diff --git a/.fernignore b/.fernignore index 34a8b8a0e..4afbcfbf5 100644 --- a/.fernignore +++ b/.fernignore @@ -5,4 +5,5 @@ LICENSE.md # Patch -src/main/java/com/merge/api/core/MergeApiApiError.java \ No newline at end of file +src/main/java/com/merge/api/core/MergeApiApiError.java +src/main/java/com/merge/legacy \ No newline at end of file diff --git a/src/main/java/com/merge/api/core/MergeApiApiError.java b/src/main/java/com/merge/api/core/MergeApiApiError.java index bbb9826c3..e16d6fd46 100644 --- a/src/main/java/com/merge/api/core/MergeApiApiError.java +++ b/src/main/java/com/merge/api/core/MergeApiApiError.java @@ -1,6 +1,6 @@ /** * This file was auto-generated by Fern from our API Definition. - * + * * NOTE: Do NOT use this class. `ApiError` is the class that should * be used. This class is just included for backwards compatibility * purposes. @@ -47,4 +47,4 @@ public String toString() { return "MergeApiApiError{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: " + body + "}"; } -} \ No newline at end of file +} diff --git a/src/main/java/com/merge/legacy/api/MergeApiClient.java b/src/main/java/com/merge/legacy/api/MergeApiClient.java new file mode 100644 index 000000000..c82a42fcc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/MergeApiClient.java @@ -0,0 +1,68 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api; + +import com.merge.legacy.api.core.ClientOptions; +import com.merge.legacy.api.core.Suppliers; +import com.merge.legacy.api.resources.accounting.AccountingClient; +import com.merge.legacy.api.resources.ats.AtsClient; +import com.merge.legacy.api.resources.crm.CrmClient; +import com.merge.legacy.api.resources.filestorage.FilestorageClient; +import com.merge.legacy.api.resources.hris.HrisClient; +import com.merge.legacy.api.resources.ticketing.TicketingClient; +import java.util.function.Supplier; + +public class MergeApiClient { + protected final ClientOptions clientOptions; + + protected final Supplier atsClient; + + protected final Supplier crmClient; + + protected final Supplier filestorageClient; + + protected final Supplier ticketingClient; + + protected final Supplier hrisClient; + + protected final Supplier accountingClient; + + public MergeApiClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.atsClient = Suppliers.memoize(() -> new AtsClient(clientOptions)); + this.crmClient = Suppliers.memoize(() -> new CrmClient(clientOptions)); + this.filestorageClient = Suppliers.memoize(() -> new FilestorageClient(clientOptions)); + this.ticketingClient = Suppliers.memoize(() -> new TicketingClient(clientOptions)); + this.hrisClient = Suppliers.memoize(() -> new HrisClient(clientOptions)); + this.accountingClient = Suppliers.memoize(() -> new AccountingClient(clientOptions)); + } + + public AtsClient ats() { + return this.atsClient.get(); + } + + public CrmClient crm() { + return this.crmClient.get(); + } + + public FilestorageClient filestorage() { + return this.filestorageClient.get(); + } + + public TicketingClient ticketing() { + return this.ticketingClient.get(); + } + + public HrisClient hris() { + return this.hrisClient.get(); + } + + public AccountingClient accounting() { + return this.accountingClient.get(); + } + + public static MergeApiClientBuilder builder() { + return new MergeApiClientBuilder(); + } +} diff --git a/src/main/java/com/merge/legacy/api/MergeApiClientBuilder.java b/src/main/java/com/merge/legacy/api/MergeApiClientBuilder.java new file mode 100644 index 000000000..14390562b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/MergeApiClientBuilder.java @@ -0,0 +1,63 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api; + +import com.merge.legacy.api.core.ClientOptions; +import com.merge.legacy.api.core.Environment; + +public final class MergeApiClientBuilder { + private ClientOptions.Builder clientOptionsBuilder = ClientOptions.builder(); + + private String apiKey = null; + + private String accountToken = null; + + private Environment environment = Environment.PRODUCTION; + + /** + * Sets apiKey + */ + public MergeApiClientBuilder apiKey(String apiKey) { + this.apiKey = apiKey; + return this; + } + + /** + * Sets accountToken + */ + public MergeApiClientBuilder accountToken(String accountToken) { + this.accountToken = accountToken; + return this; + } + + public MergeApiClientBuilder environment(Environment environment) { + this.environment = environment; + return this; + } + + public MergeApiClientBuilder url(String url) { + this.environment = Environment.custom(url); + return this; + } + + /** + * Sets the timeout (in seconds) for the client + */ + public MergeApiClientBuilder timeout(int timeout) { + this.clientOptionsBuilder.timeout(timeout); + return this; + } + + public com.merge.legacy.api.MergeApiClient 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 MergeApiClient(clientOptionsBuilder.build()); + } +} diff --git a/src/main/java/com/merge/legacy/api/core/ApiError.java b/src/main/java/com/merge/legacy/api/core/ApiError.java new file mode 100644 index 000000000..ad0b93b99 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/core/ApiError.java @@ -0,0 +1,44 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.core; + +/** + * This exception type will be thrown for any non-2XX API responses. + */ +public class ApiError extends MergeException { + /** + * The error code of the response that triggered the exception. + */ + private final int statusCode; + + /** + * The body of the response that triggered the exception. + */ + private final Object body; + + public ApiError(String message, int statusCode, Object body) { + super(message); + this.statusCode = statusCode; + this.body = body; + } + + /** + * @return the statusCode + */ + public int statusCode() { + return this.statusCode; + } + + /** + * @return the body + */ + public Object body() { + return this.body; + } + + @Override + public String toString() { + return "ApiError{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: " + body + "}"; + } +} diff --git a/src/main/java/com/merge/legacy/api/core/ClientOptions.java b/src/main/java/com/merge/legacy/api/core/ClientOptions.java new file mode 100644 index 000000000..a5a7bb748 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/core/ClientOptions.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.core; + +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; +import okhttp3.OkHttpClient; + +public final class ClientOptions { + private final Environment environment; + + private final Map headers; + + private final Map> headerSuppliers; + + private final OkHttpClient httpClient; + + private final int timeout; + + private ClientOptions( + Environment environment, + Map headers, + Map> headerSuppliers, + OkHttpClient httpClient, + int timeout) { + this.environment = environment; + this.headers = new HashMap<>(); + this.headers.putAll(headers); + this.headers.putAll(new HashMap() { + { + put("X-Fern-Language", "JAVA"); + put("X-Fern-SDK-Name", "com.merge.fern:api-sdk"); + put("X-Fern-SDK-Version", "1.1.1"); + } + }); + this.headerSuppliers = headerSuppliers; + this.httpClient = httpClient; + this.timeout = timeout; + } + + public Environment environment() { + return this.environment; + } + + public Map headers(RequestOptions requestOptions) { + Map values = new HashMap<>(this.headers); + headerSuppliers.forEach((key, supplier) -> { + values.put(key, supplier.get()); + }); + if (requestOptions != null) { + values.putAll(requestOptions.getHeaders()); + } + return values; + } + + public OkHttpClient httpClient() { + return this.httpClient; + } + + public OkHttpClient httpClientWithTimeout(RequestOptions requestOptions) { + if (requestOptions == null) { + return this.httpClient; + } + return this.httpClient + .newBuilder() + .callTimeout(requestOptions.getTimeout().get(), requestOptions.getTimeoutTimeUnit()) + .connectTimeout(0, TimeUnit.SECONDS) + .writeTimeout(0, TimeUnit.SECONDS) + .readTimeout(0, TimeUnit.SECONDS) + .build(); + } + + public static Builder builder() { + return new Builder(); + } + + public static final class Builder { + private Environment environment; + + private final Map headers = new HashMap<>(); + + private final Map> headerSuppliers = new HashMap<>(); + + private int timeout = 60; + + public Builder environment(Environment environment) { + this.environment = environment; + 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; + } + + /** + * Override the timeout in seconds. Defaults to 60 seconds. + */ + public Builder timeout(int timeout) { + this.timeout = timeout; + 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); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/core/DateTimeDeserializer.java b/src/main/java/com/merge/legacy/api/core/DateTimeDeserializer.java new file mode 100644 index 000000000..04f28415a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/core/DateTimeDeserializer.java @@ -0,0 +1,55 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.core; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.module.SimpleModule; +import java.io.IOException; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.time.format.DateTimeFormatter; +import java.time.temporal.TemporalAccessor; +import java.time.temporal.TemporalQueries; + +/** + * Custom deserializer that handles converting ISO8601 dates into {@link OffsetDateTime} objects. + */ +class DateTimeDeserializer extends JsonDeserializer { + private static final SimpleModule MODULE; + + static { + MODULE = new SimpleModule().addDeserializer(OffsetDateTime.class, new DateTimeDeserializer()); + } + + /** + * Gets a module wrapping this deserializer as an adapter for the Jackson ObjectMapper. + * + * @return A {@link SimpleModule} to be plugged onto Jackson ObjectMapper. + */ + public static SimpleModule getModule() { + return MODULE; + } + + @Override + public OffsetDateTime deserialize(JsonParser parser, DeserializationContext context) throws IOException { + JsonToken token = parser.currentToken(); + if (token == JsonToken.VALUE_NUMBER_INT) { + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(parser.getValueAsLong()), ZoneOffset.UTC); + } else { + TemporalAccessor temporal = DateTimeFormatter.ISO_DATE_TIME.parseBest( + parser.getValueAsString(), OffsetDateTime::from, LocalDateTime::from); + + if (temporal.query(TemporalQueries.offset()) == null) { + return LocalDateTime.from(temporal).atOffset(ZoneOffset.UTC); + } else { + return OffsetDateTime.from(temporal); + } + } + } +} diff --git a/src/main/java/com/merge/legacy/api/core/Environment.java b/src/main/java/com/merge/legacy/api/core/Environment.java new file mode 100644 index 000000000..f82bf0828 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/core/Environment.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.core; + +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"); + + 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; + } + + public static Environment custom(String url) { + return new Environment(url); + } +} diff --git a/src/main/java/com/merge/legacy/api/core/FileStream.java b/src/main/java/com/merge/legacy/api/core/FileStream.java new file mode 100644 index 000000000..84679afc3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/core/FileStream.java @@ -0,0 +1,60 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.core; + +import java.io.InputStream; +import java.util.Objects; +import okhttp3.MediaType; +import okhttp3.RequestBody; +import org.jetbrains.annotations.Nullable; + +/** + * Represents a file stream with associated metadata for file uploads. + */ +public class FileStream { + private final InputStream inputStream; + private final String fileName; + private final MediaType contentType; + + /** + * Constructs a FileStream with the given input stream and optional metadata. + * + * @param inputStream The input stream of the file content. Must not be null. + * @param fileName The name of the file, or null if unknown. + * @param contentType The MIME type of the file content, or null if unknown. + * @throws NullPointerException if inputStream is null + */ + public FileStream(InputStream inputStream, @Nullable String fileName, @Nullable MediaType contentType) { + this.inputStream = Objects.requireNonNull(inputStream, "Input stream cannot be null"); + this.fileName = fileName; + this.contentType = contentType; + } + + public FileStream(InputStream inputStream) { + this(inputStream, null, null); + } + + public InputStream getInputStream() { + return inputStream; + } + + @Nullable + public String getFileName() { + return fileName; + } + + @Nullable + public MediaType getContentType() { + return contentType; + } + + /** + * Creates a RequestBody suitable for use with OkHttp client. + * + * @return A RequestBody instance representing this file stream. + */ + public RequestBody toRequestBody() { + return new InputStreamRequestBody(contentType, inputStream); + } +} diff --git a/src/main/java/com/merge/legacy/api/core/InputStreamRequestBody.java b/src/main/java/com/merge/legacy/api/core/InputStreamRequestBody.java new file mode 100644 index 000000000..3751c4327 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/core/InputStreamRequestBody.java @@ -0,0 +1,79 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.core; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Objects; +import okhttp3.MediaType; +import okhttp3.RequestBody; +import okhttp3.internal.Util; +import okio.BufferedSink; +import okio.Okio; +import okio.Source; +import org.jetbrains.annotations.Nullable; + +/** + * A custom implementation of OkHttp's RequestBody that wraps an InputStream. + * This class allows streaming of data from an InputStream directly to an HTTP request body, + * which is useful for file uploads or sending large amounts of data without loading it all into memory. + */ +public class InputStreamRequestBody extends RequestBody { + private final InputStream inputStream; + private final MediaType contentType; + + /** + * Constructs an InputStreamRequestBody with the specified content type and input stream. + * + * @param contentType the MediaType of the content, or null if not known + * @param inputStream the InputStream containing the data to be sent + * @throws NullPointerException if inputStream is null + */ + public InputStreamRequestBody(@Nullable MediaType contentType, InputStream inputStream) { + this.contentType = contentType; + this.inputStream = Objects.requireNonNull(inputStream, "inputStream == null"); + } + + /** + * Returns the content type of this request body. + * + * @return the MediaType of the content, or null if not specified + */ + @Nullable + @Override + public MediaType contentType() { + return contentType; + } + + /** + * Returns the content length of this request body, if known. + * This method attempts to determine the length using the InputStream's available() method, + * which may not always accurately reflect the total length of the stream. + * + * @return the content length, or -1 if the length is unknown + * @throws IOException if an I/O error occurs + */ + @Override + public long contentLength() throws IOException { + return inputStream.available() == 0 ? -1 : inputStream.available(); + } + + /** + * Writes the content of the InputStream to the given BufferedSink. + * This method is responsible for transferring the data from the InputStream to the network request. + * + * @param sink the BufferedSink to write the content to + * @throws IOException if an I/O error occurs during writing + */ + @Override + public void writeTo(BufferedSink sink) throws IOException { + Source source = null; + try { + source = Okio.source(inputStream); + sink.writeAll(source); + } finally { + Util.closeQuietly(Objects.requireNonNull(source)); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/core/MediaTypes.java b/src/main/java/com/merge/legacy/api/core/MediaTypes.java new file mode 100644 index 000000000..f51be292d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/core/MediaTypes.java @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.core; + +import okhttp3.MediaType; + +public final class MediaTypes { + + public static final MediaType APPLICATION_JSON = MediaType.parse("application/json"); + + private MediaTypes() {} +} diff --git a/src/main/java/com/merge/legacy/api/core/MergeException.java b/src/main/java/com/merge/legacy/api/core/MergeException.java new file mode 100644 index 000000000..35d3a7d1b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/core/MergeException.java @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.core; + +/** + * This class serves as the base exception for all errors in the SDK. + */ +public class MergeException extends RuntimeException { + public MergeException(String message) { + super(message); + } + + public MergeException(String message, Exception e) { + super(message, e); + } +} diff --git a/src/main/java/com/merge/legacy/api/core/ObjectMappers.java b/src/main/java/com/merge/legacy/api/core/ObjectMappers.java new file mode 100644 index 000000000..3a2137a6d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/core/ObjectMappers.java @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.core; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.databind.json.JsonMapper; +import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import java.io.IOException; + +public final class ObjectMappers { + public static final ObjectMapper JSON_MAPPER = JsonMapper.builder() + .addModule(new Jdk8Module()) + .addModule(new JavaTimeModule()) + .addModule(com.merge.legacy.api.core.DateTimeDeserializer.getModule()) + .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) + .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .build(); + + private ObjectMappers() {} + + public static String stringify(Object o) { + try { + return JSON_MAPPER + .setSerializationInclusion(JsonInclude.Include.ALWAYS) + .writerWithDefaultPrettyPrinter() + .writeValueAsString(o); + } catch (IOException e) { + return o.getClass().getName() + "@" + Integer.toHexString(o.hashCode()); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/core/RequestOptions.java b/src/main/java/com/merge/legacy/api/core/RequestOptions.java new file mode 100644 index 000000000..00d96cf21 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/core/RequestOptions.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.core; + +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.TimeUnit; + +public final class RequestOptions { + private final String apiKey; + + private final String accountToken; + + private final Optional timeout; + + private final TimeUnit timeoutTimeUnit; + + private RequestOptions(String apiKey, String accountToken, Optional timeout, TimeUnit timeoutTimeUnit) { + this.apiKey = apiKey; + this.accountToken = accountToken; + this.timeout = timeout; + this.timeoutTimeUnit = timeoutTimeUnit; + } + + public Optional getTimeout() { + return timeout; + } + + public TimeUnit getTimeoutTimeUnit() { + return timeoutTimeUnit; + } + + public Map getHeaders() { + Map headers = new HashMap<>(); + if (this.apiKey != null) { + headers.put("Authorization", "Bearer " + this.apiKey); + } + if (this.accountToken != null) { + headers.put("X-Account-Token", this.accountToken); + } + return headers; + } + + public static Builder builder() { + return new Builder(); + } + + public static final class Builder { + private String apiKey = null; + + private String accountToken = null; + + private Optional timeout = Optional.empty(); + + private TimeUnit timeoutTimeUnit = TimeUnit.SECONDS; + + public Builder apiKey(String apiKey) { + this.apiKey = apiKey; + return this; + } + + public Builder accountToken(String accountToken) { + this.accountToken = accountToken; + return this; + } + + public Builder timeout(Integer timeout) { + this.timeout = Optional.of(timeout); + return this; + } + + public Builder timeout(Integer timeout, TimeUnit timeoutTimeUnit) { + this.timeout = Optional.of(timeout); + this.timeoutTimeUnit = timeoutTimeUnit; + return this; + } + + public RequestOptions build() { + return new RequestOptions(apiKey, accountToken, timeout, timeoutTimeUnit); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/core/ResponseBodyInputStream.java b/src/main/java/com/merge/legacy/api/core/ResponseBodyInputStream.java new file mode 100644 index 000000000..64047f289 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/core/ResponseBodyInputStream.java @@ -0,0 +1,45 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.core; + +import java.io.FilterInputStream; +import java.io.IOException; +import okhttp3.Response; + +/** + * A custom InputStream that wraps the InputStream from the OkHttp Response and ensures that the + * OkHttp Response object is properly closed when the stream is closed. + * + * This class extends FilterInputStream and takes an OkHttp Response object as a parameter. + * It retrieves the InputStream from the Response and overrides the close method to close + * both the InputStream and the Response object, ensuring proper resource management and preventing + * premature closure of the underlying HTTP connection. + */ +public class ResponseBodyInputStream extends FilterInputStream { + private final Response response; + + /** + * Constructs a ResponseBodyInputStream that wraps the InputStream from the given OkHttp + * Response object. + * + * @param response the OkHttp Response object from which the InputStream is retrieved + * @throws IOException if an I/O error occurs while retrieving the InputStream + */ + public ResponseBodyInputStream(Response response) throws IOException { + super(response.body().byteStream()); + this.response = response; + } + + /** + * Closes the InputStream and the associated OkHttp Response object. This ensures that the + * underlying HTTP connection is properly closed after the stream is no longer needed. + * + * @throws IOException if an I/O error occurs + */ + @Override + public void close() throws IOException { + super.close(); + response.close(); // Ensure the response is closed when the stream is closed + } +} diff --git a/src/main/java/com/merge/legacy/api/core/ResponseBodyReader.java b/src/main/java/com/merge/legacy/api/core/ResponseBodyReader.java new file mode 100644 index 000000000..1017eb411 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/core/ResponseBodyReader.java @@ -0,0 +1,44 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.core; + +import java.io.FilterReader; +import java.io.IOException; +import okhttp3.Response; + +/** + * A custom Reader that wraps the Reader from the OkHttp Response and ensures that the + * OkHttp Response object is properly closed when the reader is closed. + * + * This class extends FilterReader and takes an OkHttp Response object as a parameter. + * It retrieves the Reader from the Response and overrides the close method to close + * both the Reader and the Response object, ensuring proper resource management and preventing + * premature closure of the underlying HTTP connection. + */ +public class ResponseBodyReader extends FilterReader { + private final Response response; + + /** + * Constructs a ResponseBodyReader that wraps the Reader from the given OkHttp Response object. + * + * @param response the OkHttp Response object from which the Reader is retrieved + * @throws IOException if an I/O error occurs while retrieving the Reader + */ + public ResponseBodyReader(Response response) throws IOException { + super(response.body().charStream()); + this.response = response; + } + + /** + * Closes the Reader and the associated OkHttp Response object. This ensures that the + * underlying HTTP connection is properly closed after the reader is no longer needed. + * + * @throws IOException if an I/O error occurs + */ + @Override + public void close() throws IOException { + super.close(); + response.close(); // Ensure the response is closed when the reader is closed + } +} diff --git a/src/main/java/com/merge/legacy/api/core/RetryInterceptor.java b/src/main/java/com/merge/legacy/api/core/RetryInterceptor.java new file mode 100644 index 000000000..51df0e474 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/core/RetryInterceptor.java @@ -0,0 +1,78 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.core; + +import java.io.IOException; +import java.time.Duration; +import java.util.Optional; +import java.util.Random; +import okhttp3.Interceptor; +import okhttp3.Response; + +public class RetryInterceptor implements Interceptor { + + private static final Duration ONE_SECOND = Duration.ofSeconds(1); + private final ExponentialBackoff backoff; + private final Random random = new Random(); + + public RetryInterceptor(int maxRetries) { + this.backoff = new ExponentialBackoff(maxRetries); + } + + @Override + public Response intercept(Chain chain) throws IOException { + Response response = chain.proceed(chain.request()); + + if (shouldRetry(response.code())) { + return retryChain(response, chain); + } + + return response; + } + + private Response retryChain(Response response, Chain chain) throws IOException { + Optional nextBackoff = this.backoff.nextBackoff(); + while (nextBackoff.isPresent()) { + try { + Thread.sleep(nextBackoff.get().toMillis()); + } catch (InterruptedException e) { + throw new IOException("Interrupted while trying request", e); + } + response.close(); + response = chain.proceed(chain.request()); + if (shouldRetry(response.code())) { + nextBackoff = this.backoff.nextBackoff(); + } else { + return response; + } + } + + return response; + } + + private static boolean shouldRetry(int statusCode) { + return statusCode == 408 || statusCode == 409 || statusCode == 429 || statusCode >= 500; + } + + private final class ExponentialBackoff { + + private final int maxNumRetries; + + private int retryNumber = 0; + + ExponentialBackoff(int maxNumRetries) { + this.maxNumRetries = maxNumRetries; + } + + public Optional nextBackoff() { + retryNumber += 1; + if (retryNumber > maxNumRetries) { + return Optional.empty(); + } + + int upperBound = (int) Math.pow(2, retryNumber); + return Optional.of(ONE_SECOND.multipliedBy(random.nextInt(upperBound))); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/core/Stream.java b/src/main/java/com/merge/legacy/api/core/Stream.java new file mode 100644 index 000000000..fa7e3e905 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/core/Stream.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.core; + +import com.merge.api.core.ObjectMappers; +import java.io.Reader; +import java.util.Iterator; +import java.util.NoSuchElementException; +import java.util.Scanner; + +/** + * The {@code Stream} class implmenets {@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 + * {@code Scanner} to block during iteration if the next object is not available. + * + * @param The type of objects in the stream. + */ +public final class Stream implements Iterable { + /** + * The {@link Class} of the objects in the stream. + */ + private final Class valueType; + /** + * The {@link Scanner} used for reading from the input stream and blocking when neede during iteration. + */ + private final Scanner scanner; + + /** + * Constructs a new {@code Stream} with the specified value type, reader, and delimiter. + * + * @param valueType The class of the objects in the stream. + * @param reader The reader that provides the streamed data. + * @param delimiter The delimiter used to separate elements in the stream. + */ + public Stream(Class valueType, Reader reader, String delimiter) { + this.scanner = new Scanner(reader).useDelimiter(delimiter); + this.valueType = valueType; + } + + /** + * Returns an iterator over the elements in this stream that blocks during iteration when the next object is + * not yet available. + * + * @return An iterator that can be used to traverse the elements in the stream. + */ + @Override + public Iterator iterator() { + return new Iterator() { + /** + * Returns {@code true} if there are more elements in the stream. + *

+ * Will block and wait for input if the stream has not ended and the next object is not yet available. + * + * @return {@code true} if there are more elements, {@code false} otherwise. + */ + @Override + public boolean hasNext() { + return scanner.hasNext(); + } + + /** + * Returns the next element in the stream. + *

+ * Will block and wait for input if the stream has not ended and the next object is not yet available. + * + * @return The next element in the stream. + * @throws NoSuchElementException If there are no more elements in the stream. + */ + @Override + public T next() { + if (!scanner.hasNext()) { + throw new NoSuchElementException(); + } else { + try { + T parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + scanner.next().trim(), valueType); + return parsedResponse; + } catch (Exception e) { + throw new RuntimeException(e); + } + } + } + + /** + * Removing elements from {@code Stream} is not supported. + * + * @throws UnsupportedOperationException Always, as removal is not supported. + */ + @Override + public void remove() { + throw new UnsupportedOperationException(); + } + }; + } +} diff --git a/src/main/java/com/merge/legacy/api/core/Suppliers.java b/src/main/java/com/merge/legacy/api/core/Suppliers.java new file mode 100644 index 000000000..f7d3f28ed --- /dev/null +++ b/src/main/java/com/merge/legacy/api/core/Suppliers.java @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.core; + +import java.util.Objects; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Supplier; + +public final class Suppliers { + private Suppliers() {} + + public static Supplier memoize(Supplier delegate) { + AtomicReference value = new AtomicReference<>(); + return () -> { + T val = value.get(); + if (val == null) { + val = value.updateAndGet(cur -> cur == null ? Objects.requireNonNull(delegate.get()) : cur); + } + return val; + }; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/AccountingClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/AccountingClient.java new file mode 100644 index 000000000..22156ccb0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/AccountingClient.java @@ -0,0 +1,361 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting; + +import com.merge.legacy.api.core.ClientOptions; +import com.merge.legacy.api.core.Suppliers; +import com.merge.legacy.api.resources.accounting.accountdetails.AccountDetailsClient; +import com.merge.legacy.api.resources.accounting.accountingperiods.AccountingPeriodsClient; +import com.merge.legacy.api.resources.accounting.accounts.AccountsClient; +import com.merge.legacy.api.resources.accounting.accounttoken.AccountTokenClient; +import com.merge.legacy.api.resources.accounting.addresses.AddressesClient; +import com.merge.legacy.api.resources.accounting.asyncpassthrough.AsyncPassthroughClient; +import com.merge.legacy.api.resources.accounting.asynctasks.AsyncTasksClient; +import com.merge.legacy.api.resources.accounting.attachments.AttachmentsClient; +import com.merge.legacy.api.resources.accounting.audittrail.AuditTrailClient; +import com.merge.legacy.api.resources.accounting.availableactions.AvailableActionsClient; +import com.merge.legacy.api.resources.accounting.balancesheets.BalanceSheetsClient; +import com.merge.legacy.api.resources.accounting.bankfeedaccounts.BankFeedAccountsClient; +import com.merge.legacy.api.resources.accounting.bankfeedtransactions.BankFeedTransactionsClient; +import com.merge.legacy.api.resources.accounting.cashflowstatements.CashFlowStatementsClient; +import com.merge.legacy.api.resources.accounting.companyinfo.CompanyInfoClient; +import com.merge.legacy.api.resources.accounting.contacts.ContactsClient; +import com.merge.legacy.api.resources.accounting.creditnotes.CreditNotesClient; +import com.merge.legacy.api.resources.accounting.deleteaccount.DeleteAccountClient; +import com.merge.legacy.api.resources.accounting.employees.EmployeesClient; +import com.merge.legacy.api.resources.accounting.expenses.ExpensesClient; +import com.merge.legacy.api.resources.accounting.fieldmapping.FieldMappingClient; +import com.merge.legacy.api.resources.accounting.forceresync.ForceResyncClient; +import com.merge.legacy.api.resources.accounting.generalledgertransactions.GeneralLedgerTransactionsClient; +import com.merge.legacy.api.resources.accounting.generatekey.GenerateKeyClient; +import com.merge.legacy.api.resources.accounting.incomestatements.IncomeStatementsClient; +import com.merge.legacy.api.resources.accounting.invoices.InvoicesClient; +import com.merge.legacy.api.resources.accounting.issues.IssuesClient; +import com.merge.legacy.api.resources.accounting.items.ItemsClient; +import com.merge.legacy.api.resources.accounting.journalentries.JournalEntriesClient; +import com.merge.legacy.api.resources.accounting.linkedaccounts.LinkedAccountsClient; +import com.merge.legacy.api.resources.accounting.linktoken.LinkTokenClient; +import com.merge.legacy.api.resources.accounting.passthrough.PassthroughClient; +import com.merge.legacy.api.resources.accounting.payments.PaymentsClient; +import com.merge.legacy.api.resources.accounting.phonenumbers.PhoneNumbersClient; +import com.merge.legacy.api.resources.accounting.purchaseorders.PurchaseOrdersClient; +import com.merge.legacy.api.resources.accounting.regeneratekey.RegenerateKeyClient; +import com.merge.legacy.api.resources.accounting.scopes.ScopesClient; +import com.merge.legacy.api.resources.accounting.syncstatus.SyncStatusClient; +import com.merge.legacy.api.resources.accounting.taxrates.TaxRatesClient; +import com.merge.legacy.api.resources.accounting.trackingcategories.TrackingCategoriesClient; +import com.merge.legacy.api.resources.accounting.transactions.TransactionsClient; +import com.merge.legacy.api.resources.accounting.vendorcredits.VendorCreditsClient; +import com.merge.legacy.api.resources.accounting.webhookreceivers.WebhookReceiversClient; +import java.util.function.Supplier; + +public class AccountingClient { + 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 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 AccountingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.accountDetailsClient = Suppliers.memoize(() -> new AccountDetailsClient(clientOptions)); + this.accountTokenClient = Suppliers.memoize(() -> new AccountTokenClient(clientOptions)); + this.accountingPeriodsClient = Suppliers.memoize(() -> new AccountingPeriodsClient(clientOptions)); + this.accountsClient = Suppliers.memoize(() -> new AccountsClient(clientOptions)); + this.addressesClient = Suppliers.memoize(() -> new AddressesClient(clientOptions)); + this.asyncPassthroughClient = Suppliers.memoize(() -> new AsyncPassthroughClient(clientOptions)); + this.asyncTasksClient = Suppliers.memoize(() -> new AsyncTasksClient(clientOptions)); + this.attachmentsClient = Suppliers.memoize(() -> new AttachmentsClient(clientOptions)); + this.auditTrailClient = Suppliers.memoize(() -> new AuditTrailClient(clientOptions)); + this.availableActionsClient = Suppliers.memoize(() -> new AvailableActionsClient(clientOptions)); + this.balanceSheetsClient = Suppliers.memoize(() -> new BalanceSheetsClient(clientOptions)); + this.bankFeedAccountsClient = Suppliers.memoize(() -> new BankFeedAccountsClient(clientOptions)); + this.bankFeedTransactionsClient = Suppliers.memoize(() -> new BankFeedTransactionsClient(clientOptions)); + this.cashFlowStatementsClient = Suppliers.memoize(() -> new CashFlowStatementsClient(clientOptions)); + this.companyInfoClient = Suppliers.memoize(() -> new CompanyInfoClient(clientOptions)); + this.contactsClient = Suppliers.memoize(() -> new ContactsClient(clientOptions)); + this.creditNotesClient = Suppliers.memoize(() -> new CreditNotesClient(clientOptions)); + this.scopesClient = Suppliers.memoize(() -> new ScopesClient(clientOptions)); + this.deleteAccountClient = Suppliers.memoize(() -> new DeleteAccountClient(clientOptions)); + this.employeesClient = Suppliers.memoize(() -> new EmployeesClient(clientOptions)); + this.expensesClient = Suppliers.memoize(() -> new ExpensesClient(clientOptions)); + this.fieldMappingClient = Suppliers.memoize(() -> new FieldMappingClient(clientOptions)); + this.generalLedgerTransactionsClient = + Suppliers.memoize(() -> new GeneralLedgerTransactionsClient(clientOptions)); + this.generateKeyClient = Suppliers.memoize(() -> new GenerateKeyClient(clientOptions)); + this.incomeStatementsClient = Suppliers.memoize(() -> new IncomeStatementsClient(clientOptions)); + this.invoicesClient = Suppliers.memoize(() -> new InvoicesClient(clientOptions)); + this.issuesClient = Suppliers.memoize(() -> new IssuesClient(clientOptions)); + this.itemsClient = Suppliers.memoize(() -> new ItemsClient(clientOptions)); + this.journalEntriesClient = Suppliers.memoize(() -> new JournalEntriesClient(clientOptions)); + this.linkTokenClient = Suppliers.memoize(() -> new LinkTokenClient(clientOptions)); + this.linkedAccountsClient = Suppliers.memoize(() -> new LinkedAccountsClient(clientOptions)); + this.passthroughClient = Suppliers.memoize(() -> new PassthroughClient(clientOptions)); + this.paymentsClient = Suppliers.memoize(() -> new PaymentsClient(clientOptions)); + this.phoneNumbersClient = Suppliers.memoize(() -> new PhoneNumbersClient(clientOptions)); + this.purchaseOrdersClient = Suppliers.memoize(() -> new PurchaseOrdersClient(clientOptions)); + this.regenerateKeyClient = Suppliers.memoize(() -> new RegenerateKeyClient(clientOptions)); + this.syncStatusClient = Suppliers.memoize(() -> new SyncStatusClient(clientOptions)); + this.forceResyncClient = Suppliers.memoize(() -> new ForceResyncClient(clientOptions)); + this.taxRatesClient = Suppliers.memoize(() -> new TaxRatesClient(clientOptions)); + this.trackingCategoriesClient = Suppliers.memoize(() -> new TrackingCategoriesClient(clientOptions)); + this.transactionsClient = Suppliers.memoize(() -> new TransactionsClient(clientOptions)); + this.vendorCreditsClient = Suppliers.memoize(() -> new VendorCreditsClient(clientOptions)); + this.webhookReceiversClient = Suppliers.memoize(() -> new WebhookReceiversClient(clientOptions)); + } + + public AccountDetailsClient accountDetails() { + return this.accountDetailsClient.get(); + } + + public AccountTokenClient accountToken() { + return this.accountTokenClient.get(); + } + + public AccountingPeriodsClient accountingPeriods() { + return this.accountingPeriodsClient.get(); + } + + public AccountsClient accounts() { + return this.accountsClient.get(); + } + + public AddressesClient addresses() { + return this.addressesClient.get(); + } + + public AsyncPassthroughClient asyncPassthrough() { + return this.asyncPassthroughClient.get(); + } + + public AsyncTasksClient asyncTasks() { + return this.asyncTasksClient.get(); + } + + public AttachmentsClient attachments() { + return this.attachmentsClient.get(); + } + + public AuditTrailClient auditTrail() { + return this.auditTrailClient.get(); + } + + public AvailableActionsClient availableActions() { + return this.availableActionsClient.get(); + } + + public BalanceSheetsClient balanceSheets() { + return this.balanceSheetsClient.get(); + } + + public BankFeedAccountsClient bankFeedAccounts() { + return this.bankFeedAccountsClient.get(); + } + + public BankFeedTransactionsClient bankFeedTransactions() { + return this.bankFeedTransactionsClient.get(); + } + + public CashFlowStatementsClient cashFlowStatements() { + return this.cashFlowStatementsClient.get(); + } + + public CompanyInfoClient companyInfo() { + return this.companyInfoClient.get(); + } + + public ContactsClient contacts() { + return this.contactsClient.get(); + } + + public CreditNotesClient creditNotes() { + return this.creditNotesClient.get(); + } + + public ScopesClient scopes() { + return this.scopesClient.get(); + } + + public DeleteAccountClient deleteAccount() { + return this.deleteAccountClient.get(); + } + + public EmployeesClient employees() { + return this.employeesClient.get(); + } + + public ExpensesClient expenses() { + return this.expensesClient.get(); + } + + public FieldMappingClient fieldMapping() { + return this.fieldMappingClient.get(); + } + + public GeneralLedgerTransactionsClient generalLedgerTransactions() { + return this.generalLedgerTransactionsClient.get(); + } + + public GenerateKeyClient generateKey() { + return this.generateKeyClient.get(); + } + + public IncomeStatementsClient incomeStatements() { + return this.incomeStatementsClient.get(); + } + + public InvoicesClient invoices() { + return this.invoicesClient.get(); + } + + public IssuesClient issues() { + return this.issuesClient.get(); + } + + public ItemsClient items() { + return this.itemsClient.get(); + } + + public JournalEntriesClient journalEntries() { + return this.journalEntriesClient.get(); + } + + public LinkTokenClient linkToken() { + return this.linkTokenClient.get(); + } + + public LinkedAccountsClient linkedAccounts() { + return this.linkedAccountsClient.get(); + } + + public PassthroughClient passthrough() { + return this.passthroughClient.get(); + } + + public PaymentsClient payments() { + return this.paymentsClient.get(); + } + + public PhoneNumbersClient phoneNumbers() { + return this.phoneNumbersClient.get(); + } + + public PurchaseOrdersClient purchaseOrders() { + return this.purchaseOrdersClient.get(); + } + + public RegenerateKeyClient regenerateKey() { + return this.regenerateKeyClient.get(); + } + + public SyncStatusClient syncStatus() { + return this.syncStatusClient.get(); + } + + public ForceResyncClient forceResync() { + return this.forceResyncClient.get(); + } + + public TaxRatesClient taxRates() { + return this.taxRatesClient.get(); + } + + public TrackingCategoriesClient trackingCategories() { + return this.trackingCategoriesClient.get(); + } + + public TransactionsClient transactions() { + return this.transactionsClient.get(); + } + + public VendorCreditsClient vendorCredits() { + return this.vendorCreditsClient.get(); + } + + public WebhookReceiversClient webhookReceivers() { + return this.webhookReceiversClient.get(); + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/accountdetails/AccountDetailsClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/accountdetails/AccountDetailsClient.java new file mode 100644 index 000000000..c08b6cc2c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/accountdetails/AccountDetailsClient.java @@ -0,0 +1,58 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.accountdetails; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.types.AccountDetails; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/accountingperiods/AccountingPeriodsClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/accountingperiods/AccountingPeriodsClient.java new file mode 100644 index 000000000..d6c298de3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/accountingperiods/AccountingPeriodsClient.java @@ -0,0 +1,139 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.accountingperiods; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.accountingperiods.requests.AccountingPeriodsListRequest; +import com.merge.legacy.api.resources.accounting.accountingperiods.requests.AccountingPeriodsRetrieveRequest; +import com.merge.legacy.api.resources.accounting.types.AccountingPeriod; +import com.merge.legacy.api.resources.accounting.types.PaginatedAccountingPeriodList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/accountingperiods/requests/AccountingPeriodsListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/accountingperiods/requests/AccountingPeriodsListRequest.java new file mode 100644 index 000000000..5398a264e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/accountingperiods/requests/AccountingPeriodsListRequest.java @@ -0,0 +1,204 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.accountingperiods.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = AccountingPeriodsListRequest.Builder.class) +public final class AccountingPeriodsListRequest { + 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 AccountingPeriodsListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountingPeriodsListRequest && equalTo((AccountingPeriodsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountingPeriodsListRequest other) { + return cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && pageSize.equals(other.pageSize); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, this.includeDeletedData, this.includeRemoteData, this.includeShellData, this.pageSize); + } + + @Override + 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(AccountingPeriodsListRequest 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 AccountingPeriodsListRequest build() { + return new AccountingPeriodsListRequest( + cursor, includeDeletedData, includeRemoteData, includeShellData, pageSize, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/accountingperiods/requests/AccountingPeriodsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/accountingperiods/requests/AccountingPeriodsRetrieveRequest.java new file mode 100644 index 000000000..222ac8907 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/accountingperiods/requests/AccountingPeriodsRetrieveRequest.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.accountingperiods.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/accounting/accounts/AccountsClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/accounts/AccountsClient.java new file mode 100644 index 000000000..61b5337e3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/accounts/AccountsClient.java @@ -0,0 +1,287 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.accounts; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.accounts.requests.AccountEndpointRequest; +import com.merge.legacy.api.resources.accounting.accounts.requests.AccountsListRequest; +import com.merge.legacy.api.resources.accounting.accounts.requests.AccountsRetrieveRequest; +import com.merge.legacy.api.resources.accounting.types.Account; +import com.merge.legacy.api.resources.accounting.types.AccountResponse; +import com.merge.legacy.api.resources.accounting.types.MetaResponse; +import com.merge.legacy.api.resources.accounting.types.PaginatedAccountList; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/accounting/accounts/requests/AccountEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/accounts/requests/AccountEndpointRequest.java new file mode 100644 index 000000000..bea27c52e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/accounts/requests/AccountEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.accounts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.types.AccountRequest; +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 = AccountEndpointRequest.Builder.class) +public final class AccountEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final AccountRequest model; + + private final Map additionalProperties; + + private AccountEndpointRequest( + Optional isDebugMode, + Optional runAsync, + AccountRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public AccountRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountEndpointRequest && equalTo((AccountEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull AccountRequest model); + + Builder from(AccountEndpointRequest other); + } + + public interface _FinalStage { + AccountEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private AccountRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(AccountEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull AccountRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public AccountEndpointRequest build() { + return new AccountEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/accounts/requests/AccountsListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/accounts/requests/AccountsListRequest.java new file mode 100644 index 000000000..9ea5f4133 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/accounts/requests/AccountsListRequest.java @@ -0,0 +1,506 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.accounts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.accounts.types.AccountsListRequestRemoteFields; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/accounting/accounts/requests/AccountsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/accounts/requests/AccountsRetrieveRequest.java new file mode 100644 index 000000000..f69261cac --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/accounts/requests/AccountsRetrieveRequest.java @@ -0,0 +1,178 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.accounts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.accounts.types.AccountsRetrieveRequestRemoteFields; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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/legacy/api/resources/accounting/accounts/types/AccountsListRequestRemoteFields.java b/src/main/java/com/merge/legacy/api/resources/accounting/accounts/types/AccountsListRequestRemoteFields.java new file mode 100644 index 000000000..659bbe831 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/accounts/types/AccountsListRequestRemoteFields.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.accounts.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AccountsListRequestRemoteFields { + CLASSIFICATION("classification"), + + CLASSIFICATION_STATUS("classification,status"), + + STATUS("status"); + + private final String value; + + AccountsListRequestRemoteFields(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/accounts/types/AccountsListRequestShowEnumOrigins.java b/src/main/java/com/merge/legacy/api/resources/accounting/accounts/types/AccountsListRequestShowEnumOrigins.java new file mode 100644 index 000000000..918f84b2b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/accounts/types/AccountsListRequestShowEnumOrigins.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.accounts.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AccountsListRequestShowEnumOrigins { + CLASSIFICATION("classification"), + + CLASSIFICATION_STATUS("classification,status"), + + STATUS("status"); + + private final String value; + + AccountsListRequestShowEnumOrigins(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/accounts/types/AccountsRetrieveRequestRemoteFields.java b/src/main/java/com/merge/legacy/api/resources/accounting/accounts/types/AccountsRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..ac843fd33 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/accounts/types/AccountsRetrieveRequestRemoteFields.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.accounts.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AccountsRetrieveRequestRemoteFields { + CLASSIFICATION("classification"), + + CLASSIFICATION_STATUS("classification,status"), + + STATUS("status"); + + private final String value; + + AccountsRetrieveRequestRemoteFields(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/accounts/types/AccountsRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/legacy/api/resources/accounting/accounts/types/AccountsRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..f553a579a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/accounts/types/AccountsRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.accounts.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AccountsRetrieveRequestShowEnumOrigins { + CLASSIFICATION("classification"), + + CLASSIFICATION_STATUS("classification,status"), + + STATUS("status"); + + private final String value; + + AccountsRetrieveRequestShowEnumOrigins(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/accounttoken/AccountTokenClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/accounttoken/AccountTokenClient.java new file mode 100644 index 000000000..0541236e7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/accounttoken/AccountTokenClient.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.accounttoken; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.types.AccountToken; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/addresses/AddressesClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/addresses/AddressesClient.java new file mode 100644 index 000000000..66c806c6d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/addresses/AddressesClient.java @@ -0,0 +1,77 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.addresses; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.addresses.requests.AddressesRetrieveRequest; +import com.merge.legacy.api.resources.accounting.types.Address; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/addresses/requests/AddressesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/addresses/requests/AddressesRetrieveRequest.java new file mode 100644 index 000000000..59057a719 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/addresses/requests/AddressesRetrieveRequest.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.addresses.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = AddressesRetrieveRequest.Builder.class) +public final class AddressesRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private AddressesRetrieveRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AddressesRetrieveRequest && equalTo((AddressesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AddressesRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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(AddressesRetrieveRequest 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 AddressesRetrieveRequest build() { + return new AddressesRetrieveRequest(includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/asyncpassthrough/AsyncPassthroughClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/asyncpassthrough/AsyncPassthroughClient.java new file mode 100644 index 000000000..812171531 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/asyncpassthrough/AsyncPassthroughClient.java @@ -0,0 +1,110 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.asyncpassthrough; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.asyncpassthrough.types.AsyncPassthroughRetrieveResponse; +import com.merge.legacy.api.resources.accounting.types.AsyncPassthroughReciept; +import com.merge.legacy.api.resources.accounting.types.DataPassthroughRequest; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java b/src/main/java/com/merge/legacy/api/resources/accounting/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java new file mode 100644 index 000000000..2fc3164c2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import com.merge.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/asynctasks/AsyncTasksClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/asynctasks/AsyncTasksClient.java new file mode 100644 index 000000000..7807544f3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/asynctasks/AsyncTasksClient.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.asynctasks; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.types.AsyncPostTask; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/attachments/AttachmentsClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/attachments/AttachmentsClient.java new file mode 100644 index 000000000..bab8bbe65 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/attachments/AttachmentsClient.java @@ -0,0 +1,264 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.attachments; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.attachments.requests.AccountingAttachmentEndpointRequest; +import com.merge.legacy.api.resources.accounting.attachments.requests.AttachmentsListRequest; +import com.merge.legacy.api.resources.accounting.attachments.requests.AttachmentsRetrieveRequest; +import com.merge.legacy.api.resources.accounting.types.AccountingAttachment; +import com.merge.legacy.api.resources.accounting.types.AccountingAttachmentResponse; +import com.merge.legacy.api.resources.accounting.types.MetaResponse; +import com.merge.legacy.api.resources.accounting.types.PaginatedAccountingAttachmentList; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/accounting/attachments/requests/AccountingAttachmentEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/attachments/requests/AccountingAttachmentEndpointRequest.java new file mode 100644 index 000000000..8bcb228cb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/attachments/requests/AccountingAttachmentEndpointRequest.java @@ -0,0 +1,174 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.attachments.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.types.AccountingAttachmentRequest; +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 = AccountingAttachmentEndpointRequest.Builder.class) +public final class AccountingAttachmentEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final AccountingAttachmentRequest model; + + private final Map additionalProperties; + + private AccountingAttachmentEndpointRequest( + Optional isDebugMode, + Optional runAsync, + AccountingAttachmentRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public AccountingAttachmentRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountingAttachmentEndpointRequest + && equalTo((AccountingAttachmentEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountingAttachmentEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull AccountingAttachmentRequest model); + + Builder from(AccountingAttachmentEndpointRequest other); + } + + public interface _FinalStage { + AccountingAttachmentEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private AccountingAttachmentRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(AccountingAttachmentEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull AccountingAttachmentRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public AccountingAttachmentEndpointRequest build() { + return new AccountingAttachmentEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/attachments/requests/AttachmentsListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/attachments/requests/AttachmentsListRequest.java new file mode 100644 index 000000000..a4a48ac9c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/attachments/requests/AttachmentsListRequest.java @@ -0,0 +1,388 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.attachments.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/accounting/attachments/requests/AttachmentsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/attachments/requests/AttachmentsRetrieveRequest.java new file mode 100644 index 000000000..bea4aae3d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/attachments/requests/AttachmentsRetrieveRequest.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.attachments.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/accounting/audittrail/AuditTrailClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/audittrail/AuditTrailClient.java new file mode 100644 index 000000000..61f1a8d39 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/audittrail/AuditTrailClient.java @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.audittrail; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.audittrail.requests.AuditTrailListRequest; +import com.merge.legacy.api.resources.accounting.types.PaginatedAuditLogEventList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/audittrail/requests/AuditTrailListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/audittrail/requests/AuditTrailListRequest.java new file mode 100644 index 000000000..ab8c42f40 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/audittrail/requests/AuditTrailListRequest.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.audittrail.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.cursor, this.endDate, this.eventType, this.pageSize, this.startDate, this.userEmail); + } + + @Override + 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/legacy/api/resources/accounting/availableactions/AvailableActionsClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/availableactions/AvailableActionsClient.java new file mode 100644 index 000000000..abb92dc19 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/availableactions/AvailableActionsClient.java @@ -0,0 +1,58 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.availableactions; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.types.AvailableActions; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/balancesheets/BalanceSheetsClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/balancesheets/BalanceSheetsClient.java new file mode 100644 index 000000000..b7359ddf4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/balancesheets/BalanceSheetsClient.java @@ -0,0 +1,166 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.balancesheets; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.balancesheets.requests.BalanceSheetsListRequest; +import com.merge.legacy.api.resources.accounting.balancesheets.requests.BalanceSheetsRetrieveRequest; +import com.merge.legacy.api.resources.accounting.types.BalanceSheet; +import com.merge.legacy.api.resources.accounting.types.PaginatedBalanceSheetList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/balancesheets/requests/BalanceSheetsListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/balancesheets/requests/BalanceSheetsListRequest.java new file mode 100644 index 000000000..01faae35f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/balancesheets/requests/BalanceSheetsListRequest.java @@ -0,0 +1,417 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.balancesheets.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = BalanceSheetsListRequest.Builder.class) +public final class BalanceSheetsListRequest { + 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 remoteId; + + private final Map additionalProperties; + + private BalanceSheetsListRequest( + Optional companyId, + 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.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.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return balance sheets 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 The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BalanceSheetsListRequest && equalTo((BalanceSheetsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BalanceSheetsListRequest other) { + return 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) + && remoteId.equals(other.remoteId); + } + + @Override + public int hashCode() { + return Objects.hash( + this.companyId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @Override + 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 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(BalanceSheetsListRequest other) { + 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()); + 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 = "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 BalanceSheetsListRequest build() { + return new BalanceSheetsListRequest( + companyId, + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/balancesheets/requests/BalanceSheetsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/balancesheets/requests/BalanceSheetsRetrieveRequest.java new file mode 100644 index 000000000..464e5919b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/balancesheets/requests/BalanceSheetsRetrieveRequest.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.balancesheets.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/accounting/bankfeedaccounts/BankFeedAccountsClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/bankfeedaccounts/BankFeedAccountsClient.java new file mode 100644 index 000000000..16a152ac4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/bankfeedaccounts/BankFeedAccountsClient.java @@ -0,0 +1,240 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.bankfeedaccounts; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.bankfeedaccounts.requests.BankFeedAccountEndpointRequest; +import com.merge.legacy.api.resources.accounting.bankfeedaccounts.requests.BankFeedAccountsListRequest; +import com.merge.legacy.api.resources.accounting.bankfeedaccounts.requests.BankFeedAccountsRetrieveRequest; +import com.merge.legacy.api.resources.accounting.types.BankFeedAccount; +import com.merge.legacy.api.resources.accounting.types.BankFeedAccountResponse; +import com.merge.legacy.api.resources.accounting.types.MetaResponse; +import com.merge.legacy.api.resources.accounting.types.PaginatedBankFeedAccountList; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/accounting/bankfeedaccounts/requests/BankFeedAccountEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/bankfeedaccounts/requests/BankFeedAccountEndpointRequest.java new file mode 100644 index 000000000..41b24cfa4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/bankfeedaccounts/requests/BankFeedAccountEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.bankfeedaccounts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.types.BankFeedAccountRequest; +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 = BankFeedAccountEndpointRequest.Builder.class) +public final class BankFeedAccountEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final BankFeedAccountRequest model; + + private final Map additionalProperties; + + private BankFeedAccountEndpointRequest( + Optional isDebugMode, + Optional runAsync, + BankFeedAccountRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public BankFeedAccountRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BankFeedAccountEndpointRequest && equalTo((BankFeedAccountEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BankFeedAccountEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull BankFeedAccountRequest model); + + Builder from(BankFeedAccountEndpointRequest other); + } + + public interface _FinalStage { + BankFeedAccountEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private BankFeedAccountRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(BankFeedAccountEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull BankFeedAccountRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public BankFeedAccountEndpointRequest build() { + return new BankFeedAccountEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/bankfeedaccounts/requests/BankFeedAccountsListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/bankfeedaccounts/requests/BankFeedAccountsListRequest.java new file mode 100644 index 000000000..785170c59 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/bankfeedaccounts/requests/BankFeedAccountsListRequest.java @@ -0,0 +1,204 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.bankfeedaccounts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = BankFeedAccountsListRequest.Builder.class) +public final class BankFeedAccountsListRequest { + 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 BankFeedAccountsListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BankFeedAccountsListRequest && equalTo((BankFeedAccountsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BankFeedAccountsListRequest other) { + return cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && pageSize.equals(other.pageSize); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, this.includeDeletedData, this.includeRemoteData, this.includeShellData, this.pageSize); + } + + @Override + 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(BankFeedAccountsListRequest 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 BankFeedAccountsListRequest build() { + return new BankFeedAccountsListRequest( + cursor, includeDeletedData, includeRemoteData, includeShellData, pageSize, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/bankfeedaccounts/requests/BankFeedAccountsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/bankfeedaccounts/requests/BankFeedAccountsRetrieveRequest.java new file mode 100644 index 000000000..9aac03ade --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/bankfeedaccounts/requests/BankFeedAccountsRetrieveRequest.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.bankfeedaccounts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/accounting/bankfeedtransactions/BankFeedTransactionsClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/bankfeedtransactions/BankFeedTransactionsClient.java new file mode 100644 index 000000000..7436806fb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/bankfeedtransactions/BankFeedTransactionsClient.java @@ -0,0 +1,273 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.bankfeedtransactions; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.bankfeedtransactions.requests.BankFeedTransactionEndpointRequest; +import com.merge.legacy.api.resources.accounting.bankfeedtransactions.requests.BankFeedTransactionsListRequest; +import com.merge.legacy.api.resources.accounting.bankfeedtransactions.requests.BankFeedTransactionsRetrieveRequest; +import com.merge.legacy.api.resources.accounting.types.BankFeedTransaction; +import com.merge.legacy.api.resources.accounting.types.BankFeedTransactionResponse; +import com.merge.legacy.api.resources.accounting.types.MetaResponse; +import com.merge.legacy.api.resources.accounting.types.PaginatedBankFeedTransactionList; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/accounting/bankfeedtransactions/requests/BankFeedTransactionEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/bankfeedtransactions/requests/BankFeedTransactionEndpointRequest.java new file mode 100644 index 000000000..1072763a9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/bankfeedtransactions/requests/BankFeedTransactionEndpointRequest.java @@ -0,0 +1,174 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.bankfeedtransactions.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.types.BankFeedTransactionRequestRequest; +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 = BankFeedTransactionEndpointRequest.Builder.class) +public final class BankFeedTransactionEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final BankFeedTransactionRequestRequest model; + + private final Map additionalProperties; + + private BankFeedTransactionEndpointRequest( + Optional isDebugMode, + Optional runAsync, + BankFeedTransactionRequestRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public BankFeedTransactionRequestRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BankFeedTransactionEndpointRequest + && equalTo((BankFeedTransactionEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BankFeedTransactionEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull BankFeedTransactionRequestRequest model); + + Builder from(BankFeedTransactionEndpointRequest other); + } + + public interface _FinalStage { + BankFeedTransactionEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private BankFeedTransactionRequestRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(BankFeedTransactionEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull BankFeedTransactionRequestRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public BankFeedTransactionEndpointRequest build() { + return new BankFeedTransactionEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/bankfeedtransactions/requests/BankFeedTransactionsListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/bankfeedtransactions/requests/BankFeedTransactionsListRequest.java new file mode 100644 index 000000000..872d1402c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/bankfeedtransactions/requests/BankFeedTransactionsListRequest.java @@ -0,0 +1,417 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.bankfeedtransactions.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = BankFeedTransactionsListRequest.Builder.class) +public final class BankFeedTransactionsListRequest { + 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 isProcessed; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private BankFeedTransactionsListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional isProcessed, + 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.isProcessed = isProcessed; + 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, will only return bank feed transactions with this is_processed value + */ + @JsonProperty("is_processed") + public Optional getIsProcessed() { + return isProcessed; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BankFeedTransactionsListRequest && equalTo((BankFeedTransactionsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BankFeedTransactionsListRequest 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) + && isProcessed.equals(other.isProcessed) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.isProcessed, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @Override + 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 isProcessed = 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(BankFeedTransactionsListRequest other) { + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + expand(other.getExpand()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + isProcessed(other.getIsProcessed()); + 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 = "is_processed", nulls = Nulls.SKIP) + public Builder isProcessed(Optional isProcessed) { + this.isProcessed = isProcessed; + return this; + } + + public Builder isProcessed(Boolean isProcessed) { + this.isProcessed = Optional.ofNullable(isProcessed); + 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 BankFeedTransactionsListRequest build() { + return new BankFeedTransactionsListRequest( + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + isProcessed, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/bankfeedtransactions/requests/BankFeedTransactionsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/bankfeedtransactions/requests/BankFeedTransactionsRetrieveRequest.java new file mode 100644 index 000000000..bbfc5db0c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/bankfeedtransactions/requests/BankFeedTransactionsRetrieveRequest.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.bankfeedtransactions.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/accounting/cashflowstatements/CashFlowStatementsClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/cashflowstatements/CashFlowStatementsClient.java new file mode 100644 index 000000000..eceb92d08 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/cashflowstatements/CashFlowStatementsClient.java @@ -0,0 +1,167 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.cashflowstatements; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.cashflowstatements.requests.CashFlowStatementsListRequest; +import com.merge.legacy.api.resources.accounting.cashflowstatements.requests.CashFlowStatementsRetrieveRequest; +import com.merge.legacy.api.resources.accounting.types.CashFlowStatement; +import com.merge.legacy.api.resources.accounting.types.PaginatedCashFlowStatementList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/cashflowstatements/requests/CashFlowStatementsListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/cashflowstatements/requests/CashFlowStatementsListRequest.java new file mode 100644 index 000000000..497902b15 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/cashflowstatements/requests/CashFlowStatementsListRequest.java @@ -0,0 +1,417 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.cashflowstatements.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = CashFlowStatementsListRequest.Builder.class) +public final class CashFlowStatementsListRequest { + 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 remoteId; + + private final Map additionalProperties; + + private CashFlowStatementsListRequest( + Optional companyId, + 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.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.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return cash flow statements 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 The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CashFlowStatementsListRequest && equalTo((CashFlowStatementsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CashFlowStatementsListRequest other) { + return 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) + && remoteId.equals(other.remoteId); + } + + @Override + public int hashCode() { + return Objects.hash( + this.companyId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @Override + 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 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(CashFlowStatementsListRequest other) { + 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()); + 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 = "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 CashFlowStatementsListRequest build() { + return new CashFlowStatementsListRequest( + companyId, + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/cashflowstatements/requests/CashFlowStatementsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/cashflowstatements/requests/CashFlowStatementsRetrieveRequest.java new file mode 100644 index 000000000..90f6810fa --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/cashflowstatements/requests/CashFlowStatementsRetrieveRequest.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.cashflowstatements.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/accounting/companyinfo/CompanyInfoClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/companyinfo/CompanyInfoClient.java new file mode 100644 index 000000000..0cc95abb2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/companyinfo/CompanyInfoClient.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.companyinfo; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.companyinfo.requests.CompanyInfoListRequest; +import com.merge.legacy.api.resources.accounting.companyinfo.requests.CompanyInfoRetrieveRequest; +import com.merge.legacy.api.resources.accounting.types.CompanyInfo; +import com.merge.legacy.api.resources.accounting.types.PaginatedCompanyInfoList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/companyinfo/requests/CompanyInfoListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/companyinfo/requests/CompanyInfoListRequest.java new file mode 100644 index 000000000..4205f304b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/companyinfo/requests/CompanyInfoListRequest.java @@ -0,0 +1,389 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.companyinfo.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.companyinfo.types.CompanyInfoListRequestExpand; +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 = CompanyInfoListRequest.Builder.class) +public final class CompanyInfoListRequest { + 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 CompanyInfoListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CompanyInfoListRequest && equalTo((CompanyInfoListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CompanyInfoListRequest 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); + } + + @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); + } + + @Override + 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(CompanyInfoListRequest 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(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; + 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 CompanyInfoListRequest build() { + return new CompanyInfoListRequest( + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/companyinfo/requests/CompanyInfoRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/companyinfo/requests/CompanyInfoRetrieveRequest.java new file mode 100644 index 000000000..132d18de6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/companyinfo/requests/CompanyInfoRetrieveRequest.java @@ -0,0 +1,121 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.companyinfo.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/accounting/companyinfo/types/CompanyInfoListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/accounting/companyinfo/types/CompanyInfoListRequestExpand.java new file mode 100644 index 000000000..6ad4445f2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/companyinfo/types/CompanyInfoListRequestExpand.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/companyinfo/types/CompanyInfoRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/accounting/companyinfo/types/CompanyInfoRetrieveRequestExpand.java new file mode 100644 index 000000000..95a07dac9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/companyinfo/types/CompanyInfoRetrieveRequestExpand.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/contacts/ContactsClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/contacts/ContactsClient.java new file mode 100644 index 000000000..6195527aa --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/contacts/ContactsClient.java @@ -0,0 +1,375 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.contacts; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.contacts.requests.ContactEndpointRequest; +import com.merge.legacy.api.resources.accounting.contacts.requests.ContactsListRequest; +import com.merge.legacy.api.resources.accounting.contacts.requests.ContactsRemoteFieldClassesListRequest; +import com.merge.legacy.api.resources.accounting.contacts.requests.ContactsRetrieveRequest; +import com.merge.legacy.api.resources.accounting.types.*; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/accounting/contacts/requests/ContactEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/contacts/requests/ContactEndpointRequest.java new file mode 100644 index 000000000..0a14b6836 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/contacts/requests/ContactEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.contacts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.types.ContactRequest; +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 = ContactEndpointRequest.Builder.class) +public final class ContactEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final ContactRequest model; + + private final Map additionalProperties; + + private ContactEndpointRequest( + Optional isDebugMode, + Optional runAsync, + ContactRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public ContactRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactEndpointRequest && equalTo((ContactEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ContactEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull ContactRequest model); + + Builder from(ContactEndpointRequest other); + } + + public interface _FinalStage { + ContactEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private ContactRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(ContactEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull ContactRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public ContactEndpointRequest build() { + return new ContactEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/contacts/requests/ContactsListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/contacts/requests/ContactsListRequest.java new file mode 100644 index 000000000..223c4a75e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/contacts/requests/ContactsListRequest.java @@ -0,0 +1,621 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.contacts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/accounting/contacts/requests/ContactsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/contacts/requests/ContactsRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..51d87a68f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/contacts/requests/ContactsRemoteFieldClassesListRequest.java @@ -0,0 +1,243 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.contacts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @Override + 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/legacy/api/resources/accounting/contacts/requests/ContactsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/contacts/requests/ContactsRetrieveRequest.java new file mode 100644 index 000000000..f3c3c5864 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/contacts/requests/ContactsRetrieveRequest.java @@ -0,0 +1,210 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.contacts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.expand, this.includeRemoteData, this.includeRemoteFields, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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/legacy/api/resources/accounting/contacts/types/ContactsListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/accounting/contacts/types/ContactsListRequestExpand.java new file mode 100644 index 000000000..d830bae2b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/contacts/types/ContactsListRequestExpand.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/contacts/types/ContactsRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/accounting/contacts/types/ContactsRetrieveRequestExpand.java new file mode 100644 index 000000000..4353fd325 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/contacts/types/ContactsRetrieveRequestExpand.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/CreditNotesClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/CreditNotesClient.java new file mode 100644 index 000000000..dd3205a72 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/CreditNotesClient.java @@ -0,0 +1,294 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.creditnotes; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.creditnotes.requests.CreditNoteEndpointRequest; +import com.merge.legacy.api.resources.accounting.creditnotes.requests.CreditNotesListRequest; +import com.merge.legacy.api.resources.accounting.creditnotes.requests.CreditNotesRetrieveRequest; +import com.merge.legacy.api.resources.accounting.types.CreditNote; +import com.merge.legacy.api.resources.accounting.types.CreditNoteResponse; +import com.merge.legacy.api.resources.accounting.types.MetaResponse; +import com.merge.legacy.api.resources.accounting.types.PaginatedCreditNoteList; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/accounting/creditnotes/requests/CreditNoteEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/requests/CreditNoteEndpointRequest.java new file mode 100644 index 000000000..6aa1219f2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/requests/CreditNoteEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.creditnotes.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.types.CreditNoteRequest; +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 = CreditNoteEndpointRequest.Builder.class) +public final class CreditNoteEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final CreditNoteRequest model; + + private final Map additionalProperties; + + private CreditNoteEndpointRequest( + Optional isDebugMode, + Optional runAsync, + CreditNoteRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public CreditNoteRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteEndpointRequest && equalTo((CreditNoteEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreditNoteEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull CreditNoteRequest model); + + Builder from(CreditNoteEndpointRequest other); + } + + public interface _FinalStage { + CreditNoteEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private CreditNoteRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreditNoteEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull CreditNoteRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public CreditNoteEndpointRequest build() { + return new CreditNoteEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/requests/CreditNotesListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/requests/CreditNotesListRequest.java new file mode 100644 index 000000000..18e3e8ac6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/requests/CreditNotesListRequest.java @@ -0,0 +1,536 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.creditnotes.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.creditnotes.types.CreditNotesListRequestExpand; +import com.merge.legacy.api.resources.accounting.creditnotes.types.CreditNotesListRequestRemoteFields; +import com.merge.legacy.api.resources.accounting.creditnotes.types.CreditNotesListRequestShowEnumOrigins; +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 = CreditNotesListRequest.Builder.class) +public final class CreditNotesListRequest { + 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 Optional transactionDateAfter; + + private final Optional transactionDateBefore; + + private final Map additionalProperties; + + private CreditNotesListRequest( + 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, + Optional transactionDateAfter, + Optional transactionDateBefore, + Map additionalProperties) { + 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.transactionDateAfter = transactionDateAfter; + this.transactionDateBefore = transactionDateBefore; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return credit notes 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; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("transaction_date_after") + public Optional getTransactionDateAfter() { + return transactionDateAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("transaction_date_before") + public Optional getTransactionDateBefore() { + return transactionDateBefore; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNotesListRequest && equalTo((CreditNotesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreditNotesListRequest other) { + return 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) + && transactionDateAfter.equals(other.transactionDateAfter) + && transactionDateBefore.equals(other.transactionDateBefore); + } + + @Override + public int hashCode() { + return Objects.hash( + 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, + this.transactionDateAfter, + this.transactionDateBefore); + } + + @Override + 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 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(); + + private Optional transactionDateAfter = Optional.empty(); + + private Optional transactionDateBefore = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreditNotesListRequest other) { + 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()); + transactionDateAfter(other.getTransactionDateAfter()); + transactionDateBefore(other.getTransactionDateBefore()); + 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(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; + 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(CreditNotesListRequestRemoteFields 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(CreditNotesListRequestShowEnumOrigins showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + @JsonSetter(value = "transaction_date_after", nulls = Nulls.SKIP) + public Builder transactionDateAfter(Optional transactionDateAfter) { + this.transactionDateAfter = transactionDateAfter; + return this; + } + + public Builder transactionDateAfter(OffsetDateTime transactionDateAfter) { + this.transactionDateAfter = Optional.ofNullable(transactionDateAfter); + return this; + } + + @JsonSetter(value = "transaction_date_before", nulls = Nulls.SKIP) + public Builder transactionDateBefore(Optional transactionDateBefore) { + this.transactionDateBefore = transactionDateBefore; + return this; + } + + public Builder transactionDateBefore(OffsetDateTime transactionDateBefore) { + this.transactionDateBefore = Optional.ofNullable(transactionDateBefore); + return this; + } + + public CreditNotesListRequest build() { + return new CreditNotesListRequest( + companyId, + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteFields, + remoteId, + showEnumOrigins, + transactionDateAfter, + transactionDateBefore, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/requests/CreditNotesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/requests/CreditNotesRetrieveRequest.java new file mode 100644 index 000000000..c67855035 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/requests/CreditNotesRetrieveRequest.java @@ -0,0 +1,179 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.creditnotes.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.creditnotes.types.CreditNotesRetrieveRequestExpand; +import com.merge.legacy.api.resources.accounting.creditnotes.types.CreditNotesRetrieveRequestRemoteFields; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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/legacy/api/resources/accounting/creditnotes/types/CreditNotesListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/types/CreditNotesListRequestExpand.java new file mode 100644 index 000000000..a6efbc453 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/types/CreditNotesListRequestExpand.java @@ -0,0 +1,308 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/types/CreditNotesListRequestRemoteFields.java b/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/types/CreditNotesListRequestRemoteFields.java new file mode 100644 index 000000000..29df4d06d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/types/CreditNotesListRequestRemoteFields.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.creditnotes.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CreditNotesListRequestRemoteFields { + STATUS("status"), + + STATUS_TYPE("status,type"), + + TYPE("type"); + + private final String value; + + CreditNotesListRequestRemoteFields(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/types/CreditNotesListRequestShowEnumOrigins.java b/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/types/CreditNotesListRequestShowEnumOrigins.java new file mode 100644 index 000000000..eed4b8252 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/types/CreditNotesListRequestShowEnumOrigins.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.creditnotes.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CreditNotesListRequestShowEnumOrigins { + STATUS("status"), + + STATUS_TYPE("status,type"), + + TYPE("type"); + + private final String value; + + CreditNotesListRequestShowEnumOrigins(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/types/CreditNotesRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/types/CreditNotesRetrieveRequestExpand.java new file mode 100644 index 000000000..7dac5ed6f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/types/CreditNotesRetrieveRequestExpand.java @@ -0,0 +1,308 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/types/CreditNotesRetrieveRequestRemoteFields.java b/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/types/CreditNotesRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..6986761c9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/types/CreditNotesRetrieveRequestRemoteFields.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.creditnotes.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CreditNotesRetrieveRequestRemoteFields { + STATUS("status"), + + STATUS_TYPE("status,type"), + + TYPE("type"); + + private final String value; + + CreditNotesRetrieveRequestRemoteFields(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/types/CreditNotesRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/types/CreditNotesRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..a0b193b27 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/creditnotes/types/CreditNotesRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.creditnotes.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CreditNotesRetrieveRequestShowEnumOrigins { + STATUS("status"), + + STATUS_TYPE("status,type"), + + TYPE("type"); + + private final String value; + + CreditNotesRetrieveRequestShowEnumOrigins(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/deleteaccount/DeleteAccountClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/deleteaccount/DeleteAccountClient.java new file mode 100644 index 000000000..68f17af93 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/deleteaccount/DeleteAccountClient.java @@ -0,0 +1,55 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.deleteaccount; + +import com.merge.legacy.api.core.*; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/employees/EmployeesClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/employees/EmployeesClient.java new file mode 100644 index 000000000..3ae64f39a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/employees/EmployeesClient.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.employees; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.employees.requests.EmployeesListRequest; +import com.merge.legacy.api.resources.accounting.employees.requests.EmployeesRetrieveRequest; +import com.merge.legacy.api.resources.accounting.types.Employee; +import com.merge.legacy.api.resources.accounting.types.PaginatedEmployeeList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/employees/requests/EmployeesListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/employees/requests/EmployeesListRequest.java new file mode 100644 index 000000000..422118888 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/employees/requests/EmployeesListRequest.java @@ -0,0 +1,242 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.employees.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.pageSize); + } + + @Override + 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/legacy/api/resources/accounting/employees/requests/EmployeesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/employees/requests/EmployeesRetrieveRequest.java new file mode 100644 index 000000000..1f2ad9401 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/employees/requests/EmployeesRetrieveRequest.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.employees.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/accounting/expenses/ExpensesClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/expenses/ExpensesClient.java new file mode 100644 index 000000000..2d818c5ca --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/expenses/ExpensesClient.java @@ -0,0 +1,430 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.expenses; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.expenses.requests.*; +import com.merge.legacy.api.resources.accounting.types.*; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/accounting/expenses/requests/ExpenseEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/expenses/requests/ExpenseEndpointRequest.java new file mode 100644 index 000000000..6a5849c44 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/expenses/requests/ExpenseEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.expenses.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.types.ExpenseRequest; +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 = ExpenseEndpointRequest.Builder.class) +public final class ExpenseEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final ExpenseRequest model; + + private final Map additionalProperties; + + private ExpenseEndpointRequest( + Optional isDebugMode, + Optional runAsync, + ExpenseRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public ExpenseRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseEndpointRequest && equalTo((ExpenseEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExpenseEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull ExpenseRequest model); + + Builder from(ExpenseEndpointRequest other); + } + + public interface _FinalStage { + ExpenseEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private ExpenseRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(ExpenseEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull ExpenseRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public ExpenseEndpointRequest build() { + return new ExpenseEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/expenses/requests/ExpensesLinesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/expenses/requests/ExpensesLinesRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..449124311 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/expenses/requests/ExpensesLinesRemoteFieldClassesListRequest.java @@ -0,0 +1,243 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.expenses.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = ExpensesLinesRemoteFieldClassesListRequest.Builder.class) +public final class ExpensesLinesRemoteFieldClassesListRequest { + 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 ExpensesLinesRemoteFieldClassesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpensesLinesRemoteFieldClassesListRequest + && equalTo((ExpensesLinesRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExpensesLinesRemoteFieldClassesListRequest 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @Override + 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(ExpensesLinesRemoteFieldClassesListRequest 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 ExpensesLinesRemoteFieldClassesListRequest build() { + return new ExpensesLinesRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + isCommonModelField, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/expenses/requests/ExpensesListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/expenses/requests/ExpensesListRequest.java new file mode 100644 index 000000000..3fbdfef18 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/expenses/requests/ExpensesListRequest.java @@ -0,0 +1,505 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.expenses.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.expenses.types.ExpensesListRequestExpand; +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 = ExpensesListRequest.Builder.class) +public final class ExpensesListRequest { + 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 includeRemoteFields; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Optional transactionDateAfter; + + private final Optional transactionDateBefore; + + private final Map additionalProperties; + + private ExpensesListRequest( + Optional companyId, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Optional transactionDateAfter, + Optional transactionDateBefore, + Map additionalProperties) { + this.companyId = companyId; + 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.pageSize = pageSize; + this.remoteId = remoteId; + this.transactionDateAfter = transactionDateAfter; + this.transactionDateBefore = transactionDateBefore; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return expenses 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 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; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("transaction_date_after") + public Optional getTransactionDateAfter() { + return transactionDateAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("transaction_date_before") + public Optional getTransactionDateBefore() { + return transactionDateBefore; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpensesListRequest && equalTo((ExpensesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExpensesListRequest other) { + return 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) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId) + && transactionDateAfter.equals(other.transactionDateAfter) + && transactionDateBefore.equals(other.transactionDateBefore); + } + + @Override + public int hashCode() { + return Objects.hash( + this.companyId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId, + this.transactionDateAfter, + this.transactionDateBefore); + } + + @Override + 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 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 remoteId = Optional.empty(); + + private Optional transactionDateAfter = Optional.empty(); + + private Optional transactionDateBefore = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExpensesListRequest other) { + companyId(other.getCompanyId()); + 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()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + transactionDateAfter(other.getTransactionDateAfter()); + transactionDateBefore(other.getTransactionDateBefore()); + 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(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; + 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; + } + + @JsonSetter(value = "transaction_date_after", nulls = Nulls.SKIP) + public Builder transactionDateAfter(Optional transactionDateAfter) { + this.transactionDateAfter = transactionDateAfter; + return this; + } + + public Builder transactionDateAfter(OffsetDateTime transactionDateAfter) { + this.transactionDateAfter = Optional.ofNullable(transactionDateAfter); + return this; + } + + @JsonSetter(value = "transaction_date_before", nulls = Nulls.SKIP) + public Builder transactionDateBefore(Optional transactionDateBefore) { + this.transactionDateBefore = transactionDateBefore; + return this; + } + + public Builder transactionDateBefore(OffsetDateTime transactionDateBefore) { + this.transactionDateBefore = Optional.ofNullable(transactionDateBefore); + return this; + } + + public ExpensesListRequest build() { + return new ExpensesListRequest( + companyId, + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + transactionDateAfter, + transactionDateBefore, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/expenses/requests/ExpensesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/expenses/requests/ExpensesRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..da5b3fa0d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/expenses/requests/ExpensesRemoteFieldClassesListRequest.java @@ -0,0 +1,243 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.expenses.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = ExpensesRemoteFieldClassesListRequest.Builder.class) +public final class ExpensesRemoteFieldClassesListRequest { + 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 ExpensesRemoteFieldClassesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpensesRemoteFieldClassesListRequest + && equalTo((ExpensesRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExpensesRemoteFieldClassesListRequest 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @Override + 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(ExpensesRemoteFieldClassesListRequest 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 ExpensesRemoteFieldClassesListRequest build() { + return new ExpensesRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + isCommonModelField, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/expenses/requests/ExpensesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/expenses/requests/ExpensesRetrieveRequest.java new file mode 100644 index 000000000..df944159f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/expenses/requests/ExpensesRetrieveRequest.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.expenses.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields); + } + + @Override + 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/legacy/api/resources/accounting/expenses/types/ExpensesListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/accounting/expenses/types/ExpensesListRequestExpand.java new file mode 100644 index 000000000..adf3ab6cb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/expenses/types/ExpensesListRequestExpand.java @@ -0,0 +1,151 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/expenses/types/ExpensesRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/accounting/expenses/types/ExpensesRetrieveRequestExpand.java new file mode 100644 index 000000000..01e5368f3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/expenses/types/ExpensesRetrieveRequestExpand.java @@ -0,0 +1,151 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/fieldmapping/FieldMappingClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/fieldmapping/FieldMappingClient.java new file mode 100644 index 000000000..113f934c1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/fieldmapping/FieldMappingClient.java @@ -0,0 +1,338 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.fieldmapping; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.fieldmapping.requests.CreateFieldMappingRequest; +import com.merge.legacy.api.resources.accounting.fieldmapping.requests.FieldMappingsRetrieveRequest; +import com.merge.legacy.api.resources.accounting.fieldmapping.requests.PatchedEditFieldMappingRequest; +import com.merge.legacy.api.resources.accounting.fieldmapping.requests.RemoteFieldsRetrieveRequest; +import com.merge.legacy.api.resources.accounting.types.ExternalTargetFieldApiResponse; +import com.merge.legacy.api.resources.accounting.types.FieldMappingApiInstanceResponse; +import com.merge.legacy.api.resources.accounting.types.FieldMappingInstanceResponse; +import com.merge.legacy.api.resources.accounting.types.RemoteFieldApiResponse; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/accounting/fieldmapping/requests/CreateFieldMappingRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/fieldmapping/requests/CreateFieldMappingRequest.java new file mode 100644 index 000000000..eaba522b0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/fieldmapping/requests/CreateFieldMappingRequest.java @@ -0,0 +1,337 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.fieldmapping.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.excludeRemoteFieldMetadata, + this.targetFieldName, + this.targetFieldDescription, + this.remoteFieldTraversalPath, + this.remoteMethod, + this.remoteUrlPath, + this.commonModelName); + } + + @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() {} + + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @Override + public _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.add(remoteFieldTraversalPath); + return this; + } + + @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. + */ + @Override + public _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); + return this; + } + + @Override + @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) + public _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + return this; + } + + @Override + public CreateFieldMappingRequest build() { + return new CreateFieldMappingRequest( + excludeRemoteFieldMetadata, + targetFieldName, + targetFieldDescription, + remoteFieldTraversalPath, + remoteMethod, + remoteUrlPath, + commonModelName, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/fieldmapping/requests/FieldMappingsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/fieldmapping/requests/FieldMappingsRetrieveRequest.java new file mode 100644 index 000000000..38b08440a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/fieldmapping/requests/FieldMappingsRetrieveRequest.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.fieldmapping.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.excludeRemoteFieldMetadata); + } + + @Override + 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/legacy/api/resources/accounting/fieldmapping/requests/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/fieldmapping/requests/PatchedEditFieldMappingRequest.java new file mode 100644 index 000000000..0ffbceac3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/fieldmapping/requests/PatchedEditFieldMappingRequest.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.fieldmapping.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath); + } + + @Override + 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/legacy/api/resources/accounting/fieldmapping/requests/RemoteFieldsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/fieldmapping/requests/RemoteFieldsRetrieveRequest.java new file mode 100644 index 000000000..50cc8c9fc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/fieldmapping/requests/RemoteFieldsRetrieveRequest.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.fieldmapping.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.commonModels, this.includeExampleValues); + } + + @Override + 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/legacy/api/resources/accounting/forceresync/ForceResyncClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/forceresync/ForceResyncClient.java new file mode 100644 index 000000000..529ac7781 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/forceresync/ForceResyncClient.java @@ -0,0 +1,61 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.forceresync; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.types.SyncStatus; +import java.io.IOException; +import java.util.List; +import okhttp3.*; + +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/legacy/api/resources/accounting/generalledgertransactions/GeneralLedgerTransactionsClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/generalledgertransactions/GeneralLedgerTransactionsClient.java new file mode 100644 index 000000000..75635e392 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/generalledgertransactions/GeneralLedgerTransactionsClient.java @@ -0,0 +1,177 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.generalledgertransactions; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.generalledgertransactions.requests.GeneralLedgerTransactionsListRequest; +import com.merge.legacy.api.resources.accounting.generalledgertransactions.requests.GeneralLedgerTransactionsRetrieveRequest; +import com.merge.legacy.api.resources.accounting.types.GeneralLedgerTransaction; +import com.merge.legacy.api.resources.accounting.types.PaginatedGeneralLedgerTransactionList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/generalledgertransactions/requests/GeneralLedgerTransactionsListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/generalledgertransactions/requests/GeneralLedgerTransactionsListRequest.java new file mode 100644 index 000000000..810950fdd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/generalledgertransactions/requests/GeneralLedgerTransactionsListRequest.java @@ -0,0 +1,477 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.generalledgertransactions.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.generalledgertransactions.types.GeneralLedgerTransactionsListRequestExpand; +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 = GeneralLedgerTransactionsListRequest.Builder.class) +public final class GeneralLedgerTransactionsListRequest { + 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 postedDateAfter; + + private final Optional postedDateBefore; + + private final Optional remoteId; + + private final Map additionalProperties; + + private GeneralLedgerTransactionsListRequest( + Optional companyId, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional postedDateAfter, + Optional postedDateBefore, + Optional remoteId, + Map additionalProperties) { + 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.postedDateAfter = postedDateAfter; + this.postedDateBefore = postedDateBefore; + this.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return general ledger transactions 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 If provided, will only return objects posted after this datetime. + */ + @JsonProperty("posted_date_after") + public Optional getPostedDateAfter() { + return postedDateAfter; + } + + /** + * @return If provided, will only return objects posted before this datetime. + */ + @JsonProperty("posted_date_before") + public Optional getPostedDateBefore() { + return postedDateBefore; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GeneralLedgerTransactionsListRequest + && equalTo((GeneralLedgerTransactionsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GeneralLedgerTransactionsListRequest other) { + return 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) + && postedDateAfter.equals(other.postedDateAfter) + && postedDateBefore.equals(other.postedDateBefore) + && remoteId.equals(other.remoteId); + } + + @Override + public int hashCode() { + return Objects.hash( + this.companyId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.postedDateAfter, + this.postedDateBefore, + this.remoteId); + } + + @Override + 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 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 postedDateAfter = Optional.empty(); + + private Optional postedDateBefore = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GeneralLedgerTransactionsListRequest other) { + 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()); + postedDateAfter(other.getPostedDateAfter()); + postedDateBefore(other.getPostedDateBefore()); + 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 = "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; + 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 = "posted_date_after", nulls = Nulls.SKIP) + public Builder postedDateAfter(Optional postedDateAfter) { + this.postedDateAfter = postedDateAfter; + return this; + } + + public Builder postedDateAfter(OffsetDateTime postedDateAfter) { + this.postedDateAfter = Optional.ofNullable(postedDateAfter); + return this; + } + + @JsonSetter(value = "posted_date_before", nulls = Nulls.SKIP) + public Builder postedDateBefore(Optional postedDateBefore) { + this.postedDateBefore = postedDateBefore; + return this; + } + + public Builder postedDateBefore(OffsetDateTime postedDateBefore) { + this.postedDateBefore = Optional.ofNullable(postedDateBefore); + 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 GeneralLedgerTransactionsListRequest build() { + return new GeneralLedgerTransactionsListRequest( + companyId, + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + postedDateAfter, + postedDateBefore, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/generalledgertransactions/requests/GeneralLedgerTransactionsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/generalledgertransactions/requests/GeneralLedgerTransactionsRetrieveRequest.java new file mode 100644 index 000000000..30c75460e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/generalledgertransactions/requests/GeneralLedgerTransactionsRetrieveRequest.java @@ -0,0 +1,122 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.generalledgertransactions.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/accounting/generalledgertransactions/types/GeneralLedgerTransactionsListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/accounting/generalledgertransactions/types/GeneralLedgerTransactionsListRequestExpand.java new file mode 100644 index 000000000..4f1763a40 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/generalledgertransactions/types/GeneralLedgerTransactionsListRequestExpand.java @@ -0,0 +1,54 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/generalledgertransactions/types/GeneralLedgerTransactionsRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/accounting/generalledgertransactions/types/GeneralLedgerTransactionsRetrieveRequestExpand.java new file mode 100644 index 000000000..522286978 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/generalledgertransactions/types/GeneralLedgerTransactionsRetrieveRequestExpand.java @@ -0,0 +1,54 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/generatekey/GenerateKeyClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/generatekey/GenerateKeyClient.java new file mode 100644 index 000000000..445dc6759 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/generatekey/GenerateKeyClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.generatekey; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.generatekey.requests.GenerateRemoteKeyRequest; +import com.merge.legacy.api.resources.accounting.types.RemoteKey; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/generatekey/requests/GenerateRemoteKeyRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/generatekey/requests/GenerateRemoteKeyRequest.java new file mode 100644 index 000000000..0d2ff4c10 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/generatekey/requests/GenerateRemoteKeyRequest.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.generatekey.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + public GenerateRemoteKeyRequest build() { + return new GenerateRemoteKeyRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/incomestatements/IncomeStatementsClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/incomestatements/IncomeStatementsClient.java new file mode 100644 index 000000000..9156845d8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/incomestatements/IncomeStatementsClient.java @@ -0,0 +1,166 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.incomestatements; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.incomestatements.requests.IncomeStatementsListRequest; +import com.merge.legacy.api.resources.accounting.incomestatements.requests.IncomeStatementsRetrieveRequest; +import com.merge.legacy.api.resources.accounting.types.IncomeStatement; +import com.merge.legacy.api.resources.accounting.types.PaginatedIncomeStatementList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/incomestatements/requests/IncomeStatementsListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/incomestatements/requests/IncomeStatementsListRequest.java new file mode 100644 index 000000000..878f2cae8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/incomestatements/requests/IncomeStatementsListRequest.java @@ -0,0 +1,417 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.incomestatements.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = IncomeStatementsListRequest.Builder.class) +public final class IncomeStatementsListRequest { + 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 remoteId; + + private final Map additionalProperties; + + private IncomeStatementsListRequest( + Optional companyId, + 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.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.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return income statements 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 The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IncomeStatementsListRequest && equalTo((IncomeStatementsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IncomeStatementsListRequest other) { + return 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) + && remoteId.equals(other.remoteId); + } + + @Override + public int hashCode() { + return Objects.hash( + this.companyId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @Override + 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 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(IncomeStatementsListRequest other) { + 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()); + 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 = "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 IncomeStatementsListRequest build() { + return new IncomeStatementsListRequest( + companyId, + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/incomestatements/requests/IncomeStatementsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/incomestatements/requests/IncomeStatementsRetrieveRequest.java new file mode 100644 index 000000000..e878e90d9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/incomestatements/requests/IncomeStatementsRetrieveRequest.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.incomestatements.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/accounting/invoices/InvoicesClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/invoices/InvoicesClient.java new file mode 100644 index 000000000..eeca38274 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/invoices/InvoicesClient.java @@ -0,0 +1,556 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.invoices; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.invoices.requests.*; +import com.merge.legacy.api.resources.accounting.types.*; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/accounting/invoices/requests/InvoiceEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/invoices/requests/InvoiceEndpointRequest.java new file mode 100644 index 000000000..c5bbda281 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/invoices/requests/InvoiceEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.invoices.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.types.InvoiceRequest; +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 = InvoiceEndpointRequest.Builder.class) +public final class InvoiceEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final InvoiceRequest model; + + private final Map additionalProperties; + + private InvoiceEndpointRequest( + Optional isDebugMode, + Optional runAsync, + InvoiceRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public InvoiceRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceEndpointRequest && equalTo((InvoiceEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(InvoiceEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull InvoiceRequest model); + + Builder from(InvoiceEndpointRequest other); + } + + public interface _FinalStage { + InvoiceEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private InvoiceRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(InvoiceEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull InvoiceRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public InvoiceEndpointRequest build() { + return new InvoiceEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/invoices/requests/InvoicesLineItemsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/invoices/requests/InvoicesLineItemsRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..29e1dbe64 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/invoices/requests/InvoicesLineItemsRemoteFieldClassesListRequest.java @@ -0,0 +1,243 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.invoices.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = InvoicesLineItemsRemoteFieldClassesListRequest.Builder.class) +public final class InvoicesLineItemsRemoteFieldClassesListRequest { + 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 InvoicesLineItemsRemoteFieldClassesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoicesLineItemsRemoteFieldClassesListRequest + && equalTo((InvoicesLineItemsRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(InvoicesLineItemsRemoteFieldClassesListRequest 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @Override + 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(InvoicesLineItemsRemoteFieldClassesListRequest 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 InvoicesLineItemsRemoteFieldClassesListRequest build() { + return new InvoicesLineItemsRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + isCommonModelField, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/invoices/requests/InvoicesListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/invoices/requests/InvoicesListRequest.java new file mode 100644 index 000000000..a87ce372b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/invoices/requests/InvoicesListRequest.java @@ -0,0 +1,693 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.invoices.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.invoices.types.InvoicesListRequestExpand; +import com.merge.legacy.api.resources.accounting.invoices.types.InvoicesListRequestStatus; +import com.merge.legacy.api.resources.accounting.invoices.types.InvoicesListRequestType; +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 = InvoicesListRequest.Builder.class) +public final class InvoicesListRequest { + private final Optional companyId; + + private final Optional contactId; + + 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 issueDateAfter; + + private final Optional issueDateBefore; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional number; + + private final Optional pageSize; + + private final Optional remoteFields; + + private final Optional remoteId; + + private final Optional showEnumOrigins; + + private final Optional status; + + private final Optional type; + + private final Map additionalProperties; + + private InvoicesListRequest( + Optional companyId, + Optional contactId, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Optional issueDateAfter, + Optional issueDateBefore, + Optional modifiedAfter, + Optional modifiedBefore, + Optional number, + Optional pageSize, + Optional remoteFields, + Optional remoteId, + Optional showEnumOrigins, + Optional status, + Optional type, + Map additionalProperties) { + 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; + this.includeShellData = includeShellData; + this.issueDateAfter = issueDateAfter; + this.issueDateBefore = issueDateBefore; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.number = number; + this.pageSize = pageSize; + this.remoteFields = remoteFields; + this.remoteId = remoteId; + this.showEnumOrigins = showEnumOrigins; + this.status = status; + this.type = type; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return invoices for this company. + */ + @JsonProperty("company_id") + public Optional getCompanyId() { + return companyId; + } + + /** + * @return If provided, will only return invoices for this contact. + */ + @JsonProperty("contact_id") + public Optional getContactId() { + return contactId; + } + + /** + * @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, will only return objects created after this datetime. + */ + @JsonProperty("issue_date_after") + public Optional getIssueDateAfter() { + return issueDateAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("issue_date_before") + public Optional getIssueDateBefore() { + return issueDateBefore; + } + + /** + * @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 Invoices with this number. + */ + @JsonProperty("number") + public Optional getNumber() { + return number; + } + + /** + * @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 Invoices with this status. + *
    + *
  • PAID - PAID
  • + *
  • DRAFT - DRAFT
  • + *
  • SUBMITTED - SUBMITTED
  • + *
  • PARTIALLY_PAID - PARTIALLY_PAID
  • + *
  • OPEN - OPEN
  • + *
  • VOID - VOID
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return If provided, will only return Invoices with this type. + *
    + *
  • ACCOUNTS_RECEIVABLE - ACCOUNTS_RECEIVABLE
  • + *
  • ACCOUNTS_PAYABLE - ACCOUNTS_PAYABLE
  • + *
+ */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoicesListRequest && equalTo((InvoicesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(InvoicesListRequest other) { + return 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) + && includeShellData.equals(other.includeShellData) + && issueDateAfter.equals(other.issueDateAfter) + && issueDateBefore.equals(other.issueDateBefore) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && number.equals(other.number) + && pageSize.equals(other.pageSize) + && remoteFields.equals(other.remoteFields) + && remoteId.equals(other.remoteId) + && showEnumOrigins.equals(other.showEnumOrigins) + && status.equals(other.status) + && type.equals(other.type); + } + + @Override + public int hashCode() { + return Objects.hash( + this.companyId, + this.contactId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.issueDateAfter, + this.issueDateBefore, + this.modifiedAfter, + this.modifiedBefore, + this.number, + this.pageSize, + this.remoteFields, + this.remoteId, + this.showEnumOrigins, + this.status, + this.type); + } + + @Override + 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 contactId = 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 includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional issueDateAfter = Optional.empty(); + + private Optional issueDateBefore = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional number = 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(); + + private Optional type = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(InvoicesListRequest other) { + 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()); + includeShellData(other.getIncludeShellData()); + issueDateAfter(other.getIssueDateAfter()); + issueDateBefore(other.getIssueDateBefore()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + number(other.getNumber()); + pageSize(other.getPageSize()); + remoteFields(other.getRemoteFields()); + remoteId(other.getRemoteId()); + showEnumOrigins(other.getShowEnumOrigins()); + status(other.getStatus()); + type(other.getType()); + 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 = "contact_id", nulls = Nulls.SKIP) + public Builder contactId(Optional contactId) { + this.contactId = contactId; + return this; + } + + public Builder contactId(String contactId) { + this.contactId = Optional.ofNullable(contactId); + 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(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; + 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 = "issue_date_after", nulls = Nulls.SKIP) + public Builder issueDateAfter(Optional issueDateAfter) { + this.issueDateAfter = issueDateAfter; + return this; + } + + public Builder issueDateAfter(OffsetDateTime issueDateAfter) { + this.issueDateAfter = Optional.ofNullable(issueDateAfter); + return this; + } + + @JsonSetter(value = "issue_date_before", nulls = Nulls.SKIP) + public Builder issueDateBefore(Optional issueDateBefore) { + this.issueDateBefore = issueDateBefore; + return this; + } + + public Builder issueDateBefore(OffsetDateTime issueDateBefore) { + this.issueDateBefore = Optional.ofNullable(issueDateBefore); + 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 = "number", nulls = Nulls.SKIP) + public Builder number(Optional number) { + this.number = number; + return this; + } + + public Builder number(String number) { + this.number = Optional.ofNullable(number); + 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(InvoicesListRequestStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(InvoicesListRequestType type) { + this.type = Optional.ofNullable(type); + return this; + } + + public InvoicesListRequest build() { + return new InvoicesListRequest( + companyId, + contactId, + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + issueDateAfter, + issueDateBefore, + modifiedAfter, + modifiedBefore, + number, + pageSize, + remoteFields, + remoteId, + showEnumOrigins, + status, + type, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/invoices/requests/InvoicesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/invoices/requests/InvoicesRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..308fbba9e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/invoices/requests/InvoicesRemoteFieldClassesListRequest.java @@ -0,0 +1,243 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.invoices.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = InvoicesRemoteFieldClassesListRequest.Builder.class) +public final class InvoicesRemoteFieldClassesListRequest { + 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 InvoicesRemoteFieldClassesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoicesRemoteFieldClassesListRequest + && equalTo((InvoicesRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(InvoicesRemoteFieldClassesListRequest 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @Override + 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(InvoicesRemoteFieldClassesListRequest 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 InvoicesRemoteFieldClassesListRequest build() { + return new InvoicesRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + isCommonModelField, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/invoices/requests/InvoicesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/invoices/requests/InvoicesRetrieveRequest.java new file mode 100644 index 000000000..516bc1c8c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/invoices/requests/InvoicesRetrieveRequest.java @@ -0,0 +1,210 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.invoices.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.invoices.types.InvoicesRetrieveRequestExpand; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = InvoicesRetrieveRequest.Builder.class) +public final class InvoicesRetrieveRequest { + 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 InvoicesRetrieveRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoicesRetrieveRequest && equalTo((InvoicesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(InvoicesRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @Override + public int hashCode() { + return Objects.hash( + this.expand, this.includeRemoteData, this.includeRemoteFields, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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(InvoicesRetrieveRequest 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(InvoicesRetrieveRequestExpand 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 InvoicesRetrieveRequest build() { + return new InvoicesRetrieveRequest( + expand, + includeRemoteData, + includeRemoteFields, + remoteFields, + showEnumOrigins, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/invoices/requests/PatchedInvoiceEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/invoices/requests/PatchedInvoiceEndpointRequest.java new file mode 100644 index 000000000..7cd9e15db --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/invoices/requests/PatchedInvoiceEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.invoices.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.types.InvoiceRequest; +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 = PatchedInvoiceEndpointRequest.Builder.class) +public final class PatchedInvoiceEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final InvoiceRequest model; + + private final Map additionalProperties; + + private PatchedInvoiceEndpointRequest( + Optional isDebugMode, + Optional runAsync, + InvoiceRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public InvoiceRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedInvoiceEndpointRequest && equalTo((PatchedInvoiceEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedInvoiceEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull InvoiceRequest model); + + Builder from(PatchedInvoiceEndpointRequest other); + } + + public interface _FinalStage { + PatchedInvoiceEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private InvoiceRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(PatchedInvoiceEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull InvoiceRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public PatchedInvoiceEndpointRequest build() { + return new PatchedInvoiceEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/invoices/types/InvoicesListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/accounting/invoices/types/InvoicesListRequestExpand.java new file mode 100644 index 000000000..3b088b935 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/invoices/types/InvoicesListRequestExpand.java @@ -0,0 +1,5778 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/invoices/types/InvoicesListRequestStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/invoices/types/InvoicesListRequestStatus.java new file mode 100644 index 000000000..06fcd8c74 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/invoices/types/InvoicesListRequestStatus.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.invoices.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum InvoicesListRequestStatus { + DRAFT("DRAFT"), + + OPEN("OPEN"), + + PAID("PAID"), + + PARTIALLY_PAID("PARTIALLY_PAID"), + + SUBMITTED("SUBMITTED"), + + VOID("VOID"); + + private final String value; + + InvoicesListRequestStatus(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/invoices/types/InvoicesListRequestType.java b/src/main/java/com/merge/legacy/api/resources/accounting/invoices/types/InvoicesListRequestType.java new file mode 100644 index 000000000..cacbc696b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/invoices/types/InvoicesListRequestType.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.invoices.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum InvoicesListRequestType { + ACCOUNTS_PAYABLE("ACCOUNTS_PAYABLE"), + + ACCOUNTS_RECEIVABLE("ACCOUNTS_RECEIVABLE"); + + private final String value; + + InvoicesListRequestType(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/invoices/types/InvoicesRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/accounting/invoices/types/InvoicesRetrieveRequestExpand.java new file mode 100644 index 000000000..2268e2269 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/invoices/types/InvoicesRetrieveRequestExpand.java @@ -0,0 +1,5778 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/issues/IssuesClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/issues/IssuesClient.java new file mode 100644 index 000000000..abc98a74a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/issues/IssuesClient.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.issues; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.issues.requests.IssuesListRequest; +import com.merge.legacy.api.resources.accounting.types.Issue; +import com.merge.legacy.api.resources.accounting.types.PaginatedIssueList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/issues/requests/IssuesListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/issues/requests/IssuesListRequest.java new file mode 100644 index 000000000..23b8426db --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/issues/requests/IssuesListRequest.java @@ -0,0 +1,471 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.issues.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/accounting/issues/types/IssuesListRequestStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/issues/types/IssuesListRequestStatus.java new file mode 100644 index 000000000..023f7e369 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/issues/types/IssuesListRequestStatus.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/items/ItemsClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/items/ItemsClient.java new file mode 100644 index 000000000..ce2794aa8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/items/ItemsClient.java @@ -0,0 +1,180 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.items; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.items.requests.ItemsListRequest; +import com.merge.legacy.api.resources.accounting.items.requests.ItemsRetrieveRequest; +import com.merge.legacy.api.resources.accounting.types.Item; +import com.merge.legacy.api.resources.accounting.types.PaginatedItemList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/items/requests/ItemsListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/items/requests/ItemsListRequest.java new file mode 100644 index 000000000..9da53eaa0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/items/requests/ItemsListRequest.java @@ -0,0 +1,476 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.items.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.items.types.ItemsListRequestExpand; +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 = ItemsListRequest.Builder.class) +public final class ItemsListRequest { + 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 ItemsListRequest( + 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.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 return items 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemsListRequest && equalTo((ItemsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ItemsListRequest other) { + return 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); + } + + @Override + public int hashCode() { + return Objects.hash( + 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); + } + + @Override + 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 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(ItemsListRequest other) { + 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 = "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(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; + 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 ItemsListRequest build() { + return new ItemsListRequest( + companyId, + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteFields, + remoteId, + showEnumOrigins, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/items/requests/ItemsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/items/requests/ItemsRetrieveRequest.java new file mode 100644 index 000000000..e2992bcb3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/items/requests/ItemsRetrieveRequest.java @@ -0,0 +1,177 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.items.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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/legacy/api/resources/accounting/items/types/ItemsListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/accounting/items/types/ItemsListRequestExpand.java new file mode 100644 index 000000000..992e077fa --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/items/types/ItemsListRequestExpand.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/items/types/ItemsRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/accounting/items/types/ItemsRetrieveRequestExpand.java new file mode 100644 index 000000000..b5c0b2179 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/items/types/ItemsRetrieveRequestExpand.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/journalentries/JournalEntriesClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/journalentries/JournalEntriesClient.java new file mode 100644 index 000000000..57d097f26 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/journalentries/JournalEntriesClient.java @@ -0,0 +1,430 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.journalentries; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.journalentries.requests.*; +import com.merge.legacy.api.resources.accounting.types.*; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/accounting/journalentries/requests/JournalEntriesLinesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/journalentries/requests/JournalEntriesLinesRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..bacd1862d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/journalentries/requests/JournalEntriesLinesRemoteFieldClassesListRequest.java @@ -0,0 +1,243 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.journalentries.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = JournalEntriesLinesRemoteFieldClassesListRequest.Builder.class) +public final class JournalEntriesLinesRemoteFieldClassesListRequest { + 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 JournalEntriesLinesRemoteFieldClassesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalEntriesLinesRemoteFieldClassesListRequest + && equalTo((JournalEntriesLinesRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(JournalEntriesLinesRemoteFieldClassesListRequest 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @Override + 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(JournalEntriesLinesRemoteFieldClassesListRequest 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 JournalEntriesLinesRemoteFieldClassesListRequest build() { + return new JournalEntriesLinesRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + isCommonModelField, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/journalentries/requests/JournalEntriesListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/journalentries/requests/JournalEntriesListRequest.java new file mode 100644 index 000000000..282bf9c8f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/journalentries/requests/JournalEntriesListRequest.java @@ -0,0 +1,505 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.journalentries.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.journalentries.types.JournalEntriesListRequestExpand; +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 = JournalEntriesListRequest.Builder.class) +public final class JournalEntriesListRequest { + 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 includeRemoteFields; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Optional transactionDateAfter; + + private final Optional transactionDateBefore; + + private final Map additionalProperties; + + private JournalEntriesListRequest( + Optional companyId, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Optional transactionDateAfter, + Optional transactionDateBefore, + Map additionalProperties) { + this.companyId = companyId; + 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.pageSize = pageSize; + this.remoteId = remoteId; + this.transactionDateAfter = transactionDateAfter; + this.transactionDateBefore = transactionDateBefore; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return journal entries 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 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; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("transaction_date_after") + public Optional getTransactionDateAfter() { + return transactionDateAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("transaction_date_before") + public Optional getTransactionDateBefore() { + return transactionDateBefore; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalEntriesListRequest && equalTo((JournalEntriesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(JournalEntriesListRequest other) { + return 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) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId) + && transactionDateAfter.equals(other.transactionDateAfter) + && transactionDateBefore.equals(other.transactionDateBefore); + } + + @Override + public int hashCode() { + return Objects.hash( + this.companyId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId, + this.transactionDateAfter, + this.transactionDateBefore); + } + + @Override + 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 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 remoteId = Optional.empty(); + + private Optional transactionDateAfter = Optional.empty(); + + private Optional transactionDateBefore = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(JournalEntriesListRequest other) { + companyId(other.getCompanyId()); + 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()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + transactionDateAfter(other.getTransactionDateAfter()); + transactionDateBefore(other.getTransactionDateBefore()); + 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(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; + 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; + } + + @JsonSetter(value = "transaction_date_after", nulls = Nulls.SKIP) + public Builder transactionDateAfter(Optional transactionDateAfter) { + this.transactionDateAfter = transactionDateAfter; + return this; + } + + public Builder transactionDateAfter(OffsetDateTime transactionDateAfter) { + this.transactionDateAfter = Optional.ofNullable(transactionDateAfter); + return this; + } + + @JsonSetter(value = "transaction_date_before", nulls = Nulls.SKIP) + public Builder transactionDateBefore(Optional transactionDateBefore) { + this.transactionDateBefore = transactionDateBefore; + return this; + } + + public Builder transactionDateBefore(OffsetDateTime transactionDateBefore) { + this.transactionDateBefore = Optional.ofNullable(transactionDateBefore); + return this; + } + + public JournalEntriesListRequest build() { + return new JournalEntriesListRequest( + companyId, + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + transactionDateAfter, + transactionDateBefore, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/journalentries/requests/JournalEntriesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/journalentries/requests/JournalEntriesRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..b5993ab82 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/journalentries/requests/JournalEntriesRemoteFieldClassesListRequest.java @@ -0,0 +1,243 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.journalentries.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = JournalEntriesRemoteFieldClassesListRequest.Builder.class) +public final class JournalEntriesRemoteFieldClassesListRequest { + 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 JournalEntriesRemoteFieldClassesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalEntriesRemoteFieldClassesListRequest + && equalTo((JournalEntriesRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(JournalEntriesRemoteFieldClassesListRequest 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @Override + 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(JournalEntriesRemoteFieldClassesListRequest 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 JournalEntriesRemoteFieldClassesListRequest build() { + return new JournalEntriesRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + isCommonModelField, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/journalentries/requests/JournalEntriesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/journalentries/requests/JournalEntriesRetrieveRequest.java new file mode 100644 index 000000000..78ae179c9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/journalentries/requests/JournalEntriesRetrieveRequest.java @@ -0,0 +1,150 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.journalentries.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields); + } + + @Override + 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/legacy/api/resources/accounting/journalentries/requests/JournalEntryEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/journalentries/requests/JournalEntryEndpointRequest.java new file mode 100644 index 000000000..42da4cee8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/journalentries/requests/JournalEntryEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.journalentries.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.types.JournalEntryRequest; +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 = JournalEntryEndpointRequest.Builder.class) +public final class JournalEntryEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final JournalEntryRequest model; + + private final Map additionalProperties; + + private JournalEntryEndpointRequest( + Optional isDebugMode, + Optional runAsync, + JournalEntryRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public JournalEntryRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalEntryEndpointRequest && equalTo((JournalEntryEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(JournalEntryEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull JournalEntryRequest model); + + Builder from(JournalEntryEndpointRequest other); + } + + public interface _FinalStage { + JournalEntryEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private JournalEntryRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(JournalEntryEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull JournalEntryRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public JournalEntryEndpointRequest build() { + return new JournalEntryEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/journalentries/types/JournalEntriesListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/accounting/journalentries/types/JournalEntriesListRequestExpand.java new file mode 100644 index 000000000..2a55cd304 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/journalentries/types/JournalEntriesListRequestExpand.java @@ -0,0 +1,156 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/journalentries/types/JournalEntriesRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/accounting/journalentries/types/JournalEntriesRetrieveRequestExpand.java new file mode 100644 index 000000000..8cad6688d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/journalentries/types/JournalEntriesRetrieveRequestExpand.java @@ -0,0 +1,156 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/linkedaccounts/LinkedAccountsClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/linkedaccounts/LinkedAccountsClient.java new file mode 100644 index 000000000..421ff06d0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/linkedaccounts/LinkedAccountsClient.java @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.linkedaccounts; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.linkedaccounts.requests.LinkedAccountsListRequest; +import com.merge.legacy.api.resources.accounting.types.PaginatedAccountDetailsAndActionsList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/linkedaccounts/requests/LinkedAccountsListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/linkedaccounts/requests/LinkedAccountsListRequest.java new file mode 100644 index 000000000..0dbe4139c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/linkedaccounts/requests/LinkedAccountsListRequest.java @@ -0,0 +1,452 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.linkedaccounts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/accounting/linkedaccounts/types/LinkedAccountsListRequestCategory.java b/src/main/java/com/merge/legacy/api/resources/accounting/linkedaccounts/types/LinkedAccountsListRequestCategory.java new file mode 100644 index 000000000..398e2ab71 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/linkedaccounts/types/LinkedAccountsListRequestCategory.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/linktoken/LinkTokenClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/linktoken/LinkTokenClient.java new file mode 100644 index 000000000..3ee1034b3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/linktoken/LinkTokenClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.linktoken; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.linktoken.requests.EndUserDetailsRequest; +import com.merge.legacy.api.resources.accounting.types.LinkToken; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/linktoken/requests/EndUserDetailsRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/linktoken/requests/EndUserDetailsRequest.java new file mode 100644 index 000000000..f62a182e0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/linktoken/requests/EndUserDetailsRequest.java @@ -0,0 +1,600 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.linktoken.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.types.CategoriesEnum; +import com.merge.legacy.api.resources.accounting.types.CommonModelScopesBodyRequest; +import com.merge.legacy.api.resources.accounting.types.IndividualCommonModelScopeDeserializerRequest; +import com.merge.legacy.api.resources.accounting.types.LanguageEnum; +import java.util.*; +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; + } + + @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); + } + + @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); + } + + @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() {} + + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @Override + public _FinalStage integrationSpecificConfig(Map integrationSpecificConfig) { + this.integrationSpecificConfig = Optional.ofNullable(integrationSpecificConfig); + return this; + } + + @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. + */ + @Override + public _FinalStage areSyncsDisabled(Boolean areSyncsDisabled) { + this.areSyncsDisabled = Optional.ofNullable(areSyncsDisabled); + return this; + } + + @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. + */ + @Override + public _FinalStage language(LanguageEnum language) { + this.language = Optional.ofNullable(language); + return this; + } + + @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. + */ + @Override + public _FinalStage categoryCommonModelScopes( + Map>> categoryCommonModelScopes) { + this.categoryCommonModelScopes = Optional.ofNullable(categoryCommonModelScopes); + return this; + } + + @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. + */ + @Override + public _FinalStage commonModels(List commonModels) { + this.commonModels = Optional.ofNullable(commonModels); + return this; + } + + @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. + */ + @Override + public _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink) { + this.hideAdminMagicLink = Optional.ofNullable(hideAdminMagicLink); + return this; + } + + @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. + */ + @Override + public _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl) { + this.shouldCreateMagicLinkUrl = Optional.ofNullable(shouldCreateMagicLinkUrl); + return this; + } + + @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. + */ + @Override + public _FinalStage linkExpiryMins(Integer linkExpiryMins) { + this.linkExpiryMins = Optional.ofNullable(linkExpiryMins); + return this; + } + + @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. + */ + @Override + public _FinalStage integration(String integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @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. + */ + @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. + */ + @Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + this.categories.addAll(categories); + return this; + } + + @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/legacy/api/resources/accounting/passthrough/PassthroughClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/passthrough/PassthroughClient.java new file mode 100644 index 000000000..bc2621451 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/passthrough/PassthroughClient.java @@ -0,0 +1,66 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.passthrough; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.types.DataPassthroughRequest; +import com.merge.legacy.api.resources.accounting.types.RemoteResponse; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/payments/PaymentsClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/payments/PaymentsClient.java new file mode 100644 index 000000000..ab2904412 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/payments/PaymentsClient.java @@ -0,0 +1,536 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.payments; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.payments.requests.*; +import com.merge.legacy.api.resources.accounting.types.*; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/accounting/payments/requests/PatchedPaymentEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/payments/requests/PatchedPaymentEndpointRequest.java new file mode 100644 index 000000000..34aff0c4b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/payments/requests/PatchedPaymentEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.payments.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.types.PatchedPaymentRequest; +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 = PatchedPaymentEndpointRequest.Builder.class) +public final class PatchedPaymentEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final PatchedPaymentRequest model; + + private final Map additionalProperties; + + private PatchedPaymentEndpointRequest( + Optional isDebugMode, + Optional runAsync, + PatchedPaymentRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public PatchedPaymentRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedPaymentEndpointRequest && equalTo((PatchedPaymentEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedPaymentEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull PatchedPaymentRequest model); + + Builder from(PatchedPaymentEndpointRequest other); + } + + public interface _FinalStage { + PatchedPaymentEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private PatchedPaymentRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(PatchedPaymentEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull PatchedPaymentRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public PatchedPaymentEndpointRequest build() { + return new PatchedPaymentEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/payments/requests/PaymentEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/payments/requests/PaymentEndpointRequest.java new file mode 100644 index 000000000..23b765c4d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/payments/requests/PaymentEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.payments.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.types.PaymentRequest; +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 = PaymentEndpointRequest.Builder.class) +public final class PaymentEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final PaymentRequest model; + + private final Map additionalProperties; + + private PaymentEndpointRequest( + Optional isDebugMode, + Optional runAsync, + PaymentRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public PaymentRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentEndpointRequest && equalTo((PaymentEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaymentEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull PaymentRequest model); + + Builder from(PaymentEndpointRequest other); + } + + public interface _FinalStage { + PaymentEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private PaymentRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(PaymentEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull PaymentRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public PaymentEndpointRequest build() { + return new PaymentEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/payments/requests/PaymentsLineItemsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/payments/requests/PaymentsLineItemsRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..c80b12e08 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/payments/requests/PaymentsLineItemsRemoteFieldClassesListRequest.java @@ -0,0 +1,243 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.payments.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = PaymentsLineItemsRemoteFieldClassesListRequest.Builder.class) +public final class PaymentsLineItemsRemoteFieldClassesListRequest { + 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 PaymentsLineItemsRemoteFieldClassesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentsLineItemsRemoteFieldClassesListRequest + && equalTo((PaymentsLineItemsRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaymentsLineItemsRemoteFieldClassesListRequest 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @Override + 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(PaymentsLineItemsRemoteFieldClassesListRequest 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 PaymentsLineItemsRemoteFieldClassesListRequest build() { + return new PaymentsLineItemsRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + isCommonModelField, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/payments/requests/PaymentsListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/payments/requests/PaymentsListRequest.java new file mode 100644 index 000000000..f4495827c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/payments/requests/PaymentsListRequest.java @@ -0,0 +1,563 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.payments.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.payments.types.PaymentsListRequestExpand; +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 = PaymentsListRequest.Builder.class) +public final class PaymentsListRequest { + private final Optional accountId; + + private final Optional companyId; + + private final Optional contactId; + + 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 pageSize; + + private final Optional remoteId; + + private final Optional transactionDateAfter; + + private final Optional transactionDateBefore; + + private final Map additionalProperties; + + private PaymentsListRequest( + Optional accountId, + Optional companyId, + Optional contactId, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Optional transactionDateAfter, + Optional transactionDateBefore, + Map additionalProperties) { + 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; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.remoteId = remoteId; + this.transactionDateAfter = transactionDateAfter; + this.transactionDateBefore = transactionDateBefore; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return payments for this account. + */ + @JsonProperty("account_id") + public Optional getAccountId() { + return accountId; + } + + /** + * @return If provided, will only return payments for this company. + */ + @JsonProperty("company_id") + public Optional getCompanyId() { + return companyId; + } + + /** + * @return If provided, will only return payments for this contact. + */ + @JsonProperty("contact_id") + public Optional getContactId() { + return contactId; + } + + /** + * @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 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 objects created after this datetime. + */ + @JsonProperty("transaction_date_after") + public Optional getTransactionDateAfter() { + return transactionDateAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("transaction_date_before") + public Optional getTransactionDateBefore() { + return transactionDateBefore; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentsListRequest && equalTo((PaymentsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaymentsListRequest other) { + return 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) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId) + && transactionDateAfter.equals(other.transactionDateAfter) + && transactionDateBefore.equals(other.transactionDateBefore); + } + + @Override + public int hashCode() { + return Objects.hash( + this.accountId, + this.companyId, + this.contactId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId, + this.transactionDateAfter, + this.transactionDateBefore); + } + + @Override + 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 companyId = Optional.empty(); + + private Optional contactId = 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 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(); + + private Optional transactionDateAfter = Optional.empty(); + + private Optional transactionDateBefore = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaymentsListRequest other) { + 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()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + transactionDateAfter(other.getTransactionDateAfter()); + transactionDateBefore(other.getTransactionDateBefore()); + 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 = "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 = "contact_id", nulls = Nulls.SKIP) + public Builder contactId(Optional contactId) { + this.contactId = contactId; + return this; + } + + public Builder contactId(String contactId) { + this.contactId = Optional.ofNullable(contactId); + 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(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; + 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; + } + + @JsonSetter(value = "transaction_date_after", nulls = Nulls.SKIP) + public Builder transactionDateAfter(Optional transactionDateAfter) { + this.transactionDateAfter = transactionDateAfter; + return this; + } + + public Builder transactionDateAfter(OffsetDateTime transactionDateAfter) { + this.transactionDateAfter = Optional.ofNullable(transactionDateAfter); + return this; + } + + @JsonSetter(value = "transaction_date_before", nulls = Nulls.SKIP) + public Builder transactionDateBefore(Optional transactionDateBefore) { + this.transactionDateBefore = transactionDateBefore; + return this; + } + + public Builder transactionDateBefore(OffsetDateTime transactionDateBefore) { + this.transactionDateBefore = Optional.ofNullable(transactionDateBefore); + return this; + } + + public PaymentsListRequest build() { + return new PaymentsListRequest( + accountId, + companyId, + contactId, + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + transactionDateAfter, + transactionDateBefore, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/payments/requests/PaymentsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/payments/requests/PaymentsRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..8eb633fd1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/payments/requests/PaymentsRemoteFieldClassesListRequest.java @@ -0,0 +1,243 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.payments.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = PaymentsRemoteFieldClassesListRequest.Builder.class) +public final class PaymentsRemoteFieldClassesListRequest { + 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 PaymentsRemoteFieldClassesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentsRemoteFieldClassesListRequest + && equalTo((PaymentsRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaymentsRemoteFieldClassesListRequest 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @Override + 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(PaymentsRemoteFieldClassesListRequest 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 PaymentsRemoteFieldClassesListRequest build() { + return new PaymentsRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + isCommonModelField, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/payments/requests/PaymentsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/payments/requests/PaymentsRetrieveRequest.java new file mode 100644 index 000000000..e2d5d3490 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/payments/requests/PaymentsRetrieveRequest.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.payments.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields); + } + + @Override + 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/legacy/api/resources/accounting/payments/types/PaymentsListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/accounting/payments/types/PaymentsListRequestExpand.java new file mode 100644 index 000000000..4f59036d6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/payments/types/PaymentsListRequestExpand.java @@ -0,0 +1,156 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/payments/types/PaymentsRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/accounting/payments/types/PaymentsRetrieveRequestExpand.java new file mode 100644 index 000000000..7a5813e8a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/payments/types/PaymentsRetrieveRequestExpand.java @@ -0,0 +1,156 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/phonenumbers/PhoneNumbersClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/phonenumbers/PhoneNumbersClient.java new file mode 100644 index 000000000..a8127a1fe --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/phonenumbers/PhoneNumbersClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.phonenumbers; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.phonenumbers.requests.PhoneNumbersRetrieveRequest; +import com.merge.legacy.api.resources.accounting.types.AccountingPhoneNumber; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/phonenumbers/requests/PhoneNumbersRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/phonenumbers/requests/PhoneNumbersRetrieveRequest.java new file mode 100644 index 000000000..81e5be473 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/phonenumbers/requests/PhoneNumbersRetrieveRequest.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.phonenumbers.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/accounting/purchaseorders/PurchaseOrdersClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/purchaseorders/PurchaseOrdersClient.java new file mode 100644 index 000000000..c15ef6f7d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/purchaseorders/PurchaseOrdersClient.java @@ -0,0 +1,442 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.purchaseorders; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.purchaseorders.requests.*; +import com.merge.legacy.api.resources.accounting.types.*; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/accounting/purchaseorders/requests/PurchaseOrderEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/purchaseorders/requests/PurchaseOrderEndpointRequest.java new file mode 100644 index 000000000..ac6bb91bb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/purchaseorders/requests/PurchaseOrderEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.purchaseorders.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.types.PurchaseOrderRequest; +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 = PurchaseOrderEndpointRequest.Builder.class) +public final class PurchaseOrderEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final PurchaseOrderRequest model; + + private final Map additionalProperties; + + private PurchaseOrderEndpointRequest( + Optional isDebugMode, + Optional runAsync, + PurchaseOrderRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public PurchaseOrderRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrderEndpointRequest && equalTo((PurchaseOrderEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PurchaseOrderEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull PurchaseOrderRequest model); + + Builder from(PurchaseOrderEndpointRequest other); + } + + public interface _FinalStage { + PurchaseOrderEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private PurchaseOrderRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(PurchaseOrderEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull PurchaseOrderRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public PurchaseOrderEndpointRequest build() { + return new PurchaseOrderEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/purchaseorders/requests/PurchaseOrdersLineItemsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/purchaseorders/requests/PurchaseOrdersLineItemsRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..c60529e77 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/purchaseorders/requests/PurchaseOrdersLineItemsRemoteFieldClassesListRequest.java @@ -0,0 +1,243 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.purchaseorders.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = PurchaseOrdersLineItemsRemoteFieldClassesListRequest.Builder.class) +public final class PurchaseOrdersLineItemsRemoteFieldClassesListRequest { + 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 PurchaseOrdersLineItemsRemoteFieldClassesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrdersLineItemsRemoteFieldClassesListRequest + && equalTo((PurchaseOrdersLineItemsRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PurchaseOrdersLineItemsRemoteFieldClassesListRequest 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @Override + 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(PurchaseOrdersLineItemsRemoteFieldClassesListRequest 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 PurchaseOrdersLineItemsRemoteFieldClassesListRequest build() { + return new PurchaseOrdersLineItemsRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + isCommonModelField, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/purchaseorders/requests/PurchaseOrdersListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/purchaseorders/requests/PurchaseOrdersListRequest.java new file mode 100644 index 000000000..ee153b127 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/purchaseorders/requests/PurchaseOrdersListRequest.java @@ -0,0 +1,563 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.purchaseorders.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.purchaseorders.types.PurchaseOrdersListRequestExpand; +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 = PurchaseOrdersListRequest.Builder.class) +public final class PurchaseOrdersListRequest { + 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 includeRemoteFields; + + private final Optional includeShellData; + + private final Optional issueDateAfter; + + private final Optional issueDateBefore; + + 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 PurchaseOrdersListRequest( + Optional companyId, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Optional issueDateAfter, + Optional issueDateBefore, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteFields, + Optional remoteId, + Optional showEnumOrigins, + Map additionalProperties) { + this.companyId = companyId; + 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.issueDateAfter = issueDateAfter; + this.issueDateBefore = issueDateBefore; + 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 purchase orders 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 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 objects created after this datetime. + */ + @JsonProperty("issue_date_after") + public Optional getIssueDateAfter() { + return issueDateAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("issue_date_before") + public Optional getIssueDateBefore() { + return issueDateBefore; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrdersListRequest && equalTo((PurchaseOrdersListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PurchaseOrdersListRequest other) { + return 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) + && includeShellData.equals(other.includeShellData) + && issueDateAfter.equals(other.issueDateAfter) + && issueDateBefore.equals(other.issueDateBefore) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteFields.equals(other.remoteFields) + && remoteId.equals(other.remoteId) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @Override + public int hashCode() { + return Objects.hash( + this.companyId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.issueDateAfter, + this.issueDateBefore, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteFields, + this.remoteId, + this.showEnumOrigins); + } + + @Override + 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 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 issueDateAfter = Optional.empty(); + + private Optional issueDateBefore = 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(PurchaseOrdersListRequest other) { + companyId(other.getCompanyId()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + expand(other.getExpand()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + issueDateAfter(other.getIssueDateAfter()); + issueDateBefore(other.getIssueDateBefore()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + 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 = "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; + 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 = "issue_date_after", nulls = Nulls.SKIP) + public Builder issueDateAfter(Optional issueDateAfter) { + this.issueDateAfter = issueDateAfter; + return this; + } + + public Builder issueDateAfter(OffsetDateTime issueDateAfter) { + this.issueDateAfter = Optional.ofNullable(issueDateAfter); + return this; + } + + @JsonSetter(value = "issue_date_before", nulls = Nulls.SKIP) + public Builder issueDateBefore(Optional issueDateBefore) { + this.issueDateBefore = issueDateBefore; + return this; + } + + public Builder issueDateBefore(OffsetDateTime issueDateBefore) { + this.issueDateBefore = Optional.ofNullable(issueDateBefore); + 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 PurchaseOrdersListRequest build() { + return new PurchaseOrdersListRequest( + companyId, + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + issueDateAfter, + issueDateBefore, + modifiedAfter, + modifiedBefore, + pageSize, + remoteFields, + remoteId, + showEnumOrigins, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/purchaseorders/requests/PurchaseOrdersRemoteFieldClassesListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/purchaseorders/requests/PurchaseOrdersRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..95e417b9c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/purchaseorders/requests/PurchaseOrdersRemoteFieldClassesListRequest.java @@ -0,0 +1,243 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.purchaseorders.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = PurchaseOrdersRemoteFieldClassesListRequest.Builder.class) +public final class PurchaseOrdersRemoteFieldClassesListRequest { + 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 PurchaseOrdersRemoteFieldClassesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrdersRemoteFieldClassesListRequest + && equalTo((PurchaseOrdersRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PurchaseOrdersRemoteFieldClassesListRequest 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @Override + 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(PurchaseOrdersRemoteFieldClassesListRequest 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 PurchaseOrdersRemoteFieldClassesListRequest build() { + return new PurchaseOrdersRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + isCommonModelField, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/purchaseorders/requests/PurchaseOrdersRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/purchaseorders/requests/PurchaseOrdersRetrieveRequest.java new file mode 100644 index 000000000..9b4d6eaef --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/purchaseorders/requests/PurchaseOrdersRetrieveRequest.java @@ -0,0 +1,210 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.purchaseorders.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.purchaseorders.types.PurchaseOrdersRetrieveRequestExpand; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PurchaseOrdersRetrieveRequest.Builder.class) +public final class PurchaseOrdersRetrieveRequest { + 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 PurchaseOrdersRetrieveRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrdersRetrieveRequest && equalTo((PurchaseOrdersRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PurchaseOrdersRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @Override + public int hashCode() { + return Objects.hash( + this.expand, this.includeRemoteData, this.includeRemoteFields, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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(PurchaseOrdersRetrieveRequest 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(PurchaseOrdersRetrieveRequestExpand 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 PurchaseOrdersRetrieveRequest build() { + return new PurchaseOrdersRetrieveRequest( + expand, + includeRemoteData, + includeRemoteFields, + remoteFields, + showEnumOrigins, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/purchaseorders/types/PurchaseOrdersListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/accounting/purchaseorders/types/PurchaseOrdersListRequestExpand.java new file mode 100644 index 000000000..0efcd3126 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/purchaseorders/types/PurchaseOrdersListRequestExpand.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/purchaseorders/types/PurchaseOrdersRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/accounting/purchaseorders/types/PurchaseOrdersRetrieveRequestExpand.java new file mode 100644 index 000000000..b5d29f6d7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/purchaseorders/types/PurchaseOrdersRetrieveRequestExpand.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/regeneratekey/RegenerateKeyClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/regeneratekey/RegenerateKeyClient.java new file mode 100644 index 000000000..adc9255f8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/regeneratekey/RegenerateKeyClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.regeneratekey; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.regeneratekey.requests.RemoteKeyForRegenerationRequest; +import com.merge.legacy.api.resources.accounting.types.RemoteKey; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/regeneratekey/requests/RemoteKeyForRegenerationRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/regeneratekey/requests/RemoteKeyForRegenerationRequest.java new file mode 100644 index 000000000..12a9e74ce --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/regeneratekey/requests/RemoteKeyForRegenerationRequest.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.regeneratekey.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + public RemoteKeyForRegenerationRequest build() { + return new RemoteKeyForRegenerationRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/scopes/ScopesClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/scopes/ScopesClient.java new file mode 100644 index 000000000..4ba57cce9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/scopes/ScopesClient.java @@ -0,0 +1,150 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.scopes; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.scopes.requests.LinkedAccountCommonModelScopeDeserializerRequest; +import com.merge.legacy.api.resources.accounting.types.CommonModelScopeApi; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..a407de2e2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.scopes.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.types.IndividualCommonModelScopeDeserializerRequest; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @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/legacy/api/resources/accounting/syncstatus/SyncStatusClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/syncstatus/SyncStatusClient.java new file mode 100644 index 000000000..ccf7b65e7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/syncstatus/SyncStatusClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.syncstatus; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.syncstatus.requests.SyncStatusListRequest; +import com.merge.legacy.api.resources.accounting.types.PaginatedSyncStatusList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/syncstatus/requests/SyncStatusListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/syncstatus/requests/SyncStatusListRequest.java new file mode 100644 index 000000000..a134699f8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/syncstatus/requests/SyncStatusListRequest.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.syncstatus.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.cursor, this.pageSize); + } + + @Override + 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/legacy/api/resources/accounting/taxrates/TaxRatesClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/taxrates/TaxRatesClient.java new file mode 100644 index 000000000..0f2e18abe --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/taxrates/TaxRatesClient.java @@ -0,0 +1,166 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.taxrates; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.taxrates.requests.TaxRatesListRequest; +import com.merge.legacy.api.resources.accounting.taxrates.requests.TaxRatesRetrieveRequest; +import com.merge.legacy.api.resources.accounting.types.PaginatedTaxRateList; +import com.merge.legacy.api.resources.accounting.types.TaxRate; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/taxrates/requests/TaxRatesListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/taxrates/requests/TaxRatesListRequest.java new file mode 100644 index 000000000..6f7a977a7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/taxrates/requests/TaxRatesListRequest.java @@ -0,0 +1,417 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.taxrates.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = TaxRatesListRequest.Builder.class) +public final class TaxRatesListRequest { + 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 remoteId; + + private final Map additionalProperties; + + private TaxRatesListRequest( + Optional companyId, + 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.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.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return tax rates 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 The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TaxRatesListRequest && equalTo((TaxRatesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TaxRatesListRequest other) { + return 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) + && remoteId.equals(other.remoteId); + } + + @Override + public int hashCode() { + return Objects.hash( + this.companyId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @Override + 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 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(TaxRatesListRequest other) { + 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()); + 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 = "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 TaxRatesListRequest build() { + return new TaxRatesListRequest( + companyId, + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/taxrates/requests/TaxRatesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/taxrates/requests/TaxRatesRetrieveRequest.java new file mode 100644 index 000000000..860d898c0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/taxrates/requests/TaxRatesRetrieveRequest.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.taxrates.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/accounting/trackingcategories/TrackingCategoriesClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/trackingcategories/TrackingCategoriesClient.java new file mode 100644 index 000000000..9781e80a7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/trackingcategories/TrackingCategoriesClient.java @@ -0,0 +1,181 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.trackingcategories; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.trackingcategories.requests.TrackingCategoriesListRequest; +import com.merge.legacy.api.resources.accounting.trackingcategories.requests.TrackingCategoriesRetrieveRequest; +import com.merge.legacy.api.resources.accounting.types.PaginatedTrackingCategoryList; +import com.merge.legacy.api.resources.accounting.types.TrackingCategory; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/trackingcategories/requests/TrackingCategoriesListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/trackingcategories/requests/TrackingCategoriesListRequest.java new file mode 100644 index 000000000..a885189d8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/trackingcategories/requests/TrackingCategoriesListRequest.java @@ -0,0 +1,475 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.trackingcategories.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = TrackingCategoriesListRequest.Builder.class) +public final class TrackingCategoriesListRequest { + 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 TrackingCategoriesListRequest( + 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.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 return tracking categories 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TrackingCategoriesListRequest && equalTo((TrackingCategoriesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TrackingCategoriesListRequest other) { + return 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); + } + + @Override + public int hashCode() { + return Objects.hash( + 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); + } + + @Override + 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 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(TrackingCategoriesListRequest other) { + 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 = "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(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 TrackingCategoriesListRequest build() { + return new TrackingCategoriesListRequest( + companyId, + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteFields, + remoteId, + showEnumOrigins, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/trackingcategories/requests/TrackingCategoriesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/trackingcategories/requests/TrackingCategoriesRetrieveRequest.java new file mode 100644 index 000000000..2fd39f3e4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/trackingcategories/requests/TrackingCategoriesRetrieveRequest.java @@ -0,0 +1,176 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.trackingcategories.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = TrackingCategoriesRetrieveRequest.Builder.class) +public final class TrackingCategoriesRetrieveRequest { + private final Optional expand; + + private final Optional includeRemoteData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private TrackingCategoriesRetrieveRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TrackingCategoriesRetrieveRequest && equalTo((TrackingCategoriesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TrackingCategoriesRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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(TrackingCategoriesRetrieveRequest 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 TrackingCategoriesRetrieveRequest build() { + return new TrackingCategoriesRetrieveRequest( + expand, includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/transactions/TransactionsClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/transactions/TransactionsClient.java new file mode 100644 index 000000000..33baa5f89 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/transactions/TransactionsClient.java @@ -0,0 +1,176 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.transactions; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.transactions.requests.TransactionsListRequest; +import com.merge.legacy.api.resources.accounting.transactions.requests.TransactionsRetrieveRequest; +import com.merge.legacy.api.resources.accounting.types.PaginatedTransactionList; +import com.merge.legacy.api.resources.accounting.types.Transaction; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/accounting/transactions/requests/TransactionsListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/transactions/requests/TransactionsListRequest.java new file mode 100644 index 000000000..3b96462dc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/transactions/requests/TransactionsListRequest.java @@ -0,0 +1,476 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.transactions.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.transactions.types.TransactionsListRequestExpand; +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 = TransactionsListRequest.Builder.class) +public final class TransactionsListRequest { + 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 remoteId; + + private final Optional transactionDateAfter; + + private final Optional transactionDateBefore; + + private final Map additionalProperties; + + private TransactionsListRequest( + Optional companyId, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Optional transactionDateAfter, + Optional transactionDateBefore, + Map additionalProperties) { + 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.remoteId = remoteId; + this.transactionDateAfter = transactionDateAfter; + this.transactionDateBefore = transactionDateBefore; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return accounting transactions 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 The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("transaction_date_after") + public Optional getTransactionDateAfter() { + return transactionDateAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("transaction_date_before") + public Optional getTransactionDateBefore() { + return transactionDateBefore; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TransactionsListRequest && equalTo((TransactionsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TransactionsListRequest other) { + return 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) + && remoteId.equals(other.remoteId) + && transactionDateAfter.equals(other.transactionDateAfter) + && transactionDateBefore.equals(other.transactionDateBefore); + } + + @Override + public int hashCode() { + return Objects.hash( + this.companyId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId, + this.transactionDateAfter, + this.transactionDateBefore); + } + + @Override + 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 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(); + + private Optional transactionDateAfter = Optional.empty(); + + private Optional transactionDateBefore = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TransactionsListRequest other) { + 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()); + remoteId(other.getRemoteId()); + transactionDateAfter(other.getTransactionDateAfter()); + transactionDateBefore(other.getTransactionDateBefore()); + 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(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; + 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 = "transaction_date_after", nulls = Nulls.SKIP) + public Builder transactionDateAfter(Optional transactionDateAfter) { + this.transactionDateAfter = transactionDateAfter; + return this; + } + + public Builder transactionDateAfter(OffsetDateTime transactionDateAfter) { + this.transactionDateAfter = Optional.ofNullable(transactionDateAfter); + return this; + } + + @JsonSetter(value = "transaction_date_before", nulls = Nulls.SKIP) + public Builder transactionDateBefore(Optional transactionDateBefore) { + this.transactionDateBefore = transactionDateBefore; + return this; + } + + public Builder transactionDateBefore(OffsetDateTime transactionDateBefore) { + this.transactionDateBefore = Optional.ofNullable(transactionDateBefore); + return this; + } + + public TransactionsListRequest build() { + return new TransactionsListRequest( + companyId, + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + transactionDateAfter, + transactionDateBefore, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/transactions/requests/TransactionsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/transactions/requests/TransactionsRetrieveRequest.java new file mode 100644 index 000000000..2c944df34 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/transactions/requests/TransactionsRetrieveRequest.java @@ -0,0 +1,121 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.transactions.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/accounting/transactions/types/TransactionsListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/accounting/transactions/types/TransactionsListRequestExpand.java new file mode 100644 index 000000000..9abba3cd3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/transactions/types/TransactionsListRequestExpand.java @@ -0,0 +1,85 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/transactions/types/TransactionsRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/accounting/transactions/types/TransactionsRetrieveRequestExpand.java new file mode 100644 index 000000000..dcff1aae6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/transactions/types/TransactionsRetrieveRequestExpand.java @@ -0,0 +1,85 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/Account.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/Account.java new file mode 100644 index 000000000..a0c55e02d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/Account.java @@ -0,0 +1,915 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/accounting/types/AccountAccountType.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountAccountType.java new file mode 100644 index 000000000..4f1085cb4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountAccountType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/AccountAccountTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountAccountTypeEnum.java new file mode 100644 index 000000000..7b49228d7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountAccountTypeEnum.java @@ -0,0 +1,46 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AccountAccountTypeEnum { + 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"); + + private final String value; + + AccountAccountTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountClassification.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountClassification.java new file mode 100644 index 000000000..e982a7084 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountClassification.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/AccountCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountCurrency.java new file mode 100644 index 000000000..66f6c9a44 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/AccountDetails.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountDetails.java new file mode 100644 index 000000000..818786421 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountDetails.java @@ -0,0 +1,387 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/accounting/types/AccountDetailsAndActions.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountDetailsAndActions.java new file mode 100644 index 000000000..a1c8ad3ab --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountDetailsAndActions.java @@ -0,0 +1,474 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("id") + public StatusStage id(@NotNull String id) { + this.id = id; + return this; + } + + @Override + @JsonSetter("status") + public EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status) { + this.status = status; + return this; + } + + @Override + @JsonSetter("end_user_organization_name") + public EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + @Override + @JsonSetter("end_user_email_address") + public WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + @Override + @JsonSetter("webhook_listener_url") + public AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl) { + this.webhookListenerUrl = webhookListenerUrl; + return this; + } + + @Override + @JsonSetter("account_type") + public CompletedAtStage accountType(@NotNull String accountType) { + this.accountType = accountType; + return this; + } + + @Override + @JsonSetter("completed_at") + public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { + this.completedAt = completedAt; + return this; + } + + @Override + public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @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. + */ + @Override + public _FinalStage isDuplicate(Boolean isDuplicate) { + this.isDuplicate = Optional.ofNullable(isDuplicate); + return this; + } + + @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. + */ + @Override + public _FinalStage subdomain(String subdomain) { + this.subdomain = Optional.ofNullable(subdomain); + return this; + } + + @Override + @JsonSetter(value = "subdomain", nulls = Nulls.SKIP) + public _FinalStage subdomain(Optional subdomain) { + this.subdomain = subdomain; + return this; + } + + @Override + public _FinalStage endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @Override + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public _FinalStage endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + @Override + public _FinalStage statusDetail(String statusDetail) { + this.statusDetail = Optional.ofNullable(statusDetail); + return this; + } + + @Override + @JsonSetter(value = "status_detail", nulls = Nulls.SKIP) + public _FinalStage statusDetail(Optional statusDetail) { + this.statusDetail = statusDetail; + return this; + } + + @Override + public _FinalStage category(CategoryEnum category) { + this.category = Optional.ofNullable(category); + return this; + } + + @Override + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public _FinalStage category(Optional category) { + this.category = category; + return this; + } + + @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/legacy/api/resources/accounting/types/AccountDetailsAndActionsIntegration.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountDetailsAndActionsIntegration.java new file mode 100644 index 000000000..9400aeff7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountDetailsAndActionsIntegration.java @@ -0,0 +1,317 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.categories, + this.image, + this.squareImage, + this.color, + this.slug, + this.passthroughAvailable, + this.availableModelOperations); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("name") + public ColorStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + @JsonSetter("color") + public SlugStage color(@NotNull String color) { + this.color = color; + return this; + } + + @Override + @JsonSetter("slug") + public PassthroughAvailableStage slug(@NotNull String slug) { + this.slug = slug; + return this; + } + + @Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @Override + @JsonSetter(value = "square_image", nulls = Nulls.SKIP) + public _FinalStage squareImage(Optional squareImage) { + this.squareImage = squareImage; + return this; + } + + @Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @Override + @JsonSetter(value = "image", nulls = Nulls.SKIP) + public _FinalStage image(Optional image) { + this.image = image; + return this; + } + + @Override + public _FinalStage addAllCategories(List categories) { + this.categories.addAll(categories); + return this; + } + + @Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + this.categories.addAll(categories); + return this; + } + + @Override + public AccountDetailsAndActionsIntegration build() { + return new AccountDetailsAndActionsIntegration( + name, + categories, + image, + squareImage, + color, + slug, + passthroughAvailable, + availableModelOperations, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountDetailsAndActionsStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountDetailsAndActionsStatusEnum.java new file mode 100644 index 000000000..95284037f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountDetailsAndActionsStatusEnum.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountIntegration.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountIntegration.java new file mode 100644 index 000000000..e0a6f500e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountIntegration.java @@ -0,0 +1,453 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @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); + } + + @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() {} + + @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. + */ + @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. + */ + @Override + public _FinalStage categoryBetaStatus(Map categoryBetaStatus) { + this.categoryBetaStatus = Optional.ofNullable(categoryBetaStatus); + return this; + } + + @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. + */ + @Override + public _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl) { + this.webhookSetupGuideUrl = Optional.ofNullable(webhookSetupGuideUrl); + return this; + } + + @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. + */ + @Override + public _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = Optional.ofNullable(apiEndpointsToDocumentationUrls); + return this; + } + + @Override + @JsonSetter(value = "api_endpoints_to_documentation_urls", nulls = Nulls.SKIP) + public _FinalStage apiEndpointsToDocumentationUrls( + Optional> apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; + return this; + } + + @Override + public _FinalStage slug(String slug) { + this.slug = Optional.ofNullable(slug); + return this; + } + + @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. + */ + @Override + public _FinalStage color(String color) { + this.color = Optional.ofNullable(color); + return this; + } + + @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. + */ + @Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @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. + */ + @Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @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. + */ + @Override + public _FinalStage categories(List categories) { + this.categories = Optional.ofNullable(categories); + return this; + } + + @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. + */ + @Override + public _FinalStage abbreviatedName(String abbreviatedName) { + this.abbreviatedName = Optional.ofNullable(abbreviatedName); + return this; + } + + @Override + @JsonSetter(value = "abbreviated_name", nulls = Nulls.SKIP) + public _FinalStage abbreviatedName(Optional abbreviatedName) { + this.abbreviatedName = abbreviatedName; + return this; + } + + @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/legacy/api/resources/accounting/types/AccountRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountRequest.java new file mode 100644 index 000000000..77a255e10 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountRequest.java @@ -0,0 +1,775 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/accounting/types/AccountRequestAccountType.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountRequestAccountType.java new file mode 100644 index 000000000..5f9291fe4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountRequestAccountType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/AccountRequestClassification.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountRequestClassification.java new file mode 100644 index 000000000..1f07d7044 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountRequestClassification.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/AccountRequestCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountRequestCurrency.java new file mode 100644 index 000000000..18d01c4c7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountRequestCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/AccountRequestStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountRequestStatus.java new file mode 100644 index 000000000..0605484ad --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountRequestStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/AccountResponse.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountResponse.java new file mode 100644 index 000000000..e409994f4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountResponse.Builder.class) +public final class AccountResponse { + private final Account model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private AccountResponse( + Account 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 Account getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountResponse && equalTo((AccountResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull Account model); + + Builder from(AccountResponse other); + } + + public interface _FinalStage { + AccountResponse 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 Account model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(AccountResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull Account model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public AccountResponse build() { + return new AccountResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountStatus.java new file mode 100644 index 000000000..7b59c0538 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/AccountStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountStatusEnum.java new file mode 100644 index 000000000..b47450098 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountStatusEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AccountStatusEnum { + ACTIVE("ACTIVE"), + + PENDING("PENDING"), + + INACTIVE("INACTIVE"); + + private final String value; + + AccountStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountToken.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountToken.java new file mode 100644 index 000000000..6fa38fdda --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountToken.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.accountToken, this.integration); + } + + @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() {} + + @Override + public Builder from(AccountToken other) { + accountToken(other.getAccountToken()); + integration(other.getIntegration()); + return this; + } + + @Override + @JsonSetter("account_token") + public IntegrationStage accountToken(@NotNull String accountToken) { + this.accountToken = accountToken; + return this; + } + + @Override + @JsonSetter("integration") + public _FinalStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @Override + public AccountToken build() { + return new AccountToken(accountToken, integration, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountingAttachment.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountingAttachment.java new file mode 100644 index 000000000..f9912032a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountingAttachment.java @@ -0,0 +1,348 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountingAttachment.Builder.class) +public final class AccountingAttachment { + 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 company; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private AccountingAttachment( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional fileName, + Optional fileUrl, + Optional company, + 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.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 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 The company the accounting attachment 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountingAttachment && equalTo((AccountingAttachment) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountingAttachment 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) + && company.equals(other.company) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.fileName, + this.fileUrl, + this.company, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 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(AccountingAttachment other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + fileName(other.getFileName()); + fileUrl(other.getFileUrl()); + 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 = "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 = "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 AccountingAttachment build() { + return new AccountingAttachment( + id, + remoteId, + createdAt, + modifiedAt, + fileName, + fileUrl, + company, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountingAttachmentRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountingAttachmentRequest.java new file mode 100644 index 000000000..437e117fa --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountingAttachmentRequest.java @@ -0,0 +1,199 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = AccountingAttachmentRequest.Builder.class) +public final class AccountingAttachmentRequest { + private final Optional fileName; + + private final Optional fileUrl; + + private final Optional company; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private AccountingAttachmentRequest( + Optional fileName, + Optional fileUrl, + Optional company, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.fileName = fileName; + this.fileUrl = fileUrl; + this.company = company; + 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 The company the accounting attachment 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountingAttachmentRequest && equalTo((AccountingAttachmentRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountingAttachmentRequest other) { + return fileName.equals(other.fileName) + && fileUrl.equals(other.fileUrl) + && company.equals(other.company) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @Override + public int hashCode() { + return Objects.hash( + this.fileName, this.fileUrl, this.company, this.integrationParams, this.linkedAccountParams); + } + + @Override + 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 company = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountingAttachmentRequest other) { + fileName(other.getFileName()); + fileUrl(other.getFileUrl()); + company(other.getCompany()); + 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 = "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 AccountingAttachmentRequest build() { + return new AccountingAttachmentRequest( + fileName, fileUrl, company, integrationParams, linkedAccountParams, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountingAttachmentResponse.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountingAttachmentResponse.java new file mode 100644 index 000000000..65aee608d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountingAttachmentResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountingAttachmentResponse.Builder.class) +public final class AccountingAttachmentResponse { + private final AccountingAttachment model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private AccountingAttachmentResponse( + AccountingAttachment 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 AccountingAttachment getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountingAttachmentResponse && equalTo((AccountingAttachmentResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountingAttachmentResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull AccountingAttachment model); + + Builder from(AccountingAttachmentResponse other); + } + + public interface _FinalStage { + AccountingAttachmentResponse 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 AccountingAttachment model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(AccountingAttachmentResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull AccountingAttachment model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public AccountingAttachmentResponse build() { + return new AccountingAttachmentResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountingPeriod.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountingPeriod.java new file mode 100644 index 000000000..aa2aa790a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountingPeriod.java @@ -0,0 +1,345 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountingPeriod.Builder.class) +public final class AccountingPeriod { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional status; + + private final Optional startDate; + + private final Optional endDate; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private AccountingPeriod( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional status, + Optional startDate, + Optional endDate, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.status = status; + this.startDate = startDate; + this.endDate = endDate; + 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 Name of the accounting period. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return Beginning date of the period + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return End date of the period + */ + @JsonProperty("end_date") + public Optional getEndDate() { + return endDate; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountingPeriod && equalTo((AccountingPeriod) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountingPeriod other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && status.equals(other.status) + && startDate.equals(other.startDate) + && endDate.equals(other.endDate) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.status, + this.startDate, + this.endDate, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 status = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional endDate = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountingPeriod other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + status(other.getStatus()); + startDate(other.getStartDate()); + endDate(other.getEndDate()); + 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 = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(AccountingPeriodStatus status) { + this.status = Optional.ofNullable(status); + 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 = "end_date", nulls = Nulls.SKIP) + public Builder endDate(Optional endDate) { + this.endDate = endDate; + return this; + } + + public Builder endDate(OffsetDateTime endDate) { + this.endDate = Optional.ofNullable(endDate); + 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 AccountingPeriod build() { + return new AccountingPeriod( + id, + remoteId, + createdAt, + modifiedAt, + name, + status, + startDate, + endDate, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountingPeriodStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountingPeriodStatus.java new file mode 100644 index 000000000..1a3d2a031 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountingPeriodStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/AccountingPhoneNumber.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountingPhoneNumber.java new file mode 100644 index 000000000..45540dd2d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountingPhoneNumber.java @@ -0,0 +1,176 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = AccountingPhoneNumber.Builder.class) +public final class AccountingPhoneNumber { + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional number; + + private final Optional type; + + private final Map additionalProperties; + + private AccountingPhoneNumber( + Optional createdAt, + Optional modifiedAt, + Optional number, + Optional type, + Map additionalProperties) { + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.number = number; + this.type = type; + 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("number") + public Optional getNumber() { + return number; + } + + /** + * @return The phone number's type. + */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountingPhoneNumber && equalTo((AccountingPhoneNumber) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountingPhoneNumber other) { + return createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && number.equals(other.number) + && type.equals(other.type); + } + + @Override + public int hashCode() { + return Objects.hash(this.createdAt, this.modifiedAt, this.number, this.type); + } + + @Override + 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 number = Optional.empty(); + + private Optional type = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountingPhoneNumber other) { + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + number(other.getNumber()); + type(other.getType()); + 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 = "number", nulls = Nulls.SKIP) + public Builder number(Optional number) { + this.number = number; + return this; + } + + public Builder number(String number) { + this.number = Optional.ofNullable(number); + 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; + } + + public AccountingPhoneNumber build() { + return new AccountingPhoneNumber(createdAt, modifiedAt, number, type, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountingPhoneNumberRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountingPhoneNumberRequest.java new file mode 100644 index 000000000..21d1c2bd7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AccountingPhoneNumberRequest.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = AccountingPhoneNumberRequest.Builder.class) +public final class AccountingPhoneNumberRequest { + private final Optional number; + + private final Optional type; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private AccountingPhoneNumberRequest( + Optional number, + Optional type, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.number = number; + this.type = type; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The phone number. + */ + @JsonProperty("number") + public Optional getNumber() { + return number; + } + + /** + * @return The phone number's type. + */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountingPhoneNumberRequest && equalTo((AccountingPhoneNumberRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountingPhoneNumberRequest other) { + return number.equals(other.number) + && type.equals(other.type) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @Override + public int hashCode() { + return Objects.hash(this.number, this.type, this.integrationParams, this.linkedAccountParams); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional number = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountingPhoneNumberRequest other) { + number(other.getNumber()); + type(other.getType()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + return this; + } + + @JsonSetter(value = "number", nulls = Nulls.SKIP) + public Builder number(Optional number) { + this.number = number; + return this; + } + + public Builder number(String number) { + this.number = Optional.ofNullable(number); + 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 = "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 AccountingPhoneNumberRequest build() { + return new AccountingPhoneNumberRequest( + number, type, integrationParams, linkedAccountParams, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/Address.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/Address.java new file mode 100644 index 000000000..5251b7bd8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/Address.java @@ -0,0 +1,612 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/accounting/types/AddressCountry.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AddressCountry.java new file mode 100644 index 000000000..1b7a61cc0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AddressCountry.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/AddressRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AddressRequest.java new file mode 100644 index 000000000..ff5d28474 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AddressRequest.java @@ -0,0 +1,579 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/accounting/types/AddressRequestCountry.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AddressRequestCountry.java new file mode 100644 index 000000000..75cc8703b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AddressRequestCountry.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/AddressRequestType.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AddressRequestType.java new file mode 100644 index 000000000..a4ecd1829 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AddressRequestType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/AddressType.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AddressType.java new file mode 100644 index 000000000..a818570f8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AddressType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/AddressTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AddressTypeEnum.java new file mode 100644 index 000000000..5beef264d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AddressTypeEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/AdvancedMetadata.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AdvancedMetadata.java new file mode 100644 index 000000000..4d3a6c852 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AdvancedMetadata.java @@ -0,0 +1,250 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, this.displayName, this.description, this.isRequired, this.isCustom, this.fieldChoices); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = id; + return this; + } + + @Override + public _FinalStage fieldChoices(List fieldChoices) { + this.fieldChoices = Optional.ofNullable(fieldChoices); + return this; + } + + @Override + @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) + public _FinalStage fieldChoices(Optional> fieldChoices) { + this.fieldChoices = fieldChoices; + return this; + } + + @Override + public _FinalStage isCustom(Boolean isCustom) { + this.isCustom = Optional.ofNullable(isCustom); + return this; + } + + @Override + @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) + public _FinalStage isCustom(Optional isCustom) { + this.isCustom = isCustom; + return this; + } + + @Override + public _FinalStage isRequired(Boolean isRequired) { + this.isRequired = Optional.ofNullable(isRequired); + return this; + } + + @Override + @JsonSetter(value = "is_required", nulls = Nulls.SKIP) + public _FinalStage isRequired(Optional isRequired) { + this.isRequired = isRequired; + return this; + } + + @Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + @Override + public _FinalStage displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @Override + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public _FinalStage displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + @Override + public AdvancedMetadata build() { + return new AdvancedMetadata( + id, displayName, description, isRequired, isCustom, fieldChoices, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/AsyncPassthroughReciept.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AsyncPassthroughReciept.java new file mode 100644 index 000000000..4ada5efe3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AsyncPassthroughReciept.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.asyncPassthroughReceiptId); + } + + @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() {} + + @Override + public Builder from(AsyncPassthroughReciept other) { + asyncPassthroughReceiptId(other.getAsyncPassthroughReceiptId()); + return this; + } + + @Override + @JsonSetter("async_passthrough_receipt_id") + public _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId) { + this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; + return this; + } + + @Override + public AsyncPassthroughReciept build() { + return new AsyncPassthroughReciept(asyncPassthroughReceiptId, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/AsyncPostTask.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AsyncPostTask.java new file mode 100644 index 000000000..dcd7f6d7d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AsyncPostTask.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = AsyncPostTask.Builder.class) +public final class AsyncPostTask { + private final AsyncPostTaskStatus status; + + private final AsyncPostTaskResult result; + + private final Map additionalProperties; + + private AsyncPostTask( + AsyncPostTaskStatus status, AsyncPostTaskResult result, Map additionalProperties) { + this.status = status; + this.result = result; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("status") + public AsyncPostTaskStatus getStatus() { + return status; + } + + @JsonProperty("result") + public AsyncPostTaskResult getResult() { + return result; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncPostTask && equalTo((AsyncPostTask) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AsyncPostTask other) { + return status.equals(other.status) && result.equals(other.result); + } + + @Override + public int hashCode() { + return Objects.hash(this.status, this.result); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static StatusStage builder() { + return new Builder(); + } + + public interface StatusStage { + ResultStage status(@NotNull AsyncPostTaskStatus status); + + Builder from(AsyncPostTask other); + } + + public interface ResultStage { + _FinalStage result(@NotNull AsyncPostTaskResult result); + } + + public interface _FinalStage { + AsyncPostTask build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements StatusStage, ResultStage, _FinalStage { + private AsyncPostTaskStatus status; + + private AsyncPostTaskResult result; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(AsyncPostTask other) { + status(other.getStatus()); + result(other.getResult()); + return this; + } + + @Override + @JsonSetter("status") + public ResultStage status(@NotNull AsyncPostTaskStatus status) { + this.status = status; + return this; + } + + @Override + @JsonSetter("result") + public _FinalStage result(@NotNull AsyncPostTaskResult result) { + this.result = result; + return this; + } + + @Override + public AsyncPostTask build() { + return new AsyncPostTask(status, result, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/AsyncPostTaskResult.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AsyncPostTaskResult.java new file mode 100644 index 000000000..daa9456de --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AsyncPostTaskResult.java @@ -0,0 +1,115 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = AsyncPostTaskResult.Builder.class) +public final class AsyncPostTaskResult { + private final Optional statusCode; + + private final Optional> response; + + private final Map additionalProperties; + + private AsyncPostTaskResult( + Optional statusCode, + Optional> response, + Map additionalProperties) { + this.statusCode = statusCode; + this.response = response; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("status_code") + public Optional getStatusCode() { + return statusCode; + } + + @JsonProperty("response") + public Optional> getResponse() { + return response; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncPostTaskResult && equalTo((AsyncPostTaskResult) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AsyncPostTaskResult other) { + return statusCode.equals(other.statusCode) && response.equals(other.response); + } + + @Override + public int hashCode() { + return Objects.hash(this.statusCode, this.response); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional statusCode = Optional.empty(); + + private Optional> response = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AsyncPostTaskResult other) { + statusCode(other.getStatusCode()); + response(other.getResponse()); + return this; + } + + @JsonSetter(value = "status_code", nulls = Nulls.SKIP) + public Builder statusCode(Optional statusCode) { + this.statusCode = statusCode; + return this; + } + + public Builder statusCode(Integer statusCode) { + this.statusCode = Optional.ofNullable(statusCode); + return this; + } + + @JsonSetter(value = "response", nulls = Nulls.SKIP) + public Builder response(Optional> response) { + this.response = response; + return this; + } + + public Builder response(Map response) { + this.response = Optional.ofNullable(response); + return this; + } + + public AsyncPostTaskResult build() { + return new AsyncPostTaskResult(statusCode, response, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/AsyncPostTaskStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AsyncPostTaskStatus.java new file mode 100644 index 000000000..1b8913d16 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AsyncPostTaskStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/AsyncPostTaskStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AsyncPostTaskStatusEnum.java new file mode 100644 index 000000000..63573f8c7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AsyncPostTaskStatusEnum.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AsyncPostTaskStatusEnum { + QUEUED("QUEUED"), + + IN_PROGRESS("IN_PROGRESS"), + + COMPLETED("COMPLETED"), + + FAILURE("FAILURE"); + + private final String value; + + AsyncPostTaskStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/AuditLogEvent.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AuditLogEvent.java new file mode 100644 index 000000000..7f49fc45d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AuditLogEvent.java @@ -0,0 +1,441 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.userName, + this.userEmail, + this.role, + this.ipAddress, + this.eventType, + this.eventDescription, + this.createdAt); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("role") + public IpAddressStage role(@NotNull AuditLogEventRole role) { + this.role = role; + return this; + } + + @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. + */ + @Override + @JsonSetter("event_type") + public EventDescriptionStage eventType(@NotNull AuditLogEventEventType eventType) { + this.eventType = eventType; + return this; + } + + @Override + @JsonSetter("event_description") + public _FinalStage eventDescription(@NotNull String eventDescription) { + this.eventDescription = eventDescription; + return this; + } + + @Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @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. + */ + @Override + public _FinalStage userEmail(String userEmail) { + this.userEmail = Optional.ofNullable(userEmail); + return this; + } + + @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. + */ + @Override + public _FinalStage userName(String userName) { + this.userName = Optional.ofNullable(userName); + return this; + } + + @Override + @JsonSetter(value = "user_name", nulls = Nulls.SKIP) + public _FinalStage userName(Optional userName) { + this.userName = userName; + return this; + } + + @Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @Override + public AuditLogEvent build() { + return new AuditLogEvent( + id, + userName, + userEmail, + role, + ipAddress, + eventType, + eventDescription, + createdAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/AuditLogEventEventType.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AuditLogEventEventType.java new file mode 100644 index 000000000..68331861d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AuditLogEventEventType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/AuditLogEventRole.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AuditLogEventRole.java new file mode 100644 index 000000000..ee76ba76b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AuditLogEventRole.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/AvailableActions.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/AvailableActions.java new file mode 100644 index 000000000..812e5fb8a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/AvailableActions.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.integration, this.passthroughAvailable, this.availableModelOperations); + } + + @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() {} + + @Override + public Builder from(AvailableActions other) { + integration(other.getIntegration()); + passthroughAvailable(other.getPassthroughAvailable()); + availableModelOperations(other.getAvailableModelOperations()); + return this; + } + + @Override + @JsonSetter("integration") + public PassthroughAvailableStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @Override + public AvailableActions build() { + return new AvailableActions( + integration, passthroughAvailable, availableModelOperations, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/BalanceSheet.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/BalanceSheet.java new file mode 100644 index 000000000..9590e4e8a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/BalanceSheet.java @@ -0,0 +1,821 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BalanceSheet.Builder.class) +public final class BalanceSheet { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional currency; + + private final Optional company; + + private final Optional date; + + private final Optional netAssets; + + private final Optional> assets; + + private final Optional> liabilities; + + private final Optional> equity; + + private final Optional remoteGeneratedAt; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private BalanceSheet( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional currency, + Optional company, + Optional date, + Optional netAssets, + Optional> assets, + Optional> liabilities, + Optional> equity, + Optional remoteGeneratedAt, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.currency = currency; + this.company = company; + this.date = date; + this.netAssets = netAssets; + this.assets = assets; + this.liabilities = liabilities; + this.equity = equity; + this.remoteGeneratedAt = remoteGeneratedAt; + 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 balance sheet's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The balance sheet'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 Company object for the given BalanceSheet object. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The balance sheet's date. The balance sheet data will reflect the company's financial position this point in time. + */ + @JsonProperty("date") + public Optional getDate() { + return date; + } + + /** + * @return The balance sheet's net assets. + */ + @JsonProperty("net_assets") + public Optional getNetAssets() { + return netAssets; + } + + @JsonProperty("assets") + public Optional> getAssets() { + return assets; + } + + @JsonProperty("liabilities") + public Optional> getLiabilities() { + return liabilities; + } + + @JsonProperty("equity") + public Optional> getEquity() { + return equity; + } + + /** + * @return The time that balance sheet was generated by the accounting system. + */ + @JsonProperty("remote_generated_at") + public Optional getRemoteGeneratedAt() { + return remoteGeneratedAt; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BalanceSheet && equalTo((BalanceSheet) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BalanceSheet other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && currency.equals(other.currency) + && company.equals(other.company) + && date.equals(other.date) + && netAssets.equals(other.netAssets) + && assets.equals(other.assets) + && liabilities.equals(other.liabilities) + && equity.equals(other.equity) + && remoteGeneratedAt.equals(other.remoteGeneratedAt) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.currency, + this.company, + this.date, + this.netAssets, + this.assets, + this.liabilities, + this.equity, + this.remoteGeneratedAt, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 currency = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional date = Optional.empty(); + + private Optional netAssets = Optional.empty(); + + private Optional> assets = Optional.empty(); + + private Optional> liabilities = Optional.empty(); + + private Optional> equity = Optional.empty(); + + private Optional remoteGeneratedAt = 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(BalanceSheet other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + currency(other.getCurrency()); + company(other.getCompany()); + date(other.getDate()); + netAssets(other.getNetAssets()); + assets(other.getAssets()); + liabilities(other.getLiabilities()); + equity(other.getEquity()); + remoteGeneratedAt(other.getRemoteGeneratedAt()); + 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 = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(BalanceSheetCurrency 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(BalanceSheetCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "date", nulls = Nulls.SKIP) + public Builder date(Optional date) { + this.date = date; + return this; + } + + public Builder date(OffsetDateTime date) { + this.date = Optional.ofNullable(date); + return this; + } + + @JsonSetter(value = "net_assets", nulls = Nulls.SKIP) + public Builder netAssets(Optional netAssets) { + this.netAssets = netAssets; + return this; + } + + public Builder netAssets(Double netAssets) { + this.netAssets = Optional.ofNullable(netAssets); + return this; + } + + @JsonSetter(value = "assets", nulls = Nulls.SKIP) + public Builder assets(Optional> assets) { + this.assets = assets; + return this; + } + + public Builder assets(List assets) { + this.assets = Optional.ofNullable(assets); + return this; + } + + @JsonSetter(value = "liabilities", nulls = Nulls.SKIP) + public Builder liabilities(Optional> liabilities) { + this.liabilities = liabilities; + return this; + } + + public Builder liabilities(List liabilities) { + this.liabilities = Optional.ofNullable(liabilities); + return this; + } + + @JsonSetter(value = "equity", nulls = Nulls.SKIP) + public Builder equity(Optional> equity) { + this.equity = equity; + return this; + } + + public Builder equity(List equity) { + this.equity = Optional.ofNullable(equity); + return this; + } + + @JsonSetter(value = "remote_generated_at", nulls = Nulls.SKIP) + public Builder remoteGeneratedAt(Optional remoteGeneratedAt) { + this.remoteGeneratedAt = remoteGeneratedAt; + return this; + } + + public Builder remoteGeneratedAt(OffsetDateTime remoteGeneratedAt) { + this.remoteGeneratedAt = Optional.ofNullable(remoteGeneratedAt); + 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 BalanceSheet build() { + return new BalanceSheet( + id, + remoteId, + createdAt, + modifiedAt, + name, + currency, + company, + date, + netAssets, + assets, + liabilities, + equity, + remoteGeneratedAt, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/BalanceSheetCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/BalanceSheetCompany.java new file mode 100644 index 000000000..4abea3cb2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/BalanceSheetCompany.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = BalanceSheetCompany.Deserializer.class) +public final class BalanceSheetCompany { + private final Object value; + + private final int type; + + private BalanceSheetCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BalanceSheetCompany && equalTo((BalanceSheetCompany) other); + } + + private boolean equalTo(BalanceSheetCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static BalanceSheetCompany of(String value) { + return new BalanceSheetCompany(value, 0); + } + + public static BalanceSheetCompany of(CompanyInfo value) { + return new BalanceSheetCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(BalanceSheetCompany.class); + } + + @Override + public BalanceSheetCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/BalanceSheetCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/BalanceSheetCurrency.java new file mode 100644 index 000000000..e1094dab1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/BalanceSheetCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/BankFeedAccount.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedAccount.java new file mode 100644 index 000000000..0f07a81ce --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedAccount.java @@ -0,0 +1,867 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BankFeedAccount.Builder.class) +public final class BankFeedAccount { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional sourceAccountId; + + private final Optional targetAccountId; + + private final Optional sourceAccountName; + + private final Optional sourceAccountNumber; + + private final Optional targetAccountName; + + private final Optional currency; + + private final Optional feedStatus; + + private final Optional feedStartDate; + + private final Optional sourceAccountBalance; + + private final Optional accountType; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional>>> remoteData; + + private final Map additionalProperties; + + private BankFeedAccount( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional sourceAccountId, + Optional targetAccountId, + Optional sourceAccountName, + Optional sourceAccountNumber, + Optional targetAccountName, + Optional currency, + Optional feedStatus, + Optional feedStartDate, + Optional sourceAccountBalance, + Optional accountType, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional>>> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.sourceAccountId = sourceAccountId; + this.targetAccountId = targetAccountId; + this.sourceAccountName = sourceAccountName; + this.sourceAccountNumber = sourceAccountNumber; + this.targetAccountName = targetAccountName; + this.currency = currency; + this.feedStatus = feedStatus; + this.feedStartDate = feedStartDate; + this.sourceAccountBalance = sourceAccountBalance; + this.accountType = accountType; + 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 unique identifier of the source account from our customer’s platform. + */ + @JsonProperty("source_account_id") + public Optional getSourceAccountId() { + return sourceAccountId; + } + + /** + * @return The unique identifier of the target account from the third party software. + */ + @JsonProperty("target_account_id") + public Optional getTargetAccountId() { + return targetAccountId; + } + + /** + * @return The name of the source account as stored in our customer’s platform. + */ + @JsonProperty("source_account_name") + public Optional getSourceAccountName() { + return sourceAccountName; + } + + /** + * @return The human-readable account number of the source account as stored in our customer’s platform. + */ + @JsonProperty("source_account_number") + public Optional getSourceAccountNumber() { + return sourceAccountNumber; + } + + /** + * @return The name of the target account from the third party software. + */ + @JsonProperty("target_account_name") + public Optional getTargetAccountName() { + return targetAccountName; + } + + /** + * @return The currency code of the bank feed. + *
    + *
  • 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 status of the bank feed. + *
    + *
  • ACTIVE - ACTIVE
  • + *
  • INACTIVE - INACTIVE
  • + *
+ */ + @JsonProperty("feed_status") + public Optional getFeedStatus() { + return feedStatus; + } + + /** + * @return The start date of the bank feed’s transactions. + */ + @JsonProperty("feed_start_date") + public Optional getFeedStartDate() { + return feedStartDate; + } + + /** + * @return The current balance of funds in the source account. + */ + @JsonProperty("source_account_balance") + public Optional getSourceAccountBalance() { + return sourceAccountBalance; + } + + /** + * @return The type of the account. + *
    + *
  • BANK - BANK
  • + *
  • CREDIT_CARD - CREDIT_CARD
  • + *
+ */ + @JsonProperty("account_type") + public Optional getAccountType() { + return accountType; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BankFeedAccount && equalTo((BankFeedAccount) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BankFeedAccount other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && sourceAccountId.equals(other.sourceAccountId) + && targetAccountId.equals(other.targetAccountId) + && sourceAccountName.equals(other.sourceAccountName) + && sourceAccountNumber.equals(other.sourceAccountNumber) + && targetAccountName.equals(other.targetAccountName) + && currency.equals(other.currency) + && feedStatus.equals(other.feedStatus) + && feedStartDate.equals(other.feedStartDate) + && sourceAccountBalance.equals(other.sourceAccountBalance) + && accountType.equals(other.accountType) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.sourceAccountId, + this.targetAccountId, + this.sourceAccountName, + this.sourceAccountNumber, + this.targetAccountName, + this.currency, + this.feedStatus, + this.feedStartDate, + this.sourceAccountBalance, + this.accountType, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 sourceAccountId = Optional.empty(); + + private Optional targetAccountId = Optional.empty(); + + private Optional sourceAccountName = Optional.empty(); + + private Optional sourceAccountNumber = Optional.empty(); + + private Optional targetAccountName = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional feedStatus = Optional.empty(); + + private Optional feedStartDate = Optional.empty(); + + private Optional sourceAccountBalance = Optional.empty(); + + private Optional accountType = 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(BankFeedAccount other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + sourceAccountId(other.getSourceAccountId()); + targetAccountId(other.getTargetAccountId()); + sourceAccountName(other.getSourceAccountName()); + sourceAccountNumber(other.getSourceAccountNumber()); + targetAccountName(other.getTargetAccountName()); + currency(other.getCurrency()); + feedStatus(other.getFeedStatus()); + feedStartDate(other.getFeedStartDate()); + sourceAccountBalance(other.getSourceAccountBalance()); + accountType(other.getAccountType()); + 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 = "source_account_id", nulls = Nulls.SKIP) + public Builder sourceAccountId(Optional sourceAccountId) { + this.sourceAccountId = sourceAccountId; + return this; + } + + public Builder sourceAccountId(String sourceAccountId) { + this.sourceAccountId = Optional.ofNullable(sourceAccountId); + return this; + } + + @JsonSetter(value = "target_account_id", nulls = Nulls.SKIP) + public Builder targetAccountId(Optional targetAccountId) { + this.targetAccountId = targetAccountId; + return this; + } + + public Builder targetAccountId(String targetAccountId) { + this.targetAccountId = Optional.ofNullable(targetAccountId); + return this; + } + + @JsonSetter(value = "source_account_name", nulls = Nulls.SKIP) + public Builder sourceAccountName(Optional sourceAccountName) { + this.sourceAccountName = sourceAccountName; + return this; + } + + public Builder sourceAccountName(String sourceAccountName) { + this.sourceAccountName = Optional.ofNullable(sourceAccountName); + return this; + } + + @JsonSetter(value = "source_account_number", nulls = Nulls.SKIP) + public Builder sourceAccountNumber(Optional sourceAccountNumber) { + this.sourceAccountNumber = sourceAccountNumber; + return this; + } + + public Builder sourceAccountNumber(String sourceAccountNumber) { + this.sourceAccountNumber = Optional.ofNullable(sourceAccountNumber); + return this; + } + + @JsonSetter(value = "target_account_name", nulls = Nulls.SKIP) + public Builder targetAccountName(Optional targetAccountName) { + this.targetAccountName = targetAccountName; + return this; + } + + public Builder targetAccountName(String targetAccountName) { + this.targetAccountName = Optional.ofNullable(targetAccountName); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(BankFeedAccountCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "feed_status", nulls = Nulls.SKIP) + public Builder feedStatus(Optional feedStatus) { + this.feedStatus = feedStatus; + return this; + } + + public Builder feedStatus(BankFeedAccountFeedStatus feedStatus) { + this.feedStatus = Optional.ofNullable(feedStatus); + return this; + } + + @JsonSetter(value = "feed_start_date", nulls = Nulls.SKIP) + public Builder feedStartDate(Optional feedStartDate) { + this.feedStartDate = feedStartDate; + return this; + } + + public Builder feedStartDate(OffsetDateTime feedStartDate) { + this.feedStartDate = Optional.ofNullable(feedStartDate); + return this; + } + + @JsonSetter(value = "source_account_balance", nulls = Nulls.SKIP) + public Builder sourceAccountBalance(Optional sourceAccountBalance) { + this.sourceAccountBalance = sourceAccountBalance; + return this; + } + + public Builder sourceAccountBalance(Double sourceAccountBalance) { + this.sourceAccountBalance = Optional.ofNullable(sourceAccountBalance); + return this; + } + + @JsonSetter(value = "account_type", nulls = Nulls.SKIP) + public Builder accountType(Optional accountType) { + this.accountType = accountType; + return this; + } + + public Builder accountType(BankFeedAccountAccountType accountType) { + this.accountType = Optional.ofNullable(accountType); + 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 BankFeedAccount build() { + return new BankFeedAccount( + id, + remoteId, + createdAt, + modifiedAt, + sourceAccountId, + targetAccountId, + sourceAccountName, + sourceAccountNumber, + targetAccountName, + currency, + feedStatus, + feedStartDate, + sourceAccountBalance, + accountType, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedAccountAccountType.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedAccountAccountType.java new file mode 100644 index 000000000..0bb0c26d8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedAccountAccountType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/BankFeedAccountAccountTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedAccountAccountTypeEnum.java new file mode 100644 index 000000000..64263f1e7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedAccountAccountTypeEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum BankFeedAccountAccountTypeEnum { + BANK("BANK"), + + CREDIT_CARD("CREDIT_CARD"); + + private final String value; + + BankFeedAccountAccountTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedAccountCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedAccountCurrency.java new file mode 100644 index 000000000..897c60c41 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedAccountCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/BankFeedAccountFeedStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedAccountFeedStatus.java new file mode 100644 index 000000000..f9da1ac8c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedAccountFeedStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/BankFeedAccountRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedAccountRequest.java new file mode 100644 index 000000000..bb6eb7349 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedAccountRequest.java @@ -0,0 +1,728 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = BankFeedAccountRequest.Builder.class) +public final class BankFeedAccountRequest { + private final Optional sourceAccountId; + + private final Optional targetAccountId; + + private final Optional sourceAccountName; + + private final Optional sourceAccountNumber; + + private final Optional targetAccountName; + + private final Optional currency; + + private final Optional feedStatus; + + private final Optional feedStartDate; + + private final Optional sourceAccountBalance; + + private final Optional accountType; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private BankFeedAccountRequest( + Optional sourceAccountId, + Optional targetAccountId, + Optional sourceAccountName, + Optional sourceAccountNumber, + Optional targetAccountName, + Optional currency, + Optional feedStatus, + Optional feedStartDate, + Optional sourceAccountBalance, + Optional accountType, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.sourceAccountId = sourceAccountId; + this.targetAccountId = targetAccountId; + this.sourceAccountName = sourceAccountName; + this.sourceAccountNumber = sourceAccountNumber; + this.targetAccountName = targetAccountName; + this.currency = currency; + this.feedStatus = feedStatus; + this.feedStartDate = feedStartDate; + this.sourceAccountBalance = sourceAccountBalance; + this.accountType = accountType; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The unique identifier of the source account from our customer’s platform. + */ + @JsonProperty("source_account_id") + public Optional getSourceAccountId() { + return sourceAccountId; + } + + /** + * @return The unique identifier of the target account from the third party software. + */ + @JsonProperty("target_account_id") + public Optional getTargetAccountId() { + return targetAccountId; + } + + /** + * @return The name of the source account as stored in our customer’s platform. + */ + @JsonProperty("source_account_name") + public Optional getSourceAccountName() { + return sourceAccountName; + } + + /** + * @return The human-readable account number of the source account as stored in our customer’s platform. + */ + @JsonProperty("source_account_number") + public Optional getSourceAccountNumber() { + return sourceAccountNumber; + } + + /** + * @return The name of the target account from the third party software. + */ + @JsonProperty("target_account_name") + public Optional getTargetAccountName() { + return targetAccountName; + } + + /** + * @return The currency code of the bank feed. + *
    + *
  • 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 status of the bank feed. + *
    + *
  • ACTIVE - ACTIVE
  • + *
  • INACTIVE - INACTIVE
  • + *
+ */ + @JsonProperty("feed_status") + public Optional getFeedStatus() { + return feedStatus; + } + + /** + * @return The start date of the bank feed’s transactions. + */ + @JsonProperty("feed_start_date") + public Optional getFeedStartDate() { + return feedStartDate; + } + + /** + * @return The current balance of funds in the source account. + */ + @JsonProperty("source_account_balance") + public Optional getSourceAccountBalance() { + return sourceAccountBalance; + } + + /** + * @return The type of the account. + *
    + *
  • BANK - BANK
  • + *
  • CREDIT_CARD - CREDIT_CARD
  • + *
+ */ + @JsonProperty("account_type") + public Optional getAccountType() { + return accountType; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BankFeedAccountRequest && equalTo((BankFeedAccountRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BankFeedAccountRequest other) { + return sourceAccountId.equals(other.sourceAccountId) + && targetAccountId.equals(other.targetAccountId) + && sourceAccountName.equals(other.sourceAccountName) + && sourceAccountNumber.equals(other.sourceAccountNumber) + && targetAccountName.equals(other.targetAccountName) + && currency.equals(other.currency) + && feedStatus.equals(other.feedStatus) + && feedStartDate.equals(other.feedStartDate) + && sourceAccountBalance.equals(other.sourceAccountBalance) + && accountType.equals(other.accountType) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @Override + public int hashCode() { + return Objects.hash( + this.sourceAccountId, + this.targetAccountId, + this.sourceAccountName, + this.sourceAccountNumber, + this.targetAccountName, + this.currency, + this.feedStatus, + this.feedStartDate, + this.sourceAccountBalance, + this.accountType, + this.integrationParams, + this.linkedAccountParams); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional sourceAccountId = Optional.empty(); + + private Optional targetAccountId = Optional.empty(); + + private Optional sourceAccountName = Optional.empty(); + + private Optional sourceAccountNumber = Optional.empty(); + + private Optional targetAccountName = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional feedStatus = Optional.empty(); + + private Optional feedStartDate = Optional.empty(); + + private Optional sourceAccountBalance = Optional.empty(); + + private Optional accountType = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(BankFeedAccountRequest other) { + sourceAccountId(other.getSourceAccountId()); + targetAccountId(other.getTargetAccountId()); + sourceAccountName(other.getSourceAccountName()); + sourceAccountNumber(other.getSourceAccountNumber()); + targetAccountName(other.getTargetAccountName()); + currency(other.getCurrency()); + feedStatus(other.getFeedStatus()); + feedStartDate(other.getFeedStartDate()); + sourceAccountBalance(other.getSourceAccountBalance()); + accountType(other.getAccountType()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + return this; + } + + @JsonSetter(value = "source_account_id", nulls = Nulls.SKIP) + public Builder sourceAccountId(Optional sourceAccountId) { + this.sourceAccountId = sourceAccountId; + return this; + } + + public Builder sourceAccountId(String sourceAccountId) { + this.sourceAccountId = Optional.ofNullable(sourceAccountId); + return this; + } + + @JsonSetter(value = "target_account_id", nulls = Nulls.SKIP) + public Builder targetAccountId(Optional targetAccountId) { + this.targetAccountId = targetAccountId; + return this; + } + + public Builder targetAccountId(String targetAccountId) { + this.targetAccountId = Optional.ofNullable(targetAccountId); + return this; + } + + @JsonSetter(value = "source_account_name", nulls = Nulls.SKIP) + public Builder sourceAccountName(Optional sourceAccountName) { + this.sourceAccountName = sourceAccountName; + return this; + } + + public Builder sourceAccountName(String sourceAccountName) { + this.sourceAccountName = Optional.ofNullable(sourceAccountName); + return this; + } + + @JsonSetter(value = "source_account_number", nulls = Nulls.SKIP) + public Builder sourceAccountNumber(Optional sourceAccountNumber) { + this.sourceAccountNumber = sourceAccountNumber; + return this; + } + + public Builder sourceAccountNumber(String sourceAccountNumber) { + this.sourceAccountNumber = Optional.ofNullable(sourceAccountNumber); + return this; + } + + @JsonSetter(value = "target_account_name", nulls = Nulls.SKIP) + public Builder targetAccountName(Optional targetAccountName) { + this.targetAccountName = targetAccountName; + return this; + } + + public Builder targetAccountName(String targetAccountName) { + this.targetAccountName = Optional.ofNullable(targetAccountName); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(BankFeedAccountRequestCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "feed_status", nulls = Nulls.SKIP) + public Builder feedStatus(Optional feedStatus) { + this.feedStatus = feedStatus; + return this; + } + + public Builder feedStatus(BankFeedAccountRequestFeedStatus feedStatus) { + this.feedStatus = Optional.ofNullable(feedStatus); + return this; + } + + @JsonSetter(value = "feed_start_date", nulls = Nulls.SKIP) + public Builder feedStartDate(Optional feedStartDate) { + this.feedStartDate = feedStartDate; + return this; + } + + public Builder feedStartDate(OffsetDateTime feedStartDate) { + this.feedStartDate = Optional.ofNullable(feedStartDate); + return this; + } + + @JsonSetter(value = "source_account_balance", nulls = Nulls.SKIP) + public Builder sourceAccountBalance(Optional sourceAccountBalance) { + this.sourceAccountBalance = sourceAccountBalance; + return this; + } + + public Builder sourceAccountBalance(Double sourceAccountBalance) { + this.sourceAccountBalance = Optional.ofNullable(sourceAccountBalance); + return this; + } + + @JsonSetter(value = "account_type", nulls = Nulls.SKIP) + public Builder accountType(Optional accountType) { + this.accountType = accountType; + return this; + } + + public Builder accountType(BankFeedAccountRequestAccountType accountType) { + this.accountType = Optional.ofNullable(accountType); + 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 BankFeedAccountRequest build() { + return new BankFeedAccountRequest( + sourceAccountId, + targetAccountId, + sourceAccountName, + sourceAccountNumber, + targetAccountName, + currency, + feedStatus, + feedStartDate, + sourceAccountBalance, + accountType, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedAccountRequestAccountType.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedAccountRequestAccountType.java new file mode 100644 index 000000000..5fa78a58d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedAccountRequestAccountType.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/BankFeedAccountRequestCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedAccountRequestCurrency.java new file mode 100644 index 000000000..e69e7c857 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedAccountRequestCurrency.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/BankFeedAccountRequestFeedStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedAccountRequestFeedStatus.java new file mode 100644 index 000000000..cd2b0bd83 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedAccountRequestFeedStatus.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/BankFeedAccountResponse.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedAccountResponse.java new file mode 100644 index 000000000..8ffa92754 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedAccountResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BankFeedAccountResponse.Builder.class) +public final class BankFeedAccountResponse { + private final BankFeedAccount model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private BankFeedAccountResponse( + BankFeedAccount 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 BankFeedAccount getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BankFeedAccountResponse && equalTo((BankFeedAccountResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BankFeedAccountResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull BankFeedAccount model); + + Builder from(BankFeedAccountResponse other); + } + + public interface _FinalStage { + BankFeedAccountResponse 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 BankFeedAccount model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(BankFeedAccountResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull BankFeedAccount model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public BankFeedAccountResponse build() { + return new BankFeedAccountResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedTransaction.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedTransaction.java new file mode 100644 index 000000000..33657fe4c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedTransaction.java @@ -0,0 +1,505 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = BankFeedTransaction.Builder.class) +public final class BankFeedTransaction { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional bankFeedAccount; + + private final Optional transactionDate; + + private final Optional postedDate; + + private final Optional amount; + + private final Optional description; + + private final Optional transactionType; + + private final Optional payee; + + private final Optional creditOrDebit; + + private final Optional sourceTransactionId; + + private final Optional remoteWasDeleted; + + private final Optional isProcessed; + + private final Map additionalProperties; + + private BankFeedTransaction( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional bankFeedAccount, + Optional transactionDate, + Optional postedDate, + Optional amount, + Optional description, + Optional transactionType, + Optional payee, + Optional creditOrDebit, + Optional sourceTransactionId, + Optional remoteWasDeleted, + Optional isProcessed, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.bankFeedAccount = bankFeedAccount; + this.transactionDate = transactionDate; + this.postedDate = postedDate; + this.amount = amount; + this.description = description; + this.transactionType = transactionType; + this.payee = payee; + this.creditOrDebit = creditOrDebit; + this.sourceTransactionId = sourceTransactionId; + this.remoteWasDeleted = remoteWasDeleted; + this.isProcessed = isProcessed; + 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 bank feed account associated with the transaction. + */ + @JsonProperty("bank_feed_account") + public Optional getBankFeedAccount() { + return bankFeedAccount; + } + + /** + * @return The date that the transaction occurred. + */ + @JsonProperty("transaction_date") + public Optional getTransactionDate() { + return transactionDate; + } + + /** + * @return The date the transaction was posted to the bank account. + */ + @JsonProperty("posted_date") + public Optional getPostedDate() { + return postedDate; + } + + /** + * @return The amount of the transaction. + */ + @JsonProperty("amount") + public Optional getAmount() { + return amount; + } + + /** + * @return The description of the transaction. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The underlying type of the transaction. + */ + @JsonProperty("transaction_type") + public Optional getTransactionType() { + return transactionType; + } + + /** + * @return The person or merchant who initiated the transaction, or alternatively, to whom the transaction was paid. + */ + @JsonProperty("payee") + public Optional getPayee() { + return payee; + } + + /** + * @return If the transaction is of type debit or credit. + *
    + *
  • CREDIT - CREDIT
  • + *
  • DEBIT - DEBIT
  • + *
+ */ + @JsonProperty("credit_or_debit") + public Optional getCreditOrDebit() { + return creditOrDebit; + } + + /** + * @return The customer’s identifier for the transaction. + */ + @JsonProperty("source_transaction_id") + public Optional getSourceTransactionId() { + return sourceTransactionId; + } + + /** + * @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 Whether or not this transaction has been processed by the external system. For example, NetSuite writes this field as True when the SuiteApp has processed the transaction. + */ + @JsonProperty("is_processed") + public Optional getIsProcessed() { + return isProcessed; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BankFeedTransaction && equalTo((BankFeedTransaction) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BankFeedTransaction other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && bankFeedAccount.equals(other.bankFeedAccount) + && transactionDate.equals(other.transactionDate) + && postedDate.equals(other.postedDate) + && amount.equals(other.amount) + && description.equals(other.description) + && transactionType.equals(other.transactionType) + && payee.equals(other.payee) + && creditOrDebit.equals(other.creditOrDebit) + && sourceTransactionId.equals(other.sourceTransactionId) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && isProcessed.equals(other.isProcessed); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.bankFeedAccount, + this.transactionDate, + this.postedDate, + this.amount, + this.description, + this.transactionType, + this.payee, + this.creditOrDebit, + this.sourceTransactionId, + this.remoteWasDeleted, + this.isProcessed); + } + + @Override + 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 bankFeedAccount = Optional.empty(); + + private Optional transactionDate = Optional.empty(); + + private Optional postedDate = Optional.empty(); + + private Optional amount = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional transactionType = Optional.empty(); + + private Optional payee = Optional.empty(); + + private Optional creditOrDebit = Optional.empty(); + + private Optional sourceTransactionId = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional isProcessed = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(BankFeedTransaction other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + bankFeedAccount(other.getBankFeedAccount()); + transactionDate(other.getTransactionDate()); + postedDate(other.getPostedDate()); + amount(other.getAmount()); + description(other.getDescription()); + transactionType(other.getTransactionType()); + payee(other.getPayee()); + creditOrDebit(other.getCreditOrDebit()); + sourceTransactionId(other.getSourceTransactionId()); + remoteWasDeleted(other.getRemoteWasDeleted()); + isProcessed(other.getIsProcessed()); + 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 = "bank_feed_account", nulls = Nulls.SKIP) + public Builder bankFeedAccount(Optional bankFeedAccount) { + this.bankFeedAccount = bankFeedAccount; + return this; + } + + public Builder bankFeedAccount(BankFeedTransactionBankFeedAccount bankFeedAccount) { + this.bankFeedAccount = Optional.ofNullable(bankFeedAccount); + return this; + } + + @JsonSetter(value = "transaction_date", nulls = Nulls.SKIP) + public Builder transactionDate(Optional transactionDate) { + this.transactionDate = transactionDate; + return this; + } + + public Builder transactionDate(OffsetDateTime transactionDate) { + this.transactionDate = Optional.ofNullable(transactionDate); + return this; + } + + @JsonSetter(value = "posted_date", nulls = Nulls.SKIP) + public Builder postedDate(Optional postedDate) { + this.postedDate = postedDate; + return this; + } + + public Builder postedDate(OffsetDateTime postedDate) { + this.postedDate = Optional.ofNullable(postedDate); + return this; + } + + @JsonSetter(value = "amount", nulls = Nulls.SKIP) + public Builder amount(Optional amount) { + this.amount = amount; + return this; + } + + public Builder amount(Double amount) { + this.amount = Optional.ofNullable(amount); + 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 = "transaction_type", nulls = Nulls.SKIP) + public Builder transactionType(Optional transactionType) { + this.transactionType = transactionType; + return this; + } + + public Builder transactionType(String transactionType) { + this.transactionType = Optional.ofNullable(transactionType); + return this; + } + + @JsonSetter(value = "payee", nulls = Nulls.SKIP) + public Builder payee(Optional payee) { + this.payee = payee; + return this; + } + + public Builder payee(String payee) { + this.payee = Optional.ofNullable(payee); + return this; + } + + @JsonSetter(value = "credit_or_debit", nulls = Nulls.SKIP) + public Builder creditOrDebit(Optional creditOrDebit) { + this.creditOrDebit = creditOrDebit; + return this; + } + + public Builder creditOrDebit(BankFeedTransactionCreditOrDebit creditOrDebit) { + this.creditOrDebit = Optional.ofNullable(creditOrDebit); + return this; + } + + @JsonSetter(value = "source_transaction_id", nulls = Nulls.SKIP) + public Builder sourceTransactionId(Optional sourceTransactionId) { + this.sourceTransactionId = sourceTransactionId; + return this; + } + + public Builder sourceTransactionId(String sourceTransactionId) { + this.sourceTransactionId = Optional.ofNullable(sourceTransactionId); + 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_processed", nulls = Nulls.SKIP) + public Builder isProcessed(Optional isProcessed) { + this.isProcessed = isProcessed; + return this; + } + + public Builder isProcessed(Boolean isProcessed) { + this.isProcessed = Optional.ofNullable(isProcessed); + return this; + } + + public BankFeedTransaction build() { + return new BankFeedTransaction( + id, + remoteId, + createdAt, + modifiedAt, + bankFeedAccount, + transactionDate, + postedDate, + amount, + description, + transactionType, + payee, + creditOrDebit, + sourceTransactionId, + remoteWasDeleted, + isProcessed, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedTransactionBankFeedAccount.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedTransactionBankFeedAccount.java new file mode 100644 index 000000000..c620441b8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedTransactionBankFeedAccount.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = BankFeedTransactionBankFeedAccount.Deserializer.class) +public final class BankFeedTransactionBankFeedAccount { + private final Object value; + + private final int type; + + private BankFeedTransactionBankFeedAccount(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((BankFeedAccount) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BankFeedTransactionBankFeedAccount + && equalTo((BankFeedTransactionBankFeedAccount) other); + } + + private boolean equalTo(BankFeedTransactionBankFeedAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static BankFeedTransactionBankFeedAccount of(String value) { + return new BankFeedTransactionBankFeedAccount(value, 0); + } + + public static BankFeedTransactionBankFeedAccount of(BankFeedAccount value) { + return new BankFeedTransactionBankFeedAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(BankFeedAccount value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(BankFeedTransactionBankFeedAccount.class); + } + + @Override + public BankFeedTransactionBankFeedAccount 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, BankFeedAccount.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedTransactionCreditOrDebit.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedTransactionCreditOrDebit.java new file mode 100644 index 000000000..702f11ba1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedTransactionCreditOrDebit.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/BankFeedTransactionRequestRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedTransactionRequestRequest.java new file mode 100644 index 000000000..8b93a6895 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedTransactionRequestRequest.java @@ -0,0 +1,387 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = BankFeedTransactionRequestRequest.Builder.class) +public final class BankFeedTransactionRequestRequest { + private final Optional bankFeedAccount; + + private final Optional transactionDate; + + private final Optional postedDate; + + private final Optional amount; + + private final Optional description; + + private final Optional transactionType; + + private final Optional payee; + + private final Optional creditOrDebit; + + private final Optional sourceTransactionId; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private BankFeedTransactionRequestRequest( + Optional bankFeedAccount, + Optional transactionDate, + Optional postedDate, + Optional amount, + Optional description, + Optional transactionType, + Optional payee, + Optional creditOrDebit, + Optional sourceTransactionId, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.bankFeedAccount = bankFeedAccount; + this.transactionDate = transactionDate; + this.postedDate = postedDate; + this.amount = amount; + this.description = description; + this.transactionType = transactionType; + this.payee = payee; + this.creditOrDebit = creditOrDebit; + this.sourceTransactionId = sourceTransactionId; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The bank feed account associated with the transaction. + */ + @JsonProperty("bank_feed_account") + public Optional getBankFeedAccount() { + return bankFeedAccount; + } + + /** + * @return The date that the transaction occurred. + */ + @JsonProperty("transaction_date") + public Optional getTransactionDate() { + return transactionDate; + } + + /** + * @return The date the transaction was posted to the bank account. + */ + @JsonProperty("posted_date") + public Optional getPostedDate() { + return postedDate; + } + + /** + * @return The amount of the transaction. + */ + @JsonProperty("amount") + public Optional getAmount() { + return amount; + } + + /** + * @return The description of the transaction. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The underlying type of the transaction. + */ + @JsonProperty("transaction_type") + public Optional getTransactionType() { + return transactionType; + } + + /** + * @return The person or merchant who initiated the transaction, or alternatively, to whom the transaction was paid. + */ + @JsonProperty("payee") + public Optional getPayee() { + return payee; + } + + /** + * @return If the transaction is of type debit or credit. + *
    + *
  • CREDIT - CREDIT
  • + *
  • DEBIT - DEBIT
  • + *
+ */ + @JsonProperty("credit_or_debit") + public Optional getCreditOrDebit() { + return creditOrDebit; + } + + /** + * @return The customer’s identifier for the transaction. + */ + @JsonProperty("source_transaction_id") + public Optional getSourceTransactionId() { + return sourceTransactionId; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BankFeedTransactionRequestRequest && equalTo((BankFeedTransactionRequestRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BankFeedTransactionRequestRequest other) { + return bankFeedAccount.equals(other.bankFeedAccount) + && transactionDate.equals(other.transactionDate) + && postedDate.equals(other.postedDate) + && amount.equals(other.amount) + && description.equals(other.description) + && transactionType.equals(other.transactionType) + && payee.equals(other.payee) + && creditOrDebit.equals(other.creditOrDebit) + && sourceTransactionId.equals(other.sourceTransactionId) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @Override + public int hashCode() { + return Objects.hash( + this.bankFeedAccount, + this.transactionDate, + this.postedDate, + this.amount, + this.description, + this.transactionType, + this.payee, + this.creditOrDebit, + this.sourceTransactionId, + this.integrationParams, + this.linkedAccountParams); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional bankFeedAccount = Optional.empty(); + + private Optional transactionDate = Optional.empty(); + + private Optional postedDate = Optional.empty(); + + private Optional amount = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional transactionType = Optional.empty(); + + private Optional payee = Optional.empty(); + + private Optional creditOrDebit = Optional.empty(); + + private Optional sourceTransactionId = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(BankFeedTransactionRequestRequest other) { + bankFeedAccount(other.getBankFeedAccount()); + transactionDate(other.getTransactionDate()); + postedDate(other.getPostedDate()); + amount(other.getAmount()); + description(other.getDescription()); + transactionType(other.getTransactionType()); + payee(other.getPayee()); + creditOrDebit(other.getCreditOrDebit()); + sourceTransactionId(other.getSourceTransactionId()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + return this; + } + + @JsonSetter(value = "bank_feed_account", nulls = Nulls.SKIP) + public Builder bankFeedAccount(Optional bankFeedAccount) { + this.bankFeedAccount = bankFeedAccount; + return this; + } + + public Builder bankFeedAccount(BankFeedTransactionRequestRequestBankFeedAccount bankFeedAccount) { + this.bankFeedAccount = Optional.ofNullable(bankFeedAccount); + return this; + } + + @JsonSetter(value = "transaction_date", nulls = Nulls.SKIP) + public Builder transactionDate(Optional transactionDate) { + this.transactionDate = transactionDate; + return this; + } + + public Builder transactionDate(OffsetDateTime transactionDate) { + this.transactionDate = Optional.ofNullable(transactionDate); + return this; + } + + @JsonSetter(value = "posted_date", nulls = Nulls.SKIP) + public Builder postedDate(Optional postedDate) { + this.postedDate = postedDate; + return this; + } + + public Builder postedDate(OffsetDateTime postedDate) { + this.postedDate = Optional.ofNullable(postedDate); + return this; + } + + @JsonSetter(value = "amount", nulls = Nulls.SKIP) + public Builder amount(Optional amount) { + this.amount = amount; + return this; + } + + public Builder amount(Double amount) { + this.amount = Optional.ofNullable(amount); + 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 = "transaction_type", nulls = Nulls.SKIP) + public Builder transactionType(Optional transactionType) { + this.transactionType = transactionType; + return this; + } + + public Builder transactionType(String transactionType) { + this.transactionType = Optional.ofNullable(transactionType); + return this; + } + + @JsonSetter(value = "payee", nulls = Nulls.SKIP) + public Builder payee(Optional payee) { + this.payee = payee; + return this; + } + + public Builder payee(String payee) { + this.payee = Optional.ofNullable(payee); + return this; + } + + @JsonSetter(value = "credit_or_debit", nulls = Nulls.SKIP) + public Builder creditOrDebit(Optional creditOrDebit) { + this.creditOrDebit = creditOrDebit; + return this; + } + + public Builder creditOrDebit(BankFeedTransactionRequestRequestCreditOrDebit creditOrDebit) { + this.creditOrDebit = Optional.ofNullable(creditOrDebit); + return this; + } + + @JsonSetter(value = "source_transaction_id", nulls = Nulls.SKIP) + public Builder sourceTransactionId(Optional sourceTransactionId) { + this.sourceTransactionId = sourceTransactionId; + return this; + } + + public Builder sourceTransactionId(String sourceTransactionId) { + this.sourceTransactionId = Optional.ofNullable(sourceTransactionId); + 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 BankFeedTransactionRequestRequest build() { + return new BankFeedTransactionRequestRequest( + bankFeedAccount, + transactionDate, + postedDate, + amount, + description, + transactionType, + payee, + creditOrDebit, + sourceTransactionId, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedTransactionRequestRequestBankFeedAccount.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedTransactionRequestRequestBankFeedAccount.java new file mode 100644 index 000000000..4d0af5d8e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedTransactionRequestRequestBankFeedAccount.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = BankFeedTransactionRequestRequestBankFeedAccount.Deserializer.class) +public final class BankFeedTransactionRequestRequestBankFeedAccount { + private final Object value; + + private final int type; + + private BankFeedTransactionRequestRequestBankFeedAccount(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((BankFeedAccount) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BankFeedTransactionRequestRequestBankFeedAccount + && equalTo((BankFeedTransactionRequestRequestBankFeedAccount) other); + } + + private boolean equalTo(BankFeedTransactionRequestRequestBankFeedAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static BankFeedTransactionRequestRequestBankFeedAccount of(String value) { + return new BankFeedTransactionRequestRequestBankFeedAccount(value, 0); + } + + public static BankFeedTransactionRequestRequestBankFeedAccount of(BankFeedAccount value) { + return new BankFeedTransactionRequestRequestBankFeedAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(BankFeedAccount value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(BankFeedTransactionRequestRequestBankFeedAccount.class); + } + + @Override + public BankFeedTransactionRequestRequestBankFeedAccount 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, BankFeedAccount.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedTransactionRequestRequestCreditOrDebit.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedTransactionRequestRequestCreditOrDebit.java new file mode 100644 index 000000000..20ecf8cb0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedTransactionRequestRequestCreditOrDebit.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/BankFeedTransactionResponse.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedTransactionResponse.java new file mode 100644 index 000000000..70bb5e6b3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/BankFeedTransactionResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BankFeedTransactionResponse.Builder.class) +public final class BankFeedTransactionResponse { + private final BankFeedTransaction model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private BankFeedTransactionResponse( + BankFeedTransaction 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 BankFeedTransaction getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BankFeedTransactionResponse && equalTo((BankFeedTransactionResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BankFeedTransactionResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull BankFeedTransaction model); + + Builder from(BankFeedTransactionResponse other); + } + + public interface _FinalStage { + BankFeedTransactionResponse 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 BankFeedTransaction model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(BankFeedTransactionResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull BankFeedTransaction model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public BankFeedTransactionResponse build() { + return new BankFeedTransactionResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CashFlowStatement.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CashFlowStatement.java new file mode 100644 index 000000000..3d11884f9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CashFlowStatement.java @@ -0,0 +1,879 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CashFlowStatement.Builder.class) +public final class CashFlowStatement { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional currency; + + private final Optional company; + + private final Optional startPeriod; + + private final Optional endPeriod; + + private final Optional cashAtBeginningOfPeriod; + + private final Optional cashAtEndOfPeriod; + + private final Optional> operatingActivities; + + private final Optional> investingActivities; + + private final Optional> financingActivities; + + private final Optional remoteGeneratedAt; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private CashFlowStatement( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional currency, + Optional company, + Optional startPeriod, + Optional endPeriod, + Optional cashAtBeginningOfPeriod, + Optional cashAtEndOfPeriod, + Optional> operatingActivities, + Optional> investingActivities, + Optional> financingActivities, + Optional remoteGeneratedAt, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.currency = currency; + this.company = company; + this.startPeriod = startPeriod; + this.endPeriod = endPeriod; + this.cashAtBeginningOfPeriod = cashAtBeginningOfPeriod; + this.cashAtEndOfPeriod = cashAtEndOfPeriod; + this.operatingActivities = operatingActivities; + this.investingActivities = investingActivities; + this.financingActivities = financingActivities; + this.remoteGeneratedAt = remoteGeneratedAt; + 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 cash flow statement's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The cash flow statement'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 company the cash flow statement belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The cash flow statement's start period. + */ + @JsonProperty("start_period") + public Optional getStartPeriod() { + return startPeriod; + } + + /** + * @return The cash flow statement's end period. + */ + @JsonProperty("end_period") + public Optional getEndPeriod() { + return endPeriod; + } + + /** + * @return Cash and cash equivalents at the beginning of the cash flow statement's period. + */ + @JsonProperty("cash_at_beginning_of_period") + public Optional getCashAtBeginningOfPeriod() { + return cashAtBeginningOfPeriod; + } + + /** + * @return Cash and cash equivalents at the beginning of the cash flow statement's period. + */ + @JsonProperty("cash_at_end_of_period") + public Optional getCashAtEndOfPeriod() { + return cashAtEndOfPeriod; + } + + @JsonProperty("operating_activities") + public Optional> getOperatingActivities() { + return operatingActivities; + } + + @JsonProperty("investing_activities") + public Optional> getInvestingActivities() { + return investingActivities; + } + + @JsonProperty("financing_activities") + public Optional> getFinancingActivities() { + return financingActivities; + } + + /** + * @return The time that cash flow statement was generated by the accounting system. + */ + @JsonProperty("remote_generated_at") + public Optional getRemoteGeneratedAt() { + return remoteGeneratedAt; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CashFlowStatement && equalTo((CashFlowStatement) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CashFlowStatement other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && currency.equals(other.currency) + && company.equals(other.company) + && startPeriod.equals(other.startPeriod) + && endPeriod.equals(other.endPeriod) + && cashAtBeginningOfPeriod.equals(other.cashAtBeginningOfPeriod) + && cashAtEndOfPeriod.equals(other.cashAtEndOfPeriod) + && operatingActivities.equals(other.operatingActivities) + && investingActivities.equals(other.investingActivities) + && financingActivities.equals(other.financingActivities) + && remoteGeneratedAt.equals(other.remoteGeneratedAt) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.currency, + this.company, + this.startPeriod, + this.endPeriod, + this.cashAtBeginningOfPeriod, + this.cashAtEndOfPeriod, + this.operatingActivities, + this.investingActivities, + this.financingActivities, + this.remoteGeneratedAt, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 currency = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional startPeriod = Optional.empty(); + + private Optional endPeriod = Optional.empty(); + + private Optional cashAtBeginningOfPeriod = Optional.empty(); + + private Optional cashAtEndOfPeriod = Optional.empty(); + + private Optional> operatingActivities = Optional.empty(); + + private Optional> investingActivities = Optional.empty(); + + private Optional> financingActivities = Optional.empty(); + + private Optional remoteGeneratedAt = 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(CashFlowStatement other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + currency(other.getCurrency()); + company(other.getCompany()); + startPeriod(other.getStartPeriod()); + endPeriod(other.getEndPeriod()); + cashAtBeginningOfPeriod(other.getCashAtBeginningOfPeriod()); + cashAtEndOfPeriod(other.getCashAtEndOfPeriod()); + operatingActivities(other.getOperatingActivities()); + investingActivities(other.getInvestingActivities()); + financingActivities(other.getFinancingActivities()); + remoteGeneratedAt(other.getRemoteGeneratedAt()); + 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 = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(CashFlowStatementCurrency 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(CashFlowStatementCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "start_period", nulls = Nulls.SKIP) + public Builder startPeriod(Optional startPeriod) { + this.startPeriod = startPeriod; + return this; + } + + public Builder startPeriod(OffsetDateTime startPeriod) { + this.startPeriod = Optional.ofNullable(startPeriod); + return this; + } + + @JsonSetter(value = "end_period", nulls = Nulls.SKIP) + public Builder endPeriod(Optional endPeriod) { + this.endPeriod = endPeriod; + return this; + } + + public Builder endPeriod(OffsetDateTime endPeriod) { + this.endPeriod = Optional.ofNullable(endPeriod); + return this; + } + + @JsonSetter(value = "cash_at_beginning_of_period", nulls = Nulls.SKIP) + public Builder cashAtBeginningOfPeriod(Optional cashAtBeginningOfPeriod) { + this.cashAtBeginningOfPeriod = cashAtBeginningOfPeriod; + return this; + } + + public Builder cashAtBeginningOfPeriod(Double cashAtBeginningOfPeriod) { + this.cashAtBeginningOfPeriod = Optional.ofNullable(cashAtBeginningOfPeriod); + return this; + } + + @JsonSetter(value = "cash_at_end_of_period", nulls = Nulls.SKIP) + public Builder cashAtEndOfPeriod(Optional cashAtEndOfPeriod) { + this.cashAtEndOfPeriod = cashAtEndOfPeriod; + return this; + } + + public Builder cashAtEndOfPeriod(Double cashAtEndOfPeriod) { + this.cashAtEndOfPeriod = Optional.ofNullable(cashAtEndOfPeriod); + return this; + } + + @JsonSetter(value = "operating_activities", nulls = Nulls.SKIP) + public Builder operatingActivities(Optional> operatingActivities) { + this.operatingActivities = operatingActivities; + return this; + } + + public Builder operatingActivities(List operatingActivities) { + this.operatingActivities = Optional.ofNullable(operatingActivities); + return this; + } + + @JsonSetter(value = "investing_activities", nulls = Nulls.SKIP) + public Builder investingActivities(Optional> investingActivities) { + this.investingActivities = investingActivities; + return this; + } + + public Builder investingActivities(List investingActivities) { + this.investingActivities = Optional.ofNullable(investingActivities); + return this; + } + + @JsonSetter(value = "financing_activities", nulls = Nulls.SKIP) + public Builder financingActivities(Optional> financingActivities) { + this.financingActivities = financingActivities; + return this; + } + + public Builder financingActivities(List financingActivities) { + this.financingActivities = Optional.ofNullable(financingActivities); + return this; + } + + @JsonSetter(value = "remote_generated_at", nulls = Nulls.SKIP) + public Builder remoteGeneratedAt(Optional remoteGeneratedAt) { + this.remoteGeneratedAt = remoteGeneratedAt; + return this; + } + + public Builder remoteGeneratedAt(OffsetDateTime remoteGeneratedAt) { + this.remoteGeneratedAt = Optional.ofNullable(remoteGeneratedAt); + 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 CashFlowStatement build() { + return new CashFlowStatement( + id, + remoteId, + createdAt, + modifiedAt, + name, + currency, + company, + startPeriod, + endPeriod, + cashAtBeginningOfPeriod, + cashAtEndOfPeriod, + operatingActivities, + investingActivities, + financingActivities, + remoteGeneratedAt, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CashFlowStatementCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CashFlowStatementCompany.java new file mode 100644 index 000000000..ba49c727d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CashFlowStatementCompany.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CashFlowStatementCompany.Deserializer.class) +public final class CashFlowStatementCompany { + private final Object value; + + private final int type; + + private CashFlowStatementCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CashFlowStatementCompany && equalTo((CashFlowStatementCompany) other); + } + + private boolean equalTo(CashFlowStatementCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CashFlowStatementCompany of(String value) { + return new CashFlowStatementCompany(value, 0); + } + + public static CashFlowStatementCompany of(CompanyInfo value) { + return new CashFlowStatementCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CashFlowStatementCompany.class); + } + + @Override + public CashFlowStatementCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CashFlowStatementCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CashFlowStatementCurrency.java new file mode 100644 index 000000000..5ece41b75 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CashFlowStatementCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/CategoriesEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CategoriesEnum.java new file mode 100644 index 000000000..c1b83d24f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CategoriesEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CategoryEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CategoryEnum.java new file mode 100644 index 000000000..18ebdf506 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CategoryEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CategoryTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CategoryTypeEnum.java new file mode 100644 index 000000000..091b03dda --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CategoryTypeEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CategoryTypeEnum { + CLASS("CLASS"), + + DEPARTMENT("DEPARTMENT"); + + private final String value; + + CategoryTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ClassificationEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ClassificationEnum.java new file mode 100644 index 000000000..43f8f7cb4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ClassificationEnum.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ClassificationEnum { + ASSET("ASSET"), + + EQUITY("EQUITY"), + + EXPENSE("EXPENSE"), + + LIABILITY("LIABILITY"), + + REVENUE("REVENUE"); + + private final String value; + + ClassificationEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CommonModelScopeApi.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CommonModelScopeApi.java new file mode 100644 index 000000000..ac24874d7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CommonModelScopeApi.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @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/legacy/api/resources/accounting/types/CommonModelScopesBodyRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CommonModelScopesBodyRequest.java new file mode 100644 index 000000000..43917828a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CommonModelScopesBodyRequest.java @@ -0,0 +1,175 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.modelId, this.enabledActions, this.disabledFields); + } + + @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() {} + + @Override + public Builder from(CommonModelScopesBodyRequest other) { + modelId(other.getModelId()); + enabledActions(other.getEnabledActions()); + disabledFields(other.getDisabledFields()); + return this; + } + + @Override + @JsonSetter("model_id") + public _FinalStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @Override + public _FinalStage addAllDisabledFields(List disabledFields) { + this.disabledFields.addAll(disabledFields); + return this; + } + + @Override + public _FinalStage addDisabledFields(String disabledFields) { + this.disabledFields.add(disabledFields); + return this; + } + + @Override + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public _FinalStage disabledFields(List disabledFields) { + this.disabledFields.clear(); + this.disabledFields.addAll(disabledFields); + return this; + } + + @Override + public _FinalStage addAllEnabledActions(List enabledActions) { + this.enabledActions.addAll(enabledActions); + return this; + } + + @Override + public _FinalStage addEnabledActions(EnabledActionsEnum enabledActions) { + this.enabledActions.add(enabledActions); + return this; + } + + @Override + @JsonSetter(value = "enabled_actions", nulls = Nulls.SKIP) + public _FinalStage enabledActions(List enabledActions) { + this.enabledActions.clear(); + this.enabledActions.addAll(enabledActions); + return this; + } + + @Override + public CommonModelScopesBodyRequest build() { + return new CommonModelScopesBodyRequest(modelId, enabledActions, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CompanyInfo.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CompanyInfo.java new file mode 100644 index 000000000..9405d7ab9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CompanyInfo.java @@ -0,0 +1,853 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CompanyInfo.Builder.class) +public final class CompanyInfo { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional legalName; + + private final Optional taxNumber; + + private final Optional fiscalYearEndMonth; + + private final Optional fiscalYearEndDay; + + private final Optional currency; + + private final Optional remoteCreatedAt; + + private final Optional>> urls; + + private final Optional> addresses; + + private final Optional> phoneNumbers; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private CompanyInfo( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional legalName, + Optional taxNumber, + Optional fiscalYearEndMonth, + Optional fiscalYearEndDay, + Optional currency, + Optional remoteCreatedAt, + Optional>> urls, + Optional> addresses, + Optional> phoneNumbers, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.legalName = legalName; + this.taxNumber = taxNumber; + this.fiscalYearEndMonth = fiscalYearEndMonth; + this.fiscalYearEndDay = fiscalYearEndDay; + this.currency = currency; + this.remoteCreatedAt = remoteCreatedAt; + this.urls = urls; + this.addresses = addresses; + this.phoneNumbers = phoneNumbers; + 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 company's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The company's legal name. + */ + @JsonProperty("legal_name") + public Optional getLegalName() { + return legalName; + } + + /** + * @return The company's tax number. + */ + @JsonProperty("tax_number") + public Optional getTaxNumber() { + return taxNumber; + } + + /** + * @return The company's fiscal year end month. + */ + @JsonProperty("fiscal_year_end_month") + public Optional getFiscalYearEndMonth() { + return fiscalYearEndMonth; + } + + /** + * @return The company's fiscal year end day. + */ + @JsonProperty("fiscal_year_end_day") + public Optional getFiscalYearEndDay() { + return fiscalYearEndDay; + } + + /** + * @return The currency set in the company's accounting platform. + *
    + *
  • 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 When the third party's company was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return The company's urls. + */ + @JsonProperty("urls") + public Optional>> getUrls() { + return urls; + } + + @JsonProperty("addresses") + public Optional> getAddresses() { + return addresses; + } + + @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CompanyInfo && equalTo((CompanyInfo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CompanyInfo other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && legalName.equals(other.legalName) + && taxNumber.equals(other.taxNumber) + && fiscalYearEndMonth.equals(other.fiscalYearEndMonth) + && fiscalYearEndDay.equals(other.fiscalYearEndDay) + && currency.equals(other.currency) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && urls.equals(other.urls) + && addresses.equals(other.addresses) + && phoneNumbers.equals(other.phoneNumbers) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.legalName, + this.taxNumber, + this.fiscalYearEndMonth, + this.fiscalYearEndDay, + this.currency, + this.remoteCreatedAt, + this.urls, + this.addresses, + this.phoneNumbers, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 legalName = Optional.empty(); + + private Optional taxNumber = Optional.empty(); + + private Optional fiscalYearEndMonth = Optional.empty(); + + private Optional fiscalYearEndDay = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional>> urls = 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(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CompanyInfo other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + legalName(other.getLegalName()); + taxNumber(other.getTaxNumber()); + fiscalYearEndMonth(other.getFiscalYearEndMonth()); + fiscalYearEndDay(other.getFiscalYearEndDay()); + currency(other.getCurrency()); + remoteCreatedAt(other.getRemoteCreatedAt()); + urls(other.getUrls()); + addresses(other.getAddresses()); + phoneNumbers(other.getPhoneNumbers()); + 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 = "legal_name", nulls = Nulls.SKIP) + public Builder legalName(Optional legalName) { + this.legalName = legalName; + return this; + } + + public Builder legalName(String legalName) { + this.legalName = Optional.ofNullable(legalName); + 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 = "fiscal_year_end_month", nulls = Nulls.SKIP) + public Builder fiscalYearEndMonth(Optional fiscalYearEndMonth) { + this.fiscalYearEndMonth = fiscalYearEndMonth; + return this; + } + + public Builder fiscalYearEndMonth(Integer fiscalYearEndMonth) { + this.fiscalYearEndMonth = Optional.ofNullable(fiscalYearEndMonth); + return this; + } + + @JsonSetter(value = "fiscal_year_end_day", nulls = Nulls.SKIP) + public Builder fiscalYearEndDay(Optional fiscalYearEndDay) { + this.fiscalYearEndDay = fiscalYearEndDay; + return this; + } + + public Builder fiscalYearEndDay(Integer fiscalYearEndDay) { + this.fiscalYearEndDay = Optional.ofNullable(fiscalYearEndDay); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(CompanyInfoCurrency currency) { + this.currency = Optional.ofNullable(currency); + 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 = "urls", nulls = Nulls.SKIP) + public Builder urls(Optional>> urls) { + this.urls = urls; + return this; + } + + public Builder urls(List> urls) { + this.urls = Optional.ofNullable(urls); + 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; + } + + public CompanyInfo build() { + return new CompanyInfo( + id, + remoteId, + createdAt, + modifiedAt, + name, + legalName, + taxNumber, + fiscalYearEndMonth, + fiscalYearEndDay, + currency, + remoteCreatedAt, + urls, + addresses, + phoneNumbers, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CompanyInfoCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CompanyInfoCurrency.java new file mode 100644 index 000000000..cf075959a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CompanyInfoCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/ComponentTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ComponentTypeEnum.java new file mode 100644 index 000000000..38939f8d0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ComponentTypeEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ComponentTypeEnum { + SALES("SALES"), + + PURCHASE("PURCHASE"); + + private final String value; + + ComponentTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/Contact.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/Contact.java new file mode 100644 index 000000000..8f6240be4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/Contact.java @@ -0,0 +1,610 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/accounting/types/ContactAddressesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ContactAddressesItem.java new file mode 100644 index 000000000..6a33c769f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ContactAddressesItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ContactAddressesItem.Deserializer.class) +public final class ContactAddressesItem { + private final Object value; + + private final int type; + + private ContactAddressesItem(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((Address) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactAddressesItem && equalTo((ContactAddressesItem) other); + } + + private boolean equalTo(ContactAddressesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ContactAddressesItem of(String value) { + return new ContactAddressesItem(value, 0); + } + + public static ContactAddressesItem of(Address value) { + return new ContactAddressesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Address value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ContactAddressesItem.class); + } + + @Override + public ContactAddressesItem 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, Address.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ContactRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ContactRequest.java new file mode 100644 index 000000000..3c38a5974 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ContactRequest.java @@ -0,0 +1,438 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/accounting/types/ContactRequestAddressesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ContactRequestAddressesItem.java new file mode 100644 index 000000000..5c1265890 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ContactRequestAddressesItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ContactRequestAddressesItem.Deserializer.class) +public final class ContactRequestAddressesItem { + private final Object value; + + private final int type; + + private ContactRequestAddressesItem(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((Address) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactRequestAddressesItem && equalTo((ContactRequestAddressesItem) other); + } + + private boolean equalTo(ContactRequestAddressesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ContactRequestAddressesItem of(String value) { + return new ContactRequestAddressesItem(value, 0); + } + + public static ContactRequestAddressesItem of(Address value) { + return new ContactRequestAddressesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Address value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ContactRequestAddressesItem.class); + } + + @Override + public ContactRequestAddressesItem 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, Address.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ContactRequestStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ContactRequestStatus.java new file mode 100644 index 000000000..fe12078bf --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ContactRequestStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/ContactResponse.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ContactResponse.java new file mode 100644 index 000000000..2691382f4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ContactResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ContactResponse.Builder.class) +public final class ContactResponse { + private final Contact model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private ContactResponse( + Contact 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 Contact getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactResponse && equalTo((ContactResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ContactResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull Contact model); + + Builder from(ContactResponse other); + } + + public interface _FinalStage { + ContactResponse 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 Contact model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(ContactResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull Contact model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public ContactResponse build() { + return new ContactResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ContactStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ContactStatus.java new file mode 100644 index 000000000..cb9e084c0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ContactStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/CountryEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CountryEnum.java new file mode 100644 index 000000000..e825145cd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CountryEnum.java @@ -0,0 +1,518 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNote.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNote.java new file mode 100644 index 000000000..23f1152cf --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNote.java @@ -0,0 +1,1091 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreditNote.Builder.class) +public final class CreditNote { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional transactionDate; + + private final Optional status; + + private final Optional number; + + private final Optional contact; + + private final Optional company; + + private final Optional exchangeRate; + + private final Optional totalAmount; + + private final Optional remainingCredit; + + private final Optional inclusiveOfTax; + + private final Optional> lineItems; + + private final Optional>> trackingCategories; + + private final Optional currency; + + private final Optional remoteCreatedAt; + + private final Optional remoteUpdatedAt; + + private final Optional>> payments; + + private final Optional>> appliedPayments; + + private final Optional accountingPeriod; + + private final Optional> appliedToLines; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private CreditNote( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional transactionDate, + Optional status, + Optional number, + Optional contact, + Optional company, + Optional exchangeRate, + Optional totalAmount, + Optional remainingCredit, + Optional inclusiveOfTax, + Optional> lineItems, + Optional>> trackingCategories, + Optional currency, + Optional remoteCreatedAt, + Optional remoteUpdatedAt, + Optional>> payments, + Optional>> appliedPayments, + Optional accountingPeriod, + Optional> appliedToLines, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.transactionDate = transactionDate; + this.status = status; + this.number = number; + this.contact = contact; + this.company = company; + this.exchangeRate = exchangeRate; + this.totalAmount = totalAmount; + this.remainingCredit = remainingCredit; + this.inclusiveOfTax = inclusiveOfTax; + this.lineItems = lineItems; + this.trackingCategories = trackingCategories; + this.currency = currency; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteUpdatedAt = remoteUpdatedAt; + this.payments = payments; + this.appliedPayments = appliedPayments; + this.accountingPeriod = accountingPeriod; + this.appliedToLines = appliedToLines; + 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 credit note's transaction date. + */ + @JsonProperty("transaction_date") + public Optional getTransactionDate() { + return transactionDate; + } + + /** + * @return The credit note's status. + *
    + *
  • SUBMITTED - SUBMITTED
  • + *
  • AUTHORIZED - AUTHORIZED
  • + *
  • PAID - PAID
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The credit note's number. + */ + @JsonProperty("number") + public Optional getNumber() { + return number; + } + + /** + * @return The credit note's contact. + */ + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + + /** + * @return The company the credit note belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The credit note's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return The credit note's total amount. + */ + @JsonProperty("total_amount") + public Optional getTotalAmount() { + return totalAmount; + } + + /** + * @return The amount of value remaining in the credit note that the customer can use. + */ + @JsonProperty("remaining_credit") + public Optional getRemainingCredit() { + return remainingCredit; + } + + /** + * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. + */ + @JsonProperty("inclusive_of_tax") + public Optional getInclusiveOfTax() { + return inclusiveOfTax; + } + + @JsonProperty("line_items") + public Optional> getLineItems() { + return lineItems; + } + + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The credit note'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 When the third party's credit note was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the third party's credit note was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @return Array of Payment object IDs + */ + @JsonProperty("payments") + public Optional>> getPayments() { + return payments; + } + + /** + * @return A list of the Payment Applied to Lines common models related to a given Invoice, Credit Note, or Journal Entry. + */ + @JsonProperty("applied_payments") + public Optional>> getAppliedPayments() { + return appliedPayments; + } + + /** + * @return The accounting period that the CreditNote was generated in. + */ + @JsonProperty("accounting_period") + public Optional getAccountingPeriod() { + return accountingPeriod; + } + + /** + * @return A list of the CreditNote Applied to Lines common models related to a given Credit Note + */ + @JsonProperty("applied_to_lines") + public Optional> getAppliedToLines() { + return appliedToLines; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNote && equalTo((CreditNote) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreditNote other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && transactionDate.equals(other.transactionDate) + && status.equals(other.status) + && number.equals(other.number) + && contact.equals(other.contact) + && company.equals(other.company) + && exchangeRate.equals(other.exchangeRate) + && totalAmount.equals(other.totalAmount) + && remainingCredit.equals(other.remainingCredit) + && inclusiveOfTax.equals(other.inclusiveOfTax) + && lineItems.equals(other.lineItems) + && trackingCategories.equals(other.trackingCategories) + && currency.equals(other.currency) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && payments.equals(other.payments) + && appliedPayments.equals(other.appliedPayments) + && accountingPeriod.equals(other.accountingPeriod) + && appliedToLines.equals(other.appliedToLines) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.transactionDate, + this.status, + this.number, + this.contact, + this.company, + this.exchangeRate, + this.totalAmount, + this.remainingCredit, + this.inclusiveOfTax, + this.lineItems, + this.trackingCategories, + this.currency, + this.remoteCreatedAt, + this.remoteUpdatedAt, + this.payments, + this.appliedPayments, + this.accountingPeriod, + this.appliedToLines, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 transactionDate = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional number = Optional.empty(); + + private Optional contact = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Optional remainingCredit = Optional.empty(); + + private Optional inclusiveOfTax = Optional.empty(); + + private Optional> lineItems = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional>> payments = Optional.empty(); + + private Optional>> appliedPayments = Optional.empty(); + + private Optional accountingPeriod = Optional.empty(); + + private Optional> appliedToLines = 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(CreditNote other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + transactionDate(other.getTransactionDate()); + status(other.getStatus()); + number(other.getNumber()); + contact(other.getContact()); + company(other.getCompany()); + exchangeRate(other.getExchangeRate()); + totalAmount(other.getTotalAmount()); + remainingCredit(other.getRemainingCredit()); + inclusiveOfTax(other.getInclusiveOfTax()); + lineItems(other.getLineItems()); + trackingCategories(other.getTrackingCategories()); + currency(other.getCurrency()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + payments(other.getPayments()); + appliedPayments(other.getAppliedPayments()); + accountingPeriod(other.getAccountingPeriod()); + appliedToLines(other.getAppliedToLines()); + 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 = "transaction_date", nulls = Nulls.SKIP) + public Builder transactionDate(Optional transactionDate) { + this.transactionDate = transactionDate; + return this; + } + + public Builder transactionDate(OffsetDateTime transactionDate) { + this.transactionDate = Optional.ofNullable(transactionDate); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(CreditNoteStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "number", nulls = Nulls.SKIP) + public Builder number(Optional number) { + this.number = number; + return this; + } + + public Builder number(String number) { + this.number = Optional.ofNullable(number); + return this; + } + + @JsonSetter(value = "contact", nulls = Nulls.SKIP) + public Builder contact(Optional contact) { + this.contact = contact; + return this; + } + + public Builder contact(CreditNoteContact contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(CreditNoteCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + @JsonSetter(value = "total_amount", nulls = Nulls.SKIP) + public Builder totalAmount(Optional totalAmount) { + this.totalAmount = totalAmount; + return this; + } + + public Builder totalAmount(Double totalAmount) { + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + @JsonSetter(value = "remaining_credit", nulls = Nulls.SKIP) + public Builder remainingCredit(Optional remainingCredit) { + this.remainingCredit = remainingCredit; + return this; + } + + public Builder remainingCredit(Double remainingCredit) { + this.remainingCredit = Optional.ofNullable(remainingCredit); + return this; + } + + @JsonSetter(value = "inclusive_of_tax", nulls = Nulls.SKIP) + public Builder inclusiveOfTax(Optional inclusiveOfTax) { + this.inclusiveOfTax = inclusiveOfTax; + return this; + } + + public Builder inclusiveOfTax(Boolean inclusiveOfTax) { + this.inclusiveOfTax = Optional.ofNullable(inclusiveOfTax); + return this; + } + + @JsonSetter(value = "line_items", nulls = Nulls.SKIP) + public Builder lineItems(Optional> lineItems) { + this.lineItems = lineItems; + return this; + } + + public Builder lineItems(List lineItems) { + this.lineItems = Optional.ofNullable(lineItems); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(CreditNoteCurrency currency) { + this.currency = Optional.ofNullable(currency); + 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_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 = "payments", nulls = Nulls.SKIP) + public Builder payments(Optional>> payments) { + this.payments = payments; + return this; + } + + public Builder payments(List> payments) { + this.payments = Optional.ofNullable(payments); + return this; + } + + @JsonSetter(value = "applied_payments", nulls = Nulls.SKIP) + public Builder appliedPayments(Optional>> appliedPayments) { + this.appliedPayments = appliedPayments; + return this; + } + + public Builder appliedPayments(List> appliedPayments) { + this.appliedPayments = Optional.ofNullable(appliedPayments); + return this; + } + + @JsonSetter(value = "accounting_period", nulls = Nulls.SKIP) + public Builder accountingPeriod(Optional accountingPeriod) { + this.accountingPeriod = accountingPeriod; + return this; + } + + public Builder accountingPeriod(CreditNoteAccountingPeriod accountingPeriod) { + this.accountingPeriod = Optional.ofNullable(accountingPeriod); + return this; + } + + @JsonSetter(value = "applied_to_lines", nulls = Nulls.SKIP) + public Builder appliedToLines(Optional> appliedToLines) { + this.appliedToLines = appliedToLines; + return this; + } + + public Builder appliedToLines(List appliedToLines) { + this.appliedToLines = Optional.ofNullable(appliedToLines); + 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 CreditNote build() { + return new CreditNote( + id, + remoteId, + createdAt, + modifiedAt, + transactionDate, + status, + number, + contact, + company, + exchangeRate, + totalAmount, + remainingCredit, + inclusiveOfTax, + lineItems, + trackingCategories, + currency, + remoteCreatedAt, + remoteUpdatedAt, + payments, + appliedPayments, + accountingPeriod, + appliedToLines, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteAccountingPeriod.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteAccountingPeriod.java new file mode 100644 index 000000000..30ac8d348 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteAccountingPeriod.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreditNoteAccountingPeriod.Deserializer.class) +public final class CreditNoteAccountingPeriod { + private final Object value; + + private final int type; + + private CreditNoteAccountingPeriod(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((AccountingPeriod) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteAccountingPeriod && equalTo((CreditNoteAccountingPeriod) other); + } + + private boolean equalTo(CreditNoteAccountingPeriod other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreditNoteAccountingPeriod of(String value) { + return new CreditNoteAccountingPeriod(value, 0); + } + + public static CreditNoteAccountingPeriod of(AccountingPeriod value) { + return new CreditNoteAccountingPeriod(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(AccountingPeriod value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreditNoteAccountingPeriod.class); + } + + @Override + public CreditNoteAccountingPeriod 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, AccountingPeriod.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteAppliedPaymentsItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteAppliedPaymentsItem.java new file mode 100644 index 000000000..9eba13d88 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteAppliedPaymentsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreditNoteAppliedPaymentsItem.Deserializer.class) +public final class CreditNoteAppliedPaymentsItem { + private final Object value; + + private final int type; + + private CreditNoteAppliedPaymentsItem(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((PaymentLineItem) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteAppliedPaymentsItem && equalTo((CreditNoteAppliedPaymentsItem) other); + } + + private boolean equalTo(CreditNoteAppliedPaymentsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreditNoteAppliedPaymentsItem of(String value) { + return new CreditNoteAppliedPaymentsItem(value, 0); + } + + public static CreditNoteAppliedPaymentsItem of(PaymentLineItem value) { + return new CreditNoteAppliedPaymentsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PaymentLineItem value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreditNoteAppliedPaymentsItem.class); + } + + @Override + public CreditNoteAppliedPaymentsItem 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, PaymentLineItem.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteApplyLineForCreditNote.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteApplyLineForCreditNote.java new file mode 100644 index 000000000..5f5744dbb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteApplyLineForCreditNote.java @@ -0,0 +1,269 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = CreditNoteApplyLineForCreditNote.Builder.class) +public final class CreditNoteApplyLineForCreditNote { + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional invoice; + + private final Optional appliedDate; + + private final Optional appliedAmount; + + private final Optional remoteWasDeleted; + + private final Map additionalProperties; + + private CreditNoteApplyLineForCreditNote( + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional invoice, + Optional appliedDate, + Optional appliedAmount, + Optional remoteWasDeleted, + Map additionalProperties) { + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.invoice = invoice; + this.appliedDate = appliedDate; + this.appliedAmount = appliedAmount; + this.remoteWasDeleted = remoteWasDeleted; + 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("invoice") + public Optional getInvoice() { + return invoice; + } + + /** + * @return Date that the credit note is applied to the invoice. + */ + @JsonProperty("applied_date") + public Optional getAppliedDate() { + return appliedDate; + } + + /** + * @return The amount of the Credit Note applied to the invoice. + */ + @JsonProperty("applied_amount") + public Optional getAppliedAmount() { + return appliedAmount; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteApplyLineForCreditNote && equalTo((CreditNoteApplyLineForCreditNote) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreditNoteApplyLineForCreditNote other) { + return remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && invoice.equals(other.invoice) + && appliedDate.equals(other.appliedDate) + && appliedAmount.equals(other.appliedAmount) + && remoteWasDeleted.equals(other.remoteWasDeleted); + } + + @Override + public int hashCode() { + return Objects.hash( + this.remoteId, + this.createdAt, + this.modifiedAt, + this.invoice, + this.appliedDate, + this.appliedAmount, + this.remoteWasDeleted); + } + + @Override + 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 invoice = Optional.empty(); + + private Optional appliedDate = Optional.empty(); + + private Optional appliedAmount = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreditNoteApplyLineForCreditNote other) { + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + invoice(other.getInvoice()); + appliedDate(other.getAppliedDate()); + appliedAmount(other.getAppliedAmount()); + remoteWasDeleted(other.getRemoteWasDeleted()); + 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 = "invoice", nulls = Nulls.SKIP) + public Builder invoice(Optional invoice) { + this.invoice = invoice; + return this; + } + + public Builder invoice(CreditNoteApplyLineForCreditNoteInvoice invoice) { + this.invoice = Optional.ofNullable(invoice); + return this; + } + + @JsonSetter(value = "applied_date", nulls = Nulls.SKIP) + public Builder appliedDate(Optional appliedDate) { + this.appliedDate = appliedDate; + return this; + } + + public Builder appliedDate(OffsetDateTime appliedDate) { + this.appliedDate = Optional.ofNullable(appliedDate); + return this; + } + + @JsonSetter(value = "applied_amount", nulls = Nulls.SKIP) + public Builder appliedAmount(Optional appliedAmount) { + this.appliedAmount = appliedAmount; + return this; + } + + public Builder appliedAmount(String appliedAmount) { + this.appliedAmount = Optional.ofNullable(appliedAmount); + 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 CreditNoteApplyLineForCreditNote build() { + return new CreditNoteApplyLineForCreditNote( + remoteId, + createdAt, + modifiedAt, + invoice, + appliedDate, + appliedAmount, + remoteWasDeleted, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteApplyLineForCreditNoteInvoice.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteApplyLineForCreditNoteInvoice.java new file mode 100644 index 000000000..6aae357e9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteApplyLineForCreditNoteInvoice.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreditNoteApplyLineForCreditNoteInvoice.Deserializer.class) +public final class CreditNoteApplyLineForCreditNoteInvoice { + private final Object value; + + private final int type; + + private CreditNoteApplyLineForCreditNoteInvoice(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((Invoice) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteApplyLineForCreditNoteInvoice + && equalTo((CreditNoteApplyLineForCreditNoteInvoice) other); + } + + private boolean equalTo(CreditNoteApplyLineForCreditNoteInvoice other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreditNoteApplyLineForCreditNoteInvoice of(String value) { + return new CreditNoteApplyLineForCreditNoteInvoice(value, 0); + } + + public static CreditNoteApplyLineForCreditNoteInvoice of(Invoice value) { + return new CreditNoteApplyLineForCreditNoteInvoice(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Invoice value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreditNoteApplyLineForCreditNoteInvoice.class); + } + + @Override + public CreditNoteApplyLineForCreditNoteInvoice 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, Invoice.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteApplyLineForCreditNoteRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteApplyLineForCreditNoteRequest.java new file mode 100644 index 000000000..9fc84759c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteApplyLineForCreditNoteRequest.java @@ -0,0 +1,236 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = CreditNoteApplyLineForCreditNoteRequest.Builder.class) +public final class CreditNoteApplyLineForCreditNoteRequest { + private final Optional remoteId; + + private final Optional invoice; + + private final Optional appliedDate; + + private final Optional appliedAmount; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private CreditNoteApplyLineForCreditNoteRequest( + Optional remoteId, + Optional invoice, + Optional appliedDate, + Optional appliedAmount, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.remoteId = remoteId; + this.invoice = invoice; + this.appliedDate = appliedDate; + this.appliedAmount = appliedAmount; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @JsonProperty("invoice") + public Optional getInvoice() { + return invoice; + } + + /** + * @return Date that the credit note is applied to the invoice. + */ + @JsonProperty("applied_date") + public Optional getAppliedDate() { + return appliedDate; + } + + /** + * @return The amount of the Credit Note applied to the invoice. + */ + @JsonProperty("applied_amount") + public Optional getAppliedAmount() { + return appliedAmount; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteApplyLineForCreditNoteRequest + && equalTo((CreditNoteApplyLineForCreditNoteRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreditNoteApplyLineForCreditNoteRequest other) { + return remoteId.equals(other.remoteId) + && invoice.equals(other.invoice) + && appliedDate.equals(other.appliedDate) + && appliedAmount.equals(other.appliedAmount) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @Override + public int hashCode() { + return Objects.hash( + this.remoteId, + this.invoice, + this.appliedDate, + this.appliedAmount, + this.integrationParams, + this.linkedAccountParams); + } + + @Override + 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 invoice = Optional.empty(); + + private Optional appliedDate = Optional.empty(); + + private Optional appliedAmount = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreditNoteApplyLineForCreditNoteRequest other) { + remoteId(other.getRemoteId()); + invoice(other.getInvoice()); + appliedDate(other.getAppliedDate()); + appliedAmount(other.getAppliedAmount()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + 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 = "invoice", nulls = Nulls.SKIP) + public Builder invoice(Optional invoice) { + this.invoice = invoice; + return this; + } + + public Builder invoice(CreditNoteApplyLineForCreditNoteRequestInvoice invoice) { + this.invoice = Optional.ofNullable(invoice); + return this; + } + + @JsonSetter(value = "applied_date", nulls = Nulls.SKIP) + public Builder appliedDate(Optional appliedDate) { + this.appliedDate = appliedDate; + return this; + } + + public Builder appliedDate(OffsetDateTime appliedDate) { + this.appliedDate = Optional.ofNullable(appliedDate); + return this; + } + + @JsonSetter(value = "applied_amount", nulls = Nulls.SKIP) + public Builder appliedAmount(Optional appliedAmount) { + this.appliedAmount = appliedAmount; + return this; + } + + public Builder appliedAmount(String appliedAmount) { + this.appliedAmount = Optional.ofNullable(appliedAmount); + 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 CreditNoteApplyLineForCreditNoteRequest build() { + return new CreditNoteApplyLineForCreditNoteRequest( + remoteId, + invoice, + appliedDate, + appliedAmount, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteApplyLineForCreditNoteRequestInvoice.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteApplyLineForCreditNoteRequestInvoice.java new file mode 100644 index 000000000..438ae7b91 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteApplyLineForCreditNoteRequestInvoice.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreditNoteApplyLineForCreditNoteRequestInvoice.Deserializer.class) +public final class CreditNoteApplyLineForCreditNoteRequestInvoice { + private final Object value; + + private final int type; + + private CreditNoteApplyLineForCreditNoteRequestInvoice(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((Invoice) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteApplyLineForCreditNoteRequestInvoice + && equalTo((CreditNoteApplyLineForCreditNoteRequestInvoice) other); + } + + private boolean equalTo(CreditNoteApplyLineForCreditNoteRequestInvoice other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreditNoteApplyLineForCreditNoteRequestInvoice of(String value) { + return new CreditNoteApplyLineForCreditNoteRequestInvoice(value, 0); + } + + public static CreditNoteApplyLineForCreditNoteRequestInvoice of(Invoice value) { + return new CreditNoteApplyLineForCreditNoteRequestInvoice(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Invoice value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreditNoteApplyLineForCreditNoteRequestInvoice.class); + } + + @Override + public CreditNoteApplyLineForCreditNoteRequestInvoice 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, Invoice.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteApplyLineForInvoice.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteApplyLineForInvoice.java new file mode 100644 index 000000000..1ec37447b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteApplyLineForInvoice.java @@ -0,0 +1,269 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = CreditNoteApplyLineForInvoice.Builder.class) +public final class CreditNoteApplyLineForInvoice { + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional creditNote; + + private final Optional appliedDate; + + private final Optional appliedAmount; + + private final Optional remoteWasDeleted; + + private final Map additionalProperties; + + private CreditNoteApplyLineForInvoice( + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional creditNote, + Optional appliedDate, + Optional appliedAmount, + Optional remoteWasDeleted, + Map additionalProperties) { + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.creditNote = creditNote; + this.appliedDate = appliedDate; + this.appliedAmount = appliedAmount; + this.remoteWasDeleted = remoteWasDeleted; + 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("credit_note") + public Optional getCreditNote() { + return creditNote; + } + + /** + * @return Date that the credit note is applied to the invoice. + */ + @JsonProperty("applied_date") + public Optional getAppliedDate() { + return appliedDate; + } + + /** + * @return The amount of the Credit Note applied to the invoice. + */ + @JsonProperty("applied_amount") + public Optional getAppliedAmount() { + return appliedAmount; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteApplyLineForInvoice && equalTo((CreditNoteApplyLineForInvoice) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreditNoteApplyLineForInvoice other) { + return remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && creditNote.equals(other.creditNote) + && appliedDate.equals(other.appliedDate) + && appliedAmount.equals(other.appliedAmount) + && remoteWasDeleted.equals(other.remoteWasDeleted); + } + + @Override + public int hashCode() { + return Objects.hash( + this.remoteId, + this.createdAt, + this.modifiedAt, + this.creditNote, + this.appliedDate, + this.appliedAmount, + this.remoteWasDeleted); + } + + @Override + 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 creditNote = Optional.empty(); + + private Optional appliedDate = Optional.empty(); + + private Optional appliedAmount = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreditNoteApplyLineForInvoice other) { + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + creditNote(other.getCreditNote()); + appliedDate(other.getAppliedDate()); + appliedAmount(other.getAppliedAmount()); + remoteWasDeleted(other.getRemoteWasDeleted()); + 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 = "credit_note", nulls = Nulls.SKIP) + public Builder creditNote(Optional creditNote) { + this.creditNote = creditNote; + return this; + } + + public Builder creditNote(CreditNoteApplyLineForInvoiceCreditNote creditNote) { + this.creditNote = Optional.ofNullable(creditNote); + return this; + } + + @JsonSetter(value = "applied_date", nulls = Nulls.SKIP) + public Builder appliedDate(Optional appliedDate) { + this.appliedDate = appliedDate; + return this; + } + + public Builder appliedDate(OffsetDateTime appliedDate) { + this.appliedDate = Optional.ofNullable(appliedDate); + return this; + } + + @JsonSetter(value = "applied_amount", nulls = Nulls.SKIP) + public Builder appliedAmount(Optional appliedAmount) { + this.appliedAmount = appliedAmount; + return this; + } + + public Builder appliedAmount(String appliedAmount) { + this.appliedAmount = Optional.ofNullable(appliedAmount); + 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 CreditNoteApplyLineForInvoice build() { + return new CreditNoteApplyLineForInvoice( + remoteId, + createdAt, + modifiedAt, + creditNote, + appliedDate, + appliedAmount, + remoteWasDeleted, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteApplyLineForInvoiceCreditNote.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteApplyLineForInvoiceCreditNote.java new file mode 100644 index 000000000..9a1a52238 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteApplyLineForInvoiceCreditNote.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreditNoteApplyLineForInvoiceCreditNote.Deserializer.class) +public final class CreditNoteApplyLineForInvoiceCreditNote { + private final Object value; + + private final int type; + + private CreditNoteApplyLineForInvoiceCreditNote(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((CreditNote) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteApplyLineForInvoiceCreditNote + && equalTo((CreditNoteApplyLineForInvoiceCreditNote) other); + } + + private boolean equalTo(CreditNoteApplyLineForInvoiceCreditNote other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreditNoteApplyLineForInvoiceCreditNote of(String value) { + return new CreditNoteApplyLineForInvoiceCreditNote(value, 0); + } + + public static CreditNoteApplyLineForInvoiceCreditNote of(CreditNote value) { + return new CreditNoteApplyLineForInvoiceCreditNote(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CreditNote value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreditNoteApplyLineForInvoiceCreditNote.class); + } + + @Override + public CreditNoteApplyLineForInvoiceCreditNote 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, CreditNote.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteCompany.java new file mode 100644 index 000000000..440f5eef0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteCompany.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreditNoteCompany.Deserializer.class) +public final class CreditNoteCompany { + private final Object value; + + private final int type; + + private CreditNoteCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteCompany && equalTo((CreditNoteCompany) other); + } + + private boolean equalTo(CreditNoteCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreditNoteCompany of(String value) { + return new CreditNoteCompany(value, 0); + } + + public static CreditNoteCompany of(CompanyInfo value) { + return new CreditNoteCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreditNoteCompany.class); + } + + @Override + public CreditNoteCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteContact.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteContact.java new file mode 100644 index 000000000..e01e2e88d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteContact.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreditNoteContact.Deserializer.class) +public final class CreditNoteContact { + private final Object value; + + private final int type; + + private CreditNoteContact(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteContact && equalTo((CreditNoteContact) other); + } + + private boolean equalTo(CreditNoteContact other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreditNoteContact of(String value) { + return new CreditNoteContact(value, 0); + } + + public static CreditNoteContact of(Contact value) { + return new CreditNoteContact(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreditNoteContact.class); + } + + @Override + public CreditNoteContact 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteCurrency.java new file mode 100644 index 000000000..f25f3df3d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/CreditNoteLineItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteLineItem.java new file mode 100644 index 000000000..3b303fd5b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteLineItem.java @@ -0,0 +1,553 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreditNoteLineItem.Builder.class) +public final class CreditNoteLineItem { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional item; + + private final Optional name; + + private final Optional description; + + private final Optional quantity; + + private final Optional memo; + + private final Optional unitPrice; + + private final Optional taxRate; + + private final Optional totalLineAmount; + + private final Optional trackingCategory; + + private final Optional>> trackingCategories; + + private final Optional account; + + private final Optional company; + + private final Optional remoteWasDeleted; + + private final Map additionalProperties; + + private CreditNoteLineItem( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional item, + Optional name, + Optional description, + Optional quantity, + Optional memo, + Optional unitPrice, + Optional taxRate, + Optional totalLineAmount, + Optional trackingCategory, + Optional>> trackingCategories, + Optional account, + Optional company, + Optional remoteWasDeleted, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.item = item; + this.name = name; + this.description = description; + this.quantity = quantity; + this.memo = memo; + this.unitPrice = unitPrice; + this.taxRate = taxRate; + this.totalLineAmount = totalLineAmount; + this.trackingCategory = trackingCategory; + this.trackingCategories = trackingCategories; + this.account = account; + this.company = company; + this.remoteWasDeleted = remoteWasDeleted; + 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; + } + + @JsonProperty("item") + public Optional getItem() { + return item; + } + + /** + * @return The credit note line item's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The description of the item that is owed. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The credit note line item's quantity. + */ + @JsonProperty("quantity") + public Optional getQuantity() { + return quantity; + } + + /** + * @return The credit note line item's memo. + */ + @JsonProperty("memo") + public Optional getMemo() { + return memo; + } + + /** + * @return The credit note line item's unit price. + */ + @JsonProperty("unit_price") + public Optional getUnitPrice() { + return unitPrice; + } + + /** + * @return The tax rate that applies to this line item. + */ + @JsonProperty("tax_rate") + public Optional getTaxRate() { + return taxRate; + } + + /** + * @return The credit note line item's total. + */ + @JsonProperty("total_line_amount") + public Optional getTotalLineAmount() { + return totalLineAmount; + } + + /** + * @return The credit note line item's associated tracking category. + */ + @JsonProperty("tracking_category") + public Optional getTrackingCategory() { + return trackingCategory; + } + + /** + * @return The credit note line item's associated tracking categories. + */ + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The credit note line item's account. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The company the credit note 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteLineItem && equalTo((CreditNoteLineItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreditNoteLineItem other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && item.equals(other.item) + && name.equals(other.name) + && description.equals(other.description) + && quantity.equals(other.quantity) + && memo.equals(other.memo) + && unitPrice.equals(other.unitPrice) + && taxRate.equals(other.taxRate) + && totalLineAmount.equals(other.totalLineAmount) + && trackingCategory.equals(other.trackingCategory) + && trackingCategories.equals(other.trackingCategories) + && account.equals(other.account) + && company.equals(other.company) + && remoteWasDeleted.equals(other.remoteWasDeleted); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.item, + this.name, + this.description, + this.quantity, + this.memo, + this.unitPrice, + this.taxRate, + this.totalLineAmount, + this.trackingCategory, + this.trackingCategories, + this.account, + this.company, + this.remoteWasDeleted); + } + + @Override + 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 item = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional quantity = Optional.empty(); + + private Optional memo = Optional.empty(); + + private Optional unitPrice = Optional.empty(); + + private Optional taxRate = Optional.empty(); + + private Optional totalLineAmount = Optional.empty(); + + private Optional trackingCategory = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreditNoteLineItem other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + item(other.getItem()); + name(other.getName()); + description(other.getDescription()); + quantity(other.getQuantity()); + memo(other.getMemo()); + unitPrice(other.getUnitPrice()); + taxRate(other.getTaxRate()); + totalLineAmount(other.getTotalLineAmount()); + trackingCategory(other.getTrackingCategory()); + trackingCategories(other.getTrackingCategories()); + account(other.getAccount()); + company(other.getCompany()); + remoteWasDeleted(other.getRemoteWasDeleted()); + 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 = "item", nulls = Nulls.SKIP) + public Builder item(Optional item) { + this.item = item; + return this; + } + + public Builder item(CreditNoteLineItemItem item) { + this.item = Optional.ofNullable(item); + 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 = "quantity", nulls = Nulls.SKIP) + public Builder quantity(Optional quantity) { + this.quantity = quantity; + return this; + } + + public Builder quantity(String quantity) { + this.quantity = Optional.ofNullable(quantity); + return this; + } + + @JsonSetter(value = "memo", nulls = Nulls.SKIP) + public Builder memo(Optional memo) { + this.memo = memo; + return this; + } + + public Builder memo(String memo) { + this.memo = Optional.ofNullable(memo); + return this; + } + + @JsonSetter(value = "unit_price", nulls = Nulls.SKIP) + public Builder unitPrice(Optional unitPrice) { + this.unitPrice = unitPrice; + return this; + } + + public Builder unitPrice(String unitPrice) { + this.unitPrice = Optional.ofNullable(unitPrice); + return this; + } + + @JsonSetter(value = "tax_rate", nulls = Nulls.SKIP) + public Builder taxRate(Optional taxRate) { + this.taxRate = taxRate; + return this; + } + + public Builder taxRate(String taxRate) { + this.taxRate = Optional.ofNullable(taxRate); + return this; + } + + @JsonSetter(value = "total_line_amount", nulls = Nulls.SKIP) + public Builder totalLineAmount(Optional totalLineAmount) { + this.totalLineAmount = totalLineAmount; + return this; + } + + public Builder totalLineAmount(String totalLineAmount) { + this.totalLineAmount = Optional.ofNullable(totalLineAmount); + return this; + } + + @JsonSetter(value = "tracking_category", nulls = Nulls.SKIP) + public Builder trackingCategory(Optional trackingCategory) { + this.trackingCategory = trackingCategory; + return this; + } + + public Builder trackingCategory(String trackingCategory) { + this.trackingCategory = Optional.ofNullable(trackingCategory); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories(Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(String account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(CreditNoteLineItemCompany 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; + } + + public CreditNoteLineItem build() { + return new CreditNoteLineItem( + id, + remoteId, + createdAt, + modifiedAt, + item, + name, + description, + quantity, + memo, + unitPrice, + taxRate, + totalLineAmount, + trackingCategory, + trackingCategories, + account, + company, + remoteWasDeleted, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteLineItemCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteLineItemCompany.java new file mode 100644 index 000000000..0b8058e18 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteLineItemCompany.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreditNoteLineItemCompany.Deserializer.class) +public final class CreditNoteLineItemCompany { + private final Object value; + + private final int type; + + private CreditNoteLineItemCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteLineItemCompany && equalTo((CreditNoteLineItemCompany) other); + } + + private boolean equalTo(CreditNoteLineItemCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreditNoteLineItemCompany of(String value) { + return new CreditNoteLineItemCompany(value, 0); + } + + public static CreditNoteLineItemCompany of(CompanyInfo value) { + return new CreditNoteLineItemCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreditNoteLineItemCompany.class); + } + + @Override + public CreditNoteLineItemCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteLineItemItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteLineItemItem.java new file mode 100644 index 000000000..08e6df1a9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteLineItemItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreditNoteLineItemItem.Deserializer.class) +public final class CreditNoteLineItemItem { + private final Object value; + + private final int type; + + private CreditNoteLineItemItem(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((Item) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteLineItemItem && equalTo((CreditNoteLineItemItem) other); + } + + private boolean equalTo(CreditNoteLineItemItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreditNoteLineItemItem of(String value) { + return new CreditNoteLineItemItem(value, 0); + } + + public static CreditNoteLineItemItem of(Item value) { + return new CreditNoteLineItemItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Item value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreditNoteLineItemItem.class); + } + + @Override + public CreditNoteLineItemItem 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, Item.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteLineItemRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteLineItemRequest.java new file mode 100644 index 000000000..9b967d6d1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteLineItemRequest.java @@ -0,0 +1,492 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreditNoteLineItemRequest.Builder.class) +public final class CreditNoteLineItemRequest { + private final Optional remoteId; + + private final Optional item; + + private final Optional name; + + private final Optional description; + + private final Optional quantity; + + private final Optional memo; + + private final Optional unitPrice; + + private final Optional taxRate; + + private final Optional totalLineAmount; + + private final Optional trackingCategory; + + private final Optional>> trackingCategories; + + private final Optional account; + + private final Optional company; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private CreditNoteLineItemRequest( + Optional remoteId, + Optional item, + Optional name, + Optional description, + Optional quantity, + Optional memo, + Optional unitPrice, + Optional taxRate, + Optional totalLineAmount, + Optional trackingCategory, + Optional>> trackingCategories, + Optional account, + Optional company, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.remoteId = remoteId; + this.item = item; + this.name = name; + this.description = description; + this.quantity = quantity; + this.memo = memo; + this.unitPrice = unitPrice; + this.taxRate = taxRate; + this.totalLineAmount = totalLineAmount; + this.trackingCategory = trackingCategory; + this.trackingCategories = trackingCategories; + this.account = account; + this.company = company; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @JsonProperty("item") + public Optional getItem() { + return item; + } + + /** + * @return The credit note line item's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The description of the item that is owed. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The credit note line item's quantity. + */ + @JsonProperty("quantity") + public Optional getQuantity() { + return quantity; + } + + /** + * @return The credit note line item's memo. + */ + @JsonProperty("memo") + public Optional getMemo() { + return memo; + } + + /** + * @return The credit note line item's unit price. + */ + @JsonProperty("unit_price") + public Optional getUnitPrice() { + return unitPrice; + } + + /** + * @return The tax rate that applies to this line item. + */ + @JsonProperty("tax_rate") + public Optional getTaxRate() { + return taxRate; + } + + /** + * @return The credit note line item's total. + */ + @JsonProperty("total_line_amount") + public Optional getTotalLineAmount() { + return totalLineAmount; + } + + /** + * @return The credit note line item's associated tracking category. + */ + @JsonProperty("tracking_category") + public Optional getTrackingCategory() { + return trackingCategory; + } + + /** + * @return The credit note line item's associated tracking categories. + */ + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The credit note line item's account. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The company the credit note 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteLineItemRequest && equalTo((CreditNoteLineItemRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreditNoteLineItemRequest other) { + return remoteId.equals(other.remoteId) + && item.equals(other.item) + && name.equals(other.name) + && description.equals(other.description) + && quantity.equals(other.quantity) + && memo.equals(other.memo) + && unitPrice.equals(other.unitPrice) + && taxRate.equals(other.taxRate) + && totalLineAmount.equals(other.totalLineAmount) + && trackingCategory.equals(other.trackingCategory) + && trackingCategories.equals(other.trackingCategories) + && account.equals(other.account) + && company.equals(other.company) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @Override + public int hashCode() { + return Objects.hash( + this.remoteId, + this.item, + this.name, + this.description, + this.quantity, + this.memo, + this.unitPrice, + this.taxRate, + this.totalLineAmount, + this.trackingCategory, + this.trackingCategories, + this.account, + this.company, + this.integrationParams, + this.linkedAccountParams); + } + + @Override + 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 item = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional quantity = Optional.empty(); + + private Optional memo = Optional.empty(); + + private Optional unitPrice = Optional.empty(); + + private Optional taxRate = Optional.empty(); + + private Optional totalLineAmount = Optional.empty(); + + private Optional trackingCategory = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional account = 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(CreditNoteLineItemRequest other) { + remoteId(other.getRemoteId()); + item(other.getItem()); + name(other.getName()); + description(other.getDescription()); + quantity(other.getQuantity()); + memo(other.getMemo()); + unitPrice(other.getUnitPrice()); + taxRate(other.getTaxRate()); + totalLineAmount(other.getTotalLineAmount()); + trackingCategory(other.getTrackingCategory()); + trackingCategories(other.getTrackingCategories()); + account(other.getAccount()); + company(other.getCompany()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + 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 = "item", nulls = Nulls.SKIP) + public Builder item(Optional item) { + this.item = item; + return this; + } + + public Builder item(CreditNoteLineItemRequestItem item) { + this.item = Optional.ofNullable(item); + 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 = "quantity", nulls = Nulls.SKIP) + public Builder quantity(Optional quantity) { + this.quantity = quantity; + return this; + } + + public Builder quantity(String quantity) { + this.quantity = Optional.ofNullable(quantity); + return this; + } + + @JsonSetter(value = "memo", nulls = Nulls.SKIP) + public Builder memo(Optional memo) { + this.memo = memo; + return this; + } + + public Builder memo(String memo) { + this.memo = Optional.ofNullable(memo); + return this; + } + + @JsonSetter(value = "unit_price", nulls = Nulls.SKIP) + public Builder unitPrice(Optional unitPrice) { + this.unitPrice = unitPrice; + return this; + } + + public Builder unitPrice(String unitPrice) { + this.unitPrice = Optional.ofNullable(unitPrice); + return this; + } + + @JsonSetter(value = "tax_rate", nulls = Nulls.SKIP) + public Builder taxRate(Optional taxRate) { + this.taxRate = taxRate; + return this; + } + + public Builder taxRate(String taxRate) { + this.taxRate = Optional.ofNullable(taxRate); + return this; + } + + @JsonSetter(value = "total_line_amount", nulls = Nulls.SKIP) + public Builder totalLineAmount(Optional totalLineAmount) { + this.totalLineAmount = totalLineAmount; + return this; + } + + public Builder totalLineAmount(String totalLineAmount) { + this.totalLineAmount = Optional.ofNullable(totalLineAmount); + return this; + } + + @JsonSetter(value = "tracking_category", nulls = Nulls.SKIP) + public Builder trackingCategory(Optional trackingCategory) { + this.trackingCategory = trackingCategory; + return this; + } + + public Builder trackingCategory(String trackingCategory) { + this.trackingCategory = Optional.ofNullable(trackingCategory); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories(Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(String account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(CreditNoteLineItemRequestCompany 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 CreditNoteLineItemRequest build() { + return new CreditNoteLineItemRequest( + remoteId, + item, + name, + description, + quantity, + memo, + unitPrice, + taxRate, + totalLineAmount, + trackingCategory, + trackingCategories, + account, + company, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteLineItemRequestCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteLineItemRequestCompany.java new file mode 100644 index 000000000..70f402810 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteLineItemRequestCompany.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreditNoteLineItemRequestCompany.Deserializer.class) +public final class CreditNoteLineItemRequestCompany { + private final Object value; + + private final int type; + + private CreditNoteLineItemRequestCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteLineItemRequestCompany && equalTo((CreditNoteLineItemRequestCompany) other); + } + + private boolean equalTo(CreditNoteLineItemRequestCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreditNoteLineItemRequestCompany of(String value) { + return new CreditNoteLineItemRequestCompany(value, 0); + } + + public static CreditNoteLineItemRequestCompany of(CompanyInfo value) { + return new CreditNoteLineItemRequestCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreditNoteLineItemRequestCompany.class); + } + + @Override + public CreditNoteLineItemRequestCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteLineItemRequestItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteLineItemRequestItem.java new file mode 100644 index 000000000..69f01c47d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteLineItemRequestItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreditNoteLineItemRequestItem.Deserializer.class) +public final class CreditNoteLineItemRequestItem { + private final Object value; + + private final int type; + + private CreditNoteLineItemRequestItem(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((Item) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteLineItemRequestItem && equalTo((CreditNoteLineItemRequestItem) other); + } + + private boolean equalTo(CreditNoteLineItemRequestItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreditNoteLineItemRequestItem of(String value) { + return new CreditNoteLineItemRequestItem(value, 0); + } + + public static CreditNoteLineItemRequestItem of(Item value) { + return new CreditNoteLineItemRequestItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Item value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreditNoteLineItemRequestItem.class); + } + + @Override + public CreditNoteLineItemRequestItem 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, Item.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNotePaymentsItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNotePaymentsItem.java new file mode 100644 index 000000000..93063c82a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNotePaymentsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreditNotePaymentsItem.Deserializer.class) +public final class CreditNotePaymentsItem { + private final Object value; + + private final int type; + + private CreditNotePaymentsItem(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((Payment) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNotePaymentsItem && equalTo((CreditNotePaymentsItem) other); + } + + private boolean equalTo(CreditNotePaymentsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreditNotePaymentsItem of(String value) { + return new CreditNotePaymentsItem(value, 0); + } + + public static CreditNotePaymentsItem of(Payment value) { + return new CreditNotePaymentsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Payment value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreditNotePaymentsItem.class); + } + + @Override + public CreditNotePaymentsItem 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, Payment.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequest.java new file mode 100644 index 000000000..441f77a7d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequest.java @@ -0,0 +1,891 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreditNoteRequest.Builder.class) +public final class CreditNoteRequest { + private final Optional transactionDate; + + private final Optional status; + + private final Optional number; + + private final Optional contact; + + private final Optional company; + + private final Optional exchangeRate; + + private final Optional totalAmount; + + private final Optional remainingCredit; + + private final Optional inclusiveOfTax; + + private final Optional> lineItems; + + private final Optional>> trackingCategories; + + private final Optional currency; + + private final Optional>> payments; + + private final Optional>> appliedPayments; + + private final Optional accountingPeriod; + + private final Optional> appliedToLines; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private CreditNoteRequest( + Optional transactionDate, + Optional status, + Optional number, + Optional contact, + Optional company, + Optional exchangeRate, + Optional totalAmount, + Optional remainingCredit, + Optional inclusiveOfTax, + Optional> lineItems, + Optional>> trackingCategories, + Optional currency, + Optional>> payments, + Optional>> appliedPayments, + Optional accountingPeriod, + Optional> appliedToLines, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.transactionDate = transactionDate; + this.status = status; + this.number = number; + this.contact = contact; + this.company = company; + this.exchangeRate = exchangeRate; + this.totalAmount = totalAmount; + this.remainingCredit = remainingCredit; + this.inclusiveOfTax = inclusiveOfTax; + this.lineItems = lineItems; + this.trackingCategories = trackingCategories; + this.currency = currency; + this.payments = payments; + this.appliedPayments = appliedPayments; + this.accountingPeriod = accountingPeriod; + this.appliedToLines = appliedToLines; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The credit note's transaction date. + */ + @JsonProperty("transaction_date") + public Optional getTransactionDate() { + return transactionDate; + } + + /** + * @return The credit note's status. + *
    + *
  • SUBMITTED - SUBMITTED
  • + *
  • AUTHORIZED - AUTHORIZED
  • + *
  • PAID - PAID
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The credit note's number. + */ + @JsonProperty("number") + public Optional getNumber() { + return number; + } + + /** + * @return The credit note's contact. + */ + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + + /** + * @return The company the credit note belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The credit note's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return The credit note's total amount. + */ + @JsonProperty("total_amount") + public Optional getTotalAmount() { + return totalAmount; + } + + /** + * @return The amount of value remaining in the credit note that the customer can use. + */ + @JsonProperty("remaining_credit") + public Optional getRemainingCredit() { + return remainingCredit; + } + + /** + * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. + */ + @JsonProperty("inclusive_of_tax") + public Optional getInclusiveOfTax() { + return inclusiveOfTax; + } + + @JsonProperty("line_items") + public Optional> getLineItems() { + return lineItems; + } + + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The credit note'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 Array of Payment object IDs + */ + @JsonProperty("payments") + public Optional>> getPayments() { + return payments; + } + + /** + * @return A list of the Payment Applied to Lines common models related to a given Invoice, Credit Note, or Journal Entry. + */ + @JsonProperty("applied_payments") + public Optional>> getAppliedPayments() { + return appliedPayments; + } + + /** + * @return The accounting period that the CreditNote was generated in. + */ + @JsonProperty("accounting_period") + public Optional getAccountingPeriod() { + return accountingPeriod; + } + + /** + * @return A list of the CreditNote Applied to Lines common models related to a given Credit Note + */ + @JsonProperty("applied_to_lines") + public Optional> getAppliedToLines() { + return appliedToLines; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteRequest && equalTo((CreditNoteRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreditNoteRequest other) { + return transactionDate.equals(other.transactionDate) + && status.equals(other.status) + && number.equals(other.number) + && contact.equals(other.contact) + && company.equals(other.company) + && exchangeRate.equals(other.exchangeRate) + && totalAmount.equals(other.totalAmount) + && remainingCredit.equals(other.remainingCredit) + && inclusiveOfTax.equals(other.inclusiveOfTax) + && lineItems.equals(other.lineItems) + && trackingCategories.equals(other.trackingCategories) + && currency.equals(other.currency) + && payments.equals(other.payments) + && appliedPayments.equals(other.appliedPayments) + && accountingPeriod.equals(other.accountingPeriod) + && appliedToLines.equals(other.appliedToLines) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @Override + public int hashCode() { + return Objects.hash( + this.transactionDate, + this.status, + this.number, + this.contact, + this.company, + this.exchangeRate, + this.totalAmount, + this.remainingCredit, + this.inclusiveOfTax, + this.lineItems, + this.trackingCategories, + this.currency, + this.payments, + this.appliedPayments, + this.accountingPeriod, + this.appliedToLines, + this.integrationParams, + this.linkedAccountParams); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional transactionDate = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional number = Optional.empty(); + + private Optional contact = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Optional remainingCredit = Optional.empty(); + + private Optional inclusiveOfTax = Optional.empty(); + + private Optional> lineItems = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional>> payments = Optional.empty(); + + private Optional>> appliedPayments = Optional.empty(); + + private Optional accountingPeriod = Optional.empty(); + + private Optional> appliedToLines = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreditNoteRequest other) { + transactionDate(other.getTransactionDate()); + status(other.getStatus()); + number(other.getNumber()); + contact(other.getContact()); + company(other.getCompany()); + exchangeRate(other.getExchangeRate()); + totalAmount(other.getTotalAmount()); + remainingCredit(other.getRemainingCredit()); + inclusiveOfTax(other.getInclusiveOfTax()); + lineItems(other.getLineItems()); + trackingCategories(other.getTrackingCategories()); + currency(other.getCurrency()); + payments(other.getPayments()); + appliedPayments(other.getAppliedPayments()); + accountingPeriod(other.getAccountingPeriod()); + appliedToLines(other.getAppliedToLines()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + return this; + } + + @JsonSetter(value = "transaction_date", nulls = Nulls.SKIP) + public Builder transactionDate(Optional transactionDate) { + this.transactionDate = transactionDate; + return this; + } + + public Builder transactionDate(OffsetDateTime transactionDate) { + this.transactionDate = Optional.ofNullable(transactionDate); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(CreditNoteRequestStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "number", nulls = Nulls.SKIP) + public Builder number(Optional number) { + this.number = number; + return this; + } + + public Builder number(String number) { + this.number = Optional.ofNullable(number); + return this; + } + + @JsonSetter(value = "contact", nulls = Nulls.SKIP) + public Builder contact(Optional contact) { + this.contact = contact; + return this; + } + + public Builder contact(CreditNoteRequestContact contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(CreditNoteRequestCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + @JsonSetter(value = "total_amount", nulls = Nulls.SKIP) + public Builder totalAmount(Optional totalAmount) { + this.totalAmount = totalAmount; + return this; + } + + public Builder totalAmount(Double totalAmount) { + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + @JsonSetter(value = "remaining_credit", nulls = Nulls.SKIP) + public Builder remainingCredit(Optional remainingCredit) { + this.remainingCredit = remainingCredit; + return this; + } + + public Builder remainingCredit(Double remainingCredit) { + this.remainingCredit = Optional.ofNullable(remainingCredit); + return this; + } + + @JsonSetter(value = "inclusive_of_tax", nulls = Nulls.SKIP) + public Builder inclusiveOfTax(Optional inclusiveOfTax) { + this.inclusiveOfTax = inclusiveOfTax; + return this; + } + + public Builder inclusiveOfTax(Boolean inclusiveOfTax) { + this.inclusiveOfTax = Optional.ofNullable(inclusiveOfTax); + return this; + } + + @JsonSetter(value = "line_items", nulls = Nulls.SKIP) + public Builder lineItems(Optional> lineItems) { + this.lineItems = lineItems; + return this; + } + + public Builder lineItems(List lineItems) { + this.lineItems = Optional.ofNullable(lineItems); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(CreditNoteRequestCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "payments", nulls = Nulls.SKIP) + public Builder payments(Optional>> payments) { + this.payments = payments; + return this; + } + + public Builder payments(List> payments) { + this.payments = Optional.ofNullable(payments); + return this; + } + + @JsonSetter(value = "applied_payments", nulls = Nulls.SKIP) + public Builder appliedPayments(Optional>> appliedPayments) { + this.appliedPayments = appliedPayments; + return this; + } + + public Builder appliedPayments(List> appliedPayments) { + this.appliedPayments = Optional.ofNullable(appliedPayments); + return this; + } + + @JsonSetter(value = "accounting_period", nulls = Nulls.SKIP) + public Builder accountingPeriod(Optional accountingPeriod) { + this.accountingPeriod = accountingPeriod; + return this; + } + + public Builder accountingPeriod(CreditNoteRequestAccountingPeriod accountingPeriod) { + this.accountingPeriod = Optional.ofNullable(accountingPeriod); + return this; + } + + @JsonSetter(value = "applied_to_lines", nulls = Nulls.SKIP) + public Builder appliedToLines(Optional> appliedToLines) { + this.appliedToLines = appliedToLines; + return this; + } + + public Builder appliedToLines(List appliedToLines) { + this.appliedToLines = Optional.ofNullable(appliedToLines); + 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 CreditNoteRequest build() { + return new CreditNoteRequest( + transactionDate, + status, + number, + contact, + company, + exchangeRate, + totalAmount, + remainingCredit, + inclusiveOfTax, + lineItems, + trackingCategories, + currency, + payments, + appliedPayments, + accountingPeriod, + appliedToLines, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestAccountingPeriod.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestAccountingPeriod.java new file mode 100644 index 000000000..2a308c2ac --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestAccountingPeriod.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreditNoteRequestAccountingPeriod.Deserializer.class) +public final class CreditNoteRequestAccountingPeriod { + private final Object value; + + private final int type; + + private CreditNoteRequestAccountingPeriod(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((AccountingPeriod) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteRequestAccountingPeriod && equalTo((CreditNoteRequestAccountingPeriod) other); + } + + private boolean equalTo(CreditNoteRequestAccountingPeriod other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreditNoteRequestAccountingPeriod of(String value) { + return new CreditNoteRequestAccountingPeriod(value, 0); + } + + public static CreditNoteRequestAccountingPeriod of(AccountingPeriod value) { + return new CreditNoteRequestAccountingPeriod(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(AccountingPeriod value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreditNoteRequestAccountingPeriod.class); + } + + @Override + public CreditNoteRequestAccountingPeriod 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, AccountingPeriod.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestAppliedPaymentsItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestAppliedPaymentsItem.java new file mode 100644 index 000000000..db9f0969a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestAppliedPaymentsItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreditNoteRequestAppliedPaymentsItem.Deserializer.class) +public final class CreditNoteRequestAppliedPaymentsItem { + private final Object value; + + private final int type; + + private CreditNoteRequestAppliedPaymentsItem(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((PaymentLineItem) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteRequestAppliedPaymentsItem + && equalTo((CreditNoteRequestAppliedPaymentsItem) other); + } + + private boolean equalTo(CreditNoteRequestAppliedPaymentsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreditNoteRequestAppliedPaymentsItem of(String value) { + return new CreditNoteRequestAppliedPaymentsItem(value, 0); + } + + public static CreditNoteRequestAppliedPaymentsItem of(PaymentLineItem value) { + return new CreditNoteRequestAppliedPaymentsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PaymentLineItem value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreditNoteRequestAppliedPaymentsItem.class); + } + + @Override + public CreditNoteRequestAppliedPaymentsItem 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, PaymentLineItem.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestCompany.java new file mode 100644 index 000000000..ac27a1af3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestCompany.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreditNoteRequestCompany.Deserializer.class) +public final class CreditNoteRequestCompany { + private final Object value; + + private final int type; + + private CreditNoteRequestCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteRequestCompany && equalTo((CreditNoteRequestCompany) other); + } + + private boolean equalTo(CreditNoteRequestCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreditNoteRequestCompany of(String value) { + return new CreditNoteRequestCompany(value, 0); + } + + public static CreditNoteRequestCompany of(CompanyInfo value) { + return new CreditNoteRequestCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreditNoteRequestCompany.class); + } + + @Override + public CreditNoteRequestCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestContact.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestContact.java new file mode 100644 index 000000000..f0c1b1be3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestContact.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreditNoteRequestContact.Deserializer.class) +public final class CreditNoteRequestContact { + private final Object value; + + private final int type; + + private CreditNoteRequestContact(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteRequestContact && equalTo((CreditNoteRequestContact) other); + } + + private boolean equalTo(CreditNoteRequestContact other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreditNoteRequestContact of(String value) { + return new CreditNoteRequestContact(value, 0); + } + + public static CreditNoteRequestContact of(Contact value) { + return new CreditNoteRequestContact(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreditNoteRequestContact.class); + } + + @Override + public CreditNoteRequestContact 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestCurrency.java new file mode 100644 index 000000000..32690faef --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/CreditNoteRequestLineItemsItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestLineItemsItem.java new file mode 100644 index 000000000..ce17a6dda --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestLineItemsItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreditNoteRequestLineItemsItem.Deserializer.class) +public final class CreditNoteRequestLineItemsItem { + private final Object value; + + private final int type; + + private CreditNoteRequestLineItemsItem(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((CreditNoteLineItemRequest) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteRequestLineItemsItem && equalTo((CreditNoteRequestLineItemsItem) other); + } + + private boolean equalTo(CreditNoteRequestLineItemsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreditNoteRequestLineItemsItem of(String value) { + return new CreditNoteRequestLineItemsItem(value, 0); + } + + public static CreditNoteRequestLineItemsItem of(CreditNoteLineItemRequest value) { + return new CreditNoteRequestLineItemsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CreditNoteLineItemRequest value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreditNoteRequestLineItemsItem.class); + } + + @Override + public CreditNoteRequestLineItemsItem 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, CreditNoteLineItemRequest.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestPaymentsItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestPaymentsItem.java new file mode 100644 index 000000000..f4bc797fb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestPaymentsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreditNoteRequestPaymentsItem.Deserializer.class) +public final class CreditNoteRequestPaymentsItem { + private final Object value; + + private final int type; + + private CreditNoteRequestPaymentsItem(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((Payment) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteRequestPaymentsItem && equalTo((CreditNoteRequestPaymentsItem) other); + } + + private boolean equalTo(CreditNoteRequestPaymentsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreditNoteRequestPaymentsItem of(String value) { + return new CreditNoteRequestPaymentsItem(value, 0); + } + + public static CreditNoteRequestPaymentsItem of(Payment value) { + return new CreditNoteRequestPaymentsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Payment value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreditNoteRequestPaymentsItem.class); + } + + @Override + public CreditNoteRequestPaymentsItem 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, Payment.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestStatus.java new file mode 100644 index 000000000..c631ee9dd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/CreditNoteRequestTrackingCategoriesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestTrackingCategoriesItem.java new file mode 100644 index 000000000..6cfb830d6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteRequestTrackingCategoriesItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreditNoteRequestTrackingCategoriesItem.Deserializer.class) +public final class CreditNoteRequestTrackingCategoriesItem { + private final Object value; + + private final int type; + + private CreditNoteRequestTrackingCategoriesItem(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteRequestTrackingCategoriesItem + && equalTo((CreditNoteRequestTrackingCategoriesItem) other); + } + + private boolean equalTo(CreditNoteRequestTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreditNoteRequestTrackingCategoriesItem of(String value) { + return new CreditNoteRequestTrackingCategoriesItem(value, 0); + } + + public static CreditNoteRequestTrackingCategoriesItem of(TrackingCategory value) { + return new CreditNoteRequestTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreditNoteRequestTrackingCategoriesItem.class); + } + + @Override + public CreditNoteRequestTrackingCategoriesItem 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteResponse.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteResponse.java new file mode 100644 index 000000000..b85be4666 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreditNoteResponse.Builder.class) +public final class CreditNoteResponse { + private final CreditNote model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private CreditNoteResponse( + CreditNote 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 CreditNote getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteResponse && equalTo((CreditNoteResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreditNoteResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull CreditNote model); + + Builder from(CreditNoteResponse other); + } + + public interface _FinalStage { + CreditNoteResponse 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 CreditNote model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CreditNoteResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull CreditNote model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public CreditNoteResponse build() { + return new CreditNoteResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteStatus.java new file mode 100644 index 000000000..2c798c0e8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/CreditNoteStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteStatusEnum.java new file mode 100644 index 000000000..41d648051 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteStatusEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CreditNoteStatusEnum { + SUBMITTED("SUBMITTED"), + + AUTHORIZED("AUTHORIZED"), + + PAID("PAID"); + + private final String value; + + CreditNoteStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteTrackingCategoriesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteTrackingCategoriesItem.java new file mode 100644 index 000000000..6b3ecbaff --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditNoteTrackingCategoriesItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreditNoteTrackingCategoriesItem.Deserializer.class) +public final class CreditNoteTrackingCategoriesItem { + private final Object value; + + private final int type; + + private CreditNoteTrackingCategoriesItem(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteTrackingCategoriesItem && equalTo((CreditNoteTrackingCategoriesItem) other); + } + + private boolean equalTo(CreditNoteTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CreditNoteTrackingCategoriesItem of(String value) { + return new CreditNoteTrackingCategoriesItem(value, 0); + } + + public static CreditNoteTrackingCategoriesItem of(TrackingCategory value) { + return new CreditNoteTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreditNoteTrackingCategoriesItem.class); + } + + @Override + public CreditNoteTrackingCategoriesItem 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditOrDebitEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditOrDebitEnum.java new file mode 100644 index 000000000..b87c911a4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/CreditOrDebitEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CreditOrDebitEnum { + CREDIT("CREDIT"), + + DEBIT("DEBIT"); + + private final String value; + + CreditOrDebitEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/DataPassthroughRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/DataPassthroughRequest.java new file mode 100644 index 000000000..7fcd8ef28 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/DataPassthroughRequest.java @@ -0,0 +1,361 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.baseUrlOverride, + this.data, + this.multipartFormData, + this.headers, + this.requestFormat, + this.normalizeResponse); + } + + @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() {} + + @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; + } + + @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. + */ + @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. + */ + @Override + public _FinalStage normalizeResponse(Boolean normalizeResponse) { + this.normalizeResponse = Optional.ofNullable(normalizeResponse); + return this; + } + + @Override + @JsonSetter(value = "normalize_response", nulls = Nulls.SKIP) + public _FinalStage normalizeResponse(Optional normalizeResponse) { + this.normalizeResponse = normalizeResponse; + return this; + } + + @Override + public _FinalStage requestFormat(RequestFormatEnum requestFormat) { + this.requestFormat = Optional.ofNullable(requestFormat); + return this; + } + + @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. + */ + @Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @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. + */ + @Override + public _FinalStage multipartFormData(List multipartFormData) { + this.multipartFormData = Optional.ofNullable(multipartFormData); + return this; + } + + @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. + */ + @Override + public _FinalStage data(String data) { + this.data = Optional.ofNullable(data); + return this; + } + + @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. + */ + @Override + public _FinalStage baseUrlOverride(String baseUrlOverride) { + this.baseUrlOverride = Optional.ofNullable(baseUrlOverride); + return this; + } + + @Override + @JsonSetter(value = "base_url_override", nulls = Nulls.SKIP) + public _FinalStage baseUrlOverride(Optional baseUrlOverride) { + this.baseUrlOverride = baseUrlOverride; + return this; + } + + @Override + public DataPassthroughRequest build() { + return new DataPassthroughRequest( + method, + path, + baseUrlOverride, + data, + multipartFormData, + headers, + requestFormat, + normalizeResponse, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/DebugModeLog.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/DebugModeLog.java new file mode 100644 index 000000000..c168148c3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/DebugModeLog.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.logId, this.dashboardView, this.logSummary); + } + + @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() {} + + @Override + public Builder from(DebugModeLog other) { + logId(other.getLogId()); + dashboardView(other.getDashboardView()); + logSummary(other.getLogSummary()); + return this; + } + + @Override + @JsonSetter("log_id") + public DashboardViewStage logId(@NotNull String logId) { + this.logId = logId; + return this; + } + + @Override + @JsonSetter("dashboard_view") + public LogSummaryStage dashboardView(@NotNull String dashboardView) { + this.dashboardView = dashboardView; + return this; + } + + @Override + @JsonSetter("log_summary") + public _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary) { + this.logSummary = logSummary; + return this; + } + + @Override + public DebugModeLog build() { + return new DebugModeLog(logId, dashboardView, logSummary, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/DebugModelLogSummary.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/DebugModelLogSummary.java new file mode 100644 index 000000000..123cd899b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/DebugModelLogSummary.java @@ -0,0 +1,141 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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; + } + + @Override + public int hashCode() { + return Objects.hash(this.url, this.method, this.statusCode); + } + + @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() {} + + @Override + public Builder from(DebugModelLogSummary other) { + url(other.getUrl()); + method(other.getMethod()); + statusCode(other.getStatusCode()); + return this; + } + + @Override + @JsonSetter("url") + public MethodStage url(@NotNull String url) { + this.url = url; + return this; + } + + @Override + @JsonSetter("method") + public StatusCodeStage method(@NotNull String method) { + this.method = method; + return this; + } + + @Override + @JsonSetter("status_code") + public _FinalStage statusCode(int statusCode) { + this.statusCode = statusCode; + return this; + } + + @Override + public DebugModelLogSummary build() { + return new DebugModelLogSummary(url, method, statusCode, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/Employee.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/Employee.java new file mode 100644 index 000000000..a8ba50ac0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/Employee.java @@ -0,0 +1,603 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; +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; + } + + @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); + } + + @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); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("status") + public _FinalStage status(@NotNull EmployeeStatus status) { + this.status = status; + return this; + } + + @Override + public _FinalStage remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + @Override + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public _FinalStage remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + @Override + public _FinalStage fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @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. + */ + @Override + public _FinalStage remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @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. + */ + @Override + public _FinalStage company(EmployeeCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @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. + */ + @Override + public _FinalStage emailAddress(String emailAddress) { + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + @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. + */ + @Override + public _FinalStage employeeNumber(String employeeNumber) { + this.employeeNumber = Optional.ofNullable(employeeNumber); + return this; + } + + @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. + */ + @Override + public _FinalStage isContractor(Boolean isContractor) { + this.isContractor = Optional.ofNullable(isContractor); + return this; + } + + @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. + */ + @Override + public _FinalStage lastName(String lastName) { + this.lastName = Optional.ofNullable(lastName); + return this; + } + + @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. + */ + @Override + public _FinalStage firstName(String firstName) { + this.firstName = Optional.ofNullable(firstName); + return this; + } + + @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. + */ + @Override + public _FinalStage modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @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. + */ + @Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @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. + */ + @Override + public _FinalStage remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @Override + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public _FinalStage remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + @Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @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/legacy/api/resources/accounting/types/EmployeeCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/EmployeeCompany.java new file mode 100644 index 000000000..051e4743e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/EmployeeCompany.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/EmployeeStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/EmployeeStatus.java new file mode 100644 index 000000000..664f14444 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/EmployeeStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/EnabledActionsEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/EnabledActionsEnum.java new file mode 100644 index 000000000..00fbeab4c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/EnabledActionsEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/EncodingEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/EncodingEnum.java new file mode 100644 index 000000000..514fb41fa --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/EncodingEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ErrorValidationProblem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ErrorValidationProblem.java new file mode 100644 index 000000000..5546224cd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ErrorValidationProblem.java @@ -0,0 +1,178 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.source, this.title, this.detail, this.problemType); + } + + @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() {} + + @Override + public Builder from(ErrorValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + return this; + } + + @Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @Override + public ErrorValidationProblem build() { + return new ErrorValidationProblem(source, title, detail, problemType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/EventTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/EventTypeEnum.java new file mode 100644 index 000000000..776ead119 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/EventTypeEnum.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/Expense.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/Expense.java new file mode 100644 index 000000000..4f4c61a3c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/Expense.java @@ -0,0 +1,1053 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Expense.Builder.class) +public final class Expense { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional transactionDate; + + private final Optional remoteCreatedAt; + + private final Optional account; + + private final Optional contact; + + private final Optional totalAmount; + + private final Optional subTotal; + + private final Optional totalTaxAmount; + + private final Optional currency; + + private final Optional exchangeRate; + + private final Optional inclusiveOfTax; + + private final Optional company; + + private final Optional employee; + + private final Optional memo; + + private final Optional> lines; + + private final Optional>> trackingCategories; + + private final Optional remoteWasDeleted; + + private final Optional accountingPeriod; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private Expense( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional transactionDate, + Optional remoteCreatedAt, + Optional account, + Optional contact, + Optional totalAmount, + Optional subTotal, + Optional totalTaxAmount, + Optional currency, + Optional exchangeRate, + Optional inclusiveOfTax, + Optional company, + Optional employee, + Optional memo, + Optional> lines, + Optional>> trackingCategories, + Optional remoteWasDeleted, + Optional accountingPeriod, + Optional> fieldMappings, + Optional> remoteData, + Optional> remoteFields, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.transactionDate = transactionDate; + this.remoteCreatedAt = remoteCreatedAt; + this.account = account; + this.contact = contact; + this.totalAmount = totalAmount; + this.subTotal = subTotal; + this.totalTaxAmount = totalTaxAmount; + this.currency = currency; + this.exchangeRate = exchangeRate; + this.inclusiveOfTax = inclusiveOfTax; + this.company = company; + this.employee = employee; + this.memo = memo; + this.lines = lines; + this.trackingCategories = trackingCategories; + this.remoteWasDeleted = remoteWasDeleted; + this.accountingPeriod = accountingPeriod; + 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 When the transaction occurred. + */ + @JsonProperty("transaction_date") + public Optional getTransactionDate() { + return transactionDate; + } + + /** + * @return When the expense was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return The expense's payment account. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The expense's contact. + */ + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + + /** + * @return The expense's total amount. + */ + @JsonProperty("total_amount") + public Optional getTotalAmount() { + return totalAmount; + } + + /** + * @return The expense's total amount before tax. + */ + @JsonProperty("sub_total") + public Optional getSubTotal() { + return subTotal; + } + + /** + * @return The expense's total tax amount. + */ + @JsonProperty("total_tax_amount") + public Optional getTotalTaxAmount() { + return totalTaxAmount; + } + + /** + * @return The expense'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 expense's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. + */ + @JsonProperty("inclusive_of_tax") + public Optional getInclusiveOfTax() { + return inclusiveOfTax; + } + + /** + * @return The company the expense belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The employee this overall transaction relates to. + */ + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + /** + * @return The expense's private note. + */ + @JsonProperty("memo") + public Optional getMemo() { + return memo; + } + + @JsonProperty("lines") + public Optional> getLines() { + return lines; + } + + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @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 The accounting period that the Expense was generated in. + */ + @JsonProperty("accounting_period") + public Optional getAccountingPeriod() { + return accountingPeriod; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Expense && equalTo((Expense) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Expense other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && transactionDate.equals(other.transactionDate) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && account.equals(other.account) + && contact.equals(other.contact) + && totalAmount.equals(other.totalAmount) + && subTotal.equals(other.subTotal) + && totalTaxAmount.equals(other.totalTaxAmount) + && currency.equals(other.currency) + && exchangeRate.equals(other.exchangeRate) + && inclusiveOfTax.equals(other.inclusiveOfTax) + && company.equals(other.company) + && employee.equals(other.employee) + && memo.equals(other.memo) + && lines.equals(other.lines) + && trackingCategories.equals(other.trackingCategories) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && accountingPeriod.equals(other.accountingPeriod) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.transactionDate, + this.remoteCreatedAt, + this.account, + this.contact, + this.totalAmount, + this.subTotal, + this.totalTaxAmount, + this.currency, + this.exchangeRate, + this.inclusiveOfTax, + this.company, + this.employee, + this.memo, + this.lines, + this.trackingCategories, + this.remoteWasDeleted, + this.accountingPeriod, + this.fieldMappings, + this.remoteData, + this.remoteFields); + } + + @Override + 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 transactionDate = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional contact = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Optional subTotal = Optional.empty(); + + private Optional totalTaxAmount = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional inclusiveOfTax = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional employee = Optional.empty(); + + private Optional memo = Optional.empty(); + + private Optional> lines = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional accountingPeriod = 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(Expense other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + transactionDate(other.getTransactionDate()); + remoteCreatedAt(other.getRemoteCreatedAt()); + account(other.getAccount()); + contact(other.getContact()); + totalAmount(other.getTotalAmount()); + subTotal(other.getSubTotal()); + totalTaxAmount(other.getTotalTaxAmount()); + currency(other.getCurrency()); + exchangeRate(other.getExchangeRate()); + inclusiveOfTax(other.getInclusiveOfTax()); + company(other.getCompany()); + employee(other.getEmployee()); + memo(other.getMemo()); + lines(other.getLines()); + trackingCategories(other.getTrackingCategories()); + remoteWasDeleted(other.getRemoteWasDeleted()); + accountingPeriod(other.getAccountingPeriod()); + 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 = "transaction_date", nulls = Nulls.SKIP) + public Builder transactionDate(Optional transactionDate) { + this.transactionDate = transactionDate; + return this; + } + + public Builder transactionDate(OffsetDateTime transactionDate) { + this.transactionDate = Optional.ofNullable(transactionDate); + 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 = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(ExpenseAccount 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(ExpenseContact contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "total_amount", nulls = Nulls.SKIP) + public Builder totalAmount(Optional totalAmount) { + this.totalAmount = totalAmount; + return this; + } + + public Builder totalAmount(Double totalAmount) { + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + @JsonSetter(value = "sub_total", nulls = Nulls.SKIP) + public Builder subTotal(Optional subTotal) { + this.subTotal = subTotal; + return this; + } + + public Builder subTotal(Double subTotal) { + this.subTotal = Optional.ofNullable(subTotal); + return this; + } + + @JsonSetter(value = "total_tax_amount", nulls = Nulls.SKIP) + public Builder totalTaxAmount(Optional totalTaxAmount) { + this.totalTaxAmount = totalTaxAmount; + return this; + } + + public Builder totalTaxAmount(Double totalTaxAmount) { + this.totalTaxAmount = Optional.ofNullable(totalTaxAmount); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(ExpenseCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + @JsonSetter(value = "inclusive_of_tax", nulls = Nulls.SKIP) + public Builder inclusiveOfTax(Optional inclusiveOfTax) { + this.inclusiveOfTax = inclusiveOfTax; + return this; + } + + public Builder inclusiveOfTax(Boolean inclusiveOfTax) { + this.inclusiveOfTax = Optional.ofNullable(inclusiveOfTax); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(ExpenseCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "employee", nulls = Nulls.SKIP) + public Builder employee(Optional employee) { + this.employee = employee; + return this; + } + + public Builder employee(ExpenseEmployee employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "memo", nulls = Nulls.SKIP) + public Builder memo(Optional memo) { + this.memo = memo; + return this; + } + + public Builder memo(String memo) { + this.memo = Optional.ofNullable(memo); + return this; + } + + @JsonSetter(value = "lines", nulls = Nulls.SKIP) + public Builder lines(Optional> lines) { + this.lines = lines; + return this; + } + + public Builder lines(List lines) { + this.lines = Optional.ofNullable(lines); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories(Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + 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 = "accounting_period", nulls = Nulls.SKIP) + public Builder accountingPeriod(Optional accountingPeriod) { + this.accountingPeriod = accountingPeriod; + return this; + } + + public Builder accountingPeriod(ExpenseAccountingPeriod accountingPeriod) { + this.accountingPeriod = Optional.ofNullable(accountingPeriod); + 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 Expense build() { + return new Expense( + id, + remoteId, + createdAt, + modifiedAt, + transactionDate, + remoteCreatedAt, + account, + contact, + totalAmount, + subTotal, + totalTaxAmount, + currency, + exchangeRate, + inclusiveOfTax, + company, + employee, + memo, + lines, + trackingCategories, + remoteWasDeleted, + accountingPeriod, + fieldMappings, + remoteData, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseAccount.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseAccount.java new file mode 100644 index 000000000..f25a84dfb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseAccount.Deserializer.class) +public final class ExpenseAccount { + private final Object value; + + private final int type; + + private ExpenseAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseAccount && equalTo((ExpenseAccount) other); + } + + private boolean equalTo(ExpenseAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseAccount of(String value) { + return new ExpenseAccount(value, 0); + } + + public static ExpenseAccount of(Account value) { + return new ExpenseAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseAccount.class); + } + + @Override + public ExpenseAccount 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/legacy/api/resources/accounting/types/ExpenseAccountingPeriod.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseAccountingPeriod.java new file mode 100644 index 000000000..b5edaf644 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseAccountingPeriod.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseAccountingPeriod.Deserializer.class) +public final class ExpenseAccountingPeriod { + private final Object value; + + private final int type; + + private ExpenseAccountingPeriod(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((AccountingPeriod) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseAccountingPeriod && equalTo((ExpenseAccountingPeriod) other); + } + + private boolean equalTo(ExpenseAccountingPeriod other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseAccountingPeriod of(String value) { + return new ExpenseAccountingPeriod(value, 0); + } + + public static ExpenseAccountingPeriod of(AccountingPeriod value) { + return new ExpenseAccountingPeriod(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(AccountingPeriod value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseAccountingPeriod.class); + } + + @Override + public ExpenseAccountingPeriod 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, AccountingPeriod.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseCompany.java new file mode 100644 index 000000000..dfb23033d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseCompany.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseCompany.Deserializer.class) +public final class ExpenseCompany { + private final Object value; + + private final int type; + + private ExpenseCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseCompany && equalTo((ExpenseCompany) other); + } + + private boolean equalTo(ExpenseCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseCompany of(String value) { + return new ExpenseCompany(value, 0); + } + + public static ExpenseCompany of(CompanyInfo value) { + return new ExpenseCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseCompany.class); + } + + @Override + public ExpenseCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseContact.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseContact.java new file mode 100644 index 000000000..9a4caed47 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseContact.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseContact.Deserializer.class) +public final class ExpenseContact { + private final Object value; + + private final int type; + + private ExpenseContact(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseContact && equalTo((ExpenseContact) other); + } + + private boolean equalTo(ExpenseContact other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseContact of(String value) { + return new ExpenseContact(value, 0); + } + + public static ExpenseContact of(Contact value) { + return new ExpenseContact(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseContact.class); + } + + @Override + public ExpenseContact 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseCurrency.java new file mode 100644 index 000000000..6052d6a2d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/ExpenseEmployee.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseEmployee.java new file mode 100644 index 000000000..6c9854232 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseEmployee.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseEmployee.Deserializer.class) +public final class ExpenseEmployee { + private final Object value; + + private final int type; + + private ExpenseEmployee(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((Employee) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseEmployee && equalTo((ExpenseEmployee) other); + } + + private boolean equalTo(ExpenseEmployee other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseEmployee of(String value) { + return new ExpenseEmployee(value, 0); + } + + public static ExpenseEmployee of(Employee value) { + return new ExpenseEmployee(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employee value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseEmployee.class); + } + + @Override + public ExpenseEmployee 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, Employee.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLine.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLine.java new file mode 100644 index 000000000..1f677516d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLine.java @@ -0,0 +1,862 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExpenseLine.Builder.class) +public final class ExpenseLine { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional item; + + private final Optional netAmount; + + private final Optional trackingCategory; + + private final Optional>> trackingCategories; + + private final Optional company; + + private final Optional employee; + + private final Optional currency; + + private final Optional account; + + private final Optional contact; + + private final Optional description; + + private final Optional exchangeRate; + + private final Optional taxRate; + + private final Optional remoteWasDeleted; + + private final Map additionalProperties; + + private ExpenseLine( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional item, + Optional netAmount, + Optional trackingCategory, + Optional>> trackingCategories, + Optional company, + Optional employee, + Optional currency, + Optional account, + Optional contact, + Optional description, + Optional exchangeRate, + Optional taxRate, + Optional remoteWasDeleted, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.item = item; + this.netAmount = netAmount; + this.trackingCategory = trackingCategory; + this.trackingCategories = trackingCategories; + this.company = company; + this.employee = employee; + this.currency = currency; + this.account = account; + this.contact = contact; + this.description = description; + this.exchangeRate = exchangeRate; + this.taxRate = taxRate; + this.remoteWasDeleted = remoteWasDeleted; + 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 line's item. + */ + @JsonProperty("item") + public Optional getItem() { + return item; + } + + /** + * @return The line's net amount. + */ + @JsonProperty("net_amount") + public Optional getNetAmount() { + return netAmount; + } + + @JsonProperty("tracking_category") + public Optional getTrackingCategory() { + return trackingCategory; + } + + /** + * @return The expense line item's associated tracking categories. + */ + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The company the expense belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The employee this overall transaction relates to. + */ + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + /** + * @return The expense line item'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 expense's payment account. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The expense's contact. + */ + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + + /** + * @return The description of the item that was purchased by the company. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The expense line item's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return The tax rate that applies to this line item. + */ + @JsonProperty("tax_rate") + public Optional getTaxRate() { + return taxRate; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseLine && equalTo((ExpenseLine) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExpenseLine other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && item.equals(other.item) + && netAmount.equals(other.netAmount) + && trackingCategory.equals(other.trackingCategory) + && trackingCategories.equals(other.trackingCategories) + && company.equals(other.company) + && employee.equals(other.employee) + && currency.equals(other.currency) + && account.equals(other.account) + && contact.equals(other.contact) + && description.equals(other.description) + && exchangeRate.equals(other.exchangeRate) + && taxRate.equals(other.taxRate) + && remoteWasDeleted.equals(other.remoteWasDeleted); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.item, + this.netAmount, + this.trackingCategory, + this.trackingCategories, + this.company, + this.employee, + this.currency, + this.account, + this.contact, + this.description, + this.exchangeRate, + this.taxRate, + this.remoteWasDeleted); + } + + @Override + 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 item = Optional.empty(); + + private Optional netAmount = Optional.empty(); + + private Optional trackingCategory = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional employee = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional contact = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional taxRate = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExpenseLine other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + item(other.getItem()); + netAmount(other.getNetAmount()); + trackingCategory(other.getTrackingCategory()); + trackingCategories(other.getTrackingCategories()); + company(other.getCompany()); + employee(other.getEmployee()); + currency(other.getCurrency()); + account(other.getAccount()); + contact(other.getContact()); + description(other.getDescription()); + exchangeRate(other.getExchangeRate()); + taxRate(other.getTaxRate()); + remoteWasDeleted(other.getRemoteWasDeleted()); + 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 = "item", nulls = Nulls.SKIP) + public Builder item(Optional item) { + this.item = item; + return this; + } + + public Builder item(ExpenseLineItem item) { + this.item = Optional.ofNullable(item); + return this; + } + + @JsonSetter(value = "net_amount", nulls = Nulls.SKIP) + public Builder netAmount(Optional netAmount) { + this.netAmount = netAmount; + return this; + } + + public Builder netAmount(Double netAmount) { + this.netAmount = Optional.ofNullable(netAmount); + return this; + } + + @JsonSetter(value = "tracking_category", nulls = Nulls.SKIP) + public Builder trackingCategory(Optional trackingCategory) { + this.trackingCategory = trackingCategory; + return this; + } + + public Builder trackingCategory(ExpenseLineTrackingCategory trackingCategory) { + this.trackingCategory = Optional.ofNullable(trackingCategory); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + 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 = "employee", nulls = Nulls.SKIP) + public Builder employee(Optional employee) { + this.employee = employee; + return this; + } + + public Builder employee(ExpenseLineEmployee employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(ExpenseLineCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(ExpenseLineAccount 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(ExpenseLineContact contact) { + this.contact = Optional.ofNullable(contact); + 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 = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + @JsonSetter(value = "tax_rate", nulls = Nulls.SKIP) + public Builder taxRate(Optional taxRate) { + this.taxRate = taxRate; + return this; + } + + public Builder taxRate(String taxRate) { + this.taxRate = Optional.ofNullable(taxRate); + 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 ExpenseLine build() { + return new ExpenseLine( + id, + remoteId, + createdAt, + modifiedAt, + item, + netAmount, + trackingCategory, + trackingCategories, + company, + employee, + currency, + account, + contact, + description, + exchangeRate, + taxRate, + remoteWasDeleted, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineAccount.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineAccount.java new file mode 100644 index 000000000..dde446aa5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseLineAccount.Deserializer.class) +public final class ExpenseLineAccount { + private final Object value; + + private final int type; + + private ExpenseLineAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseLineAccount && equalTo((ExpenseLineAccount) other); + } + + private boolean equalTo(ExpenseLineAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseLineAccount of(String value) { + return new ExpenseLineAccount(value, 0); + } + + public static ExpenseLineAccount of(Account value) { + return new ExpenseLineAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseLineAccount.class); + } + + @Override + public ExpenseLineAccount 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/legacy/api/resources/accounting/types/ExpenseLineContact.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineContact.java new file mode 100644 index 000000000..2773e32cf --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineContact.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseLineContact.Deserializer.class) +public final class ExpenseLineContact { + private final Object value; + + private final int type; + + private ExpenseLineContact(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseLineContact && equalTo((ExpenseLineContact) other); + } + + private boolean equalTo(ExpenseLineContact other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseLineContact of(String value) { + return new ExpenseLineContact(value, 0); + } + + public static ExpenseLineContact of(Contact value) { + return new ExpenseLineContact(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseLineContact.class); + } + + @Override + public ExpenseLineContact 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineCurrency.java new file mode 100644 index 000000000..81ff7e9d9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/ExpenseLineEmployee.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineEmployee.java new file mode 100644 index 000000000..e61c8443b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineEmployee.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseLineEmployee.Deserializer.class) +public final class ExpenseLineEmployee { + private final Object value; + + private final int type; + + private ExpenseLineEmployee(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((Employee) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseLineEmployee && equalTo((ExpenseLineEmployee) other); + } + + private boolean equalTo(ExpenseLineEmployee other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseLineEmployee of(String value) { + return new ExpenseLineEmployee(value, 0); + } + + public static ExpenseLineEmployee of(Employee value) { + return new ExpenseLineEmployee(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employee value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseLineEmployee.class); + } + + @Override + public ExpenseLineEmployee 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, Employee.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineItem.java new file mode 100644 index 000000000..fe25fe91b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseLineItem.Deserializer.class) +public final class ExpenseLineItem { + private final Object value; + + private final int type; + + private ExpenseLineItem(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((Item) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseLineItem && equalTo((ExpenseLineItem) other); + } + + private boolean equalTo(ExpenseLineItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseLineItem of(String value) { + return new ExpenseLineItem(value, 0); + } + + public static ExpenseLineItem of(Item value) { + return new ExpenseLineItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Item value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseLineItem.class); + } + + @Override + public ExpenseLineItem 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, Item.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineRequest.java new file mode 100644 index 000000000..e342f9729 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineRequest.java @@ -0,0 +1,828 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExpenseLineRequest.Builder.class) +public final class ExpenseLineRequest { + private final Optional remoteId; + + private final Optional item; + + private final Optional netAmount; + + private final Optional trackingCategory; + + private final Optional>> trackingCategories; + + private final Optional company; + + private final Optional employee; + + private final Optional currency; + + private final Optional account; + + private final Optional contact; + + private final Optional description; + + private final Optional exchangeRate; + + private final Optional taxRate; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private ExpenseLineRequest( + Optional remoteId, + Optional item, + Optional netAmount, + Optional trackingCategory, + Optional>> trackingCategories, + Optional company, + Optional employee, + Optional currency, + Optional account, + Optional contact, + Optional description, + Optional exchangeRate, + Optional taxRate, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.remoteId = remoteId; + this.item = item; + this.netAmount = netAmount; + this.trackingCategory = trackingCategory; + this.trackingCategories = trackingCategories; + this.company = company; + this.employee = employee; + this.currency = currency; + this.account = account; + this.contact = contact; + this.description = description; + this.exchangeRate = exchangeRate; + this.taxRate = taxRate; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The line's item. + */ + @JsonProperty("item") + public Optional getItem() { + return item; + } + + /** + * @return The line's net amount. + */ + @JsonProperty("net_amount") + public Optional getNetAmount() { + return netAmount; + } + + @JsonProperty("tracking_category") + public Optional getTrackingCategory() { + return trackingCategory; + } + + /** + * @return The expense line item's associated tracking categories. + */ + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The company the expense belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The employee this overall transaction relates to. + */ + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + /** + * @return The expense line item'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 expense's payment account. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The expense's contact. + */ + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + + /** + * @return The description of the item that was purchased by the company. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The expense line item's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return The tax rate that applies to this line item. + */ + @JsonProperty("tax_rate") + public Optional getTaxRate() { + return taxRate; + } + + @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseLineRequest && equalTo((ExpenseLineRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExpenseLineRequest other) { + return remoteId.equals(other.remoteId) + && item.equals(other.item) + && netAmount.equals(other.netAmount) + && trackingCategory.equals(other.trackingCategory) + && trackingCategories.equals(other.trackingCategories) + && company.equals(other.company) + && employee.equals(other.employee) + && currency.equals(other.currency) + && account.equals(other.account) + && contact.equals(other.contact) + && description.equals(other.description) + && exchangeRate.equals(other.exchangeRate) + && taxRate.equals(other.taxRate) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.remoteId, + this.item, + this.netAmount, + this.trackingCategory, + this.trackingCategories, + this.company, + this.employee, + this.currency, + this.account, + this.contact, + this.description, + this.exchangeRate, + this.taxRate, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @Override + 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 item = Optional.empty(); + + private Optional netAmount = Optional.empty(); + + private Optional trackingCategory = Optional.empty(); + + private Optional>> trackingCategories = + Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional employee = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional contact = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional taxRate = 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(ExpenseLineRequest other) { + remoteId(other.getRemoteId()); + item(other.getItem()); + netAmount(other.getNetAmount()); + trackingCategory(other.getTrackingCategory()); + trackingCategories(other.getTrackingCategories()); + company(other.getCompany()); + employee(other.getEmployee()); + currency(other.getCurrency()); + account(other.getAccount()); + contact(other.getContact()); + description(other.getDescription()); + exchangeRate(other.getExchangeRate()); + taxRate(other.getTaxRate()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + remoteFields(other.getRemoteFields()); + 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 = "item", nulls = Nulls.SKIP) + public Builder item(Optional item) { + this.item = item; + return this; + } + + public Builder item(ExpenseLineRequestItem item) { + this.item = Optional.ofNullable(item); + return this; + } + + @JsonSetter(value = "net_amount", nulls = Nulls.SKIP) + public Builder netAmount(Optional netAmount) { + this.netAmount = netAmount; + return this; + } + + public Builder netAmount(Double netAmount) { + this.netAmount = Optional.ofNullable(netAmount); + return this; + } + + @JsonSetter(value = "tracking_category", nulls = Nulls.SKIP) + public Builder trackingCategory(Optional trackingCategory) { + this.trackingCategory = trackingCategory; + return this; + } + + public Builder trackingCategory(ExpenseLineRequestTrackingCategory trackingCategory) { + this.trackingCategory = Optional.ofNullable(trackingCategory); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + 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 = "employee", nulls = Nulls.SKIP) + public Builder employee(Optional employee) { + this.employee = employee; + return this; + } + + public Builder employee(ExpenseLineRequestEmployee employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(ExpenseLineRequestCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(ExpenseLineRequestAccount 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(ExpenseLineRequestContact contact) { + this.contact = Optional.ofNullable(contact); + 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 = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + @JsonSetter(value = "tax_rate", nulls = Nulls.SKIP) + public Builder taxRate(Optional taxRate) { + this.taxRate = taxRate; + return this; + } + + public Builder taxRate(String taxRate) { + this.taxRate = Optional.ofNullable(taxRate); + 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 ExpenseLineRequest build() { + return new ExpenseLineRequest( + remoteId, + item, + netAmount, + trackingCategory, + trackingCategories, + company, + employee, + currency, + account, + contact, + description, + exchangeRate, + taxRate, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineRequestAccount.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineRequestAccount.java new file mode 100644 index 000000000..746b144cc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineRequestAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseLineRequestAccount.Deserializer.class) +public final class ExpenseLineRequestAccount { + private final Object value; + + private final int type; + + private ExpenseLineRequestAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseLineRequestAccount && equalTo((ExpenseLineRequestAccount) other); + } + + private boolean equalTo(ExpenseLineRequestAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseLineRequestAccount of(String value) { + return new ExpenseLineRequestAccount(value, 0); + } + + public static ExpenseLineRequestAccount of(Account value) { + return new ExpenseLineRequestAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseLineRequestAccount.class); + } + + @Override + public ExpenseLineRequestAccount 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/legacy/api/resources/accounting/types/ExpenseLineRequestContact.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineRequestContact.java new file mode 100644 index 000000000..6f2ee0c65 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineRequestContact.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseLineRequestContact.Deserializer.class) +public final class ExpenseLineRequestContact { + private final Object value; + + private final int type; + + private ExpenseLineRequestContact(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseLineRequestContact && equalTo((ExpenseLineRequestContact) other); + } + + private boolean equalTo(ExpenseLineRequestContact other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseLineRequestContact of(String value) { + return new ExpenseLineRequestContact(value, 0); + } + + public static ExpenseLineRequestContact of(Contact value) { + return new ExpenseLineRequestContact(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseLineRequestContact.class); + } + + @Override + public ExpenseLineRequestContact 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineRequestCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineRequestCurrency.java new file mode 100644 index 000000000..ca7a3fde0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineRequestCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/ExpenseLineRequestEmployee.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineRequestEmployee.java new file mode 100644 index 000000000..bb95b423a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineRequestEmployee.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseLineRequestEmployee.Deserializer.class) +public final class ExpenseLineRequestEmployee { + private final Object value; + + private final int type; + + private ExpenseLineRequestEmployee(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((Employee) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseLineRequestEmployee && equalTo((ExpenseLineRequestEmployee) other); + } + + private boolean equalTo(ExpenseLineRequestEmployee other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseLineRequestEmployee of(String value) { + return new ExpenseLineRequestEmployee(value, 0); + } + + public static ExpenseLineRequestEmployee of(Employee value) { + return new ExpenseLineRequestEmployee(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employee value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseLineRequestEmployee.class); + } + + @Override + public ExpenseLineRequestEmployee 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, Employee.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineRequestItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineRequestItem.java new file mode 100644 index 000000000..fc45919dd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineRequestItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseLineRequestItem.Deserializer.class) +public final class ExpenseLineRequestItem { + private final Object value; + + private final int type; + + private ExpenseLineRequestItem(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((Item) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseLineRequestItem && equalTo((ExpenseLineRequestItem) other); + } + + private boolean equalTo(ExpenseLineRequestItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseLineRequestItem of(String value) { + return new ExpenseLineRequestItem(value, 0); + } + + public static ExpenseLineRequestItem of(Item value) { + return new ExpenseLineRequestItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Item value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseLineRequestItem.class); + } + + @Override + public ExpenseLineRequestItem 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, Item.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineRequestTrackingCategoriesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineRequestTrackingCategoriesItem.java new file mode 100644 index 000000000..a097f9409 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineRequestTrackingCategoriesItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseLineRequestTrackingCategoriesItem.Deserializer.class) +public final class ExpenseLineRequestTrackingCategoriesItem { + private final Object value; + + private final int type; + + private ExpenseLineRequestTrackingCategoriesItem(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseLineRequestTrackingCategoriesItem + && equalTo((ExpenseLineRequestTrackingCategoriesItem) other); + } + + private boolean equalTo(ExpenseLineRequestTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseLineRequestTrackingCategoriesItem of(String value) { + return new ExpenseLineRequestTrackingCategoriesItem(value, 0); + } + + public static ExpenseLineRequestTrackingCategoriesItem of(TrackingCategory value) { + return new ExpenseLineRequestTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseLineRequestTrackingCategoriesItem.class); + } + + @Override + public ExpenseLineRequestTrackingCategoriesItem 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineRequestTrackingCategory.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineRequestTrackingCategory.java new file mode 100644 index 000000000..ae7970933 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineRequestTrackingCategory.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseLineRequestTrackingCategory.Deserializer.class) +public final class ExpenseLineRequestTrackingCategory { + private final Object value; + + private final int type; + + private ExpenseLineRequestTrackingCategory(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseLineRequestTrackingCategory + && equalTo((ExpenseLineRequestTrackingCategory) other); + } + + private boolean equalTo(ExpenseLineRequestTrackingCategory other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseLineRequestTrackingCategory of(String value) { + return new ExpenseLineRequestTrackingCategory(value, 0); + } + + public static ExpenseLineRequestTrackingCategory of(TrackingCategory value) { + return new ExpenseLineRequestTrackingCategory(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseLineRequestTrackingCategory.class); + } + + @Override + public ExpenseLineRequestTrackingCategory 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineTrackingCategoriesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineTrackingCategoriesItem.java new file mode 100644 index 000000000..1b3a7b0ec --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineTrackingCategoriesItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseLineTrackingCategoriesItem.Deserializer.class) +public final class ExpenseLineTrackingCategoriesItem { + private final Object value; + + private final int type; + + private ExpenseLineTrackingCategoriesItem(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseLineTrackingCategoriesItem && equalTo((ExpenseLineTrackingCategoriesItem) other); + } + + private boolean equalTo(ExpenseLineTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseLineTrackingCategoriesItem of(String value) { + return new ExpenseLineTrackingCategoriesItem(value, 0); + } + + public static ExpenseLineTrackingCategoriesItem of(TrackingCategory value) { + return new ExpenseLineTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseLineTrackingCategoriesItem.class); + } + + @Override + public ExpenseLineTrackingCategoriesItem 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineTrackingCategory.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineTrackingCategory.java new file mode 100644 index 000000000..668cb5233 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseLineTrackingCategory.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseLineTrackingCategory.Deserializer.class) +public final class ExpenseLineTrackingCategory { + private final Object value; + + private final int type; + + private ExpenseLineTrackingCategory(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseLineTrackingCategory && equalTo((ExpenseLineTrackingCategory) other); + } + + private boolean equalTo(ExpenseLineTrackingCategory other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseLineTrackingCategory of(String value) { + return new ExpenseLineTrackingCategory(value, 0); + } + + public static ExpenseLineTrackingCategory of(TrackingCategory value) { + return new ExpenseLineTrackingCategory(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseLineTrackingCategory.class); + } + + @Override + public ExpenseLineTrackingCategory 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseRequest.java new file mode 100644 index 000000000..dc9f380b5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseRequest.java @@ -0,0 +1,883 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExpenseRequest.Builder.class) +public final class ExpenseRequest { + private final Optional transactionDate; + + private final Optional account; + + private final Optional contact; + + private final Optional totalAmount; + + private final Optional subTotal; + + private final Optional totalTaxAmount; + + private final Optional currency; + + private final Optional exchangeRate; + + private final Optional inclusiveOfTax; + + private final Optional company; + + private final Optional employee; + + private final Optional memo; + + private final Optional> lines; + + private final Optional>> trackingCategories; + + private final Optional accountingPeriod; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private ExpenseRequest( + Optional transactionDate, + Optional account, + Optional contact, + Optional totalAmount, + Optional subTotal, + Optional totalTaxAmount, + Optional currency, + Optional exchangeRate, + Optional inclusiveOfTax, + Optional company, + Optional employee, + Optional memo, + Optional> lines, + Optional>> trackingCategories, + Optional accountingPeriod, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.transactionDate = transactionDate; + this.account = account; + this.contact = contact; + this.totalAmount = totalAmount; + this.subTotal = subTotal; + this.totalTaxAmount = totalTaxAmount; + this.currency = currency; + this.exchangeRate = exchangeRate; + this.inclusiveOfTax = inclusiveOfTax; + this.company = company; + this.employee = employee; + this.memo = memo; + this.lines = lines; + this.trackingCategories = trackingCategories; + this.accountingPeriod = accountingPeriod; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return When the transaction occurred. + */ + @JsonProperty("transaction_date") + public Optional getTransactionDate() { + return transactionDate; + } + + /** + * @return The expense's payment account. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The expense's contact. + */ + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + + /** + * @return The expense's total amount. + */ + @JsonProperty("total_amount") + public Optional getTotalAmount() { + return totalAmount; + } + + /** + * @return The expense's total amount before tax. + */ + @JsonProperty("sub_total") + public Optional getSubTotal() { + return subTotal; + } + + /** + * @return The expense's total tax amount. + */ + @JsonProperty("total_tax_amount") + public Optional getTotalTaxAmount() { + return totalTaxAmount; + } + + /** + * @return The expense'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 expense's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. + */ + @JsonProperty("inclusive_of_tax") + public Optional getInclusiveOfTax() { + return inclusiveOfTax; + } + + /** + * @return The company the expense belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The employee this overall transaction relates to. + */ + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + /** + * @return The expense's private note. + */ + @JsonProperty("memo") + public Optional getMemo() { + return memo; + } + + @JsonProperty("lines") + public Optional> getLines() { + return lines; + } + + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The accounting period that the Expense was generated in. + */ + @JsonProperty("accounting_period") + public Optional getAccountingPeriod() { + return accountingPeriod; + } + + @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseRequest && equalTo((ExpenseRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExpenseRequest other) { + return transactionDate.equals(other.transactionDate) + && account.equals(other.account) + && contact.equals(other.contact) + && totalAmount.equals(other.totalAmount) + && subTotal.equals(other.subTotal) + && totalTaxAmount.equals(other.totalTaxAmount) + && currency.equals(other.currency) + && exchangeRate.equals(other.exchangeRate) + && inclusiveOfTax.equals(other.inclusiveOfTax) + && company.equals(other.company) + && employee.equals(other.employee) + && memo.equals(other.memo) + && lines.equals(other.lines) + && trackingCategories.equals(other.trackingCategories) + && accountingPeriod.equals(other.accountingPeriod) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.transactionDate, + this.account, + this.contact, + this.totalAmount, + this.subTotal, + this.totalTaxAmount, + this.currency, + this.exchangeRate, + this.inclusiveOfTax, + this.company, + this.employee, + this.memo, + this.lines, + this.trackingCategories, + this.accountingPeriod, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional transactionDate = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional contact = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Optional subTotal = Optional.empty(); + + private Optional totalTaxAmount = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional inclusiveOfTax = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional employee = Optional.empty(); + + private Optional memo = Optional.empty(); + + private Optional> lines = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional accountingPeriod = 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(ExpenseRequest other) { + transactionDate(other.getTransactionDate()); + account(other.getAccount()); + contact(other.getContact()); + totalAmount(other.getTotalAmount()); + subTotal(other.getSubTotal()); + totalTaxAmount(other.getTotalTaxAmount()); + currency(other.getCurrency()); + exchangeRate(other.getExchangeRate()); + inclusiveOfTax(other.getInclusiveOfTax()); + company(other.getCompany()); + employee(other.getEmployee()); + memo(other.getMemo()); + lines(other.getLines()); + trackingCategories(other.getTrackingCategories()); + accountingPeriod(other.getAccountingPeriod()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + remoteFields(other.getRemoteFields()); + return this; + } + + @JsonSetter(value = "transaction_date", nulls = Nulls.SKIP) + public Builder transactionDate(Optional transactionDate) { + this.transactionDate = transactionDate; + return this; + } + + public Builder transactionDate(OffsetDateTime transactionDate) { + this.transactionDate = Optional.ofNullable(transactionDate); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(ExpenseRequestAccount 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(ExpenseRequestContact contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "total_amount", nulls = Nulls.SKIP) + public Builder totalAmount(Optional totalAmount) { + this.totalAmount = totalAmount; + return this; + } + + public Builder totalAmount(Double totalAmount) { + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + @JsonSetter(value = "sub_total", nulls = Nulls.SKIP) + public Builder subTotal(Optional subTotal) { + this.subTotal = subTotal; + return this; + } + + public Builder subTotal(Double subTotal) { + this.subTotal = Optional.ofNullable(subTotal); + return this; + } + + @JsonSetter(value = "total_tax_amount", nulls = Nulls.SKIP) + public Builder totalTaxAmount(Optional totalTaxAmount) { + this.totalTaxAmount = totalTaxAmount; + return this; + } + + public Builder totalTaxAmount(Double totalTaxAmount) { + this.totalTaxAmount = Optional.ofNullable(totalTaxAmount); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(ExpenseRequestCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + @JsonSetter(value = "inclusive_of_tax", nulls = Nulls.SKIP) + public Builder inclusiveOfTax(Optional inclusiveOfTax) { + this.inclusiveOfTax = inclusiveOfTax; + return this; + } + + public Builder inclusiveOfTax(Boolean inclusiveOfTax) { + this.inclusiveOfTax = Optional.ofNullable(inclusiveOfTax); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(ExpenseRequestCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "employee", nulls = Nulls.SKIP) + public Builder employee(Optional employee) { + this.employee = employee; + return this; + } + + public Builder employee(ExpenseRequestEmployee employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "memo", nulls = Nulls.SKIP) + public Builder memo(Optional memo) { + this.memo = memo; + return this; + } + + public Builder memo(String memo) { + this.memo = Optional.ofNullable(memo); + return this; + } + + @JsonSetter(value = "lines", nulls = Nulls.SKIP) + public Builder lines(Optional> lines) { + this.lines = lines; + return this; + } + + public Builder lines(List lines) { + this.lines = Optional.ofNullable(lines); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + @JsonSetter(value = "accounting_period", nulls = Nulls.SKIP) + public Builder accountingPeriod(Optional accountingPeriod) { + this.accountingPeriod = accountingPeriod; + return this; + } + + public Builder accountingPeriod(ExpenseRequestAccountingPeriod accountingPeriod) { + this.accountingPeriod = Optional.ofNullable(accountingPeriod); + 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 ExpenseRequest build() { + return new ExpenseRequest( + transactionDate, + account, + contact, + totalAmount, + subTotal, + totalTaxAmount, + currency, + exchangeRate, + inclusiveOfTax, + company, + employee, + memo, + lines, + trackingCategories, + accountingPeriod, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseRequestAccount.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseRequestAccount.java new file mode 100644 index 000000000..35b4969ad --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseRequestAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseRequestAccount.Deserializer.class) +public final class ExpenseRequestAccount { + private final Object value; + + private final int type; + + private ExpenseRequestAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseRequestAccount && equalTo((ExpenseRequestAccount) other); + } + + private boolean equalTo(ExpenseRequestAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseRequestAccount of(String value) { + return new ExpenseRequestAccount(value, 0); + } + + public static ExpenseRequestAccount of(Account value) { + return new ExpenseRequestAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseRequestAccount.class); + } + + @Override + public ExpenseRequestAccount 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/legacy/api/resources/accounting/types/ExpenseRequestAccountingPeriod.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseRequestAccountingPeriod.java new file mode 100644 index 000000000..f1702c39c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseRequestAccountingPeriod.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseRequestAccountingPeriod.Deserializer.class) +public final class ExpenseRequestAccountingPeriod { + private final Object value; + + private final int type; + + private ExpenseRequestAccountingPeriod(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((AccountingPeriod) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseRequestAccountingPeriod && equalTo((ExpenseRequestAccountingPeriod) other); + } + + private boolean equalTo(ExpenseRequestAccountingPeriod other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseRequestAccountingPeriod of(String value) { + return new ExpenseRequestAccountingPeriod(value, 0); + } + + public static ExpenseRequestAccountingPeriod of(AccountingPeriod value) { + return new ExpenseRequestAccountingPeriod(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(AccountingPeriod value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseRequestAccountingPeriod.class); + } + + @Override + public ExpenseRequestAccountingPeriod 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, AccountingPeriod.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseRequestCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseRequestCompany.java new file mode 100644 index 000000000..800d415ee --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseRequestCompany.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseRequestCompany.Deserializer.class) +public final class ExpenseRequestCompany { + private final Object value; + + private final int type; + + private ExpenseRequestCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseRequestCompany && equalTo((ExpenseRequestCompany) other); + } + + private boolean equalTo(ExpenseRequestCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseRequestCompany of(String value) { + return new ExpenseRequestCompany(value, 0); + } + + public static ExpenseRequestCompany of(CompanyInfo value) { + return new ExpenseRequestCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseRequestCompany.class); + } + + @Override + public ExpenseRequestCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseRequestContact.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseRequestContact.java new file mode 100644 index 000000000..15a597bd3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseRequestContact.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseRequestContact.Deserializer.class) +public final class ExpenseRequestContact { + private final Object value; + + private final int type; + + private ExpenseRequestContact(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseRequestContact && equalTo((ExpenseRequestContact) other); + } + + private boolean equalTo(ExpenseRequestContact other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseRequestContact of(String value) { + return new ExpenseRequestContact(value, 0); + } + + public static ExpenseRequestContact of(Contact value) { + return new ExpenseRequestContact(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseRequestContact.class); + } + + @Override + public ExpenseRequestContact 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseRequestCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseRequestCurrency.java new file mode 100644 index 000000000..41e9ea86b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseRequestCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/ExpenseRequestEmployee.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseRequestEmployee.java new file mode 100644 index 000000000..edd6a196f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseRequestEmployee.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseRequestEmployee.Deserializer.class) +public final class ExpenseRequestEmployee { + private final Object value; + + private final int type; + + private ExpenseRequestEmployee(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((Employee) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseRequestEmployee && equalTo((ExpenseRequestEmployee) other); + } + + private boolean equalTo(ExpenseRequestEmployee other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseRequestEmployee of(String value) { + return new ExpenseRequestEmployee(value, 0); + } + + public static ExpenseRequestEmployee of(Employee value) { + return new ExpenseRequestEmployee(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employee value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseRequestEmployee.class); + } + + @Override + public ExpenseRequestEmployee 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, Employee.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseRequestTrackingCategoriesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseRequestTrackingCategoriesItem.java new file mode 100644 index 000000000..516306ffb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseRequestTrackingCategoriesItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseRequestTrackingCategoriesItem.Deserializer.class) +public final class ExpenseRequestTrackingCategoriesItem { + private final Object value; + + private final int type; + + private ExpenseRequestTrackingCategoriesItem(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseRequestTrackingCategoriesItem + && equalTo((ExpenseRequestTrackingCategoriesItem) other); + } + + private boolean equalTo(ExpenseRequestTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseRequestTrackingCategoriesItem of(String value) { + return new ExpenseRequestTrackingCategoriesItem(value, 0); + } + + public static ExpenseRequestTrackingCategoriesItem of(TrackingCategory value) { + return new ExpenseRequestTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseRequestTrackingCategoriesItem.class); + } + + @Override + public ExpenseRequestTrackingCategoriesItem 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseResponse.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseResponse.java new file mode 100644 index 000000000..146730bc1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExpenseResponse.Builder.class) +public final class ExpenseResponse { + private final Expense model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private ExpenseResponse( + Expense 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 Expense getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseResponse && equalTo((ExpenseResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExpenseResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull Expense model); + + Builder from(ExpenseResponse other); + } + + public interface _FinalStage { + ExpenseResponse 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 Expense model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(ExpenseResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull Expense model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public ExpenseResponse build() { + return new ExpenseResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseTrackingCategoriesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseTrackingCategoriesItem.java new file mode 100644 index 000000000..62f183f5a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExpenseTrackingCategoriesItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseTrackingCategoriesItem.Deserializer.class) +public final class ExpenseTrackingCategoriesItem { + private final Object value; + + private final int type; + + private ExpenseTrackingCategoriesItem(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseTrackingCategoriesItem && equalTo((ExpenseTrackingCategoriesItem) other); + } + + private boolean equalTo(ExpenseTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseTrackingCategoriesItem of(String value) { + return new ExpenseTrackingCategoriesItem(value, 0); + } + + public static ExpenseTrackingCategoriesItem of(TrackingCategory value) { + return new ExpenseTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseTrackingCategoriesItem.class); + } + + @Override + public ExpenseTrackingCategoriesItem 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExternalTargetFieldApi.java new file mode 100644 index 000000000..f2264375a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExternalTargetFieldApi.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isMapped); + } + + @Override + 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/legacy/api/resources/accounting/types/ExternalTargetFieldApiResponse.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExternalTargetFieldApiResponse.java new file mode 100644 index 000000000..b7e4bb44c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ExternalTargetFieldApiResponse.java @@ -0,0 +1,637 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/accounting/types/FeedStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/FeedStatusEnum.java new file mode 100644 index 000000000..55ae29c66 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/FeedStatusEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FeedStatusEnum { + ACTIVE("ACTIVE"), + + INACTIVE("INACTIVE"); + + private final String value; + + FeedStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldFormatEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldFormatEnum.java new file mode 100644 index 000000000..9b5f83ef3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldFormatEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldMappingApiInstance.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldMappingApiInstance.java new file mode 100644 index 000000000..3842a897a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldMappingApiInstance.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField); + } + + @Override + 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/legacy/api/resources/accounting/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldMappingApiInstanceRemoteField.java new file mode 100644 index 000000000..ae5a5de88 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldMappingApiInstanceRemoteField.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.remoteKeyName, this.schema, this.remoteEndpointInfo); + } + + @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() {} + + @Override + public Builder from(FieldMappingApiInstanceRemoteField other) { + remoteKeyName(other.getRemoteKeyName()); + schema(other.getSchema()); + remoteEndpointInfo(other.getRemoteEndpointInfo()); + return this; + } + + @Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo( + @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @Override + public _FinalStage schema(Map schema) { + this.schema = Optional.ofNullable(schema); + return this; + } + + @Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Optional> schema) { + this.schema = schema; + return this; + } + + @Override + public _FinalStage remoteKeyName(String remoteKeyName) { + this.remoteKeyName = Optional.ofNullable(remoteKeyName); + return this; + } + + @Override + @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) + public _FinalStage remoteKeyName(Optional remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @Override + public FieldMappingApiInstanceRemoteField build() { + return new FieldMappingApiInstanceRemoteField( + remoteKeyName, schema, remoteEndpointInfo, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java new file mode 100644 index 000000000..7bd32df09 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java @@ -0,0 +1,138 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @Override + 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/legacy/api/resources/accounting/types/FieldMappingApiInstanceResponse.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldMappingApiInstanceResponse.java new file mode 100644 index 000000000..4c99a1591 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldMappingApiInstanceResponse.java @@ -0,0 +1,637 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/accounting/types/FieldMappingApiInstanceTargetField.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldMappingApiInstanceTargetField.java new file mode 100644 index 000000000..8a5c2c3c1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldMappingApiInstanceTargetField.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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; + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isOrganizationWide); + } + + @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() {} + + @Override + public Builder from(FieldMappingApiInstanceTargetField other) { + name(other.getName()); + description(other.getDescription()); + isOrganizationWide(other.getIsOrganizationWide()); + return this; + } + + @Override + @JsonSetter("name") + public DescriptionStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + @JsonSetter("description") + public IsOrganizationWideStage description(@NotNull String description) { + this.description = description; + return this; + } + + @Override + @JsonSetter("is_organization_wide") + public _FinalStage isOrganizationWide(boolean isOrganizationWide) { + this.isOrganizationWide = isOrganizationWide; + return this; + } + + @Override + public FieldMappingApiInstanceTargetField build() { + return new FieldMappingApiInstanceTargetField(name, description, isOrganizationWide, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldMappingInstanceResponse.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldMappingInstanceResponse.java new file mode 100644 index 000000000..d994f7538 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldMappingInstanceResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @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() {} + + @Override + public Builder from(FieldMappingInstanceResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull FieldMappingApiInstance model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public FieldMappingInstanceResponse build() { + return new FieldMappingInstanceResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldPermissionDeserializer.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldPermissionDeserializer.java new file mode 100644 index 000000000..1e4d8b14d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldPermissionDeserializer.java @@ -0,0 +1,112 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @Override + 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/legacy/api/resources/accounting/types/FieldPermissionDeserializerRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldPermissionDeserializerRequest.java new file mode 100644 index 000000000..a9d110971 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldPermissionDeserializerRequest.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @Override + 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/legacy/api/resources/accounting/types/FieldTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldTypeEnum.java new file mode 100644 index 000000000..781075d86 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/FieldTypeEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransaction.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransaction.java new file mode 100644 index 000000000..24d178687 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransaction.java @@ -0,0 +1,540 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GeneralLedgerTransaction.Builder.class) +public final class GeneralLedgerTransaction { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional underlyingTransactionRemoteId; + + private final Optional underlyingTransactionType; + + private final Optional accountingPeriod; + + private final Optional company; + + private final Optional remoteUpdatedAt; + + private final Optional remoteCreatedAt; + + private final Optional>> trackingCategories; + + private final Optional postingDate; + + private final Optional> + generalLedgerTransactionLines; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private GeneralLedgerTransaction( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional underlyingTransactionRemoteId, + Optional underlyingTransactionType, + Optional accountingPeriod, + Optional company, + Optional remoteUpdatedAt, + Optional remoteCreatedAt, + Optional>> trackingCategories, + Optional postingDate, + Optional> generalLedgerTransactionLines, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.underlyingTransactionRemoteId = underlyingTransactionRemoteId; + this.underlyingTransactionType = underlyingTransactionType; + this.accountingPeriod = accountingPeriod; + this.company = company; + this.remoteUpdatedAt = remoteUpdatedAt; + this.remoteCreatedAt = remoteCreatedAt; + this.trackingCategories = trackingCategories; + this.postingDate = postingDate; + this.generalLedgerTransactionLines = generalLedgerTransactionLines; + 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 third party remote ID of the underlying transaction. + */ + @JsonProperty("underlying_transaction_remote_id") + public Optional getUnderlyingTransactionRemoteId() { + return underlyingTransactionRemoteId; + } + + /** + * @return The type of the underlying transaction. + *
    + *
  • INVOICE - INVOICE
  • + *
  • EXPENSE - EXPENSE
  • + *
  • TRANSACTION - TRANSACTION
  • + *
  • JOURNAL_ENTRY - JOURNAL_ENTRY
  • + *
  • PAYMENT - PAYMENT
  • + *
  • VENDOR_CREDIT - VENDOR_CREDIT
  • + *
  • CREDIT_NOTE - CREDIT_NOTE
  • + *
+ */ + @JsonProperty("underlying_transaction_type") + public Optional getUnderlyingTransactionType() { + return underlyingTransactionType; + } + + /** + * @return The accounting period that the GeneralLedgerTransaction was generated in. + */ + @JsonProperty("accounting_period") + public Optional getAccountingPeriod() { + return accountingPeriod; + } + + /** + * @return The company the GeneralLedgerTransaction belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return When the third party's GeneralLedgerTransaction entry was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @return When the third party's GeneralLedgerTransaction entry was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The date that the transaction was posted to the general ledger. + */ + @JsonProperty("posting_date") + public Optional getPostingDate() { + return postingDate; + } + + /** + * @return A list of “General Ledger Transaction Applied to Lines” objects. + */ + @JsonProperty("general_ledger_transaction_lines") + public Optional> + getGeneralLedgerTransactionLines() { + return generalLedgerTransactionLines; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GeneralLedgerTransaction && equalTo((GeneralLedgerTransaction) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GeneralLedgerTransaction other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && underlyingTransactionRemoteId.equals(other.underlyingTransactionRemoteId) + && underlyingTransactionType.equals(other.underlyingTransactionType) + && accountingPeriod.equals(other.accountingPeriod) + && company.equals(other.company) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && trackingCategories.equals(other.trackingCategories) + && postingDate.equals(other.postingDate) + && generalLedgerTransactionLines.equals(other.generalLedgerTransactionLines) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.underlyingTransactionRemoteId, + this.underlyingTransactionType, + this.accountingPeriod, + this.company, + this.remoteUpdatedAt, + this.remoteCreatedAt, + this.trackingCategories, + this.postingDate, + this.generalLedgerTransactionLines, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 underlyingTransactionRemoteId = Optional.empty(); + + private Optional underlyingTransactionType = + Optional.empty(); + + private Optional accountingPeriod = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional>> trackingCategories = + Optional.empty(); + + private Optional postingDate = Optional.empty(); + + private Optional> + generalLedgerTransactionLines = 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(GeneralLedgerTransaction other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + underlyingTransactionRemoteId(other.getUnderlyingTransactionRemoteId()); + underlyingTransactionType(other.getUnderlyingTransactionType()); + accountingPeriod(other.getAccountingPeriod()); + company(other.getCompany()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + remoteCreatedAt(other.getRemoteCreatedAt()); + trackingCategories(other.getTrackingCategories()); + postingDate(other.getPostingDate()); + generalLedgerTransactionLines(other.getGeneralLedgerTransactionLines()); + 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 = "underlying_transaction_remote_id", nulls = Nulls.SKIP) + public Builder underlyingTransactionRemoteId(Optional underlyingTransactionRemoteId) { + this.underlyingTransactionRemoteId = underlyingTransactionRemoteId; + return this; + } + + public Builder underlyingTransactionRemoteId(String underlyingTransactionRemoteId) { + this.underlyingTransactionRemoteId = Optional.ofNullable(underlyingTransactionRemoteId); + return this; + } + + @JsonSetter(value = "underlying_transaction_type", nulls = Nulls.SKIP) + public Builder underlyingTransactionType( + Optional underlyingTransactionType) { + this.underlyingTransactionType = underlyingTransactionType; + return this; + } + + public Builder underlyingTransactionType( + GeneralLedgerTransactionUnderlyingTransactionType underlyingTransactionType) { + this.underlyingTransactionType = Optional.ofNullable(underlyingTransactionType); + return this; + } + + @JsonSetter(value = "accounting_period", nulls = Nulls.SKIP) + public Builder accountingPeriod(Optional accountingPeriod) { + this.accountingPeriod = accountingPeriod; + return this; + } + + public Builder accountingPeriod(GeneralLedgerTransactionAccountingPeriod accountingPeriod) { + this.accountingPeriod = Optional.ofNullable(accountingPeriod); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(GeneralLedgerTransactionCompany company) { + this.company = Optional.ofNullable(company); + 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 = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories( + List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + @JsonSetter(value = "posting_date", nulls = Nulls.SKIP) + public Builder postingDate(Optional postingDate) { + this.postingDate = postingDate; + return this; + } + + public Builder postingDate(OffsetDateTime postingDate) { + this.postingDate = Optional.ofNullable(postingDate); + return this; + } + + @JsonSetter(value = "general_ledger_transaction_lines", nulls = Nulls.SKIP) + public Builder generalLedgerTransactionLines( + Optional> + generalLedgerTransactionLines) { + this.generalLedgerTransactionLines = generalLedgerTransactionLines; + return this; + } + + public Builder generalLedgerTransactionLines( + List generalLedgerTransactionLines) { + this.generalLedgerTransactionLines = Optional.ofNullable(generalLedgerTransactionLines); + 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 GeneralLedgerTransaction build() { + return new GeneralLedgerTransaction( + id, + remoteId, + createdAt, + modifiedAt, + underlyingTransactionRemoteId, + underlyingTransactionType, + accountingPeriod, + company, + remoteUpdatedAt, + remoteCreatedAt, + trackingCategories, + postingDate, + generalLedgerTransactionLines, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionAccountingPeriod.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionAccountingPeriod.java new file mode 100644 index 000000000..525f096d9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionAccountingPeriod.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = GeneralLedgerTransactionAccountingPeriod.Deserializer.class) +public final class GeneralLedgerTransactionAccountingPeriod { + private final Object value; + + private final int type; + + private GeneralLedgerTransactionAccountingPeriod(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((AccountingPeriod) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GeneralLedgerTransactionAccountingPeriod + && equalTo((GeneralLedgerTransactionAccountingPeriod) other); + } + + private boolean equalTo(GeneralLedgerTransactionAccountingPeriod other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static GeneralLedgerTransactionAccountingPeriod of(String value) { + return new GeneralLedgerTransactionAccountingPeriod(value, 0); + } + + public static GeneralLedgerTransactionAccountingPeriod of(AccountingPeriod value) { + return new GeneralLedgerTransactionAccountingPeriod(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(AccountingPeriod value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(GeneralLedgerTransactionAccountingPeriod.class); + } + + @Override + public GeneralLedgerTransactionAccountingPeriod 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, AccountingPeriod.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionCompany.java new file mode 100644 index 000000000..1ccc18fce --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionCompany.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = GeneralLedgerTransactionCompany.Deserializer.class) +public final class GeneralLedgerTransactionCompany { + private final Object value; + + private final int type; + + private GeneralLedgerTransactionCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GeneralLedgerTransactionCompany && equalTo((GeneralLedgerTransactionCompany) other); + } + + private boolean equalTo(GeneralLedgerTransactionCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static GeneralLedgerTransactionCompany of(String value) { + return new GeneralLedgerTransactionCompany(value, 0); + } + + public static GeneralLedgerTransactionCompany of(CompanyInfo value) { + return new GeneralLedgerTransactionCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(GeneralLedgerTransactionCompany.class); + } + + @Override + public GeneralLedgerTransactionCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionGeneralLedgerTransactionLinesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionGeneralLedgerTransactionLinesItem.java new file mode 100644 index 000000000..f980f8a28 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionGeneralLedgerTransactionLinesItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = GeneralLedgerTransactionGeneralLedgerTransactionLinesItem.Deserializer.class) +public final class GeneralLedgerTransactionGeneralLedgerTransactionLinesItem { + private final Object value; + + private final int type; + + private GeneralLedgerTransactionGeneralLedgerTransactionLinesItem(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((GeneralLedgerTransactionLine) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GeneralLedgerTransactionGeneralLedgerTransactionLinesItem + && equalTo((GeneralLedgerTransactionGeneralLedgerTransactionLinesItem) other); + } + + private boolean equalTo(GeneralLedgerTransactionGeneralLedgerTransactionLinesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static GeneralLedgerTransactionGeneralLedgerTransactionLinesItem of(String value) { + return new GeneralLedgerTransactionGeneralLedgerTransactionLinesItem(value, 0); + } + + public static GeneralLedgerTransactionGeneralLedgerTransactionLinesItem of(GeneralLedgerTransactionLine value) { + return new GeneralLedgerTransactionGeneralLedgerTransactionLinesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(GeneralLedgerTransactionLine value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(GeneralLedgerTransactionGeneralLedgerTransactionLinesItem.class); + } + + @Override + public GeneralLedgerTransactionGeneralLedgerTransactionLinesItem 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, GeneralLedgerTransactionLine.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionLine.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionLine.java new file mode 100644 index 000000000..74387dbc9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionLine.java @@ -0,0 +1,1993 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GeneralLedgerTransactionLine.Builder.class) +public final class GeneralLedgerTransactionLine { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional account; + + private final Optional company; + + private final Optional employee; + + private final Optional contact; + + private final Optional baseCurrency; + + private final Optional transactionCurrency; + + private final Optional exchangeRate; + + private final Optional description; + + private final Optional> trackingCategories; + + private final String debitAmount; + + private final String creditAmount; + + private final Optional item; + + private final String foreignDebitAmount; + + private final String foreignCreditAmount; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Map additionalProperties; + + private GeneralLedgerTransactionLine( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional account, + Optional company, + Optional employee, + Optional contact, + Optional baseCurrency, + Optional transactionCurrency, + Optional exchangeRate, + Optional description, + Optional> trackingCategories, + String debitAmount, + String creditAmount, + Optional item, + String foreignDebitAmount, + String foreignCreditAmount, + Optional remoteWasDeleted, + Optional> fieldMappings, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.account = account; + this.company = company; + this.employee = employee; + this.contact = contact; + this.baseCurrency = baseCurrency; + this.transactionCurrency = transactionCurrency; + this.exchangeRate = exchangeRate; + this.description = description; + this.trackingCategories = trackingCategories; + this.debitAmount = debitAmount; + this.creditAmount = creditAmount; + this.item = item; + this.foreignDebitAmount = foreignDebitAmount; + this.foreignCreditAmount = foreignCreditAmount; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + 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; + } + + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The company the GeneralLedgerTransaction belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + + /** + * @return The base currency of the transaction + *
    + *
  • 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("base_currency") + public Optional getBaseCurrency() { + return baseCurrency; + } + + /** + * @return The transaction currency that the transaction is made in. + *
    + *
  • 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("transaction_currency") + public Optional getTransactionCurrency() { + return transactionCurrency; + } + + /** + * @return The exchange rate between the base currency and the transaction currency. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return A description of the line item. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("tracking_categories") + public Optional> getTrackingCategories() { + return trackingCategories; + } + + @JsonProperty("debit_amount") + public String getDebitAmount() { + return debitAmount; + } + + @JsonProperty("credit_amount") + public String getCreditAmount() { + return creditAmount; + } + + @JsonProperty("item") + public Optional getItem() { + return item; + } + + @JsonProperty("foreign_debit_amount") + public String getForeignDebitAmount() { + return foreignDebitAmount; + } + + @JsonProperty("foreign_credit_amount") + public String getForeignCreditAmount() { + return foreignCreditAmount; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GeneralLedgerTransactionLine && equalTo((GeneralLedgerTransactionLine) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GeneralLedgerTransactionLine other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && account.equals(other.account) + && company.equals(other.company) + && employee.equals(other.employee) + && contact.equals(other.contact) + && baseCurrency.equals(other.baseCurrency) + && transactionCurrency.equals(other.transactionCurrency) + && exchangeRate.equals(other.exchangeRate) + && description.equals(other.description) + && trackingCategories.equals(other.trackingCategories) + && debitAmount.equals(other.debitAmount) + && creditAmount.equals(other.creditAmount) + && item.equals(other.item) + && foreignDebitAmount.equals(other.foreignDebitAmount) + && foreignCreditAmount.equals(other.foreignCreditAmount) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.account, + this.company, + this.employee, + this.contact, + this.baseCurrency, + this.transactionCurrency, + this.exchangeRate, + this.description, + this.trackingCategories, + this.debitAmount, + this.creditAmount, + this.item, + this.foreignDebitAmount, + this.foreignCreditAmount, + this.remoteWasDeleted, + this.fieldMappings); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DebitAmountStage builder() { + return new Builder(); + } + + public interface DebitAmountStage { + CreditAmountStage debitAmount(@NotNull String debitAmount); + + Builder from(GeneralLedgerTransactionLine other); + } + + public interface CreditAmountStage { + ForeignDebitAmountStage creditAmount(@NotNull String creditAmount); + } + + public interface ForeignDebitAmountStage { + ForeignCreditAmountStage foreignDebitAmount(@NotNull String foreignDebitAmount); + } + + public interface ForeignCreditAmountStage { + _FinalStage foreignCreditAmount(@NotNull String foreignCreditAmount); + } + + public interface _FinalStage { + GeneralLedgerTransactionLine 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 account(Optional account); + + _FinalStage account(GeneralLedgerTransactionLineAccount account); + + _FinalStage company(Optional company); + + _FinalStage company(GeneralLedgerTransactionLineCompany company); + + _FinalStage employee(Optional employee); + + _FinalStage employee(GeneralLedgerTransactionLineEmployee employee); + + _FinalStage contact(Optional contact); + + _FinalStage contact(GeneralLedgerTransactionLineContact contact); + + _FinalStage baseCurrency(Optional baseCurrency); + + _FinalStage baseCurrency(GeneralLedgerTransactionLineBaseCurrency baseCurrency); + + _FinalStage transactionCurrency(Optional transactionCurrency); + + _FinalStage transactionCurrency(GeneralLedgerTransactionLineTransactionCurrency transactionCurrency); + + _FinalStage exchangeRate(Optional exchangeRate); + + _FinalStage exchangeRate(String exchangeRate); + + _FinalStage description(Optional description); + + _FinalStage description(String description); + + _FinalStage trackingCategories(Optional> trackingCategories); + + _FinalStage trackingCategories(List trackingCategories); + + _FinalStage item(Optional item); + + _FinalStage item(GeneralLedgerTransactionLineItem item); + + _FinalStage remoteWasDeleted(Optional remoteWasDeleted); + + _FinalStage remoteWasDeleted(Boolean remoteWasDeleted); + + _FinalStage fieldMappings(Optional> fieldMappings); + + _FinalStage fieldMappings(Map fieldMappings); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements DebitAmountStage, + CreditAmountStage, + ForeignDebitAmountStage, + ForeignCreditAmountStage, + _FinalStage { + private String debitAmount; + + private String creditAmount; + + private String foreignDebitAmount; + + private String foreignCreditAmount; + + private Optional> fieldMappings = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional item = Optional.empty(); + + private Optional> trackingCategories = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional transactionCurrency = Optional.empty(); + + private Optional baseCurrency = Optional.empty(); + + private Optional contact = Optional.empty(); + + private Optional employee = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional account = 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() {} + + @Override + public Builder from(GeneralLedgerTransactionLine other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + account(other.getAccount()); + company(other.getCompany()); + employee(other.getEmployee()); + contact(other.getContact()); + baseCurrency(other.getBaseCurrency()); + transactionCurrency(other.getTransactionCurrency()); + exchangeRate(other.getExchangeRate()); + description(other.getDescription()); + trackingCategories(other.getTrackingCategories()); + debitAmount(other.getDebitAmount()); + creditAmount(other.getCreditAmount()); + item(other.getItem()); + foreignDebitAmount(other.getForeignDebitAmount()); + foreignCreditAmount(other.getForeignCreditAmount()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + return this; + } + + @Override + @JsonSetter("debit_amount") + public CreditAmountStage debitAmount(@NotNull String debitAmount) { + this.debitAmount = debitAmount; + return this; + } + + @Override + @JsonSetter("credit_amount") + public ForeignDebitAmountStage creditAmount(@NotNull String creditAmount) { + this.creditAmount = creditAmount; + return this; + } + + @Override + @JsonSetter("foreign_debit_amount") + public ForeignCreditAmountStage foreignDebitAmount(@NotNull String foreignDebitAmount) { + this.foreignDebitAmount = foreignDebitAmount; + return this; + } + + @Override + @JsonSetter("foreign_credit_amount") + public _FinalStage foreignCreditAmount(@NotNull String foreignCreditAmount) { + this.foreignCreditAmount = foreignCreditAmount; + return this; + } + + @Override + public _FinalStage fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @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. + */ + @Override + public _FinalStage remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @Override + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public _FinalStage remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + @Override + public _FinalStage item(GeneralLedgerTransactionLineItem item) { + this.item = Optional.ofNullable(item); + return this; + } + + @Override + @JsonSetter(value = "item", nulls = Nulls.SKIP) + public _FinalStage item(Optional item) { + this.item = item; + return this; + } + + @Override + public _FinalStage trackingCategories(List trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + @Override + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public _FinalStage trackingCategories(Optional> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + /** + *

A description of the line item.

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

The exchange rate between the base currency and the transaction currency.

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

The transaction currency that the transaction is made in.

+ *
    + *
  • 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)
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage transactionCurrency(GeneralLedgerTransactionLineTransactionCurrency transactionCurrency) { + this.transactionCurrency = Optional.ofNullable(transactionCurrency); + return this; + } + + @Override + @JsonSetter(value = "transaction_currency", nulls = Nulls.SKIP) + public _FinalStage transactionCurrency( + Optional transactionCurrency) { + this.transactionCurrency = transactionCurrency; + return this; + } + + /** + *

The base currency of the transaction

+ *
    + *
  • 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)
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage baseCurrency(GeneralLedgerTransactionLineBaseCurrency baseCurrency) { + this.baseCurrency = Optional.ofNullable(baseCurrency); + return this; + } + + @Override + @JsonSetter(value = "base_currency", nulls = Nulls.SKIP) + public _FinalStage baseCurrency(Optional baseCurrency) { + this.baseCurrency = baseCurrency; + return this; + } + + @Override + public _FinalStage contact(GeneralLedgerTransactionLineContact contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @Override + @JsonSetter(value = "contact", nulls = Nulls.SKIP) + public _FinalStage contact(Optional contact) { + this.contact = contact; + return this; + } + + @Override + public _FinalStage employee(GeneralLedgerTransactionLineEmployee employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @Override + @JsonSetter(value = "employee", nulls = Nulls.SKIP) + public _FinalStage employee(Optional employee) { + this.employee = employee; + return this; + } + + /** + *

The company the GeneralLedgerTransaction belongs to.

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

The datetime that this object was modified by Merge.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @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. + */ + @Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @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. + */ + @Override + public _FinalStage remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @Override + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public _FinalStage remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + @Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @Override + public GeneralLedgerTransactionLine build() { + return new GeneralLedgerTransactionLine( + id, + remoteId, + createdAt, + modifiedAt, + account, + company, + employee, + contact, + baseCurrency, + transactionCurrency, + exchangeRate, + description, + trackingCategories, + debitAmount, + creditAmount, + item, + foreignDebitAmount, + foreignCreditAmount, + remoteWasDeleted, + fieldMappings, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionLineAccount.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionLineAccount.java new file mode 100644 index 000000000..bd5f54c5e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionLineAccount.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = GeneralLedgerTransactionLineAccount.Deserializer.class) +public final class GeneralLedgerTransactionLineAccount { + private final Object value; + + private final int type; + + private GeneralLedgerTransactionLineAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GeneralLedgerTransactionLineAccount + && equalTo((GeneralLedgerTransactionLineAccount) other); + } + + private boolean equalTo(GeneralLedgerTransactionLineAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static GeneralLedgerTransactionLineAccount of(String value) { + return new GeneralLedgerTransactionLineAccount(value, 0); + } + + public static GeneralLedgerTransactionLineAccount of(Account value) { + return new GeneralLedgerTransactionLineAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(GeneralLedgerTransactionLineAccount.class); + } + + @Override + public GeneralLedgerTransactionLineAccount 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/legacy/api/resources/accounting/types/GeneralLedgerTransactionLineBaseCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionLineBaseCurrency.java new file mode 100644 index 000000000..8ef834843 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionLineBaseCurrency.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/GeneralLedgerTransactionLineCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionLineCompany.java new file mode 100644 index 000000000..56111a99c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionLineCompany.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = GeneralLedgerTransactionLineCompany.Deserializer.class) +public final class GeneralLedgerTransactionLineCompany { + private final Object value; + + private final int type; + + private GeneralLedgerTransactionLineCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GeneralLedgerTransactionLineCompany + && equalTo((GeneralLedgerTransactionLineCompany) other); + } + + private boolean equalTo(GeneralLedgerTransactionLineCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static GeneralLedgerTransactionLineCompany of(String value) { + return new GeneralLedgerTransactionLineCompany(value, 0); + } + + public static GeneralLedgerTransactionLineCompany of(CompanyInfo value) { + return new GeneralLedgerTransactionLineCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(GeneralLedgerTransactionLineCompany.class); + } + + @Override + public GeneralLedgerTransactionLineCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionLineContact.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionLineContact.java new file mode 100644 index 000000000..82870fdc3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionLineContact.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = GeneralLedgerTransactionLineContact.Deserializer.class) +public final class GeneralLedgerTransactionLineContact { + private final Object value; + + private final int type; + + private GeneralLedgerTransactionLineContact(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GeneralLedgerTransactionLineContact + && equalTo((GeneralLedgerTransactionLineContact) other); + } + + private boolean equalTo(GeneralLedgerTransactionLineContact other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static GeneralLedgerTransactionLineContact of(String value) { + return new GeneralLedgerTransactionLineContact(value, 0); + } + + public static GeneralLedgerTransactionLineContact of(Contact value) { + return new GeneralLedgerTransactionLineContact(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(GeneralLedgerTransactionLineContact.class); + } + + @Override + public GeneralLedgerTransactionLineContact 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionLineEmployee.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionLineEmployee.java new file mode 100644 index 000000000..99092a639 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionLineEmployee.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = GeneralLedgerTransactionLineEmployee.Deserializer.class) +public final class GeneralLedgerTransactionLineEmployee { + private final Object value; + + private final int type; + + private GeneralLedgerTransactionLineEmployee(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((Employee) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GeneralLedgerTransactionLineEmployee + && equalTo((GeneralLedgerTransactionLineEmployee) other); + } + + private boolean equalTo(GeneralLedgerTransactionLineEmployee other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static GeneralLedgerTransactionLineEmployee of(String value) { + return new GeneralLedgerTransactionLineEmployee(value, 0); + } + + public static GeneralLedgerTransactionLineEmployee of(Employee value) { + return new GeneralLedgerTransactionLineEmployee(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employee value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(GeneralLedgerTransactionLineEmployee.class); + } + + @Override + public GeneralLedgerTransactionLineEmployee 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, Employee.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionLineItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionLineItem.java new file mode 100644 index 000000000..f0c3c7ecd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionLineItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = GeneralLedgerTransactionLineItem.Deserializer.class) +public final class GeneralLedgerTransactionLineItem { + private final Object value; + + private final int type; + + private GeneralLedgerTransactionLineItem(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((Item) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GeneralLedgerTransactionLineItem && equalTo((GeneralLedgerTransactionLineItem) other); + } + + private boolean equalTo(GeneralLedgerTransactionLineItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static GeneralLedgerTransactionLineItem of(String value) { + return new GeneralLedgerTransactionLineItem(value, 0); + } + + public static GeneralLedgerTransactionLineItem of(Item value) { + return new GeneralLedgerTransactionLineItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Item value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(GeneralLedgerTransactionLineItem.class); + } + + @Override + public GeneralLedgerTransactionLineItem 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, Item.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionLineTransactionCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionLineTransactionCurrency.java new file mode 100644 index 000000000..793f4317d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionLineTransactionCurrency.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/GeneralLedgerTransactionTrackingCategoriesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionTrackingCategoriesItem.java new file mode 100644 index 000000000..6ea8df531 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionTrackingCategoriesItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = GeneralLedgerTransactionTrackingCategoriesItem.Deserializer.class) +public final class GeneralLedgerTransactionTrackingCategoriesItem { + private final Object value; + + private final int type; + + private GeneralLedgerTransactionTrackingCategoriesItem(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GeneralLedgerTransactionTrackingCategoriesItem + && equalTo((GeneralLedgerTransactionTrackingCategoriesItem) other); + } + + private boolean equalTo(GeneralLedgerTransactionTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static GeneralLedgerTransactionTrackingCategoriesItem of(String value) { + return new GeneralLedgerTransactionTrackingCategoriesItem(value, 0); + } + + public static GeneralLedgerTransactionTrackingCategoriesItem of(TrackingCategory value) { + return new GeneralLedgerTransactionTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(GeneralLedgerTransactionTrackingCategoriesItem.class); + } + + @Override + public GeneralLedgerTransactionTrackingCategoriesItem 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionUnderlyingTransactionType.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionUnderlyingTransactionType.java new file mode 100644 index 000000000..daccc8738 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/GeneralLedgerTransactionUnderlyingTransactionType.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/IncomeStatement.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/IncomeStatement.java new file mode 100644 index 000000000..ad9202fbe --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/IncomeStatement.java @@ -0,0 +1,905 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IncomeStatement.Builder.class) +public final class IncomeStatement { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional currency; + + private final Optional company; + + private final Optional startPeriod; + + private final Optional endPeriod; + + private final Optional> income; + + private final Optional> costOfSales; + + private final Optional grossProfit; + + private final Optional> operatingExpenses; + + private final Optional netOperatingIncome; + + private final Optional> nonOperatingExpenses; + + private final Optional netIncome; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private IncomeStatement( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional currency, + Optional company, + Optional startPeriod, + Optional endPeriod, + Optional> income, + Optional> costOfSales, + Optional grossProfit, + Optional> operatingExpenses, + Optional netOperatingIncome, + Optional> nonOperatingExpenses, + Optional netIncome, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.currency = currency; + this.company = company; + this.startPeriod = startPeriod; + this.endPeriod = endPeriod; + this.income = income; + this.costOfSales = costOfSales; + this.grossProfit = grossProfit; + this.operatingExpenses = operatingExpenses; + this.netOperatingIncome = netOperatingIncome; + this.nonOperatingExpenses = nonOperatingExpenses; + this.netIncome = netIncome; + 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 income statement's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The income statement'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 company the income statement belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The income statement's start period. + */ + @JsonProperty("start_period") + public Optional getStartPeriod() { + return startPeriod; + } + + /** + * @return The income statement's end period. + */ + @JsonProperty("end_period") + public Optional getEndPeriod() { + return endPeriod; + } + + @JsonProperty("income") + public Optional> getIncome() { + return income; + } + + @JsonProperty("cost_of_sales") + public Optional> getCostOfSales() { + return costOfSales; + } + + /** + * @return The revenue minus the cost of sale. + */ + @JsonProperty("gross_profit") + public Optional getGrossProfit() { + return grossProfit; + } + + @JsonProperty("operating_expenses") + public Optional> getOperatingExpenses() { + return operatingExpenses; + } + + /** + * @return The revenue minus the operating expenses. + */ + @JsonProperty("net_operating_income") + public Optional getNetOperatingIncome() { + return netOperatingIncome; + } + + @JsonProperty("non_operating_expenses") + public Optional> getNonOperatingExpenses() { + return nonOperatingExpenses; + } + + /** + * @return The gross profit minus the total expenses. + */ + @JsonProperty("net_income") + public Optional getNetIncome() { + return netIncome; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IncomeStatement && equalTo((IncomeStatement) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IncomeStatement other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && currency.equals(other.currency) + && company.equals(other.company) + && startPeriod.equals(other.startPeriod) + && endPeriod.equals(other.endPeriod) + && income.equals(other.income) + && costOfSales.equals(other.costOfSales) + && grossProfit.equals(other.grossProfit) + && operatingExpenses.equals(other.operatingExpenses) + && netOperatingIncome.equals(other.netOperatingIncome) + && nonOperatingExpenses.equals(other.nonOperatingExpenses) + && netIncome.equals(other.netIncome) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.currency, + this.company, + this.startPeriod, + this.endPeriod, + this.income, + this.costOfSales, + this.grossProfit, + this.operatingExpenses, + this.netOperatingIncome, + this.nonOperatingExpenses, + this.netIncome, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 currency = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional startPeriod = Optional.empty(); + + private Optional endPeriod = Optional.empty(); + + private Optional> income = Optional.empty(); + + private Optional> costOfSales = Optional.empty(); + + private Optional grossProfit = Optional.empty(); + + private Optional> operatingExpenses = Optional.empty(); + + private Optional netOperatingIncome = Optional.empty(); + + private Optional> nonOperatingExpenses = Optional.empty(); + + private Optional netIncome = 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(IncomeStatement other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + currency(other.getCurrency()); + company(other.getCompany()); + startPeriod(other.getStartPeriod()); + endPeriod(other.getEndPeriod()); + income(other.getIncome()); + costOfSales(other.getCostOfSales()); + grossProfit(other.getGrossProfit()); + operatingExpenses(other.getOperatingExpenses()); + netOperatingIncome(other.getNetOperatingIncome()); + nonOperatingExpenses(other.getNonOperatingExpenses()); + netIncome(other.getNetIncome()); + 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 = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(IncomeStatementCurrency 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(IncomeStatementCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "start_period", nulls = Nulls.SKIP) + public Builder startPeriod(Optional startPeriod) { + this.startPeriod = startPeriod; + return this; + } + + public Builder startPeriod(OffsetDateTime startPeriod) { + this.startPeriod = Optional.ofNullable(startPeriod); + return this; + } + + @JsonSetter(value = "end_period", nulls = Nulls.SKIP) + public Builder endPeriod(Optional endPeriod) { + this.endPeriod = endPeriod; + return this; + } + + public Builder endPeriod(OffsetDateTime endPeriod) { + this.endPeriod = Optional.ofNullable(endPeriod); + return this; + } + + @JsonSetter(value = "income", nulls = Nulls.SKIP) + public Builder income(Optional> income) { + this.income = income; + return this; + } + + public Builder income(List income) { + this.income = Optional.ofNullable(income); + return this; + } + + @JsonSetter(value = "cost_of_sales", nulls = Nulls.SKIP) + public Builder costOfSales(Optional> costOfSales) { + this.costOfSales = costOfSales; + return this; + } + + public Builder costOfSales(List costOfSales) { + this.costOfSales = Optional.ofNullable(costOfSales); + return this; + } + + @JsonSetter(value = "gross_profit", nulls = Nulls.SKIP) + public Builder grossProfit(Optional grossProfit) { + this.grossProfit = grossProfit; + return this; + } + + public Builder grossProfit(Double grossProfit) { + this.grossProfit = Optional.ofNullable(grossProfit); + return this; + } + + @JsonSetter(value = "operating_expenses", nulls = Nulls.SKIP) + public Builder operatingExpenses(Optional> operatingExpenses) { + this.operatingExpenses = operatingExpenses; + return this; + } + + public Builder operatingExpenses(List operatingExpenses) { + this.operatingExpenses = Optional.ofNullable(operatingExpenses); + return this; + } + + @JsonSetter(value = "net_operating_income", nulls = Nulls.SKIP) + public Builder netOperatingIncome(Optional netOperatingIncome) { + this.netOperatingIncome = netOperatingIncome; + return this; + } + + public Builder netOperatingIncome(Double netOperatingIncome) { + this.netOperatingIncome = Optional.ofNullable(netOperatingIncome); + return this; + } + + @JsonSetter(value = "non_operating_expenses", nulls = Nulls.SKIP) + public Builder nonOperatingExpenses(Optional> nonOperatingExpenses) { + this.nonOperatingExpenses = nonOperatingExpenses; + return this; + } + + public Builder nonOperatingExpenses(List nonOperatingExpenses) { + this.nonOperatingExpenses = Optional.ofNullable(nonOperatingExpenses); + return this; + } + + @JsonSetter(value = "net_income", nulls = Nulls.SKIP) + public Builder netIncome(Optional netIncome) { + this.netIncome = netIncome; + return this; + } + + public Builder netIncome(Double netIncome) { + this.netIncome = Optional.ofNullable(netIncome); + 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 IncomeStatement build() { + return new IncomeStatement( + id, + remoteId, + createdAt, + modifiedAt, + name, + currency, + company, + startPeriod, + endPeriod, + income, + costOfSales, + grossProfit, + operatingExpenses, + netOperatingIncome, + nonOperatingExpenses, + netIncome, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/IncomeStatementCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/IncomeStatementCompany.java new file mode 100644 index 000000000..aad6b817d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/IncomeStatementCompany.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = IncomeStatementCompany.Deserializer.class) +public final class IncomeStatementCompany { + private final Object value; + + private final int type; + + private IncomeStatementCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IncomeStatementCompany && equalTo((IncomeStatementCompany) other); + } + + private boolean equalTo(IncomeStatementCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static IncomeStatementCompany of(String value) { + return new IncomeStatementCompany(value, 0); + } + + public static IncomeStatementCompany of(CompanyInfo value) { + return new IncomeStatementCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(IncomeStatementCompany.class); + } + + @Override + public IncomeStatementCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/IncomeStatementCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/IncomeStatementCurrency.java new file mode 100644 index 000000000..d8b1afa89 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/IncomeStatementCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/IndividualCommonModelScopeDeserializer.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/IndividualCommonModelScopeDeserializer.java new file mode 100644 index 000000000..28b9e7bf5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/IndividualCommonModelScopeDeserializer.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @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() {} + + @Override + public Builder from(IndividualCommonModelScopeDeserializer other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @Override + public _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions(Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @Override + public IndividualCommonModelScopeDeserializer build() { + return new IndividualCommonModelScopeDeserializer( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/IndividualCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/IndividualCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..4d19bc647 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/IndividualCommonModelScopeDeserializerRequest.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @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() {} + + @Override + public Builder from(IndividualCommonModelScopeDeserializerRequest other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @Override + public _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions( + Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @Override + public IndividualCommonModelScopeDeserializerRequest build() { + return new IndividualCommonModelScopeDeserializerRequest( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/Invoice.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/Invoice.java new file mode 100644 index 000000000..946970cd6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/Invoice.java @@ -0,0 +1,1381 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Invoice.Builder.class) +public final class Invoice { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional type; + + private final Optional contact; + + private final Optional number; + + private final Optional issueDate; + + private final Optional dueDate; + + private final Optional paidOnDate; + + private final Optional memo; + + private final Optional company; + + private final Optional employee; + + private final Optional currency; + + private final Optional exchangeRate; + + private final Optional totalDiscount; + + private final Optional subTotal; + + private final Optional status; + + private final Optional totalTaxAmount; + + private final Optional totalAmount; + + private final Optional balance; + + private final Optional remoteUpdatedAt; + + private final Optional>> trackingCategories; + + private final Optional accountingPeriod; + + private final Optional>> purchaseOrders; + + private final Optional>> payments; + + private final Optional>> appliedPayments; + + private final Optional> lineItems; + + private final Optional> appliedCreditNotes; + + private final Optional> appliedVendorCredits; + + private final Optional inclusiveOfTax; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private Invoice( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional type, + Optional contact, + Optional number, + Optional issueDate, + Optional dueDate, + Optional paidOnDate, + Optional memo, + Optional company, + Optional employee, + Optional currency, + Optional exchangeRate, + Optional totalDiscount, + Optional subTotal, + Optional status, + Optional totalTaxAmount, + Optional totalAmount, + Optional balance, + Optional remoteUpdatedAt, + Optional>> trackingCategories, + Optional accountingPeriod, + Optional>> purchaseOrders, + Optional>> payments, + Optional>> appliedPayments, + Optional> lineItems, + Optional> appliedCreditNotes, + Optional> appliedVendorCredits, + Optional inclusiveOfTax, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Optional> remoteFields, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.type = type; + this.contact = contact; + this.number = number; + this.issueDate = issueDate; + this.dueDate = dueDate; + this.paidOnDate = paidOnDate; + this.memo = memo; + this.company = company; + this.employee = employee; + this.currency = currency; + this.exchangeRate = exchangeRate; + this.totalDiscount = totalDiscount; + this.subTotal = subTotal; + this.status = status; + this.totalTaxAmount = totalTaxAmount; + this.totalAmount = totalAmount; + this.balance = balance; + this.remoteUpdatedAt = remoteUpdatedAt; + this.trackingCategories = trackingCategories; + this.accountingPeriod = accountingPeriod; + this.purchaseOrders = purchaseOrders; + this.payments = payments; + this.appliedPayments = appliedPayments; + this.lineItems = lineItems; + this.appliedCreditNotes = appliedCreditNotes; + this.appliedVendorCredits = appliedVendorCredits; + this.inclusiveOfTax = inclusiveOfTax; + 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 Whether the invoice is an accounts receivable or accounts payable. If type is ACCOUNTS_PAYABLE, the invoice is a bill. If type is ACCOUNTS_RECEIVABLE, it is an invoice. + *
    + *
  • ACCOUNTS_RECEIVABLE - ACCOUNTS_RECEIVABLE
  • + *
  • ACCOUNTS_PAYABLE - ACCOUNTS_PAYABLE
  • + *
+ */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return The invoice's contact. + */ + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + + /** + * @return The invoice's number. + */ + @JsonProperty("number") + public Optional getNumber() { + return number; + } + + /** + * @return The invoice's issue date. + */ + @JsonProperty("issue_date") + public Optional getIssueDate() { + return issueDate; + } + + /** + * @return The invoice's due date. + */ + @JsonProperty("due_date") + public Optional getDueDate() { + return dueDate; + } + + /** + * @return The invoice's paid date. + */ + @JsonProperty("paid_on_date") + public Optional getPaidOnDate() { + return paidOnDate; + } + + /** + * @return The invoice's private note. + */ + @JsonProperty("memo") + public Optional getMemo() { + return memo; + } + + /** + * @return The company the invoice belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The employee this overall transaction relates to. + */ + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + /** + * @return The invoice'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 invoice's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return The total discounts applied to the total cost. + */ + @JsonProperty("total_discount") + public Optional getTotalDiscount() { + return totalDiscount; + } + + /** + * @return The total amount being paid before taxes. + */ + @JsonProperty("sub_total") + public Optional getSubTotal() { + return subTotal; + } + + /** + * @return The status of the invoice. + *
    + *
  • PAID - PAID
  • + *
  • DRAFT - DRAFT
  • + *
  • SUBMITTED - SUBMITTED
  • + *
  • PARTIALLY_PAID - PARTIALLY_PAID
  • + *
  • OPEN - OPEN
  • + *
  • VOID - VOID
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The total amount being paid in taxes. + */ + @JsonProperty("total_tax_amount") + public Optional getTotalTaxAmount() { + return totalTaxAmount; + } + + /** + * @return The invoice's total amount. + */ + @JsonProperty("total_amount") + public Optional getTotalAmount() { + return totalAmount; + } + + /** + * @return The invoice's remaining balance. + */ + @JsonProperty("balance") + public Optional getBalance() { + return balance; + } + + /** + * @return When the third party's invoice entry was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The accounting period that the Invoice was generated in. + */ + @JsonProperty("accounting_period") + public Optional getAccountingPeriod() { + return accountingPeriod; + } + + @JsonProperty("purchase_orders") + public Optional>> getPurchaseOrders() { + return purchaseOrders; + } + + /** + * @return Array of Payment object IDs. + */ + @JsonProperty("payments") + public Optional>> getPayments() { + return payments; + } + + /** + * @return A list of the Payment Applied to Lines common models related to a given Invoice, Credit Note, or Journal Entry. + */ + @JsonProperty("applied_payments") + public Optional>> getAppliedPayments() { + return appliedPayments; + } + + @JsonProperty("line_items") + public Optional> getLineItems() { + return lineItems; + } + + /** + * @return CreditNoteApplyLines applied to the Invoice. + */ + @JsonProperty("applied_credit_notes") + public Optional> getAppliedCreditNotes() { + return appliedCreditNotes; + } + + /** + * @return VendorCreditApplyLines applied to the Invoice. + */ + @JsonProperty("applied_vendor_credits") + public Optional> getAppliedVendorCredits() { + return appliedVendorCredits; + } + + /** + * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. + */ + @JsonProperty("inclusive_of_tax") + public Optional getInclusiveOfTax() { + return inclusiveOfTax; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Invoice && equalTo((Invoice) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Invoice other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && type.equals(other.type) + && contact.equals(other.contact) + && number.equals(other.number) + && issueDate.equals(other.issueDate) + && dueDate.equals(other.dueDate) + && paidOnDate.equals(other.paidOnDate) + && memo.equals(other.memo) + && company.equals(other.company) + && employee.equals(other.employee) + && currency.equals(other.currency) + && exchangeRate.equals(other.exchangeRate) + && totalDiscount.equals(other.totalDiscount) + && subTotal.equals(other.subTotal) + && status.equals(other.status) + && totalTaxAmount.equals(other.totalTaxAmount) + && totalAmount.equals(other.totalAmount) + && balance.equals(other.balance) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && trackingCategories.equals(other.trackingCategories) + && accountingPeriod.equals(other.accountingPeriod) + && purchaseOrders.equals(other.purchaseOrders) + && payments.equals(other.payments) + && appliedPayments.equals(other.appliedPayments) + && lineItems.equals(other.lineItems) + && appliedCreditNotes.equals(other.appliedCreditNotes) + && appliedVendorCredits.equals(other.appliedVendorCredits) + && inclusiveOfTax.equals(other.inclusiveOfTax) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.type, + this.contact, + this.number, + this.issueDate, + this.dueDate, + this.paidOnDate, + this.memo, + this.company, + this.employee, + this.currency, + this.exchangeRate, + this.totalDiscount, + this.subTotal, + this.status, + this.totalTaxAmount, + this.totalAmount, + this.balance, + this.remoteUpdatedAt, + this.trackingCategories, + this.accountingPeriod, + this.purchaseOrders, + this.payments, + this.appliedPayments, + this.lineItems, + this.appliedCreditNotes, + this.appliedVendorCredits, + this.inclusiveOfTax, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData, + this.remoteFields); + } + + @Override + 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 type = Optional.empty(); + + private Optional contact = Optional.empty(); + + private Optional number = Optional.empty(); + + private Optional issueDate = Optional.empty(); + + private Optional dueDate = Optional.empty(); + + private Optional paidOnDate = Optional.empty(); + + private Optional memo = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional employee = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional totalDiscount = Optional.empty(); + + private Optional subTotal = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional totalTaxAmount = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Optional balance = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional accountingPeriod = Optional.empty(); + + private Optional>> purchaseOrders = Optional.empty(); + + private Optional>> payments = Optional.empty(); + + private Optional>> appliedPayments = Optional.empty(); + + private Optional> lineItems = Optional.empty(); + + private Optional> appliedCreditNotes = Optional.empty(); + + private Optional> appliedVendorCredits = Optional.empty(); + + private Optional inclusiveOfTax = 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(Invoice other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + type(other.getType()); + contact(other.getContact()); + number(other.getNumber()); + issueDate(other.getIssueDate()); + dueDate(other.getDueDate()); + paidOnDate(other.getPaidOnDate()); + memo(other.getMemo()); + company(other.getCompany()); + employee(other.getEmployee()); + currency(other.getCurrency()); + exchangeRate(other.getExchangeRate()); + totalDiscount(other.getTotalDiscount()); + subTotal(other.getSubTotal()); + status(other.getStatus()); + totalTaxAmount(other.getTotalTaxAmount()); + totalAmount(other.getTotalAmount()); + balance(other.getBalance()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + trackingCategories(other.getTrackingCategories()); + accountingPeriod(other.getAccountingPeriod()); + purchaseOrders(other.getPurchaseOrders()); + payments(other.getPayments()); + appliedPayments(other.getAppliedPayments()); + lineItems(other.getLineItems()); + appliedCreditNotes(other.getAppliedCreditNotes()); + appliedVendorCredits(other.getAppliedVendorCredits()); + inclusiveOfTax(other.getInclusiveOfTax()); + 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 = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(InvoiceType type) { + this.type = Optional.ofNullable(type); + return this; + } + + @JsonSetter(value = "contact", nulls = Nulls.SKIP) + public Builder contact(Optional contact) { + this.contact = contact; + return this; + } + + public Builder contact(InvoiceContact contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "number", nulls = Nulls.SKIP) + public Builder number(Optional number) { + this.number = number; + return this; + } + + public Builder number(String number) { + this.number = Optional.ofNullable(number); + return this; + } + + @JsonSetter(value = "issue_date", nulls = Nulls.SKIP) + public Builder issueDate(Optional issueDate) { + this.issueDate = issueDate; + return this; + } + + public Builder issueDate(OffsetDateTime issueDate) { + this.issueDate = Optional.ofNullable(issueDate); + return this; + } + + @JsonSetter(value = "due_date", nulls = Nulls.SKIP) + public Builder dueDate(Optional dueDate) { + this.dueDate = dueDate; + return this; + } + + public Builder dueDate(OffsetDateTime dueDate) { + this.dueDate = Optional.ofNullable(dueDate); + return this; + } + + @JsonSetter(value = "paid_on_date", nulls = Nulls.SKIP) + public Builder paidOnDate(Optional paidOnDate) { + this.paidOnDate = paidOnDate; + return this; + } + + public Builder paidOnDate(OffsetDateTime paidOnDate) { + this.paidOnDate = Optional.ofNullable(paidOnDate); + return this; + } + + @JsonSetter(value = "memo", nulls = Nulls.SKIP) + public Builder memo(Optional memo) { + this.memo = memo; + return this; + } + + public Builder memo(String memo) { + this.memo = Optional.ofNullable(memo); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(InvoiceCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "employee", nulls = Nulls.SKIP) + public Builder employee(Optional employee) { + this.employee = employee; + return this; + } + + public Builder employee(InvoiceEmployee employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(InvoiceCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + @JsonSetter(value = "total_discount", nulls = Nulls.SKIP) + public Builder totalDiscount(Optional totalDiscount) { + this.totalDiscount = totalDiscount; + return this; + } + + public Builder totalDiscount(Double totalDiscount) { + this.totalDiscount = Optional.ofNullable(totalDiscount); + return this; + } + + @JsonSetter(value = "sub_total", nulls = Nulls.SKIP) + public Builder subTotal(Optional subTotal) { + this.subTotal = subTotal; + return this; + } + + public Builder subTotal(Double subTotal) { + this.subTotal = Optional.ofNullable(subTotal); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(InvoiceStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "total_tax_amount", nulls = Nulls.SKIP) + public Builder totalTaxAmount(Optional totalTaxAmount) { + this.totalTaxAmount = totalTaxAmount; + return this; + } + + public Builder totalTaxAmount(Double totalTaxAmount) { + this.totalTaxAmount = Optional.ofNullable(totalTaxAmount); + return this; + } + + @JsonSetter(value = "total_amount", nulls = Nulls.SKIP) + public Builder totalAmount(Optional totalAmount) { + this.totalAmount = totalAmount; + return this; + } + + public Builder totalAmount(Double totalAmount) { + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + @JsonSetter(value = "balance", nulls = Nulls.SKIP) + public Builder balance(Optional balance) { + this.balance = balance; + return this; + } + + public Builder balance(Double balance) { + this.balance = Optional.ofNullable(balance); + 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 = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories(Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + @JsonSetter(value = "accounting_period", nulls = Nulls.SKIP) + public Builder accountingPeriod(Optional accountingPeriod) { + this.accountingPeriod = accountingPeriod; + return this; + } + + public Builder accountingPeriod(InvoiceAccountingPeriod accountingPeriod) { + this.accountingPeriod = Optional.ofNullable(accountingPeriod); + return this; + } + + @JsonSetter(value = "purchase_orders", nulls = Nulls.SKIP) + public Builder purchaseOrders(Optional>> purchaseOrders) { + this.purchaseOrders = purchaseOrders; + return this; + } + + public Builder purchaseOrders(List> purchaseOrders) { + this.purchaseOrders = Optional.ofNullable(purchaseOrders); + return this; + } + + @JsonSetter(value = "payments", nulls = Nulls.SKIP) + public Builder payments(Optional>> payments) { + this.payments = payments; + return this; + } + + public Builder payments(List> payments) { + this.payments = Optional.ofNullable(payments); + return this; + } + + @JsonSetter(value = "applied_payments", nulls = Nulls.SKIP) + public Builder appliedPayments(Optional>> appliedPayments) { + this.appliedPayments = appliedPayments; + return this; + } + + public Builder appliedPayments(List> appliedPayments) { + this.appliedPayments = Optional.ofNullable(appliedPayments); + return this; + } + + @JsonSetter(value = "line_items", nulls = Nulls.SKIP) + public Builder lineItems(Optional> lineItems) { + this.lineItems = lineItems; + return this; + } + + public Builder lineItems(List lineItems) { + this.lineItems = Optional.ofNullable(lineItems); + return this; + } + + @JsonSetter(value = "applied_credit_notes", nulls = Nulls.SKIP) + public Builder appliedCreditNotes(Optional> appliedCreditNotes) { + this.appliedCreditNotes = appliedCreditNotes; + return this; + } + + public Builder appliedCreditNotes(List appliedCreditNotes) { + this.appliedCreditNotes = Optional.ofNullable(appliedCreditNotes); + return this; + } + + @JsonSetter(value = "applied_vendor_credits", nulls = Nulls.SKIP) + public Builder appliedVendorCredits(Optional> appliedVendorCredits) { + this.appliedVendorCredits = appliedVendorCredits; + return this; + } + + public Builder appliedVendorCredits(List appliedVendorCredits) { + this.appliedVendorCredits = Optional.ofNullable(appliedVendorCredits); + return this; + } + + @JsonSetter(value = "inclusive_of_tax", nulls = Nulls.SKIP) + public Builder inclusiveOfTax(Optional inclusiveOfTax) { + this.inclusiveOfTax = inclusiveOfTax; + return this; + } + + public Builder inclusiveOfTax(Boolean inclusiveOfTax) { + this.inclusiveOfTax = Optional.ofNullable(inclusiveOfTax); + 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 Invoice build() { + return new Invoice( + id, + remoteId, + createdAt, + modifiedAt, + type, + contact, + number, + issueDate, + dueDate, + paidOnDate, + memo, + company, + employee, + currency, + exchangeRate, + totalDiscount, + subTotal, + status, + totalTaxAmount, + totalAmount, + balance, + remoteUpdatedAt, + trackingCategories, + accountingPeriod, + purchaseOrders, + payments, + appliedPayments, + lineItems, + appliedCreditNotes, + appliedVendorCredits, + inclusiveOfTax, + remoteWasDeleted, + fieldMappings, + remoteData, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceAccountingPeriod.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceAccountingPeriod.java new file mode 100644 index 000000000..55c6eaeb9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceAccountingPeriod.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceAccountingPeriod.Deserializer.class) +public final class InvoiceAccountingPeriod { + private final Object value; + + private final int type; + + private InvoiceAccountingPeriod(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((AccountingPeriod) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceAccountingPeriod && equalTo((InvoiceAccountingPeriod) other); + } + + private boolean equalTo(InvoiceAccountingPeriod other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceAccountingPeriod of(String value) { + return new InvoiceAccountingPeriod(value, 0); + } + + public static InvoiceAccountingPeriod of(AccountingPeriod value) { + return new InvoiceAccountingPeriod(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(AccountingPeriod value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceAccountingPeriod.class); + } + + @Override + public InvoiceAccountingPeriod 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, AccountingPeriod.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceAppliedCreditNotesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceAppliedCreditNotesItem.java new file mode 100644 index 000000000..08c897632 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceAppliedCreditNotesItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceAppliedCreditNotesItem.Deserializer.class) +public final class InvoiceAppliedCreditNotesItem { + private final Object value; + + private final int type; + + private InvoiceAppliedCreditNotesItem(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((CreditNoteApplyLineForInvoice) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceAppliedCreditNotesItem && equalTo((InvoiceAppliedCreditNotesItem) other); + } + + private boolean equalTo(InvoiceAppliedCreditNotesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceAppliedCreditNotesItem of(String value) { + return new InvoiceAppliedCreditNotesItem(value, 0); + } + + public static InvoiceAppliedCreditNotesItem of(CreditNoteApplyLineForInvoice value) { + return new InvoiceAppliedCreditNotesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CreditNoteApplyLineForInvoice value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceAppliedCreditNotesItem.class); + } + + @Override + public InvoiceAppliedCreditNotesItem 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, CreditNoteApplyLineForInvoice.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceAppliedPaymentsItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceAppliedPaymentsItem.java new file mode 100644 index 000000000..167b8efc4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceAppliedPaymentsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceAppliedPaymentsItem.Deserializer.class) +public final class InvoiceAppliedPaymentsItem { + private final Object value; + + private final int type; + + private InvoiceAppliedPaymentsItem(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((PaymentLineItem) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceAppliedPaymentsItem && equalTo((InvoiceAppliedPaymentsItem) other); + } + + private boolean equalTo(InvoiceAppliedPaymentsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceAppliedPaymentsItem of(String value) { + return new InvoiceAppliedPaymentsItem(value, 0); + } + + public static InvoiceAppliedPaymentsItem of(PaymentLineItem value) { + return new InvoiceAppliedPaymentsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PaymentLineItem value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceAppliedPaymentsItem.class); + } + + @Override + public InvoiceAppliedPaymentsItem 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, PaymentLineItem.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceAppliedVendorCreditsItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceAppliedVendorCreditsItem.java new file mode 100644 index 000000000..145bba2e9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceAppliedVendorCreditsItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceAppliedVendorCreditsItem.Deserializer.class) +public final class InvoiceAppliedVendorCreditsItem { + private final Object value; + + private final int type; + + private InvoiceAppliedVendorCreditsItem(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((VendorCreditApplyLineForInvoice) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceAppliedVendorCreditsItem && equalTo((InvoiceAppliedVendorCreditsItem) other); + } + + private boolean equalTo(InvoiceAppliedVendorCreditsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceAppliedVendorCreditsItem of(String value) { + return new InvoiceAppliedVendorCreditsItem(value, 0); + } + + public static InvoiceAppliedVendorCreditsItem of(VendorCreditApplyLineForInvoice value) { + return new InvoiceAppliedVendorCreditsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(VendorCreditApplyLineForInvoice value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceAppliedVendorCreditsItem.class); + } + + @Override + public InvoiceAppliedVendorCreditsItem 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, VendorCreditApplyLineForInvoice.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceCompany.java new file mode 100644 index 000000000..08d5ed759 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceCompany.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceCompany.Deserializer.class) +public final class InvoiceCompany { + private final Object value; + + private final int type; + + private InvoiceCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceCompany && equalTo((InvoiceCompany) other); + } + + private boolean equalTo(InvoiceCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceCompany of(String value) { + return new InvoiceCompany(value, 0); + } + + public static InvoiceCompany of(CompanyInfo value) { + return new InvoiceCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceCompany.class); + } + + @Override + public InvoiceCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceContact.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceContact.java new file mode 100644 index 000000000..304012ab1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceContact.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceContact.Deserializer.class) +public final class InvoiceContact { + private final Object value; + + private final int type; + + private InvoiceContact(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceContact && equalTo((InvoiceContact) other); + } + + private boolean equalTo(InvoiceContact other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceContact of(String value) { + return new InvoiceContact(value, 0); + } + + public static InvoiceContact of(Contact value) { + return new InvoiceContact(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceContact.class); + } + + @Override + public InvoiceContact 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceCurrency.java new file mode 100644 index 000000000..a75e9b92c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/InvoiceEmployee.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceEmployee.java new file mode 100644 index 000000000..71b225557 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceEmployee.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceEmployee.Deserializer.class) +public final class InvoiceEmployee { + private final Object value; + + private final int type; + + private InvoiceEmployee(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((Employee) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceEmployee && equalTo((InvoiceEmployee) other); + } + + private boolean equalTo(InvoiceEmployee other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceEmployee of(String value) { + return new InvoiceEmployee(value, 0); + } + + public static InvoiceEmployee of(Employee value) { + return new InvoiceEmployee(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employee value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceEmployee.class); + } + + @Override + public InvoiceEmployee 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, Employee.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItem.java new file mode 100644 index 000000000..1b6a2fc31 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItem.java @@ -0,0 +1,938 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = InvoiceLineItem.Builder.class) +public final class InvoiceLineItem { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional description; + + private final Optional unitPrice; + + private final Optional quantity; + + private final Optional totalAmount; + + private final Optional employee; + + private final Optional currency; + + private final Optional exchangeRate; + + private final Optional item; + + private final Optional account; + + private final Optional taxRate; + + private final Optional trackingCategory; + + private final Optional>> trackingCategories; + + private final Optional company; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private InvoiceLineItem( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional description, + Optional unitPrice, + Optional quantity, + Optional totalAmount, + Optional employee, + Optional currency, + Optional exchangeRate, + Optional item, + Optional account, + Optional taxRate, + Optional trackingCategory, + Optional>> trackingCategories, + Optional company, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteFields, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.description = description; + this.unitPrice = unitPrice; + this.quantity = quantity; + this.totalAmount = totalAmount; + this.employee = employee; + this.currency = currency; + this.exchangeRate = exchangeRate; + this.item = item; + this.account = account; + this.taxRate = taxRate; + this.trackingCategory = trackingCategory; + this.trackingCategories = trackingCategories; + this.company = company; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + 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 line item's description. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The line item's unit price. + */ + @JsonProperty("unit_price") + public Optional getUnitPrice() { + return unitPrice; + } + + /** + * @return The line item's quantity. + */ + @JsonProperty("quantity") + public Optional getQuantity() { + return quantity; + } + + /** + * @return The line item's total amount. + */ + @JsonProperty("total_amount") + public Optional getTotalAmount() { + return totalAmount; + } + + /** + * @return The employee this overall transaction relates to. + */ + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + /** + * @return The line item'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 line item's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + @JsonProperty("item") + public Optional getItem() { + return item; + } + + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The tax rate that applies to this line item. + */ + @JsonProperty("tax_rate") + public Optional getTaxRate() { + return taxRate; + } + + @JsonProperty("tracking_category") + public Optional getTrackingCategory() { + return trackingCategory; + } + + /** + * @return The invoice line item's associated tracking categories. + */ + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The company the invoice 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_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceLineItem && equalTo((InvoiceLineItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(InvoiceLineItem other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && description.equals(other.description) + && unitPrice.equals(other.unitPrice) + && quantity.equals(other.quantity) + && totalAmount.equals(other.totalAmount) + && employee.equals(other.employee) + && currency.equals(other.currency) + && exchangeRate.equals(other.exchangeRate) + && item.equals(other.item) + && account.equals(other.account) + && taxRate.equals(other.taxRate) + && trackingCategory.equals(other.trackingCategory) + && trackingCategories.equals(other.trackingCategories) + && company.equals(other.company) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.description, + this.unitPrice, + this.quantity, + this.totalAmount, + this.employee, + this.currency, + this.exchangeRate, + this.item, + this.account, + this.taxRate, + this.trackingCategory, + this.trackingCategories, + this.company, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteFields); + } + + @Override + 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 description = Optional.empty(); + + private Optional unitPrice = Optional.empty(); + + private Optional quantity = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Optional employee = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional item = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional taxRate = Optional.empty(); + + private Optional trackingCategory = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(InvoiceLineItem other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + description(other.getDescription()); + unitPrice(other.getUnitPrice()); + quantity(other.getQuantity()); + totalAmount(other.getTotalAmount()); + employee(other.getEmployee()); + currency(other.getCurrency()); + exchangeRate(other.getExchangeRate()); + item(other.getItem()); + account(other.getAccount()); + taxRate(other.getTaxRate()); + trackingCategory(other.getTrackingCategory()); + trackingCategories(other.getTrackingCategories()); + company(other.getCompany()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + 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 = "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 = "unit_price", nulls = Nulls.SKIP) + public Builder unitPrice(Optional unitPrice) { + this.unitPrice = unitPrice; + return this; + } + + public Builder unitPrice(Double unitPrice) { + this.unitPrice = Optional.ofNullable(unitPrice); + return this; + } + + @JsonSetter(value = "quantity", nulls = Nulls.SKIP) + public Builder quantity(Optional quantity) { + this.quantity = quantity; + return this; + } + + public Builder quantity(Double quantity) { + this.quantity = Optional.ofNullable(quantity); + return this; + } + + @JsonSetter(value = "total_amount", nulls = Nulls.SKIP) + public Builder totalAmount(Optional totalAmount) { + this.totalAmount = totalAmount; + return this; + } + + public Builder totalAmount(Double totalAmount) { + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + @JsonSetter(value = "employee", nulls = Nulls.SKIP) + public Builder employee(Optional employee) { + this.employee = employee; + return this; + } + + public Builder employee(InvoiceLineItemEmployee employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(InvoiceLineItemCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + @JsonSetter(value = "item", nulls = Nulls.SKIP) + public Builder item(Optional item) { + this.item = item; + return this; + } + + public Builder item(InvoiceLineItemItem item) { + this.item = Optional.ofNullable(item); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(InvoiceLineItemAccount account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "tax_rate", nulls = Nulls.SKIP) + public Builder taxRate(Optional taxRate) { + this.taxRate = taxRate; + return this; + } + + public Builder taxRate(String taxRate) { + this.taxRate = Optional.ofNullable(taxRate); + return this; + } + + @JsonSetter(value = "tracking_category", nulls = Nulls.SKIP) + public Builder trackingCategory(Optional trackingCategory) { + this.trackingCategory = trackingCategory; + return this; + } + + public Builder trackingCategory(InvoiceLineItemTrackingCategory trackingCategory) { + this.trackingCategory = Optional.ofNullable(trackingCategory); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + 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_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 InvoiceLineItem build() { + return new InvoiceLineItem( + id, + remoteId, + createdAt, + modifiedAt, + description, + unitPrice, + quantity, + totalAmount, + employee, + currency, + exchangeRate, + item, + account, + taxRate, + trackingCategory, + trackingCategories, + company, + remoteWasDeleted, + fieldMappings, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemAccount.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemAccount.java new file mode 100644 index 000000000..5baf0afd2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceLineItemAccount.Deserializer.class) +public final class InvoiceLineItemAccount { + private final Object value; + + private final int type; + + private InvoiceLineItemAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceLineItemAccount && equalTo((InvoiceLineItemAccount) other); + } + + private boolean equalTo(InvoiceLineItemAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceLineItemAccount of(String value) { + return new InvoiceLineItemAccount(value, 0); + } + + public static InvoiceLineItemAccount of(Account value) { + return new InvoiceLineItemAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceLineItemAccount.class); + } + + @Override + public InvoiceLineItemAccount 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/legacy/api/resources/accounting/types/InvoiceLineItemCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemCurrency.java new file mode 100644 index 000000000..9f537fbcf --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/InvoiceLineItemEmployee.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemEmployee.java new file mode 100644 index 000000000..c058dd609 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemEmployee.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceLineItemEmployee.Deserializer.class) +public final class InvoiceLineItemEmployee { + private final Object value; + + private final int type; + + private InvoiceLineItemEmployee(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((Employee) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceLineItemEmployee && equalTo((InvoiceLineItemEmployee) other); + } + + private boolean equalTo(InvoiceLineItemEmployee other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceLineItemEmployee of(String value) { + return new InvoiceLineItemEmployee(value, 0); + } + + public static InvoiceLineItemEmployee of(Employee value) { + return new InvoiceLineItemEmployee(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employee value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceLineItemEmployee.class); + } + + @Override + public InvoiceLineItemEmployee 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, Employee.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemItem.java new file mode 100644 index 000000000..a8641486c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceLineItemItem.Deserializer.class) +public final class InvoiceLineItemItem { + private final Object value; + + private final int type; + + private InvoiceLineItemItem(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((Item) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceLineItemItem && equalTo((InvoiceLineItemItem) other); + } + + private boolean equalTo(InvoiceLineItemItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceLineItemItem of(String value) { + return new InvoiceLineItemItem(value, 0); + } + + public static InvoiceLineItemItem of(Item value) { + return new InvoiceLineItemItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Item value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceLineItemItem.class); + } + + @Override + public InvoiceLineItemItem 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, Item.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemRequest.java new file mode 100644 index 000000000..4d51558d9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemRequest.java @@ -0,0 +1,852 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = InvoiceLineItemRequest.Builder.class) +public final class InvoiceLineItemRequest { + private final Optional remoteId; + + private final Optional description; + + private final Optional unitPrice; + + private final Optional quantity; + + private final Optional totalAmount; + + private final Optional employee; + + private final Optional currency; + + private final Optional exchangeRate; + + private final Optional item; + + private final Optional account; + + private final Optional taxRate; + + private final Optional trackingCategory; + + private final Optional>> trackingCategories; + + private final Optional company; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private InvoiceLineItemRequest( + Optional remoteId, + Optional description, + Optional unitPrice, + Optional quantity, + Optional totalAmount, + Optional employee, + Optional currency, + Optional exchangeRate, + Optional item, + Optional account, + Optional taxRate, + Optional trackingCategory, + Optional>> trackingCategories, + Optional company, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.remoteId = remoteId; + this.description = description; + this.unitPrice = unitPrice; + this.quantity = quantity; + this.totalAmount = totalAmount; + this.employee = employee; + this.currency = currency; + this.exchangeRate = exchangeRate; + this.item = item; + this.account = account; + this.taxRate = taxRate; + this.trackingCategory = trackingCategory; + this.trackingCategories = trackingCategories; + this.company = company; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The line item's description. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The line item's unit price. + */ + @JsonProperty("unit_price") + public Optional getUnitPrice() { + return unitPrice; + } + + /** + * @return The line item's quantity. + */ + @JsonProperty("quantity") + public Optional getQuantity() { + return quantity; + } + + /** + * @return The line item's total amount. + */ + @JsonProperty("total_amount") + public Optional getTotalAmount() { + return totalAmount; + } + + /** + * @return The employee this overall transaction relates to. + */ + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + /** + * @return The line item'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 line item's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + @JsonProperty("item") + public Optional getItem() { + return item; + } + + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The tax rate that applies to this line item. + */ + @JsonProperty("tax_rate") + public Optional getTaxRate() { + return taxRate; + } + + @JsonProperty("tracking_category") + public Optional getTrackingCategory() { + return trackingCategory; + } + + /** + * @return The invoice line item's associated tracking categories. + */ + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The company the invoice 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; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceLineItemRequest && equalTo((InvoiceLineItemRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(InvoiceLineItemRequest other) { + return remoteId.equals(other.remoteId) + && description.equals(other.description) + && unitPrice.equals(other.unitPrice) + && quantity.equals(other.quantity) + && totalAmount.equals(other.totalAmount) + && employee.equals(other.employee) + && currency.equals(other.currency) + && exchangeRate.equals(other.exchangeRate) + && item.equals(other.item) + && account.equals(other.account) + && taxRate.equals(other.taxRate) + && trackingCategory.equals(other.trackingCategory) + && trackingCategories.equals(other.trackingCategories) + && company.equals(other.company) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.remoteId, + this.description, + this.unitPrice, + this.quantity, + this.totalAmount, + this.employee, + this.currency, + this.exchangeRate, + this.item, + this.account, + this.taxRate, + this.trackingCategory, + this.trackingCategories, + this.company, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @Override + 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 description = Optional.empty(); + + private Optional unitPrice = Optional.empty(); + + private Optional quantity = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Optional employee = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional item = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional taxRate = Optional.empty(); + + private Optional trackingCategory = Optional.empty(); + + private Optional>> trackingCategories = + Optional.empty(); + + private Optional company = 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(InvoiceLineItemRequest other) { + remoteId(other.getRemoteId()); + description(other.getDescription()); + unitPrice(other.getUnitPrice()); + quantity(other.getQuantity()); + totalAmount(other.getTotalAmount()); + employee(other.getEmployee()); + currency(other.getCurrency()); + exchangeRate(other.getExchangeRate()); + item(other.getItem()); + account(other.getAccount()); + taxRate(other.getTaxRate()); + trackingCategory(other.getTrackingCategory()); + trackingCategories(other.getTrackingCategories()); + company(other.getCompany()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + remoteFields(other.getRemoteFields()); + 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 = "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 = "unit_price", nulls = Nulls.SKIP) + public Builder unitPrice(Optional unitPrice) { + this.unitPrice = unitPrice; + return this; + } + + public Builder unitPrice(Double unitPrice) { + this.unitPrice = Optional.ofNullable(unitPrice); + return this; + } + + @JsonSetter(value = "quantity", nulls = Nulls.SKIP) + public Builder quantity(Optional quantity) { + this.quantity = quantity; + return this; + } + + public Builder quantity(Double quantity) { + this.quantity = Optional.ofNullable(quantity); + return this; + } + + @JsonSetter(value = "total_amount", nulls = Nulls.SKIP) + public Builder totalAmount(Optional totalAmount) { + this.totalAmount = totalAmount; + return this; + } + + public Builder totalAmount(Double totalAmount) { + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + @JsonSetter(value = "employee", nulls = Nulls.SKIP) + public Builder employee(Optional employee) { + this.employee = employee; + return this; + } + + public Builder employee(InvoiceLineItemRequestEmployee employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(InvoiceLineItemRequestCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + @JsonSetter(value = "item", nulls = Nulls.SKIP) + public Builder item(Optional item) { + this.item = item; + return this; + } + + public Builder item(InvoiceLineItemRequestItem item) { + this.item = Optional.ofNullable(item); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(InvoiceLineItemRequestAccount account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "tax_rate", nulls = Nulls.SKIP) + public Builder taxRate(Optional taxRate) { + this.taxRate = taxRate; + return this; + } + + public Builder taxRate(String taxRate) { + this.taxRate = Optional.ofNullable(taxRate); + return this; + } + + @JsonSetter(value = "tracking_category", nulls = Nulls.SKIP) + public Builder trackingCategory(Optional trackingCategory) { + this.trackingCategory = trackingCategory; + return this; + } + + public Builder trackingCategory(InvoiceLineItemRequestTrackingCategory trackingCategory) { + this.trackingCategory = Optional.ofNullable(trackingCategory); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories( + List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + 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; + } + + @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 InvoiceLineItemRequest build() { + return new InvoiceLineItemRequest( + remoteId, + description, + unitPrice, + quantity, + totalAmount, + employee, + currency, + exchangeRate, + item, + account, + taxRate, + trackingCategory, + trackingCategories, + company, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemRequestAccount.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemRequestAccount.java new file mode 100644 index 000000000..9a8779a9e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemRequestAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceLineItemRequestAccount.Deserializer.class) +public final class InvoiceLineItemRequestAccount { + private final Object value; + + private final int type; + + private InvoiceLineItemRequestAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceLineItemRequestAccount && equalTo((InvoiceLineItemRequestAccount) other); + } + + private boolean equalTo(InvoiceLineItemRequestAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceLineItemRequestAccount of(String value) { + return new InvoiceLineItemRequestAccount(value, 0); + } + + public static InvoiceLineItemRequestAccount of(Account value) { + return new InvoiceLineItemRequestAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceLineItemRequestAccount.class); + } + + @Override + public InvoiceLineItemRequestAccount 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/legacy/api/resources/accounting/types/InvoiceLineItemRequestCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemRequestCurrency.java new file mode 100644 index 000000000..4ff97e67c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemRequestCurrency.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/InvoiceLineItemRequestEmployee.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemRequestEmployee.java new file mode 100644 index 000000000..404d09363 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemRequestEmployee.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceLineItemRequestEmployee.Deserializer.class) +public final class InvoiceLineItemRequestEmployee { + private final Object value; + + private final int type; + + private InvoiceLineItemRequestEmployee(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((Employee) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceLineItemRequestEmployee && equalTo((InvoiceLineItemRequestEmployee) other); + } + + private boolean equalTo(InvoiceLineItemRequestEmployee other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceLineItemRequestEmployee of(String value) { + return new InvoiceLineItemRequestEmployee(value, 0); + } + + public static InvoiceLineItemRequestEmployee of(Employee value) { + return new InvoiceLineItemRequestEmployee(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employee value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceLineItemRequestEmployee.class); + } + + @Override + public InvoiceLineItemRequestEmployee 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, Employee.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemRequestItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemRequestItem.java new file mode 100644 index 000000000..b87e14edd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemRequestItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceLineItemRequestItem.Deserializer.class) +public final class InvoiceLineItemRequestItem { + private final Object value; + + private final int type; + + private InvoiceLineItemRequestItem(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((Item) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceLineItemRequestItem && equalTo((InvoiceLineItemRequestItem) other); + } + + private boolean equalTo(InvoiceLineItemRequestItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceLineItemRequestItem of(String value) { + return new InvoiceLineItemRequestItem(value, 0); + } + + public static InvoiceLineItemRequestItem of(Item value) { + return new InvoiceLineItemRequestItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Item value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceLineItemRequestItem.class); + } + + @Override + public InvoiceLineItemRequestItem 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, Item.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemRequestTrackingCategoriesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemRequestTrackingCategoriesItem.java new file mode 100644 index 000000000..6660a2b08 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemRequestTrackingCategoriesItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceLineItemRequestTrackingCategoriesItem.Deserializer.class) +public final class InvoiceLineItemRequestTrackingCategoriesItem { + private final Object value; + + private final int type; + + private InvoiceLineItemRequestTrackingCategoriesItem(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceLineItemRequestTrackingCategoriesItem + && equalTo((InvoiceLineItemRequestTrackingCategoriesItem) other); + } + + private boolean equalTo(InvoiceLineItemRequestTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceLineItemRequestTrackingCategoriesItem of(String value) { + return new InvoiceLineItemRequestTrackingCategoriesItem(value, 0); + } + + public static InvoiceLineItemRequestTrackingCategoriesItem of(TrackingCategory value) { + return new InvoiceLineItemRequestTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceLineItemRequestTrackingCategoriesItem.class); + } + + @Override + public InvoiceLineItemRequestTrackingCategoriesItem 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemRequestTrackingCategory.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemRequestTrackingCategory.java new file mode 100644 index 000000000..fae68ef74 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemRequestTrackingCategory.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceLineItemRequestTrackingCategory.Deserializer.class) +public final class InvoiceLineItemRequestTrackingCategory { + private final Object value; + + private final int type; + + private InvoiceLineItemRequestTrackingCategory(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceLineItemRequestTrackingCategory + && equalTo((InvoiceLineItemRequestTrackingCategory) other); + } + + private boolean equalTo(InvoiceLineItemRequestTrackingCategory other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceLineItemRequestTrackingCategory of(String value) { + return new InvoiceLineItemRequestTrackingCategory(value, 0); + } + + public static InvoiceLineItemRequestTrackingCategory of(TrackingCategory value) { + return new InvoiceLineItemRequestTrackingCategory(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceLineItemRequestTrackingCategory.class); + } + + @Override + public InvoiceLineItemRequestTrackingCategory 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemTrackingCategoriesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemTrackingCategoriesItem.java new file mode 100644 index 000000000..b5a6b5356 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemTrackingCategoriesItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceLineItemTrackingCategoriesItem.Deserializer.class) +public final class InvoiceLineItemTrackingCategoriesItem { + private final Object value; + + private final int type; + + private InvoiceLineItemTrackingCategoriesItem(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceLineItemTrackingCategoriesItem + && equalTo((InvoiceLineItemTrackingCategoriesItem) other); + } + + private boolean equalTo(InvoiceLineItemTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceLineItemTrackingCategoriesItem of(String value) { + return new InvoiceLineItemTrackingCategoriesItem(value, 0); + } + + public static InvoiceLineItemTrackingCategoriesItem of(TrackingCategory value) { + return new InvoiceLineItemTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceLineItemTrackingCategoriesItem.class); + } + + @Override + public InvoiceLineItemTrackingCategoriesItem 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemTrackingCategory.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemTrackingCategory.java new file mode 100644 index 000000000..33bdf80df --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceLineItemTrackingCategory.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceLineItemTrackingCategory.Deserializer.class) +public final class InvoiceLineItemTrackingCategory { + private final Object value; + + private final int type; + + private InvoiceLineItemTrackingCategory(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceLineItemTrackingCategory && equalTo((InvoiceLineItemTrackingCategory) other); + } + + private boolean equalTo(InvoiceLineItemTrackingCategory other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceLineItemTrackingCategory of(String value) { + return new InvoiceLineItemTrackingCategory(value, 0); + } + + public static InvoiceLineItemTrackingCategory of(TrackingCategory value) { + return new InvoiceLineItemTrackingCategory(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceLineItemTrackingCategory.class); + } + + @Override + public InvoiceLineItemTrackingCategory 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoicePaymentsItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoicePaymentsItem.java new file mode 100644 index 000000000..8cb5322d2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoicePaymentsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoicePaymentsItem.Deserializer.class) +public final class InvoicePaymentsItem { + private final Object value; + + private final int type; + + private InvoicePaymentsItem(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((Payment) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoicePaymentsItem && equalTo((InvoicePaymentsItem) other); + } + + private boolean equalTo(InvoicePaymentsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoicePaymentsItem of(String value) { + return new InvoicePaymentsItem(value, 0); + } + + public static InvoicePaymentsItem of(Payment value) { + return new InvoicePaymentsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Payment value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoicePaymentsItem.class); + } + + @Override + public InvoicePaymentsItem 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, Payment.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoicePurchaseOrdersItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoicePurchaseOrdersItem.java new file mode 100644 index 000000000..e93f2ae2b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoicePurchaseOrdersItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoicePurchaseOrdersItem.Deserializer.class) +public final class InvoicePurchaseOrdersItem { + private final Object value; + + private final int type; + + private InvoicePurchaseOrdersItem(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((PurchaseOrder) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoicePurchaseOrdersItem && equalTo((InvoicePurchaseOrdersItem) other); + } + + private boolean equalTo(InvoicePurchaseOrdersItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoicePurchaseOrdersItem of(String value) { + return new InvoicePurchaseOrdersItem(value, 0); + } + + public static InvoicePurchaseOrdersItem of(PurchaseOrder value) { + return new InvoicePurchaseOrdersItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PurchaseOrder value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoicePurchaseOrdersItem.class); + } + + @Override + public InvoicePurchaseOrdersItem 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, PurchaseOrder.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequest.java new file mode 100644 index 000000000..397b9c1e3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequest.java @@ -0,0 +1,1095 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = InvoiceRequest.Builder.class) +public final class InvoiceRequest { + private final Optional type; + + private final Optional contact; + + private final Optional number; + + private final Optional issueDate; + + private final Optional dueDate; + + private final Optional paidOnDate; + + private final Optional employee; + + private final Optional memo; + + private final Optional status; + + private final Optional company; + + private final Optional currency; + + private final Optional exchangeRate; + + private final Optional totalDiscount; + + private final Optional subTotal; + + private final Optional totalTaxAmount; + + private final Optional inclusiveOfTax; + + private final Optional totalAmount; + + private final Optional balance; + + private final Optional>> payments; + + private final Optional>> trackingCategories; + + private final Optional> lineItems; + + private final Optional>> purchaseOrders; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private InvoiceRequest( + Optional type, + Optional contact, + Optional number, + Optional issueDate, + Optional dueDate, + Optional paidOnDate, + Optional employee, + Optional memo, + Optional status, + Optional company, + Optional currency, + Optional exchangeRate, + Optional totalDiscount, + Optional subTotal, + Optional totalTaxAmount, + Optional inclusiveOfTax, + Optional totalAmount, + Optional balance, + Optional>> payments, + Optional>> trackingCategories, + Optional> lineItems, + Optional>> purchaseOrders, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.type = type; + this.contact = contact; + this.number = number; + this.issueDate = issueDate; + this.dueDate = dueDate; + this.paidOnDate = paidOnDate; + this.employee = employee; + this.memo = memo; + this.status = status; + this.company = company; + this.currency = currency; + this.exchangeRate = exchangeRate; + this.totalDiscount = totalDiscount; + this.subTotal = subTotal; + this.totalTaxAmount = totalTaxAmount; + this.inclusiveOfTax = inclusiveOfTax; + this.totalAmount = totalAmount; + this.balance = balance; + this.payments = payments; + this.trackingCategories = trackingCategories; + this.lineItems = lineItems; + this.purchaseOrders = purchaseOrders; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether the invoice is an accounts receivable or accounts payable. If type is ACCOUNTS_PAYABLE, the invoice is a bill. If type is ACCOUNTS_RECEIVABLE, it is an invoice. + *
    + *
  • ACCOUNTS_RECEIVABLE - ACCOUNTS_RECEIVABLE
  • + *
  • ACCOUNTS_PAYABLE - ACCOUNTS_PAYABLE
  • + *
+ */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return The invoice's contact. + */ + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + + /** + * @return The invoice's number. + */ + @JsonProperty("number") + public Optional getNumber() { + return number; + } + + /** + * @return The invoice's issue date. + */ + @JsonProperty("issue_date") + public Optional getIssueDate() { + return issueDate; + } + + /** + * @return The invoice's due date. + */ + @JsonProperty("due_date") + public Optional getDueDate() { + return dueDate; + } + + /** + * @return The invoice's paid date. + */ + @JsonProperty("paid_on_date") + public Optional getPaidOnDate() { + return paidOnDate; + } + + /** + * @return The employee this overall transaction relates to. + */ + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + /** + * @return The invoice's private note. + */ + @JsonProperty("memo") + public Optional getMemo() { + return memo; + } + + /** + * @return The status of the invoice. + *
    + *
  • PAID - PAID
  • + *
  • DRAFT - DRAFT
  • + *
  • SUBMITTED - SUBMITTED
  • + *
  • PARTIALLY_PAID - PARTIALLY_PAID
  • + *
  • OPEN - OPEN
  • + *
  • VOID - VOID
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The company the invoice belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The invoice'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 invoice's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return The total discounts applied to the total cost. + */ + @JsonProperty("total_discount") + public Optional getTotalDiscount() { + return totalDiscount; + } + + /** + * @return The total amount being paid before taxes. + */ + @JsonProperty("sub_total") + public Optional getSubTotal() { + return subTotal; + } + + /** + * @return The total amount being paid in taxes. + */ + @JsonProperty("total_tax_amount") + public Optional getTotalTaxAmount() { + return totalTaxAmount; + } + + /** + * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. + */ + @JsonProperty("inclusive_of_tax") + public Optional getInclusiveOfTax() { + return inclusiveOfTax; + } + + /** + * @return The invoice's total amount. + */ + @JsonProperty("total_amount") + public Optional getTotalAmount() { + return totalAmount; + } + + /** + * @return The invoice's remaining balance. + */ + @JsonProperty("balance") + public Optional getBalance() { + return balance; + } + + /** + * @return Array of Payment object IDs. + */ + @JsonProperty("payments") + public Optional>> getPayments() { + return payments; + } + + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + @JsonProperty("line_items") + public Optional> getLineItems() { + return lineItems; + } + + @JsonProperty("purchase_orders") + public Optional>> getPurchaseOrders() { + return purchaseOrders; + } + + @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceRequest && equalTo((InvoiceRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(InvoiceRequest other) { + return type.equals(other.type) + && contact.equals(other.contact) + && number.equals(other.number) + && issueDate.equals(other.issueDate) + && dueDate.equals(other.dueDate) + && paidOnDate.equals(other.paidOnDate) + && employee.equals(other.employee) + && memo.equals(other.memo) + && status.equals(other.status) + && company.equals(other.company) + && currency.equals(other.currency) + && exchangeRate.equals(other.exchangeRate) + && totalDiscount.equals(other.totalDiscount) + && subTotal.equals(other.subTotal) + && totalTaxAmount.equals(other.totalTaxAmount) + && inclusiveOfTax.equals(other.inclusiveOfTax) + && totalAmount.equals(other.totalAmount) + && balance.equals(other.balance) + && payments.equals(other.payments) + && trackingCategories.equals(other.trackingCategories) + && lineItems.equals(other.lineItems) + && purchaseOrders.equals(other.purchaseOrders) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.type, + this.contact, + this.number, + this.issueDate, + this.dueDate, + this.paidOnDate, + this.employee, + this.memo, + this.status, + this.company, + this.currency, + this.exchangeRate, + this.totalDiscount, + this.subTotal, + this.totalTaxAmount, + this.inclusiveOfTax, + this.totalAmount, + this.balance, + this.payments, + this.trackingCategories, + this.lineItems, + this.purchaseOrders, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @Override + 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 contact = Optional.empty(); + + private Optional number = Optional.empty(); + + private Optional issueDate = Optional.empty(); + + private Optional dueDate = Optional.empty(); + + private Optional paidOnDate = Optional.empty(); + + private Optional employee = Optional.empty(); + + private Optional memo = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional totalDiscount = Optional.empty(); + + private Optional subTotal = Optional.empty(); + + private Optional totalTaxAmount = Optional.empty(); + + private Optional inclusiveOfTax = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Optional balance = Optional.empty(); + + private Optional>> payments = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional> lineItems = Optional.empty(); + + private Optional>> purchaseOrders = 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(InvoiceRequest other) { + type(other.getType()); + contact(other.getContact()); + number(other.getNumber()); + issueDate(other.getIssueDate()); + dueDate(other.getDueDate()); + paidOnDate(other.getPaidOnDate()); + employee(other.getEmployee()); + memo(other.getMemo()); + status(other.getStatus()); + company(other.getCompany()); + currency(other.getCurrency()); + exchangeRate(other.getExchangeRate()); + totalDiscount(other.getTotalDiscount()); + subTotal(other.getSubTotal()); + totalTaxAmount(other.getTotalTaxAmount()); + inclusiveOfTax(other.getInclusiveOfTax()); + totalAmount(other.getTotalAmount()); + balance(other.getBalance()); + payments(other.getPayments()); + trackingCategories(other.getTrackingCategories()); + lineItems(other.getLineItems()); + purchaseOrders(other.getPurchaseOrders()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + remoteFields(other.getRemoteFields()); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(InvoiceRequestType type) { + this.type = Optional.ofNullable(type); + return this; + } + + @JsonSetter(value = "contact", nulls = Nulls.SKIP) + public Builder contact(Optional contact) { + this.contact = contact; + return this; + } + + public Builder contact(InvoiceRequestContact contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "number", nulls = Nulls.SKIP) + public Builder number(Optional number) { + this.number = number; + return this; + } + + public Builder number(String number) { + this.number = Optional.ofNullable(number); + return this; + } + + @JsonSetter(value = "issue_date", nulls = Nulls.SKIP) + public Builder issueDate(Optional issueDate) { + this.issueDate = issueDate; + return this; + } + + public Builder issueDate(OffsetDateTime issueDate) { + this.issueDate = Optional.ofNullable(issueDate); + return this; + } + + @JsonSetter(value = "due_date", nulls = Nulls.SKIP) + public Builder dueDate(Optional dueDate) { + this.dueDate = dueDate; + return this; + } + + public Builder dueDate(OffsetDateTime dueDate) { + this.dueDate = Optional.ofNullable(dueDate); + return this; + } + + @JsonSetter(value = "paid_on_date", nulls = Nulls.SKIP) + public Builder paidOnDate(Optional paidOnDate) { + this.paidOnDate = paidOnDate; + return this; + } + + public Builder paidOnDate(OffsetDateTime paidOnDate) { + this.paidOnDate = Optional.ofNullable(paidOnDate); + return this; + } + + @JsonSetter(value = "employee", nulls = Nulls.SKIP) + public Builder employee(Optional employee) { + this.employee = employee; + return this; + } + + public Builder employee(InvoiceRequestEmployee employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "memo", nulls = Nulls.SKIP) + public Builder memo(Optional memo) { + this.memo = memo; + return this; + } + + public Builder memo(String memo) { + this.memo = Optional.ofNullable(memo); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(InvoiceRequestStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(InvoiceRequestCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(InvoiceRequestCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + @JsonSetter(value = "total_discount", nulls = Nulls.SKIP) + public Builder totalDiscount(Optional totalDiscount) { + this.totalDiscount = totalDiscount; + return this; + } + + public Builder totalDiscount(Double totalDiscount) { + this.totalDiscount = Optional.ofNullable(totalDiscount); + return this; + } + + @JsonSetter(value = "sub_total", nulls = Nulls.SKIP) + public Builder subTotal(Optional subTotal) { + this.subTotal = subTotal; + return this; + } + + public Builder subTotal(Double subTotal) { + this.subTotal = Optional.ofNullable(subTotal); + return this; + } + + @JsonSetter(value = "total_tax_amount", nulls = Nulls.SKIP) + public Builder totalTaxAmount(Optional totalTaxAmount) { + this.totalTaxAmount = totalTaxAmount; + return this; + } + + public Builder totalTaxAmount(Double totalTaxAmount) { + this.totalTaxAmount = Optional.ofNullable(totalTaxAmount); + return this; + } + + @JsonSetter(value = "inclusive_of_tax", nulls = Nulls.SKIP) + public Builder inclusiveOfTax(Optional inclusiveOfTax) { + this.inclusiveOfTax = inclusiveOfTax; + return this; + } + + public Builder inclusiveOfTax(Boolean inclusiveOfTax) { + this.inclusiveOfTax = Optional.ofNullable(inclusiveOfTax); + return this; + } + + @JsonSetter(value = "total_amount", nulls = Nulls.SKIP) + public Builder totalAmount(Optional totalAmount) { + this.totalAmount = totalAmount; + return this; + } + + public Builder totalAmount(Double totalAmount) { + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + @JsonSetter(value = "balance", nulls = Nulls.SKIP) + public Builder balance(Optional balance) { + this.balance = balance; + return this; + } + + public Builder balance(Double balance) { + this.balance = Optional.ofNullable(balance); + return this; + } + + @JsonSetter(value = "payments", nulls = Nulls.SKIP) + public Builder payments(Optional>> payments) { + this.payments = payments; + return this; + } + + public Builder payments(List> payments) { + this.payments = Optional.ofNullable(payments); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + @JsonSetter(value = "line_items", nulls = Nulls.SKIP) + public Builder lineItems(Optional> lineItems) { + this.lineItems = lineItems; + return this; + } + + public Builder lineItems(List lineItems) { + this.lineItems = Optional.ofNullable(lineItems); + return this; + } + + @JsonSetter(value = "purchase_orders", nulls = Nulls.SKIP) + public Builder purchaseOrders(Optional>> purchaseOrders) { + this.purchaseOrders = purchaseOrders; + return this; + } + + public Builder purchaseOrders(List> purchaseOrders) { + this.purchaseOrders = Optional.ofNullable(purchaseOrders); + 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 InvoiceRequest build() { + return new InvoiceRequest( + type, + contact, + number, + issueDate, + dueDate, + paidOnDate, + employee, + memo, + status, + company, + currency, + exchangeRate, + totalDiscount, + subTotal, + totalTaxAmount, + inclusiveOfTax, + totalAmount, + balance, + payments, + trackingCategories, + lineItems, + purchaseOrders, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestCompany.java new file mode 100644 index 000000000..2b30d09ab --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestCompany.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceRequestCompany.Deserializer.class) +public final class InvoiceRequestCompany { + private final Object value; + + private final int type; + + private InvoiceRequestCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceRequestCompany && equalTo((InvoiceRequestCompany) other); + } + + private boolean equalTo(InvoiceRequestCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceRequestCompany of(String value) { + return new InvoiceRequestCompany(value, 0); + } + + public static InvoiceRequestCompany of(CompanyInfo value) { + return new InvoiceRequestCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceRequestCompany.class); + } + + @Override + public InvoiceRequestCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestContact.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestContact.java new file mode 100644 index 000000000..778e98635 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestContact.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceRequestContact.Deserializer.class) +public final class InvoiceRequestContact { + private final Object value; + + private final int type; + + private InvoiceRequestContact(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceRequestContact && equalTo((InvoiceRequestContact) other); + } + + private boolean equalTo(InvoiceRequestContact other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceRequestContact of(String value) { + return new InvoiceRequestContact(value, 0); + } + + public static InvoiceRequestContact of(Contact value) { + return new InvoiceRequestContact(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceRequestContact.class); + } + + @Override + public InvoiceRequestContact 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestCurrency.java new file mode 100644 index 000000000..963c42291 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/InvoiceRequestEmployee.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestEmployee.java new file mode 100644 index 000000000..0bdc52c91 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestEmployee.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceRequestEmployee.Deserializer.class) +public final class InvoiceRequestEmployee { + private final Object value; + + private final int type; + + private InvoiceRequestEmployee(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((Employee) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceRequestEmployee && equalTo((InvoiceRequestEmployee) other); + } + + private boolean equalTo(InvoiceRequestEmployee other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceRequestEmployee of(String value) { + return new InvoiceRequestEmployee(value, 0); + } + + public static InvoiceRequestEmployee of(Employee value) { + return new InvoiceRequestEmployee(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employee value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceRequestEmployee.class); + } + + @Override + public InvoiceRequestEmployee 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, Employee.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestPaymentsItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestPaymentsItem.java new file mode 100644 index 000000000..b2c8cbc6c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestPaymentsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceRequestPaymentsItem.Deserializer.class) +public final class InvoiceRequestPaymentsItem { + private final Object value; + + private final int type; + + private InvoiceRequestPaymentsItem(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((Payment) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceRequestPaymentsItem && equalTo((InvoiceRequestPaymentsItem) other); + } + + private boolean equalTo(InvoiceRequestPaymentsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceRequestPaymentsItem of(String value) { + return new InvoiceRequestPaymentsItem(value, 0); + } + + public static InvoiceRequestPaymentsItem of(Payment value) { + return new InvoiceRequestPaymentsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Payment value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceRequestPaymentsItem.class); + } + + @Override + public InvoiceRequestPaymentsItem 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, Payment.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestPurchaseOrdersItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestPurchaseOrdersItem.java new file mode 100644 index 000000000..25e0cd59c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestPurchaseOrdersItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceRequestPurchaseOrdersItem.Deserializer.class) +public final class InvoiceRequestPurchaseOrdersItem { + private final Object value; + + private final int type; + + private InvoiceRequestPurchaseOrdersItem(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((PurchaseOrder) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceRequestPurchaseOrdersItem && equalTo((InvoiceRequestPurchaseOrdersItem) other); + } + + private boolean equalTo(InvoiceRequestPurchaseOrdersItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceRequestPurchaseOrdersItem of(String value) { + return new InvoiceRequestPurchaseOrdersItem(value, 0); + } + + public static InvoiceRequestPurchaseOrdersItem of(PurchaseOrder value) { + return new InvoiceRequestPurchaseOrdersItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PurchaseOrder value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceRequestPurchaseOrdersItem.class); + } + + @Override + public InvoiceRequestPurchaseOrdersItem 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, PurchaseOrder.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestStatus.java new file mode 100644 index 000000000..e9e496cd7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/InvoiceRequestTrackingCategoriesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestTrackingCategoriesItem.java new file mode 100644 index 000000000..d099bb66b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestTrackingCategoriesItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceRequestTrackingCategoriesItem.Deserializer.class) +public final class InvoiceRequestTrackingCategoriesItem { + private final Object value; + + private final int type; + + private InvoiceRequestTrackingCategoriesItem(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceRequestTrackingCategoriesItem + && equalTo((InvoiceRequestTrackingCategoriesItem) other); + } + + private boolean equalTo(InvoiceRequestTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceRequestTrackingCategoriesItem of(String value) { + return new InvoiceRequestTrackingCategoriesItem(value, 0); + } + + public static InvoiceRequestTrackingCategoriesItem of(TrackingCategory value) { + return new InvoiceRequestTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceRequestTrackingCategoriesItem.class); + } + + @Override + public InvoiceRequestTrackingCategoriesItem 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestType.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestType.java new file mode 100644 index 000000000..1b531e872 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceRequestType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/InvoiceResponse.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceResponse.java new file mode 100644 index 000000000..60a9296c4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = InvoiceResponse.Builder.class) +public final class InvoiceResponse { + private final Invoice model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private InvoiceResponse( + Invoice 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 Invoice getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceResponse && equalTo((InvoiceResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(InvoiceResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull Invoice model); + + Builder from(InvoiceResponse other); + } + + public interface _FinalStage { + InvoiceResponse 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 Invoice model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(InvoiceResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull Invoice model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public InvoiceResponse build() { + return new InvoiceResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceStatus.java new file mode 100644 index 000000000..1d782b5c4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/InvoiceStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceStatusEnum.java new file mode 100644 index 000000000..a0ed7a644 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceStatusEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum InvoiceStatusEnum { + PAID("PAID"), + + DRAFT("DRAFT"), + + SUBMITTED("SUBMITTED"), + + PARTIALLY_PAID("PARTIALLY_PAID"), + + OPEN("OPEN"), + + VOID("VOID"); + + private final String value; + + InvoiceStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceTrackingCategoriesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceTrackingCategoriesItem.java new file mode 100644 index 000000000..62158d21f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceTrackingCategoriesItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceTrackingCategoriesItem.Deserializer.class) +public final class InvoiceTrackingCategoriesItem { + private final Object value; + + private final int type; + + private InvoiceTrackingCategoriesItem(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceTrackingCategoriesItem && equalTo((InvoiceTrackingCategoriesItem) other); + } + + private boolean equalTo(InvoiceTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceTrackingCategoriesItem of(String value) { + return new InvoiceTrackingCategoriesItem(value, 0); + } + + public static InvoiceTrackingCategoriesItem of(TrackingCategory value) { + return new InvoiceTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceTrackingCategoriesItem.class); + } + + @Override + public InvoiceTrackingCategoriesItem 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceType.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceType.java new file mode 100644 index 000000000..c371ef545 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/InvoiceTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceTypeEnum.java new file mode 100644 index 000000000..47f88241e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/InvoiceTypeEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum InvoiceTypeEnum { + ACCOUNTS_RECEIVABLE("ACCOUNTS_RECEIVABLE"), + + ACCOUNTS_PAYABLE("ACCOUNTS_PAYABLE"); + + private final String value; + + InvoiceTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/Issue.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/Issue.java new file mode 100644 index 000000000..dd8ca51da --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/Issue.java @@ -0,0 +1,341 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.status, + this.errorDescription, + this.endUser, + this.firstIncidentTime, + this.lastIncidentTime, + this.isMuted, + this.errorDetails); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("error_description") + public _FinalStage errorDescription(@NotNull String errorDescription) { + this.errorDescription = errorDescription; + return this; + } + + @Override + public _FinalStage errorDetails(List errorDetails) { + this.errorDetails = Optional.ofNullable(errorDetails); + return this; + } + + @Override + @JsonSetter(value = "error_details", nulls = Nulls.SKIP) + public _FinalStage errorDetails(Optional> errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + @Override + public _FinalStage isMuted(Boolean isMuted) { + this.isMuted = Optional.ofNullable(isMuted); + return this; + } + + @Override + @JsonSetter(value = "is_muted", nulls = Nulls.SKIP) + public _FinalStage isMuted(Optional isMuted) { + this.isMuted = isMuted; + return this; + } + + @Override + public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { + this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); + return this; + } + + @Override + @JsonSetter(value = "last_incident_time", nulls = Nulls.SKIP) + public _FinalStage lastIncidentTime(Optional lastIncidentTime) { + this.lastIncidentTime = lastIncidentTime; + return this; + } + + @Override + public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { + this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); + return this; + } + + @Override + @JsonSetter(value = "first_incident_time", nulls = Nulls.SKIP) + public _FinalStage firstIncidentTime(Optional firstIncidentTime) { + this.firstIncidentTime = firstIncidentTime; + return this; + } + + @Override + public _FinalStage endUser(Map endUser) { + this.endUser = Optional.ofNullable(endUser); + return this; + } + + @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. + */ + @Override + public _FinalStage status(IssueStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @Override + public Issue build() { + return new Issue( + id, + status, + errorDescription, + endUser, + firstIncidentTime, + lastIncidentTime, + isMuted, + errorDetails, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/IssueStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/IssueStatus.java new file mode 100644 index 000000000..2cf642542 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/IssueStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/IssueStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/IssueStatusEnum.java new file mode 100644 index 000000000..08a6976d3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/IssueStatusEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/Item.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/Item.java new file mode 100644 index 000000000..b6a7bb6e4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/Item.java @@ -0,0 +1,555 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Item.Builder.class) +public final class Item { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional status; + + private final Optional unitPrice; + + private final Optional purchasePrice; + + private final Optional purchaseAccount; + + private final Optional salesAccount; + + private final Optional company; + + private final Optional purchaseTaxRate; + + private final Optional salesTaxRate; + + private final Optional remoteUpdatedAt; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Item( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional status, + Optional unitPrice, + Optional purchasePrice, + Optional purchaseAccount, + Optional salesAccount, + Optional company, + Optional purchaseTaxRate, + Optional salesTaxRate, + Optional remoteUpdatedAt, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.status = status; + this.unitPrice = unitPrice; + this.purchasePrice = purchasePrice; + this.purchaseAccount = purchaseAccount; + this.salesAccount = salesAccount; + this.company = company; + this.purchaseTaxRate = purchaseTaxRate; + this.salesTaxRate = salesTaxRate; + this.remoteUpdatedAt = remoteUpdatedAt; + 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 item's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The item's status. + *
    + *
  • ACTIVE - ACTIVE
  • + *
  • ARCHIVED - ARCHIVED
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The item's unit price. + */ + @JsonProperty("unit_price") + public Optional getUnitPrice() { + return unitPrice; + } + + /** + * @return The price at which the item is purchased from a vendor. + */ + @JsonProperty("purchase_price") + public Optional getPurchasePrice() { + return purchasePrice; + } + + /** + * @return References the default account used to record a purchase of the item. + */ + @JsonProperty("purchase_account") + public Optional getPurchaseAccount() { + return purchaseAccount; + } + + /** + * @return References the default account used to record a sale. + */ + @JsonProperty("sales_account") + public Optional getSalesAccount() { + return salesAccount; + } + + /** + * @return The company the item belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The default purchase tax rate for this item. + */ + @JsonProperty("purchase_tax_rate") + public Optional getPurchaseTaxRate() { + return purchaseTaxRate; + } + + /** + * @return The default sales tax rate for this item. + */ + @JsonProperty("sales_tax_rate") + public Optional getSalesTaxRate() { + return salesTaxRate; + } + + /** + * @return When the third party's item note was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Item && equalTo((Item) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Item other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && status.equals(other.status) + && unitPrice.equals(other.unitPrice) + && purchasePrice.equals(other.purchasePrice) + && purchaseAccount.equals(other.purchaseAccount) + && salesAccount.equals(other.salesAccount) + && company.equals(other.company) + && purchaseTaxRate.equals(other.purchaseTaxRate) + && salesTaxRate.equals(other.salesTaxRate) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.status, + this.unitPrice, + this.purchasePrice, + this.purchaseAccount, + this.salesAccount, + this.company, + this.purchaseTaxRate, + this.salesTaxRate, + this.remoteUpdatedAt, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 status = Optional.empty(); + + private Optional unitPrice = Optional.empty(); + + private Optional purchasePrice = Optional.empty(); + + private Optional purchaseAccount = Optional.empty(); + + private Optional salesAccount = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional purchaseTaxRate = Optional.empty(); + + private Optional salesTaxRate = Optional.empty(); + + private Optional remoteUpdatedAt = 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(Item other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + status(other.getStatus()); + unitPrice(other.getUnitPrice()); + purchasePrice(other.getPurchasePrice()); + purchaseAccount(other.getPurchaseAccount()); + salesAccount(other.getSalesAccount()); + company(other.getCompany()); + purchaseTaxRate(other.getPurchaseTaxRate()); + salesTaxRate(other.getSalesTaxRate()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + 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 = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(ItemStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "unit_price", nulls = Nulls.SKIP) + public Builder unitPrice(Optional unitPrice) { + this.unitPrice = unitPrice; + return this; + } + + public Builder unitPrice(Double unitPrice) { + this.unitPrice = Optional.ofNullable(unitPrice); + return this; + } + + @JsonSetter(value = "purchase_price", nulls = Nulls.SKIP) + public Builder purchasePrice(Optional purchasePrice) { + this.purchasePrice = purchasePrice; + return this; + } + + public Builder purchasePrice(Double purchasePrice) { + this.purchasePrice = Optional.ofNullable(purchasePrice); + return this; + } + + @JsonSetter(value = "purchase_account", nulls = Nulls.SKIP) + public Builder purchaseAccount(Optional purchaseAccount) { + this.purchaseAccount = purchaseAccount; + return this; + } + + public Builder purchaseAccount(ItemPurchaseAccount purchaseAccount) { + this.purchaseAccount = Optional.ofNullable(purchaseAccount); + return this; + } + + @JsonSetter(value = "sales_account", nulls = Nulls.SKIP) + public Builder salesAccount(Optional salesAccount) { + this.salesAccount = salesAccount; + return this; + } + + public Builder salesAccount(ItemSalesAccount salesAccount) { + this.salesAccount = Optional.ofNullable(salesAccount); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(ItemCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "purchase_tax_rate", nulls = Nulls.SKIP) + public Builder purchaseTaxRate(Optional purchaseTaxRate) { + this.purchaseTaxRate = purchaseTaxRate; + return this; + } + + public Builder purchaseTaxRate(ItemPurchaseTaxRate purchaseTaxRate) { + this.purchaseTaxRate = Optional.ofNullable(purchaseTaxRate); + return this; + } + + @JsonSetter(value = "sales_tax_rate", nulls = Nulls.SKIP) + public Builder salesTaxRate(Optional salesTaxRate) { + this.salesTaxRate = salesTaxRate; + return this; + } + + public Builder salesTaxRate(ItemSalesTaxRate salesTaxRate) { + this.salesTaxRate = Optional.ofNullable(salesTaxRate); + 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_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 Item build() { + return new Item( + id, + remoteId, + createdAt, + modifiedAt, + name, + status, + unitPrice, + purchasePrice, + purchaseAccount, + salesAccount, + company, + purchaseTaxRate, + salesTaxRate, + remoteUpdatedAt, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ItemCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ItemCompany.java new file mode 100644 index 000000000..1025122b3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ItemCompany.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ItemCompany.Deserializer.class) +public final class ItemCompany { + private final Object value; + + private final int type; + + private ItemCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemCompany && equalTo((ItemCompany) other); + } + + private boolean equalTo(ItemCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ItemCompany of(String value) { + return new ItemCompany(value, 0); + } + + public static ItemCompany of(CompanyInfo value) { + return new ItemCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ItemCompany.class); + } + + @Override + public ItemCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ItemFormatEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ItemFormatEnum.java new file mode 100644 index 000000000..2c31a4fe5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ItemFormatEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ItemPurchaseAccount.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ItemPurchaseAccount.java new file mode 100644 index 000000000..1c7a0725a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ItemPurchaseAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ItemPurchaseAccount.Deserializer.class) +public final class ItemPurchaseAccount { + private final Object value; + + private final int type; + + private ItemPurchaseAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemPurchaseAccount && equalTo((ItemPurchaseAccount) other); + } + + private boolean equalTo(ItemPurchaseAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ItemPurchaseAccount of(String value) { + return new ItemPurchaseAccount(value, 0); + } + + public static ItemPurchaseAccount of(Account value) { + return new ItemPurchaseAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ItemPurchaseAccount.class); + } + + @Override + public ItemPurchaseAccount 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/legacy/api/resources/accounting/types/ItemPurchaseTaxRate.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ItemPurchaseTaxRate.java new file mode 100644 index 000000000..4e30f9f0b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ItemPurchaseTaxRate.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ItemPurchaseTaxRate.Deserializer.class) +public final class ItemPurchaseTaxRate { + private final Object value; + + private final int type; + + private ItemPurchaseTaxRate(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((TaxRate) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemPurchaseTaxRate && equalTo((ItemPurchaseTaxRate) other); + } + + private boolean equalTo(ItemPurchaseTaxRate other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ItemPurchaseTaxRate of(String value) { + return new ItemPurchaseTaxRate(value, 0); + } + + public static ItemPurchaseTaxRate of(TaxRate value) { + return new ItemPurchaseTaxRate(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TaxRate value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ItemPurchaseTaxRate.class); + } + + @Override + public ItemPurchaseTaxRate 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, TaxRate.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ItemSalesAccount.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ItemSalesAccount.java new file mode 100644 index 000000000..a509f5a74 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ItemSalesAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ItemSalesAccount.Deserializer.class) +public final class ItemSalesAccount { + private final Object value; + + private final int type; + + private ItemSalesAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemSalesAccount && equalTo((ItemSalesAccount) other); + } + + private boolean equalTo(ItemSalesAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ItemSalesAccount of(String value) { + return new ItemSalesAccount(value, 0); + } + + public static ItemSalesAccount of(Account value) { + return new ItemSalesAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ItemSalesAccount.class); + } + + @Override + public ItemSalesAccount 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/legacy/api/resources/accounting/types/ItemSalesTaxRate.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ItemSalesTaxRate.java new file mode 100644 index 000000000..62dafcd4f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ItemSalesTaxRate.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ItemSalesTaxRate.Deserializer.class) +public final class ItemSalesTaxRate { + private final Object value; + + private final int type; + + private ItemSalesTaxRate(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((TaxRate) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemSalesTaxRate && equalTo((ItemSalesTaxRate) other); + } + + private boolean equalTo(ItemSalesTaxRate other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ItemSalesTaxRate of(String value) { + return new ItemSalesTaxRate(value, 0); + } + + public static ItemSalesTaxRate of(TaxRate value) { + return new ItemSalesTaxRate(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TaxRate value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ItemSalesTaxRate.class); + } + + @Override + public ItemSalesTaxRate 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, TaxRate.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ItemSchema.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ItemSchema.java new file mode 100644 index 000000000..7093f8122 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ItemSchema.java @@ -0,0 +1,136 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.itemType, this.itemFormat, this.itemChoices); + } + + @Override + 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/legacy/api/resources/accounting/types/ItemStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ItemStatus.java new file mode 100644 index 000000000..0e88654bd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ItemStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/ItemTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ItemTypeEnum.java new file mode 100644 index 000000000..db7e96730 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ItemTypeEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntry.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntry.java new file mode 100644 index 000000000..c4394afd3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntry.java @@ -0,0 +1,1029 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = JournalEntry.Builder.class) +public final class JournalEntry { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional transactionDate; + + private final Optional>> payments; + + private final Optional>> appliedPayments; + + private final Optional memo; + + private final Optional currency; + + private final Optional exchangeRate; + + private final Optional company; + + private final Optional inclusiveOfTax; + + private final Optional> lines; + + private final Optional journalNumber; + + private final Optional>> trackingCategories; + + private final Optional remoteWasDeleted; + + private final Optional postingStatus; + + private final Optional accountingPeriod; + + private final Optional remoteCreatedAt; + + private final Optional remoteUpdatedAt; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private JournalEntry( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional transactionDate, + Optional>> payments, + Optional>> appliedPayments, + Optional memo, + Optional currency, + Optional exchangeRate, + Optional company, + Optional inclusiveOfTax, + Optional> lines, + Optional journalNumber, + Optional>> trackingCategories, + Optional remoteWasDeleted, + Optional postingStatus, + Optional accountingPeriod, + Optional remoteCreatedAt, + Optional remoteUpdatedAt, + Optional> fieldMappings, + Optional> remoteData, + Optional> remoteFields, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.transactionDate = transactionDate; + this.payments = payments; + this.appliedPayments = appliedPayments; + this.memo = memo; + this.currency = currency; + this.exchangeRate = exchangeRate; + this.company = company; + this.inclusiveOfTax = inclusiveOfTax; + this.lines = lines; + this.journalNumber = journalNumber; + this.trackingCategories = trackingCategories; + this.remoteWasDeleted = remoteWasDeleted; + this.postingStatus = postingStatus; + this.accountingPeriod = accountingPeriod; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteUpdatedAt = remoteUpdatedAt; + 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 journal entry's transaction date. + */ + @JsonProperty("transaction_date") + public Optional getTransactionDate() { + return transactionDate; + } + + /** + * @return Array of Payment object IDs. + */ + @JsonProperty("payments") + public Optional>> getPayments() { + return payments; + } + + /** + * @return A list of the Payment Applied to Lines common models related to a given Invoice, Credit Note, or Journal Entry. + */ + @JsonProperty("applied_payments") + public Optional>> getAppliedPayments() { + return appliedPayments; + } + + /** + * @return The journal entry's private note. + */ + @JsonProperty("memo") + public Optional getMemo() { + return memo; + } + + /** + * @return The journal'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 journal entry's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return The company the journal entry belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. + */ + @JsonProperty("inclusive_of_tax") + public Optional getInclusiveOfTax() { + return inclusiveOfTax; + } + + @JsonProperty("lines") + public Optional> getLines() { + return lines; + } + + /** + * @return Reference number for identifying journal entries. + */ + @JsonProperty("journal_number") + public Optional getJournalNumber() { + return journalNumber; + } + + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @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 The journal's posting status. + *
    + *
  • UNPOSTED - UNPOSTED
  • + *
  • POSTED - POSTED
  • + *
+ */ + @JsonProperty("posting_status") + public Optional getPostingStatus() { + return postingStatus; + } + + /** + * @return The accounting period that the JournalEntry was generated in. + */ + @JsonProperty("accounting_period") + public Optional getAccountingPeriod() { + return accountingPeriod; + } + + /** + * @return When the third party's journal entry was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the third party's journal entry 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; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalEntry && equalTo((JournalEntry) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(JournalEntry other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && transactionDate.equals(other.transactionDate) + && payments.equals(other.payments) + && appliedPayments.equals(other.appliedPayments) + && memo.equals(other.memo) + && currency.equals(other.currency) + && exchangeRate.equals(other.exchangeRate) + && company.equals(other.company) + && inclusiveOfTax.equals(other.inclusiveOfTax) + && lines.equals(other.lines) + && journalNumber.equals(other.journalNumber) + && trackingCategories.equals(other.trackingCategories) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && postingStatus.equals(other.postingStatus) + && accountingPeriod.equals(other.accountingPeriod) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.transactionDate, + this.payments, + this.appliedPayments, + this.memo, + this.currency, + this.exchangeRate, + this.company, + this.inclusiveOfTax, + this.lines, + this.journalNumber, + this.trackingCategories, + this.remoteWasDeleted, + this.postingStatus, + this.accountingPeriod, + this.remoteCreatedAt, + this.remoteUpdatedAt, + this.fieldMappings, + this.remoteData, + this.remoteFields); + } + + @Override + 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 transactionDate = Optional.empty(); + + private Optional>> payments = Optional.empty(); + + private Optional>> appliedPayments = Optional.empty(); + + private Optional memo = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional inclusiveOfTax = Optional.empty(); + + private Optional> lines = Optional.empty(); + + private Optional journalNumber = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional postingStatus = Optional.empty(); + + private Optional accountingPeriod = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteUpdatedAt = 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(JournalEntry other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + transactionDate(other.getTransactionDate()); + payments(other.getPayments()); + appliedPayments(other.getAppliedPayments()); + memo(other.getMemo()); + currency(other.getCurrency()); + exchangeRate(other.getExchangeRate()); + company(other.getCompany()); + inclusiveOfTax(other.getInclusiveOfTax()); + lines(other.getLines()); + journalNumber(other.getJournalNumber()); + trackingCategories(other.getTrackingCategories()); + remoteWasDeleted(other.getRemoteWasDeleted()); + postingStatus(other.getPostingStatus()); + accountingPeriod(other.getAccountingPeriod()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + 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 = "transaction_date", nulls = Nulls.SKIP) + public Builder transactionDate(Optional transactionDate) { + this.transactionDate = transactionDate; + return this; + } + + public Builder transactionDate(OffsetDateTime transactionDate) { + this.transactionDate = Optional.ofNullable(transactionDate); + return this; + } + + @JsonSetter(value = "payments", nulls = Nulls.SKIP) + public Builder payments(Optional>> payments) { + this.payments = payments; + return this; + } + + public Builder payments(List> payments) { + this.payments = Optional.ofNullable(payments); + return this; + } + + @JsonSetter(value = "applied_payments", nulls = Nulls.SKIP) + public Builder appliedPayments(Optional>> appliedPayments) { + this.appliedPayments = appliedPayments; + return this; + } + + public Builder appliedPayments(List> appliedPayments) { + this.appliedPayments = Optional.ofNullable(appliedPayments); + return this; + } + + @JsonSetter(value = "memo", nulls = Nulls.SKIP) + public Builder memo(Optional memo) { + this.memo = memo; + return this; + } + + public Builder memo(String memo) { + this.memo = Optional.ofNullable(memo); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(JournalEntryCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(JournalEntryCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "inclusive_of_tax", nulls = Nulls.SKIP) + public Builder inclusiveOfTax(Optional inclusiveOfTax) { + this.inclusiveOfTax = inclusiveOfTax; + return this; + } + + public Builder inclusiveOfTax(Boolean inclusiveOfTax) { + this.inclusiveOfTax = Optional.ofNullable(inclusiveOfTax); + return this; + } + + @JsonSetter(value = "lines", nulls = Nulls.SKIP) + public Builder lines(Optional> lines) { + this.lines = lines; + return this; + } + + public Builder lines(List lines) { + this.lines = Optional.ofNullable(lines); + return this; + } + + @JsonSetter(value = "journal_number", nulls = Nulls.SKIP) + public Builder journalNumber(Optional journalNumber) { + this.journalNumber = journalNumber; + return this; + } + + public Builder journalNumber(String journalNumber) { + this.journalNumber = Optional.ofNullable(journalNumber); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + 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 = "posting_status", nulls = Nulls.SKIP) + public Builder postingStatus(Optional postingStatus) { + this.postingStatus = postingStatus; + return this; + } + + public Builder postingStatus(JournalEntryPostingStatus postingStatus) { + this.postingStatus = Optional.ofNullable(postingStatus); + return this; + } + + @JsonSetter(value = "accounting_period", nulls = Nulls.SKIP) + public Builder accountingPeriod(Optional accountingPeriod) { + this.accountingPeriod = accountingPeriod; + return this; + } + + public Builder accountingPeriod(JournalEntryAccountingPeriod accountingPeriod) { + this.accountingPeriod = Optional.ofNullable(accountingPeriod); + 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_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 = "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 JournalEntry build() { + return new JournalEntry( + id, + remoteId, + createdAt, + modifiedAt, + transactionDate, + payments, + appliedPayments, + memo, + currency, + exchangeRate, + company, + inclusiveOfTax, + lines, + journalNumber, + trackingCategories, + remoteWasDeleted, + postingStatus, + accountingPeriod, + remoteCreatedAt, + remoteUpdatedAt, + fieldMappings, + remoteData, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryAccountingPeriod.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryAccountingPeriod.java new file mode 100644 index 000000000..5d99db6ed --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryAccountingPeriod.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = JournalEntryAccountingPeriod.Deserializer.class) +public final class JournalEntryAccountingPeriod { + private final Object value; + + private final int type; + + private JournalEntryAccountingPeriod(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((AccountingPeriod) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalEntryAccountingPeriod && equalTo((JournalEntryAccountingPeriod) other); + } + + private boolean equalTo(JournalEntryAccountingPeriod other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static JournalEntryAccountingPeriod of(String value) { + return new JournalEntryAccountingPeriod(value, 0); + } + + public static JournalEntryAccountingPeriod of(AccountingPeriod value) { + return new JournalEntryAccountingPeriod(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(AccountingPeriod value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(JournalEntryAccountingPeriod.class); + } + + @Override + public JournalEntryAccountingPeriod 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, AccountingPeriod.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryAppliedPaymentsItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryAppliedPaymentsItem.java new file mode 100644 index 000000000..69b26e091 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryAppliedPaymentsItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = JournalEntryAppliedPaymentsItem.Deserializer.class) +public final class JournalEntryAppliedPaymentsItem { + private final Object value; + + private final int type; + + private JournalEntryAppliedPaymentsItem(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((PaymentLineItem) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalEntryAppliedPaymentsItem && equalTo((JournalEntryAppliedPaymentsItem) other); + } + + private boolean equalTo(JournalEntryAppliedPaymentsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static JournalEntryAppliedPaymentsItem of(String value) { + return new JournalEntryAppliedPaymentsItem(value, 0); + } + + public static JournalEntryAppliedPaymentsItem of(PaymentLineItem value) { + return new JournalEntryAppliedPaymentsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PaymentLineItem value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(JournalEntryAppliedPaymentsItem.class); + } + + @Override + public JournalEntryAppliedPaymentsItem 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, PaymentLineItem.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryCompany.java new file mode 100644 index 000000000..2f8e996dc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryCompany.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = JournalEntryCompany.Deserializer.class) +public final class JournalEntryCompany { + private final Object value; + + private final int type; + + private JournalEntryCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalEntryCompany && equalTo((JournalEntryCompany) other); + } + + private boolean equalTo(JournalEntryCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static JournalEntryCompany of(String value) { + return new JournalEntryCompany(value, 0); + } + + public static JournalEntryCompany of(CompanyInfo value) { + return new JournalEntryCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(JournalEntryCompany.class); + } + + @Override + public JournalEntryCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryCurrency.java new file mode 100644 index 000000000..62be2d9dc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/JournalEntryPaymentsItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryPaymentsItem.java new file mode 100644 index 000000000..8fa2e1d72 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryPaymentsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = JournalEntryPaymentsItem.Deserializer.class) +public final class JournalEntryPaymentsItem { + private final Object value; + + private final int type; + + private JournalEntryPaymentsItem(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((Payment) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalEntryPaymentsItem && equalTo((JournalEntryPaymentsItem) other); + } + + private boolean equalTo(JournalEntryPaymentsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static JournalEntryPaymentsItem of(String value) { + return new JournalEntryPaymentsItem(value, 0); + } + + public static JournalEntryPaymentsItem of(Payment value) { + return new JournalEntryPaymentsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Payment value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(JournalEntryPaymentsItem.class); + } + + @Override + public JournalEntryPaymentsItem 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, Payment.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryPostingStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryPostingStatus.java new file mode 100644 index 000000000..a9e8363cc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryPostingStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/JournalEntryRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryRequest.java new file mode 100644 index 000000000..32ac4f47d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryRequest.java @@ -0,0 +1,773 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = JournalEntryRequest.Builder.class) +public final class JournalEntryRequest { + private final Optional transactionDate; + + private final Optional>> payments; + + private final Optional memo; + + private final Optional currency; + + private final Optional exchangeRate; + + private final Optional company; + + private final Optional>> trackingCategories; + + private final Optional inclusiveOfTax; + + private final Optional> lines; + + private final Optional journalNumber; + + private final Optional postingStatus; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private JournalEntryRequest( + Optional transactionDate, + Optional>> payments, + Optional memo, + Optional currency, + Optional exchangeRate, + Optional company, + Optional>> trackingCategories, + Optional inclusiveOfTax, + Optional> lines, + Optional journalNumber, + Optional postingStatus, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.transactionDate = transactionDate; + this.payments = payments; + this.memo = memo; + this.currency = currency; + this.exchangeRate = exchangeRate; + this.company = company; + this.trackingCategories = trackingCategories; + this.inclusiveOfTax = inclusiveOfTax; + this.lines = lines; + this.journalNumber = journalNumber; + this.postingStatus = postingStatus; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The journal entry's transaction date. + */ + @JsonProperty("transaction_date") + public Optional getTransactionDate() { + return transactionDate; + } + + /** + * @return Array of Payment object IDs. + */ + @JsonProperty("payments") + public Optional>> getPayments() { + return payments; + } + + /** + * @return The journal entry's private note. + */ + @JsonProperty("memo") + public Optional getMemo() { + return memo; + } + + /** + * @return The journal'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 journal entry's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return The company the journal entry belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. + */ + @JsonProperty("inclusive_of_tax") + public Optional getInclusiveOfTax() { + return inclusiveOfTax; + } + + @JsonProperty("lines") + public Optional> getLines() { + return lines; + } + + /** + * @return Reference number for identifying journal entries. + */ + @JsonProperty("journal_number") + public Optional getJournalNumber() { + return journalNumber; + } + + /** + * @return The journal's posting status. + *
    + *
  • UNPOSTED - UNPOSTED
  • + *
  • POSTED - POSTED
  • + *
+ */ + @JsonProperty("posting_status") + public Optional getPostingStatus() { + return postingStatus; + } + + @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalEntryRequest && equalTo((JournalEntryRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(JournalEntryRequest other) { + return transactionDate.equals(other.transactionDate) + && payments.equals(other.payments) + && memo.equals(other.memo) + && currency.equals(other.currency) + && exchangeRate.equals(other.exchangeRate) + && company.equals(other.company) + && trackingCategories.equals(other.trackingCategories) + && inclusiveOfTax.equals(other.inclusiveOfTax) + && lines.equals(other.lines) + && journalNumber.equals(other.journalNumber) + && postingStatus.equals(other.postingStatus) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.transactionDate, + this.payments, + this.memo, + this.currency, + this.exchangeRate, + this.company, + this.trackingCategories, + this.inclusiveOfTax, + this.lines, + this.journalNumber, + this.postingStatus, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional transactionDate = Optional.empty(); + + private Optional>> payments = Optional.empty(); + + private Optional memo = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional>> trackingCategories = + Optional.empty(); + + private Optional inclusiveOfTax = Optional.empty(); + + private Optional> lines = Optional.empty(); + + private Optional journalNumber = Optional.empty(); + + private Optional postingStatus = 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(JournalEntryRequest other) { + transactionDate(other.getTransactionDate()); + payments(other.getPayments()); + memo(other.getMemo()); + currency(other.getCurrency()); + exchangeRate(other.getExchangeRate()); + company(other.getCompany()); + trackingCategories(other.getTrackingCategories()); + inclusiveOfTax(other.getInclusiveOfTax()); + lines(other.getLines()); + journalNumber(other.getJournalNumber()); + postingStatus(other.getPostingStatus()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + remoteFields(other.getRemoteFields()); + return this; + } + + @JsonSetter(value = "transaction_date", nulls = Nulls.SKIP) + public Builder transactionDate(Optional transactionDate) { + this.transactionDate = transactionDate; + return this; + } + + public Builder transactionDate(OffsetDateTime transactionDate) { + this.transactionDate = Optional.ofNullable(transactionDate); + return this; + } + + @JsonSetter(value = "payments", nulls = Nulls.SKIP) + public Builder payments(Optional>> payments) { + this.payments = payments; + return this; + } + + public Builder payments(List> payments) { + this.payments = Optional.ofNullable(payments); + return this; + } + + @JsonSetter(value = "memo", nulls = Nulls.SKIP) + public Builder memo(Optional memo) { + this.memo = memo; + return this; + } + + public Builder memo(String memo) { + this.memo = Optional.ofNullable(memo); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(JournalEntryRequestCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(JournalEntryRequestCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories( + List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + @JsonSetter(value = "inclusive_of_tax", nulls = Nulls.SKIP) + public Builder inclusiveOfTax(Optional inclusiveOfTax) { + this.inclusiveOfTax = inclusiveOfTax; + return this; + } + + public Builder inclusiveOfTax(Boolean inclusiveOfTax) { + this.inclusiveOfTax = Optional.ofNullable(inclusiveOfTax); + return this; + } + + @JsonSetter(value = "lines", nulls = Nulls.SKIP) + public Builder lines(Optional> lines) { + this.lines = lines; + return this; + } + + public Builder lines(List lines) { + this.lines = Optional.ofNullable(lines); + return this; + } + + @JsonSetter(value = "journal_number", nulls = Nulls.SKIP) + public Builder journalNumber(Optional journalNumber) { + this.journalNumber = journalNumber; + return this; + } + + public Builder journalNumber(String journalNumber) { + this.journalNumber = Optional.ofNullable(journalNumber); + return this; + } + + @JsonSetter(value = "posting_status", nulls = Nulls.SKIP) + public Builder postingStatus(Optional postingStatus) { + this.postingStatus = postingStatus; + return this; + } + + public Builder postingStatus(JournalEntryRequestPostingStatus postingStatus) { + this.postingStatus = Optional.ofNullable(postingStatus); + 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 JournalEntryRequest build() { + return new JournalEntryRequest( + transactionDate, + payments, + memo, + currency, + exchangeRate, + company, + trackingCategories, + inclusiveOfTax, + lines, + journalNumber, + postingStatus, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryRequestCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryRequestCompany.java new file mode 100644 index 000000000..3b0dfe371 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryRequestCompany.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = JournalEntryRequestCompany.Deserializer.class) +public final class JournalEntryRequestCompany { + private final Object value; + + private final int type; + + private JournalEntryRequestCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalEntryRequestCompany && equalTo((JournalEntryRequestCompany) other); + } + + private boolean equalTo(JournalEntryRequestCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static JournalEntryRequestCompany of(String value) { + return new JournalEntryRequestCompany(value, 0); + } + + public static JournalEntryRequestCompany of(CompanyInfo value) { + return new JournalEntryRequestCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(JournalEntryRequestCompany.class); + } + + @Override + public JournalEntryRequestCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryRequestCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryRequestCurrency.java new file mode 100644 index 000000000..ee6fbf0be --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryRequestCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/JournalEntryRequestPaymentsItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryRequestPaymentsItem.java new file mode 100644 index 000000000..d087b9d27 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryRequestPaymentsItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = JournalEntryRequestPaymentsItem.Deserializer.class) +public final class JournalEntryRequestPaymentsItem { + private final Object value; + + private final int type; + + private JournalEntryRequestPaymentsItem(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((Payment) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalEntryRequestPaymentsItem && equalTo((JournalEntryRequestPaymentsItem) other); + } + + private boolean equalTo(JournalEntryRequestPaymentsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static JournalEntryRequestPaymentsItem of(String value) { + return new JournalEntryRequestPaymentsItem(value, 0); + } + + public static JournalEntryRequestPaymentsItem of(Payment value) { + return new JournalEntryRequestPaymentsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Payment value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(JournalEntryRequestPaymentsItem.class); + } + + @Override + public JournalEntryRequestPaymentsItem 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, Payment.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryRequestPostingStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryRequestPostingStatus.java new file mode 100644 index 000000000..5c46d0192 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryRequestPostingStatus.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/JournalEntryRequestTrackingCategoriesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryRequestTrackingCategoriesItem.java new file mode 100644 index 000000000..eb7fd100a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryRequestTrackingCategoriesItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = JournalEntryRequestTrackingCategoriesItem.Deserializer.class) +public final class JournalEntryRequestTrackingCategoriesItem { + private final Object value; + + private final int type; + + private JournalEntryRequestTrackingCategoriesItem(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalEntryRequestTrackingCategoriesItem + && equalTo((JournalEntryRequestTrackingCategoriesItem) other); + } + + private boolean equalTo(JournalEntryRequestTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static JournalEntryRequestTrackingCategoriesItem of(String value) { + return new JournalEntryRequestTrackingCategoriesItem(value, 0); + } + + public static JournalEntryRequestTrackingCategoriesItem of(TrackingCategory value) { + return new JournalEntryRequestTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(JournalEntryRequestTrackingCategoriesItem.class); + } + + @Override + public JournalEntryRequestTrackingCategoriesItem 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryResponse.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryResponse.java new file mode 100644 index 000000000..1adc30489 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = JournalEntryResponse.Builder.class) +public final class JournalEntryResponse { + private final JournalEntry model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private JournalEntryResponse( + JournalEntry 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 JournalEntry getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalEntryResponse && equalTo((JournalEntryResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(JournalEntryResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull JournalEntry model); + + Builder from(JournalEntryResponse other); + } + + public interface _FinalStage { + JournalEntryResponse 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 JournalEntry model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(JournalEntryResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull JournalEntry model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public JournalEntryResponse build() { + return new JournalEntryResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryTrackingCategoriesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryTrackingCategoriesItem.java new file mode 100644 index 000000000..f3846d304 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalEntryTrackingCategoriesItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = JournalEntryTrackingCategoriesItem.Deserializer.class) +public final class JournalEntryTrackingCategoriesItem { + private final Object value; + + private final int type; + + private JournalEntryTrackingCategoriesItem(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalEntryTrackingCategoriesItem + && equalTo((JournalEntryTrackingCategoriesItem) other); + } + + private boolean equalTo(JournalEntryTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static JournalEntryTrackingCategoriesItem of(String value) { + return new JournalEntryTrackingCategoriesItem(value, 0); + } + + public static JournalEntryTrackingCategoriesItem of(TrackingCategory value) { + return new JournalEntryTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(JournalEntryTrackingCategoriesItem.class); + } + + @Override + public JournalEntryTrackingCategoriesItem 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLine.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLine.java new file mode 100644 index 000000000..566a00f92 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLine.java @@ -0,0 +1,850 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = JournalLine.Builder.class) +public final class JournalLine { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional account; + + private final Optional netAmount; + + private final Optional trackingCategory; + + private final Optional>> trackingCategories; + + private final Optional currency; + + private final Optional company; + + private final Optional employee; + + private final Optional contact; + + private final Optional taxRate; + + private final Optional description; + + private final Optional exchangeRate; + + private final Optional remoteWasDeleted; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private JournalLine( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional account, + Optional netAmount, + Optional trackingCategory, + Optional>> trackingCategories, + Optional currency, + Optional company, + Optional employee, + Optional contact, + Optional taxRate, + Optional description, + Optional exchangeRate, + Optional remoteWasDeleted, + Optional> remoteFields, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.account = account; + this.netAmount = netAmount; + this.trackingCategory = trackingCategory; + this.trackingCategories = trackingCategories; + this.currency = currency; + this.company = company; + this.employee = employee; + this.contact = contact; + this.taxRate = taxRate; + this.description = description; + this.exchangeRate = exchangeRate; + this.remoteWasDeleted = remoteWasDeleted; + 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; + } + + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The value of the line item including taxes and other fees. + */ + @JsonProperty("net_amount") + public Optional getNetAmount() { + return netAmount; + } + + @JsonProperty("tracking_category") + public Optional getTrackingCategory() { + return trackingCategory; + } + + /** + * @return The journal line item's associated tracking categories. + */ + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The journal line item'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 company the journal entry belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + + /** + * @return The tax rate that applies to this line item. + */ + @JsonProperty("tax_rate") + public Optional getTaxRate() { + return taxRate; + } + + /** + * @return The line's description. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The journal line item's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @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("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalLine && equalTo((JournalLine) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(JournalLine other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && account.equals(other.account) + && netAmount.equals(other.netAmount) + && trackingCategory.equals(other.trackingCategory) + && trackingCategories.equals(other.trackingCategories) + && currency.equals(other.currency) + && company.equals(other.company) + && employee.equals(other.employee) + && contact.equals(other.contact) + && taxRate.equals(other.taxRate) + && description.equals(other.description) + && exchangeRate.equals(other.exchangeRate) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.account, + this.netAmount, + this.trackingCategory, + this.trackingCategories, + this.currency, + this.company, + this.employee, + this.contact, + this.taxRate, + this.description, + this.exchangeRate, + this.remoteWasDeleted, + this.remoteFields); + } + + @Override + 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 account = Optional.empty(); + + private Optional netAmount = Optional.empty(); + + private Optional trackingCategory = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional employee = Optional.empty(); + + private Optional contact = Optional.empty(); + + private Optional taxRate = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(JournalLine other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + account(other.getAccount()); + netAmount(other.getNetAmount()); + trackingCategory(other.getTrackingCategory()); + trackingCategories(other.getTrackingCategories()); + currency(other.getCurrency()); + company(other.getCompany()); + employee(other.getEmployee()); + contact(other.getContact()); + taxRate(other.getTaxRate()); + description(other.getDescription()); + exchangeRate(other.getExchangeRate()); + remoteWasDeleted(other.getRemoteWasDeleted()); + 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 = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(JournalLineAccount account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "net_amount", nulls = Nulls.SKIP) + public Builder netAmount(Optional netAmount) { + this.netAmount = netAmount; + return this; + } + + public Builder netAmount(Double netAmount) { + this.netAmount = Optional.ofNullable(netAmount); + return this; + } + + @JsonSetter(value = "tracking_category", nulls = Nulls.SKIP) + public Builder trackingCategory(Optional trackingCategory) { + this.trackingCategory = trackingCategory; + return this; + } + + public Builder trackingCategory(JournalLineTrackingCategory trackingCategory) { + this.trackingCategory = Optional.ofNullable(trackingCategory); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(JournalLineCurrency 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 = "employee", nulls = Nulls.SKIP) + public Builder employee(Optional employee) { + this.employee = employee; + return this; + } + + public Builder employee(String employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "contact", nulls = Nulls.SKIP) + public Builder contact(Optional contact) { + this.contact = contact; + return this; + } + + public Builder contact(String contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "tax_rate", nulls = Nulls.SKIP) + public Builder taxRate(Optional taxRate) { + this.taxRate = taxRate; + return this; + } + + public Builder taxRate(String taxRate) { + this.taxRate = Optional.ofNullable(taxRate); + 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 = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + 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 = "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 JournalLine build() { + return new JournalLine( + id, + remoteId, + createdAt, + modifiedAt, + account, + netAmount, + trackingCategory, + trackingCategories, + currency, + company, + employee, + contact, + taxRate, + description, + exchangeRate, + remoteWasDeleted, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLineAccount.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLineAccount.java new file mode 100644 index 000000000..88e3db4de --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLineAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = JournalLineAccount.Deserializer.class) +public final class JournalLineAccount { + private final Object value; + + private final int type; + + private JournalLineAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalLineAccount && equalTo((JournalLineAccount) other); + } + + private boolean equalTo(JournalLineAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static JournalLineAccount of(String value) { + return new JournalLineAccount(value, 0); + } + + public static JournalLineAccount of(Account value) { + return new JournalLineAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(JournalLineAccount.class); + } + + @Override + public JournalLineAccount 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/legacy/api/resources/accounting/types/JournalLineCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLineCurrency.java new file mode 100644 index 000000000..4ac086c83 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLineCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/JournalLineRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLineRequest.java new file mode 100644 index 000000000..732493c04 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLineRequest.java @@ -0,0 +1,790 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = JournalLineRequest.Builder.class) +public final class JournalLineRequest { + private final Optional remoteId; + + private final Optional account; + + private final Optional netAmount; + + private final Optional trackingCategory; + + private final Optional>> trackingCategories; + + private final Optional currency; + + private final Optional company; + + private final Optional employee; + + private final Optional contact; + + private final Optional taxRate; + + private final Optional description; + + private final Optional exchangeRate; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private JournalLineRequest( + Optional remoteId, + Optional account, + Optional netAmount, + Optional trackingCategory, + Optional>> trackingCategories, + Optional currency, + Optional company, + Optional employee, + Optional contact, + Optional taxRate, + Optional description, + Optional exchangeRate, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.remoteId = remoteId; + this.account = account; + this.netAmount = netAmount; + this.trackingCategory = trackingCategory; + this.trackingCategories = trackingCategories; + this.currency = currency; + this.company = company; + this.employee = employee; + this.contact = contact; + this.taxRate = taxRate; + this.description = description; + this.exchangeRate = exchangeRate; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The value of the line item including taxes and other fees. + */ + @JsonProperty("net_amount") + public Optional getNetAmount() { + return netAmount; + } + + @JsonProperty("tracking_category") + public Optional getTrackingCategory() { + return trackingCategory; + } + + /** + * @return The journal line item's associated tracking categories. + */ + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The journal line item'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 company the journal entry belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + + /** + * @return The tax rate that applies to this line item. + */ + @JsonProperty("tax_rate") + public Optional getTaxRate() { + return taxRate; + } + + /** + * @return The line's description. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The journal line item's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalLineRequest && equalTo((JournalLineRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(JournalLineRequest other) { + return remoteId.equals(other.remoteId) + && account.equals(other.account) + && netAmount.equals(other.netAmount) + && trackingCategory.equals(other.trackingCategory) + && trackingCategories.equals(other.trackingCategories) + && currency.equals(other.currency) + && company.equals(other.company) + && employee.equals(other.employee) + && contact.equals(other.contact) + && taxRate.equals(other.taxRate) + && description.equals(other.description) + && exchangeRate.equals(other.exchangeRate) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.remoteId, + this.account, + this.netAmount, + this.trackingCategory, + this.trackingCategories, + this.currency, + this.company, + this.employee, + this.contact, + this.taxRate, + this.description, + this.exchangeRate, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @Override + 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 account = Optional.empty(); + + private Optional netAmount = Optional.empty(); + + private Optional trackingCategory = Optional.empty(); + + private Optional>> trackingCategories = + Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional employee = Optional.empty(); + + private Optional contact = Optional.empty(); + + private Optional taxRate = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional exchangeRate = 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(JournalLineRequest other) { + remoteId(other.getRemoteId()); + account(other.getAccount()); + netAmount(other.getNetAmount()); + trackingCategory(other.getTrackingCategory()); + trackingCategories(other.getTrackingCategories()); + currency(other.getCurrency()); + company(other.getCompany()); + employee(other.getEmployee()); + contact(other.getContact()); + taxRate(other.getTaxRate()); + description(other.getDescription()); + exchangeRate(other.getExchangeRate()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + remoteFields(other.getRemoteFields()); + 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 = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(JournalLineRequestAccount account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "net_amount", nulls = Nulls.SKIP) + public Builder netAmount(Optional netAmount) { + this.netAmount = netAmount; + return this; + } + + public Builder netAmount(Double netAmount) { + this.netAmount = Optional.ofNullable(netAmount); + return this; + } + + @JsonSetter(value = "tracking_category", nulls = Nulls.SKIP) + public Builder trackingCategory(Optional trackingCategory) { + this.trackingCategory = trackingCategory; + return this; + } + + public Builder trackingCategory(JournalLineRequestTrackingCategory trackingCategory) { + this.trackingCategory = Optional.ofNullable(trackingCategory); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(JournalLineRequestCurrency 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 = "employee", nulls = Nulls.SKIP) + public Builder employee(Optional employee) { + this.employee = employee; + return this; + } + + public Builder employee(String employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "contact", nulls = Nulls.SKIP) + public Builder contact(Optional contact) { + this.contact = contact; + return this; + } + + public Builder contact(String contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "tax_rate", nulls = Nulls.SKIP) + public Builder taxRate(Optional taxRate) { + this.taxRate = taxRate; + return this; + } + + public Builder taxRate(String taxRate) { + this.taxRate = Optional.ofNullable(taxRate); + 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 = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + 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 JournalLineRequest build() { + return new JournalLineRequest( + remoteId, + account, + netAmount, + trackingCategory, + trackingCategories, + currency, + company, + employee, + contact, + taxRate, + description, + exchangeRate, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLineRequestAccount.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLineRequestAccount.java new file mode 100644 index 000000000..6e0d315a1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLineRequestAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = JournalLineRequestAccount.Deserializer.class) +public final class JournalLineRequestAccount { + private final Object value; + + private final int type; + + private JournalLineRequestAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalLineRequestAccount && equalTo((JournalLineRequestAccount) other); + } + + private boolean equalTo(JournalLineRequestAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static JournalLineRequestAccount of(String value) { + return new JournalLineRequestAccount(value, 0); + } + + public static JournalLineRequestAccount of(Account value) { + return new JournalLineRequestAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(JournalLineRequestAccount.class); + } + + @Override + public JournalLineRequestAccount 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/legacy/api/resources/accounting/types/JournalLineRequestCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLineRequestCurrency.java new file mode 100644 index 000000000..370f0110a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLineRequestCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/JournalLineRequestTrackingCategoriesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLineRequestTrackingCategoriesItem.java new file mode 100644 index 000000000..57cd28aff --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLineRequestTrackingCategoriesItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = JournalLineRequestTrackingCategoriesItem.Deserializer.class) +public final class JournalLineRequestTrackingCategoriesItem { + private final Object value; + + private final int type; + + private JournalLineRequestTrackingCategoriesItem(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalLineRequestTrackingCategoriesItem + && equalTo((JournalLineRequestTrackingCategoriesItem) other); + } + + private boolean equalTo(JournalLineRequestTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static JournalLineRequestTrackingCategoriesItem of(String value) { + return new JournalLineRequestTrackingCategoriesItem(value, 0); + } + + public static JournalLineRequestTrackingCategoriesItem of(TrackingCategory value) { + return new JournalLineRequestTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(JournalLineRequestTrackingCategoriesItem.class); + } + + @Override + public JournalLineRequestTrackingCategoriesItem 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLineRequestTrackingCategory.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLineRequestTrackingCategory.java new file mode 100644 index 000000000..dc73cbe3a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLineRequestTrackingCategory.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = JournalLineRequestTrackingCategory.Deserializer.class) +public final class JournalLineRequestTrackingCategory { + private final Object value; + + private final int type; + + private JournalLineRequestTrackingCategory(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalLineRequestTrackingCategory + && equalTo((JournalLineRequestTrackingCategory) other); + } + + private boolean equalTo(JournalLineRequestTrackingCategory other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static JournalLineRequestTrackingCategory of(String value) { + return new JournalLineRequestTrackingCategory(value, 0); + } + + public static JournalLineRequestTrackingCategory of(TrackingCategory value) { + return new JournalLineRequestTrackingCategory(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(JournalLineRequestTrackingCategory.class); + } + + @Override + public JournalLineRequestTrackingCategory 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLineTrackingCategoriesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLineTrackingCategoriesItem.java new file mode 100644 index 000000000..ec4af75fd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLineTrackingCategoriesItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = JournalLineTrackingCategoriesItem.Deserializer.class) +public final class JournalLineTrackingCategoriesItem { + private final Object value; + + private final int type; + + private JournalLineTrackingCategoriesItem(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalLineTrackingCategoriesItem && equalTo((JournalLineTrackingCategoriesItem) other); + } + + private boolean equalTo(JournalLineTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static JournalLineTrackingCategoriesItem of(String value) { + return new JournalLineTrackingCategoriesItem(value, 0); + } + + public static JournalLineTrackingCategoriesItem of(TrackingCategory value) { + return new JournalLineTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(JournalLineTrackingCategoriesItem.class); + } + + @Override + public JournalLineTrackingCategoriesItem 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLineTrackingCategory.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLineTrackingCategory.java new file mode 100644 index 000000000..99f2a6487 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/JournalLineTrackingCategory.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = JournalLineTrackingCategory.Deserializer.class) +public final class JournalLineTrackingCategory { + private final Object value; + + private final int type; + + private JournalLineTrackingCategory(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalLineTrackingCategory && equalTo((JournalLineTrackingCategory) other); + } + + private boolean equalTo(JournalLineTrackingCategory other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static JournalLineTrackingCategory of(String value) { + return new JournalLineTrackingCategory(value, 0); + } + + public static JournalLineTrackingCategory of(TrackingCategory value) { + return new JournalLineTrackingCategory(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(JournalLineTrackingCategory.class); + } + + @Override + public JournalLineTrackingCategory 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/LanguageEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/LanguageEnum.java new file mode 100644 index 000000000..f06d62ec2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/LanguageEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/LinkToken.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/LinkToken.java new file mode 100644 index 000000000..713e8ef41 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/LinkToken.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.linkToken, this.integrationName, this.magicLinkUrl); + } + + @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() {} + + @Override + public Builder from(LinkToken other) { + linkToken(other.getLinkToken()); + integrationName(other.getIntegrationName()); + magicLinkUrl(other.getMagicLinkUrl()); + return this; + } + + @Override + @JsonSetter("link_token") + public _FinalStage linkToken(@NotNull String linkToken) { + this.linkToken = linkToken; + return this; + } + + @Override + public _FinalStage magicLinkUrl(String magicLinkUrl) { + this.magicLinkUrl = Optional.ofNullable(magicLinkUrl); + return this; + } + + @Override + @JsonSetter(value = "magic_link_url", nulls = Nulls.SKIP) + public _FinalStage magicLinkUrl(Optional magicLinkUrl) { + this.magicLinkUrl = magicLinkUrl; + return this; + } + + @Override + public _FinalStage integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @Override + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public _FinalStage integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + @Override + public LinkToken build() { + return new LinkToken(linkToken, integrationName, magicLinkUrl, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/LinkedAccountStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/LinkedAccountStatus.java new file mode 100644 index 000000000..67a9ed067 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/LinkedAccountStatus.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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; + } + + @Override + public int hashCode() { + return Objects.hash(this.linkedAccountStatus, this.canMakeRequest); + } + + @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() {} + + @Override + public Builder from(LinkedAccountStatus other) { + linkedAccountStatus(other.getLinkedAccountStatus()); + canMakeRequest(other.getCanMakeRequest()); + return this; + } + + @Override + @JsonSetter("linked_account_status") + public CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus) { + this.linkedAccountStatus = linkedAccountStatus; + return this; + } + + @Override + @JsonSetter("can_make_request") + public _FinalStage canMakeRequest(boolean canMakeRequest) { + this.canMakeRequest = canMakeRequest; + return this; + } + + @Override + public LinkedAccountStatus build() { + return new LinkedAccountStatus(linkedAccountStatus, canMakeRequest, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/MetaResponse.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/MetaResponse.java new file mode 100644 index 000000000..28514259d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/MetaResponse.java @@ -0,0 +1,232 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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; + } + + @Override + public int hashCode() { + return Objects.hash( + this.requestSchema, + this.remoteFieldClasses, + this.status, + this.hasConditionalParams, + this.hasRequiredLinkedAccountParams); + } + + @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() {} + + @Override + public Builder from(MetaResponse other) { + requestSchema(other.getRequestSchema()); + remoteFieldClasses(other.getRemoteFieldClasses()); + status(other.getStatus()); + hasConditionalParams(other.getHasConditionalParams()); + hasRequiredLinkedAccountParams(other.getHasRequiredLinkedAccountParams()); + return this; + } + + @Override + @JsonSetter("has_conditional_params") + public HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams) { + this.hasConditionalParams = hasConditionalParams; + return this; + } + + @Override + @JsonSetter("has_required_linked_account_params") + public _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams) { + this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; + return this; + } + + @Override + public _FinalStage status(LinkedAccountStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @Override + public _FinalStage remoteFieldClasses(Map remoteFieldClasses) { + this.remoteFieldClasses = Optional.ofNullable(remoteFieldClasses); + return this; + } + + @Override + @JsonSetter(value = "remote_field_classes", nulls = Nulls.SKIP) + public _FinalStage remoteFieldClasses(Optional> remoteFieldClasses) { + this.remoteFieldClasses = remoteFieldClasses; + return this; + } + + @Override + public _FinalStage requestSchema(String key, JsonNode value) { + this.requestSchema.put(key, value); + return this; + } + + @Override + public _FinalStage putAllRequestSchema(Map requestSchema) { + this.requestSchema.putAll(requestSchema); + return this; + } + + @Override + @JsonSetter(value = "request_schema", nulls = Nulls.SKIP) + public _FinalStage requestSchema(Map requestSchema) { + this.requestSchema.clear(); + this.requestSchema.putAll(requestSchema); + return this; + } + + @Override + public MetaResponse build() { + return new MetaResponse( + requestSchema, + remoteFieldClasses, + status, + hasConditionalParams, + hasRequiredLinkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/MethodEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/MethodEnum.java new file mode 100644 index 000000000..b7ff376b4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/MethodEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ModelOperation.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ModelOperation.java new file mode 100644 index 000000000..2ac64ef06 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ModelOperation.java @@ -0,0 +1,216 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.modelName, this.availableOperations, this.requiredPostParameters, this.supportedFields); + } + + @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() {} + + @Override + public Builder from(ModelOperation other) { + modelName(other.getModelName()); + availableOperations(other.getAvailableOperations()); + requiredPostParameters(other.getRequiredPostParameters()); + supportedFields(other.getSupportedFields()); + return this; + } + + @Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @Override + public _FinalStage addAllSupportedFields(List supportedFields) { + this.supportedFields.addAll(supportedFields); + return this; + } + + @Override + public _FinalStage addSupportedFields(String supportedFields) { + this.supportedFields.add(supportedFields); + return this; + } + + @Override + @JsonSetter(value = "supported_fields", nulls = Nulls.SKIP) + public _FinalStage supportedFields(List supportedFields) { + this.supportedFields.clear(); + this.supportedFields.addAll(supportedFields); + return this; + } + + @Override + public _FinalStage addAllRequiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.addAll(requiredPostParameters); + return this; + } + + @Override + public _FinalStage addRequiredPostParameters(String requiredPostParameters) { + this.requiredPostParameters.add(requiredPostParameters); + return this; + } + + @Override + @JsonSetter(value = "required_post_parameters", nulls = Nulls.SKIP) + public _FinalStage requiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.clear(); + this.requiredPostParameters.addAll(requiredPostParameters); + return this; + } + + @Override + public _FinalStage addAllAvailableOperations(List availableOperations) { + this.availableOperations.addAll(availableOperations); + return this; + } + + @Override + public _FinalStage addAvailableOperations(String availableOperations) { + this.availableOperations.add(availableOperations); + return this; + } + + @Override + @JsonSetter(value = "available_operations", nulls = Nulls.SKIP) + public _FinalStage availableOperations(List availableOperations) { + this.availableOperations.clear(); + this.availableOperations.addAll(availableOperations); + return this; + } + + @Override + public ModelOperation build() { + return new ModelOperation( + modelName, availableOperations, requiredPostParameters, supportedFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ModelPermissionDeserializer.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ModelPermissionDeserializer.java new file mode 100644 index 000000000..e8a41c94b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ModelPermissionDeserializer.java @@ -0,0 +1,89 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @Override + 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/legacy/api/resources/accounting/types/ModelPermissionDeserializerRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ModelPermissionDeserializerRequest.java new file mode 100644 index 000000000..ce9df50e7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ModelPermissionDeserializerRequest.java @@ -0,0 +1,90 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @Override + 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/legacy/api/resources/accounting/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/MultipartFormFieldRequest.java new file mode 100644 index 000000000..b5c685342 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/MultipartFormFieldRequest.java @@ -0,0 +1,259 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.data, this.encoding, this.fileName, this.contentType); + } + + @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() {} + + @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. + */ + @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. + */ + @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. + */ + @Override + public _FinalStage contentType(String contentType) { + this.contentType = Optional.ofNullable(contentType); + return this; + } + + @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. + */ + @Override + public _FinalStage fileName(String fileName) { + this.fileName = Optional.ofNullable(fileName); + return this; + } + + @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. + */ + @Override + public _FinalStage encoding(MultipartFormFieldRequestEncoding encoding) { + this.encoding = Optional.ofNullable(encoding); + return this; + } + + @Override + @JsonSetter(value = "encoding", nulls = Nulls.SKIP) + public _FinalStage encoding(Optional encoding) { + this.encoding = encoding; + return this; + } + + @Override + public MultipartFormFieldRequest build() { + return new MultipartFormFieldRequest(name, data, encoding, fileName, contentType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/MultipartFormFieldRequestEncoding.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/MultipartFormFieldRequestEncoding.java new file mode 100644 index 000000000..8983da59c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/MultipartFormFieldRequestEncoding.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedAccountDetailsAndActionsList.java new file mode 100644 index 000000000..434273654 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedAccountDetailsAndActionsList.java @@ -0,0 +1,135 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/accounting/types/PaginatedAccountList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedAccountList.java new file mode 100644 index 000000000..93757f9f0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedAccountList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/accounting/types/PaginatedAccountingAttachmentList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedAccountingAttachmentList.java new file mode 100644 index 000000000..63ce624fc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedAccountingAttachmentList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAccountingAttachmentList.Builder.class) +public final class PaginatedAccountingAttachmentList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAccountingAttachmentList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAccountingAttachmentList && equalTo((PaginatedAccountingAttachmentList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAccountingAttachmentList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedAccountingAttachmentList 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 PaginatedAccountingAttachmentList build() { + return new PaginatedAccountingAttachmentList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedAccountingPeriodList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedAccountingPeriodList.java new file mode 100644 index 000000000..04feb9e06 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedAccountingPeriodList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAccountingPeriodList.Builder.class) +public final class PaginatedAccountingPeriodList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAccountingPeriodList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAccountingPeriodList && equalTo((PaginatedAccountingPeriodList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAccountingPeriodList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedAccountingPeriodList 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 PaginatedAccountingPeriodList build() { + return new PaginatedAccountingPeriodList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedAuditLogEventList.java new file mode 100644 index 000000000..09147521a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedAuditLogEventList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/accounting/types/PaginatedBalanceSheetList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedBalanceSheetList.java new file mode 100644 index 000000000..2c38762a5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedBalanceSheetList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedBalanceSheetList.Builder.class) +public final class PaginatedBalanceSheetList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedBalanceSheetList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedBalanceSheetList && equalTo((PaginatedBalanceSheetList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedBalanceSheetList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedBalanceSheetList 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 PaginatedBalanceSheetList build() { + return new PaginatedBalanceSheetList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedBankFeedAccountList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedBankFeedAccountList.java new file mode 100644 index 000000000..cbc993cfd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedBankFeedAccountList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedBankFeedAccountList.Builder.class) +public final class PaginatedBankFeedAccountList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedBankFeedAccountList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedBankFeedAccountList && equalTo((PaginatedBankFeedAccountList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedBankFeedAccountList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedBankFeedAccountList 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 PaginatedBankFeedAccountList build() { + return new PaginatedBankFeedAccountList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedBankFeedTransactionList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedBankFeedTransactionList.java new file mode 100644 index 000000000..159ec15f4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedBankFeedTransactionList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedBankFeedTransactionList.Builder.class) +public final class PaginatedBankFeedTransactionList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedBankFeedTransactionList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedBankFeedTransactionList && equalTo((PaginatedBankFeedTransactionList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedBankFeedTransactionList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedBankFeedTransactionList 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 PaginatedBankFeedTransactionList build() { + return new PaginatedBankFeedTransactionList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedCashFlowStatementList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedCashFlowStatementList.java new file mode 100644 index 000000000..7ed97cd44 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedCashFlowStatementList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedCashFlowStatementList.Builder.class) +public final class PaginatedCashFlowStatementList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedCashFlowStatementList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedCashFlowStatementList && equalTo((PaginatedCashFlowStatementList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedCashFlowStatementList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedCashFlowStatementList 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 PaginatedCashFlowStatementList build() { + return new PaginatedCashFlowStatementList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedCompanyInfoList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedCompanyInfoList.java new file mode 100644 index 000000000..86bd91a80 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedCompanyInfoList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedCompanyInfoList.Builder.class) +public final class PaginatedCompanyInfoList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedCompanyInfoList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedCompanyInfoList && equalTo((PaginatedCompanyInfoList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedCompanyInfoList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedCompanyInfoList 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 PaginatedCompanyInfoList build() { + return new PaginatedCompanyInfoList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedContactList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedContactList.java new file mode 100644 index 000000000..83eb32565 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedContactList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/accounting/types/PaginatedCreditNoteList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedCreditNoteList.java new file mode 100644 index 000000000..7bbefca6e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedCreditNoteList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedCreditNoteList.Builder.class) +public final class PaginatedCreditNoteList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedCreditNoteList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedCreditNoteList && equalTo((PaginatedCreditNoteList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedCreditNoteList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedCreditNoteList 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 PaginatedCreditNoteList build() { + return new PaginatedCreditNoteList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedEmployeeList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedEmployeeList.java new file mode 100644 index 000000000..d14b4dc0c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedEmployeeList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/accounting/types/PaginatedExpenseList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedExpenseList.java new file mode 100644 index 000000000..732750e18 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedExpenseList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedExpenseList.Builder.class) +public final class PaginatedExpenseList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedExpenseList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedExpenseList && equalTo((PaginatedExpenseList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedExpenseList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedExpenseList 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 PaginatedExpenseList build() { + return new PaginatedExpenseList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedGeneralLedgerTransactionList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedGeneralLedgerTransactionList.java new file mode 100644 index 000000000..5a229b715 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedGeneralLedgerTransactionList.java @@ -0,0 +1,135 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedGeneralLedgerTransactionList.Builder.class) +public final class PaginatedGeneralLedgerTransactionList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedGeneralLedgerTransactionList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedGeneralLedgerTransactionList + && equalTo((PaginatedGeneralLedgerTransactionList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedGeneralLedgerTransactionList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedGeneralLedgerTransactionList 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 PaginatedGeneralLedgerTransactionList build() { + return new PaginatedGeneralLedgerTransactionList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedIncomeStatementList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedIncomeStatementList.java new file mode 100644 index 000000000..7693fd66e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedIncomeStatementList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedIncomeStatementList.Builder.class) +public final class PaginatedIncomeStatementList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedIncomeStatementList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedIncomeStatementList && equalTo((PaginatedIncomeStatementList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedIncomeStatementList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedIncomeStatementList 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 PaginatedIncomeStatementList build() { + return new PaginatedIncomeStatementList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedInvoiceList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedInvoiceList.java new file mode 100644 index 000000000..5f3c9d3a8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedInvoiceList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedInvoiceList.Builder.class) +public final class PaginatedInvoiceList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedInvoiceList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedInvoiceList && equalTo((PaginatedInvoiceList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedInvoiceList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedInvoiceList 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 PaginatedInvoiceList build() { + return new PaginatedInvoiceList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedIssueList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedIssueList.java new file mode 100644 index 000000000..2300c3440 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedIssueList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/accounting/types/PaginatedItemList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedItemList.java new file mode 100644 index 000000000..938929f7c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedItemList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedItemList.Builder.class) +public final class PaginatedItemList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedItemList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedItemList && equalTo((PaginatedItemList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedItemList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedItemList 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 PaginatedItemList build() { + return new PaginatedItemList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedJournalEntryList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedJournalEntryList.java new file mode 100644 index 000000000..b8ef0e3f5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedJournalEntryList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedJournalEntryList.Builder.class) +public final class PaginatedJournalEntryList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedJournalEntryList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedJournalEntryList && equalTo((PaginatedJournalEntryList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedJournalEntryList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedJournalEntryList 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 PaginatedJournalEntryList build() { + return new PaginatedJournalEntryList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedPaymentList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedPaymentList.java new file mode 100644 index 000000000..097938202 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedPaymentList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedPaymentList.Builder.class) +public final class PaginatedPaymentList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedPaymentList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedPaymentList && equalTo((PaginatedPaymentList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedPaymentList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedPaymentList 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 PaginatedPaymentList build() { + return new PaginatedPaymentList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedPurchaseOrderList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedPurchaseOrderList.java new file mode 100644 index 000000000..7d6c34b09 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedPurchaseOrderList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedPurchaseOrderList.Builder.class) +public final class PaginatedPurchaseOrderList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedPurchaseOrderList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedPurchaseOrderList && equalTo((PaginatedPurchaseOrderList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedPurchaseOrderList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedPurchaseOrderList 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 PaginatedPurchaseOrderList build() { + return new PaginatedPurchaseOrderList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedRemoteFieldClassList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedRemoteFieldClassList.java new file mode 100644 index 000000000..573f9e168 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedRemoteFieldClassList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/accounting/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedSyncStatusList.java new file mode 100644 index 000000000..c49398432 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedSyncStatusList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/accounting/types/PaginatedTaxRateList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedTaxRateList.java new file mode 100644 index 000000000..8471a6b65 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedTaxRateList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedTaxRateList.Builder.class) +public final class PaginatedTaxRateList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedTaxRateList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedTaxRateList && equalTo((PaginatedTaxRateList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedTaxRateList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedTaxRateList 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 PaginatedTaxRateList build() { + return new PaginatedTaxRateList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedTrackingCategoryList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedTrackingCategoryList.java new file mode 100644 index 000000000..df6f6c9b2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedTrackingCategoryList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedTrackingCategoryList.Builder.class) +public final class PaginatedTrackingCategoryList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedTrackingCategoryList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedTrackingCategoryList && equalTo((PaginatedTrackingCategoryList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedTrackingCategoryList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedTrackingCategoryList 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 PaginatedTrackingCategoryList build() { + return new PaginatedTrackingCategoryList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedTransactionList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedTransactionList.java new file mode 100644 index 000000000..cbc084f94 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedTransactionList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedTransactionList.Builder.class) +public final class PaginatedTransactionList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedTransactionList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedTransactionList && equalTo((PaginatedTransactionList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedTransactionList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedTransactionList 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 PaginatedTransactionList build() { + return new PaginatedTransactionList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedVendorCreditList.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedVendorCreditList.java new file mode 100644 index 000000000..e9645ec37 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaginatedVendorCreditList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedVendorCreditList.Builder.class) +public final class PaginatedVendorCreditList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedVendorCreditList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedVendorCreditList && equalTo((PaginatedVendorCreditList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedVendorCreditList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedVendorCreditList 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 PaginatedVendorCreditList build() { + return new PaginatedVendorCreditList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequest.java new file mode 100644 index 000000000..f4470d0f6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequest.java @@ -0,0 +1,776 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PatchedPaymentRequest.Builder.class) +public final class PatchedPaymentRequest { + private final Optional transactionDate; + + private final Optional contact; + + private final Optional account; + + private final Optional currency; + + private final Optional exchangeRate; + + private final Optional company; + + private final Optional totalAmount; + + private final Optional type; + + private final Optional>> trackingCategories; + + private final Optional accountingPeriod; + + private final Optional> appliedToLines; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private PatchedPaymentRequest( + Optional transactionDate, + Optional contact, + Optional account, + Optional currency, + Optional exchangeRate, + Optional company, + Optional totalAmount, + Optional type, + Optional>> trackingCategories, + Optional accountingPeriod, + Optional> appliedToLines, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.transactionDate = transactionDate; + this.contact = contact; + this.account = account; + this.currency = currency; + this.exchangeRate = exchangeRate; + this.company = company; + this.totalAmount = totalAmount; + this.type = type; + this.trackingCategories = trackingCategories; + this.accountingPeriod = accountingPeriod; + this.appliedToLines = appliedToLines; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The payment's transaction date. + */ + @JsonProperty("transaction_date") + public Optional getTransactionDate() { + return transactionDate; + } + + /** + * @return The supplier, or customer involved in the payment. + */ + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + + /** + * @return The supplier’s or customer’s account in which the payment is made. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The payment'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 payment's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return The company the payment belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The total amount of money being paid to the supplier, or customer, after taxes. + */ + @JsonProperty("total_amount") + public Optional getTotalAmount() { + return totalAmount; + } + + /** + * @return The type of the invoice. + *
    + *
  • ACCOUNTS_PAYABLE - ACCOUNTS_PAYABLE
  • + *
  • ACCOUNTS_RECEIVABLE - ACCOUNTS_RECEIVABLE
  • + *
+ */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The accounting period that the Payment was generated in. + */ + @JsonProperty("accounting_period") + public Optional getAccountingPeriod() { + return accountingPeriod; + } + + /** + * @return A list of “Payment Applied to Lines” objects. + */ + @JsonProperty("applied_to_lines") + public Optional> getAppliedToLines() { + return appliedToLines; + } + + @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedPaymentRequest && equalTo((PatchedPaymentRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedPaymentRequest other) { + return transactionDate.equals(other.transactionDate) + && contact.equals(other.contact) + && account.equals(other.account) + && currency.equals(other.currency) + && exchangeRate.equals(other.exchangeRate) + && company.equals(other.company) + && totalAmount.equals(other.totalAmount) + && type.equals(other.type) + && trackingCategories.equals(other.trackingCategories) + && accountingPeriod.equals(other.accountingPeriod) + && appliedToLines.equals(other.appliedToLines) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.transactionDate, + this.contact, + this.account, + this.currency, + this.exchangeRate, + this.company, + this.totalAmount, + this.type, + this.trackingCategories, + this.accountingPeriod, + this.appliedToLines, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional transactionDate = Optional.empty(); + + private Optional contact = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional>> trackingCategories = + Optional.empty(); + + private Optional accountingPeriod = Optional.empty(); + + private Optional> appliedToLines = 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(PatchedPaymentRequest other) { + transactionDate(other.getTransactionDate()); + contact(other.getContact()); + account(other.getAccount()); + currency(other.getCurrency()); + exchangeRate(other.getExchangeRate()); + company(other.getCompany()); + totalAmount(other.getTotalAmount()); + type(other.getType()); + trackingCategories(other.getTrackingCategories()); + accountingPeriod(other.getAccountingPeriod()); + appliedToLines(other.getAppliedToLines()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + remoteFields(other.getRemoteFields()); + return this; + } + + @JsonSetter(value = "transaction_date", nulls = Nulls.SKIP) + public Builder transactionDate(Optional transactionDate) { + this.transactionDate = transactionDate; + return this; + } + + public Builder transactionDate(OffsetDateTime transactionDate) { + this.transactionDate = Optional.ofNullable(transactionDate); + return this; + } + + @JsonSetter(value = "contact", nulls = Nulls.SKIP) + public Builder contact(Optional contact) { + this.contact = contact; + return this; + } + + public Builder contact(PatchedPaymentRequestContact contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(PatchedPaymentRequestAccount account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(PatchedPaymentRequestCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(PatchedPaymentRequestCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "total_amount", nulls = Nulls.SKIP) + public Builder totalAmount(Optional totalAmount) { + this.totalAmount = totalAmount; + return this; + } + + public Builder totalAmount(Double totalAmount) { + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(PatchedPaymentRequestType type) { + this.type = Optional.ofNullable(type); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories( + List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + @JsonSetter(value = "accounting_period", nulls = Nulls.SKIP) + public Builder accountingPeriod(Optional accountingPeriod) { + this.accountingPeriod = accountingPeriod; + return this; + } + + public Builder accountingPeriod(PatchedPaymentRequestAccountingPeriod accountingPeriod) { + this.accountingPeriod = Optional.ofNullable(accountingPeriod); + return this; + } + + @JsonSetter(value = "applied_to_lines", nulls = Nulls.SKIP) + public Builder appliedToLines(Optional> appliedToLines) { + this.appliedToLines = appliedToLines; + return this; + } + + public Builder appliedToLines(List appliedToLines) { + this.appliedToLines = Optional.ofNullable(appliedToLines); + 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 PatchedPaymentRequest build() { + return new PatchedPaymentRequest( + transactionDate, + contact, + account, + currency, + exchangeRate, + company, + totalAmount, + type, + trackingCategories, + accountingPeriod, + appliedToLines, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequestAccount.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequestAccount.java new file mode 100644 index 000000000..29e1d147b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequestAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PatchedPaymentRequestAccount.Deserializer.class) +public final class PatchedPaymentRequestAccount { + private final Object value; + + private final int type; + + private PatchedPaymentRequestAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedPaymentRequestAccount && equalTo((PatchedPaymentRequestAccount) other); + } + + private boolean equalTo(PatchedPaymentRequestAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PatchedPaymentRequestAccount of(String value) { + return new PatchedPaymentRequestAccount(value, 0); + } + + public static PatchedPaymentRequestAccount of(Account value) { + return new PatchedPaymentRequestAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PatchedPaymentRequestAccount.class); + } + + @Override + public PatchedPaymentRequestAccount 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/legacy/api/resources/accounting/types/PatchedPaymentRequestAccountingPeriod.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequestAccountingPeriod.java new file mode 100644 index 000000000..3fd7e60a7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequestAccountingPeriod.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PatchedPaymentRequestAccountingPeriod.Deserializer.class) +public final class PatchedPaymentRequestAccountingPeriod { + private final Object value; + + private final int type; + + private PatchedPaymentRequestAccountingPeriod(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((AccountingPeriod) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedPaymentRequestAccountingPeriod + && equalTo((PatchedPaymentRequestAccountingPeriod) other); + } + + private boolean equalTo(PatchedPaymentRequestAccountingPeriod other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PatchedPaymentRequestAccountingPeriod of(String value) { + return new PatchedPaymentRequestAccountingPeriod(value, 0); + } + + public static PatchedPaymentRequestAccountingPeriod of(AccountingPeriod value) { + return new PatchedPaymentRequestAccountingPeriod(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(AccountingPeriod value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PatchedPaymentRequestAccountingPeriod.class); + } + + @Override + public PatchedPaymentRequestAccountingPeriod 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, AccountingPeriod.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequestAppliedToLinesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequestAppliedToLinesItem.java new file mode 100644 index 000000000..7b95060fa --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequestAppliedToLinesItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PatchedPaymentRequestAppliedToLinesItem.Deserializer.class) +public final class PatchedPaymentRequestAppliedToLinesItem { + private final Object value; + + private final int type; + + private PatchedPaymentRequestAppliedToLinesItem(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((PaymentLineItemRequest) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedPaymentRequestAppliedToLinesItem + && equalTo((PatchedPaymentRequestAppliedToLinesItem) other); + } + + private boolean equalTo(PatchedPaymentRequestAppliedToLinesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PatchedPaymentRequestAppliedToLinesItem of(String value) { + return new PatchedPaymentRequestAppliedToLinesItem(value, 0); + } + + public static PatchedPaymentRequestAppliedToLinesItem of(PaymentLineItemRequest value) { + return new PatchedPaymentRequestAppliedToLinesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PaymentLineItemRequest value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PatchedPaymentRequestAppliedToLinesItem.class); + } + + @Override + public PatchedPaymentRequestAppliedToLinesItem 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, PaymentLineItemRequest.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequestCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequestCompany.java new file mode 100644 index 000000000..83a296a3c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequestCompany.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PatchedPaymentRequestCompany.Deserializer.class) +public final class PatchedPaymentRequestCompany { + private final Object value; + + private final int type; + + private PatchedPaymentRequestCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedPaymentRequestCompany && equalTo((PatchedPaymentRequestCompany) other); + } + + private boolean equalTo(PatchedPaymentRequestCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PatchedPaymentRequestCompany of(String value) { + return new PatchedPaymentRequestCompany(value, 0); + } + + public static PatchedPaymentRequestCompany of(CompanyInfo value) { + return new PatchedPaymentRequestCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PatchedPaymentRequestCompany.class); + } + + @Override + public PatchedPaymentRequestCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequestContact.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequestContact.java new file mode 100644 index 000000000..b9ace3f21 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequestContact.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PatchedPaymentRequestContact.Deserializer.class) +public final class PatchedPaymentRequestContact { + private final Object value; + + private final int type; + + private PatchedPaymentRequestContact(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedPaymentRequestContact && equalTo((PatchedPaymentRequestContact) other); + } + + private boolean equalTo(PatchedPaymentRequestContact other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PatchedPaymentRequestContact of(String value) { + return new PatchedPaymentRequestContact(value, 0); + } + + public static PatchedPaymentRequestContact of(Contact value) { + return new PatchedPaymentRequestContact(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PatchedPaymentRequestContact.class); + } + + @Override + public PatchedPaymentRequestContact 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequestCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequestCurrency.java new file mode 100644 index 000000000..13cd53146 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequestCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/PatchedPaymentRequestTrackingCategoriesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequestTrackingCategoriesItem.java new file mode 100644 index 000000000..ba38602a3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequestTrackingCategoriesItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PatchedPaymentRequestTrackingCategoriesItem.Deserializer.class) +public final class PatchedPaymentRequestTrackingCategoriesItem { + private final Object value; + + private final int type; + + private PatchedPaymentRequestTrackingCategoriesItem(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedPaymentRequestTrackingCategoriesItem + && equalTo((PatchedPaymentRequestTrackingCategoriesItem) other); + } + + private boolean equalTo(PatchedPaymentRequestTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PatchedPaymentRequestTrackingCategoriesItem of(String value) { + return new PatchedPaymentRequestTrackingCategoriesItem(value, 0); + } + + public static PatchedPaymentRequestTrackingCategoriesItem of(TrackingCategory value) { + return new PatchedPaymentRequestTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PatchedPaymentRequestTrackingCategoriesItem.class); + } + + @Override + public PatchedPaymentRequestTrackingCategoriesItem 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequestType.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequestType.java new file mode 100644 index 000000000..04a1df2d5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PatchedPaymentRequestType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/Payment.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/Payment.java new file mode 100644 index 000000000..34a16f6c5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/Payment.java @@ -0,0 +1,944 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Payment.Builder.class) +public final class Payment { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional transactionDate; + + private final Optional contact; + + private final Optional account; + + private final Optional currency; + + private final Optional exchangeRate; + + private final Optional company; + + private final Optional totalAmount; + + private final Optional type; + + private final Optional>> trackingCategories; + + private final Optional accountingPeriod; + + private final Optional> appliedToLines; + + private final Optional remoteUpdatedAt; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private Payment( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional transactionDate, + Optional contact, + Optional account, + Optional currency, + Optional exchangeRate, + Optional company, + Optional totalAmount, + Optional type, + Optional>> trackingCategories, + Optional accountingPeriod, + Optional> appliedToLines, + Optional remoteUpdatedAt, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Optional> remoteFields, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.transactionDate = transactionDate; + this.contact = contact; + this.account = account; + this.currency = currency; + this.exchangeRate = exchangeRate; + this.company = company; + this.totalAmount = totalAmount; + this.type = type; + this.trackingCategories = trackingCategories; + this.accountingPeriod = accountingPeriod; + this.appliedToLines = appliedToLines; + this.remoteUpdatedAt = remoteUpdatedAt; + 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 payment's transaction date. + */ + @JsonProperty("transaction_date") + public Optional getTransactionDate() { + return transactionDate; + } + + /** + * @return The supplier, or customer involved in the payment. + */ + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + + /** + * @return The supplier’s or customer’s account in which the payment is made. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The payment'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 payment's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return The company the payment belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The total amount of money being paid to the supplier, or customer, after taxes. + */ + @JsonProperty("total_amount") + public Optional getTotalAmount() { + return totalAmount; + } + + /** + * @return The type of the invoice. + *
    + *
  • ACCOUNTS_PAYABLE - ACCOUNTS_PAYABLE
  • + *
  • ACCOUNTS_RECEIVABLE - ACCOUNTS_RECEIVABLE
  • + *
+ */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The accounting period that the Payment was generated in. + */ + @JsonProperty("accounting_period") + public Optional getAccountingPeriod() { + return accountingPeriod; + } + + /** + * @return A list of “Payment Applied to Lines” objects. + */ + @JsonProperty("applied_to_lines") + public Optional> getAppliedToLines() { + return appliedToLines; + } + + /** + * @return When the third party's payment entry was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Payment && equalTo((Payment) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Payment other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && transactionDate.equals(other.transactionDate) + && contact.equals(other.contact) + && account.equals(other.account) + && currency.equals(other.currency) + && exchangeRate.equals(other.exchangeRate) + && company.equals(other.company) + && totalAmount.equals(other.totalAmount) + && type.equals(other.type) + && trackingCategories.equals(other.trackingCategories) + && accountingPeriod.equals(other.accountingPeriod) + && appliedToLines.equals(other.appliedToLines) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.transactionDate, + this.contact, + this.account, + this.currency, + this.exchangeRate, + this.company, + this.totalAmount, + this.type, + this.trackingCategories, + this.accountingPeriod, + this.appliedToLines, + this.remoteUpdatedAt, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData, + this.remoteFields); + } + + @Override + 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 transactionDate = Optional.empty(); + + private Optional contact = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional accountingPeriod = Optional.empty(); + + private Optional> appliedToLines = Optional.empty(); + + private Optional remoteUpdatedAt = 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(Payment other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + transactionDate(other.getTransactionDate()); + contact(other.getContact()); + account(other.getAccount()); + currency(other.getCurrency()); + exchangeRate(other.getExchangeRate()); + company(other.getCompany()); + totalAmount(other.getTotalAmount()); + type(other.getType()); + trackingCategories(other.getTrackingCategories()); + accountingPeriod(other.getAccountingPeriod()); + appliedToLines(other.getAppliedToLines()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + 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 = "transaction_date", nulls = Nulls.SKIP) + public Builder transactionDate(Optional transactionDate) { + this.transactionDate = transactionDate; + return this; + } + + public Builder transactionDate(OffsetDateTime transactionDate) { + this.transactionDate = Optional.ofNullable(transactionDate); + return this; + } + + @JsonSetter(value = "contact", nulls = Nulls.SKIP) + public Builder contact(Optional contact) { + this.contact = contact; + return this; + } + + public Builder contact(PaymentContact contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(PaymentAccount account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(PaymentCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(PaymentCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "total_amount", nulls = Nulls.SKIP) + public Builder totalAmount(Optional totalAmount) { + this.totalAmount = totalAmount; + return this; + } + + public Builder totalAmount(Double totalAmount) { + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(PaymentType type) { + this.type = Optional.ofNullable(type); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories(Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + @JsonSetter(value = "accounting_period", nulls = Nulls.SKIP) + public Builder accountingPeriod(Optional accountingPeriod) { + this.accountingPeriod = accountingPeriod; + return this; + } + + public Builder accountingPeriod(PaymentAccountingPeriod accountingPeriod) { + this.accountingPeriod = Optional.ofNullable(accountingPeriod); + return this; + } + + @JsonSetter(value = "applied_to_lines", nulls = Nulls.SKIP) + public Builder appliedToLines(Optional> appliedToLines) { + this.appliedToLines = appliedToLines; + return this; + } + + public Builder appliedToLines(List appliedToLines) { + this.appliedToLines = Optional.ofNullable(appliedToLines); + 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_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 Payment build() { + return new Payment( + id, + remoteId, + createdAt, + modifiedAt, + transactionDate, + contact, + account, + currency, + exchangeRate, + company, + totalAmount, + type, + trackingCategories, + accountingPeriod, + appliedToLines, + remoteUpdatedAt, + remoteWasDeleted, + fieldMappings, + remoteData, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentAccount.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentAccount.java new file mode 100644 index 000000000..480f595b7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PaymentAccount.Deserializer.class) +public final class PaymentAccount { + private final Object value; + + private final int type; + + private PaymentAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentAccount && equalTo((PaymentAccount) other); + } + + private boolean equalTo(PaymentAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PaymentAccount of(String value) { + return new PaymentAccount(value, 0); + } + + public static PaymentAccount of(Account value) { + return new PaymentAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PaymentAccount.class); + } + + @Override + public PaymentAccount 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/legacy/api/resources/accounting/types/PaymentAccountingPeriod.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentAccountingPeriod.java new file mode 100644 index 000000000..f59cc1df6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentAccountingPeriod.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PaymentAccountingPeriod.Deserializer.class) +public final class PaymentAccountingPeriod { + private final Object value; + + private final int type; + + private PaymentAccountingPeriod(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((AccountingPeriod) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentAccountingPeriod && equalTo((PaymentAccountingPeriod) other); + } + + private boolean equalTo(PaymentAccountingPeriod other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PaymentAccountingPeriod of(String value) { + return new PaymentAccountingPeriod(value, 0); + } + + public static PaymentAccountingPeriod of(AccountingPeriod value) { + return new PaymentAccountingPeriod(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(AccountingPeriod value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PaymentAccountingPeriod.class); + } + + @Override + public PaymentAccountingPeriod 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, AccountingPeriod.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentAppliedToLinesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentAppliedToLinesItem.java new file mode 100644 index 000000000..7115194ea --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentAppliedToLinesItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PaymentAppliedToLinesItem.Deserializer.class) +public final class PaymentAppliedToLinesItem { + private final Object value; + + private final int type; + + private PaymentAppliedToLinesItem(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((PaymentLineItem) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentAppliedToLinesItem && equalTo((PaymentAppliedToLinesItem) other); + } + + private boolean equalTo(PaymentAppliedToLinesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PaymentAppliedToLinesItem of(String value) { + return new PaymentAppliedToLinesItem(value, 0); + } + + public static PaymentAppliedToLinesItem of(PaymentLineItem value) { + return new PaymentAppliedToLinesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PaymentLineItem value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PaymentAppliedToLinesItem.class); + } + + @Override + public PaymentAppliedToLinesItem 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, PaymentLineItem.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentCompany.java new file mode 100644 index 000000000..a0748f187 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentCompany.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PaymentCompany.Deserializer.class) +public final class PaymentCompany { + private final Object value; + + private final int type; + + private PaymentCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentCompany && equalTo((PaymentCompany) other); + } + + private boolean equalTo(PaymentCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PaymentCompany of(String value) { + return new PaymentCompany(value, 0); + } + + public static PaymentCompany of(CompanyInfo value) { + return new PaymentCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PaymentCompany.class); + } + + @Override + public PaymentCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentContact.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentContact.java new file mode 100644 index 000000000..8cfb7704a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentContact.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PaymentContact.Deserializer.class) +public final class PaymentContact { + private final Object value; + + private final int type; + + private PaymentContact(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentContact && equalTo((PaymentContact) other); + } + + private boolean equalTo(PaymentContact other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PaymentContact of(String value) { + return new PaymentContact(value, 0); + } + + public static PaymentContact of(Contact value) { + return new PaymentContact(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PaymentContact.class); + } + + @Override + public PaymentContact 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentCurrency.java new file mode 100644 index 000000000..722559dc1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/PaymentLineItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentLineItem.java new file mode 100644 index 000000000..aa9e2f98f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentLineItem.java @@ -0,0 +1,298 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = PaymentLineItem.Builder.class) +public final class PaymentLineItem { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional appliedAmount; + + private final Optional appliedDate; + + private final Optional relatedObjectId; + + private final Optional relatedObjectType; + + private final Map additionalProperties; + + private PaymentLineItem( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional appliedAmount, + Optional appliedDate, + Optional relatedObjectId, + Optional relatedObjectType, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.appliedAmount = appliedAmount; + this.appliedDate = appliedDate; + this.relatedObjectId = relatedObjectId; + this.relatedObjectType = relatedObjectType; + 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 amount being applied to the transaction. + */ + @JsonProperty("applied_amount") + public Optional getAppliedAmount() { + return appliedAmount; + } + + /** + * @return The date the payment portion is applied. + */ + @JsonProperty("applied_date") + public Optional getAppliedDate() { + return appliedDate; + } + + /** + * @return The Merge ID of the transaction the payment portion is being applied to. + */ + @JsonProperty("related_object_id") + public Optional getRelatedObjectId() { + return relatedObjectId; + } + + /** + * @return The type of transaction the payment portion is being applied to. Possible values include: INVOICE, JOURNAL_ENTRY, or CREDIT_NOTE. + */ + @JsonProperty("related_object_type") + public Optional getRelatedObjectType() { + return relatedObjectType; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentLineItem && equalTo((PaymentLineItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaymentLineItem other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && appliedAmount.equals(other.appliedAmount) + && appliedDate.equals(other.appliedDate) + && relatedObjectId.equals(other.relatedObjectId) + && relatedObjectType.equals(other.relatedObjectType); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.appliedAmount, + this.appliedDate, + this.relatedObjectId, + this.relatedObjectType); + } + + @Override + 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 appliedAmount = Optional.empty(); + + private Optional appliedDate = Optional.empty(); + + private Optional relatedObjectId = Optional.empty(); + + private Optional relatedObjectType = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaymentLineItem other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + appliedAmount(other.getAppliedAmount()); + appliedDate(other.getAppliedDate()); + relatedObjectId(other.getRelatedObjectId()); + relatedObjectType(other.getRelatedObjectType()); + 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 = "applied_amount", nulls = Nulls.SKIP) + public Builder appliedAmount(Optional appliedAmount) { + this.appliedAmount = appliedAmount; + return this; + } + + public Builder appliedAmount(String appliedAmount) { + this.appliedAmount = Optional.ofNullable(appliedAmount); + return this; + } + + @JsonSetter(value = "applied_date", nulls = Nulls.SKIP) + public Builder appliedDate(Optional appliedDate) { + this.appliedDate = appliedDate; + return this; + } + + public Builder appliedDate(OffsetDateTime appliedDate) { + this.appliedDate = Optional.ofNullable(appliedDate); + return this; + } + + @JsonSetter(value = "related_object_id", nulls = Nulls.SKIP) + public Builder relatedObjectId(Optional relatedObjectId) { + this.relatedObjectId = relatedObjectId; + return this; + } + + public Builder relatedObjectId(String relatedObjectId) { + this.relatedObjectId = Optional.ofNullable(relatedObjectId); + return this; + } + + @JsonSetter(value = "related_object_type", nulls = Nulls.SKIP) + public Builder relatedObjectType(Optional relatedObjectType) { + this.relatedObjectType = relatedObjectType; + return this; + } + + public Builder relatedObjectType(String relatedObjectType) { + this.relatedObjectType = Optional.ofNullable(relatedObjectType); + return this; + } + + public PaymentLineItem build() { + return new PaymentLineItem( + id, + remoteId, + createdAt, + modifiedAt, + appliedAmount, + appliedDate, + relatedObjectId, + relatedObjectType, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentLineItemRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentLineItemRequest.java new file mode 100644 index 000000000..bd7fc004d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentLineItemRequest.java @@ -0,0 +1,290 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaymentLineItemRequest.Builder.class) +public final class PaymentLineItemRequest { + private final Optional remoteId; + + private final Optional appliedAmount; + + private final Optional appliedDate; + + private final Optional relatedObjectId; + + private final Optional relatedObjectType; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private PaymentLineItemRequest( + Optional remoteId, + Optional appliedAmount, + Optional appliedDate, + Optional relatedObjectId, + Optional relatedObjectType, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.remoteId = remoteId; + this.appliedAmount = appliedAmount; + this.appliedDate = appliedDate; + this.relatedObjectId = relatedObjectId; + this.relatedObjectType = relatedObjectType; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The amount being applied to the transaction. + */ + @JsonProperty("applied_amount") + public Optional getAppliedAmount() { + return appliedAmount; + } + + /** + * @return The date the payment portion is applied. + */ + @JsonProperty("applied_date") + public Optional getAppliedDate() { + return appliedDate; + } + + /** + * @return The Merge ID of the transaction the payment portion is being applied to. + */ + @JsonProperty("related_object_id") + public Optional getRelatedObjectId() { + return relatedObjectId; + } + + /** + * @return The type of transaction the payment portion is being applied to. Possible values include: INVOICE, JOURNAL_ENTRY, or CREDIT_NOTE. + */ + @JsonProperty("related_object_type") + public Optional getRelatedObjectType() { + return relatedObjectType; + } + + @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentLineItemRequest && equalTo((PaymentLineItemRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaymentLineItemRequest other) { + return remoteId.equals(other.remoteId) + && appliedAmount.equals(other.appliedAmount) + && appliedDate.equals(other.appliedDate) + && relatedObjectId.equals(other.relatedObjectId) + && relatedObjectType.equals(other.relatedObjectType) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.remoteId, + this.appliedAmount, + this.appliedDate, + this.relatedObjectId, + this.relatedObjectType, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @Override + 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 appliedAmount = Optional.empty(); + + private Optional appliedDate = Optional.empty(); + + private Optional relatedObjectId = Optional.empty(); + + private Optional relatedObjectType = 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(PaymentLineItemRequest other) { + remoteId(other.getRemoteId()); + appliedAmount(other.getAppliedAmount()); + appliedDate(other.getAppliedDate()); + relatedObjectId(other.getRelatedObjectId()); + relatedObjectType(other.getRelatedObjectType()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + remoteFields(other.getRemoteFields()); + 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 = "applied_amount", nulls = Nulls.SKIP) + public Builder appliedAmount(Optional appliedAmount) { + this.appliedAmount = appliedAmount; + return this; + } + + public Builder appliedAmount(String appliedAmount) { + this.appliedAmount = Optional.ofNullable(appliedAmount); + return this; + } + + @JsonSetter(value = "applied_date", nulls = Nulls.SKIP) + public Builder appliedDate(Optional appliedDate) { + this.appliedDate = appliedDate; + return this; + } + + public Builder appliedDate(OffsetDateTime appliedDate) { + this.appliedDate = Optional.ofNullable(appliedDate); + return this; + } + + @JsonSetter(value = "related_object_id", nulls = Nulls.SKIP) + public Builder relatedObjectId(Optional relatedObjectId) { + this.relatedObjectId = relatedObjectId; + return this; + } + + public Builder relatedObjectId(String relatedObjectId) { + this.relatedObjectId = Optional.ofNullable(relatedObjectId); + return this; + } + + @JsonSetter(value = "related_object_type", nulls = Nulls.SKIP) + public Builder relatedObjectType(Optional relatedObjectType) { + this.relatedObjectType = relatedObjectType; + return this; + } + + public Builder relatedObjectType(String relatedObjectType) { + this.relatedObjectType = Optional.ofNullable(relatedObjectType); + 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 PaymentLineItemRequest build() { + return new PaymentLineItemRequest( + remoteId, + appliedAmount, + appliedDate, + relatedObjectId, + relatedObjectType, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequest.java new file mode 100644 index 000000000..e6fc7fa73 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequest.java @@ -0,0 +1,774 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaymentRequest.Builder.class) +public final class PaymentRequest { + private final Optional transactionDate; + + private final Optional contact; + + private final Optional account; + + private final Optional currency; + + private final Optional exchangeRate; + + private final Optional company; + + private final Optional totalAmount; + + private final Optional type; + + private final Optional>> trackingCategories; + + private final Optional accountingPeriod; + + private final Optional> appliedToLines; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private PaymentRequest( + Optional transactionDate, + Optional contact, + Optional account, + Optional currency, + Optional exchangeRate, + Optional company, + Optional totalAmount, + Optional type, + Optional>> trackingCategories, + Optional accountingPeriod, + Optional> appliedToLines, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.transactionDate = transactionDate; + this.contact = contact; + this.account = account; + this.currency = currency; + this.exchangeRate = exchangeRate; + this.company = company; + this.totalAmount = totalAmount; + this.type = type; + this.trackingCategories = trackingCategories; + this.accountingPeriod = accountingPeriod; + this.appliedToLines = appliedToLines; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The payment's transaction date. + */ + @JsonProperty("transaction_date") + public Optional getTransactionDate() { + return transactionDate; + } + + /** + * @return The supplier, or customer involved in the payment. + */ + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + + /** + * @return The supplier’s or customer’s account in which the payment is made. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The payment'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 payment's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return The company the payment belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The total amount of money being paid to the supplier, or customer, after taxes. + */ + @JsonProperty("total_amount") + public Optional getTotalAmount() { + return totalAmount; + } + + /** + * @return The type of the invoice. + *
    + *
  • ACCOUNTS_PAYABLE - ACCOUNTS_PAYABLE
  • + *
  • ACCOUNTS_RECEIVABLE - ACCOUNTS_RECEIVABLE
  • + *
+ */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The accounting period that the Payment was generated in. + */ + @JsonProperty("accounting_period") + public Optional getAccountingPeriod() { + return accountingPeriod; + } + + /** + * @return A list of “Payment Applied to Lines” objects. + */ + @JsonProperty("applied_to_lines") + public Optional> getAppliedToLines() { + return appliedToLines; + } + + @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentRequest && equalTo((PaymentRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaymentRequest other) { + return transactionDate.equals(other.transactionDate) + && contact.equals(other.contact) + && account.equals(other.account) + && currency.equals(other.currency) + && exchangeRate.equals(other.exchangeRate) + && company.equals(other.company) + && totalAmount.equals(other.totalAmount) + && type.equals(other.type) + && trackingCategories.equals(other.trackingCategories) + && accountingPeriod.equals(other.accountingPeriod) + && appliedToLines.equals(other.appliedToLines) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.transactionDate, + this.contact, + this.account, + this.currency, + this.exchangeRate, + this.company, + this.totalAmount, + this.type, + this.trackingCategories, + this.accountingPeriod, + this.appliedToLines, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional transactionDate = Optional.empty(); + + private Optional contact = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional accountingPeriod = Optional.empty(); + + private Optional> appliedToLines = 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(PaymentRequest other) { + transactionDate(other.getTransactionDate()); + contact(other.getContact()); + account(other.getAccount()); + currency(other.getCurrency()); + exchangeRate(other.getExchangeRate()); + company(other.getCompany()); + totalAmount(other.getTotalAmount()); + type(other.getType()); + trackingCategories(other.getTrackingCategories()); + accountingPeriod(other.getAccountingPeriod()); + appliedToLines(other.getAppliedToLines()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + remoteFields(other.getRemoteFields()); + return this; + } + + @JsonSetter(value = "transaction_date", nulls = Nulls.SKIP) + public Builder transactionDate(Optional transactionDate) { + this.transactionDate = transactionDate; + return this; + } + + public Builder transactionDate(OffsetDateTime transactionDate) { + this.transactionDate = Optional.ofNullable(transactionDate); + return this; + } + + @JsonSetter(value = "contact", nulls = Nulls.SKIP) + public Builder contact(Optional contact) { + this.contact = contact; + return this; + } + + public Builder contact(PaymentRequestContact contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(PaymentRequestAccount account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(PaymentRequestCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(PaymentRequestCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "total_amount", nulls = Nulls.SKIP) + public Builder totalAmount(Optional totalAmount) { + this.totalAmount = totalAmount; + return this; + } + + public Builder totalAmount(Double totalAmount) { + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(PaymentRequestType type) { + this.type = Optional.ofNullable(type); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + @JsonSetter(value = "accounting_period", nulls = Nulls.SKIP) + public Builder accountingPeriod(Optional accountingPeriod) { + this.accountingPeriod = accountingPeriod; + return this; + } + + public Builder accountingPeriod(PaymentRequestAccountingPeriod accountingPeriod) { + this.accountingPeriod = Optional.ofNullable(accountingPeriod); + return this; + } + + @JsonSetter(value = "applied_to_lines", nulls = Nulls.SKIP) + public Builder appliedToLines(Optional> appliedToLines) { + this.appliedToLines = appliedToLines; + return this; + } + + public Builder appliedToLines(List appliedToLines) { + this.appliedToLines = Optional.ofNullable(appliedToLines); + 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 PaymentRequest build() { + return new PaymentRequest( + transactionDate, + contact, + account, + currency, + exchangeRate, + company, + totalAmount, + type, + trackingCategories, + accountingPeriod, + appliedToLines, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequestAccount.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequestAccount.java new file mode 100644 index 000000000..ed0e553b1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequestAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PaymentRequestAccount.Deserializer.class) +public final class PaymentRequestAccount { + private final Object value; + + private final int type; + + private PaymentRequestAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentRequestAccount && equalTo((PaymentRequestAccount) other); + } + + private boolean equalTo(PaymentRequestAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PaymentRequestAccount of(String value) { + return new PaymentRequestAccount(value, 0); + } + + public static PaymentRequestAccount of(Account value) { + return new PaymentRequestAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PaymentRequestAccount.class); + } + + @Override + public PaymentRequestAccount 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/legacy/api/resources/accounting/types/PaymentRequestAccountingPeriod.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequestAccountingPeriod.java new file mode 100644 index 000000000..48a665f9d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequestAccountingPeriod.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PaymentRequestAccountingPeriod.Deserializer.class) +public final class PaymentRequestAccountingPeriod { + private final Object value; + + private final int type; + + private PaymentRequestAccountingPeriod(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((AccountingPeriod) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentRequestAccountingPeriod && equalTo((PaymentRequestAccountingPeriod) other); + } + + private boolean equalTo(PaymentRequestAccountingPeriod other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PaymentRequestAccountingPeriod of(String value) { + return new PaymentRequestAccountingPeriod(value, 0); + } + + public static PaymentRequestAccountingPeriod of(AccountingPeriod value) { + return new PaymentRequestAccountingPeriod(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(AccountingPeriod value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PaymentRequestAccountingPeriod.class); + } + + @Override + public PaymentRequestAccountingPeriod 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, AccountingPeriod.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequestAppliedToLinesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequestAppliedToLinesItem.java new file mode 100644 index 000000000..d64782caa --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequestAppliedToLinesItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PaymentRequestAppliedToLinesItem.Deserializer.class) +public final class PaymentRequestAppliedToLinesItem { + private final Object value; + + private final int type; + + private PaymentRequestAppliedToLinesItem(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((PaymentLineItemRequest) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentRequestAppliedToLinesItem && equalTo((PaymentRequestAppliedToLinesItem) other); + } + + private boolean equalTo(PaymentRequestAppliedToLinesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PaymentRequestAppliedToLinesItem of(String value) { + return new PaymentRequestAppliedToLinesItem(value, 0); + } + + public static PaymentRequestAppliedToLinesItem of(PaymentLineItemRequest value) { + return new PaymentRequestAppliedToLinesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PaymentLineItemRequest value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PaymentRequestAppliedToLinesItem.class); + } + + @Override + public PaymentRequestAppliedToLinesItem 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, PaymentLineItemRequest.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequestCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequestCompany.java new file mode 100644 index 000000000..9a6005083 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequestCompany.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PaymentRequestCompany.Deserializer.class) +public final class PaymentRequestCompany { + private final Object value; + + private final int type; + + private PaymentRequestCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentRequestCompany && equalTo((PaymentRequestCompany) other); + } + + private boolean equalTo(PaymentRequestCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PaymentRequestCompany of(String value) { + return new PaymentRequestCompany(value, 0); + } + + public static PaymentRequestCompany of(CompanyInfo value) { + return new PaymentRequestCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PaymentRequestCompany.class); + } + + @Override + public PaymentRequestCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequestContact.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequestContact.java new file mode 100644 index 000000000..a90a611da --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequestContact.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PaymentRequestContact.Deserializer.class) +public final class PaymentRequestContact { + private final Object value; + + private final int type; + + private PaymentRequestContact(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentRequestContact && equalTo((PaymentRequestContact) other); + } + + private boolean equalTo(PaymentRequestContact other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PaymentRequestContact of(String value) { + return new PaymentRequestContact(value, 0); + } + + public static PaymentRequestContact of(Contact value) { + return new PaymentRequestContact(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PaymentRequestContact.class); + } + + @Override + public PaymentRequestContact 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequestCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequestCurrency.java new file mode 100644 index 000000000..986be4d7f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequestCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/PaymentRequestTrackingCategoriesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequestTrackingCategoriesItem.java new file mode 100644 index 000000000..61a49d190 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequestTrackingCategoriesItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PaymentRequestTrackingCategoriesItem.Deserializer.class) +public final class PaymentRequestTrackingCategoriesItem { + private final Object value; + + private final int type; + + private PaymentRequestTrackingCategoriesItem(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentRequestTrackingCategoriesItem + && equalTo((PaymentRequestTrackingCategoriesItem) other); + } + + private boolean equalTo(PaymentRequestTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PaymentRequestTrackingCategoriesItem of(String value) { + return new PaymentRequestTrackingCategoriesItem(value, 0); + } + + public static PaymentRequestTrackingCategoriesItem of(TrackingCategory value) { + return new PaymentRequestTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PaymentRequestTrackingCategoriesItem.class); + } + + @Override + public PaymentRequestTrackingCategoriesItem 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequestType.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequestType.java new file mode 100644 index 000000000..1aa2b88bf --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentRequestType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/PaymentResponse.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentResponse.java new file mode 100644 index 000000000..e670fa063 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaymentResponse.Builder.class) +public final class PaymentResponse { + private final Payment model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private PaymentResponse( + Payment 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 Payment getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentResponse && equalTo((PaymentResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaymentResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull Payment model); + + Builder from(PaymentResponse other); + } + + public interface _FinalStage { + PaymentResponse 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 Payment model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(PaymentResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull Payment model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public PaymentResponse build() { + return new PaymentResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentTrackingCategoriesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentTrackingCategoriesItem.java new file mode 100644 index 000000000..c4368751b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentTrackingCategoriesItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PaymentTrackingCategoriesItem.Deserializer.class) +public final class PaymentTrackingCategoriesItem { + private final Object value; + + private final int type; + + private PaymentTrackingCategoriesItem(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentTrackingCategoriesItem && equalTo((PaymentTrackingCategoriesItem) other); + } + + private boolean equalTo(PaymentTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PaymentTrackingCategoriesItem of(String value) { + return new PaymentTrackingCategoriesItem(value, 0); + } + + public static PaymentTrackingCategoriesItem of(TrackingCategory value) { + return new PaymentTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PaymentTrackingCategoriesItem.class); + } + + @Override + public PaymentTrackingCategoriesItem 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentType.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentType.java new file mode 100644 index 000000000..bdf4bfb69 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/PaymentTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentTypeEnum.java new file mode 100644 index 000000000..2185e0563 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PaymentTypeEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PaymentTypeEnum { + ACCOUNTS_PAYABLE("ACCOUNTS_PAYABLE"), + + ACCOUNTS_RECEIVABLE("ACCOUNTS_RECEIVABLE"); + + private final String value; + + PaymentTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PostingStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PostingStatusEnum.java new file mode 100644 index 000000000..1994daed4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PostingStatusEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PostingStatusEnum { + UNPOSTED("UNPOSTED"), + + POSTED("POSTED"); + + private final String value; + + PostingStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrder.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrder.java new file mode 100644 index 000000000..de3dd1418 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrder.java @@ -0,0 +1,1119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PurchaseOrder.Builder.class) +public final class PurchaseOrder { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional status; + + private final Optional issueDate; + + private final Optional purchaseOrderNumber; + + private final Optional deliveryDate; + + private final Optional deliveryAddress; + + private final Optional customer; + + private final Optional vendor; + + private final Optional memo; + + private final Optional company; + + private final Optional totalAmount; + + private final Optional currency; + + private final Optional exchangeRate; + + private final Optional> lineItems; + + private final Optional inclusiveOfTax; + + private final Optional>> trackingCategories; + + private final Optional accountingPeriod; + + private final Optional remoteCreatedAt; + + private final Optional remoteUpdatedAt; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private PurchaseOrder( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional status, + Optional issueDate, + Optional purchaseOrderNumber, + Optional deliveryDate, + Optional deliveryAddress, + Optional customer, + Optional vendor, + Optional memo, + Optional company, + Optional totalAmount, + Optional currency, + Optional exchangeRate, + Optional> lineItems, + Optional inclusiveOfTax, + Optional>> trackingCategories, + Optional accountingPeriod, + Optional remoteCreatedAt, + Optional remoteUpdatedAt, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Optional> remoteFields, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.status = status; + this.issueDate = issueDate; + this.purchaseOrderNumber = purchaseOrderNumber; + this.deliveryDate = deliveryDate; + this.deliveryAddress = deliveryAddress; + this.customer = customer; + this.vendor = vendor; + this.memo = memo; + this.company = company; + this.totalAmount = totalAmount; + this.currency = currency; + this.exchangeRate = exchangeRate; + this.lineItems = lineItems; + this.inclusiveOfTax = inclusiveOfTax; + this.trackingCategories = trackingCategories; + this.accountingPeriod = accountingPeriod; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteUpdatedAt = remoteUpdatedAt; + 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 purchase order's status. + *
    + *
  • DRAFT - DRAFT
  • + *
  • SUBMITTED - SUBMITTED
  • + *
  • AUTHORIZED - AUTHORIZED
  • + *
  • BILLED - BILLED
  • + *
  • DELETED - DELETED
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The purchase order's issue date. + */ + @JsonProperty("issue_date") + public Optional getIssueDate() { + return issueDate; + } + + /** + * @return The human-readable number of the purchase order. + */ + @JsonProperty("purchase_order_number") + public Optional getPurchaseOrderNumber() { + return purchaseOrderNumber; + } + + /** + * @return The purchase order's delivery date. + */ + @JsonProperty("delivery_date") + public Optional getDeliveryDate() { + return deliveryDate; + } + + /** + * @return The purchase order's delivery address. + */ + @JsonProperty("delivery_address") + public Optional getDeliveryAddress() { + return deliveryAddress; + } + + /** + * @return The contact making the purchase order. + */ + @JsonProperty("customer") + public Optional getCustomer() { + return customer; + } + + /** + * @return The party fulfilling the purchase order. + */ + @JsonProperty("vendor") + public Optional getVendor() { + return vendor; + } + + /** + * @return A memo attached to the purchase order. + */ + @JsonProperty("memo") + public Optional getMemo() { + return memo; + } + + /** + * @return The company the purchase order belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The purchase order's total amount. + */ + @JsonProperty("total_amount") + public Optional getTotalAmount() { + return totalAmount; + } + + /** + * @return The purchase order'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 purchase order's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + @JsonProperty("line_items") + public Optional> getLineItems() { + return lineItems; + } + + /** + * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. + */ + @JsonProperty("inclusive_of_tax") + public Optional getInclusiveOfTax() { + return inclusiveOfTax; + } + + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The accounting period that the PurchaseOrder was generated in. + */ + @JsonProperty("accounting_period") + public Optional getAccountingPeriod() { + return accountingPeriod; + } + + /** + * @return When the third party's purchase order note was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the third party's purchase order note was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrder && equalTo((PurchaseOrder) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PurchaseOrder other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && status.equals(other.status) + && issueDate.equals(other.issueDate) + && purchaseOrderNumber.equals(other.purchaseOrderNumber) + && deliveryDate.equals(other.deliveryDate) + && deliveryAddress.equals(other.deliveryAddress) + && customer.equals(other.customer) + && vendor.equals(other.vendor) + && memo.equals(other.memo) + && company.equals(other.company) + && totalAmount.equals(other.totalAmount) + && currency.equals(other.currency) + && exchangeRate.equals(other.exchangeRate) + && lineItems.equals(other.lineItems) + && inclusiveOfTax.equals(other.inclusiveOfTax) + && trackingCategories.equals(other.trackingCategories) + && accountingPeriod.equals(other.accountingPeriod) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.status, + this.issueDate, + this.purchaseOrderNumber, + this.deliveryDate, + this.deliveryAddress, + this.customer, + this.vendor, + this.memo, + this.company, + this.totalAmount, + this.currency, + this.exchangeRate, + this.lineItems, + this.inclusiveOfTax, + this.trackingCategories, + this.accountingPeriod, + this.remoteCreatedAt, + this.remoteUpdatedAt, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData, + this.remoteFields); + } + + @Override + 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 status = Optional.empty(); + + private Optional issueDate = Optional.empty(); + + private Optional purchaseOrderNumber = Optional.empty(); + + private Optional deliveryDate = Optional.empty(); + + private Optional deliveryAddress = Optional.empty(); + + private Optional customer = Optional.empty(); + + private Optional vendor = Optional.empty(); + + private Optional memo = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional> lineItems = Optional.empty(); + + private Optional inclusiveOfTax = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional accountingPeriod = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteUpdatedAt = 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(PurchaseOrder other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + status(other.getStatus()); + issueDate(other.getIssueDate()); + purchaseOrderNumber(other.getPurchaseOrderNumber()); + deliveryDate(other.getDeliveryDate()); + deliveryAddress(other.getDeliveryAddress()); + customer(other.getCustomer()); + vendor(other.getVendor()); + memo(other.getMemo()); + company(other.getCompany()); + totalAmount(other.getTotalAmount()); + currency(other.getCurrency()); + exchangeRate(other.getExchangeRate()); + lineItems(other.getLineItems()); + inclusiveOfTax(other.getInclusiveOfTax()); + trackingCategories(other.getTrackingCategories()); + accountingPeriod(other.getAccountingPeriod()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + 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 = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(PurchaseOrderStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "issue_date", nulls = Nulls.SKIP) + public Builder issueDate(Optional issueDate) { + this.issueDate = issueDate; + return this; + } + + public Builder issueDate(OffsetDateTime issueDate) { + this.issueDate = Optional.ofNullable(issueDate); + return this; + } + + @JsonSetter(value = "purchase_order_number", nulls = Nulls.SKIP) + public Builder purchaseOrderNumber(Optional purchaseOrderNumber) { + this.purchaseOrderNumber = purchaseOrderNumber; + return this; + } + + public Builder purchaseOrderNumber(String purchaseOrderNumber) { + this.purchaseOrderNumber = Optional.ofNullable(purchaseOrderNumber); + return this; + } + + @JsonSetter(value = "delivery_date", nulls = Nulls.SKIP) + public Builder deliveryDate(Optional deliveryDate) { + this.deliveryDate = deliveryDate; + return this; + } + + public Builder deliveryDate(OffsetDateTime deliveryDate) { + this.deliveryDate = Optional.ofNullable(deliveryDate); + return this; + } + + @JsonSetter(value = "delivery_address", nulls = Nulls.SKIP) + public Builder deliveryAddress(Optional deliveryAddress) { + this.deliveryAddress = deliveryAddress; + return this; + } + + public Builder deliveryAddress(PurchaseOrderDeliveryAddress deliveryAddress) { + this.deliveryAddress = Optional.ofNullable(deliveryAddress); + return this; + } + + @JsonSetter(value = "customer", nulls = Nulls.SKIP) + public Builder customer(Optional customer) { + this.customer = customer; + return this; + } + + public Builder customer(String customer) { + this.customer = Optional.ofNullable(customer); + return this; + } + + @JsonSetter(value = "vendor", nulls = Nulls.SKIP) + public Builder vendor(Optional vendor) { + this.vendor = vendor; + return this; + } + + public Builder vendor(PurchaseOrderVendor vendor) { + this.vendor = Optional.ofNullable(vendor); + return this; + } + + @JsonSetter(value = "memo", nulls = Nulls.SKIP) + public Builder memo(Optional memo) { + this.memo = memo; + return this; + } + + public Builder memo(String memo) { + this.memo = Optional.ofNullable(memo); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(PurchaseOrderCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "total_amount", nulls = Nulls.SKIP) + public Builder totalAmount(Optional totalAmount) { + this.totalAmount = totalAmount; + return this; + } + + public Builder totalAmount(Double totalAmount) { + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(PurchaseOrderCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + @JsonSetter(value = "line_items", nulls = Nulls.SKIP) + public Builder lineItems(Optional> lineItems) { + this.lineItems = lineItems; + return this; + } + + public Builder lineItems(List lineItems) { + this.lineItems = Optional.ofNullable(lineItems); + return this; + } + + @JsonSetter(value = "inclusive_of_tax", nulls = Nulls.SKIP) + public Builder inclusiveOfTax(Optional inclusiveOfTax) { + this.inclusiveOfTax = inclusiveOfTax; + return this; + } + + public Builder inclusiveOfTax(Boolean inclusiveOfTax) { + this.inclusiveOfTax = Optional.ofNullable(inclusiveOfTax); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + @JsonSetter(value = "accounting_period", nulls = Nulls.SKIP) + public Builder accountingPeriod(Optional accountingPeriod) { + this.accountingPeriod = accountingPeriod; + return this; + } + + public Builder accountingPeriod(PurchaseOrderAccountingPeriod accountingPeriod) { + this.accountingPeriod = Optional.ofNullable(accountingPeriod); + 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_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_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 PurchaseOrder build() { + return new PurchaseOrder( + id, + remoteId, + createdAt, + modifiedAt, + status, + issueDate, + purchaseOrderNumber, + deliveryDate, + deliveryAddress, + customer, + vendor, + memo, + company, + totalAmount, + currency, + exchangeRate, + lineItems, + inclusiveOfTax, + trackingCategories, + accountingPeriod, + remoteCreatedAt, + remoteUpdatedAt, + remoteWasDeleted, + fieldMappings, + remoteData, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderAccountingPeriod.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderAccountingPeriod.java new file mode 100644 index 000000000..e21c4e996 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderAccountingPeriod.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PurchaseOrderAccountingPeriod.Deserializer.class) +public final class PurchaseOrderAccountingPeriod { + private final Object value; + + private final int type; + + private PurchaseOrderAccountingPeriod(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((AccountingPeriod) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrderAccountingPeriod && equalTo((PurchaseOrderAccountingPeriod) other); + } + + private boolean equalTo(PurchaseOrderAccountingPeriod other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PurchaseOrderAccountingPeriod of(String value) { + return new PurchaseOrderAccountingPeriod(value, 0); + } + + public static PurchaseOrderAccountingPeriod of(AccountingPeriod value) { + return new PurchaseOrderAccountingPeriod(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(AccountingPeriod value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PurchaseOrderAccountingPeriod.class); + } + + @Override + public PurchaseOrderAccountingPeriod 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, AccountingPeriod.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderCompany.java new file mode 100644 index 000000000..d9c5dfc23 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderCompany.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PurchaseOrderCompany.Deserializer.class) +public final class PurchaseOrderCompany { + private final Object value; + + private final int type; + + private PurchaseOrderCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrderCompany && equalTo((PurchaseOrderCompany) other); + } + + private boolean equalTo(PurchaseOrderCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PurchaseOrderCompany of(String value) { + return new PurchaseOrderCompany(value, 0); + } + + public static PurchaseOrderCompany of(CompanyInfo value) { + return new PurchaseOrderCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PurchaseOrderCompany.class); + } + + @Override + public PurchaseOrderCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderCurrency.java new file mode 100644 index 000000000..9450a7806 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/PurchaseOrderDeliveryAddress.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderDeliveryAddress.java new file mode 100644 index 000000000..561daa7e1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderDeliveryAddress.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PurchaseOrderDeliveryAddress.Deserializer.class) +public final class PurchaseOrderDeliveryAddress { + private final Object value; + + private final int type; + + private PurchaseOrderDeliveryAddress(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((Address) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrderDeliveryAddress && equalTo((PurchaseOrderDeliveryAddress) other); + } + + private boolean equalTo(PurchaseOrderDeliveryAddress other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PurchaseOrderDeliveryAddress of(String value) { + return new PurchaseOrderDeliveryAddress(value, 0); + } + + public static PurchaseOrderDeliveryAddress of(Address value) { + return new PurchaseOrderDeliveryAddress(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Address value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PurchaseOrderDeliveryAddress.class); + } + + @Override + public PurchaseOrderDeliveryAddress 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, Address.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderLineItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderLineItem.java new file mode 100644 index 000000000..44023b3e6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderLineItem.java @@ -0,0 +1,916 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PurchaseOrderLineItem.Builder.class) +public final class PurchaseOrderLineItem { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional description; + + private final Optional unitPrice; + + private final Optional quantity; + + private final Optional item; + + private final Optional account; + + private final Optional trackingCategory; + + private final Optional>> trackingCategories; + + private final Optional taxAmount; + + private final Optional totalLineAmount; + + private final Optional currency; + + private final Optional taxRate; + + private final Optional exchangeRate; + + private final Optional company; + + private final Optional remoteWasDeleted; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private PurchaseOrderLineItem( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional description, + Optional unitPrice, + Optional quantity, + Optional item, + Optional account, + Optional trackingCategory, + Optional>> trackingCategories, + Optional taxAmount, + Optional totalLineAmount, + Optional currency, + Optional taxRate, + Optional exchangeRate, + Optional company, + Optional remoteWasDeleted, + Optional> remoteFields, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.description = description; + this.unitPrice = unitPrice; + this.quantity = quantity; + this.item = item; + this.account = account; + this.trackingCategory = trackingCategory; + this.trackingCategories = trackingCategories; + this.taxAmount = taxAmount; + this.totalLineAmount = totalLineAmount; + this.currency = currency; + this.taxRate = taxRate; + this.exchangeRate = exchangeRate; + this.company = company; + this.remoteWasDeleted = remoteWasDeleted; + 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 A description of the good being purchased. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The line item's unit price. + */ + @JsonProperty("unit_price") + public Optional getUnitPrice() { + return unitPrice; + } + + /** + * @return The line item's quantity. + */ + @JsonProperty("quantity") + public Optional getQuantity() { + return quantity; + } + + @JsonProperty("item") + public Optional getItem() { + return item; + } + + /** + * @return The purchase order line item's account. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The purchase order line item's associated tracking category. + */ + @JsonProperty("tracking_category") + public Optional getTrackingCategory() { + return trackingCategory; + } + + /** + * @return The purchase order line item's associated tracking categories. + */ + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The purchase order line item's tax amount. + */ + @JsonProperty("tax_amount") + public Optional getTaxAmount() { + return taxAmount; + } + + /** + * @return The purchase order line item's total amount. + */ + @JsonProperty("total_line_amount") + public Optional getTotalLineAmount() { + return totalLineAmount; + } + + /** + * @return The purchase order line item'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 tax rate that applies to this line item. + */ + @JsonProperty("tax_rate") + public Optional getTaxRate() { + return taxRate; + } + + /** + * @return The purchase order line item's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return The company the purchase order line item 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("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrderLineItem && equalTo((PurchaseOrderLineItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PurchaseOrderLineItem other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && description.equals(other.description) + && unitPrice.equals(other.unitPrice) + && quantity.equals(other.quantity) + && item.equals(other.item) + && account.equals(other.account) + && trackingCategory.equals(other.trackingCategory) + && trackingCategories.equals(other.trackingCategories) + && taxAmount.equals(other.taxAmount) + && totalLineAmount.equals(other.totalLineAmount) + && currency.equals(other.currency) + && taxRate.equals(other.taxRate) + && exchangeRate.equals(other.exchangeRate) + && company.equals(other.company) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.description, + this.unitPrice, + this.quantity, + this.item, + this.account, + this.trackingCategory, + this.trackingCategories, + this.taxAmount, + this.totalLineAmount, + this.currency, + this.taxRate, + this.exchangeRate, + this.company, + this.remoteWasDeleted, + this.remoteFields); + } + + @Override + 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 description = Optional.empty(); + + private Optional unitPrice = Optional.empty(); + + private Optional quantity = Optional.empty(); + + private Optional item = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional trackingCategory = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional taxAmount = Optional.empty(); + + private Optional totalLineAmount = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional taxRate = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PurchaseOrderLineItem other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + description(other.getDescription()); + unitPrice(other.getUnitPrice()); + quantity(other.getQuantity()); + item(other.getItem()); + account(other.getAccount()); + trackingCategory(other.getTrackingCategory()); + trackingCategories(other.getTrackingCategories()); + taxAmount(other.getTaxAmount()); + totalLineAmount(other.getTotalLineAmount()); + currency(other.getCurrency()); + taxRate(other.getTaxRate()); + exchangeRate(other.getExchangeRate()); + company(other.getCompany()); + remoteWasDeleted(other.getRemoteWasDeleted()); + 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 = "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 = "unit_price", nulls = Nulls.SKIP) + public Builder unitPrice(Optional unitPrice) { + this.unitPrice = unitPrice; + return this; + } + + public Builder unitPrice(Double unitPrice) { + this.unitPrice = Optional.ofNullable(unitPrice); + return this; + } + + @JsonSetter(value = "quantity", nulls = Nulls.SKIP) + public Builder quantity(Optional quantity) { + this.quantity = quantity; + return this; + } + + public Builder quantity(Double quantity) { + this.quantity = Optional.ofNullable(quantity); + return this; + } + + @JsonSetter(value = "item", nulls = Nulls.SKIP) + public Builder item(Optional item) { + this.item = item; + return this; + } + + public Builder item(PurchaseOrderLineItemItem item) { + this.item = Optional.ofNullable(item); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(String account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "tracking_category", nulls = Nulls.SKIP) + public Builder trackingCategory(Optional trackingCategory) { + this.trackingCategory = trackingCategory; + return this; + } + + public Builder trackingCategory(String trackingCategory) { + this.trackingCategory = Optional.ofNullable(trackingCategory); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories(Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + @JsonSetter(value = "tax_amount", nulls = Nulls.SKIP) + public Builder taxAmount(Optional taxAmount) { + this.taxAmount = taxAmount; + return this; + } + + public Builder taxAmount(String taxAmount) { + this.taxAmount = Optional.ofNullable(taxAmount); + return this; + } + + @JsonSetter(value = "total_line_amount", nulls = Nulls.SKIP) + public Builder totalLineAmount(Optional totalLineAmount) { + this.totalLineAmount = totalLineAmount; + return this; + } + + public Builder totalLineAmount(String totalLineAmount) { + this.totalLineAmount = Optional.ofNullable(totalLineAmount); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(PurchaseOrderLineItemCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "tax_rate", nulls = Nulls.SKIP) + public Builder taxRate(Optional taxRate) { + this.taxRate = taxRate; + return this; + } + + public Builder taxRate(String taxRate) { + this.taxRate = Optional.ofNullable(taxRate); + return this; + } + + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + 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 = "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 PurchaseOrderLineItem build() { + return new PurchaseOrderLineItem( + id, + remoteId, + createdAt, + modifiedAt, + description, + unitPrice, + quantity, + item, + account, + trackingCategory, + trackingCategories, + taxAmount, + totalLineAmount, + currency, + taxRate, + exchangeRate, + company, + remoteWasDeleted, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderLineItemCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderLineItemCurrency.java new file mode 100644 index 000000000..f0f064002 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderLineItemCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/PurchaseOrderLineItemItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderLineItemItem.java new file mode 100644 index 000000000..882ecf52c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderLineItemItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PurchaseOrderLineItemItem.Deserializer.class) +public final class PurchaseOrderLineItemItem { + private final Object value; + + private final int type; + + private PurchaseOrderLineItemItem(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((Item) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrderLineItemItem && equalTo((PurchaseOrderLineItemItem) other); + } + + private boolean equalTo(PurchaseOrderLineItemItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PurchaseOrderLineItemItem of(String value) { + return new PurchaseOrderLineItemItem(value, 0); + } + + public static PurchaseOrderLineItemItem of(Item value) { + return new PurchaseOrderLineItemItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Item value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PurchaseOrderLineItemItem.class); + } + + @Override + public PurchaseOrderLineItemItem 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, Item.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderLineItemRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderLineItemRequest.java new file mode 100644 index 000000000..dfd572a32 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderLineItemRequest.java @@ -0,0 +1,855 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PurchaseOrderLineItemRequest.Builder.class) +public final class PurchaseOrderLineItemRequest { + private final Optional remoteId; + + private final Optional description; + + private final Optional unitPrice; + + private final Optional quantity; + + private final Optional item; + + private final Optional account; + + private final Optional trackingCategory; + + private final Optional>> trackingCategories; + + private final Optional taxAmount; + + private final Optional totalLineAmount; + + private final Optional currency; + + private final Optional taxRate; + + private final Optional exchangeRate; + + private final Optional company; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private PurchaseOrderLineItemRequest( + Optional remoteId, + Optional description, + Optional unitPrice, + Optional quantity, + Optional item, + Optional account, + Optional trackingCategory, + Optional>> trackingCategories, + Optional taxAmount, + Optional totalLineAmount, + Optional currency, + Optional taxRate, + Optional exchangeRate, + Optional company, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.remoteId = remoteId; + this.description = description; + this.unitPrice = unitPrice; + this.quantity = quantity; + this.item = item; + this.account = account; + this.trackingCategory = trackingCategory; + this.trackingCategories = trackingCategories; + this.taxAmount = taxAmount; + this.totalLineAmount = totalLineAmount; + this.currency = currency; + this.taxRate = taxRate; + this.exchangeRate = exchangeRate; + this.company = company; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return A description of the good being purchased. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The line item's unit price. + */ + @JsonProperty("unit_price") + public Optional getUnitPrice() { + return unitPrice; + } + + /** + * @return The line item's quantity. + */ + @JsonProperty("quantity") + public Optional getQuantity() { + return quantity; + } + + @JsonProperty("item") + public Optional getItem() { + return item; + } + + /** + * @return The purchase order line item's account. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The purchase order line item's associated tracking category. + */ + @JsonProperty("tracking_category") + public Optional getTrackingCategory() { + return trackingCategory; + } + + /** + * @return The purchase order line item's associated tracking categories. + */ + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The purchase order line item's tax amount. + */ + @JsonProperty("tax_amount") + public Optional getTaxAmount() { + return taxAmount; + } + + /** + * @return The purchase order line item's total amount. + */ + @JsonProperty("total_line_amount") + public Optional getTotalLineAmount() { + return totalLineAmount; + } + + /** + * @return The purchase order line item'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 tax rate that applies to this line item. + */ + @JsonProperty("tax_rate") + public Optional getTaxRate() { + return taxRate; + } + + /** + * @return The purchase order line item's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return The company the purchase order line item 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; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrderLineItemRequest && equalTo((PurchaseOrderLineItemRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PurchaseOrderLineItemRequest other) { + return remoteId.equals(other.remoteId) + && description.equals(other.description) + && unitPrice.equals(other.unitPrice) + && quantity.equals(other.quantity) + && item.equals(other.item) + && account.equals(other.account) + && trackingCategory.equals(other.trackingCategory) + && trackingCategories.equals(other.trackingCategories) + && taxAmount.equals(other.taxAmount) + && totalLineAmount.equals(other.totalLineAmount) + && currency.equals(other.currency) + && taxRate.equals(other.taxRate) + && exchangeRate.equals(other.exchangeRate) + && company.equals(other.company) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.remoteId, + this.description, + this.unitPrice, + this.quantity, + this.item, + this.account, + this.trackingCategory, + this.trackingCategories, + this.taxAmount, + this.totalLineAmount, + this.currency, + this.taxRate, + this.exchangeRate, + this.company, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @Override + 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 description = Optional.empty(); + + private Optional unitPrice = Optional.empty(); + + private Optional quantity = Optional.empty(); + + private Optional item = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional trackingCategory = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional taxAmount = Optional.empty(); + + private Optional totalLineAmount = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional taxRate = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional company = 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(PurchaseOrderLineItemRequest other) { + remoteId(other.getRemoteId()); + description(other.getDescription()); + unitPrice(other.getUnitPrice()); + quantity(other.getQuantity()); + item(other.getItem()); + account(other.getAccount()); + trackingCategory(other.getTrackingCategory()); + trackingCategories(other.getTrackingCategories()); + taxAmount(other.getTaxAmount()); + totalLineAmount(other.getTotalLineAmount()); + currency(other.getCurrency()); + taxRate(other.getTaxRate()); + exchangeRate(other.getExchangeRate()); + company(other.getCompany()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + remoteFields(other.getRemoteFields()); + 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 = "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 = "unit_price", nulls = Nulls.SKIP) + public Builder unitPrice(Optional unitPrice) { + this.unitPrice = unitPrice; + return this; + } + + public Builder unitPrice(Double unitPrice) { + this.unitPrice = Optional.ofNullable(unitPrice); + return this; + } + + @JsonSetter(value = "quantity", nulls = Nulls.SKIP) + public Builder quantity(Optional quantity) { + this.quantity = quantity; + return this; + } + + public Builder quantity(Double quantity) { + this.quantity = Optional.ofNullable(quantity); + return this; + } + + @JsonSetter(value = "item", nulls = Nulls.SKIP) + public Builder item(Optional item) { + this.item = item; + return this; + } + + public Builder item(PurchaseOrderLineItemRequestItem item) { + this.item = Optional.ofNullable(item); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(String account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "tracking_category", nulls = Nulls.SKIP) + public Builder trackingCategory(Optional trackingCategory) { + this.trackingCategory = trackingCategory; + return this; + } + + public Builder trackingCategory(String trackingCategory) { + this.trackingCategory = Optional.ofNullable(trackingCategory); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories(Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + @JsonSetter(value = "tax_amount", nulls = Nulls.SKIP) + public Builder taxAmount(Optional taxAmount) { + this.taxAmount = taxAmount; + return this; + } + + public Builder taxAmount(String taxAmount) { + this.taxAmount = Optional.ofNullable(taxAmount); + return this; + } + + @JsonSetter(value = "total_line_amount", nulls = Nulls.SKIP) + public Builder totalLineAmount(Optional totalLineAmount) { + this.totalLineAmount = totalLineAmount; + return this; + } + + public Builder totalLineAmount(String totalLineAmount) { + this.totalLineAmount = Optional.ofNullable(totalLineAmount); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(PurchaseOrderLineItemRequestCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "tax_rate", nulls = Nulls.SKIP) + public Builder taxRate(Optional taxRate) { + this.taxRate = taxRate; + return this; + } + + public Builder taxRate(String taxRate) { + this.taxRate = Optional.ofNullable(taxRate); + return this; + } + + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + 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; + } + + @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 PurchaseOrderLineItemRequest build() { + return new PurchaseOrderLineItemRequest( + remoteId, + description, + unitPrice, + quantity, + item, + account, + trackingCategory, + trackingCategories, + taxAmount, + totalLineAmount, + currency, + taxRate, + exchangeRate, + company, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderLineItemRequestCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderLineItemRequestCurrency.java new file mode 100644 index 000000000..02daac975 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderLineItemRequestCurrency.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/PurchaseOrderLineItemRequestItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderLineItemRequestItem.java new file mode 100644 index 000000000..0c078d54d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderLineItemRequestItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PurchaseOrderLineItemRequestItem.Deserializer.class) +public final class PurchaseOrderLineItemRequestItem { + private final Object value; + + private final int type; + + private PurchaseOrderLineItemRequestItem(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((Item) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrderLineItemRequestItem && equalTo((PurchaseOrderLineItemRequestItem) other); + } + + private boolean equalTo(PurchaseOrderLineItemRequestItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PurchaseOrderLineItemRequestItem of(String value) { + return new PurchaseOrderLineItemRequestItem(value, 0); + } + + public static PurchaseOrderLineItemRequestItem of(Item value) { + return new PurchaseOrderLineItemRequestItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Item value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PurchaseOrderLineItemRequestItem.class); + } + + @Override + public PurchaseOrderLineItemRequestItem 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, Item.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderRequest.java new file mode 100644 index 000000000..f7e7f8a12 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderRequest.java @@ -0,0 +1,863 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PurchaseOrderRequest.Builder.class) +public final class PurchaseOrderRequest { + private final Optional status; + + private final Optional issueDate; + + private final Optional deliveryDate; + + private final Optional deliveryAddress; + + private final Optional customer; + + private final Optional vendor; + + private final Optional memo; + + private final Optional company; + + private final Optional totalAmount; + + private final Optional currency; + + private final Optional inclusiveOfTax; + + private final Optional exchangeRate; + + private final Optional>> trackingCategories; + + private final Optional> lineItems; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private PurchaseOrderRequest( + Optional status, + Optional issueDate, + Optional deliveryDate, + Optional deliveryAddress, + Optional customer, + Optional vendor, + Optional memo, + Optional company, + Optional totalAmount, + Optional currency, + Optional inclusiveOfTax, + Optional exchangeRate, + Optional>> trackingCategories, + Optional> lineItems, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.status = status; + this.issueDate = issueDate; + this.deliveryDate = deliveryDate; + this.deliveryAddress = deliveryAddress; + this.customer = customer; + this.vendor = vendor; + this.memo = memo; + this.company = company; + this.totalAmount = totalAmount; + this.currency = currency; + this.inclusiveOfTax = inclusiveOfTax; + this.exchangeRate = exchangeRate; + this.trackingCategories = trackingCategories; + this.lineItems = lineItems; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The purchase order's status. + *
    + *
  • DRAFT - DRAFT
  • + *
  • SUBMITTED - SUBMITTED
  • + *
  • AUTHORIZED - AUTHORIZED
  • + *
  • BILLED - BILLED
  • + *
  • DELETED - DELETED
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The purchase order's issue date. + */ + @JsonProperty("issue_date") + public Optional getIssueDate() { + return issueDate; + } + + /** + * @return The purchase order's delivery date. + */ + @JsonProperty("delivery_date") + public Optional getDeliveryDate() { + return deliveryDate; + } + + /** + * @return The purchase order's delivery address. + */ + @JsonProperty("delivery_address") + public Optional getDeliveryAddress() { + return deliveryAddress; + } + + /** + * @return The contact making the purchase order. + */ + @JsonProperty("customer") + public Optional getCustomer() { + return customer; + } + + /** + * @return The party fulfilling the purchase order. + */ + @JsonProperty("vendor") + public Optional getVendor() { + return vendor; + } + + /** + * @return A memo attached to the purchase order. + */ + @JsonProperty("memo") + public Optional getMemo() { + return memo; + } + + /** + * @return The company the purchase order belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The purchase order's total amount. + */ + @JsonProperty("total_amount") + public Optional getTotalAmount() { + return totalAmount; + } + + /** + * @return The purchase order'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 If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. + */ + @JsonProperty("inclusive_of_tax") + public Optional getInclusiveOfTax() { + return inclusiveOfTax; + } + + /** + * @return The purchase order's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + @JsonProperty("line_items") + public Optional> getLineItems() { + return lineItems; + } + + @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrderRequest && equalTo((PurchaseOrderRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PurchaseOrderRequest other) { + return status.equals(other.status) + && issueDate.equals(other.issueDate) + && deliveryDate.equals(other.deliveryDate) + && deliveryAddress.equals(other.deliveryAddress) + && customer.equals(other.customer) + && vendor.equals(other.vendor) + && memo.equals(other.memo) + && company.equals(other.company) + && totalAmount.equals(other.totalAmount) + && currency.equals(other.currency) + && inclusiveOfTax.equals(other.inclusiveOfTax) + && exchangeRate.equals(other.exchangeRate) + && trackingCategories.equals(other.trackingCategories) + && lineItems.equals(other.lineItems) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.status, + this.issueDate, + this.deliveryDate, + this.deliveryAddress, + this.customer, + this.vendor, + this.memo, + this.company, + this.totalAmount, + this.currency, + this.inclusiveOfTax, + this.exchangeRate, + this.trackingCategories, + this.lineItems, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional status = Optional.empty(); + + private Optional issueDate = Optional.empty(); + + private Optional deliveryDate = Optional.empty(); + + private Optional deliveryAddress = Optional.empty(); + + private Optional customer = Optional.empty(); + + private Optional vendor = Optional.empty(); + + private Optional memo = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional inclusiveOfTax = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional>> trackingCategories = + Optional.empty(); + + private Optional> lineItems = 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(PurchaseOrderRequest other) { + status(other.getStatus()); + issueDate(other.getIssueDate()); + deliveryDate(other.getDeliveryDate()); + deliveryAddress(other.getDeliveryAddress()); + customer(other.getCustomer()); + vendor(other.getVendor()); + memo(other.getMemo()); + company(other.getCompany()); + totalAmount(other.getTotalAmount()); + currency(other.getCurrency()); + inclusiveOfTax(other.getInclusiveOfTax()); + exchangeRate(other.getExchangeRate()); + trackingCategories(other.getTrackingCategories()); + lineItems(other.getLineItems()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + remoteFields(other.getRemoteFields()); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(PurchaseOrderRequestStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "issue_date", nulls = Nulls.SKIP) + public Builder issueDate(Optional issueDate) { + this.issueDate = issueDate; + return this; + } + + public Builder issueDate(OffsetDateTime issueDate) { + this.issueDate = Optional.ofNullable(issueDate); + return this; + } + + @JsonSetter(value = "delivery_date", nulls = Nulls.SKIP) + public Builder deliveryDate(Optional deliveryDate) { + this.deliveryDate = deliveryDate; + return this; + } + + public Builder deliveryDate(OffsetDateTime deliveryDate) { + this.deliveryDate = Optional.ofNullable(deliveryDate); + return this; + } + + @JsonSetter(value = "delivery_address", nulls = Nulls.SKIP) + public Builder deliveryAddress(Optional deliveryAddress) { + this.deliveryAddress = deliveryAddress; + return this; + } + + public Builder deliveryAddress(PurchaseOrderRequestDeliveryAddress deliveryAddress) { + this.deliveryAddress = Optional.ofNullable(deliveryAddress); + return this; + } + + @JsonSetter(value = "customer", nulls = Nulls.SKIP) + public Builder customer(Optional customer) { + this.customer = customer; + return this; + } + + public Builder customer(String customer) { + this.customer = Optional.ofNullable(customer); + return this; + } + + @JsonSetter(value = "vendor", nulls = Nulls.SKIP) + public Builder vendor(Optional vendor) { + this.vendor = vendor; + return this; + } + + public Builder vendor(PurchaseOrderRequestVendor vendor) { + this.vendor = Optional.ofNullable(vendor); + return this; + } + + @JsonSetter(value = "memo", nulls = Nulls.SKIP) + public Builder memo(Optional memo) { + this.memo = memo; + return this; + } + + public Builder memo(String memo) { + this.memo = Optional.ofNullable(memo); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(PurchaseOrderRequestCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "total_amount", nulls = Nulls.SKIP) + public Builder totalAmount(Optional totalAmount) { + this.totalAmount = totalAmount; + return this; + } + + public Builder totalAmount(Double totalAmount) { + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(PurchaseOrderRequestCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "inclusive_of_tax", nulls = Nulls.SKIP) + public Builder inclusiveOfTax(Optional inclusiveOfTax) { + this.inclusiveOfTax = inclusiveOfTax; + return this; + } + + public Builder inclusiveOfTax(Boolean inclusiveOfTax) { + this.inclusiveOfTax = Optional.ofNullable(inclusiveOfTax); + return this; + } + + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories( + List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + @JsonSetter(value = "line_items", nulls = Nulls.SKIP) + public Builder lineItems(Optional> lineItems) { + this.lineItems = lineItems; + return this; + } + + public Builder lineItems(List lineItems) { + this.lineItems = Optional.ofNullable(lineItems); + 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 PurchaseOrderRequest build() { + return new PurchaseOrderRequest( + status, + issueDate, + deliveryDate, + deliveryAddress, + customer, + vendor, + memo, + company, + totalAmount, + currency, + inclusiveOfTax, + exchangeRate, + trackingCategories, + lineItems, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderRequestCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderRequestCompany.java new file mode 100644 index 000000000..97e55996f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderRequestCompany.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PurchaseOrderRequestCompany.Deserializer.class) +public final class PurchaseOrderRequestCompany { + private final Object value; + + private final int type; + + private PurchaseOrderRequestCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrderRequestCompany && equalTo((PurchaseOrderRequestCompany) other); + } + + private boolean equalTo(PurchaseOrderRequestCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PurchaseOrderRequestCompany of(String value) { + return new PurchaseOrderRequestCompany(value, 0); + } + + public static PurchaseOrderRequestCompany of(CompanyInfo value) { + return new PurchaseOrderRequestCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PurchaseOrderRequestCompany.class); + } + + @Override + public PurchaseOrderRequestCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderRequestCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderRequestCurrency.java new file mode 100644 index 000000000..7e696559b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderRequestCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/PurchaseOrderRequestDeliveryAddress.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderRequestDeliveryAddress.java new file mode 100644 index 000000000..986955b86 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderRequestDeliveryAddress.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PurchaseOrderRequestDeliveryAddress.Deserializer.class) +public final class PurchaseOrderRequestDeliveryAddress { + private final Object value; + + private final int type; + + private PurchaseOrderRequestDeliveryAddress(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((Address) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrderRequestDeliveryAddress + && equalTo((PurchaseOrderRequestDeliveryAddress) other); + } + + private boolean equalTo(PurchaseOrderRequestDeliveryAddress other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PurchaseOrderRequestDeliveryAddress of(String value) { + return new PurchaseOrderRequestDeliveryAddress(value, 0); + } + + public static PurchaseOrderRequestDeliveryAddress of(Address value) { + return new PurchaseOrderRequestDeliveryAddress(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Address value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PurchaseOrderRequestDeliveryAddress.class); + } + + @Override + public PurchaseOrderRequestDeliveryAddress 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, Address.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderRequestStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderRequestStatus.java new file mode 100644 index 000000000..a9e3f2c46 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderRequestStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/PurchaseOrderRequestTrackingCategoriesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderRequestTrackingCategoriesItem.java new file mode 100644 index 000000000..12e144210 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderRequestTrackingCategoriesItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PurchaseOrderRequestTrackingCategoriesItem.Deserializer.class) +public final class PurchaseOrderRequestTrackingCategoriesItem { + private final Object value; + + private final int type; + + private PurchaseOrderRequestTrackingCategoriesItem(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrderRequestTrackingCategoriesItem + && equalTo((PurchaseOrderRequestTrackingCategoriesItem) other); + } + + private boolean equalTo(PurchaseOrderRequestTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PurchaseOrderRequestTrackingCategoriesItem of(String value) { + return new PurchaseOrderRequestTrackingCategoriesItem(value, 0); + } + + public static PurchaseOrderRequestTrackingCategoriesItem of(TrackingCategory value) { + return new PurchaseOrderRequestTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PurchaseOrderRequestTrackingCategoriesItem.class); + } + + @Override + public PurchaseOrderRequestTrackingCategoriesItem 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderRequestVendor.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderRequestVendor.java new file mode 100644 index 000000000..ba348c36d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderRequestVendor.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PurchaseOrderRequestVendor.Deserializer.class) +public final class PurchaseOrderRequestVendor { + private final Object value; + + private final int type; + + private PurchaseOrderRequestVendor(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrderRequestVendor && equalTo((PurchaseOrderRequestVendor) other); + } + + private boolean equalTo(PurchaseOrderRequestVendor other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PurchaseOrderRequestVendor of(String value) { + return new PurchaseOrderRequestVendor(value, 0); + } + + public static PurchaseOrderRequestVendor of(Contact value) { + return new PurchaseOrderRequestVendor(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PurchaseOrderRequestVendor.class); + } + + @Override + public PurchaseOrderRequestVendor 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderResponse.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderResponse.java new file mode 100644 index 000000000..f66e06161 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PurchaseOrderResponse.Builder.class) +public final class PurchaseOrderResponse { + private final PurchaseOrder model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private PurchaseOrderResponse( + PurchaseOrder 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 PurchaseOrder getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrderResponse && equalTo((PurchaseOrderResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PurchaseOrderResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull PurchaseOrder model); + + Builder from(PurchaseOrderResponse other); + } + + public interface _FinalStage { + PurchaseOrderResponse 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 PurchaseOrder model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(PurchaseOrderResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull PurchaseOrder model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public PurchaseOrderResponse build() { + return new PurchaseOrderResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderStatus.java new file mode 100644 index 000000000..fd2e6a139 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/PurchaseOrderStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderStatusEnum.java new file mode 100644 index 000000000..6d6cef191 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderStatusEnum.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PurchaseOrderStatusEnum { + DRAFT("DRAFT"), + + SUBMITTED("SUBMITTED"), + + AUTHORIZED("AUTHORIZED"), + + BILLED("BILLED"), + + DELETED("DELETED"); + + private final String value; + + PurchaseOrderStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderTrackingCategoriesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderTrackingCategoriesItem.java new file mode 100644 index 000000000..25885b9f7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderTrackingCategoriesItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PurchaseOrderTrackingCategoriesItem.Deserializer.class) +public final class PurchaseOrderTrackingCategoriesItem { + private final Object value; + + private final int type; + + private PurchaseOrderTrackingCategoriesItem(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrderTrackingCategoriesItem + && equalTo((PurchaseOrderTrackingCategoriesItem) other); + } + + private boolean equalTo(PurchaseOrderTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PurchaseOrderTrackingCategoriesItem of(String value) { + return new PurchaseOrderTrackingCategoriesItem(value, 0); + } + + public static PurchaseOrderTrackingCategoriesItem of(TrackingCategory value) { + return new PurchaseOrderTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PurchaseOrderTrackingCategoriesItem.class); + } + + @Override + public PurchaseOrderTrackingCategoriesItem 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderVendor.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderVendor.java new file mode 100644 index 000000000..abb20ca7f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/PurchaseOrderVendor.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PurchaseOrderVendor.Deserializer.class) +public final class PurchaseOrderVendor { + private final Object value; + + private final int type; + + private PurchaseOrderVendor(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrderVendor && equalTo((PurchaseOrderVendor) other); + } + + private boolean equalTo(PurchaseOrderVendor other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PurchaseOrderVendor of(String value) { + return new PurchaseOrderVendor(value, 0); + } + + public static PurchaseOrderVendor of(Contact value) { + return new PurchaseOrderVendor(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PurchaseOrderVendor.class); + } + + @Override + public PurchaseOrderVendor 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteData.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteData.java new file mode 100644 index 000000000..ab836cdd8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteData.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.path, this.data); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("path") + public _FinalStage path(@NotNull String path) { + this.path = path; + return this; + } + + @Override + public _FinalStage data(JsonNode data) { + this.data = Optional.ofNullable(data); + return this; + } + + @Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(Optional data) { + this.data = data; + return this; + } + + @Override + public RemoteData build() { + return new RemoteData(path, data, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteEndpointInfo.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteEndpointInfo.java new file mode 100644 index 000000000..9d7cd59fd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteEndpointInfo.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @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() {} + + @Override + public Builder from(RemoteEndpointInfo other) { + method(other.getMethod()); + urlPath(other.getUrlPath()); + fieldTraversalPath(other.getFieldTraversalPath()); + return this; + } + + @Override + @JsonSetter("method") + public UrlPathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @Override + @JsonSetter("url_path") + public _FinalStage urlPath(@NotNull String urlPath) { + this.urlPath = urlPath; + return this; + } + + @Override + public _FinalStage addAllFieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.addAll(fieldTraversalPath); + return this; + } + + @Override + public _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath) { + this.fieldTraversalPath.add(fieldTraversalPath); + return this; + } + + @Override + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) + public _FinalStage fieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.clear(); + this.fieldTraversalPath.addAll(fieldTraversalPath); + return this; + } + + @Override + public RemoteEndpointInfo build() { + return new RemoteEndpointInfo(method, urlPath, fieldTraversalPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteField.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteField.java new file mode 100644 index 000000000..d12777bf8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteField.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.remoteFieldClass, this.value); + } + + @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() {} + + @Override + public Builder from(RemoteField other) { + remoteFieldClass(other.getRemoteFieldClass()); + value(other.getValue()); + return this; + } + + @Override + @JsonSetter("remote_field_class") + public _FinalStage remoteFieldClass(@NotNull RemoteFieldClass remoteFieldClass) { + this.remoteFieldClass = remoteFieldClass; + return this; + } + + @Override + public _FinalStage value(Map value) { + this.value = Optional.ofNullable(value); + return this; + } + + @Override + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public _FinalStage value(Optional> value) { + this.value = value; + return this; + } + + @Override + public RemoteField build() { + return new RemoteField(remoteFieldClass, value, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteFieldApi.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteFieldApi.java new file mode 100644 index 000000000..1c5a5cd95 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteFieldApi.java @@ -0,0 +1,264 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.schema, + this.remoteKeyName, + this.remoteEndpointInfo, + this.exampleValues, + this.advancedMetadata, + this.coverage); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("remote_key_name") + public RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @Override + public _FinalStage coverage(RemoteFieldApiCoverage coverage) { + this.coverage = Optional.ofNullable(coverage); + return this; + } + + @Override + @JsonSetter(value = "coverage", nulls = Nulls.SKIP) + public _FinalStage coverage(Optional coverage) { + this.coverage = coverage; + return this; + } + + @Override + public _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata) { + this.advancedMetadata = Optional.ofNullable(advancedMetadata); + return this; + } + + @Override + @JsonSetter(value = "advanced_metadata", nulls = Nulls.SKIP) + public _FinalStage advancedMetadata(Optional advancedMetadata) { + this.advancedMetadata = advancedMetadata; + return this; + } + + @Override + public _FinalStage exampleValues(List exampleValues) { + this.exampleValues = Optional.ofNullable(exampleValues); + return this; + } + + @Override + @JsonSetter(value = "example_values", nulls = Nulls.SKIP) + public _FinalStage exampleValues(Optional> exampleValues) { + this.exampleValues = exampleValues; + return this; + } + + @Override + public _FinalStage schema(String key, JsonNode value) { + this.schema.put(key, value); + return this; + } + + @Override + public _FinalStage putAllSchema(Map schema) { + this.schema.putAll(schema); + return this; + } + + @Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Map schema) { + this.schema.clear(); + this.schema.putAll(schema); + return this; + } + + @Override + public RemoteFieldApi build() { + return new RemoteFieldApi( + schema, + remoteKeyName, + remoteEndpointInfo, + exampleValues, + advancedMetadata, + coverage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteFieldApiCoverage.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteFieldApiCoverage.java new file mode 100644 index 000000000..af2702dc1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteFieldApiCoverage.java @@ -0,0 +1,91 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/RemoteFieldApiResponse.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteFieldApiResponse.java new file mode 100644 index 000000000..8442d4fd0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteFieldApiResponse.java @@ -0,0 +1,637 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/accounting/types/RemoteFieldClass.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteFieldClass.java new file mode 100644 index 000000000..50d521afb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteFieldClass.java @@ -0,0 +1,325 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/accounting/types/RemoteFieldRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteFieldRequest.java new file mode 100644 index 000000000..8273512e9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteFieldRequest.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.remoteFieldClass, this.value); + } + + @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() {} + + @Override + public Builder from(RemoteFieldRequest other) { + remoteFieldClass(other.getRemoteFieldClass()); + value(other.getValue()); + return this; + } + + @Override + @JsonSetter("remote_field_class") + public _FinalStage remoteFieldClass(@NotNull RemoteFieldRequestRemoteFieldClass remoteFieldClass) { + this.remoteFieldClass = remoteFieldClass; + return this; + } + + @Override + public _FinalStage value(JsonNode value) { + this.value = Optional.ofNullable(value); + return this; + } + + @Override + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public _FinalStage value(Optional value) { + this.value = value; + return this; + } + + @Override + public RemoteFieldRequest build() { + return new RemoteFieldRequest(remoteFieldClass, value, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteFieldRequestRemoteFieldClass.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteFieldRequestRemoteFieldClass.java new file mode 100644 index 000000000..1d27ac373 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteFieldRequestRemoteFieldClass.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/RemoteKey.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteKey.java new file mode 100644 index 000000000..1c747e398 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteKey.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.key); + } + + @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() {} + + @Override + public Builder from(RemoteKey other) { + name(other.getName()); + key(other.getKey()); + return this; + } + + @Override + @JsonSetter("name") + public KeyStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + @JsonSetter("key") + public _FinalStage key(@NotNull String key) { + this.key = key; + return this; + } + + @Override + public RemoteKey build() { + return new RemoteKey(name, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteResponse.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteResponse.java new file mode 100644 index 000000000..716e3ee36 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/RemoteResponse.java @@ -0,0 +1,271 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.status, + this.response, + this.responseHeaders, + this.responseType, + this.headers); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("method") + public PathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @Override + @JsonSetter("path") + public StatusStage path(@NotNull String path) { + this.path = path; + return this; + } + + @Override + @JsonSetter("status") + public ResponseStage status(int status) { + this.status = status; + return this; + } + + @Override + @JsonSetter("response") + public _FinalStage response(@NotNull JsonNode response) { + this.response = response; + return this; + } + + @Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Optional> headers) { + this.headers = headers; + return this; + } + + @Override + public _FinalStage responseType(ResponseTypeEnum responseType) { + this.responseType = Optional.ofNullable(responseType); + return this; + } + + @Override + @JsonSetter(value = "response_type", nulls = Nulls.SKIP) + public _FinalStage responseType(Optional responseType) { + this.responseType = responseType; + return this; + } + + @Override + public _FinalStage responseHeaders(Map responseHeaders) { + this.responseHeaders = Optional.ofNullable(responseHeaders); + return this; + } + + @Override + @JsonSetter(value = "response_headers", nulls = Nulls.SKIP) + public _FinalStage responseHeaders(Optional> responseHeaders) { + this.responseHeaders = responseHeaders; + return this; + } + + @Override + public RemoteResponse build() { + return new RemoteResponse( + method, path, status, response, responseHeaders, responseType, headers, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ReportItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ReportItem.java new file mode 100644 index 000000000..d41ce7e93 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ReportItem.java @@ -0,0 +1,296 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ReportItem.Builder.class) +public final class ReportItem { + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional value; + + private final Optional>> subItems; + + private final Optional company; + + private final Optional remoteWasDeleted; + + private final Map additionalProperties; + + private ReportItem( + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional value, + Optional>> subItems, + Optional company, + Optional remoteWasDeleted, + Map additionalProperties) { + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.value = value; + this.subItems = subItems; + this.company = company; + this.remoteWasDeleted = remoteWasDeleted; + 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 report item's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The report item's value. + */ + @JsonProperty("value") + public Optional getValue() { + return value; + } + + @JsonProperty("sub_items") + public Optional>> getSubItems() { + return subItems; + } + + /** + * @return The company the report item 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ReportItem && equalTo((ReportItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ReportItem other) { + return remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && value.equals(other.value) + && subItems.equals(other.subItems) + && company.equals(other.company) + && remoteWasDeleted.equals(other.remoteWasDeleted); + } + + @Override + public int hashCode() { + return Objects.hash( + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.value, + this.subItems, + this.company, + this.remoteWasDeleted); + } + + @Override + 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 value = Optional.empty(); + + private Optional>> subItems = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ReportItem other) { + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + value(other.getValue()); + subItems(other.getSubItems()); + company(other.getCompany()); + remoteWasDeleted(other.getRemoteWasDeleted()); + 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 = "value", nulls = Nulls.SKIP) + public Builder value(Optional value) { + this.value = value; + return this; + } + + public Builder value(Double value) { + this.value = Optional.ofNullable(value); + return this; + } + + @JsonSetter(value = "sub_items", nulls = Nulls.SKIP) + public Builder subItems(Optional>> subItems) { + this.subItems = subItems; + return this; + } + + public Builder subItems(List> subItems) { + this.subItems = Optional.ofNullable(subItems); + 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; + } + + public ReportItem build() { + return new ReportItem( + remoteId, + createdAt, + modifiedAt, + name, + value, + subItems, + company, + remoteWasDeleted, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/RequestFormatEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/RequestFormatEnum.java new file mode 100644 index 000000000..a42ddbc51 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/RequestFormatEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ResponseTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ResponseTypeEnum.java new file mode 100644 index 000000000..65321fda9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ResponseTypeEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/RoleEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/RoleEnum.java new file mode 100644 index 000000000..a40e7196c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/RoleEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/SelectiveSyncConfigurationsUsageEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/SelectiveSyncConfigurationsUsageEnum.java new file mode 100644 index 000000000..9ca4d9857 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/SelectiveSyncConfigurationsUsageEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/Status7D1Enum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/Status7D1Enum.java new file mode 100644 index 000000000..83642ccce --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/Status7D1Enum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum Status7D1Enum { + ACTIVE("ACTIVE"), + + ARCHIVED("ARCHIVED"); + + private final String value; + + Status7D1Enum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/Status895Enum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/Status895Enum.java new file mode 100644 index 000000000..abc8a7fc9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/Status895Enum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum Status895Enum { + ACTIVE("ACTIVE"), + + INACTIVE("INACTIVE"); + + private final String value; + + Status895Enum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/SyncStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/SyncStatus.java new file mode 100644 index 000000000..da720d997 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/SyncStatus.java @@ -0,0 +1,283 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.modelName, + this.modelId, + this.lastSyncStart, + this.nextSyncStart, + this.status, + this.isInitialSync, + this.selectiveSyncConfigurationsUsage); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("model_name") + public ModelIdStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @Override + @JsonSetter("model_id") + public StatusStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @Override + @JsonSetter("status") + public IsInitialSyncStage status(@NotNull SyncStatusStatusEnum status) { + this.status = status; + return this; + } + + @Override + @JsonSetter("is_initial_sync") + public _FinalStage isInitialSync(boolean isInitialSync) { + this.isInitialSync = isInitialSync; + return this; + } + + @Override + public _FinalStage selectiveSyncConfigurationsUsage( + SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = Optional.ofNullable(selectiveSyncConfigurationsUsage); + return this; + } + + @Override + @JsonSetter(value = "selective_sync_configurations_usage", nulls = Nulls.SKIP) + public _FinalStage selectiveSyncConfigurationsUsage( + Optional selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; + return this; + } + + @Override + public _FinalStage nextSyncStart(OffsetDateTime nextSyncStart) { + this.nextSyncStart = Optional.ofNullable(nextSyncStart); + return this; + } + + @Override + @JsonSetter(value = "next_sync_start", nulls = Nulls.SKIP) + public _FinalStage nextSyncStart(Optional nextSyncStart) { + this.nextSyncStart = nextSyncStart; + return this; + } + + @Override + public _FinalStage lastSyncStart(OffsetDateTime lastSyncStart) { + this.lastSyncStart = Optional.ofNullable(lastSyncStart); + return this; + } + + @Override + @JsonSetter(value = "last_sync_start", nulls = Nulls.SKIP) + public _FinalStage lastSyncStart(Optional lastSyncStart) { + this.lastSyncStart = lastSyncStart; + return this; + } + + @Override + public SyncStatus build() { + return new SyncStatus( + modelName, + modelId, + lastSyncStart, + nextSyncStart, + status, + isInitialSync, + selectiveSyncConfigurationsUsage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/SyncStatusStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/SyncStatusStatusEnum.java new file mode 100644 index 000000000..b9efcd2a5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/SyncStatusStatusEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/TaxComponent.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/TaxComponent.java new file mode 100644 index 000000000..fca7a5cff --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/TaxComponent.java @@ -0,0 +1,331 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = TaxComponent.Builder.class) +public final class TaxComponent { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional rate; + + private final Optional isCompound; + + private final Optional componentType; + + private final Optional remoteWasDeleted; + + private final Map additionalProperties; + + private TaxComponent( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional rate, + Optional isCompound, + Optional componentType, + Optional remoteWasDeleted, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.rate = rate; + this.isCompound = isCompound; + this.componentType = componentType; + this.remoteWasDeleted = remoteWasDeleted; + 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 tax rate’s name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The tax component’s rate. + */ + @JsonProperty("rate") + public Optional getRate() { + return rate; + } + + /** + * @return

True if the tax component is compound, False if not.

+ */ + @JsonProperty("is_compound") + public Optional getIsCompound() { + return isCompound; + } + + /** + * @return

PURCHASE if the tax component corresponds to a purchase tax or SALES if the tax component corresponds to a sales tax.

+ *
    + *
  • SALES - SALES
  • + *
  • PURCHASE - PURCHASE
  • + *
+ */ + @JsonProperty("component_type") + public Optional getComponentType() { + return componentType; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TaxComponent && equalTo((TaxComponent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TaxComponent other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && rate.equals(other.rate) + && isCompound.equals(other.isCompound) + && componentType.equals(other.componentType) + && remoteWasDeleted.equals(other.remoteWasDeleted); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.rate, + this.isCompound, + this.componentType, + this.remoteWasDeleted); + } + + @Override + 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 rate = Optional.empty(); + + private Optional isCompound = Optional.empty(); + + private Optional componentType = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TaxComponent other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + rate(other.getRate()); + isCompound(other.getIsCompound()); + componentType(other.getComponentType()); + remoteWasDeleted(other.getRemoteWasDeleted()); + 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 = "rate", nulls = Nulls.SKIP) + public Builder rate(Optional rate) { + this.rate = rate; + return this; + } + + public Builder rate(String rate) { + this.rate = Optional.ofNullable(rate); + return this; + } + + @JsonSetter(value = "is_compound", nulls = Nulls.SKIP) + public Builder isCompound(Optional isCompound) { + this.isCompound = isCompound; + return this; + } + + public Builder isCompound(Boolean isCompound) { + this.isCompound = Optional.ofNullable(isCompound); + return this; + } + + @JsonSetter(value = "component_type", nulls = Nulls.SKIP) + public Builder componentType(Optional componentType) { + this.componentType = componentType; + return this; + } + + public Builder componentType(TaxComponentComponentType componentType) { + this.componentType = Optional.ofNullable(componentType); + 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 TaxComponent build() { + return new TaxComponent( + id, + remoteId, + createdAt, + modifiedAt, + name, + rate, + isCompound, + componentType, + remoteWasDeleted, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/TaxComponentComponentType.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/TaxComponentComponentType.java new file mode 100644 index 000000000..394e9f40b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/TaxComponentComponentType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/TaxRate.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/TaxRate.java new file mode 100644 index 000000000..07e12d1f9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/TaxRate.java @@ -0,0 +1,526 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TaxRate.Builder.class) +public final class TaxRate { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional company; + + private final Optional code; + + private final Optional name; + + private final Optional description; + + private final Optional status; + + private final Optional country; + + private final Optional totalTaxRate; + + private final Optional effectiveTaxRate; + + private final Optional> taxComponents; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private TaxRate( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional company, + Optional code, + Optional name, + Optional description, + Optional status, + Optional country, + Optional totalTaxRate, + Optional effectiveTaxRate, + Optional> taxComponents, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.company = company; + this.code = code; + this.name = name; + this.description = description; + this.status = status; + this.country = country; + this.totalTaxRate = totalTaxRate; + this.effectiveTaxRate = effectiveTaxRate; + this.taxComponents = taxComponents; + 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 subsidiary that the tax rate belongs to (in the case of multi-entity systems). + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The tax code associated with this tax rate or group of tax rates from the third-party platform. + */ + @JsonProperty("code") + public Optional getCode() { + return code; + } + + /** + * @return The tax rate’s name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The tax rate's description. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The tax rate’s status - ACTIVE if an active tax rate, ARCHIVED if not active. + *
    + *
  • ACTIVE - ACTIVE
  • + *
  • ARCHIVED - ARCHIVED
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The country the tax rate is associated with. + */ + @JsonProperty("country") + public Optional getCountry() { + return country; + } + + /** + * @return The tax’s total tax rate - sum of the tax components (not compounded). + */ + @JsonProperty("total_tax_rate") + public Optional getTotalTaxRate() { + return totalTaxRate; + } + + /** + * @return The tax rate’s effective tax rate - total amount of tax with compounding. + */ + @JsonProperty("effective_tax_rate") + public Optional getEffectiveTaxRate() { + return effectiveTaxRate; + } + + /** + * @return The related tax components of the tax rate. + */ + @JsonProperty("tax_components") + public Optional> getTaxComponents() { + return taxComponents; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TaxRate && equalTo((TaxRate) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TaxRate other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && company.equals(other.company) + && code.equals(other.code) + && name.equals(other.name) + && description.equals(other.description) + && status.equals(other.status) + && country.equals(other.country) + && totalTaxRate.equals(other.totalTaxRate) + && effectiveTaxRate.equals(other.effectiveTaxRate) + && taxComponents.equals(other.taxComponents) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.company, + this.code, + this.name, + this.description, + this.status, + this.country, + this.totalTaxRate, + this.effectiveTaxRate, + this.taxComponents, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 company = Optional.empty(); + + private Optional code = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional country = Optional.empty(); + + private Optional totalTaxRate = Optional.empty(); + + private Optional effectiveTaxRate = Optional.empty(); + + private Optional> taxComponents = 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(TaxRate other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + company(other.getCompany()); + code(other.getCode()); + name(other.getName()); + description(other.getDescription()); + status(other.getStatus()); + country(other.getCountry()); + totalTaxRate(other.getTotalTaxRate()); + effectiveTaxRate(other.getEffectiveTaxRate()); + taxComponents(other.getTaxComponents()); + 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 = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(TaxRateCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "code", nulls = Nulls.SKIP) + public Builder code(Optional code) { + this.code = code; + return this; + } + + public Builder code(String code) { + this.code = Optional.ofNullable(code); + 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 = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(TaxRateStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "country", nulls = Nulls.SKIP) + public Builder country(Optional country) { + this.country = country; + return this; + } + + public Builder country(String country) { + this.country = Optional.ofNullable(country); + return this; + } + + @JsonSetter(value = "total_tax_rate", nulls = Nulls.SKIP) + public Builder totalTaxRate(Optional totalTaxRate) { + this.totalTaxRate = totalTaxRate; + return this; + } + + public Builder totalTaxRate(Double totalTaxRate) { + this.totalTaxRate = Optional.ofNullable(totalTaxRate); + return this; + } + + @JsonSetter(value = "effective_tax_rate", nulls = Nulls.SKIP) + public Builder effectiveTaxRate(Optional effectiveTaxRate) { + this.effectiveTaxRate = effectiveTaxRate; + return this; + } + + public Builder effectiveTaxRate(Double effectiveTaxRate) { + this.effectiveTaxRate = Optional.ofNullable(effectiveTaxRate); + return this; + } + + @JsonSetter(value = "tax_components", nulls = Nulls.SKIP) + public Builder taxComponents(Optional> taxComponents) { + this.taxComponents = taxComponents; + return this; + } + + public Builder taxComponents(List taxComponents) { + this.taxComponents = Optional.ofNullable(taxComponents); + 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 TaxRate build() { + return new TaxRate( + id, + remoteId, + createdAt, + modifiedAt, + company, + code, + name, + description, + status, + country, + totalTaxRate, + effectiveTaxRate, + taxComponents, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/TaxRateCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/TaxRateCompany.java new file mode 100644 index 000000000..bf3530504 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/TaxRateCompany.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TaxRateCompany.Deserializer.class) +public final class TaxRateCompany { + private final Object value; + + private final int type; + + private TaxRateCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TaxRateCompany && equalTo((TaxRateCompany) other); + } + + private boolean equalTo(TaxRateCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TaxRateCompany of(String value) { + return new TaxRateCompany(value, 0); + } + + public static TaxRateCompany of(CompanyInfo value) { + return new TaxRateCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TaxRateCompany.class); + } + + @Override + public TaxRateCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/TaxRateStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/TaxRateStatus.java new file mode 100644 index 000000000..752f2b2a1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/TaxRateStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/TaxRateTaxComponentsItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/TaxRateTaxComponentsItem.java new file mode 100644 index 000000000..153d57d2f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/TaxRateTaxComponentsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TaxRateTaxComponentsItem.Deserializer.class) +public final class TaxRateTaxComponentsItem { + private final Object value; + + private final int type; + + private TaxRateTaxComponentsItem(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((TaxComponent) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TaxRateTaxComponentsItem && equalTo((TaxRateTaxComponentsItem) other); + } + + private boolean equalTo(TaxRateTaxComponentsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TaxRateTaxComponentsItem of(String value) { + return new TaxRateTaxComponentsItem(value, 0); + } + + public static TaxRateTaxComponentsItem of(TaxComponent value) { + return new TaxRateTaxComponentsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TaxComponent value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TaxRateTaxComponentsItem.class); + } + + @Override + public TaxRateTaxComponentsItem 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, TaxComponent.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/TrackingCategory.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/TrackingCategory.java new file mode 100644 index 000000000..ea1490a71 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/TrackingCategory.java @@ -0,0 +1,388 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = TrackingCategory.Builder.class) +public final class TrackingCategory { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional status; + + private final Optional categoryType; + + private final Optional parentCategory; + + private final Optional company; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Map additionalProperties; + + private TrackingCategory( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional status, + Optional categoryType, + Optional parentCategory, + Optional company, + Optional remoteWasDeleted, + Optional> fieldMappings, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.status = status; + this.categoryType = categoryType; + this.parentCategory = parentCategory; + this.company = company; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + 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 tracking category's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The tracking category's status. + *
    + *
  • ACTIVE - ACTIVE
  • + *
  • ARCHIVED - ARCHIVED
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The tracking category’s type. + *
    + *
  • CLASS - CLASS
  • + *
  • DEPARTMENT - DEPARTMENT
  • + *
+ */ + @JsonProperty("category_type") + public Optional getCategoryType() { + return categoryType; + } + + @JsonProperty("parent_category") + public Optional getParentCategory() { + return parentCategory; + } + + /** + * @return The company the GeneralLedgerTransaction 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TrackingCategory && equalTo((TrackingCategory) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TrackingCategory other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && status.equals(other.status) + && categoryType.equals(other.categoryType) + && parentCategory.equals(other.parentCategory) + && company.equals(other.company) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.status, + this.categoryType, + this.parentCategory, + this.company, + this.remoteWasDeleted, + this.fieldMappings); + } + + @Override + 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 status = Optional.empty(); + + private Optional categoryType = Optional.empty(); + + private Optional parentCategory = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TrackingCategory other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + status(other.getStatus()); + categoryType(other.getCategoryType()); + parentCategory(other.getParentCategory()); + company(other.getCompany()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + 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 = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(TrackingCategoryStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "category_type", nulls = Nulls.SKIP) + public Builder categoryType(Optional categoryType) { + this.categoryType = categoryType; + return this; + } + + public Builder categoryType(TrackingCategoryCategoryType categoryType) { + this.categoryType = Optional.ofNullable(categoryType); + return this; + } + + @JsonSetter(value = "parent_category", nulls = Nulls.SKIP) + public Builder parentCategory(Optional parentCategory) { + this.parentCategory = parentCategory; + return this; + } + + public Builder parentCategory(String parentCategory) { + this.parentCategory = Optional.ofNullable(parentCategory); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(TrackingCategoryCompany 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; + } + + public TrackingCategory build() { + return new TrackingCategory( + id, + remoteId, + createdAt, + modifiedAt, + name, + status, + categoryType, + parentCategory, + company, + remoteWasDeleted, + fieldMappings, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/TrackingCategoryCategoryType.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/TrackingCategoryCategoryType.java new file mode 100644 index 000000000..40be7f09a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/TrackingCategoryCategoryType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/TrackingCategoryCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/TrackingCategoryCompany.java new file mode 100644 index 000000000..e0a5c2670 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/TrackingCategoryCompany.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TrackingCategoryCompany.Deserializer.class) +public final class TrackingCategoryCompany { + private final Object value; + + private final int type; + + private TrackingCategoryCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TrackingCategoryCompany && equalTo((TrackingCategoryCompany) other); + } + + private boolean equalTo(TrackingCategoryCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TrackingCategoryCompany of(String value) { + return new TrackingCategoryCompany(value, 0); + } + + public static TrackingCategoryCompany of(CompanyInfo value) { + return new TrackingCategoryCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TrackingCategoryCompany.class); + } + + @Override + public TrackingCategoryCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/TrackingCategoryStatus.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/TrackingCategoryStatus.java new file mode 100644 index 000000000..799e1f356 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/TrackingCategoryStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/Transaction.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/Transaction.java new file mode 100644 index 000000000..a22474226 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/Transaction.java @@ -0,0 +1,941 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Transaction.Builder.class) +public final class Transaction { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional transactionType; + + private final Optional number; + + private final Optional transactionDate; + + private final Optional account; + + private final Optional contact; + + private final Optional inclusiveOfTax; + + private final Optional totalAmount; + + private final Optional currency; + + private final Optional exchangeRate; + + private final Optional company; + + private final Optional>> trackingCategories; + + private final Optional> lineItems; + + private final Optional remoteWasDeleted; + + private final Optional accountingPeriod; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Transaction( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional transactionType, + Optional number, + Optional transactionDate, + Optional account, + Optional contact, + Optional inclusiveOfTax, + Optional totalAmount, + Optional currency, + Optional exchangeRate, + Optional company, + Optional>> trackingCategories, + Optional> lineItems, + Optional remoteWasDeleted, + Optional accountingPeriod, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.transactionType = transactionType; + this.number = number; + this.transactionDate = transactionDate; + this.account = account; + this.contact = contact; + this.inclusiveOfTax = inclusiveOfTax; + this.totalAmount = totalAmount; + this.currency = currency; + this.exchangeRate = exchangeRate; + this.company = company; + this.trackingCategories = trackingCategories; + this.lineItems = lineItems; + this.remoteWasDeleted = remoteWasDeleted; + this.accountingPeriod = accountingPeriod; + 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 transaction, which can by any transaction object not already included in Merge’s common model. + */ + @JsonProperty("transaction_type") + public Optional getTransactionType() { + return transactionType; + } + + /** + * @return The transaction's number used for identifying purposes. + */ + @JsonProperty("number") + public Optional getNumber() { + return number; + } + + /** + * @return The date upon which the transaction occurred. + */ + @JsonProperty("transaction_date") + public Optional getTransactionDate() { + return transactionDate; + } + + /** + * @return The transaction's account. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The contact to whom the transaction relates to. + */ + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + + /** + * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. + */ + @JsonProperty("inclusive_of_tax") + public Optional getInclusiveOfTax() { + return inclusiveOfTax; + } + + /** + * @return The total amount being paid after taxes. + */ + @JsonProperty("total_amount") + public Optional getTotalAmount() { + return totalAmount; + } + + /** + * @return The transaction'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 transaction's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return The company the transaction belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + @JsonProperty("line_items") + public Optional> getLineItems() { + return lineItems; + } + + /** + * @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 The accounting period that the Transaction was generated in. + */ + @JsonProperty("accounting_period") + public Optional getAccountingPeriod() { + return accountingPeriod; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Transaction && equalTo((Transaction) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Transaction other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && transactionType.equals(other.transactionType) + && number.equals(other.number) + && transactionDate.equals(other.transactionDate) + && account.equals(other.account) + && contact.equals(other.contact) + && inclusiveOfTax.equals(other.inclusiveOfTax) + && totalAmount.equals(other.totalAmount) + && currency.equals(other.currency) + && exchangeRate.equals(other.exchangeRate) + && company.equals(other.company) + && trackingCategories.equals(other.trackingCategories) + && lineItems.equals(other.lineItems) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && accountingPeriod.equals(other.accountingPeriod) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.transactionType, + this.number, + this.transactionDate, + this.account, + this.contact, + this.inclusiveOfTax, + this.totalAmount, + this.currency, + this.exchangeRate, + this.company, + this.trackingCategories, + this.lineItems, + this.remoteWasDeleted, + this.accountingPeriod, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 transactionType = Optional.empty(); + + private Optional number = Optional.empty(); + + private Optional transactionDate = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional contact = Optional.empty(); + + private Optional inclusiveOfTax = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional> lineItems = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional accountingPeriod = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Transaction other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + transactionType(other.getTransactionType()); + number(other.getNumber()); + transactionDate(other.getTransactionDate()); + account(other.getAccount()); + contact(other.getContact()); + inclusiveOfTax(other.getInclusiveOfTax()); + totalAmount(other.getTotalAmount()); + currency(other.getCurrency()); + exchangeRate(other.getExchangeRate()); + company(other.getCompany()); + trackingCategories(other.getTrackingCategories()); + lineItems(other.getLineItems()); + remoteWasDeleted(other.getRemoteWasDeleted()); + accountingPeriod(other.getAccountingPeriod()); + 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 = "transaction_type", nulls = Nulls.SKIP) + public Builder transactionType(Optional transactionType) { + this.transactionType = transactionType; + return this; + } + + public Builder transactionType(String transactionType) { + this.transactionType = Optional.ofNullable(transactionType); + return this; + } + + @JsonSetter(value = "number", nulls = Nulls.SKIP) + public Builder number(Optional number) { + this.number = number; + return this; + } + + public Builder number(String number) { + this.number = Optional.ofNullable(number); + return this; + } + + @JsonSetter(value = "transaction_date", nulls = Nulls.SKIP) + public Builder transactionDate(Optional transactionDate) { + this.transactionDate = transactionDate; + return this; + } + + public Builder transactionDate(OffsetDateTime transactionDate) { + this.transactionDate = Optional.ofNullable(transactionDate); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(TransactionAccount 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(TransactionContact contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "inclusive_of_tax", nulls = Nulls.SKIP) + public Builder inclusiveOfTax(Optional inclusiveOfTax) { + this.inclusiveOfTax = inclusiveOfTax; + return this; + } + + public Builder inclusiveOfTax(Boolean inclusiveOfTax) { + this.inclusiveOfTax = Optional.ofNullable(inclusiveOfTax); + return this; + } + + @JsonSetter(value = "total_amount", nulls = Nulls.SKIP) + public Builder totalAmount(Optional totalAmount) { + this.totalAmount = totalAmount; + return this; + } + + public Builder totalAmount(String totalAmount) { + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(TransactionCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + 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 = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + @JsonSetter(value = "line_items", nulls = Nulls.SKIP) + public Builder lineItems(Optional> lineItems) { + this.lineItems = lineItems; + return this; + } + + public Builder lineItems(List lineItems) { + this.lineItems = Optional.ofNullable(lineItems); + 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 = "accounting_period", nulls = Nulls.SKIP) + public Builder accountingPeriod(Optional accountingPeriod) { + this.accountingPeriod = accountingPeriod; + return this; + } + + public Builder accountingPeriod(TransactionAccountingPeriod accountingPeriod) { + this.accountingPeriod = Optional.ofNullable(accountingPeriod); + 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 Transaction build() { + return new Transaction( + id, + remoteId, + createdAt, + modifiedAt, + transactionType, + number, + transactionDate, + account, + contact, + inclusiveOfTax, + totalAmount, + currency, + exchangeRate, + company, + trackingCategories, + lineItems, + remoteWasDeleted, + accountingPeriod, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/TransactionAccount.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/TransactionAccount.java new file mode 100644 index 000000000..5e98afe29 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/TransactionAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TransactionAccount.Deserializer.class) +public final class TransactionAccount { + private final Object value; + + private final int type; + + private TransactionAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TransactionAccount && equalTo((TransactionAccount) other); + } + + private boolean equalTo(TransactionAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TransactionAccount of(String value) { + return new TransactionAccount(value, 0); + } + + public static TransactionAccount of(Account value) { + return new TransactionAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TransactionAccount.class); + } + + @Override + public TransactionAccount 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/legacy/api/resources/accounting/types/TransactionAccountingPeriod.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/TransactionAccountingPeriod.java new file mode 100644 index 000000000..5b5bce481 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/TransactionAccountingPeriod.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TransactionAccountingPeriod.Deserializer.class) +public final class TransactionAccountingPeriod { + private final Object value; + + private final int type; + + private TransactionAccountingPeriod(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((AccountingPeriod) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TransactionAccountingPeriod && equalTo((TransactionAccountingPeriod) other); + } + + private boolean equalTo(TransactionAccountingPeriod other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TransactionAccountingPeriod of(String value) { + return new TransactionAccountingPeriod(value, 0); + } + + public static TransactionAccountingPeriod of(AccountingPeriod value) { + return new TransactionAccountingPeriod(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(AccountingPeriod value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TransactionAccountingPeriod.class); + } + + @Override + public TransactionAccountingPeriod 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, AccountingPeriod.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/TransactionContact.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/TransactionContact.java new file mode 100644 index 000000000..d960bff2e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/TransactionContact.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TransactionContact.Deserializer.class) +public final class TransactionContact { + private final Object value; + + private final int type; + + private TransactionContact(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TransactionContact && equalTo((TransactionContact) other); + } + + private boolean equalTo(TransactionContact other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TransactionContact of(String value) { + return new TransactionContact(value, 0); + } + + public static TransactionContact of(Contact value) { + return new TransactionContact(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TransactionContact.class); + } + + @Override + public TransactionContact 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/TransactionCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/TransactionCurrency.java new file mode 100644 index 000000000..0248c19c9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/TransactionCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/TransactionCurrencyEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/TransactionCurrencyEnum.java new file mode 100644 index 000000000..c62f8c25e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/TransactionCurrencyEnum.java @@ -0,0 +1,632 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TransactionCurrencyEnum { + XUA("XUA"), + + AFN("AFN"), + + AFA("AFA"), + + ALL("ALL"), + + ALK("ALK"), + + DZD("DZD"), + + ADP("ADP"), + + AOA("AOA"), + + AOK("AOK"), + + AON("AON"), + + AOR("AOR"), + + ARA("ARA"), + + ARS("ARS"), + + ARM("ARM"), + + ARP("ARP"), + + ARL("ARL"), + + AMD("AMD"), + + AWG("AWG"), + + AUD("AUD"), + + ATS("ATS"), + + AZN("AZN"), + + AZM("AZM"), + + BSD("BSD"), + + BHD("BHD"), + + BDT("BDT"), + + BBD("BBD"), + + BYN("BYN"), + + BYB("BYB"), + + BYR("BYR"), + + BEF("BEF"), + + BEC("BEC"), + + BEL("BEL"), + + BZD("BZD"), + + BMD("BMD"), + + BTN("BTN"), + + BOB("BOB"), + + BOL("BOL"), + + BOV("BOV"), + + BOP("BOP"), + + BAM("BAM"), + + BAD("BAD"), + + BAN("BAN"), + + BWP("BWP"), + + BRC("BRC"), + + BRZ("BRZ"), + + BRE("BRE"), + + BRR("BRR"), + + BRN("BRN"), + + BRB("BRB"), + + BRL("BRL"), + + GBP("GBP"), + + BND("BND"), + + BGL("BGL"), + + BGN("BGN"), + + BGO("BGO"), + + BGM("BGM"), + + BUK("BUK"), + + BIF("BIF"), + + XPF("XPF"), + + KHR("KHR"), + + CAD("CAD"), + + CVE("CVE"), + + KYD("KYD"), + + XAF("XAF"), + + CLE("CLE"), + + CLP("CLP"), + + CLF("CLF"), + + CNX("CNX"), + + CNY("CNY"), + + CNH("CNH"), + + COP("COP"), + + COU("COU"), + + KMF("KMF"), + + CDF("CDF"), + + CRC("CRC"), + + HRD("HRD"), + + HRK("HRK"), + + CUC("CUC"), + + CUP("CUP"), + + CYP("CYP"), + + CZK("CZK"), + + CSK("CSK"), + + DKK("DKK"), + + DJF("DJF"), + + DOP("DOP"), + + NLG("NLG"), + + XCD("XCD"), + + DDM("DDM"), + + ECS("ECS"), + + ECV("ECV"), + + EGP("EGP"), + + GQE("GQE"), + + ERN("ERN"), + + EEK("EEK"), + + ETB("ETB"), + + EUR("EUR"), + + XBA("XBA"), + + XEU("XEU"), + + XBB("XBB"), + + XBC("XBC"), + + XBD("XBD"), + + FKP("FKP"), + + FJD("FJD"), + + FIM("FIM"), + + FRF("FRF"), + + XFO("XFO"), + + XFU("XFU"), + + GMD("GMD"), + + GEK("GEK"), + + GEL("GEL"), + + DEM("DEM"), + + GHS("GHS"), + + GHC("GHC"), + + GIP("GIP"), + + XAU("XAU"), + + GRD("GRD"), + + GTQ("GTQ"), + + GWP("GWP"), + + GNF("GNF"), + + GNS("GNS"), + + GYD("GYD"), + + HTG("HTG"), + + HNL("HNL"), + + HKD("HKD"), + + HUF("HUF"), + + IMP("IMP"), + + ISK("ISK"), + + ISJ("ISJ"), + + INR("INR"), + + IDR("IDR"), + + IRR("IRR"), + + IQD("IQD"), + + IEP("IEP"), + + ILS("ILS"), + + ILP("ILP"), + + ILR("ILR"), + + ITL("ITL"), + + JMD("JMD"), + + JPY("JPY"), + + JOD("JOD"), + + KZT("KZT"), + + KES("KES"), + + KWD("KWD"), + + KGS("KGS"), + + LAK("LAK"), + + LVL("LVL"), + + LVR("LVR"), + + LBP("LBP"), + + LSL("LSL"), + + LRD("LRD"), + + LYD("LYD"), + + LTL("LTL"), + + LTT("LTT"), + + LUL("LUL"), + + LUC("LUC"), + + LUF("LUF"), + + MOP("MOP"), + + MKD("MKD"), + + MKN("MKN"), + + MGA("MGA"), + + MGF("MGF"), + + MWK("MWK"), + + MYR("MYR"), + + MVR("MVR"), + + MVP("MVP"), + + MLF("MLF"), + + MTL("MTL"), + + MTP("MTP"), + + MRU("MRU"), + + MRO("MRO"), + + MUR("MUR"), + + MXV("MXV"), + + MXN("MXN"), + + MXP("MXP"), + + MDC("MDC"), + + MDL("MDL"), + + MCF("MCF"), + + MNT("MNT"), + + MAD("MAD"), + + MAF("MAF"), + + MZE("MZE"), + + MZN("MZN"), + + MZM("MZM"), + + MMK("MMK"), + + NAD("NAD"), + + NPR("NPR"), + + ANG("ANG"), + + TWD("TWD"), + + NZD("NZD"), + + NIO("NIO"), + + NIC("NIC"), + + NGN("NGN"), + + KPW("KPW"), + + NOK("NOK"), + + OMR("OMR"), + + PKR("PKR"), + + XPD("XPD"), + + PAB("PAB"), + + PGK("PGK"), + + PYG("PYG"), + + PEI("PEI"), + + PEN("PEN"), + + PES("PES"), + + PHP("PHP"), + + XPT("XPT"), + + PLN("PLN"), + + PLZ("PLZ"), + + PTE("PTE"), + + GWE("GWE"), + + QAR("QAR"), + + XRE("XRE"), + + RHD("RHD"), + + RON("RON"), + + ROL("ROL"), + + RUB("RUB"), + + RUR("RUR"), + + RWF("RWF"), + + SVC("SVC"), + + WST("WST"), + + SAR("SAR"), + + RSD("RSD"), + + CSD("CSD"), + + SCR("SCR"), + + SLL("SLL"), + + XAG("XAG"), + + SGD("SGD"), + + SKK("SKK"), + + SIT("SIT"), + + SBD("SBD"), + + SOS("SOS"), + + ZAR("ZAR"), + + ZAL("ZAL"), + + KRH("KRH"), + + KRW("KRW"), + + KRO("KRO"), + + SSP("SSP"), + + SUR("SUR"), + + ESP("ESP"), + + ESA("ESA"), + + ESB("ESB"), + + XDR("XDR"), + + LKR("LKR"), + + SHP("SHP"), + + XSU("XSU"), + + SDD("SDD"), + + SDG("SDG"), + + SDP("SDP"), + + SRD("SRD"), + + SRG("SRG"), + + SZL("SZL"), + + SEK("SEK"), + + CHF("CHF"), + + SYP("SYP"), + + STN("STN"), + + STD("STD"), + + TVD("TVD"), + + TJR("TJR"), + + TJS("TJS"), + + TZS("TZS"), + + XTS("XTS"), + + THB("THB"), + + XXX("XXX"), + + TPE("TPE"), + + TOP("TOP"), + + TTD("TTD"), + + TND("TND"), + + TRY("TRY"), + + TRL("TRL"), + + TMT("TMT"), + + TMM("TMM"), + + USD("USD"), + + USN("USN"), + + USS("USS"), + + UGX("UGX"), + + UGS("UGS"), + + UAH("UAH"), + + UAK("UAK"), + + AED("AED"), + + UYW("UYW"), + + UYU("UYU"), + + UYP("UYP"), + + UYI("UYI"), + + UZS("UZS"), + + VUV("VUV"), + + VES("VES"), + + VEB("VEB"), + + VEF("VEF"), + + VND("VND"), + + VNN("VNN"), + + CHE("CHE"), + + CHW("CHW"), + + XOF("XOF"), + + YDD("YDD"), + + YER("YER"), + + YUN("YUN"), + + YUD("YUD"), + + YUM("YUM"), + + YUR("YUR"), + + ZWN("ZWN"), + + ZRN("ZRN"), + + ZRZ("ZRZ"), + + ZMW("ZMW"), + + ZMK("ZMK"), + + ZWD("ZWD"), + + ZWR("ZWR"), + + ZWL("ZWL"); + + private final String value; + + TransactionCurrencyEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/TransactionLineItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/TransactionLineItem.java new file mode 100644 index 000000000..963427820 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/TransactionLineItem.java @@ -0,0 +1,861 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TransactionLineItem.Builder.class) +public final class TransactionLineItem { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional memo; + + private final Optional unitPrice; + + private final Optional quantity; + + private final Optional item; + + private final Optional account; + + private final Optional trackingCategory; + + private final Optional>> trackingCategories; + + private final Optional totalLineAmount; + + private final Optional taxRate; + + private final Optional currency; + + private final Optional exchangeRate; + + private final Optional company; + + private final Optional remoteWasDeleted; + + private final Map additionalProperties; + + private TransactionLineItem( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional memo, + Optional unitPrice, + Optional quantity, + Optional item, + Optional account, + Optional trackingCategory, + Optional>> trackingCategories, + Optional totalLineAmount, + Optional taxRate, + Optional currency, + Optional exchangeRate, + Optional company, + Optional remoteWasDeleted, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.memo = memo; + this.unitPrice = unitPrice; + this.quantity = quantity; + this.item = item; + this.account = account; + this.trackingCategory = trackingCategory; + this.trackingCategories = trackingCategories; + this.totalLineAmount = totalLineAmount; + this.taxRate = taxRate; + this.currency = currency; + this.exchangeRate = exchangeRate; + this.company = company; + this.remoteWasDeleted = remoteWasDeleted; + 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 An internal note used by the business to clarify purpose of the transaction. + */ + @JsonProperty("memo") + public Optional getMemo() { + return memo; + } + + /** + * @return The line item's unit price. + */ + @JsonProperty("unit_price") + public Optional getUnitPrice() { + return unitPrice; + } + + /** + * @return The line item's quantity. + */ + @JsonProperty("quantity") + public Optional getQuantity() { + return quantity; + } + + @JsonProperty("item") + public Optional getItem() { + return item; + } + + /** + * @return The line item's account. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The line's associated tracking category. + */ + @JsonProperty("tracking_category") + public Optional getTrackingCategory() { + return trackingCategory; + } + + /** + * @return The transaction line item's associated tracking categories. + */ + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The line item's total. + */ + @JsonProperty("total_line_amount") + public Optional getTotalLineAmount() { + return totalLineAmount; + } + + /** + * @return The tax rate that applies to this line item. + */ + @JsonProperty("tax_rate") + public Optional getTaxRate() { + return taxRate; + } + + /** + * @return The line item'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 line item's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return The company the line 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TransactionLineItem && equalTo((TransactionLineItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TransactionLineItem other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && memo.equals(other.memo) + && unitPrice.equals(other.unitPrice) + && quantity.equals(other.quantity) + && item.equals(other.item) + && account.equals(other.account) + && trackingCategory.equals(other.trackingCategory) + && trackingCategories.equals(other.trackingCategories) + && totalLineAmount.equals(other.totalLineAmount) + && taxRate.equals(other.taxRate) + && currency.equals(other.currency) + && exchangeRate.equals(other.exchangeRate) + && company.equals(other.company) + && remoteWasDeleted.equals(other.remoteWasDeleted); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.memo, + this.unitPrice, + this.quantity, + this.item, + this.account, + this.trackingCategory, + this.trackingCategories, + this.totalLineAmount, + this.taxRate, + this.currency, + this.exchangeRate, + this.company, + this.remoteWasDeleted); + } + + @Override + 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 memo = Optional.empty(); + + private Optional unitPrice = Optional.empty(); + + private Optional quantity = Optional.empty(); + + private Optional item = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional trackingCategory = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional totalLineAmount = Optional.empty(); + + private Optional taxRate = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TransactionLineItem other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + memo(other.getMemo()); + unitPrice(other.getUnitPrice()); + quantity(other.getQuantity()); + item(other.getItem()); + account(other.getAccount()); + trackingCategory(other.getTrackingCategory()); + trackingCategories(other.getTrackingCategories()); + totalLineAmount(other.getTotalLineAmount()); + taxRate(other.getTaxRate()); + currency(other.getCurrency()); + exchangeRate(other.getExchangeRate()); + company(other.getCompany()); + remoteWasDeleted(other.getRemoteWasDeleted()); + 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 = "memo", nulls = Nulls.SKIP) + public Builder memo(Optional memo) { + this.memo = memo; + return this; + } + + public Builder memo(String memo) { + this.memo = Optional.ofNullable(memo); + return this; + } + + @JsonSetter(value = "unit_price", nulls = Nulls.SKIP) + public Builder unitPrice(Optional unitPrice) { + this.unitPrice = unitPrice; + return this; + } + + public Builder unitPrice(String unitPrice) { + this.unitPrice = Optional.ofNullable(unitPrice); + return this; + } + + @JsonSetter(value = "quantity", nulls = Nulls.SKIP) + public Builder quantity(Optional quantity) { + this.quantity = quantity; + return this; + } + + public Builder quantity(String quantity) { + this.quantity = Optional.ofNullable(quantity); + return this; + } + + @JsonSetter(value = "item", nulls = Nulls.SKIP) + public Builder item(Optional item) { + this.item = item; + return this; + } + + public Builder item(TransactionLineItemItem item) { + this.item = Optional.ofNullable(item); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(String account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "tracking_category", nulls = Nulls.SKIP) + public Builder trackingCategory(Optional trackingCategory) { + this.trackingCategory = trackingCategory; + return this; + } + + public Builder trackingCategory(String trackingCategory) { + this.trackingCategory = Optional.ofNullable(trackingCategory); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories(Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + @JsonSetter(value = "total_line_amount", nulls = Nulls.SKIP) + public Builder totalLineAmount(Optional totalLineAmount) { + this.totalLineAmount = totalLineAmount; + return this; + } + + public Builder totalLineAmount(String totalLineAmount) { + this.totalLineAmount = Optional.ofNullable(totalLineAmount); + return this; + } + + @JsonSetter(value = "tax_rate", nulls = Nulls.SKIP) + public Builder taxRate(Optional taxRate) { + this.taxRate = taxRate; + return this; + } + + public Builder taxRate(String taxRate) { + this.taxRate = Optional.ofNullable(taxRate); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(TransactionLineItemCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + 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; + } + + public TransactionLineItem build() { + return new TransactionLineItem( + id, + remoteId, + createdAt, + modifiedAt, + memo, + unitPrice, + quantity, + item, + account, + trackingCategory, + trackingCategories, + totalLineAmount, + taxRate, + currency, + exchangeRate, + company, + remoteWasDeleted, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/TransactionLineItemCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/TransactionLineItemCurrency.java new file mode 100644 index 000000000..7b85c96d7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/TransactionLineItemCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/TransactionLineItemItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/TransactionLineItemItem.java new file mode 100644 index 000000000..e606f4c27 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/TransactionLineItemItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TransactionLineItemItem.Deserializer.class) +public final class TransactionLineItemItem { + private final Object value; + + private final int type; + + private TransactionLineItemItem(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((Item) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TransactionLineItemItem && equalTo((TransactionLineItemItem) other); + } + + private boolean equalTo(TransactionLineItemItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TransactionLineItemItem of(String value) { + return new TransactionLineItemItem(value, 0); + } + + public static TransactionLineItemItem of(Item value) { + return new TransactionLineItemItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Item value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TransactionLineItemItem.class); + } + + @Override + public TransactionLineItemItem 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, Item.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/TransactionTrackingCategoriesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/TransactionTrackingCategoriesItem.java new file mode 100644 index 000000000..2ee069d1f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/TransactionTrackingCategoriesItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TransactionTrackingCategoriesItem.Deserializer.class) +public final class TransactionTrackingCategoriesItem { + private final Object value; + + private final int type; + + private TransactionTrackingCategoriesItem(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TransactionTrackingCategoriesItem && equalTo((TransactionTrackingCategoriesItem) other); + } + + private boolean equalTo(TransactionTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TransactionTrackingCategoriesItem of(String value) { + return new TransactionTrackingCategoriesItem(value, 0); + } + + public static TransactionTrackingCategoriesItem of(TrackingCategory value) { + return new TransactionTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TransactionTrackingCategoriesItem.class); + } + + @Override + public TransactionTrackingCategoriesItem 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/UnderlyingTransactionTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/UnderlyingTransactionTypeEnum.java new file mode 100644 index 000000000..069b3a24a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/UnderlyingTransactionTypeEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum UnderlyingTransactionTypeEnum { + INVOICE("INVOICE"), + + EXPENSE("EXPENSE"), + + TRANSACTION("TRANSACTION"), + + JOURNAL_ENTRY("JOURNAL_ENTRY"), + + PAYMENT("PAYMENT"), + + VENDOR_CREDIT("VENDOR_CREDIT"), + + CREDIT_NOTE("CREDIT_NOTE"); + + private final String value; + + UnderlyingTransactionTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/ValidationProblemSource.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/ValidationProblemSource.java new file mode 100644 index 000000000..1f658d96a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/ValidationProblemSource.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.pointer); + } + + @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() {} + + @Override + public Builder from(ValidationProblemSource other) { + pointer(other.getPointer()); + return this; + } + + @Override + @JsonSetter("pointer") + public _FinalStage pointer(@NotNull String pointer) { + this.pointer = pointer; + return this; + } + + @Override + public ValidationProblemSource build() { + return new ValidationProblemSource(pointer, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCredit.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCredit.java new file mode 100644 index 000000000..8a0870d7b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCredit.java @@ -0,0 +1,912 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = VendorCredit.Builder.class) +public final class VendorCredit { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional number; + + private final Optional transactionDate; + + private final Optional vendor; + + private final Optional totalAmount; + + private final Optional currency; + + private final Optional exchangeRate; + + private final Optional inclusiveOfTax; + + private final Optional company; + + private final Optional> lines; + + private final Optional>> trackingCategories; + + private final Optional> appliedToLines; + + private final Optional remoteWasDeleted; + + private final Optional accountingPeriod; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private VendorCredit( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional number, + Optional transactionDate, + Optional vendor, + Optional totalAmount, + Optional currency, + Optional exchangeRate, + Optional inclusiveOfTax, + Optional company, + Optional> lines, + Optional>> trackingCategories, + Optional> appliedToLines, + Optional remoteWasDeleted, + Optional accountingPeriod, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.number = number; + this.transactionDate = transactionDate; + this.vendor = vendor; + this.totalAmount = totalAmount; + this.currency = currency; + this.exchangeRate = exchangeRate; + this.inclusiveOfTax = inclusiveOfTax; + this.company = company; + this.lines = lines; + this.trackingCategories = trackingCategories; + this.appliedToLines = appliedToLines; + this.remoteWasDeleted = remoteWasDeleted; + this.accountingPeriod = accountingPeriod; + 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 vendor credit's number. + */ + @JsonProperty("number") + public Optional getNumber() { + return number; + } + + /** + * @return The vendor credit's transaction date. + */ + @JsonProperty("transaction_date") + public Optional getTransactionDate() { + return transactionDate; + } + + /** + * @return The vendor that owes the gift or refund. + */ + @JsonProperty("vendor") + public Optional getVendor() { + return vendor; + } + + /** + * @return The vendor credit's total amount. + */ + @JsonProperty("total_amount") + public Optional getTotalAmount() { + return totalAmount; + } + + /** + * @return The vendor credit'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 vendor credit's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. + */ + @JsonProperty("inclusive_of_tax") + public Optional getInclusiveOfTax() { + return inclusiveOfTax; + } + + /** + * @return The company the vendor credit belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + @JsonProperty("lines") + public Optional> getLines() { + return lines; + } + + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return A list of VendorCredit Applied to Lines objects. + */ + @JsonProperty("applied_to_lines") + public Optional> getAppliedToLines() { + return appliedToLines; + } + + /** + * @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 The accounting period that the VendorCredit was generated in. + */ + @JsonProperty("accounting_period") + public Optional getAccountingPeriod() { + return accountingPeriod; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCredit && equalTo((VendorCredit) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(VendorCredit other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && number.equals(other.number) + && transactionDate.equals(other.transactionDate) + && vendor.equals(other.vendor) + && totalAmount.equals(other.totalAmount) + && currency.equals(other.currency) + && exchangeRate.equals(other.exchangeRate) + && inclusiveOfTax.equals(other.inclusiveOfTax) + && company.equals(other.company) + && lines.equals(other.lines) + && trackingCategories.equals(other.trackingCategories) + && appliedToLines.equals(other.appliedToLines) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && accountingPeriod.equals(other.accountingPeriod) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.number, + this.transactionDate, + this.vendor, + this.totalAmount, + this.currency, + this.exchangeRate, + this.inclusiveOfTax, + this.company, + this.lines, + this.trackingCategories, + this.appliedToLines, + this.remoteWasDeleted, + this.accountingPeriod, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 number = Optional.empty(); + + private Optional transactionDate = Optional.empty(); + + private Optional vendor = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional inclusiveOfTax = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional> lines = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional> appliedToLines = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional accountingPeriod = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(VendorCredit other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + number(other.getNumber()); + transactionDate(other.getTransactionDate()); + vendor(other.getVendor()); + totalAmount(other.getTotalAmount()); + currency(other.getCurrency()); + exchangeRate(other.getExchangeRate()); + inclusiveOfTax(other.getInclusiveOfTax()); + company(other.getCompany()); + lines(other.getLines()); + trackingCategories(other.getTrackingCategories()); + appliedToLines(other.getAppliedToLines()); + remoteWasDeleted(other.getRemoteWasDeleted()); + accountingPeriod(other.getAccountingPeriod()); + 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 = "number", nulls = Nulls.SKIP) + public Builder number(Optional number) { + this.number = number; + return this; + } + + public Builder number(String number) { + this.number = Optional.ofNullable(number); + return this; + } + + @JsonSetter(value = "transaction_date", nulls = Nulls.SKIP) + public Builder transactionDate(Optional transactionDate) { + this.transactionDate = transactionDate; + return this; + } + + public Builder transactionDate(OffsetDateTime transactionDate) { + this.transactionDate = Optional.ofNullable(transactionDate); + return this; + } + + @JsonSetter(value = "vendor", nulls = Nulls.SKIP) + public Builder vendor(Optional vendor) { + this.vendor = vendor; + return this; + } + + public Builder vendor(VendorCreditVendor vendor) { + this.vendor = Optional.ofNullable(vendor); + return this; + } + + @JsonSetter(value = "total_amount", nulls = Nulls.SKIP) + public Builder totalAmount(Optional totalAmount) { + this.totalAmount = totalAmount; + return this; + } + + public Builder totalAmount(Double totalAmount) { + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(VendorCreditCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + @JsonSetter(value = "inclusive_of_tax", nulls = Nulls.SKIP) + public Builder inclusiveOfTax(Optional inclusiveOfTax) { + this.inclusiveOfTax = inclusiveOfTax; + return this; + } + + public Builder inclusiveOfTax(Boolean inclusiveOfTax) { + this.inclusiveOfTax = Optional.ofNullable(inclusiveOfTax); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(VendorCreditCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "lines", nulls = Nulls.SKIP) + public Builder lines(Optional> lines) { + this.lines = lines; + return this; + } + + public Builder lines(List lines) { + this.lines = Optional.ofNullable(lines); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + @JsonSetter(value = "applied_to_lines", nulls = Nulls.SKIP) + public Builder appliedToLines(Optional> appliedToLines) { + this.appliedToLines = appliedToLines; + return this; + } + + public Builder appliedToLines(List appliedToLines) { + this.appliedToLines = Optional.ofNullable(appliedToLines); + 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 = "accounting_period", nulls = Nulls.SKIP) + public Builder accountingPeriod(Optional accountingPeriod) { + this.accountingPeriod = accountingPeriod; + return this; + } + + public Builder accountingPeriod(VendorCreditAccountingPeriod accountingPeriod) { + this.accountingPeriod = Optional.ofNullable(accountingPeriod); + 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 VendorCredit build() { + return new VendorCredit( + id, + remoteId, + createdAt, + modifiedAt, + number, + transactionDate, + vendor, + totalAmount, + currency, + exchangeRate, + inclusiveOfTax, + company, + lines, + trackingCategories, + appliedToLines, + remoteWasDeleted, + accountingPeriod, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditAccountingPeriod.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditAccountingPeriod.java new file mode 100644 index 000000000..16a3d24d1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditAccountingPeriod.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = VendorCreditAccountingPeriod.Deserializer.class) +public final class VendorCreditAccountingPeriod { + private final Object value; + + private final int type; + + private VendorCreditAccountingPeriod(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((AccountingPeriod) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCreditAccountingPeriod && equalTo((VendorCreditAccountingPeriod) other); + } + + private boolean equalTo(VendorCreditAccountingPeriod other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static VendorCreditAccountingPeriod of(String value) { + return new VendorCreditAccountingPeriod(value, 0); + } + + public static VendorCreditAccountingPeriod of(AccountingPeriod value) { + return new VendorCreditAccountingPeriod(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(AccountingPeriod value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(VendorCreditAccountingPeriod.class); + } + + @Override + public VendorCreditAccountingPeriod 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, AccountingPeriod.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditApplyLineForInvoice.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditApplyLineForInvoice.java new file mode 100644 index 000000000..3fef3bd35 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditApplyLineForInvoice.java @@ -0,0 +1,269 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = VendorCreditApplyLineForInvoice.Builder.class) +public final class VendorCreditApplyLineForInvoice { + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional vendorCredit; + + private final Optional appliedDate; + + private final Optional appliedAmount; + + private final Optional remoteWasDeleted; + + private final Map additionalProperties; + + private VendorCreditApplyLineForInvoice( + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional vendorCredit, + Optional appliedDate, + Optional appliedAmount, + Optional remoteWasDeleted, + Map additionalProperties) { + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.vendorCredit = vendorCredit; + this.appliedDate = appliedDate; + this.appliedAmount = appliedAmount; + this.remoteWasDeleted = remoteWasDeleted; + 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("vendor_credit") + public Optional getVendorCredit() { + return vendorCredit; + } + + /** + * @return Date that the vendor credit is applied to the invoice. + */ + @JsonProperty("applied_date") + public Optional getAppliedDate() { + return appliedDate; + } + + /** + * @return The amount of the VendorCredit applied to the invoice. + */ + @JsonProperty("applied_amount") + public Optional getAppliedAmount() { + return appliedAmount; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCreditApplyLineForInvoice && equalTo((VendorCreditApplyLineForInvoice) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(VendorCreditApplyLineForInvoice other) { + return remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && vendorCredit.equals(other.vendorCredit) + && appliedDate.equals(other.appliedDate) + && appliedAmount.equals(other.appliedAmount) + && remoteWasDeleted.equals(other.remoteWasDeleted); + } + + @Override + public int hashCode() { + return Objects.hash( + this.remoteId, + this.createdAt, + this.modifiedAt, + this.vendorCredit, + this.appliedDate, + this.appliedAmount, + this.remoteWasDeleted); + } + + @Override + 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 vendorCredit = Optional.empty(); + + private Optional appliedDate = Optional.empty(); + + private Optional appliedAmount = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(VendorCreditApplyLineForInvoice other) { + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + vendorCredit(other.getVendorCredit()); + appliedDate(other.getAppliedDate()); + appliedAmount(other.getAppliedAmount()); + remoteWasDeleted(other.getRemoteWasDeleted()); + 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 = "vendor_credit", nulls = Nulls.SKIP) + public Builder vendorCredit(Optional vendorCredit) { + this.vendorCredit = vendorCredit; + return this; + } + + public Builder vendorCredit(VendorCreditApplyLineForInvoiceVendorCredit vendorCredit) { + this.vendorCredit = Optional.ofNullable(vendorCredit); + return this; + } + + @JsonSetter(value = "applied_date", nulls = Nulls.SKIP) + public Builder appliedDate(Optional appliedDate) { + this.appliedDate = appliedDate; + return this; + } + + public Builder appliedDate(OffsetDateTime appliedDate) { + this.appliedDate = Optional.ofNullable(appliedDate); + return this; + } + + @JsonSetter(value = "applied_amount", nulls = Nulls.SKIP) + public Builder appliedAmount(Optional appliedAmount) { + this.appliedAmount = appliedAmount; + return this; + } + + public Builder appliedAmount(String appliedAmount) { + this.appliedAmount = Optional.ofNullable(appliedAmount); + 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 VendorCreditApplyLineForInvoice build() { + return new VendorCreditApplyLineForInvoice( + remoteId, + createdAt, + modifiedAt, + vendorCredit, + appliedDate, + appliedAmount, + remoteWasDeleted, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditApplyLineForInvoiceVendorCredit.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditApplyLineForInvoiceVendorCredit.java new file mode 100644 index 000000000..945fda8f1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditApplyLineForInvoiceVendorCredit.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = VendorCreditApplyLineForInvoiceVendorCredit.Deserializer.class) +public final class VendorCreditApplyLineForInvoiceVendorCredit { + private final Object value; + + private final int type; + + private VendorCreditApplyLineForInvoiceVendorCredit(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((VendorCredit) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCreditApplyLineForInvoiceVendorCredit + && equalTo((VendorCreditApplyLineForInvoiceVendorCredit) other); + } + + private boolean equalTo(VendorCreditApplyLineForInvoiceVendorCredit other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static VendorCreditApplyLineForInvoiceVendorCredit of(String value) { + return new VendorCreditApplyLineForInvoiceVendorCredit(value, 0); + } + + public static VendorCreditApplyLineForInvoiceVendorCredit of(VendorCredit value) { + return new VendorCreditApplyLineForInvoiceVendorCredit(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(VendorCredit value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(VendorCreditApplyLineForInvoiceVendorCredit.class); + } + + @Override + public VendorCreditApplyLineForInvoiceVendorCredit 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, VendorCredit.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditApplyLineForVendorCredit.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditApplyLineForVendorCredit.java new file mode 100644 index 000000000..1706d297c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditApplyLineForVendorCredit.java @@ -0,0 +1,270 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = VendorCreditApplyLineForVendorCredit.Builder.class) +public final class VendorCreditApplyLineForVendorCredit { + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional invoice; + + private final Optional appliedDate; + + private final Optional appliedAmount; + + private final Optional remoteWasDeleted; + + private final Map additionalProperties; + + private VendorCreditApplyLineForVendorCredit( + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional invoice, + Optional appliedDate, + Optional appliedAmount, + Optional remoteWasDeleted, + Map additionalProperties) { + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.invoice = invoice; + this.appliedDate = appliedDate; + this.appliedAmount = appliedAmount; + this.remoteWasDeleted = remoteWasDeleted; + 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("invoice") + public Optional getInvoice() { + return invoice; + } + + /** + * @return Date that the vendor credit is applied to the invoice. + */ + @JsonProperty("applied_date") + public Optional getAppliedDate() { + return appliedDate; + } + + /** + * @return The amount of the VendorCredit applied to the invoice. + */ + @JsonProperty("applied_amount") + public Optional getAppliedAmount() { + return appliedAmount; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCreditApplyLineForVendorCredit + && equalTo((VendorCreditApplyLineForVendorCredit) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(VendorCreditApplyLineForVendorCredit other) { + return remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && invoice.equals(other.invoice) + && appliedDate.equals(other.appliedDate) + && appliedAmount.equals(other.appliedAmount) + && remoteWasDeleted.equals(other.remoteWasDeleted); + } + + @Override + public int hashCode() { + return Objects.hash( + this.remoteId, + this.createdAt, + this.modifiedAt, + this.invoice, + this.appliedDate, + this.appliedAmount, + this.remoteWasDeleted); + } + + @Override + 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 invoice = Optional.empty(); + + private Optional appliedDate = Optional.empty(); + + private Optional appliedAmount = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(VendorCreditApplyLineForVendorCredit other) { + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + invoice(other.getInvoice()); + appliedDate(other.getAppliedDate()); + appliedAmount(other.getAppliedAmount()); + remoteWasDeleted(other.getRemoteWasDeleted()); + 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 = "invoice", nulls = Nulls.SKIP) + public Builder invoice(Optional invoice) { + this.invoice = invoice; + return this; + } + + public Builder invoice(VendorCreditApplyLineForVendorCreditInvoice invoice) { + this.invoice = Optional.ofNullable(invoice); + return this; + } + + @JsonSetter(value = "applied_date", nulls = Nulls.SKIP) + public Builder appliedDate(Optional appliedDate) { + this.appliedDate = appliedDate; + return this; + } + + public Builder appliedDate(OffsetDateTime appliedDate) { + this.appliedDate = Optional.ofNullable(appliedDate); + return this; + } + + @JsonSetter(value = "applied_amount", nulls = Nulls.SKIP) + public Builder appliedAmount(Optional appliedAmount) { + this.appliedAmount = appliedAmount; + return this; + } + + public Builder appliedAmount(String appliedAmount) { + this.appliedAmount = Optional.ofNullable(appliedAmount); + 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 VendorCreditApplyLineForVendorCredit build() { + return new VendorCreditApplyLineForVendorCredit( + remoteId, + createdAt, + modifiedAt, + invoice, + appliedDate, + appliedAmount, + remoteWasDeleted, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditApplyLineForVendorCreditInvoice.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditApplyLineForVendorCreditInvoice.java new file mode 100644 index 000000000..4126495cc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditApplyLineForVendorCreditInvoice.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = VendorCreditApplyLineForVendorCreditInvoice.Deserializer.class) +public final class VendorCreditApplyLineForVendorCreditInvoice { + private final Object value; + + private final int type; + + private VendorCreditApplyLineForVendorCreditInvoice(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((Invoice) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCreditApplyLineForVendorCreditInvoice + && equalTo((VendorCreditApplyLineForVendorCreditInvoice) other); + } + + private boolean equalTo(VendorCreditApplyLineForVendorCreditInvoice other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static VendorCreditApplyLineForVendorCreditInvoice of(String value) { + return new VendorCreditApplyLineForVendorCreditInvoice(value, 0); + } + + public static VendorCreditApplyLineForVendorCreditInvoice of(Invoice value) { + return new VendorCreditApplyLineForVendorCreditInvoice(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Invoice value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(VendorCreditApplyLineForVendorCreditInvoice.class); + } + + @Override + public VendorCreditApplyLineForVendorCreditInvoice 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, Invoice.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditApplyLineForVendorCreditRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditApplyLineForVendorCreditRequest.java new file mode 100644 index 000000000..0f97ae6f2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditApplyLineForVendorCreditRequest.java @@ -0,0 +1,236 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = VendorCreditApplyLineForVendorCreditRequest.Builder.class) +public final class VendorCreditApplyLineForVendorCreditRequest { + private final Optional remoteId; + + private final Optional invoice; + + private final Optional appliedDate; + + private final Optional appliedAmount; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private VendorCreditApplyLineForVendorCreditRequest( + Optional remoteId, + Optional invoice, + Optional appliedDate, + Optional appliedAmount, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.remoteId = remoteId; + this.invoice = invoice; + this.appliedDate = appliedDate; + this.appliedAmount = appliedAmount; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @JsonProperty("invoice") + public Optional getInvoice() { + return invoice; + } + + /** + * @return Date that the vendor credit is applied to the invoice. + */ + @JsonProperty("applied_date") + public Optional getAppliedDate() { + return appliedDate; + } + + /** + * @return The amount of the VendorCredit applied to the invoice. + */ + @JsonProperty("applied_amount") + public Optional getAppliedAmount() { + return appliedAmount; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCreditApplyLineForVendorCreditRequest + && equalTo((VendorCreditApplyLineForVendorCreditRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(VendorCreditApplyLineForVendorCreditRequest other) { + return remoteId.equals(other.remoteId) + && invoice.equals(other.invoice) + && appliedDate.equals(other.appliedDate) + && appliedAmount.equals(other.appliedAmount) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @Override + public int hashCode() { + return Objects.hash( + this.remoteId, + this.invoice, + this.appliedDate, + this.appliedAmount, + this.integrationParams, + this.linkedAccountParams); + } + + @Override + 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 invoice = Optional.empty(); + + private Optional appliedDate = Optional.empty(); + + private Optional appliedAmount = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(VendorCreditApplyLineForVendorCreditRequest other) { + remoteId(other.getRemoteId()); + invoice(other.getInvoice()); + appliedDate(other.getAppliedDate()); + appliedAmount(other.getAppliedAmount()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + 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 = "invoice", nulls = Nulls.SKIP) + public Builder invoice(Optional invoice) { + this.invoice = invoice; + return this; + } + + public Builder invoice(VendorCreditApplyLineForVendorCreditRequestInvoice invoice) { + this.invoice = Optional.ofNullable(invoice); + return this; + } + + @JsonSetter(value = "applied_date", nulls = Nulls.SKIP) + public Builder appliedDate(Optional appliedDate) { + this.appliedDate = appliedDate; + return this; + } + + public Builder appliedDate(OffsetDateTime appliedDate) { + this.appliedDate = Optional.ofNullable(appliedDate); + return this; + } + + @JsonSetter(value = "applied_amount", nulls = Nulls.SKIP) + public Builder appliedAmount(Optional appliedAmount) { + this.appliedAmount = appliedAmount; + return this; + } + + public Builder appliedAmount(String appliedAmount) { + this.appliedAmount = Optional.ofNullable(appliedAmount); + 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 VendorCreditApplyLineForVendorCreditRequest build() { + return new VendorCreditApplyLineForVendorCreditRequest( + remoteId, + invoice, + appliedDate, + appliedAmount, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditApplyLineForVendorCreditRequestInvoice.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditApplyLineForVendorCreditRequestInvoice.java new file mode 100644 index 000000000..61d07f3c0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditApplyLineForVendorCreditRequestInvoice.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = VendorCreditApplyLineForVendorCreditRequestInvoice.Deserializer.class) +public final class VendorCreditApplyLineForVendorCreditRequestInvoice { + private final Object value; + + private final int type; + + private VendorCreditApplyLineForVendorCreditRequestInvoice(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((Invoice) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCreditApplyLineForVendorCreditRequestInvoice + && equalTo((VendorCreditApplyLineForVendorCreditRequestInvoice) other); + } + + private boolean equalTo(VendorCreditApplyLineForVendorCreditRequestInvoice other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static VendorCreditApplyLineForVendorCreditRequestInvoice of(String value) { + return new VendorCreditApplyLineForVendorCreditRequestInvoice(value, 0); + } + + public static VendorCreditApplyLineForVendorCreditRequestInvoice of(Invoice value) { + return new VendorCreditApplyLineForVendorCreditRequestInvoice(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Invoice value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(VendorCreditApplyLineForVendorCreditRequestInvoice.class); + } + + @Override + public VendorCreditApplyLineForVendorCreditRequestInvoice 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, Invoice.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditCompany.java new file mode 100644 index 000000000..f6c812529 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditCompany.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = VendorCreditCompany.Deserializer.class) +public final class VendorCreditCompany { + private final Object value; + + private final int type; + + private VendorCreditCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCreditCompany && equalTo((VendorCreditCompany) other); + } + + private boolean equalTo(VendorCreditCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static VendorCreditCompany of(String value) { + return new VendorCreditCompany(value, 0); + } + + public static VendorCreditCompany of(CompanyInfo value) { + return new VendorCreditCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(VendorCreditCompany.class); + } + + @Override + public VendorCreditCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditCurrency.java new file mode 100644 index 000000000..0dfb19a17 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/VendorCreditLine.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditLine.java new file mode 100644 index 000000000..3d6f8f1a1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditLine.java @@ -0,0 +1,440 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = VendorCreditLine.Builder.class) +public final class VendorCreditLine { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional netAmount; + + private final Optional trackingCategory; + + private final Optional>> trackingCategories; + + private final Optional description; + + private final Optional account; + + private final Optional company; + + private final Optional taxRate; + + private final Optional exchangeRate; + + private final Optional remoteWasDeleted; + + private final Map additionalProperties; + + private VendorCreditLine( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional netAmount, + Optional trackingCategory, + Optional>> trackingCategories, + Optional description, + Optional account, + Optional company, + Optional taxRate, + Optional exchangeRate, + Optional remoteWasDeleted, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.netAmount = netAmount; + this.trackingCategory = trackingCategory; + this.trackingCategories = trackingCategories; + this.description = description; + this.account = account; + this.company = company; + this.taxRate = taxRate; + this.exchangeRate = exchangeRate; + this.remoteWasDeleted = remoteWasDeleted; + 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 full value of the credit. + */ + @JsonProperty("net_amount") + public Optional getNetAmount() { + return netAmount; + } + + /** + * @return The line's associated tracking category. + */ + @JsonProperty("tracking_category") + public Optional getTrackingCategory() { + return trackingCategory; + } + + /** + * @return The vendor credit line item's associated tracking categories. + */ + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The line's description. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The line's account. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The company the line belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The tax rate that applies to this line item. + */ + @JsonProperty("tax_rate") + public Optional getTaxRate() { + return taxRate; + } + + /** + * @return The vendor credit line item's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCreditLine && equalTo((VendorCreditLine) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(VendorCreditLine other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && netAmount.equals(other.netAmount) + && trackingCategory.equals(other.trackingCategory) + && trackingCategories.equals(other.trackingCategories) + && description.equals(other.description) + && account.equals(other.account) + && company.equals(other.company) + && taxRate.equals(other.taxRate) + && exchangeRate.equals(other.exchangeRate) + && remoteWasDeleted.equals(other.remoteWasDeleted); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.netAmount, + this.trackingCategory, + this.trackingCategories, + this.description, + this.account, + this.company, + this.taxRate, + this.exchangeRate, + this.remoteWasDeleted); + } + + @Override + 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 netAmount = Optional.empty(); + + private Optional trackingCategory = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional taxRate = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(VendorCreditLine other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + netAmount(other.getNetAmount()); + trackingCategory(other.getTrackingCategory()); + trackingCategories(other.getTrackingCategories()); + description(other.getDescription()); + account(other.getAccount()); + company(other.getCompany()); + taxRate(other.getTaxRate()); + exchangeRate(other.getExchangeRate()); + remoteWasDeleted(other.getRemoteWasDeleted()); + 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 = "net_amount", nulls = Nulls.SKIP) + public Builder netAmount(Optional netAmount) { + this.netAmount = netAmount; + return this; + } + + public Builder netAmount(Double netAmount) { + this.netAmount = Optional.ofNullable(netAmount); + return this; + } + + @JsonSetter(value = "tracking_category", nulls = Nulls.SKIP) + public Builder trackingCategory(Optional trackingCategory) { + this.trackingCategory = trackingCategory; + return this; + } + + public Builder trackingCategory(String trackingCategory) { + this.trackingCategory = Optional.ofNullable(trackingCategory); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories(Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + 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 = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(VendorCreditLineAccount account) { + this.account = Optional.ofNullable(account); + 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 = "tax_rate", nulls = Nulls.SKIP) + public Builder taxRate(Optional taxRate) { + this.taxRate = taxRate; + return this; + } + + public Builder taxRate(String taxRate) { + this.taxRate = Optional.ofNullable(taxRate); + return this; + } + + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + 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 VendorCreditLine build() { + return new VendorCreditLine( + id, + remoteId, + createdAt, + modifiedAt, + netAmount, + trackingCategory, + trackingCategories, + description, + account, + company, + taxRate, + exchangeRate, + remoteWasDeleted, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditLineAccount.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditLineAccount.java new file mode 100644 index 000000000..b049ab370 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditLineAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = VendorCreditLineAccount.Deserializer.class) +public final class VendorCreditLineAccount { + private final Object value; + + private final int type; + + private VendorCreditLineAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCreditLineAccount && equalTo((VendorCreditLineAccount) other); + } + + private boolean equalTo(VendorCreditLineAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static VendorCreditLineAccount of(String value) { + return new VendorCreditLineAccount(value, 0); + } + + public static VendorCreditLineAccount of(Account value) { + return new VendorCreditLineAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(VendorCreditLineAccount.class); + } + + @Override + public VendorCreditLineAccount 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/legacy/api/resources/accounting/types/VendorCreditLineRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditLineRequest.java new file mode 100644 index 000000000..4c74c2490 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditLineRequest.java @@ -0,0 +1,379 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = VendorCreditLineRequest.Builder.class) +public final class VendorCreditLineRequest { + private final Optional remoteId; + + private final Optional netAmount; + + private final Optional trackingCategory; + + private final Optional>> trackingCategories; + + private final Optional description; + + private final Optional account; + + private final Optional company; + + private final Optional taxRate; + + private final Optional exchangeRate; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private VendorCreditLineRequest( + Optional remoteId, + Optional netAmount, + Optional trackingCategory, + Optional>> trackingCategories, + Optional description, + Optional account, + Optional company, + Optional taxRate, + Optional exchangeRate, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.remoteId = remoteId; + this.netAmount = netAmount; + this.trackingCategory = trackingCategory; + this.trackingCategories = trackingCategories; + this.description = description; + this.account = account; + this.company = company; + this.taxRate = taxRate; + this.exchangeRate = exchangeRate; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The full value of the credit. + */ + @JsonProperty("net_amount") + public Optional getNetAmount() { + return netAmount; + } + + /** + * @return The line's associated tracking category. + */ + @JsonProperty("tracking_category") + public Optional getTrackingCategory() { + return trackingCategory; + } + + /** + * @return The vendor credit line item's associated tracking categories. + */ + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The line's description. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The line's account. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The company the line belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The tax rate that applies to this line item. + */ + @JsonProperty("tax_rate") + public Optional getTaxRate() { + return taxRate; + } + + /** + * @return The vendor credit line item's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCreditLineRequest && equalTo((VendorCreditLineRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(VendorCreditLineRequest other) { + return remoteId.equals(other.remoteId) + && netAmount.equals(other.netAmount) + && trackingCategory.equals(other.trackingCategory) + && trackingCategories.equals(other.trackingCategories) + && description.equals(other.description) + && account.equals(other.account) + && company.equals(other.company) + && taxRate.equals(other.taxRate) + && exchangeRate.equals(other.exchangeRate) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @Override + public int hashCode() { + return Objects.hash( + this.remoteId, + this.netAmount, + this.trackingCategory, + this.trackingCategories, + this.description, + this.account, + this.company, + this.taxRate, + this.exchangeRate, + this.integrationParams, + this.linkedAccountParams); + } + + @Override + 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 netAmount = Optional.empty(); + + private Optional trackingCategory = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional taxRate = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(VendorCreditLineRequest other) { + remoteId(other.getRemoteId()); + netAmount(other.getNetAmount()); + trackingCategory(other.getTrackingCategory()); + trackingCategories(other.getTrackingCategories()); + description(other.getDescription()); + account(other.getAccount()); + company(other.getCompany()); + taxRate(other.getTaxRate()); + exchangeRate(other.getExchangeRate()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + 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 = "net_amount", nulls = Nulls.SKIP) + public Builder netAmount(Optional netAmount) { + this.netAmount = netAmount; + return this; + } + + public Builder netAmount(Double netAmount) { + this.netAmount = Optional.ofNullable(netAmount); + return this; + } + + @JsonSetter(value = "tracking_category", nulls = Nulls.SKIP) + public Builder trackingCategory(Optional trackingCategory) { + this.trackingCategory = trackingCategory; + return this; + } + + public Builder trackingCategory(String trackingCategory) { + this.trackingCategory = Optional.ofNullable(trackingCategory); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories(Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + 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 = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(VendorCreditLineRequestAccount account) { + this.account = Optional.ofNullable(account); + 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 = "tax_rate", nulls = Nulls.SKIP) + public Builder taxRate(Optional taxRate) { + this.taxRate = taxRate; + return this; + } + + public Builder taxRate(String taxRate) { + this.taxRate = Optional.ofNullable(taxRate); + return this; + } + + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + 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 VendorCreditLineRequest build() { + return new VendorCreditLineRequest( + remoteId, + netAmount, + trackingCategory, + trackingCategories, + description, + account, + company, + taxRate, + exchangeRate, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditLineRequestAccount.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditLineRequestAccount.java new file mode 100644 index 000000000..7eb7672e7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditLineRequestAccount.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = VendorCreditLineRequestAccount.Deserializer.class) +public final class VendorCreditLineRequestAccount { + private final Object value; + + private final int type; + + private VendorCreditLineRequestAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCreditLineRequestAccount && equalTo((VendorCreditLineRequestAccount) other); + } + + private boolean equalTo(VendorCreditLineRequestAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static VendorCreditLineRequestAccount of(String value) { + return new VendorCreditLineRequestAccount(value, 0); + } + + public static VendorCreditLineRequestAccount of(Account value) { + return new VendorCreditLineRequestAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(VendorCreditLineRequestAccount.class); + } + + @Override + public VendorCreditLineRequestAccount 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/legacy/api/resources/accounting/types/VendorCreditRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditRequest.java new file mode 100644 index 000000000..a845f5bb2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditRequest.java @@ -0,0 +1,746 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = VendorCreditRequest.Builder.class) +public final class VendorCreditRequest { + private final Optional number; + + private final Optional transactionDate; + + private final Optional vendor; + + private final Optional totalAmount; + + private final Optional currency; + + private final Optional exchangeRate; + + private final Optional inclusiveOfTax; + + private final Optional company; + + private final Optional>> trackingCategories; + + private final Optional> appliedToLines; + + private final Optional accountingPeriod; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private VendorCreditRequest( + Optional number, + Optional transactionDate, + Optional vendor, + Optional totalAmount, + Optional currency, + Optional exchangeRate, + Optional inclusiveOfTax, + Optional company, + Optional>> trackingCategories, + Optional> appliedToLines, + Optional accountingPeriod, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.number = number; + this.transactionDate = transactionDate; + this.vendor = vendor; + this.totalAmount = totalAmount; + this.currency = currency; + this.exchangeRate = exchangeRate; + this.inclusiveOfTax = inclusiveOfTax; + this.company = company; + this.trackingCategories = trackingCategories; + this.appliedToLines = appliedToLines; + this.accountingPeriod = accountingPeriod; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The vendor credit's number. + */ + @JsonProperty("number") + public Optional getNumber() { + return number; + } + + /** + * @return The vendor credit's transaction date. + */ + @JsonProperty("transaction_date") + public Optional getTransactionDate() { + return transactionDate; + } + + /** + * @return The vendor that owes the gift or refund. + */ + @JsonProperty("vendor") + public Optional getVendor() { + return vendor; + } + + /** + * @return The vendor credit's total amount. + */ + @JsonProperty("total_amount") + public Optional getTotalAmount() { + return totalAmount; + } + + /** + * @return The vendor credit'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 vendor credit's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. + */ + @JsonProperty("inclusive_of_tax") + public Optional getInclusiveOfTax() { + return inclusiveOfTax; + } + + /** + * @return The company the vendor credit belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return A list of VendorCredit Applied to Lines objects. + */ + @JsonProperty("applied_to_lines") + public Optional> getAppliedToLines() { + return appliedToLines; + } + + /** + * @return The accounting period that the VendorCredit was generated in. + */ + @JsonProperty("accounting_period") + public Optional getAccountingPeriod() { + return accountingPeriod; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCreditRequest && equalTo((VendorCreditRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(VendorCreditRequest other) { + return number.equals(other.number) + && transactionDate.equals(other.transactionDate) + && vendor.equals(other.vendor) + && totalAmount.equals(other.totalAmount) + && currency.equals(other.currency) + && exchangeRate.equals(other.exchangeRate) + && inclusiveOfTax.equals(other.inclusiveOfTax) + && company.equals(other.company) + && trackingCategories.equals(other.trackingCategories) + && appliedToLines.equals(other.appliedToLines) + && accountingPeriod.equals(other.accountingPeriod) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @Override + public int hashCode() { + return Objects.hash( + this.number, + this.transactionDate, + this.vendor, + this.totalAmount, + this.currency, + this.exchangeRate, + this.inclusiveOfTax, + this.company, + this.trackingCategories, + this.appliedToLines, + this.accountingPeriod, + this.integrationParams, + this.linkedAccountParams); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional number = Optional.empty(); + + private Optional transactionDate = Optional.empty(); + + private Optional vendor = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional inclusiveOfTax = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional>> trackingCategories = + Optional.empty(); + + private Optional> appliedToLines = Optional.empty(); + + private Optional accountingPeriod = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(VendorCreditRequest other) { + number(other.getNumber()); + transactionDate(other.getTransactionDate()); + vendor(other.getVendor()); + totalAmount(other.getTotalAmount()); + currency(other.getCurrency()); + exchangeRate(other.getExchangeRate()); + inclusiveOfTax(other.getInclusiveOfTax()); + company(other.getCompany()); + trackingCategories(other.getTrackingCategories()); + appliedToLines(other.getAppliedToLines()); + accountingPeriod(other.getAccountingPeriod()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + return this; + } + + @JsonSetter(value = "number", nulls = Nulls.SKIP) + public Builder number(Optional number) { + this.number = number; + return this; + } + + public Builder number(String number) { + this.number = Optional.ofNullable(number); + return this; + } + + @JsonSetter(value = "transaction_date", nulls = Nulls.SKIP) + public Builder transactionDate(Optional transactionDate) { + this.transactionDate = transactionDate; + return this; + } + + public Builder transactionDate(OffsetDateTime transactionDate) { + this.transactionDate = Optional.ofNullable(transactionDate); + return this; + } + + @JsonSetter(value = "vendor", nulls = Nulls.SKIP) + public Builder vendor(Optional vendor) { + this.vendor = vendor; + return this; + } + + public Builder vendor(VendorCreditRequestVendor vendor) { + this.vendor = Optional.ofNullable(vendor); + return this; + } + + @JsonSetter(value = "total_amount", nulls = Nulls.SKIP) + public Builder totalAmount(Optional totalAmount) { + this.totalAmount = totalAmount; + return this; + } + + public Builder totalAmount(Double totalAmount) { + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(VendorCreditRequestCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + @JsonSetter(value = "inclusive_of_tax", nulls = Nulls.SKIP) + public Builder inclusiveOfTax(Optional inclusiveOfTax) { + this.inclusiveOfTax = inclusiveOfTax; + return this; + } + + public Builder inclusiveOfTax(Boolean inclusiveOfTax) { + this.inclusiveOfTax = Optional.ofNullable(inclusiveOfTax); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(VendorCreditRequestCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories( + List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + @JsonSetter(value = "applied_to_lines", nulls = Nulls.SKIP) + public Builder appliedToLines(Optional> appliedToLines) { + this.appliedToLines = appliedToLines; + return this; + } + + public Builder appliedToLines(List appliedToLines) { + this.appliedToLines = Optional.ofNullable(appliedToLines); + return this; + } + + @JsonSetter(value = "accounting_period", nulls = Nulls.SKIP) + public Builder accountingPeriod(Optional accountingPeriod) { + this.accountingPeriod = accountingPeriod; + return this; + } + + public Builder accountingPeriod(VendorCreditRequestAccountingPeriod accountingPeriod) { + this.accountingPeriod = Optional.ofNullable(accountingPeriod); + 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 VendorCreditRequest build() { + return new VendorCreditRequest( + number, + transactionDate, + vendor, + totalAmount, + currency, + exchangeRate, + inclusiveOfTax, + company, + trackingCategories, + appliedToLines, + accountingPeriod, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditRequestAccountingPeriod.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditRequestAccountingPeriod.java new file mode 100644 index 000000000..6793e61d0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditRequestAccountingPeriod.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = VendorCreditRequestAccountingPeriod.Deserializer.class) +public final class VendorCreditRequestAccountingPeriod { + private final Object value; + + private final int type; + + private VendorCreditRequestAccountingPeriod(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((AccountingPeriod) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCreditRequestAccountingPeriod + && equalTo((VendorCreditRequestAccountingPeriod) other); + } + + private boolean equalTo(VendorCreditRequestAccountingPeriod other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static VendorCreditRequestAccountingPeriod of(String value) { + return new VendorCreditRequestAccountingPeriod(value, 0); + } + + public static VendorCreditRequestAccountingPeriod of(AccountingPeriod value) { + return new VendorCreditRequestAccountingPeriod(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(AccountingPeriod value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(VendorCreditRequestAccountingPeriod.class); + } + + @Override + public VendorCreditRequestAccountingPeriod 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, AccountingPeriod.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditRequestCompany.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditRequestCompany.java new file mode 100644 index 000000000..13d98a8c1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditRequestCompany.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = VendorCreditRequestCompany.Deserializer.class) +public final class VendorCreditRequestCompany { + private final Object value; + + private final int type; + + private VendorCreditRequestCompany(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((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCreditRequestCompany && equalTo((VendorCreditRequestCompany) other); + } + + private boolean equalTo(VendorCreditRequestCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static VendorCreditRequestCompany of(String value) { + return new VendorCreditRequestCompany(value, 0); + } + + public static VendorCreditRequestCompany of(CompanyInfo value) { + return new VendorCreditRequestCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(VendorCreditRequestCompany.class); + } + + @Override + public VendorCreditRequestCompany 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, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditRequestCurrency.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditRequestCurrency.java new file mode 100644 index 000000000..cf2293ae7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditRequestCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/accounting/types/VendorCreditRequestTrackingCategoriesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditRequestTrackingCategoriesItem.java new file mode 100644 index 000000000..e0011314f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditRequestTrackingCategoriesItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = VendorCreditRequestTrackingCategoriesItem.Deserializer.class) +public final class VendorCreditRequestTrackingCategoriesItem { + private final Object value; + + private final int type; + + private VendorCreditRequestTrackingCategoriesItem(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCreditRequestTrackingCategoriesItem + && equalTo((VendorCreditRequestTrackingCategoriesItem) other); + } + + private boolean equalTo(VendorCreditRequestTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static VendorCreditRequestTrackingCategoriesItem of(String value) { + return new VendorCreditRequestTrackingCategoriesItem(value, 0); + } + + public static VendorCreditRequestTrackingCategoriesItem of(TrackingCategory value) { + return new VendorCreditRequestTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(VendorCreditRequestTrackingCategoriesItem.class); + } + + @Override + public VendorCreditRequestTrackingCategoriesItem 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditRequestVendor.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditRequestVendor.java new file mode 100644 index 000000000..6a2b09d26 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditRequestVendor.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = VendorCreditRequestVendor.Deserializer.class) +public final class VendorCreditRequestVendor { + private final Object value; + + private final int type; + + private VendorCreditRequestVendor(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCreditRequestVendor && equalTo((VendorCreditRequestVendor) other); + } + + private boolean equalTo(VendorCreditRequestVendor other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static VendorCreditRequestVendor of(String value) { + return new VendorCreditRequestVendor(value, 0); + } + + public static VendorCreditRequestVendor of(Contact value) { + return new VendorCreditRequestVendor(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(VendorCreditRequestVendor.class); + } + + @Override + public VendorCreditRequestVendor 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditResponse.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditResponse.java new file mode 100644 index 000000000..00d764a1c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = VendorCreditResponse.Builder.class) +public final class VendorCreditResponse { + private final VendorCredit model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private VendorCreditResponse( + VendorCredit 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 VendorCredit getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCreditResponse && equalTo((VendorCreditResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(VendorCreditResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull VendorCredit model); + + Builder from(VendorCreditResponse other); + } + + public interface _FinalStage { + VendorCreditResponse 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 VendorCredit model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(VendorCreditResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull VendorCredit model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public VendorCreditResponse build() { + return new VendorCreditResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditTrackingCategoriesItem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditTrackingCategoriesItem.java new file mode 100644 index 000000000..87cafabcd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditTrackingCategoriesItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = VendorCreditTrackingCategoriesItem.Deserializer.class) +public final class VendorCreditTrackingCategoriesItem { + private final Object value; + + private final int type; + + private VendorCreditTrackingCategoriesItem(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((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCreditTrackingCategoriesItem + && equalTo((VendorCreditTrackingCategoriesItem) other); + } + + private boolean equalTo(VendorCreditTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static VendorCreditTrackingCategoriesItem of(String value) { + return new VendorCreditTrackingCategoriesItem(value, 0); + } + + public static VendorCreditTrackingCategoriesItem of(TrackingCategory value) { + return new VendorCreditTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(VendorCreditTrackingCategoriesItem.class); + } + + @Override + public VendorCreditTrackingCategoriesItem 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, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditVendor.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditVendor.java new file mode 100644 index 000000000..8193e7cf0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/VendorCreditVendor.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = VendorCreditVendor.Deserializer.class) +public final class VendorCreditVendor { + private final Object value; + + private final int type; + + private VendorCreditVendor(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCreditVendor && equalTo((VendorCreditVendor) other); + } + + private boolean equalTo(VendorCreditVendor other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static VendorCreditVendor of(String value) { + return new VendorCreditVendor(value, 0); + } + + public static VendorCreditVendor of(Contact value) { + return new VendorCreditVendor(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(VendorCreditVendor.class); + } + + @Override + public VendorCreditVendor 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/WarningValidationProblem.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/WarningValidationProblem.java new file mode 100644 index 000000000..7d3c68352 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/WarningValidationProblem.java @@ -0,0 +1,178 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.source, this.title, this.detail, this.problemType); + } + + @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() {} + + @Override + public Builder from(WarningValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + return this; + } + + @Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @Override + public WarningValidationProblem build() { + return new WarningValidationProblem(source, title, detail, problemType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/types/WebhookReceiver.java b/src/main/java/com/merge/legacy/api/resources/accounting/types/WebhookReceiver.java new file mode 100644 index 000000000..bffae4c03 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/types/WebhookReceiver.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @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() {} + + @Override + public Builder from(WebhookReceiver other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @Override + public WebhookReceiver build() { + return new WebhookReceiver(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/vendorcredits/VendorCreditsClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/vendorcredits/VendorCreditsClient.java new file mode 100644 index 000000000..f28b25b73 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/vendorcredits/VendorCreditsClient.java @@ -0,0 +1,278 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.vendorcredits; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.types.MetaResponse; +import com.merge.legacy.api.resources.accounting.types.PaginatedVendorCreditList; +import com.merge.legacy.api.resources.accounting.types.VendorCredit; +import com.merge.legacy.api.resources.accounting.types.VendorCreditResponse; +import com.merge.legacy.api.resources.accounting.vendorcredits.requests.VendorCreditEndpointRequest; +import com.merge.legacy.api.resources.accounting.vendorcredits.requests.VendorCreditsListRequest; +import com.merge.legacy.api.resources.accounting.vendorcredits.requests.VendorCreditsRetrieveRequest; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/accounting/vendorcredits/requests/VendorCreditEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/vendorcredits/requests/VendorCreditEndpointRequest.java new file mode 100644 index 000000000..a63f6a2e3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/vendorcredits/requests/VendorCreditEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.vendorcredits.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.types.VendorCreditRequest; +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 = VendorCreditEndpointRequest.Builder.class) +public final class VendorCreditEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final VendorCreditRequest model; + + private final Map additionalProperties; + + private VendorCreditEndpointRequest( + Optional isDebugMode, + Optional runAsync, + VendorCreditRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public VendorCreditRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCreditEndpointRequest && equalTo((VendorCreditEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(VendorCreditEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull VendorCreditRequest model); + + Builder from(VendorCreditEndpointRequest other); + } + + public interface _FinalStage { + VendorCreditEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private VendorCreditRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(VendorCreditEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull VendorCreditRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public VendorCreditEndpointRequest build() { + return new VendorCreditEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/vendorcredits/requests/VendorCreditsListRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/vendorcredits/requests/VendorCreditsListRequest.java new file mode 100644 index 000000000..e9c1a223e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/vendorcredits/requests/VendorCreditsListRequest.java @@ -0,0 +1,476 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.vendorcredits.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.accounting.vendorcredits.types.VendorCreditsListRequestExpand; +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 = VendorCreditsListRequest.Builder.class) +public final class VendorCreditsListRequest { + 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 remoteId; + + private final Optional transactionDateAfter; + + private final Optional transactionDateBefore; + + private final Map additionalProperties; + + private VendorCreditsListRequest( + Optional companyId, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Optional transactionDateAfter, + Optional transactionDateBefore, + Map additionalProperties) { + 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.remoteId = remoteId; + this.transactionDateAfter = transactionDateAfter; + this.transactionDateBefore = transactionDateBefore; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return vendor credits 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 The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("transaction_date_after") + public Optional getTransactionDateAfter() { + return transactionDateAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("transaction_date_before") + public Optional getTransactionDateBefore() { + return transactionDateBefore; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCreditsListRequest && equalTo((VendorCreditsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(VendorCreditsListRequest other) { + return 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) + && remoteId.equals(other.remoteId) + && transactionDateAfter.equals(other.transactionDateAfter) + && transactionDateBefore.equals(other.transactionDateBefore); + } + + @Override + public int hashCode() { + return Objects.hash( + this.companyId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId, + this.transactionDateAfter, + this.transactionDateBefore); + } + + @Override + 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 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(); + + private Optional transactionDateAfter = Optional.empty(); + + private Optional transactionDateBefore = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(VendorCreditsListRequest other) { + 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()); + remoteId(other.getRemoteId()); + transactionDateAfter(other.getTransactionDateAfter()); + transactionDateBefore(other.getTransactionDateBefore()); + 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(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; + 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 = "transaction_date_after", nulls = Nulls.SKIP) + public Builder transactionDateAfter(Optional transactionDateAfter) { + this.transactionDateAfter = transactionDateAfter; + return this; + } + + public Builder transactionDateAfter(OffsetDateTime transactionDateAfter) { + this.transactionDateAfter = Optional.ofNullable(transactionDateAfter); + return this; + } + + @JsonSetter(value = "transaction_date_before", nulls = Nulls.SKIP) + public Builder transactionDateBefore(Optional transactionDateBefore) { + this.transactionDateBefore = transactionDateBefore; + return this; + } + + public Builder transactionDateBefore(OffsetDateTime transactionDateBefore) { + this.transactionDateBefore = Optional.ofNullable(transactionDateBefore); + return this; + } + + public VendorCreditsListRequest build() { + return new VendorCreditsListRequest( + companyId, + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + transactionDateAfter, + transactionDateBefore, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/vendorcredits/requests/VendorCreditsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/vendorcredits/requests/VendorCreditsRetrieveRequest.java new file mode 100644 index 000000000..936d87ed3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/vendorcredits/requests/VendorCreditsRetrieveRequest.java @@ -0,0 +1,121 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.vendorcredits.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/accounting/vendorcredits/types/VendorCreditsListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/accounting/vendorcredits/types/VendorCreditsListRequestExpand.java new file mode 100644 index 000000000..d7fe74350 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/vendorcredits/types/VendorCreditsListRequestExpand.java @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/vendorcredits/types/VendorCreditsRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/accounting/vendorcredits/types/VendorCreditsRetrieveRequestExpand.java new file mode 100644 index 000000000..54871020c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/vendorcredits/types/VendorCreditsRetrieveRequestExpand.java @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/accounting/webhookreceivers/WebhookReceiversClient.java b/src/main/java/com/merge/legacy/api/resources/accounting/webhookreceivers/WebhookReceiversClient.java new file mode 100644 index 000000000..cb6f3a04b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/webhookreceivers/WebhookReceiversClient.java @@ -0,0 +1,111 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.webhookreceivers; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.accounting.types.WebhookReceiver; +import com.merge.legacy.api.resources.accounting.webhookreceivers.requests.WebhookReceiverRequest; +import java.io.IOException; +import java.util.List; +import okhttp3.*; + +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/legacy/api/resources/accounting/webhookreceivers/requests/WebhookReceiverRequest.java b/src/main/java/com/merge/legacy/api/resources/accounting/webhookreceivers/requests/WebhookReceiverRequest.java new file mode 100644 index 000000000..e1d36e460 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/accounting/webhookreceivers/requests/WebhookReceiverRequest.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.accounting.webhookreceivers.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @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() {} + + @Override + public Builder from(WebhookReceiverRequest other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @Override + public WebhookReceiverRequest build() { + return new WebhookReceiverRequest(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/AtsClient.java b/src/main/java/com/merge/legacy/api/resources/ats/AtsClient.java new file mode 100644 index 000000000..cce7fd267 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/AtsClient.java @@ -0,0 +1,280 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats; + +import com.merge.legacy.api.core.ClientOptions; +import com.merge.legacy.api.core.Suppliers; +import com.merge.legacy.api.resources.ats.accountdetails.AccountDetailsClient; +import com.merge.legacy.api.resources.ats.accounttoken.AccountTokenClient; +import com.merge.legacy.api.resources.ats.activities.ActivitiesClient; +import com.merge.legacy.api.resources.ats.applications.ApplicationsClient; +import com.merge.legacy.api.resources.ats.asyncpassthrough.AsyncPassthroughClient; +import com.merge.legacy.api.resources.ats.attachments.AttachmentsClient; +import com.merge.legacy.api.resources.ats.audittrail.AuditTrailClient; +import com.merge.legacy.api.resources.ats.availableactions.AvailableActionsClient; +import com.merge.legacy.api.resources.ats.candidates.CandidatesClient; +import com.merge.legacy.api.resources.ats.deleteaccount.DeleteAccountClient; +import com.merge.legacy.api.resources.ats.departments.DepartmentsClient; +import com.merge.legacy.api.resources.ats.eeocs.EeocsClient; +import com.merge.legacy.api.resources.ats.fieldmapping.FieldMappingClient; +import com.merge.legacy.api.resources.ats.forceresync.ForceResyncClient; +import com.merge.legacy.api.resources.ats.generatekey.GenerateKeyClient; +import com.merge.legacy.api.resources.ats.interviews.InterviewsClient; +import com.merge.legacy.api.resources.ats.issues.IssuesClient; +import com.merge.legacy.api.resources.ats.jobinterviewstages.JobInterviewStagesClient; +import com.merge.legacy.api.resources.ats.jobpostings.JobPostingsClient; +import com.merge.legacy.api.resources.ats.jobs.JobsClient; +import com.merge.legacy.api.resources.ats.linkedaccounts.LinkedAccountsClient; +import com.merge.legacy.api.resources.ats.linktoken.LinkTokenClient; +import com.merge.legacy.api.resources.ats.offers.OffersClient; +import com.merge.legacy.api.resources.ats.offices.OfficesClient; +import com.merge.legacy.api.resources.ats.passthrough.PassthroughClient; +import com.merge.legacy.api.resources.ats.regeneratekey.RegenerateKeyClient; +import com.merge.legacy.api.resources.ats.rejectreasons.RejectReasonsClient; +import com.merge.legacy.api.resources.ats.scopes.ScopesClient; +import com.merge.legacy.api.resources.ats.scorecards.ScorecardsClient; +import com.merge.legacy.api.resources.ats.syncstatus.SyncStatusClient; +import com.merge.legacy.api.resources.ats.tags.TagsClient; +import com.merge.legacy.api.resources.ats.users.UsersClient; +import com.merge.legacy.api.resources.ats.webhookreceivers.WebhookReceiversClient; +import java.util.function.Supplier; + +public class AtsClient { + 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 AtsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.accountDetailsClient = Suppliers.memoize(() -> new AccountDetailsClient(clientOptions)); + this.accountTokenClient = Suppliers.memoize(() -> new AccountTokenClient(clientOptions)); + this.activitiesClient = Suppliers.memoize(() -> new ActivitiesClient(clientOptions)); + this.applicationsClient = Suppliers.memoize(() -> new ApplicationsClient(clientOptions)); + this.asyncPassthroughClient = Suppliers.memoize(() -> new AsyncPassthroughClient(clientOptions)); + this.attachmentsClient = Suppliers.memoize(() -> new AttachmentsClient(clientOptions)); + this.auditTrailClient = Suppliers.memoize(() -> new AuditTrailClient(clientOptions)); + this.availableActionsClient = Suppliers.memoize(() -> new AvailableActionsClient(clientOptions)); + this.candidatesClient = Suppliers.memoize(() -> new CandidatesClient(clientOptions)); + this.scopesClient = Suppliers.memoize(() -> new ScopesClient(clientOptions)); + this.deleteAccountClient = Suppliers.memoize(() -> new DeleteAccountClient(clientOptions)); + this.departmentsClient = Suppliers.memoize(() -> new DepartmentsClient(clientOptions)); + this.eeocsClient = Suppliers.memoize(() -> new EeocsClient(clientOptions)); + this.fieldMappingClient = Suppliers.memoize(() -> new FieldMappingClient(clientOptions)); + this.generateKeyClient = Suppliers.memoize(() -> new GenerateKeyClient(clientOptions)); + this.interviewsClient = Suppliers.memoize(() -> new InterviewsClient(clientOptions)); + this.issuesClient = Suppliers.memoize(() -> new IssuesClient(clientOptions)); + this.jobInterviewStagesClient = Suppliers.memoize(() -> new JobInterviewStagesClient(clientOptions)); + this.jobPostingsClient = Suppliers.memoize(() -> new JobPostingsClient(clientOptions)); + this.jobsClient = Suppliers.memoize(() -> new JobsClient(clientOptions)); + this.linkTokenClient = Suppliers.memoize(() -> new LinkTokenClient(clientOptions)); + this.linkedAccountsClient = Suppliers.memoize(() -> new LinkedAccountsClient(clientOptions)); + this.offersClient = Suppliers.memoize(() -> new OffersClient(clientOptions)); + this.officesClient = Suppliers.memoize(() -> new OfficesClient(clientOptions)); + this.passthroughClient = Suppliers.memoize(() -> new PassthroughClient(clientOptions)); + this.regenerateKeyClient = Suppliers.memoize(() -> new RegenerateKeyClient(clientOptions)); + this.rejectReasonsClient = Suppliers.memoize(() -> new RejectReasonsClient(clientOptions)); + this.scorecardsClient = Suppliers.memoize(() -> new ScorecardsClient(clientOptions)); + this.syncStatusClient = Suppliers.memoize(() -> new SyncStatusClient(clientOptions)); + this.forceResyncClient = Suppliers.memoize(() -> new ForceResyncClient(clientOptions)); + this.tagsClient = Suppliers.memoize(() -> new TagsClient(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 ActivitiesClient activities() { + return this.activitiesClient.get(); + } + + public ApplicationsClient applications() { + return this.applicationsClient.get(); + } + + public AsyncPassthroughClient asyncPassthrough() { + return this.asyncPassthroughClient.get(); + } + + public AttachmentsClient attachments() { + return this.attachmentsClient.get(); + } + + public AuditTrailClient auditTrail() { + return this.auditTrailClient.get(); + } + + public AvailableActionsClient availableActions() { + return this.availableActionsClient.get(); + } + + public CandidatesClient candidates() { + return this.candidatesClient.get(); + } + + public ScopesClient scopes() { + return this.scopesClient.get(); + } + + public DeleteAccountClient deleteAccount() { + return this.deleteAccountClient.get(); + } + + public DepartmentsClient departments() { + return this.departmentsClient.get(); + } + + public EeocsClient eeocs() { + return this.eeocsClient.get(); + } + + public FieldMappingClient fieldMapping() { + return this.fieldMappingClient.get(); + } + + public GenerateKeyClient generateKey() { + return this.generateKeyClient.get(); + } + + public InterviewsClient interviews() { + return this.interviewsClient.get(); + } + + public IssuesClient issues() { + return this.issuesClient.get(); + } + + public JobInterviewStagesClient jobInterviewStages() { + return this.jobInterviewStagesClient.get(); + } + + public JobPostingsClient jobPostings() { + return this.jobPostingsClient.get(); + } + + public JobsClient jobs() { + return this.jobsClient.get(); + } + + public LinkTokenClient linkToken() { + return this.linkTokenClient.get(); + } + + public LinkedAccountsClient linkedAccounts() { + return this.linkedAccountsClient.get(); + } + + public OffersClient offers() { + return this.offersClient.get(); + } + + public OfficesClient offices() { + return this.officesClient.get(); + } + + public PassthroughClient passthrough() { + return this.passthroughClient.get(); + } + + public RegenerateKeyClient regenerateKey() { + return this.regenerateKeyClient.get(); + } + + public RejectReasonsClient rejectReasons() { + return this.rejectReasonsClient.get(); + } + + public ScorecardsClient scorecards() { + return this.scorecardsClient.get(); + } + + public SyncStatusClient syncStatus() { + return this.syncStatusClient.get(); + } + + public ForceResyncClient forceResync() { + return this.forceResyncClient.get(); + } + + public TagsClient tags() { + return this.tagsClient.get(); + } + + public UsersClient users() { + return this.usersClient.get(); + } + + public WebhookReceiversClient webhookReceivers() { + return this.webhookReceiversClient.get(); + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/accountdetails/AccountDetailsClient.java b/src/main/java/com/merge/legacy/api/resources/ats/accountdetails/AccountDetailsClient.java new file mode 100644 index 000000000..5cb8cb8a1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/accountdetails/AccountDetailsClient.java @@ -0,0 +1,58 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.accountdetails; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.types.AccountDetails; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/accounttoken/AccountTokenClient.java b/src/main/java/com/merge/legacy/api/resources/ats/accounttoken/AccountTokenClient.java new file mode 100644 index 000000000..14aed18e8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/accounttoken/AccountTokenClient.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.accounttoken; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.types.AccountToken; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/activities/ActivitiesClient.java b/src/main/java/com/merge/legacy/api/resources/ats/activities/ActivitiesClient.java new file mode 100644 index 000000000..f6ff01418 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/activities/ActivitiesClient.java @@ -0,0 +1,285 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.activities; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.activities.requests.ActivitiesListRequest; +import com.merge.legacy.api.resources.ats.activities.requests.ActivitiesRetrieveRequest; +import com.merge.legacy.api.resources.ats.activities.requests.ActivityEndpointRequest; +import com.merge.legacy.api.resources.ats.types.Activity; +import com.merge.legacy.api.resources.ats.types.ActivityResponse; +import com.merge.legacy.api.resources.ats.types.MetaResponse; +import com.merge.legacy.api.resources.ats.types.PaginatedActivityList; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/ats/activities/requests/ActivitiesListRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/activities/requests/ActivitiesListRequest.java new file mode 100644 index 000000000..34e4bf59b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/activities/requests/ActivitiesListRequest.java @@ -0,0 +1,477 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.activities.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ats.activities.types.ActivitiesListRequestRemoteFields; +import com.merge.legacy.api.resources.ats.activities.types.ActivitiesListRequestShowEnumOrigins; +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 = ActivitiesListRequest.Builder.class) +public final class ActivitiesListRequest { + 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 Optional userId; + + private final Map additionalProperties; + + private ActivitiesListRequest( + 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, + Optional userId, + 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.remoteFields = remoteFields; + this.remoteId = remoteId; + this.showEnumOrigins = showEnumOrigins; + this.userId = userId; + 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 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 activities done by this user. + */ + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActivitiesListRequest && equalTo((ActivitiesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActivitiesListRequest 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) + && remoteFields.equals(other.remoteFields) + && remoteId.equals(other.remoteId) + && showEnumOrigins.equals(other.showEnumOrigins) + && userId.equals(other.userId); + } + + @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.remoteFields, + this.remoteId, + this.showEnumOrigins, + this.userId); + } + + @Override + 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 remoteFields = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + private Optional userId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ActivitiesListRequest 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()); + remoteFields(other.getRemoteFields()); + remoteId(other.getRemoteId()); + showEnumOrigins(other.getShowEnumOrigins()); + userId(other.getUserId()); + 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(ActivitiesListRequestRemoteFields 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(ActivitiesListRequestShowEnumOrigins showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(String userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + public ActivitiesListRequest build() { + return new ActivitiesListRequest( + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteFields, + remoteId, + showEnumOrigins, + userId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/activities/requests/ActivitiesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/activities/requests/ActivitiesRetrieveRequest.java new file mode 100644 index 000000000..14ef6ca8c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/activities/requests/ActivitiesRetrieveRequest.java @@ -0,0 +1,178 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.activities.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ats.activities.types.ActivitiesRetrieveRequestRemoteFields; +import com.merge.legacy.api.resources.ats.activities.types.ActivitiesRetrieveRequestShowEnumOrigins; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ActivitiesRetrieveRequest.Builder.class) +public final class ActivitiesRetrieveRequest { + private final Optional expand; + + private final Optional includeRemoteData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private ActivitiesRetrieveRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActivitiesRetrieveRequest && equalTo((ActivitiesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActivitiesRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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(ActivitiesRetrieveRequest 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(ActivitiesRetrieveRequestRemoteFields 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(ActivitiesRetrieveRequestShowEnumOrigins showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public ActivitiesRetrieveRequest build() { + return new ActivitiesRetrieveRequest( + expand, includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/activities/requests/ActivityEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/activities/requests/ActivityEndpointRequest.java new file mode 100644 index 000000000..8380f1fb9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/activities/requests/ActivityEndpointRequest.java @@ -0,0 +1,199 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.activities.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ats.types.ActivityRequest; +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 = ActivityEndpointRequest.Builder.class) +public final class ActivityEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final ActivityRequest model; + + private final String remoteUserId; + + private final Map additionalProperties; + + private ActivityEndpointRequest( + Optional isDebugMode, + Optional runAsync, + ActivityRequest model, + String remoteUserId, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.remoteUserId = remoteUserId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public ActivityRequest getModel() { + return model; + } + + @JsonProperty("remote_user_id") + public String getRemoteUserId() { + return remoteUserId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActivityEndpointRequest && equalTo((ActivityEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActivityEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) + && runAsync.equals(other.runAsync) + && model.equals(other.model) + && remoteUserId.equals(other.remoteUserId); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model, this.remoteUserId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + RemoteUserIdStage model(@NotNull ActivityRequest model); + + Builder from(ActivityEndpointRequest other); + } + + public interface RemoteUserIdStage { + _FinalStage remoteUserId(@NotNull String remoteUserId); + } + + public interface _FinalStage { + ActivityEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, RemoteUserIdStage, _FinalStage { + private ActivityRequest model; + + private String remoteUserId; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(ActivityEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + remoteUserId(other.getRemoteUserId()); + return this; + } + + @Override + @JsonSetter("model") + public RemoteUserIdStage model(@NotNull ActivityRequest model) { + this.model = model; + return this; + } + + @Override + @JsonSetter("remote_user_id") + public _FinalStage remoteUserId(@NotNull String remoteUserId) { + this.remoteUserId = remoteUserId; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public ActivityEndpointRequest build() { + return new ActivityEndpointRequest(isDebugMode, runAsync, model, remoteUserId, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/activities/types/ActivitiesListRequestRemoteFields.java b/src/main/java/com/merge/legacy/api/resources/ats/activities/types/ActivitiesListRequestRemoteFields.java new file mode 100644 index 000000000..54312fce6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/activities/types/ActivitiesListRequestRemoteFields.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.activities.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ActivitiesListRequestRemoteFields { + ACTIVITY_TYPE("activity_type"), + + ACTIVITY_TYPE_VISIBILITY("activity_type,visibility"), + + VISIBILITY("visibility"); + + private final String value; + + ActivitiesListRequestRemoteFields(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/activities/types/ActivitiesListRequestShowEnumOrigins.java b/src/main/java/com/merge/legacy/api/resources/ats/activities/types/ActivitiesListRequestShowEnumOrigins.java new file mode 100644 index 000000000..4be317775 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/activities/types/ActivitiesListRequestShowEnumOrigins.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.activities.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ActivitiesListRequestShowEnumOrigins { + ACTIVITY_TYPE("activity_type"), + + ACTIVITY_TYPE_VISIBILITY("activity_type,visibility"), + + VISIBILITY("visibility"); + + private final String value; + + ActivitiesListRequestShowEnumOrigins(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/activities/types/ActivitiesRetrieveRequestRemoteFields.java b/src/main/java/com/merge/legacy/api/resources/ats/activities/types/ActivitiesRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..3ad4a513b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/activities/types/ActivitiesRetrieveRequestRemoteFields.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.activities.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ActivitiesRetrieveRequestRemoteFields { + ACTIVITY_TYPE("activity_type"), + + ACTIVITY_TYPE_VISIBILITY("activity_type,visibility"), + + VISIBILITY("visibility"); + + private final String value; + + ActivitiesRetrieveRequestRemoteFields(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/activities/types/ActivitiesRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/legacy/api/resources/ats/activities/types/ActivitiesRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..c8aa31738 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/activities/types/ActivitiesRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.activities.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ActivitiesRetrieveRequestShowEnumOrigins { + ACTIVITY_TYPE("activity_type"), + + ACTIVITY_TYPE_VISIBILITY("activity_type,visibility"), + + VISIBILITY("visibility"); + + private final String value; + + ActivitiesRetrieveRequestShowEnumOrigins(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/applications/ApplicationsClient.java b/src/main/java/com/merge/legacy/api/resources/ats/applications/ApplicationsClient.java new file mode 100644 index 000000000..94f7c2803 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/applications/ApplicationsClient.java @@ -0,0 +1,371 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.applications; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.applications.requests.*; +import com.merge.legacy.api.resources.ats.types.Application; +import com.merge.legacy.api.resources.ats.types.ApplicationResponse; +import com.merge.legacy.api.resources.ats.types.MetaResponse; +import com.merge.legacy.api.resources.ats.types.PaginatedApplicationList; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/ats/applications/requests/ApplicationEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/applications/requests/ApplicationEndpointRequest.java new file mode 100644 index 000000000..a6a34a335 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/applications/requests/ApplicationEndpointRequest.java @@ -0,0 +1,199 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.applications.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ats.types.ApplicationRequest; +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 = ApplicationEndpointRequest.Builder.class) +public final class ApplicationEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final ApplicationRequest model; + + private final String remoteUserId; + + private final Map additionalProperties; + + private ApplicationEndpointRequest( + Optional isDebugMode, + Optional runAsync, + ApplicationRequest model, + String remoteUserId, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.remoteUserId = remoteUserId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public ApplicationRequest getModel() { + return model; + } + + @JsonProperty("remote_user_id") + public String getRemoteUserId() { + return remoteUserId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApplicationEndpointRequest && equalTo((ApplicationEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ApplicationEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) + && runAsync.equals(other.runAsync) + && model.equals(other.model) + && remoteUserId.equals(other.remoteUserId); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model, this.remoteUserId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + RemoteUserIdStage model(@NotNull ApplicationRequest model); + + Builder from(ApplicationEndpointRequest other); + } + + public interface RemoteUserIdStage { + _FinalStage remoteUserId(@NotNull String remoteUserId); + } + + public interface _FinalStage { + ApplicationEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, RemoteUserIdStage, _FinalStage { + private ApplicationRequest model; + + private String remoteUserId; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(ApplicationEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + remoteUserId(other.getRemoteUserId()); + return this; + } + + @Override + @JsonSetter("model") + public RemoteUserIdStage model(@NotNull ApplicationRequest model) { + this.model = model; + return this; + } + + @Override + @JsonSetter("remote_user_id") + public _FinalStage remoteUserId(@NotNull String remoteUserId) { + this.remoteUserId = remoteUserId; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public ApplicationEndpointRequest build() { + return new ApplicationEndpointRequest(isDebugMode, runAsync, model, remoteUserId, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/applications/requests/ApplicationsListRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/applications/requests/ApplicationsListRequest.java new file mode 100644 index 000000000..f99797a31 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/applications/requests/ApplicationsListRequest.java @@ -0,0 +1,563 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.applications.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ats.applications.types.ApplicationsListRequestExpand; +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 = ApplicationsListRequest.Builder.class) +public final class ApplicationsListRequest { + private final Optional candidateId; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional creditedToId; + + private final Optional currentStageId; + + private final Optional cursor; + + private final Optional expand; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional jobId; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional rejectReasonId; + + private final Optional remoteId; + + private final Optional source; + + private final Map additionalProperties; + + private ApplicationsListRequest( + Optional candidateId, + Optional createdAfter, + Optional createdBefore, + Optional creditedToId, + Optional currentStageId, + Optional cursor, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional jobId, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional rejectReasonId, + Optional remoteId, + Optional source, + Map additionalProperties) { + 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; + this.jobId = jobId; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.rejectReasonId = rejectReasonId; + this.remoteId = remoteId; + this.source = source; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return applications 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 If provided, will only return applications credited to this user. + */ + @JsonProperty("credited_to_id") + public Optional getCreditedToId() { + return creditedToId; + } + + /** + * @return If provided, will only return applications at this interview stage. + */ + @JsonProperty("current_stage_id") + public Optional getCurrentStageId() { + return currentStageId; + } + + /** + * @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, will only return applications for this job. + */ + @JsonProperty("job_id") + public Optional getJobId() { + return jobId; + } + + /** + * @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 applications with this reject reason. + */ + @JsonProperty("reject_reason_id") + public Optional getRejectReasonId() { + return rejectReasonId; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return If provided, will only return applications with this source. + */ + @JsonProperty("source") + public Optional getSource() { + return source; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApplicationsListRequest && equalTo((ApplicationsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ApplicationsListRequest other) { + return 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) + && jobId.equals(other.jobId) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && rejectReasonId.equals(other.rejectReasonId) + && remoteId.equals(other.remoteId) + && source.equals(other.source); + } + + @Override + public int hashCode() { + return Objects.hash( + this.candidateId, + this.createdAfter, + this.createdBefore, + this.creditedToId, + this.currentStageId, + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.jobId, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.rejectReasonId, + this.remoteId, + this.source); + } + + @Override + 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 creditedToId = Optional.empty(); + + private Optional currentStageId = 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 jobId = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional rejectReasonId = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional source = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ApplicationsListRequest other) { + 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()); + jobId(other.getJobId()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + rejectReasonId(other.getRejectReasonId()); + remoteId(other.getRemoteId()); + source(other.getSource()); + 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 = "credited_to_id", nulls = Nulls.SKIP) + public Builder creditedToId(Optional creditedToId) { + this.creditedToId = creditedToId; + return this; + } + + public Builder creditedToId(String creditedToId) { + this.creditedToId = Optional.ofNullable(creditedToId); + return this; + } + + @JsonSetter(value = "current_stage_id", nulls = Nulls.SKIP) + public Builder currentStageId(Optional currentStageId) { + this.currentStageId = currentStageId; + return this; + } + + public Builder currentStageId(String currentStageId) { + this.currentStageId = Optional.ofNullable(currentStageId); + 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(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; + 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 = "job_id", nulls = Nulls.SKIP) + public Builder jobId(Optional jobId) { + this.jobId = jobId; + return this; + } + + public Builder jobId(String jobId) { + this.jobId = Optional.ofNullable(jobId); + 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 = "reject_reason_id", nulls = Nulls.SKIP) + public Builder rejectReasonId(Optional rejectReasonId) { + this.rejectReasonId = rejectReasonId; + return this; + } + + public Builder rejectReasonId(String rejectReasonId) { + this.rejectReasonId = Optional.ofNullable(rejectReasonId); + 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 = "source", nulls = Nulls.SKIP) + public Builder source(Optional source) { + this.source = source; + return this; + } + + public Builder source(String source) { + this.source = Optional.ofNullable(source); + return this; + } + + public ApplicationsListRequest build() { + return new ApplicationsListRequest( + candidateId, + createdAfter, + createdBefore, + creditedToId, + currentStageId, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + jobId, + modifiedAfter, + modifiedBefore, + pageSize, + rejectReasonId, + remoteId, + source, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/applications/requests/ApplicationsMetaPostRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/applications/requests/ApplicationsMetaPostRetrieveRequest.java new file mode 100644 index 000000000..a4a99dd77 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/applications/requests/ApplicationsMetaPostRetrieveRequest.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.applications.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = ApplicationsMetaPostRetrieveRequest.Builder.class) +public final class ApplicationsMetaPostRetrieveRequest { + private final Optional applicationRemoteTemplateId; + + private final Map additionalProperties; + + private ApplicationsMetaPostRetrieveRequest( + Optional applicationRemoteTemplateId, Map additionalProperties) { + this.applicationRemoteTemplateId = applicationRemoteTemplateId; + this.additionalProperties = additionalProperties; + } + + /** + * @return The template ID associated with the nested application in the request. + */ + @JsonProperty("application_remote_template_id") + public Optional getApplicationRemoteTemplateId() { + return applicationRemoteTemplateId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApplicationsMetaPostRetrieveRequest + && equalTo((ApplicationsMetaPostRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ApplicationsMetaPostRetrieveRequest other) { + return applicationRemoteTemplateId.equals(other.applicationRemoteTemplateId); + } + + @Override + public int hashCode() { + return Objects.hash(this.applicationRemoteTemplateId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional applicationRemoteTemplateId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ApplicationsMetaPostRetrieveRequest other) { + applicationRemoteTemplateId(other.getApplicationRemoteTemplateId()); + return this; + } + + @JsonSetter(value = "application_remote_template_id", nulls = Nulls.SKIP) + public Builder applicationRemoteTemplateId(Optional applicationRemoteTemplateId) { + this.applicationRemoteTemplateId = applicationRemoteTemplateId; + return this; + } + + public Builder applicationRemoteTemplateId(String applicationRemoteTemplateId) { + this.applicationRemoteTemplateId = Optional.ofNullable(applicationRemoteTemplateId); + return this; + } + + public ApplicationsMetaPostRetrieveRequest build() { + return new ApplicationsMetaPostRetrieveRequest(applicationRemoteTemplateId, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/applications/requests/ApplicationsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/applications/requests/ApplicationsRetrieveRequest.java new file mode 100644 index 000000000..6e068bcf9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/applications/requests/ApplicationsRetrieveRequest.java @@ -0,0 +1,121 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.applications.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/ats/applications/requests/UpdateApplicationStageRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/applications/requests/UpdateApplicationStageRequest.java new file mode 100644 index 000000000..930a54c07 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/applications/requests/UpdateApplicationStageRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.applications.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = UpdateApplicationStageRequest.Builder.class) +public final class UpdateApplicationStageRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final Optional jobInterviewStage; + + private final Optional remoteUserId; + + private final Map additionalProperties; + + private UpdateApplicationStageRequest( + Optional isDebugMode, + Optional runAsync, + Optional jobInterviewStage, + Optional remoteUserId, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.jobInterviewStage = jobInterviewStage; + this.remoteUserId = remoteUserId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + /** + * @return The interview stage to move the application to. + */ + @JsonProperty("job_interview_stage") + public Optional getJobInterviewStage() { + return jobInterviewStage; + } + + @JsonProperty("remote_user_id") + public Optional getRemoteUserId() { + return remoteUserId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateApplicationStageRequest && equalTo((UpdateApplicationStageRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateApplicationStageRequest other) { + return isDebugMode.equals(other.isDebugMode) + && runAsync.equals(other.runAsync) + && jobInterviewStage.equals(other.jobInterviewStage) + && remoteUserId.equals(other.remoteUserId); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.jobInterviewStage, this.remoteUserId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional isDebugMode = Optional.empty(); + + private Optional runAsync = Optional.empty(); + + private Optional jobInterviewStage = Optional.empty(); + + private Optional remoteUserId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateApplicationStageRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + jobInterviewStage(other.getJobInterviewStage()); + remoteUserId(other.getRemoteUserId()); + return this; + } + + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public Builder isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + public Builder isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @JsonSetter(value = "run_async", nulls = Nulls.SKIP) + public Builder runAsync(Optional runAsync) { + this.runAsync = runAsync; + return this; + } + + public Builder runAsync(Boolean runAsync) { + this.runAsync = Optional.ofNullable(runAsync); + return this; + } + + @JsonSetter(value = "job_interview_stage", nulls = Nulls.SKIP) + public Builder jobInterviewStage(Optional jobInterviewStage) { + this.jobInterviewStage = jobInterviewStage; + return this; + } + + public Builder jobInterviewStage(String jobInterviewStage) { + this.jobInterviewStage = Optional.ofNullable(jobInterviewStage); + return this; + } + + @JsonSetter(value = "remote_user_id", nulls = Nulls.SKIP) + public Builder remoteUserId(Optional remoteUserId) { + this.remoteUserId = remoteUserId; + return this; + } + + public Builder remoteUserId(String remoteUserId) { + this.remoteUserId = Optional.ofNullable(remoteUserId); + return this; + } + + public UpdateApplicationStageRequest build() { + return new UpdateApplicationStageRequest( + isDebugMode, runAsync, jobInterviewStage, remoteUserId, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/applications/types/ApplicationsListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/ats/applications/types/ApplicationsListRequestExpand.java new file mode 100644 index 000000000..191dd3ad2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/applications/types/ApplicationsListRequestExpand.java @@ -0,0 +1,680 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/applications/types/ApplicationsRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/ats/applications/types/ApplicationsRetrieveRequestExpand.java new file mode 100644 index 000000000..f776f06a2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/applications/types/ApplicationsRetrieveRequestExpand.java @@ -0,0 +1,680 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/asyncpassthrough/AsyncPassthroughClient.java b/src/main/java/com/merge/legacy/api/resources/ats/asyncpassthrough/AsyncPassthroughClient.java new file mode 100644 index 000000000..8a8df44e6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/asyncpassthrough/AsyncPassthroughClient.java @@ -0,0 +1,110 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.asyncpassthrough; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.asyncpassthrough.types.AsyncPassthroughRetrieveResponse; +import com.merge.legacy.api.resources.ats.types.AsyncPassthroughReciept; +import com.merge.legacy.api.resources.ats.types.DataPassthroughRequest; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java b/src/main/java/com/merge/legacy/api/resources/ats/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java new file mode 100644 index 000000000..240aa2ee2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import com.merge.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/attachments/AttachmentsClient.java b/src/main/java/com/merge/legacy/api/resources/ats/attachments/AttachmentsClient.java new file mode 100644 index 000000000..113c4175a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/attachments/AttachmentsClient.java @@ -0,0 +1,283 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.attachments; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.attachments.requests.AttachmentEndpointRequest; +import com.merge.legacy.api.resources.ats.attachments.requests.AttachmentsListRequest; +import com.merge.legacy.api.resources.ats.attachments.requests.AttachmentsRetrieveRequest; +import com.merge.legacy.api.resources.ats.types.Attachment; +import com.merge.legacy.api.resources.ats.types.AttachmentResponse; +import com.merge.legacy.api.resources.ats.types.MetaResponse; +import com.merge.legacy.api.resources.ats.types.PaginatedAttachmentList; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/ats/attachments/requests/AttachmentEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/attachments/requests/AttachmentEndpointRequest.java new file mode 100644 index 000000000..9fe732277 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/attachments/requests/AttachmentEndpointRequest.java @@ -0,0 +1,199 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.attachments.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ats.types.AttachmentRequest; +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 = AttachmentEndpointRequest.Builder.class) +public final class AttachmentEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final AttachmentRequest model; + + private final String remoteUserId; + + private final Map additionalProperties; + + private AttachmentEndpointRequest( + Optional isDebugMode, + Optional runAsync, + AttachmentRequest model, + String remoteUserId, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.remoteUserId = remoteUserId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public AttachmentRequest getModel() { + return model; + } + + @JsonProperty("remote_user_id") + public String getRemoteUserId() { + return remoteUserId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttachmentEndpointRequest && equalTo((AttachmentEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttachmentEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) + && runAsync.equals(other.runAsync) + && model.equals(other.model) + && remoteUserId.equals(other.remoteUserId); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model, this.remoteUserId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + RemoteUserIdStage model(@NotNull AttachmentRequest model); + + Builder from(AttachmentEndpointRequest other); + } + + public interface RemoteUserIdStage { + _FinalStage remoteUserId(@NotNull String remoteUserId); + } + + public interface _FinalStage { + AttachmentEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, RemoteUserIdStage, _FinalStage { + private AttachmentRequest model; + + private String remoteUserId; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(AttachmentEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + remoteUserId(other.getRemoteUserId()); + return this; + } + + @Override + @JsonSetter("model") + public RemoteUserIdStage model(@NotNull AttachmentRequest model) { + this.model = model; + return this; + } + + @Override + @JsonSetter("remote_user_id") + public _FinalStage remoteUserId(@NotNull String remoteUserId) { + this.remoteUserId = remoteUserId; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public AttachmentEndpointRequest build() { + return new AttachmentEndpointRequest(isDebugMode, runAsync, model, remoteUserId, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/attachments/requests/AttachmentsListRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/attachments/requests/AttachmentsListRequest.java new file mode 100644 index 000000000..11b0c85f3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/attachments/requests/AttachmentsListRequest.java @@ -0,0 +1,475 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.attachments.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ats/attachments/requests/AttachmentsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/attachments/requests/AttachmentsRetrieveRequest.java new file mode 100644 index 000000000..80b1b2661 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/attachments/requests/AttachmentsRetrieveRequest.java @@ -0,0 +1,176 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.attachments.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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/legacy/api/resources/ats/audittrail/AuditTrailClient.java b/src/main/java/com/merge/legacy/api/resources/ats/audittrail/AuditTrailClient.java new file mode 100644 index 000000000..5d92c1da0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/audittrail/AuditTrailClient.java @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.audittrail; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.audittrail.requests.AuditTrailListRequest; +import com.merge.legacy.api.resources.ats.types.PaginatedAuditLogEventList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/audittrail/requests/AuditTrailListRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/audittrail/requests/AuditTrailListRequest.java new file mode 100644 index 000000000..3bc941a0e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/audittrail/requests/AuditTrailListRequest.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.audittrail.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.cursor, this.endDate, this.eventType, this.pageSize, this.startDate, this.userEmail); + } + + @Override + 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/legacy/api/resources/ats/availableactions/AvailableActionsClient.java b/src/main/java/com/merge/legacy/api/resources/ats/availableactions/AvailableActionsClient.java new file mode 100644 index 000000000..be07e80c8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/availableactions/AvailableActionsClient.java @@ -0,0 +1,58 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.availableactions; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.types.AvailableActions; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/candidates/CandidatesClient.java b/src/main/java/com/merge/legacy/api/resources/ats/candidates/CandidatesClient.java new file mode 100644 index 000000000..2d40fdd52 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/candidates/CandidatesClient.java @@ -0,0 +1,427 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.candidates; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.candidates.requests.*; +import com.merge.legacy.api.resources.ats.types.Candidate; +import com.merge.legacy.api.resources.ats.types.CandidateResponse; +import com.merge.legacy.api.resources.ats.types.MetaResponse; +import com.merge.legacy.api.resources.ats.types.PaginatedCandidateList; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/ats/candidates/requests/CandidateEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/candidates/requests/CandidateEndpointRequest.java new file mode 100644 index 000000000..a60387aa9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/candidates/requests/CandidateEndpointRequest.java @@ -0,0 +1,199 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.candidates.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ats.types.CandidateRequest; +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 = CandidateEndpointRequest.Builder.class) +public final class CandidateEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final CandidateRequest model; + + private final String remoteUserId; + + private final Map additionalProperties; + + private CandidateEndpointRequest( + Optional isDebugMode, + Optional runAsync, + CandidateRequest model, + String remoteUserId, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.remoteUserId = remoteUserId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public CandidateRequest getModel() { + return model; + } + + @JsonProperty("remote_user_id") + public String getRemoteUserId() { + return remoteUserId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CandidateEndpointRequest && equalTo((CandidateEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CandidateEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) + && runAsync.equals(other.runAsync) + && model.equals(other.model) + && remoteUserId.equals(other.remoteUserId); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model, this.remoteUserId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + RemoteUserIdStage model(@NotNull CandidateRequest model); + + Builder from(CandidateEndpointRequest other); + } + + public interface RemoteUserIdStage { + _FinalStage remoteUserId(@NotNull String remoteUserId); + } + + public interface _FinalStage { + CandidateEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, RemoteUserIdStage, _FinalStage { + private CandidateRequest model; + + private String remoteUserId; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CandidateEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + remoteUserId(other.getRemoteUserId()); + return this; + } + + @Override + @JsonSetter("model") + public RemoteUserIdStage model(@NotNull CandidateRequest model) { + this.model = model; + return this; + } + + @Override + @JsonSetter("remote_user_id") + public _FinalStage remoteUserId(@NotNull String remoteUserId) { + this.remoteUserId = remoteUserId; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public CandidateEndpointRequest build() { + return new CandidateEndpointRequest(isDebugMode, runAsync, model, remoteUserId, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/candidates/requests/CandidatesListRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/candidates/requests/CandidatesListRequest.java new file mode 100644 index 000000000..456d1f2db --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/candidates/requests/CandidatesListRequest.java @@ -0,0 +1,505 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.candidates.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ats.candidates.types.CandidatesListRequestExpand; +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 = CandidatesListRequest.Builder.class) +public final class CandidatesListRequest { + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional emailAddresses; + + private final Optional expand; + + private final Optional firstName; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional lastName; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Optional tags; + + private final Map additionalProperties; + + private CandidatesListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional emailAddresses, + Optional expand, + Optional firstName, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional lastName, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Optional tags, + Map additionalProperties) { + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.emailAddresses = emailAddresses; + this.expand = expand; + this.firstName = firstName; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.lastName = lastName; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.remoteId = remoteId; + this.tags = tags; + 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 candidates with these email addresses; multiple 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 If provided, will only return candidates with this first name. + */ + @JsonProperty("first_name") + public Optional getFirstName() { + return firstName; + } + + /** + * @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 candidates with this last name. + */ + @JsonProperty("last_name") + public Optional getLastName() { + return lastName; + } + + /** + * @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 candidates with these tags; multiple tags can be separated by commas. + */ + @JsonProperty("tags") + public Optional getTags() { + return tags; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CandidatesListRequest && equalTo((CandidatesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CandidatesListRequest other) { + return 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) + && includeShellData.equals(other.includeShellData) + && lastName.equals(other.lastName) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId) + && tags.equals(other.tags); + } + + @Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.emailAddresses, + this.expand, + this.firstName, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.lastName, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId, + this.tags); + } + + @Override + 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 emailAddresses = Optional.empty(); + + private Optional expand = Optional.empty(); + + private Optional firstName = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional lastName = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional tags = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CandidatesListRequest other) { + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + emailAddresses(other.getEmailAddresses()); + expand(other.getExpand()); + firstName(other.getFirstName()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + lastName(other.getLastName()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + tags(other.getTags()); + 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(CandidatesListRequestExpand 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 = "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 = "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 = "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 = "tags", nulls = Nulls.SKIP) + public Builder tags(Optional tags) { + this.tags = tags; + return this; + } + + public Builder tags(String tags) { + this.tags = Optional.ofNullable(tags); + return this; + } + + public CandidatesListRequest build() { + return new CandidatesListRequest( + createdAfter, + createdBefore, + cursor, + emailAddresses, + expand, + firstName, + includeDeletedData, + includeRemoteData, + includeShellData, + lastName, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + tags, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/candidates/requests/CandidatesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/candidates/requests/CandidatesRetrieveRequest.java new file mode 100644 index 000000000..7f5d632f9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/candidates/requests/CandidatesRetrieveRequest.java @@ -0,0 +1,121 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.candidates.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/ats/candidates/requests/IgnoreCommonModelRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/candidates/requests/IgnoreCommonModelRequest.java new file mode 100644 index 000000000..52bbd8a22 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/candidates/requests/IgnoreCommonModelRequest.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.candidates.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.reason, this.message); + } + + @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() {} + + @Override + public Builder from(IgnoreCommonModelRequest other) { + reason(other.getReason()); + message(other.getMessage()); + return this; + } + + @Override + @JsonSetter("reason") + public _FinalStage reason(@NotNull ReasonEnum reason) { + this.reason = reason; + return this; + } + + @Override + public _FinalStage message(String message) { + this.message = Optional.ofNullable(message); + return this; + } + + @Override + @JsonSetter(value = "message", nulls = Nulls.SKIP) + public _FinalStage message(Optional message) { + this.message = message; + return this; + } + + @Override + public IgnoreCommonModelRequest build() { + return new IgnoreCommonModelRequest(reason, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/candidates/requests/PatchedCandidateEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/candidates/requests/PatchedCandidateEndpointRequest.java new file mode 100644 index 000000000..4637dd5f0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/candidates/requests/PatchedCandidateEndpointRequest.java @@ -0,0 +1,200 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.candidates.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ats.types.PatchedCandidateRequest; +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 = PatchedCandidateEndpointRequest.Builder.class) +public final class PatchedCandidateEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final PatchedCandidateRequest model; + + private final String remoteUserId; + + private final Map additionalProperties; + + private PatchedCandidateEndpointRequest( + Optional isDebugMode, + Optional runAsync, + PatchedCandidateRequest model, + String remoteUserId, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.remoteUserId = remoteUserId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public PatchedCandidateRequest getModel() { + return model; + } + + @JsonProperty("remote_user_id") + public String getRemoteUserId() { + return remoteUserId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedCandidateEndpointRequest && equalTo((PatchedCandidateEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedCandidateEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) + && runAsync.equals(other.runAsync) + && model.equals(other.model) + && remoteUserId.equals(other.remoteUserId); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model, this.remoteUserId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + RemoteUserIdStage model(@NotNull PatchedCandidateRequest model); + + Builder from(PatchedCandidateEndpointRequest other); + } + + public interface RemoteUserIdStage { + _FinalStage remoteUserId(@NotNull String remoteUserId); + } + + public interface _FinalStage { + PatchedCandidateEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, RemoteUserIdStage, _FinalStage { + private PatchedCandidateRequest model; + + private String remoteUserId; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(PatchedCandidateEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + remoteUserId(other.getRemoteUserId()); + return this; + } + + @Override + @JsonSetter("model") + public RemoteUserIdStage model(@NotNull PatchedCandidateRequest model) { + this.model = model; + return this; + } + + @Override + @JsonSetter("remote_user_id") + public _FinalStage remoteUserId(@NotNull String remoteUserId) { + this.remoteUserId = remoteUserId; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public PatchedCandidateEndpointRequest build() { + return new PatchedCandidateEndpointRequest( + isDebugMode, runAsync, model, remoteUserId, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/candidates/types/CandidatesListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/ats/candidates/types/CandidatesListRequestExpand.java new file mode 100644 index 000000000..11e2cde6a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/candidates/types/CandidatesListRequestExpand.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/candidates/types/CandidatesRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/ats/candidates/types/CandidatesRetrieveRequestExpand.java new file mode 100644 index 000000000..9859293ff --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/candidates/types/CandidatesRetrieveRequestExpand.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/deleteaccount/DeleteAccountClient.java b/src/main/java/com/merge/legacy/api/resources/ats/deleteaccount/DeleteAccountClient.java new file mode 100644 index 000000000..a52d0025e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/deleteaccount/DeleteAccountClient.java @@ -0,0 +1,55 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.deleteaccount; + +import com.merge.legacy.api.core.*; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/departments/DepartmentsClient.java b/src/main/java/com/merge/legacy/api/resources/ats/departments/DepartmentsClient.java new file mode 100644 index 000000000..33199b70a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/departments/DepartmentsClient.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.departments; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.departments.requests.DepartmentsListRequest; +import com.merge.legacy.api.resources.ats.departments.requests.DepartmentsRetrieveRequest; +import com.merge.legacy.api.resources.ats.types.Department; +import com.merge.legacy.api.resources.ats.types.PaginatedDepartmentList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/departments/requests/DepartmentsListRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/departments/requests/DepartmentsListRequest.java new file mode 100644 index 000000000..de3acb88c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/departments/requests/DepartmentsListRequest.java @@ -0,0 +1,359 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.departments.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = DepartmentsListRequest.Builder.class) +public final class DepartmentsListRequest { + 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 DepartmentsListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DepartmentsListRequest && equalTo((DepartmentsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DepartmentsListRequest 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); + } + + @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); + } + + @Override + 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(DepartmentsListRequest 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 DepartmentsListRequest build() { + return new DepartmentsListRequest( + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/departments/requests/DepartmentsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/departments/requests/DepartmentsRetrieveRequest.java new file mode 100644 index 000000000..00f2bda77 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/departments/requests/DepartmentsRetrieveRequest.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.departments.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/ats/eeocs/EeocsClient.java b/src/main/java/com/merge/legacy/api/resources/ats/eeocs/EeocsClient.java new file mode 100644 index 000000000..d3e0f4132 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/eeocs/EeocsClient.java @@ -0,0 +1,182 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.eeocs; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.eeocs.requests.EeocsListRequest; +import com.merge.legacy.api.resources.ats.eeocs.requests.EeocsRetrieveRequest; +import com.merge.legacy.api.resources.ats.types.Eeoc; +import com.merge.legacy.api.resources.ats.types.PaginatedEeocList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/eeocs/requests/EeocsListRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/eeocs/requests/EeocsListRequest.java new file mode 100644 index 000000000..973e91d03 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/eeocs/requests/EeocsListRequest.java @@ -0,0 +1,477 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.eeocs.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ats.eeocs.types.EeocsListRequestRemoteFields; +import com.merge.legacy.api.resources.ats.eeocs.types.EeocsListRequestShowEnumOrigins; +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 = EeocsListRequest.Builder.class) +public final class EeocsListRequest { + 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 EeocsListRequest( + 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 EEOC info 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EeocsListRequest && equalTo((EeocsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EeocsListRequest 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); + } + + @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); + } + + @Override + 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(EeocsListRequest 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(EeocsListRequestRemoteFields 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(EeocsListRequestShowEnumOrigins showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public EeocsListRequest build() { + return new EeocsListRequest( + candidateId, + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteFields, + remoteId, + showEnumOrigins, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/eeocs/requests/EeocsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/eeocs/requests/EeocsRetrieveRequest.java new file mode 100644 index 000000000..406b9e96d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/eeocs/requests/EeocsRetrieveRequest.java @@ -0,0 +1,178 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.eeocs.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ats.eeocs.types.EeocsRetrieveRequestRemoteFields; +import com.merge.legacy.api.resources.ats.eeocs.types.EeocsRetrieveRequestShowEnumOrigins; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EeocsRetrieveRequest.Builder.class) +public final class EeocsRetrieveRequest { + private final Optional expand; + + private final Optional includeRemoteData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private EeocsRetrieveRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EeocsRetrieveRequest && equalTo((EeocsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EeocsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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(EeocsRetrieveRequest 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(EeocsRetrieveRequestRemoteFields 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(EeocsRetrieveRequestShowEnumOrigins showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public EeocsRetrieveRequest build() { + return new EeocsRetrieveRequest( + expand, includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/eeocs/types/EeocsListRequestRemoteFields.java b/src/main/java/com/merge/legacy/api/resources/ats/eeocs/types/EeocsListRequestRemoteFields.java new file mode 100644 index 000000000..600bf5fe3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/eeocs/types/EeocsListRequestRemoteFields.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.eeocs.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EeocsListRequestRemoteFields { + DISABILITY_STATUS("disability_status"), + + DISABILITY_STATUS_GENDER("disability_status,gender"), + + DISABILITY_STATUS_GENDER_RACE("disability_status,gender,race"), + + DISABILITY_STATUS_GENDER_RACE_VETERAN_STATUS("disability_status,gender,race,veteran_status"), + + DISABILITY_STATUS_GENDER_VETERAN_STATUS("disability_status,gender,veteran_status"), + + DISABILITY_STATUS_RACE("disability_status,race"), + + DISABILITY_STATUS_RACE_VETERAN_STATUS("disability_status,race,veteran_status"), + + DISABILITY_STATUS_VETERAN_STATUS("disability_status,veteran_status"), + + GENDER("gender"), + + GENDER_RACE("gender,race"), + + GENDER_RACE_VETERAN_STATUS("gender,race,veteran_status"), + + GENDER_VETERAN_STATUS("gender,veteran_status"), + + RACE("race"), + + RACE_VETERAN_STATUS("race,veteran_status"), + + VETERAN_STATUS("veteran_status"); + + private final String value; + + EeocsListRequestRemoteFields(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/eeocs/types/EeocsListRequestShowEnumOrigins.java b/src/main/java/com/merge/legacy/api/resources/ats/eeocs/types/EeocsListRequestShowEnumOrigins.java new file mode 100644 index 000000000..efaf39e74 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/eeocs/types/EeocsListRequestShowEnumOrigins.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.eeocs.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EeocsListRequestShowEnumOrigins { + DISABILITY_STATUS("disability_status"), + + DISABILITY_STATUS_GENDER("disability_status,gender"), + + DISABILITY_STATUS_GENDER_RACE("disability_status,gender,race"), + + DISABILITY_STATUS_GENDER_RACE_VETERAN_STATUS("disability_status,gender,race,veteran_status"), + + DISABILITY_STATUS_GENDER_VETERAN_STATUS("disability_status,gender,veteran_status"), + + DISABILITY_STATUS_RACE("disability_status,race"), + + DISABILITY_STATUS_RACE_VETERAN_STATUS("disability_status,race,veteran_status"), + + DISABILITY_STATUS_VETERAN_STATUS("disability_status,veteran_status"), + + GENDER("gender"), + + GENDER_RACE("gender,race"), + + GENDER_RACE_VETERAN_STATUS("gender,race,veteran_status"), + + GENDER_VETERAN_STATUS("gender,veteran_status"), + + RACE("race"), + + RACE_VETERAN_STATUS("race,veteran_status"), + + VETERAN_STATUS("veteran_status"); + + private final String value; + + EeocsListRequestShowEnumOrigins(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/eeocs/types/EeocsRetrieveRequestRemoteFields.java b/src/main/java/com/merge/legacy/api/resources/ats/eeocs/types/EeocsRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..1ce1bfd39 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/eeocs/types/EeocsRetrieveRequestRemoteFields.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.eeocs.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EeocsRetrieveRequestRemoteFields { + DISABILITY_STATUS("disability_status"), + + DISABILITY_STATUS_GENDER("disability_status,gender"), + + DISABILITY_STATUS_GENDER_RACE("disability_status,gender,race"), + + DISABILITY_STATUS_GENDER_RACE_VETERAN_STATUS("disability_status,gender,race,veteran_status"), + + DISABILITY_STATUS_GENDER_VETERAN_STATUS("disability_status,gender,veteran_status"), + + DISABILITY_STATUS_RACE("disability_status,race"), + + DISABILITY_STATUS_RACE_VETERAN_STATUS("disability_status,race,veteran_status"), + + DISABILITY_STATUS_VETERAN_STATUS("disability_status,veteran_status"), + + GENDER("gender"), + + GENDER_RACE("gender,race"), + + GENDER_RACE_VETERAN_STATUS("gender,race,veteran_status"), + + GENDER_VETERAN_STATUS("gender,veteran_status"), + + RACE("race"), + + RACE_VETERAN_STATUS("race,veteran_status"), + + VETERAN_STATUS("veteran_status"); + + private final String value; + + EeocsRetrieveRequestRemoteFields(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/eeocs/types/EeocsRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/legacy/api/resources/ats/eeocs/types/EeocsRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..6cf38c977 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/eeocs/types/EeocsRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.eeocs.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EeocsRetrieveRequestShowEnumOrigins { + DISABILITY_STATUS("disability_status"), + + DISABILITY_STATUS_GENDER("disability_status,gender"), + + DISABILITY_STATUS_GENDER_RACE("disability_status,gender,race"), + + DISABILITY_STATUS_GENDER_RACE_VETERAN_STATUS("disability_status,gender,race,veteran_status"), + + DISABILITY_STATUS_GENDER_VETERAN_STATUS("disability_status,gender,veteran_status"), + + DISABILITY_STATUS_RACE("disability_status,race"), + + DISABILITY_STATUS_RACE_VETERAN_STATUS("disability_status,race,veteran_status"), + + DISABILITY_STATUS_VETERAN_STATUS("disability_status,veteran_status"), + + GENDER("gender"), + + GENDER_RACE("gender,race"), + + GENDER_RACE_VETERAN_STATUS("gender,race,veteran_status"), + + GENDER_VETERAN_STATUS("gender,veteran_status"), + + RACE("race"), + + RACE_VETERAN_STATUS("race,veteran_status"), + + VETERAN_STATUS("veteran_status"); + + private final String value; + + EeocsRetrieveRequestShowEnumOrigins(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/fieldmapping/FieldMappingClient.java b/src/main/java/com/merge/legacy/api/resources/ats/fieldmapping/FieldMappingClient.java new file mode 100644 index 000000000..87037411e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/fieldmapping/FieldMappingClient.java @@ -0,0 +1,338 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.fieldmapping; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.fieldmapping.requests.CreateFieldMappingRequest; +import com.merge.legacy.api.resources.ats.fieldmapping.requests.FieldMappingsRetrieveRequest; +import com.merge.legacy.api.resources.ats.fieldmapping.requests.PatchedEditFieldMappingRequest; +import com.merge.legacy.api.resources.ats.fieldmapping.requests.RemoteFieldsRetrieveRequest; +import com.merge.legacy.api.resources.ats.types.ExternalTargetFieldApiResponse; +import com.merge.legacy.api.resources.ats.types.FieldMappingApiInstanceResponse; +import com.merge.legacy.api.resources.ats.types.FieldMappingInstanceResponse; +import com.merge.legacy.api.resources.ats.types.RemoteFieldApiResponse; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/ats/fieldmapping/requests/CreateFieldMappingRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/fieldmapping/requests/CreateFieldMappingRequest.java new file mode 100644 index 000000000..232e3278d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/fieldmapping/requests/CreateFieldMappingRequest.java @@ -0,0 +1,337 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.fieldmapping.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.excludeRemoteFieldMetadata, + this.targetFieldName, + this.targetFieldDescription, + this.remoteFieldTraversalPath, + this.remoteMethod, + this.remoteUrlPath, + this.commonModelName); + } + + @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() {} + + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @Override + public _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.add(remoteFieldTraversalPath); + return this; + } + + @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. + */ + @Override + public _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); + return this; + } + + @Override + @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) + public _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + return this; + } + + @Override + public CreateFieldMappingRequest build() { + return new CreateFieldMappingRequest( + excludeRemoteFieldMetadata, + targetFieldName, + targetFieldDescription, + remoteFieldTraversalPath, + remoteMethod, + remoteUrlPath, + commonModelName, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/fieldmapping/requests/FieldMappingsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/fieldmapping/requests/FieldMappingsRetrieveRequest.java new file mode 100644 index 000000000..82d1f9b0d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/fieldmapping/requests/FieldMappingsRetrieveRequest.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.fieldmapping.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.excludeRemoteFieldMetadata); + } + + @Override + 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/legacy/api/resources/ats/fieldmapping/requests/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/fieldmapping/requests/PatchedEditFieldMappingRequest.java new file mode 100644 index 000000000..6784dbdb4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/fieldmapping/requests/PatchedEditFieldMappingRequest.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.fieldmapping.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath); + } + + @Override + 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/legacy/api/resources/ats/fieldmapping/requests/RemoteFieldsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/fieldmapping/requests/RemoteFieldsRetrieveRequest.java new file mode 100644 index 000000000..b5eac6dd6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/fieldmapping/requests/RemoteFieldsRetrieveRequest.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.fieldmapping.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.commonModels, this.includeExampleValues); + } + + @Override + 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/legacy/api/resources/ats/forceresync/ForceResyncClient.java b/src/main/java/com/merge/legacy/api/resources/ats/forceresync/ForceResyncClient.java new file mode 100644 index 000000000..9aec6d5d3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/forceresync/ForceResyncClient.java @@ -0,0 +1,61 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.forceresync; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.types.SyncStatus; +import java.io.IOException; +import java.util.List; +import okhttp3.*; + +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/legacy/api/resources/ats/generatekey/GenerateKeyClient.java b/src/main/java/com/merge/legacy/api/resources/ats/generatekey/GenerateKeyClient.java new file mode 100644 index 000000000..37dc85c8e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/generatekey/GenerateKeyClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.generatekey; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.generatekey.requests.GenerateRemoteKeyRequest; +import com.merge.legacy.api.resources.ats.types.RemoteKey; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/generatekey/requests/GenerateRemoteKeyRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/generatekey/requests/GenerateRemoteKeyRequest.java new file mode 100644 index 000000000..5446bfdc9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/generatekey/requests/GenerateRemoteKeyRequest.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.generatekey.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + public GenerateRemoteKeyRequest build() { + return new GenerateRemoteKeyRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/interviews/InterviewsClient.java b/src/main/java/com/merge/legacy/api/resources/ats/interviews/InterviewsClient.java new file mode 100644 index 000000000..41d8cdbab --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/interviews/InterviewsClient.java @@ -0,0 +1,295 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.interviews; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.interviews.requests.InterviewsListRequest; +import com.merge.legacy.api.resources.ats.interviews.requests.InterviewsRetrieveRequest; +import com.merge.legacy.api.resources.ats.interviews.requests.ScheduledInterviewEndpointRequest; +import com.merge.legacy.api.resources.ats.types.MetaResponse; +import com.merge.legacy.api.resources.ats.types.PaginatedScheduledInterviewList; +import com.merge.legacy.api.resources.ats.types.ScheduledInterview; +import com.merge.legacy.api.resources.ats.types.ScheduledInterviewResponse; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/ats/interviews/requests/InterviewsListRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/interviews/requests/InterviewsListRequest.java new file mode 100644 index 000000000..7c2d22ab0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/interviews/requests/InterviewsListRequest.java @@ -0,0 +1,563 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.interviews.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ats.interviews.types.InterviewsListRequestExpand; +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 = InterviewsListRequest.Builder.class) +public final class InterviewsListRequest { + private final Optional applicationId; + + 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 jobId; + + private final Optional jobInterviewStageId; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional organizerId; + + private final Optional pageSize; + + private final Optional remoteFields; + + private final Optional remoteId; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private InterviewsListRequest( + Optional applicationId, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional jobId, + Optional jobInterviewStageId, + Optional modifiedAfter, + Optional modifiedBefore, + Optional organizerId, + Optional pageSize, + Optional remoteFields, + Optional remoteId, + Optional showEnumOrigins, + Map additionalProperties) { + this.applicationId = applicationId; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.expand = expand; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.jobId = jobId; + this.jobInterviewStageId = jobInterviewStageId; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.organizerId = organizerId; + this.pageSize = pageSize; + this.remoteFields = remoteFields; + this.remoteId = remoteId; + this.showEnumOrigins = showEnumOrigins; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return interviews for this application. + */ + @JsonProperty("application_id") + public Optional getApplicationId() { + return applicationId; + } + + /** + * @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, wll only return interviews organized for this job. + */ + @JsonProperty("job_id") + public Optional getJobId() { + return jobId; + } + + /** + * @return If provided, will only return interviews at this stage. + */ + @JsonProperty("job_interview_stage_id") + public Optional getJobInterviewStageId() { + return jobInterviewStageId; + } + + /** + * @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 interviews organized by this user. + */ + @JsonProperty("organizer_id") + public Optional getOrganizerId() { + return organizerId; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InterviewsListRequest && equalTo((InterviewsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(InterviewsListRequest other) { + return 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) + && jobId.equals(other.jobId) + && jobInterviewStageId.equals(other.jobInterviewStageId) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && organizerId.equals(other.organizerId) + && pageSize.equals(other.pageSize) + && remoteFields.equals(other.remoteFields) + && remoteId.equals(other.remoteId) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @Override + public int hashCode() { + return Objects.hash( + this.applicationId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.jobId, + this.jobInterviewStageId, + this.modifiedAfter, + this.modifiedBefore, + this.organizerId, + this.pageSize, + this.remoteFields, + this.remoteId, + this.showEnumOrigins); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional applicationId = 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 jobId = Optional.empty(); + + private Optional jobInterviewStageId = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional organizerId = 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(InterviewsListRequest other) { + applicationId(other.getApplicationId()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + expand(other.getExpand()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + jobId(other.getJobId()); + jobInterviewStageId(other.getJobInterviewStageId()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + organizerId(other.getOrganizerId()); + pageSize(other.getPageSize()); + remoteFields(other.getRemoteFields()); + remoteId(other.getRemoteId()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + @JsonSetter(value = "application_id", nulls = Nulls.SKIP) + public Builder applicationId(Optional applicationId) { + this.applicationId = applicationId; + return this; + } + + public Builder applicationId(String applicationId) { + this.applicationId = Optional.ofNullable(applicationId); + 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(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; + 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 = "job_id", nulls = Nulls.SKIP) + public Builder jobId(Optional jobId) { + this.jobId = jobId; + return this; + } + + public Builder jobId(String jobId) { + this.jobId = Optional.ofNullable(jobId); + return this; + } + + @JsonSetter(value = "job_interview_stage_id", nulls = Nulls.SKIP) + public Builder jobInterviewStageId(Optional jobInterviewStageId) { + this.jobInterviewStageId = jobInterviewStageId; + return this; + } + + public Builder jobInterviewStageId(String jobInterviewStageId) { + this.jobInterviewStageId = Optional.ofNullable(jobInterviewStageId); + 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 = "organizer_id", nulls = Nulls.SKIP) + public Builder organizerId(Optional organizerId) { + this.organizerId = organizerId; + return this; + } + + public Builder organizerId(String organizerId) { + this.organizerId = Optional.ofNullable(organizerId); + 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 InterviewsListRequest build() { + return new InterviewsListRequest( + applicationId, + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + jobId, + jobInterviewStageId, + modifiedAfter, + modifiedBefore, + organizerId, + pageSize, + remoteFields, + remoteId, + showEnumOrigins, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/interviews/requests/InterviewsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/interviews/requests/InterviewsRetrieveRequest.java new file mode 100644 index 000000000..303790583 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/interviews/requests/InterviewsRetrieveRequest.java @@ -0,0 +1,177 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.interviews.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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/legacy/api/resources/ats/interviews/requests/ScheduledInterviewEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/interviews/requests/ScheduledInterviewEndpointRequest.java new file mode 100644 index 000000000..257fe3753 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/interviews/requests/ScheduledInterviewEndpointRequest.java @@ -0,0 +1,200 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.interviews.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ats.types.ScheduledInterviewRequest; +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 = ScheduledInterviewEndpointRequest.Builder.class) +public final class ScheduledInterviewEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final ScheduledInterviewRequest model; + + private final String remoteUserId; + + private final Map additionalProperties; + + private ScheduledInterviewEndpointRequest( + Optional isDebugMode, + Optional runAsync, + ScheduledInterviewRequest model, + String remoteUserId, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.remoteUserId = remoteUserId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public ScheduledInterviewRequest getModel() { + return model; + } + + @JsonProperty("remote_user_id") + public String getRemoteUserId() { + return remoteUserId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScheduledInterviewEndpointRequest && equalTo((ScheduledInterviewEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ScheduledInterviewEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) + && runAsync.equals(other.runAsync) + && model.equals(other.model) + && remoteUserId.equals(other.remoteUserId); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model, this.remoteUserId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + RemoteUserIdStage model(@NotNull ScheduledInterviewRequest model); + + Builder from(ScheduledInterviewEndpointRequest other); + } + + public interface RemoteUserIdStage { + _FinalStage remoteUserId(@NotNull String remoteUserId); + } + + public interface _FinalStage { + ScheduledInterviewEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, RemoteUserIdStage, _FinalStage { + private ScheduledInterviewRequest model; + + private String remoteUserId; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(ScheduledInterviewEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + remoteUserId(other.getRemoteUserId()); + return this; + } + + @Override + @JsonSetter("model") + public RemoteUserIdStage model(@NotNull ScheduledInterviewRequest model) { + this.model = model; + return this; + } + + @Override + @JsonSetter("remote_user_id") + public _FinalStage remoteUserId(@NotNull String remoteUserId) { + this.remoteUserId = remoteUserId; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public ScheduledInterviewEndpointRequest build() { + return new ScheduledInterviewEndpointRequest( + isDebugMode, runAsync, model, remoteUserId, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/interviews/types/InterviewsListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/ats/interviews/types/InterviewsListRequestExpand.java new file mode 100644 index 000000000..3bec2dd57 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/interviews/types/InterviewsListRequestExpand.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/interviews/types/InterviewsRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/ats/interviews/types/InterviewsRetrieveRequestExpand.java new file mode 100644 index 000000000..1b71cf3da --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/interviews/types/InterviewsRetrieveRequestExpand.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/issues/IssuesClient.java b/src/main/java/com/merge/legacy/api/resources/ats/issues/IssuesClient.java new file mode 100644 index 000000000..9d7867a02 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/issues/IssuesClient.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.issues; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.issues.requests.IssuesListRequest; +import com.merge.legacy.api.resources.ats.types.Issue; +import com.merge.legacy.api.resources.ats.types.PaginatedIssueList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/issues/requests/IssuesListRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/issues/requests/IssuesListRequest.java new file mode 100644 index 000000000..6c8db5579 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/issues/requests/IssuesListRequest.java @@ -0,0 +1,471 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.issues.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ats/issues/types/IssuesListRequestStatus.java b/src/main/java/com/merge/legacy/api/resources/ats/issues/types/IssuesListRequestStatus.java new file mode 100644 index 000000000..dfb86910d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/issues/types/IssuesListRequestStatus.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/jobinterviewstages/JobInterviewStagesClient.java b/src/main/java/com/merge/legacy/api/resources/ats/jobinterviewstages/JobInterviewStagesClient.java new file mode 100644 index 000000000..0ba2cdf2d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/jobinterviewstages/JobInterviewStagesClient.java @@ -0,0 +1,167 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.jobinterviewstages; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.jobinterviewstages.requests.JobInterviewStagesListRequest; +import com.merge.legacy.api.resources.ats.jobinterviewstages.requests.JobInterviewStagesRetrieveRequest; +import com.merge.legacy.api.resources.ats.types.JobInterviewStage; +import com.merge.legacy.api.resources.ats.types.PaginatedJobInterviewStageList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/jobinterviewstages/requests/JobInterviewStagesListRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/jobinterviewstages/requests/JobInterviewStagesListRequest.java new file mode 100644 index 000000000..0443c1433 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/jobinterviewstages/requests/JobInterviewStagesListRequest.java @@ -0,0 +1,417 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.jobinterviewstages.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = JobInterviewStagesListRequest.Builder.class) +public final class JobInterviewStagesListRequest { + 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 jobId; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private JobInterviewStagesListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional jobId, + 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.jobId = jobId; + 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, will only return interview stages for this job. + */ + @JsonProperty("job_id") + public Optional getJobId() { + return jobId; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JobInterviewStagesListRequest && equalTo((JobInterviewStagesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(JobInterviewStagesListRequest 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) + && jobId.equals(other.jobId) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.jobId, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @Override + 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 jobId = 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(JobInterviewStagesListRequest other) { + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + expand(other.getExpand()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + jobId(other.getJobId()); + 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 = "job_id", nulls = Nulls.SKIP) + public Builder jobId(Optional jobId) { + this.jobId = jobId; + return this; + } + + public Builder jobId(String jobId) { + this.jobId = Optional.ofNullable(jobId); + 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 JobInterviewStagesListRequest build() { + return new JobInterviewStagesListRequest( + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + jobId, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/jobinterviewstages/requests/JobInterviewStagesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/jobinterviewstages/requests/JobInterviewStagesRetrieveRequest.java new file mode 100644 index 000000000..098213009 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/jobinterviewstages/requests/JobInterviewStagesRetrieveRequest.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.jobinterviewstages.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/ats/jobpostings/JobPostingsClient.java b/src/main/java/com/merge/legacy/api/resources/ats/jobpostings/JobPostingsClient.java new file mode 100644 index 000000000..6cf4c3637 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/jobpostings/JobPostingsClient.java @@ -0,0 +1,166 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.jobpostings; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.jobpostings.requests.JobPostingsListRequest; +import com.merge.legacy.api.resources.ats.jobpostings.requests.JobPostingsRetrieveRequest; +import com.merge.legacy.api.resources.ats.types.JobPosting; +import com.merge.legacy.api.resources.ats.types.PaginatedJobPostingList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/jobpostings/requests/JobPostingsListRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/jobpostings/requests/JobPostingsListRequest.java new file mode 100644 index 000000000..c087c748f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/jobpostings/requests/JobPostingsListRequest.java @@ -0,0 +1,425 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.jobpostings.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ats.jobpostings.types.JobPostingsListRequestStatus; +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 = JobPostingsListRequest.Builder.class) +public final class JobPostingsListRequest { + 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 Optional status; + + private final Map additionalProperties; + + private JobPostingsListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Optional status, + 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.status = status; + 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; + } + + /** + * @return If provided, will only return Job Postings with this status. Options: ('PUBLISHED', 'CLOSED', 'DRAFT', 'INTERNAL', 'PENDING') + *
    + *
  • PUBLISHED - PUBLISHED
  • + *
  • CLOSED - CLOSED
  • + *
  • DRAFT - DRAFT
  • + *
  • INTERNAL - INTERNAL
  • + *
  • PENDING - PENDING
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JobPostingsListRequest && equalTo((JobPostingsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(JobPostingsListRequest 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) + && status.equals(other.status); + } + + @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, + this.status); + } + + @Override + 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(); + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(JobPostingsListRequest 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()); + status(other.getStatus()); + 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; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(JobPostingsListRequestStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + public JobPostingsListRequest build() { + return new JobPostingsListRequest( + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + status, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/jobpostings/requests/JobPostingsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/jobpostings/requests/JobPostingsRetrieveRequest.java new file mode 100644 index 000000000..b0349fce8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/jobpostings/requests/JobPostingsRetrieveRequest.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.jobpostings.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/ats/jobpostings/types/JobPostingsListRequestStatus.java b/src/main/java/com/merge/legacy/api/resources/ats/jobpostings/types/JobPostingsListRequestStatus.java new file mode 100644 index 000000000..80578e291 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/jobpostings/types/JobPostingsListRequestStatus.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.jobpostings.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum JobPostingsListRequestStatus { + CLOSED("CLOSED"), + + DRAFT("DRAFT"), + + INTERNAL("INTERNAL"), + + PENDING("PENDING"), + + PUBLISHED("PUBLISHED"); + + private final String value; + + JobPostingsListRequestStatus(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/jobs/JobsClient.java b/src/main/java/com/merge/legacy/api/resources/ats/jobs/JobsClient.java new file mode 100644 index 000000000..6448f1ab0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/jobs/JobsClient.java @@ -0,0 +1,262 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.jobs; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.jobs.requests.JobsListRequest; +import com.merge.legacy.api.resources.ats.jobs.requests.JobsRetrieveRequest; +import com.merge.legacy.api.resources.ats.jobs.requests.JobsScreeningQuestionsListRequest; +import com.merge.legacy.api.resources.ats.types.Job; +import com.merge.legacy.api.resources.ats.types.PaginatedJobList; +import com.merge.legacy.api.resources.ats.types.PaginatedScreeningQuestionList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/jobs/requests/JobsListRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/jobs/requests/JobsListRequest.java new file mode 100644 index 000000000..3b4f1500d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/jobs/requests/JobsListRequest.java @@ -0,0 +1,542 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.jobs.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ats.jobs.types.JobsListRequestExpand; +import com.merge.legacy.api.resources.ats.jobs.types.JobsListRequestStatus; +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 = JobsListRequest.Builder.class) +public final class JobsListRequest { + private final Optional code; + + 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 offices; + + 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 JobsListRequest( + Optional code, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional offices, + Optional pageSize, + Optional remoteFields, + Optional remoteId, + Optional showEnumOrigins, + Optional status, + Map additionalProperties) { + this.code = code; + 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.offices = offices; + this.pageSize = pageSize; + this.remoteFields = remoteFields; + this.remoteId = remoteId; + this.showEnumOrigins = showEnumOrigins; + this.status = status; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return jobs with this code. + */ + @JsonProperty("code") + public Optional getCode() { + return code; + } + + /** + * @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 If provided, will only return jobs for this office; multiple offices can be separated by commas. + */ + @JsonProperty("offices") + public Optional getOffices() { + return offices; + } + + /** + * @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 jobs with this status. Options: ('OPEN', 'CLOSED', 'DRAFT', 'ARCHIVED', 'PENDING') + *
    + *
  • OPEN - OPEN
  • + *
  • CLOSED - CLOSED
  • + *
  • DRAFT - DRAFT
  • + *
  • ARCHIVED - ARCHIVED
  • + *
  • PENDING - PENDING
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JobsListRequest && equalTo((JobsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(JobsListRequest other) { + return 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) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && offices.equals(other.offices) + && pageSize.equals(other.pageSize) + && remoteFields.equals(other.remoteFields) + && remoteId.equals(other.remoteId) + && showEnumOrigins.equals(other.showEnumOrigins) + && status.equals(other.status); + } + + @Override + public int hashCode() { + return Objects.hash( + this.code, + this.createdAfter, + this.createdBefore, + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.offices, + this.pageSize, + this.remoteFields, + this.remoteId, + this.showEnumOrigins, + this.status); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional code = 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 offices = 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(JobsListRequest other) { + code(other.getCode()); + 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()); + offices(other.getOffices()); + pageSize(other.getPageSize()); + remoteFields(other.getRemoteFields()); + remoteId(other.getRemoteId()); + showEnumOrigins(other.getShowEnumOrigins()); + status(other.getStatus()); + return this; + } + + @JsonSetter(value = "code", nulls = Nulls.SKIP) + public Builder code(Optional code) { + this.code = code; + return this; + } + + public Builder code(String code) { + this.code = Optional.ofNullable(code); + 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(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; + 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 = "offices", nulls = Nulls.SKIP) + public Builder offices(Optional offices) { + this.offices = offices; + return this; + } + + public Builder offices(String offices) { + this.offices = Optional.ofNullable(offices); + 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(JobsListRequestStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + public JobsListRequest build() { + return new JobsListRequest( + code, + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + offices, + pageSize, + remoteFields, + remoteId, + showEnumOrigins, + status, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/jobs/requests/JobsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/jobs/requests/JobsRetrieveRequest.java new file mode 100644 index 000000000..0652a761c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/jobs/requests/JobsRetrieveRequest.java @@ -0,0 +1,177 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.jobs.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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/legacy/api/resources/ats/jobs/requests/JobsScreeningQuestionsListRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/jobs/requests/JobsScreeningQuestionsListRequest.java new file mode 100644 index 000000000..c4cedbc28 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/jobs/requests/JobsScreeningQuestionsListRequest.java @@ -0,0 +1,243 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.jobs.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ats.jobs.types.JobsScreeningQuestionsListRequestExpand; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@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 includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional pageSize; + + private final Map additionalProperties; + + private JobsScreeningQuestionsListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JobsScreeningQuestionsListRequest && equalTo((JobsScreeningQuestionsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(JobsScreeningQuestionsListRequest 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.pageSize); + } + + @Override + 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(JobsScreeningQuestionsListRequest 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(JobsScreeningQuestionsListRequestExpand 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 JobsScreeningQuestionsListRequest build() { + return new JobsScreeningQuestionsListRequest( + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/jobs/types/JobsListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/ats/jobs/types/JobsListRequestExpand.java new file mode 100644 index 000000000..b7b67f363 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/jobs/types/JobsListRequestExpand.java @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/jobs/types/JobsListRequestStatus.java b/src/main/java/com/merge/legacy/api/resources/ats/jobs/types/JobsListRequestStatus.java new file mode 100644 index 000000000..6eb5dadd3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/jobs/types/JobsListRequestStatus.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.jobs.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum JobsListRequestStatus { + ARCHIVED("ARCHIVED"), + + CLOSED("CLOSED"), + + DRAFT("DRAFT"), + + OPEN("OPEN"), + + PENDING("PENDING"); + + private final String value; + + JobsListRequestStatus(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/jobs/types/JobsRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/ats/jobs/types/JobsRetrieveRequestExpand.java new file mode 100644 index 000000000..ba0853846 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/jobs/types/JobsRetrieveRequestExpand.java @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/jobs/types/JobsScreeningQuestionsListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/ats/jobs/types/JobsScreeningQuestionsListRequestExpand.java new file mode 100644 index 000000000..425e347b7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/jobs/types/JobsScreeningQuestionsListRequestExpand.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/linkedaccounts/LinkedAccountsClient.java b/src/main/java/com/merge/legacy/api/resources/ats/linkedaccounts/LinkedAccountsClient.java new file mode 100644 index 000000000..7a25f72e0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/linkedaccounts/LinkedAccountsClient.java @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.linkedaccounts; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.linkedaccounts.requests.LinkedAccountsListRequest; +import com.merge.legacy.api.resources.ats.types.PaginatedAccountDetailsAndActionsList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/linkedaccounts/requests/LinkedAccountsListRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/linkedaccounts/requests/LinkedAccountsListRequest.java new file mode 100644 index 000000000..e82fedb7e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/linkedaccounts/requests/LinkedAccountsListRequest.java @@ -0,0 +1,452 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.linkedaccounts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ats/linkedaccounts/types/LinkedAccountsListRequestCategory.java b/src/main/java/com/merge/legacy/api/resources/ats/linkedaccounts/types/LinkedAccountsListRequestCategory.java new file mode 100644 index 000000000..2ef623e60 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/linkedaccounts/types/LinkedAccountsListRequestCategory.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/linktoken/LinkTokenClient.java b/src/main/java/com/merge/legacy/api/resources/ats/linktoken/LinkTokenClient.java new file mode 100644 index 000000000..073490b9b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/linktoken/LinkTokenClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.linktoken; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.linktoken.requests.EndUserDetailsRequest; +import com.merge.legacy.api.resources.ats.types.LinkToken; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/linktoken/requests/EndUserDetailsRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/linktoken/requests/EndUserDetailsRequest.java new file mode 100644 index 000000000..0a5fa3a5a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/linktoken/requests/EndUserDetailsRequest.java @@ -0,0 +1,600 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.linktoken.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ats.types.CategoriesEnum; +import com.merge.legacy.api.resources.ats.types.CommonModelScopesBodyRequest; +import com.merge.legacy.api.resources.ats.types.IndividualCommonModelScopeDeserializerRequest; +import com.merge.legacy.api.resources.ats.types.LanguageEnum; +import java.util.*; +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; + } + + @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); + } + + @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); + } + + @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() {} + + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @Override + public _FinalStage integrationSpecificConfig(Map integrationSpecificConfig) { + this.integrationSpecificConfig = Optional.ofNullable(integrationSpecificConfig); + return this; + } + + @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. + */ + @Override + public _FinalStage areSyncsDisabled(Boolean areSyncsDisabled) { + this.areSyncsDisabled = Optional.ofNullable(areSyncsDisabled); + return this; + } + + @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. + */ + @Override + public _FinalStage language(LanguageEnum language) { + this.language = Optional.ofNullable(language); + return this; + } + + @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. + */ + @Override + public _FinalStage categoryCommonModelScopes( + Map>> categoryCommonModelScopes) { + this.categoryCommonModelScopes = Optional.ofNullable(categoryCommonModelScopes); + return this; + } + + @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. + */ + @Override + public _FinalStage commonModels(List commonModels) { + this.commonModels = Optional.ofNullable(commonModels); + return this; + } + + @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. + */ + @Override + public _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink) { + this.hideAdminMagicLink = Optional.ofNullable(hideAdminMagicLink); + return this; + } + + @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. + */ + @Override + public _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl) { + this.shouldCreateMagicLinkUrl = Optional.ofNullable(shouldCreateMagicLinkUrl); + return this; + } + + @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. + */ + @Override + public _FinalStage linkExpiryMins(Integer linkExpiryMins) { + this.linkExpiryMins = Optional.ofNullable(linkExpiryMins); + return this; + } + + @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. + */ + @Override + public _FinalStage integration(String integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @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. + */ + @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. + */ + @Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + this.categories.addAll(categories); + return this; + } + + @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/legacy/api/resources/ats/offers/OffersClient.java b/src/main/java/com/merge/legacy/api/resources/ats/offers/OffersClient.java new file mode 100644 index 000000000..a56a585dd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/offers/OffersClient.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.offers; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.offers.requests.OffersListRequest; +import com.merge.legacy.api.resources.ats.offers.requests.OffersRetrieveRequest; +import com.merge.legacy.api.resources.ats.types.Offer; +import com.merge.legacy.api.resources.ats.types.PaginatedOfferList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/offers/requests/OffersListRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/offers/requests/OffersListRequest.java new file mode 100644 index 000000000..58d13a9ef --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/offers/requests/OffersListRequest.java @@ -0,0 +1,505 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.offers.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ats.offers.types.OffersListRequestExpand; +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 = OffersListRequest.Builder.class) +public final class OffersListRequest { + private final Optional applicationId; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional creatorId; + + 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 OffersListRequest( + Optional applicationId, + Optional createdAfter, + Optional createdBefore, + Optional creatorId, + 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.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; + 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 offers for this application. + */ + @JsonProperty("application_id") + public Optional getApplicationId() { + return applicationId; + } + + /** + * @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 If provided, will only return offers created by this user. + */ + @JsonProperty("creator_id") + public Optional getCreatorId() { + return creatorId; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OffersListRequest && equalTo((OffersListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OffersListRequest other) { + return 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) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteFields.equals(other.remoteFields) + && remoteId.equals(other.remoteId) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @Override + public int hashCode() { + return Objects.hash( + this.applicationId, + this.createdAfter, + this.createdBefore, + this.creatorId, + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteFields, + this.remoteId, + this.showEnumOrigins); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional applicationId = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional creatorId = 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(OffersListRequest other) { + 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()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteFields(other.getRemoteFields()); + remoteId(other.getRemoteId()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + @JsonSetter(value = "application_id", nulls = Nulls.SKIP) + public Builder applicationId(Optional applicationId) { + this.applicationId = applicationId; + return this; + } + + public Builder applicationId(String applicationId) { + this.applicationId = Optional.ofNullable(applicationId); + 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 = "creator_id", nulls = Nulls.SKIP) + public Builder creatorId(Optional creatorId) { + this.creatorId = creatorId; + return this; + } + + public Builder creatorId(String creatorId) { + this.creatorId = Optional.ofNullable(creatorId); + 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(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; + 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 OffersListRequest build() { + return new OffersListRequest( + applicationId, + createdAfter, + createdBefore, + creatorId, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteFields, + remoteId, + showEnumOrigins, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/offers/requests/OffersRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/offers/requests/OffersRetrieveRequest.java new file mode 100644 index 000000000..71f2403d7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/offers/requests/OffersRetrieveRequest.java @@ -0,0 +1,177 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.offers.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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/legacy/api/resources/ats/offers/types/OffersListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/ats/offers/types/OffersListRequestExpand.java new file mode 100644 index 000000000..fd06bc6b4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/offers/types/OffersListRequestExpand.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/offers/types/OffersRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/ats/offers/types/OffersRetrieveRequestExpand.java new file mode 100644 index 000000000..e5d593a6e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/offers/types/OffersRetrieveRequestExpand.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/offices/OfficesClient.java b/src/main/java/com/merge/legacy/api/resources/ats/offices/OfficesClient.java new file mode 100644 index 000000000..1445a00d9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/offices/OfficesClient.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.offices; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.offices.requests.OfficesListRequest; +import com.merge.legacy.api.resources.ats.offices.requests.OfficesRetrieveRequest; +import com.merge.legacy.api.resources.ats.types.Office; +import com.merge.legacy.api.resources.ats.types.PaginatedOfficeList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/offices/requests/OfficesListRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/offices/requests/OfficesListRequest.java new file mode 100644 index 000000000..04986ffde --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/offices/requests/OfficesListRequest.java @@ -0,0 +1,359 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.offices.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = OfficesListRequest.Builder.class) +public final class OfficesListRequest { + 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 OfficesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OfficesListRequest && equalTo((OfficesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OfficesListRequest 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); + } + + @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); + } + + @Override + 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(OfficesListRequest 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 OfficesListRequest build() { + return new OfficesListRequest( + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/offices/requests/OfficesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/offices/requests/OfficesRetrieveRequest.java new file mode 100644 index 000000000..8bd51d57b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/offices/requests/OfficesRetrieveRequest.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.offices.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/ats/passthrough/PassthroughClient.java b/src/main/java/com/merge/legacy/api/resources/ats/passthrough/PassthroughClient.java new file mode 100644 index 000000000..cba8c3a18 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/passthrough/PassthroughClient.java @@ -0,0 +1,66 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.passthrough; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.types.DataPassthroughRequest; +import com.merge.legacy.api.resources.ats.types.RemoteResponse; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/regeneratekey/RegenerateKeyClient.java b/src/main/java/com/merge/legacy/api/resources/ats/regeneratekey/RegenerateKeyClient.java new file mode 100644 index 000000000..98456ce97 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/regeneratekey/RegenerateKeyClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.regeneratekey; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.regeneratekey.requests.RemoteKeyForRegenerationRequest; +import com.merge.legacy.api.resources.ats.types.RemoteKey; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/regeneratekey/requests/RemoteKeyForRegenerationRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/regeneratekey/requests/RemoteKeyForRegenerationRequest.java new file mode 100644 index 000000000..e03604d93 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/regeneratekey/requests/RemoteKeyForRegenerationRequest.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.regeneratekey.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + public RemoteKeyForRegenerationRequest build() { + return new RemoteKeyForRegenerationRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/rejectreasons/RejectReasonsClient.java b/src/main/java/com/merge/legacy/api/resources/ats/rejectreasons/RejectReasonsClient.java new file mode 100644 index 000000000..f58d1aaa6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/rejectreasons/RejectReasonsClient.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.rejectreasons; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.rejectreasons.requests.RejectReasonsListRequest; +import com.merge.legacy.api.resources.ats.rejectreasons.requests.RejectReasonsRetrieveRequest; +import com.merge.legacy.api.resources.ats.types.PaginatedRejectReasonList; +import com.merge.legacy.api.resources.ats.types.RejectReason; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/rejectreasons/requests/RejectReasonsListRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/rejectreasons/requests/RejectReasonsListRequest.java new file mode 100644 index 000000000..bae9517eb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/rejectreasons/requests/RejectReasonsListRequest.java @@ -0,0 +1,359 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.rejectreasons.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = RejectReasonsListRequest.Builder.class) +public final class RejectReasonsListRequest { + 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 RejectReasonsListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RejectReasonsListRequest && equalTo((RejectReasonsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RejectReasonsListRequest 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); + } + + @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); + } + + @Override + 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(RejectReasonsListRequest 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 RejectReasonsListRequest build() { + return new RejectReasonsListRequest( + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/rejectreasons/requests/RejectReasonsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/rejectreasons/requests/RejectReasonsRetrieveRequest.java new file mode 100644 index 000000000..793beb222 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/rejectreasons/requests/RejectReasonsRetrieveRequest.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.rejectreasons.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/ats/scopes/ScopesClient.java b/src/main/java/com/merge/legacy/api/resources/ats/scopes/ScopesClient.java new file mode 100644 index 000000000..413a6d382 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/scopes/ScopesClient.java @@ -0,0 +1,150 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.scopes; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.scopes.requests.LinkedAccountCommonModelScopeDeserializerRequest; +import com.merge.legacy.api.resources.ats.types.CommonModelScopeApi; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..733e4b200 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.scopes.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ats.types.IndividualCommonModelScopeDeserializerRequest; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @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/legacy/api/resources/ats/scorecards/ScorecardsClient.java b/src/main/java/com/merge/legacy/api/resources/ats/scorecards/ScorecardsClient.java new file mode 100644 index 000000000..3e3860b13 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/scorecards/ScorecardsClient.java @@ -0,0 +1,188 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.scorecards; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.scorecards.requests.ScorecardsListRequest; +import com.merge.legacy.api.resources.ats.scorecards.requests.ScorecardsRetrieveRequest; +import com.merge.legacy.api.resources.ats.types.PaginatedScorecardList; +import com.merge.legacy.api.resources.ats.types.Scorecard; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/scorecards/requests/ScorecardsListRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/scorecards/requests/ScorecardsListRequest.java new file mode 100644 index 000000000..5964c3a4a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/scorecards/requests/ScorecardsListRequest.java @@ -0,0 +1,534 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.scorecards.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ats.scorecards.types.ScorecardsListRequestExpand; +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 = ScorecardsListRequest.Builder.class) +public final class ScorecardsListRequest { + private final Optional applicationId; + + 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 interviewId; + + private final Optional interviewerId; + + 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 ScorecardsListRequest( + Optional applicationId, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional interviewId, + Optional interviewerId, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteFields, + Optional remoteId, + Optional showEnumOrigins, + Map additionalProperties) { + this.applicationId = applicationId; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.expand = expand; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.interviewId = interviewId; + this.interviewerId = interviewerId; + 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 scorecards for this application. + */ + @JsonProperty("application_id") + public Optional getApplicationId() { + return applicationId; + } + + /** + * @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, will only return scorecards for this interview. + */ + @JsonProperty("interview_id") + public Optional getInterviewId() { + return interviewId; + } + + /** + * @return If provided, will only return scorecards for this interviewer. + */ + @JsonProperty("interviewer_id") + public Optional getInterviewerId() { + return interviewerId; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScorecardsListRequest && equalTo((ScorecardsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ScorecardsListRequest other) { + return 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) + && interviewId.equals(other.interviewId) + && interviewerId.equals(other.interviewerId) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteFields.equals(other.remoteFields) + && remoteId.equals(other.remoteId) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @Override + public int hashCode() { + return Objects.hash( + this.applicationId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.interviewId, + this.interviewerId, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteFields, + this.remoteId, + this.showEnumOrigins); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional applicationId = 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 interviewId = Optional.empty(); + + private Optional interviewerId = 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(ScorecardsListRequest other) { + applicationId(other.getApplicationId()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + expand(other.getExpand()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + interviewId(other.getInterviewId()); + interviewerId(other.getInterviewerId()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteFields(other.getRemoteFields()); + remoteId(other.getRemoteId()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + @JsonSetter(value = "application_id", nulls = Nulls.SKIP) + public Builder applicationId(Optional applicationId) { + this.applicationId = applicationId; + return this; + } + + public Builder applicationId(String applicationId) { + this.applicationId = Optional.ofNullable(applicationId); + 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(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; + 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 = "interview_id", nulls = Nulls.SKIP) + public Builder interviewId(Optional interviewId) { + this.interviewId = interviewId; + return this; + } + + public Builder interviewId(String interviewId) { + this.interviewId = Optional.ofNullable(interviewId); + return this; + } + + @JsonSetter(value = "interviewer_id", nulls = Nulls.SKIP) + public Builder interviewerId(Optional interviewerId) { + this.interviewerId = interviewerId; + return this; + } + + public Builder interviewerId(String interviewerId) { + this.interviewerId = Optional.ofNullable(interviewerId); + 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 ScorecardsListRequest build() { + return new ScorecardsListRequest( + applicationId, + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + interviewId, + interviewerId, + modifiedAfter, + modifiedBefore, + pageSize, + remoteFields, + remoteId, + showEnumOrigins, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/scorecards/requests/ScorecardsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/scorecards/requests/ScorecardsRetrieveRequest.java new file mode 100644 index 000000000..f0ecfc023 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/scorecards/requests/ScorecardsRetrieveRequest.java @@ -0,0 +1,177 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.scorecards.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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/legacy/api/resources/ats/scorecards/types/ScorecardsListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/ats/scorecards/types/ScorecardsListRequestExpand.java new file mode 100644 index 000000000..28106d78f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/scorecards/types/ScorecardsListRequestExpand.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/scorecards/types/ScorecardsRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/ats/scorecards/types/ScorecardsRetrieveRequestExpand.java new file mode 100644 index 000000000..8088518a8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/scorecards/types/ScorecardsRetrieveRequestExpand.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/syncstatus/SyncStatusClient.java b/src/main/java/com/merge/legacy/api/resources/ats/syncstatus/SyncStatusClient.java new file mode 100644 index 000000000..93d9c54c4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/syncstatus/SyncStatusClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.syncstatus; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.syncstatus.requests.SyncStatusListRequest; +import com.merge.legacy.api.resources.ats.types.PaginatedSyncStatusList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/syncstatus/requests/SyncStatusListRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/syncstatus/requests/SyncStatusListRequest.java new file mode 100644 index 000000000..afb7a0423 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/syncstatus/requests/SyncStatusListRequest.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.syncstatus.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.cursor, this.pageSize); + } + + @Override + 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/legacy/api/resources/ats/tags/TagsClient.java b/src/main/java/com/merge/legacy/api/resources/ats/tags/TagsClient.java new file mode 100644 index 000000000..082471207 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/tags/TagsClient.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.tags; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.tags.requests.TagsListRequest; +import com.merge.legacy.api.resources.ats.types.PaginatedTagList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/tags/requests/TagsListRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/tags/requests/TagsListRequest.java new file mode 100644 index 000000000..81849afff --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/tags/requests/TagsListRequest.java @@ -0,0 +1,359 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.tags.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ats/types/AccessRoleEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/AccessRoleEnum.java new file mode 100644 index 000000000..ebfd7c90f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/AccessRoleEnum.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AccessRoleEnum { + SUPER_ADMIN("SUPER_ADMIN"), + + ADMIN("ADMIN"), + + TEAM_MEMBER("TEAM_MEMBER"), + + LIMITED_TEAM_MEMBER("LIMITED_TEAM_MEMBER"), + + INTERVIEWER("INTERVIEWER"); + + private final String value; + + AccessRoleEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/AccountDetails.java b/src/main/java/com/merge/legacy/api/resources/ats/types/AccountDetails.java new file mode 100644 index 000000000..861a7f139 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/AccountDetails.java @@ -0,0 +1,387 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ats/types/AccountDetailsAndActions.java b/src/main/java/com/merge/legacy/api/resources/ats/types/AccountDetailsAndActions.java new file mode 100644 index 000000000..264586b9a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/AccountDetailsAndActions.java @@ -0,0 +1,474 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("id") + public StatusStage id(@NotNull String id) { + this.id = id; + return this; + } + + @Override + @JsonSetter("status") + public EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status) { + this.status = status; + return this; + } + + @Override + @JsonSetter("end_user_organization_name") + public EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + @Override + @JsonSetter("end_user_email_address") + public WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + @Override + @JsonSetter("webhook_listener_url") + public AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl) { + this.webhookListenerUrl = webhookListenerUrl; + return this; + } + + @Override + @JsonSetter("account_type") + public CompletedAtStage accountType(@NotNull String accountType) { + this.accountType = accountType; + return this; + } + + @Override + @JsonSetter("completed_at") + public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { + this.completedAt = completedAt; + return this; + } + + @Override + public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @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. + */ + @Override + public _FinalStage isDuplicate(Boolean isDuplicate) { + this.isDuplicate = Optional.ofNullable(isDuplicate); + return this; + } + + @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. + */ + @Override + public _FinalStage subdomain(String subdomain) { + this.subdomain = Optional.ofNullable(subdomain); + return this; + } + + @Override + @JsonSetter(value = "subdomain", nulls = Nulls.SKIP) + public _FinalStage subdomain(Optional subdomain) { + this.subdomain = subdomain; + return this; + } + + @Override + public _FinalStage endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @Override + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public _FinalStage endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + @Override + public _FinalStage statusDetail(String statusDetail) { + this.statusDetail = Optional.ofNullable(statusDetail); + return this; + } + + @Override + @JsonSetter(value = "status_detail", nulls = Nulls.SKIP) + public _FinalStage statusDetail(Optional statusDetail) { + this.statusDetail = statusDetail; + return this; + } + + @Override + public _FinalStage category(CategoryEnum category) { + this.category = Optional.ofNullable(category); + return this; + } + + @Override + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public _FinalStage category(Optional category) { + this.category = category; + return this; + } + + @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/legacy/api/resources/ats/types/AccountDetailsAndActionsIntegration.java b/src/main/java/com/merge/legacy/api/resources/ats/types/AccountDetailsAndActionsIntegration.java new file mode 100644 index 000000000..e43384f74 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/AccountDetailsAndActionsIntegration.java @@ -0,0 +1,317 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.categories, + this.image, + this.squareImage, + this.color, + this.slug, + this.passthroughAvailable, + this.availableModelOperations); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("name") + public ColorStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + @JsonSetter("color") + public SlugStage color(@NotNull String color) { + this.color = color; + return this; + } + + @Override + @JsonSetter("slug") + public PassthroughAvailableStage slug(@NotNull String slug) { + this.slug = slug; + return this; + } + + @Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @Override + @JsonSetter(value = "square_image", nulls = Nulls.SKIP) + public _FinalStage squareImage(Optional squareImage) { + this.squareImage = squareImage; + return this; + } + + @Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @Override + @JsonSetter(value = "image", nulls = Nulls.SKIP) + public _FinalStage image(Optional image) { + this.image = image; + return this; + } + + @Override + public _FinalStage addAllCategories(List categories) { + this.categories.addAll(categories); + return this; + } + + @Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + this.categories.addAll(categories); + return this; + } + + @Override + public AccountDetailsAndActionsIntegration build() { + return new AccountDetailsAndActionsIntegration( + name, + categories, + image, + squareImage, + color, + slug, + passthroughAvailable, + availableModelOperations, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/AccountDetailsAndActionsStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/AccountDetailsAndActionsStatusEnum.java new file mode 100644 index 000000000..8f12419b1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/AccountDetailsAndActionsStatusEnum.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/AccountIntegration.java b/src/main/java/com/merge/legacy/api/resources/ats/types/AccountIntegration.java new file mode 100644 index 000000000..9e2cfcf72 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/AccountIntegration.java @@ -0,0 +1,453 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @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); + } + + @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() {} + + @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. + */ + @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. + */ + @Override + public _FinalStage categoryBetaStatus(Map categoryBetaStatus) { + this.categoryBetaStatus = Optional.ofNullable(categoryBetaStatus); + return this; + } + + @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. + */ + @Override + public _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl) { + this.webhookSetupGuideUrl = Optional.ofNullable(webhookSetupGuideUrl); + return this; + } + + @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. + */ + @Override + public _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = Optional.ofNullable(apiEndpointsToDocumentationUrls); + return this; + } + + @Override + @JsonSetter(value = "api_endpoints_to_documentation_urls", nulls = Nulls.SKIP) + public _FinalStage apiEndpointsToDocumentationUrls( + Optional> apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; + return this; + } + + @Override + public _FinalStage slug(String slug) { + this.slug = Optional.ofNullable(slug); + return this; + } + + @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. + */ + @Override + public _FinalStage color(String color) { + this.color = Optional.ofNullable(color); + return this; + } + + @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. + */ + @Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @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. + */ + @Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @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. + */ + @Override + public _FinalStage categories(List categories) { + this.categories = Optional.ofNullable(categories); + return this; + } + + @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. + */ + @Override + public _FinalStage abbreviatedName(String abbreviatedName) { + this.abbreviatedName = Optional.ofNullable(abbreviatedName); + return this; + } + + @Override + @JsonSetter(value = "abbreviated_name", nulls = Nulls.SKIP) + public _FinalStage abbreviatedName(Optional abbreviatedName) { + this.abbreviatedName = abbreviatedName; + return this; + } + + @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/legacy/api/resources/ats/types/AccountToken.java b/src/main/java/com/merge/legacy/api/resources/ats/types/AccountToken.java new file mode 100644 index 000000000..599a2556a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/AccountToken.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.accountToken, this.integration); + } + + @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() {} + + @Override + public Builder from(AccountToken other) { + accountToken(other.getAccountToken()); + integration(other.getIntegration()); + return this; + } + + @Override + @JsonSetter("account_token") + public IntegrationStage accountToken(@NotNull String accountToken) { + this.accountToken = accountToken; + return this; + } + + @Override + @JsonSetter("integration") + public _FinalStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @Override + public AccountToken build() { + return new AccountToken(accountToken, integration, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/Activity.java b/src/main/java/com/merge/legacy/api/resources/ats/types/Activity.java new file mode 100644 index 000000000..ba35baa60 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/Activity.java @@ -0,0 +1,471 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Activity.Builder.class) +public final class Activity { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional user; + + private final Optional remoteCreatedAt; + + private final Optional activityType; + + private final Optional subject; + + private final Optional body; + + private final Optional visibility; + + private final Optional candidate; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Activity( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional user, + Optional remoteCreatedAt, + Optional activityType, + Optional subject, + Optional body, + Optional visibility, + Optional candidate, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.user = user; + this.remoteCreatedAt = remoteCreatedAt; + this.activityType = activityType; + this.subject = subject; + this.body = body; + this.visibility = visibility; + this.candidate = candidate; + 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 that performed the action. + */ + @JsonProperty("user") + public Optional getUser() { + return user; + } + + /** + * @return When the third party's activity was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return The activity's type. + *
    + *
  • NOTE - NOTE
  • + *
  • EMAIL - EMAIL
  • + *
  • OTHER - OTHER
  • + *
+ */ + @JsonProperty("activity_type") + public Optional getActivityType() { + return activityType; + } + + /** + * @return The activity's subject. + */ + @JsonProperty("subject") + public Optional getSubject() { + return subject; + } + + /** + * @return The activity's body. + */ + @JsonProperty("body") + public Optional getBody() { + return body; + } + + /** + * @return The activity's visibility. + *
    + *
  • ADMIN_ONLY - ADMIN_ONLY
  • + *
  • PUBLIC - PUBLIC
  • + *
  • PRIVATE - PRIVATE
  • + *
+ */ + @JsonProperty("visibility") + public Optional getVisibility() { + return visibility; + } + + @JsonProperty("candidate") + public Optional getCandidate() { + return candidate; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Activity && equalTo((Activity) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Activity other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && user.equals(other.user) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && activityType.equals(other.activityType) + && subject.equals(other.subject) + && body.equals(other.body) + && visibility.equals(other.visibility) + && candidate.equals(other.candidate) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.user, + this.remoteCreatedAt, + this.activityType, + this.subject, + this.body, + this.visibility, + this.candidate, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 user = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional activityType = Optional.empty(); + + private Optional subject = Optional.empty(); + + private Optional body = Optional.empty(); + + private Optional visibility = Optional.empty(); + + private Optional candidate = 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(Activity other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + user(other.getUser()); + remoteCreatedAt(other.getRemoteCreatedAt()); + activityType(other.getActivityType()); + subject(other.getSubject()); + body(other.getBody()); + visibility(other.getVisibility()); + candidate(other.getCandidate()); + 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 = "user", nulls = Nulls.SKIP) + public Builder user(Optional user) { + this.user = user; + return this; + } + + public Builder user(ActivityUser user) { + this.user = Optional.ofNullable(user); + 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 = "activity_type", nulls = Nulls.SKIP) + public Builder activityType(Optional activityType) { + this.activityType = activityType; + return this; + } + + public Builder activityType(ActivityActivityType activityType) { + this.activityType = Optional.ofNullable(activityType); + return this; + } + + @JsonSetter(value = "subject", nulls = Nulls.SKIP) + public Builder subject(Optional subject) { + this.subject = subject; + return this; + } + + public Builder subject(String subject) { + this.subject = Optional.ofNullable(subject); + return this; + } + + @JsonSetter(value = "body", nulls = Nulls.SKIP) + public Builder body(Optional body) { + this.body = body; + return this; + } + + public Builder body(String body) { + this.body = Optional.ofNullable(body); + return this; + } + + @JsonSetter(value = "visibility", nulls = Nulls.SKIP) + public Builder visibility(Optional visibility) { + this.visibility = visibility; + return this; + } + + public Builder visibility(ActivityVisibility visibility) { + this.visibility = Optional.ofNullable(visibility); + 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 = "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 Activity build() { + return new Activity( + id, + remoteId, + createdAt, + modifiedAt, + user, + remoteCreatedAt, + activityType, + subject, + body, + visibility, + candidate, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ActivityActivityType.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ActivityActivityType.java new file mode 100644 index 000000000..71344434e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ActivityActivityType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/ActivityRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ActivityRequest.java new file mode 100644 index 000000000..b695e460e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ActivityRequest.java @@ -0,0 +1,302 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = ActivityRequest.Builder.class) +public final class ActivityRequest { + private final Optional user; + + private final Optional activityType; + + private final Optional subject; + + private final Optional body; + + private final Optional visibility; + + private final Optional candidate; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private ActivityRequest( + Optional user, + Optional activityType, + Optional subject, + Optional body, + Optional visibility, + Optional candidate, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.user = user; + this.activityType = activityType; + this.subject = subject; + this.body = body; + this.visibility = visibility; + this.candidate = candidate; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The user that performed the action. + */ + @JsonProperty("user") + public Optional getUser() { + return user; + } + + /** + * @return The activity's type. + *
    + *
  • NOTE - NOTE
  • + *
  • EMAIL - EMAIL
  • + *
  • OTHER - OTHER
  • + *
+ */ + @JsonProperty("activity_type") + public Optional getActivityType() { + return activityType; + } + + /** + * @return The activity's subject. + */ + @JsonProperty("subject") + public Optional getSubject() { + return subject; + } + + /** + * @return The activity's body. + */ + @JsonProperty("body") + public Optional getBody() { + return body; + } + + /** + * @return The activity's visibility. + *
    + *
  • ADMIN_ONLY - ADMIN_ONLY
  • + *
  • PUBLIC - PUBLIC
  • + *
  • PRIVATE - PRIVATE
  • + *
+ */ + @JsonProperty("visibility") + public Optional getVisibility() { + return visibility; + } + + @JsonProperty("candidate") + public Optional getCandidate() { + return candidate; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActivityRequest && equalTo((ActivityRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActivityRequest other) { + return user.equals(other.user) + && activityType.equals(other.activityType) + && subject.equals(other.subject) + && body.equals(other.body) + && visibility.equals(other.visibility) + && candidate.equals(other.candidate) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @Override + public int hashCode() { + return Objects.hash( + this.user, + this.activityType, + this.subject, + this.body, + this.visibility, + this.candidate, + this.integrationParams, + this.linkedAccountParams); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional user = Optional.empty(); + + private Optional activityType = Optional.empty(); + + private Optional subject = Optional.empty(); + + private Optional body = Optional.empty(); + + private Optional visibility = Optional.empty(); + + private Optional candidate = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ActivityRequest other) { + user(other.getUser()); + activityType(other.getActivityType()); + subject(other.getSubject()); + body(other.getBody()); + visibility(other.getVisibility()); + candidate(other.getCandidate()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + return this; + } + + @JsonSetter(value = "user", nulls = Nulls.SKIP) + public Builder user(Optional user) { + this.user = user; + return this; + } + + public Builder user(ActivityRequestUser user) { + this.user = Optional.ofNullable(user); + return this; + } + + @JsonSetter(value = "activity_type", nulls = Nulls.SKIP) + public Builder activityType(Optional activityType) { + this.activityType = activityType; + return this; + } + + public Builder activityType(ActivityRequestActivityType activityType) { + this.activityType = Optional.ofNullable(activityType); + return this; + } + + @JsonSetter(value = "subject", nulls = Nulls.SKIP) + public Builder subject(Optional subject) { + this.subject = subject; + return this; + } + + public Builder subject(String subject) { + this.subject = Optional.ofNullable(subject); + return this; + } + + @JsonSetter(value = "body", nulls = Nulls.SKIP) + public Builder body(Optional body) { + this.body = body; + return this; + } + + public Builder body(String body) { + this.body = Optional.ofNullable(body); + return this; + } + + @JsonSetter(value = "visibility", nulls = Nulls.SKIP) + public Builder visibility(Optional visibility) { + this.visibility = visibility; + return this; + } + + public Builder visibility(ActivityRequestVisibility visibility) { + this.visibility = Optional.ofNullable(visibility); + 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 = "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 ActivityRequest build() { + return new ActivityRequest( + user, + activityType, + subject, + body, + visibility, + candidate, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ActivityRequestActivityType.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ActivityRequestActivityType.java new file mode 100644 index 000000000..1d8a6e338 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ActivityRequestActivityType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/ActivityRequestUser.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ActivityRequestUser.java new file mode 100644 index 000000000..bd619995d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ActivityRequestUser.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ActivityRequestUser.Deserializer.class) +public final class ActivityRequestUser { + private final Object value; + + private final int type; + + private ActivityRequestUser(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((RemoteUser) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActivityRequestUser && equalTo((ActivityRequestUser) other); + } + + private boolean equalTo(ActivityRequestUser other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ActivityRequestUser of(String value) { + return new ActivityRequestUser(value, 0); + } + + public static ActivityRequestUser of(RemoteUser value) { + return new ActivityRequestUser(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(RemoteUser value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ActivityRequestUser.class); + } + + @Override + public ActivityRequestUser 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, RemoteUser.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ActivityRequestVisibility.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ActivityRequestVisibility.java new file mode 100644 index 000000000..3d32fc288 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ActivityRequestVisibility.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/ActivityResponse.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ActivityResponse.java new file mode 100644 index 000000000..646cc808e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ActivityResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ActivityResponse.Builder.class) +public final class ActivityResponse { + private final Activity model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private ActivityResponse( + Activity 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 Activity getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActivityResponse && equalTo((ActivityResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActivityResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull Activity model); + + Builder from(ActivityResponse other); + } + + public interface _FinalStage { + ActivityResponse 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 Activity model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(ActivityResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull Activity model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public ActivityResponse build() { + return new ActivityResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ActivityTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ActivityTypeEnum.java new file mode 100644 index 000000000..f8b4ccb61 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ActivityTypeEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ActivityUser.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ActivityUser.java new file mode 100644 index 000000000..b61173839 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ActivityUser.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ActivityUser.Deserializer.class) +public final class ActivityUser { + private final Object value; + + private final int type; + + private ActivityUser(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((RemoteUser) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActivityUser && equalTo((ActivityUser) other); + } + + private boolean equalTo(ActivityUser other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ActivityUser of(String value) { + return new ActivityUser(value, 0); + } + + public static ActivityUser of(RemoteUser value) { + return new ActivityUser(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(RemoteUser value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ActivityUser.class); + } + + @Override + public ActivityUser 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, RemoteUser.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ActivityVisibility.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ActivityVisibility.java new file mode 100644 index 000000000..d65b978d1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ActivityVisibility.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/AdvancedMetadata.java b/src/main/java/com/merge/legacy/api/resources/ats/types/AdvancedMetadata.java new file mode 100644 index 000000000..386f66174 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/AdvancedMetadata.java @@ -0,0 +1,250 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, this.displayName, this.description, this.isRequired, this.isCustom, this.fieldChoices); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = id; + return this; + } + + @Override + public _FinalStage fieldChoices(List fieldChoices) { + this.fieldChoices = Optional.ofNullable(fieldChoices); + return this; + } + + @Override + @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) + public _FinalStage fieldChoices(Optional> fieldChoices) { + this.fieldChoices = fieldChoices; + return this; + } + + @Override + public _FinalStage isCustom(Boolean isCustom) { + this.isCustom = Optional.ofNullable(isCustom); + return this; + } + + @Override + @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) + public _FinalStage isCustom(Optional isCustom) { + this.isCustom = isCustom; + return this; + } + + @Override + public _FinalStage isRequired(Boolean isRequired) { + this.isRequired = Optional.ofNullable(isRequired); + return this; + } + + @Override + @JsonSetter(value = "is_required", nulls = Nulls.SKIP) + public _FinalStage isRequired(Optional isRequired) { + this.isRequired = isRequired; + return this; + } + + @Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + @Override + public _FinalStage displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @Override + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public _FinalStage displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + @Override + public AdvancedMetadata build() { + return new AdvancedMetadata( + id, displayName, description, isRequired, isCustom, fieldChoices, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/Application.java b/src/main/java/com/merge/legacy/api/resources/ats/types/Application.java new file mode 100644 index 000000000..eec2670bd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/Application.java @@ -0,0 +1,547 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Application.Builder.class) +public final class Application { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional candidate; + + private final Optional job; + + private final Optional appliedAt; + + private final Optional rejectedAt; + + private final Optional>> offers; + + private final Optional source; + + private final Optional creditedTo; + + private final Optional> screeningQuestionAnswers; + + private final Optional currentStage; + + private final Optional rejectReason; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Application( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional candidate, + Optional job, + Optional appliedAt, + Optional rejectedAt, + Optional>> offers, + Optional source, + Optional creditedTo, + Optional> screeningQuestionAnswers, + Optional currentStage, + Optional rejectReason, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.candidate = candidate; + this.job = job; + this.appliedAt = appliedAt; + this.rejectedAt = rejectedAt; + this.offers = offers; + this.source = source; + this.creditedTo = creditedTo; + this.screeningQuestionAnswers = screeningQuestionAnswers; + this.currentStage = currentStage; + this.rejectReason = rejectReason; + 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 candidate applying. + */ + @JsonProperty("candidate") + public Optional getCandidate() { + return candidate; + } + + /** + * @return The job being applied for. + */ + @JsonProperty("job") + public Optional getJob() { + return job; + } + + /** + * @return When the application was submitted. + */ + @JsonProperty("applied_at") + public Optional getAppliedAt() { + return appliedAt; + } + + /** + * @return When the application was rejected. + */ + @JsonProperty("rejected_at") + public Optional getRejectedAt() { + return rejectedAt; + } + + @JsonProperty("offers") + public Optional>> getOffers() { + return offers; + } + + /** + * @return The application's source. + */ + @JsonProperty("source") + public Optional getSource() { + return source; + } + + /** + * @return The user credited for this application. + */ + @JsonProperty("credited_to") + public Optional getCreditedTo() { + return creditedTo; + } + + @JsonProperty("screening_question_answers") + public Optional> getScreeningQuestionAnswers() { + return screeningQuestionAnswers; + } + + /** + * @return The application's current stage. + */ + @JsonProperty("current_stage") + public Optional getCurrentStage() { + return currentStage; + } + + /** + * @return The application's reason for rejection. + */ + @JsonProperty("reject_reason") + public Optional getRejectReason() { + return rejectReason; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Application && equalTo((Application) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Application other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && candidate.equals(other.candidate) + && job.equals(other.job) + && appliedAt.equals(other.appliedAt) + && rejectedAt.equals(other.rejectedAt) + && offers.equals(other.offers) + && source.equals(other.source) + && creditedTo.equals(other.creditedTo) + && screeningQuestionAnswers.equals(other.screeningQuestionAnswers) + && currentStage.equals(other.currentStage) + && rejectReason.equals(other.rejectReason) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.candidate, + this.job, + this.appliedAt, + this.rejectedAt, + this.offers, + this.source, + this.creditedTo, + this.screeningQuestionAnswers, + this.currentStage, + this.rejectReason, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 candidate = Optional.empty(); + + private Optional job = Optional.empty(); + + private Optional appliedAt = Optional.empty(); + + private Optional rejectedAt = Optional.empty(); + + private Optional>> offers = Optional.empty(); + + private Optional source = Optional.empty(); + + private Optional creditedTo = Optional.empty(); + + private Optional> screeningQuestionAnswers = Optional.empty(); + + private Optional currentStage = Optional.empty(); + + private Optional rejectReason = 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(Application other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + candidate(other.getCandidate()); + job(other.getJob()); + appliedAt(other.getAppliedAt()); + rejectedAt(other.getRejectedAt()); + offers(other.getOffers()); + source(other.getSource()); + creditedTo(other.getCreditedTo()); + screeningQuestionAnswers(other.getScreeningQuestionAnswers()); + currentStage(other.getCurrentStage()); + rejectReason(other.getRejectReason()); + 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 = "candidate", nulls = Nulls.SKIP) + public Builder candidate(Optional candidate) { + this.candidate = candidate; + return this; + } + + public Builder candidate(ApplicationCandidate candidate) { + this.candidate = Optional.ofNullable(candidate); + return this; + } + + @JsonSetter(value = "job", nulls = Nulls.SKIP) + public Builder job(Optional job) { + this.job = job; + return this; + } + + public Builder job(ApplicationJob job) { + this.job = Optional.ofNullable(job); + return this; + } + + @JsonSetter(value = "applied_at", nulls = Nulls.SKIP) + public Builder appliedAt(Optional appliedAt) { + this.appliedAt = appliedAt; + return this; + } + + public Builder appliedAt(OffsetDateTime appliedAt) { + this.appliedAt = Optional.ofNullable(appliedAt); + return this; + } + + @JsonSetter(value = "rejected_at", nulls = Nulls.SKIP) + public Builder rejectedAt(Optional rejectedAt) { + this.rejectedAt = rejectedAt; + return this; + } + + public Builder rejectedAt(OffsetDateTime rejectedAt) { + this.rejectedAt = Optional.ofNullable(rejectedAt); + return this; + } + + @JsonSetter(value = "offers", nulls = Nulls.SKIP) + public Builder offers(Optional>> offers) { + this.offers = offers; + return this; + } + + public Builder offers(List> offers) { + this.offers = Optional.ofNullable(offers); + return this; + } + + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public Builder source(Optional source) { + this.source = source; + return this; + } + + public Builder source(String source) { + this.source = Optional.ofNullable(source); + return this; + } + + @JsonSetter(value = "credited_to", nulls = Nulls.SKIP) + public Builder creditedTo(Optional creditedTo) { + this.creditedTo = creditedTo; + return this; + } + + public Builder creditedTo(ApplicationCreditedTo creditedTo) { + this.creditedTo = Optional.ofNullable(creditedTo); + return this; + } + + @JsonSetter(value = "screening_question_answers", nulls = Nulls.SKIP) + public Builder screeningQuestionAnswers( + Optional> screeningQuestionAnswers) { + this.screeningQuestionAnswers = screeningQuestionAnswers; + return this; + } + + public Builder screeningQuestionAnswers( + List screeningQuestionAnswers) { + this.screeningQuestionAnswers = Optional.ofNullable(screeningQuestionAnswers); + return this; + } + + @JsonSetter(value = "current_stage", nulls = Nulls.SKIP) + public Builder currentStage(Optional currentStage) { + this.currentStage = currentStage; + return this; + } + + public Builder currentStage(ApplicationCurrentStage currentStage) { + this.currentStage = Optional.ofNullable(currentStage); + return this; + } + + @JsonSetter(value = "reject_reason", nulls = Nulls.SKIP) + public Builder rejectReason(Optional rejectReason) { + this.rejectReason = rejectReason; + return this; + } + + public Builder rejectReason(ApplicationRejectReason rejectReason) { + this.rejectReason = Optional.ofNullable(rejectReason); + 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 Application build() { + return new Application( + id, + remoteId, + createdAt, + modifiedAt, + candidate, + job, + appliedAt, + rejectedAt, + offers, + source, + creditedTo, + screeningQuestionAnswers, + currentStage, + rejectReason, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationCandidate.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationCandidate.java new file mode 100644 index 000000000..d68671708 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationCandidate.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ApplicationCandidate.Deserializer.class) +public final class ApplicationCandidate { + private final Object value; + + private final int type; + + private ApplicationCandidate(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((Candidate) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApplicationCandidate && equalTo((ApplicationCandidate) other); + } + + private boolean equalTo(ApplicationCandidate other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ApplicationCandidate of(String value) { + return new ApplicationCandidate(value, 0); + } + + public static ApplicationCandidate of(Candidate value) { + return new ApplicationCandidate(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Candidate value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ApplicationCandidate.class); + } + + @Override + public ApplicationCandidate 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, Candidate.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationCreditedTo.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationCreditedTo.java new file mode 100644 index 000000000..34b6acc26 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationCreditedTo.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ApplicationCreditedTo.Deserializer.class) +public final class ApplicationCreditedTo { + private final Object value; + + private final int type; + + private ApplicationCreditedTo(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((RemoteUser) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApplicationCreditedTo && equalTo((ApplicationCreditedTo) other); + } + + private boolean equalTo(ApplicationCreditedTo other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ApplicationCreditedTo of(String value) { + return new ApplicationCreditedTo(value, 0); + } + + public static ApplicationCreditedTo of(RemoteUser value) { + return new ApplicationCreditedTo(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(RemoteUser value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ApplicationCreditedTo.class); + } + + @Override + public ApplicationCreditedTo 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, RemoteUser.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationCurrentStage.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationCurrentStage.java new file mode 100644 index 000000000..093c0f9bf --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationCurrentStage.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ApplicationCurrentStage.Deserializer.class) +public final class ApplicationCurrentStage { + private final Object value; + + private final int type; + + private ApplicationCurrentStage(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((JobInterviewStage) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApplicationCurrentStage && equalTo((ApplicationCurrentStage) other); + } + + private boolean equalTo(ApplicationCurrentStage other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ApplicationCurrentStage of(String value) { + return new ApplicationCurrentStage(value, 0); + } + + public static ApplicationCurrentStage of(JobInterviewStage value) { + return new ApplicationCurrentStage(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(JobInterviewStage value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ApplicationCurrentStage.class); + } + + @Override + public ApplicationCurrentStage 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, JobInterviewStage.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationJob.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationJob.java new file mode 100644 index 000000000..15cb0b8c1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationJob.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ApplicationJob.Deserializer.class) +public final class ApplicationJob { + private final Object value; + + private final int type; + + private ApplicationJob(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((Job) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApplicationJob && equalTo((ApplicationJob) other); + } + + private boolean equalTo(ApplicationJob other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ApplicationJob of(String value) { + return new ApplicationJob(value, 0); + } + + public static ApplicationJob of(Job value) { + return new ApplicationJob(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Job value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ApplicationJob.class); + } + + @Override + public ApplicationJob 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, Job.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationOffersItem.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationOffersItem.java new file mode 100644 index 000000000..82aeabbbf --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationOffersItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ApplicationOffersItem.Deserializer.class) +public final class ApplicationOffersItem { + private final Object value; + + private final int type; + + private ApplicationOffersItem(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((Offer) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApplicationOffersItem && equalTo((ApplicationOffersItem) other); + } + + private boolean equalTo(ApplicationOffersItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ApplicationOffersItem of(String value) { + return new ApplicationOffersItem(value, 0); + } + + public static ApplicationOffersItem of(Offer value) { + return new ApplicationOffersItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Offer value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ApplicationOffersItem.class); + } + + @Override + public ApplicationOffersItem 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, Offer.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRejectReason.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRejectReason.java new file mode 100644 index 000000000..5a207d2ba --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRejectReason.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ApplicationRejectReason.Deserializer.class) +public final class ApplicationRejectReason { + private final Object value; + + private final int type; + + private ApplicationRejectReason(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((RejectReason) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApplicationRejectReason && equalTo((ApplicationRejectReason) other); + } + + private boolean equalTo(ApplicationRejectReason other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ApplicationRejectReason of(String value) { + return new ApplicationRejectReason(value, 0); + } + + public static ApplicationRejectReason of(RejectReason value) { + return new ApplicationRejectReason(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(RejectReason value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ApplicationRejectReason.class); + } + + @Override + public ApplicationRejectReason 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, RejectReason.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRequest.java new file mode 100644 index 000000000..bd12a72a2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRequest.java @@ -0,0 +1,432 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ApplicationRequest.Builder.class) +public final class ApplicationRequest { + private final Optional candidate; + + private final Optional job; + + private final Optional appliedAt; + + private final Optional rejectedAt; + + private final Optional>> offers; + + private final Optional source; + + private final Optional creditedTo; + + private final Optional> screeningQuestionAnswers; + + private final Optional currentStage; + + private final Optional rejectReason; + + private final Optional remoteTemplateId; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private ApplicationRequest( + Optional candidate, + Optional job, + Optional appliedAt, + Optional rejectedAt, + Optional>> offers, + Optional source, + Optional creditedTo, + Optional> screeningQuestionAnswers, + Optional currentStage, + Optional rejectReason, + Optional remoteTemplateId, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.candidate = candidate; + this.job = job; + this.appliedAt = appliedAt; + this.rejectedAt = rejectedAt; + this.offers = offers; + this.source = source; + this.creditedTo = creditedTo; + this.screeningQuestionAnswers = screeningQuestionAnswers; + this.currentStage = currentStage; + this.rejectReason = rejectReason; + this.remoteTemplateId = remoteTemplateId; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The candidate applying. + */ + @JsonProperty("candidate") + public Optional getCandidate() { + return candidate; + } + + /** + * @return The job being applied for. + */ + @JsonProperty("job") + public Optional getJob() { + return job; + } + + /** + * @return When the application was submitted. + */ + @JsonProperty("applied_at") + public Optional getAppliedAt() { + return appliedAt; + } + + /** + * @return When the application was rejected. + */ + @JsonProperty("rejected_at") + public Optional getRejectedAt() { + return rejectedAt; + } + + @JsonProperty("offers") + public Optional>> getOffers() { + return offers; + } + + /** + * @return The application's source. + */ + @JsonProperty("source") + public Optional getSource() { + return source; + } + + /** + * @return The user credited for this application. + */ + @JsonProperty("credited_to") + public Optional getCreditedTo() { + return creditedTo; + } + + @JsonProperty("screening_question_answers") + public Optional> getScreeningQuestionAnswers() { + return screeningQuestionAnswers; + } + + /** + * @return The application's current stage. + */ + @JsonProperty("current_stage") + public Optional getCurrentStage() { + return currentStage; + } + + /** + * @return The application's reason for rejection. + */ + @JsonProperty("reject_reason") + public Optional getRejectReason() { + return rejectReason; + } + + @JsonProperty("remote_template_id") + public Optional getRemoteTemplateId() { + return remoteTemplateId; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApplicationRequest && equalTo((ApplicationRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ApplicationRequest other) { + return candidate.equals(other.candidate) + && job.equals(other.job) + && appliedAt.equals(other.appliedAt) + && rejectedAt.equals(other.rejectedAt) + && offers.equals(other.offers) + && source.equals(other.source) + && creditedTo.equals(other.creditedTo) + && screeningQuestionAnswers.equals(other.screeningQuestionAnswers) + && currentStage.equals(other.currentStage) + && rejectReason.equals(other.rejectReason) + && remoteTemplateId.equals(other.remoteTemplateId) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @Override + public int hashCode() { + return Objects.hash( + this.candidate, + this.job, + this.appliedAt, + this.rejectedAt, + this.offers, + this.source, + this.creditedTo, + this.screeningQuestionAnswers, + this.currentStage, + this.rejectReason, + this.remoteTemplateId, + this.integrationParams, + this.linkedAccountParams); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional candidate = Optional.empty(); + + private Optional job = Optional.empty(); + + private Optional appliedAt = Optional.empty(); + + private Optional rejectedAt = Optional.empty(); + + private Optional>> offers = Optional.empty(); + + private Optional source = Optional.empty(); + + private Optional creditedTo = Optional.empty(); + + private Optional> screeningQuestionAnswers = + Optional.empty(); + + private Optional currentStage = Optional.empty(); + + private Optional rejectReason = Optional.empty(); + + private Optional remoteTemplateId = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ApplicationRequest other) { + candidate(other.getCandidate()); + job(other.getJob()); + appliedAt(other.getAppliedAt()); + rejectedAt(other.getRejectedAt()); + offers(other.getOffers()); + source(other.getSource()); + creditedTo(other.getCreditedTo()); + screeningQuestionAnswers(other.getScreeningQuestionAnswers()); + currentStage(other.getCurrentStage()); + rejectReason(other.getRejectReason()); + remoteTemplateId(other.getRemoteTemplateId()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + return this; + } + + @JsonSetter(value = "candidate", nulls = Nulls.SKIP) + public Builder candidate(Optional candidate) { + this.candidate = candidate; + return this; + } + + public Builder candidate(ApplicationRequestCandidate candidate) { + this.candidate = Optional.ofNullable(candidate); + return this; + } + + @JsonSetter(value = "job", nulls = Nulls.SKIP) + public Builder job(Optional job) { + this.job = job; + return this; + } + + public Builder job(ApplicationRequestJob job) { + this.job = Optional.ofNullable(job); + return this; + } + + @JsonSetter(value = "applied_at", nulls = Nulls.SKIP) + public Builder appliedAt(Optional appliedAt) { + this.appliedAt = appliedAt; + return this; + } + + public Builder appliedAt(OffsetDateTime appliedAt) { + this.appliedAt = Optional.ofNullable(appliedAt); + return this; + } + + @JsonSetter(value = "rejected_at", nulls = Nulls.SKIP) + public Builder rejectedAt(Optional rejectedAt) { + this.rejectedAt = rejectedAt; + return this; + } + + public Builder rejectedAt(OffsetDateTime rejectedAt) { + this.rejectedAt = Optional.ofNullable(rejectedAt); + return this; + } + + @JsonSetter(value = "offers", nulls = Nulls.SKIP) + public Builder offers(Optional>> offers) { + this.offers = offers; + return this; + } + + public Builder offers(List> offers) { + this.offers = Optional.ofNullable(offers); + return this; + } + + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public Builder source(Optional source) { + this.source = source; + return this; + } + + public Builder source(String source) { + this.source = Optional.ofNullable(source); + return this; + } + + @JsonSetter(value = "credited_to", nulls = Nulls.SKIP) + public Builder creditedTo(Optional creditedTo) { + this.creditedTo = creditedTo; + return this; + } + + public Builder creditedTo(ApplicationRequestCreditedTo creditedTo) { + this.creditedTo = Optional.ofNullable(creditedTo); + return this; + } + + @JsonSetter(value = "screening_question_answers", nulls = Nulls.SKIP) + public Builder screeningQuestionAnswers( + Optional> screeningQuestionAnswers) { + this.screeningQuestionAnswers = screeningQuestionAnswers; + return this; + } + + public Builder screeningQuestionAnswers( + List screeningQuestionAnswers) { + this.screeningQuestionAnswers = Optional.ofNullable(screeningQuestionAnswers); + return this; + } + + @JsonSetter(value = "current_stage", nulls = Nulls.SKIP) + public Builder currentStage(Optional currentStage) { + this.currentStage = currentStage; + return this; + } + + public Builder currentStage(ApplicationRequestCurrentStage currentStage) { + this.currentStage = Optional.ofNullable(currentStage); + return this; + } + + @JsonSetter(value = "reject_reason", nulls = Nulls.SKIP) + public Builder rejectReason(Optional rejectReason) { + this.rejectReason = rejectReason; + return this; + } + + public Builder rejectReason(ApplicationRequestRejectReason rejectReason) { + this.rejectReason = Optional.ofNullable(rejectReason); + return this; + } + + @JsonSetter(value = "remote_template_id", nulls = Nulls.SKIP) + public Builder remoteTemplateId(Optional remoteTemplateId) { + this.remoteTemplateId = remoteTemplateId; + return this; + } + + public Builder remoteTemplateId(String remoteTemplateId) { + this.remoteTemplateId = Optional.ofNullable(remoteTemplateId); + 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 ApplicationRequest build() { + return new ApplicationRequest( + candidate, + job, + appliedAt, + rejectedAt, + offers, + source, + creditedTo, + screeningQuestionAnswers, + currentStage, + rejectReason, + remoteTemplateId, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRequestCandidate.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRequestCandidate.java new file mode 100644 index 000000000..45a7c87e7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRequestCandidate.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ApplicationRequestCandidate.Deserializer.class) +public final class ApplicationRequestCandidate { + private final Object value; + + private final int type; + + private ApplicationRequestCandidate(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((Candidate) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApplicationRequestCandidate && equalTo((ApplicationRequestCandidate) other); + } + + private boolean equalTo(ApplicationRequestCandidate other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ApplicationRequestCandidate of(String value) { + return new ApplicationRequestCandidate(value, 0); + } + + public static ApplicationRequestCandidate of(Candidate value) { + return new ApplicationRequestCandidate(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Candidate value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ApplicationRequestCandidate.class); + } + + @Override + public ApplicationRequestCandidate 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, Candidate.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRequestCreditedTo.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRequestCreditedTo.java new file mode 100644 index 000000000..f012e11ec --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRequestCreditedTo.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ApplicationRequestCreditedTo.Deserializer.class) +public final class ApplicationRequestCreditedTo { + private final Object value; + + private final int type; + + private ApplicationRequestCreditedTo(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((RemoteUser) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApplicationRequestCreditedTo && equalTo((ApplicationRequestCreditedTo) other); + } + + private boolean equalTo(ApplicationRequestCreditedTo other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ApplicationRequestCreditedTo of(String value) { + return new ApplicationRequestCreditedTo(value, 0); + } + + public static ApplicationRequestCreditedTo of(RemoteUser value) { + return new ApplicationRequestCreditedTo(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(RemoteUser value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ApplicationRequestCreditedTo.class); + } + + @Override + public ApplicationRequestCreditedTo 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, RemoteUser.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRequestCurrentStage.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRequestCurrentStage.java new file mode 100644 index 000000000..f2636f9aa --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRequestCurrentStage.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ApplicationRequestCurrentStage.Deserializer.class) +public final class ApplicationRequestCurrentStage { + private final Object value; + + private final int type; + + private ApplicationRequestCurrentStage(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((JobInterviewStage) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApplicationRequestCurrentStage && equalTo((ApplicationRequestCurrentStage) other); + } + + private boolean equalTo(ApplicationRequestCurrentStage other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ApplicationRequestCurrentStage of(String value) { + return new ApplicationRequestCurrentStage(value, 0); + } + + public static ApplicationRequestCurrentStage of(JobInterviewStage value) { + return new ApplicationRequestCurrentStage(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(JobInterviewStage value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ApplicationRequestCurrentStage.class); + } + + @Override + public ApplicationRequestCurrentStage 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, JobInterviewStage.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRequestJob.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRequestJob.java new file mode 100644 index 000000000..3460e2912 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRequestJob.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ApplicationRequestJob.Deserializer.class) +public final class ApplicationRequestJob { + private final Object value; + + private final int type; + + private ApplicationRequestJob(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((Job) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApplicationRequestJob && equalTo((ApplicationRequestJob) other); + } + + private boolean equalTo(ApplicationRequestJob other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ApplicationRequestJob of(String value) { + return new ApplicationRequestJob(value, 0); + } + + public static ApplicationRequestJob of(Job value) { + return new ApplicationRequestJob(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Job value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ApplicationRequestJob.class); + } + + @Override + public ApplicationRequestJob 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, Job.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRequestOffersItem.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRequestOffersItem.java new file mode 100644 index 000000000..81a0c988e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRequestOffersItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ApplicationRequestOffersItem.Deserializer.class) +public final class ApplicationRequestOffersItem { + private final Object value; + + private final int type; + + private ApplicationRequestOffersItem(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((Offer) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApplicationRequestOffersItem && equalTo((ApplicationRequestOffersItem) other); + } + + private boolean equalTo(ApplicationRequestOffersItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ApplicationRequestOffersItem of(String value) { + return new ApplicationRequestOffersItem(value, 0); + } + + public static ApplicationRequestOffersItem of(Offer value) { + return new ApplicationRequestOffersItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Offer value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ApplicationRequestOffersItem.class); + } + + @Override + public ApplicationRequestOffersItem 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, Offer.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRequestRejectReason.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRequestRejectReason.java new file mode 100644 index 000000000..b328b0ec1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRequestRejectReason.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ApplicationRequestRejectReason.Deserializer.class) +public final class ApplicationRequestRejectReason { + private final Object value; + + private final int type; + + private ApplicationRequestRejectReason(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((RejectReason) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApplicationRequestRejectReason && equalTo((ApplicationRequestRejectReason) other); + } + + private boolean equalTo(ApplicationRequestRejectReason other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ApplicationRequestRejectReason of(String value) { + return new ApplicationRequestRejectReason(value, 0); + } + + public static ApplicationRequestRejectReason of(RejectReason value) { + return new ApplicationRequestRejectReason(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(RejectReason value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ApplicationRequestRejectReason.class); + } + + @Override + public ApplicationRequestRejectReason 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, RejectReason.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRequestScreeningQuestionAnswersItem.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRequestScreeningQuestionAnswersItem.java new file mode 100644 index 000000000..72885f33b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationRequestScreeningQuestionAnswersItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ApplicationRequestScreeningQuestionAnswersItem.Deserializer.class) +public final class ApplicationRequestScreeningQuestionAnswersItem { + private final Object value; + + private final int type; + + private ApplicationRequestScreeningQuestionAnswersItem(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((ScreeningQuestionAnswerRequest) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApplicationRequestScreeningQuestionAnswersItem + && equalTo((ApplicationRequestScreeningQuestionAnswersItem) other); + } + + private boolean equalTo(ApplicationRequestScreeningQuestionAnswersItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ApplicationRequestScreeningQuestionAnswersItem of(String value) { + return new ApplicationRequestScreeningQuestionAnswersItem(value, 0); + } + + public static ApplicationRequestScreeningQuestionAnswersItem of(ScreeningQuestionAnswerRequest value) { + return new ApplicationRequestScreeningQuestionAnswersItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(ScreeningQuestionAnswerRequest value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ApplicationRequestScreeningQuestionAnswersItem.class); + } + + @Override + public ApplicationRequestScreeningQuestionAnswersItem 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, ScreeningQuestionAnswerRequest.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationResponse.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationResponse.java new file mode 100644 index 000000000..cf8faafdf --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ApplicationResponse.Builder.class) +public final class ApplicationResponse { + private final Application model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private ApplicationResponse( + Application 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 Application getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApplicationResponse && equalTo((ApplicationResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ApplicationResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull Application model); + + Builder from(ApplicationResponse other); + } + + public interface _FinalStage { + ApplicationResponse 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 Application model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(ApplicationResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull Application model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public ApplicationResponse build() { + return new ApplicationResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationScreeningQuestionAnswersItem.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationScreeningQuestionAnswersItem.java new file mode 100644 index 000000000..70795fbbb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ApplicationScreeningQuestionAnswersItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ApplicationScreeningQuestionAnswersItem.Deserializer.class) +public final class ApplicationScreeningQuestionAnswersItem { + private final Object value; + + private final int type; + + private ApplicationScreeningQuestionAnswersItem(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((ScreeningQuestionAnswer) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApplicationScreeningQuestionAnswersItem + && equalTo((ApplicationScreeningQuestionAnswersItem) other); + } + + private boolean equalTo(ApplicationScreeningQuestionAnswersItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ApplicationScreeningQuestionAnswersItem of(String value) { + return new ApplicationScreeningQuestionAnswersItem(value, 0); + } + + public static ApplicationScreeningQuestionAnswersItem of(ScreeningQuestionAnswer value) { + return new ApplicationScreeningQuestionAnswersItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(ScreeningQuestionAnswer value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ApplicationScreeningQuestionAnswersItem.class); + } + + @Override + public ApplicationScreeningQuestionAnswersItem 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, ScreeningQuestionAnswer.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/AsyncPassthroughReciept.java b/src/main/java/com/merge/legacy/api/resources/ats/types/AsyncPassthroughReciept.java new file mode 100644 index 000000000..410cad65b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/AsyncPassthroughReciept.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.asyncPassthroughReceiptId); + } + + @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() {} + + @Override + public Builder from(AsyncPassthroughReciept other) { + asyncPassthroughReceiptId(other.getAsyncPassthroughReceiptId()); + return this; + } + + @Override + @JsonSetter("async_passthrough_receipt_id") + public _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId) { + this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; + return this; + } + + @Override + public AsyncPassthroughReciept build() { + return new AsyncPassthroughReciept(asyncPassthroughReceiptId, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/Attachment.java b/src/main/java/com/merge/legacy/api/resources/ats/types/Attachment.java new file mode 100644 index 000000000..6cd38799b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/Attachment.java @@ -0,0 +1,383 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ats/types/AttachmentAttachmentType.java b/src/main/java/com/merge/legacy/api/resources/ats/types/AttachmentAttachmentType.java new file mode 100644 index 000000000..8f78abbee --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/AttachmentAttachmentType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/AttachmentRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/types/AttachmentRequest.java new file mode 100644 index 000000000..cfe476f9f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/AttachmentRequest.java @@ -0,0 +1,243 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.fileName, + this.fileUrl, + this.candidate, + this.attachmentType, + this.integrationParams, + this.linkedAccountParams); + } + + @Override + 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/legacy/api/resources/ats/types/AttachmentRequestAttachmentType.java b/src/main/java/com/merge/legacy/api/resources/ats/types/AttachmentRequestAttachmentType.java new file mode 100644 index 000000000..7710a310d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/AttachmentRequestAttachmentType.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/AttachmentResponse.java b/src/main/java/com/merge/legacy/api/resources/ats/types/AttachmentResponse.java new file mode 100644 index 000000000..0b153d904 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/AttachmentResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttachmentResponse.Builder.class) +public final class AttachmentResponse { + private final Attachment model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private AttachmentResponse( + Attachment 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 Attachment getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttachmentResponse && equalTo((AttachmentResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttachmentResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull Attachment model); + + Builder from(AttachmentResponse other); + } + + public interface _FinalStage { + AttachmentResponse 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 Attachment model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(AttachmentResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull Attachment model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public AttachmentResponse build() { + return new AttachmentResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/AttachmentTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/AttachmentTypeEnum.java new file mode 100644 index 000000000..8efaed745 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/AttachmentTypeEnum.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AttachmentTypeEnum { + RESUME("RESUME"), + + COVER_LETTER("COVER_LETTER"), + + OFFER_LETTER("OFFER_LETTER"), + + OTHER("OTHER"); + + private final String value; + + AttachmentTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/AuditLogEvent.java b/src/main/java/com/merge/legacy/api/resources/ats/types/AuditLogEvent.java new file mode 100644 index 000000000..67029eb4d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/AuditLogEvent.java @@ -0,0 +1,441 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.userName, + this.userEmail, + this.role, + this.ipAddress, + this.eventType, + this.eventDescription, + this.createdAt); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("role") + public IpAddressStage role(@NotNull AuditLogEventRole role) { + this.role = role; + return this; + } + + @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. + */ + @Override + @JsonSetter("event_type") + public EventDescriptionStage eventType(@NotNull AuditLogEventEventType eventType) { + this.eventType = eventType; + return this; + } + + @Override + @JsonSetter("event_description") + public _FinalStage eventDescription(@NotNull String eventDescription) { + this.eventDescription = eventDescription; + return this; + } + + @Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @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. + */ + @Override + public _FinalStage userEmail(String userEmail) { + this.userEmail = Optional.ofNullable(userEmail); + return this; + } + + @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. + */ + @Override + public _FinalStage userName(String userName) { + this.userName = Optional.ofNullable(userName); + return this; + } + + @Override + @JsonSetter(value = "user_name", nulls = Nulls.SKIP) + public _FinalStage userName(Optional userName) { + this.userName = userName; + return this; + } + + @Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @Override + public AuditLogEvent build() { + return new AuditLogEvent( + id, + userName, + userEmail, + role, + ipAddress, + eventType, + eventDescription, + createdAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/AuditLogEventEventType.java b/src/main/java/com/merge/legacy/api/resources/ats/types/AuditLogEventEventType.java new file mode 100644 index 000000000..f41823ee9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/AuditLogEventEventType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/AuditLogEventRole.java b/src/main/java/com/merge/legacy/api/resources/ats/types/AuditLogEventRole.java new file mode 100644 index 000000000..37e850da8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/AuditLogEventRole.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/AvailableActions.java b/src/main/java/com/merge/legacy/api/resources/ats/types/AvailableActions.java new file mode 100644 index 000000000..6ee4038c6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/AvailableActions.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.integration, this.passthroughAvailable, this.availableModelOperations); + } + + @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() {} + + @Override + public Builder from(AvailableActions other) { + integration(other.getIntegration()); + passthroughAvailable(other.getPassthroughAvailable()); + availableModelOperations(other.getAvailableModelOperations()); + return this; + } + + @Override + @JsonSetter("integration") + public PassthroughAvailableStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @Override + public AvailableActions build() { + return new AvailableActions( + integration, passthroughAvailable, availableModelOperations, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/Candidate.java b/src/main/java/com/merge/legacy/api/resources/ats/types/Candidate.java new file mode 100644 index 000000000..aa8bb7cb1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/Candidate.java @@ -0,0 +1,716 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Candidate.Builder.class) +public final class Candidate { + 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 company; + + private final Optional title; + + private final Optional remoteCreatedAt; + + private final Optional remoteUpdatedAt; + + private final Optional lastInteractionAt; + + private final Optional isPrivate; + + private final Optional canEmail; + + private final Optional>> locations; + + private final Optional> phoneNumbers; + + private final Optional> emailAddresses; + + private final Optional> urls; + + private final Optional>> tags; + + private final Optional>> applications; + + private final Optional>> attachments; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Candidate( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional firstName, + Optional lastName, + Optional company, + Optional title, + Optional remoteCreatedAt, + Optional remoteUpdatedAt, + Optional lastInteractionAt, + Optional isPrivate, + Optional canEmail, + Optional>> locations, + Optional> phoneNumbers, + Optional> emailAddresses, + Optional> urls, + Optional>> tags, + Optional>> applications, + Optional>> attachments, + 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.company = company; + this.title = title; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteUpdatedAt = remoteUpdatedAt; + this.lastInteractionAt = lastInteractionAt; + this.isPrivate = isPrivate; + this.canEmail = canEmail; + this.locations = locations; + this.phoneNumbers = phoneNumbers; + this.emailAddresses = emailAddresses; + this.urls = urls; + this.tags = tags; + this.applications = applications; + this.attachments = attachments; + 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 candidate's first name. + */ + @JsonProperty("first_name") + public Optional getFirstName() { + return firstName; + } + + /** + * @return The candidate's last name. + */ + @JsonProperty("last_name") + public Optional getLastName() { + return lastName; + } + + /** + * @return The candidate's current company. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The candidate's current title. + */ + @JsonProperty("title") + public Optional getTitle() { + return title; + } + + /** + * @return When the third party's candidate was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the third party's candidate was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @return When the most recent interaction with the candidate occurred. + */ + @JsonProperty("last_interaction_at") + public Optional getLastInteractionAt() { + return lastInteractionAt; + } + + /** + * @return Whether or not the candidate is private. + */ + @JsonProperty("is_private") + public Optional getIsPrivate() { + return isPrivate; + } + + /** + * @return Whether or not the candidate can be emailed. + */ + @JsonProperty("can_email") + public Optional getCanEmail() { + return canEmail; + } + + /** + * @return The candidate's locations. + */ + @JsonProperty("locations") + public Optional>> getLocations() { + return locations; + } + + @JsonProperty("phone_numbers") + public Optional> getPhoneNumbers() { + return phoneNumbers; + } + + @JsonProperty("email_addresses") + public Optional> getEmailAddresses() { + return emailAddresses; + } + + @JsonProperty("urls") + public Optional> getUrls() { + return urls; + } + + /** + * @return Array of Tag names as strings. + */ + @JsonProperty("tags") + public Optional>> getTags() { + return tags; + } + + /** + * @return Array of Application object IDs. + */ + @JsonProperty("applications") + public Optional>> getApplications() { + return applications; + } + + /** + * @return Array of Attachment object IDs. + */ + @JsonProperty("attachments") + public Optional>> getAttachments() { + return attachments; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Candidate && equalTo((Candidate) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Candidate 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) + && company.equals(other.company) + && title.equals(other.title) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && lastInteractionAt.equals(other.lastInteractionAt) + && isPrivate.equals(other.isPrivate) + && canEmail.equals(other.canEmail) + && locations.equals(other.locations) + && phoneNumbers.equals(other.phoneNumbers) + && emailAddresses.equals(other.emailAddresses) + && urls.equals(other.urls) + && tags.equals(other.tags) + && applications.equals(other.applications) + && attachments.equals(other.attachments) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.firstName, + this.lastName, + this.company, + this.title, + this.remoteCreatedAt, + this.remoteUpdatedAt, + this.lastInteractionAt, + this.isPrivate, + this.canEmail, + this.locations, + this.phoneNumbers, + this.emailAddresses, + this.urls, + this.tags, + this.applications, + this.attachments, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 company = Optional.empty(); + + private Optional title = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional lastInteractionAt = Optional.empty(); + + private Optional isPrivate = Optional.empty(); + + private Optional canEmail = Optional.empty(); + + private Optional>> locations = Optional.empty(); + + private Optional> phoneNumbers = Optional.empty(); + + private Optional> emailAddresses = Optional.empty(); + + private Optional> urls = Optional.empty(); + + private Optional>> tags = Optional.empty(); + + private Optional>> applications = Optional.empty(); + + private Optional>> attachments = 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(Candidate other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + firstName(other.getFirstName()); + lastName(other.getLastName()); + company(other.getCompany()); + title(other.getTitle()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + lastInteractionAt(other.getLastInteractionAt()); + isPrivate(other.getIsPrivate()); + canEmail(other.getCanEmail()); + locations(other.getLocations()); + phoneNumbers(other.getPhoneNumbers()); + emailAddresses(other.getEmailAddresses()); + urls(other.getUrls()); + tags(other.getTags()); + applications(other.getApplications()); + attachments(other.getAttachments()); + 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 = "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 = "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 = "title", nulls = Nulls.SKIP) + public Builder title(Optional title) { + this.title = title; + return this; + } + + public Builder title(String title) { + this.title = Optional.ofNullable(title); + 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_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 = "last_interaction_at", nulls = Nulls.SKIP) + public Builder lastInteractionAt(Optional lastInteractionAt) { + this.lastInteractionAt = lastInteractionAt; + return this; + } + + public Builder lastInteractionAt(OffsetDateTime lastInteractionAt) { + this.lastInteractionAt = Optional.ofNullable(lastInteractionAt); + return this; + } + + @JsonSetter(value = "is_private", nulls = Nulls.SKIP) + public Builder isPrivate(Optional isPrivate) { + this.isPrivate = isPrivate; + return this; + } + + public Builder isPrivate(Boolean isPrivate) { + this.isPrivate = Optional.ofNullable(isPrivate); + return this; + } + + @JsonSetter(value = "can_email", nulls = Nulls.SKIP) + public Builder canEmail(Optional canEmail) { + this.canEmail = canEmail; + return this; + } + + public Builder canEmail(Boolean canEmail) { + this.canEmail = Optional.ofNullable(canEmail); + return this; + } + + @JsonSetter(value = "locations", nulls = Nulls.SKIP) + public Builder locations(Optional>> locations) { + this.locations = locations; + return this; + } + + public Builder locations(List> locations) { + this.locations = Optional.ofNullable(locations); + 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 = "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 = "urls", nulls = Nulls.SKIP) + public Builder urls(Optional> urls) { + this.urls = urls; + return this; + } + + public Builder urls(List urls) { + this.urls = Optional.ofNullable(urls); + return this; + } + + @JsonSetter(value = "tags", nulls = Nulls.SKIP) + public Builder tags(Optional>> tags) { + this.tags = tags; + return this; + } + + public Builder tags(List> tags) { + this.tags = Optional.ofNullable(tags); + return this; + } + + @JsonSetter(value = "applications", nulls = Nulls.SKIP) + public Builder applications(Optional>> applications) { + this.applications = applications; + return this; + } + + public Builder applications(List> applications) { + this.applications = Optional.ofNullable(applications); + return this; + } + + @JsonSetter(value = "attachments", nulls = Nulls.SKIP) + public Builder attachments(Optional>> attachments) { + this.attachments = attachments; + return this; + } + + public Builder attachments(List> attachments) { + this.attachments = Optional.ofNullable(attachments); + 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 Candidate build() { + return new Candidate( + id, + remoteId, + createdAt, + modifiedAt, + firstName, + lastName, + company, + title, + remoteCreatedAt, + remoteUpdatedAt, + lastInteractionAt, + isPrivate, + canEmail, + locations, + phoneNumbers, + emailAddresses, + urls, + tags, + applications, + attachments, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/CandidateApplicationsItem.java b/src/main/java/com/merge/legacy/api/resources/ats/types/CandidateApplicationsItem.java new file mode 100644 index 000000000..914b9d28d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/CandidateApplicationsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CandidateApplicationsItem.Deserializer.class) +public final class CandidateApplicationsItem { + private final Object value; + + private final int type; + + private CandidateApplicationsItem(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((Application) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CandidateApplicationsItem && equalTo((CandidateApplicationsItem) other); + } + + private boolean equalTo(CandidateApplicationsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CandidateApplicationsItem of(String value) { + return new CandidateApplicationsItem(value, 0); + } + + public static CandidateApplicationsItem of(Application value) { + return new CandidateApplicationsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Application value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CandidateApplicationsItem.class); + } + + @Override + public CandidateApplicationsItem 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, Application.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/CandidateAttachmentsItem.java b/src/main/java/com/merge/legacy/api/resources/ats/types/CandidateAttachmentsItem.java new file mode 100644 index 000000000..2e6e7dbeb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/CandidateAttachmentsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CandidateAttachmentsItem.Deserializer.class) +public final class CandidateAttachmentsItem { + private final Object value; + + private final int type; + + private CandidateAttachmentsItem(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((Attachment) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CandidateAttachmentsItem && equalTo((CandidateAttachmentsItem) other); + } + + private boolean equalTo(CandidateAttachmentsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CandidateAttachmentsItem of(String value) { + return new CandidateAttachmentsItem(value, 0); + } + + public static CandidateAttachmentsItem of(Attachment value) { + return new CandidateAttachmentsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Attachment value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CandidateAttachmentsItem.class); + } + + @Override + public CandidateAttachmentsItem 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, Attachment.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/CandidateRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/types/CandidateRequest.java new file mode 100644 index 000000000..bb86c928b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/CandidateRequest.java @@ -0,0 +1,542 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CandidateRequest.Builder.class) +public final class CandidateRequest { + private final Optional firstName; + + private final Optional lastName; + + private final Optional company; + + private final Optional title; + + private final Optional lastInteractionAt; + + private final Optional isPrivate; + + private final Optional canEmail; + + private final Optional>> locations; + + private final Optional> phoneNumbers; + + private final Optional> emailAddresses; + + private final Optional> urls; + + private final Optional>> tags; + + private final Optional>> applications; + + private final Optional>> attachments; + + private final Optional remoteTemplateId; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private CandidateRequest( + Optional firstName, + Optional lastName, + Optional company, + Optional title, + Optional lastInteractionAt, + Optional isPrivate, + Optional canEmail, + Optional>> locations, + Optional> phoneNumbers, + Optional> emailAddresses, + Optional> urls, + Optional>> tags, + Optional>> applications, + Optional>> attachments, + Optional remoteTemplateId, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.firstName = firstName; + this.lastName = lastName; + this.company = company; + this.title = title; + this.lastInteractionAt = lastInteractionAt; + this.isPrivate = isPrivate; + this.canEmail = canEmail; + this.locations = locations; + this.phoneNumbers = phoneNumbers; + this.emailAddresses = emailAddresses; + this.urls = urls; + this.tags = tags; + this.applications = applications; + this.attachments = attachments; + this.remoteTemplateId = remoteTemplateId; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The candidate's first name. + */ + @JsonProperty("first_name") + public Optional getFirstName() { + return firstName; + } + + /** + * @return The candidate's last name. + */ + @JsonProperty("last_name") + public Optional getLastName() { + return lastName; + } + + /** + * @return The candidate's current company. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The candidate's current title. + */ + @JsonProperty("title") + public Optional getTitle() { + return title; + } + + /** + * @return When the most recent interaction with the candidate occurred. + */ + @JsonProperty("last_interaction_at") + public Optional getLastInteractionAt() { + return lastInteractionAt; + } + + /** + * @return Whether or not the candidate is private. + */ + @JsonProperty("is_private") + public Optional getIsPrivate() { + return isPrivate; + } + + /** + * @return Whether or not the candidate can be emailed. + */ + @JsonProperty("can_email") + public Optional getCanEmail() { + return canEmail; + } + + /** + * @return The candidate's locations. + */ + @JsonProperty("locations") + public Optional>> getLocations() { + return locations; + } + + @JsonProperty("phone_numbers") + public Optional> getPhoneNumbers() { + return phoneNumbers; + } + + @JsonProperty("email_addresses") + public Optional> getEmailAddresses() { + return emailAddresses; + } + + @JsonProperty("urls") + public Optional> getUrls() { + return urls; + } + + /** + * @return Array of Tag names as strings. + */ + @JsonProperty("tags") + public Optional>> getTags() { + return tags; + } + + /** + * @return Array of Application object IDs. + */ + @JsonProperty("applications") + public Optional>> getApplications() { + return applications; + } + + /** + * @return Array of Attachment object IDs. + */ + @JsonProperty("attachments") + public Optional>> getAttachments() { + return attachments; + } + + @JsonProperty("remote_template_id") + public Optional getRemoteTemplateId() { + return remoteTemplateId; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CandidateRequest && equalTo((CandidateRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CandidateRequest other) { + return firstName.equals(other.firstName) + && lastName.equals(other.lastName) + && company.equals(other.company) + && title.equals(other.title) + && lastInteractionAt.equals(other.lastInteractionAt) + && isPrivate.equals(other.isPrivate) + && canEmail.equals(other.canEmail) + && locations.equals(other.locations) + && phoneNumbers.equals(other.phoneNumbers) + && emailAddresses.equals(other.emailAddresses) + && urls.equals(other.urls) + && tags.equals(other.tags) + && applications.equals(other.applications) + && attachments.equals(other.attachments) + && remoteTemplateId.equals(other.remoteTemplateId) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @Override + public int hashCode() { + return Objects.hash( + this.firstName, + this.lastName, + this.company, + this.title, + this.lastInteractionAt, + this.isPrivate, + this.canEmail, + this.locations, + this.phoneNumbers, + this.emailAddresses, + this.urls, + this.tags, + this.applications, + this.attachments, + this.remoteTemplateId, + this.integrationParams, + this.linkedAccountParams); + } + + @Override + 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 company = Optional.empty(); + + private Optional title = Optional.empty(); + + private Optional lastInteractionAt = Optional.empty(); + + private Optional isPrivate = Optional.empty(); + + private Optional canEmail = Optional.empty(); + + private Optional>> locations = Optional.empty(); + + private Optional> phoneNumbers = Optional.empty(); + + private Optional> emailAddresses = Optional.empty(); + + private Optional> urls = Optional.empty(); + + private Optional>> tags = Optional.empty(); + + private Optional>> applications = Optional.empty(); + + private Optional>> attachments = Optional.empty(); + + private Optional remoteTemplateId = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CandidateRequest other) { + firstName(other.getFirstName()); + lastName(other.getLastName()); + company(other.getCompany()); + title(other.getTitle()); + lastInteractionAt(other.getLastInteractionAt()); + isPrivate(other.getIsPrivate()); + canEmail(other.getCanEmail()); + locations(other.getLocations()); + phoneNumbers(other.getPhoneNumbers()); + emailAddresses(other.getEmailAddresses()); + urls(other.getUrls()); + tags(other.getTags()); + applications(other.getApplications()); + attachments(other.getAttachments()); + remoteTemplateId(other.getRemoteTemplateId()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + 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 = "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 = "title", nulls = Nulls.SKIP) + public Builder title(Optional title) { + this.title = title; + return this; + } + + public Builder title(String title) { + this.title = Optional.ofNullable(title); + return this; + } + + @JsonSetter(value = "last_interaction_at", nulls = Nulls.SKIP) + public Builder lastInteractionAt(Optional lastInteractionAt) { + this.lastInteractionAt = lastInteractionAt; + return this; + } + + public Builder lastInteractionAt(OffsetDateTime lastInteractionAt) { + this.lastInteractionAt = Optional.ofNullable(lastInteractionAt); + return this; + } + + @JsonSetter(value = "is_private", nulls = Nulls.SKIP) + public Builder isPrivate(Optional isPrivate) { + this.isPrivate = isPrivate; + return this; + } + + public Builder isPrivate(Boolean isPrivate) { + this.isPrivate = Optional.ofNullable(isPrivate); + return this; + } + + @JsonSetter(value = "can_email", nulls = Nulls.SKIP) + public Builder canEmail(Optional canEmail) { + this.canEmail = canEmail; + return this; + } + + public Builder canEmail(Boolean canEmail) { + this.canEmail = Optional.ofNullable(canEmail); + return this; + } + + @JsonSetter(value = "locations", nulls = Nulls.SKIP) + public Builder locations(Optional>> locations) { + this.locations = locations; + return this; + } + + public Builder locations(List> locations) { + this.locations = Optional.ofNullable(locations); + 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 = "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 = "urls", nulls = Nulls.SKIP) + public Builder urls(Optional> urls) { + this.urls = urls; + return this; + } + + public Builder urls(List urls) { + this.urls = Optional.ofNullable(urls); + return this; + } + + @JsonSetter(value = "tags", nulls = Nulls.SKIP) + public Builder tags(Optional>> tags) { + this.tags = tags; + return this; + } + + public Builder tags(List> tags) { + this.tags = Optional.ofNullable(tags); + return this; + } + + @JsonSetter(value = "applications", nulls = Nulls.SKIP) + public Builder applications(Optional>> applications) { + this.applications = applications; + return this; + } + + public Builder applications(List> applications) { + this.applications = Optional.ofNullable(applications); + return this; + } + + @JsonSetter(value = "attachments", nulls = Nulls.SKIP) + public Builder attachments(Optional>> attachments) { + this.attachments = attachments; + return this; + } + + public Builder attachments(List> attachments) { + this.attachments = Optional.ofNullable(attachments); + return this; + } + + @JsonSetter(value = "remote_template_id", nulls = Nulls.SKIP) + public Builder remoteTemplateId(Optional remoteTemplateId) { + this.remoteTemplateId = remoteTemplateId; + return this; + } + + public Builder remoteTemplateId(String remoteTemplateId) { + this.remoteTemplateId = Optional.ofNullable(remoteTemplateId); + 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 CandidateRequest build() { + return new CandidateRequest( + firstName, + lastName, + company, + title, + lastInteractionAt, + isPrivate, + canEmail, + locations, + phoneNumbers, + emailAddresses, + urls, + tags, + applications, + attachments, + remoteTemplateId, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/CandidateRequestApplicationsItem.java b/src/main/java/com/merge/legacy/api/resources/ats/types/CandidateRequestApplicationsItem.java new file mode 100644 index 000000000..21f5cfd96 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/CandidateRequestApplicationsItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CandidateRequestApplicationsItem.Deserializer.class) +public final class CandidateRequestApplicationsItem { + private final Object value; + + private final int type; + + private CandidateRequestApplicationsItem(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((Application) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CandidateRequestApplicationsItem && equalTo((CandidateRequestApplicationsItem) other); + } + + private boolean equalTo(CandidateRequestApplicationsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CandidateRequestApplicationsItem of(String value) { + return new CandidateRequestApplicationsItem(value, 0); + } + + public static CandidateRequestApplicationsItem of(Application value) { + return new CandidateRequestApplicationsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Application value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CandidateRequestApplicationsItem.class); + } + + @Override + public CandidateRequestApplicationsItem 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, Application.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/CandidateRequestAttachmentsItem.java b/src/main/java/com/merge/legacy/api/resources/ats/types/CandidateRequestAttachmentsItem.java new file mode 100644 index 000000000..98467c1e1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/CandidateRequestAttachmentsItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CandidateRequestAttachmentsItem.Deserializer.class) +public final class CandidateRequestAttachmentsItem { + private final Object value; + + private final int type; + + private CandidateRequestAttachmentsItem(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((Attachment) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CandidateRequestAttachmentsItem && equalTo((CandidateRequestAttachmentsItem) other); + } + + private boolean equalTo(CandidateRequestAttachmentsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CandidateRequestAttachmentsItem of(String value) { + return new CandidateRequestAttachmentsItem(value, 0); + } + + public static CandidateRequestAttachmentsItem of(Attachment value) { + return new CandidateRequestAttachmentsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Attachment value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CandidateRequestAttachmentsItem.class); + } + + @Override + public CandidateRequestAttachmentsItem 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, Attachment.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/CandidateResponse.java b/src/main/java/com/merge/legacy/api/resources/ats/types/CandidateResponse.java new file mode 100644 index 000000000..f4eb46e2a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/CandidateResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CandidateResponse.Builder.class) +public final class CandidateResponse { + private final Candidate model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private CandidateResponse( + Candidate 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 Candidate getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CandidateResponse && equalTo((CandidateResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CandidateResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull Candidate model); + + Builder from(CandidateResponse other); + } + + public interface _FinalStage { + CandidateResponse 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 Candidate model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CandidateResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull Candidate model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public CandidateResponse build() { + return new CandidateResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/CategoriesEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/CategoriesEnum.java new file mode 100644 index 000000000..b5943c85f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/CategoriesEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/CategoryEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/CategoryEnum.java new file mode 100644 index 000000000..7bed98afb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/CategoryEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/CommonModelScopeApi.java b/src/main/java/com/merge/legacy/api/resources/ats/types/CommonModelScopeApi.java new file mode 100644 index 000000000..2c08ef1c5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/CommonModelScopeApi.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @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/legacy/api/resources/ats/types/CommonModelScopesBodyRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/types/CommonModelScopesBodyRequest.java new file mode 100644 index 000000000..50070d9fc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/CommonModelScopesBodyRequest.java @@ -0,0 +1,175 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.modelId, this.enabledActions, this.disabledFields); + } + + @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() {} + + @Override + public Builder from(CommonModelScopesBodyRequest other) { + modelId(other.getModelId()); + enabledActions(other.getEnabledActions()); + disabledFields(other.getDisabledFields()); + return this; + } + + @Override + @JsonSetter("model_id") + public _FinalStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @Override + public _FinalStage addAllDisabledFields(List disabledFields) { + this.disabledFields.addAll(disabledFields); + return this; + } + + @Override + public _FinalStage addDisabledFields(String disabledFields) { + this.disabledFields.add(disabledFields); + return this; + } + + @Override + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public _FinalStage disabledFields(List disabledFields) { + this.disabledFields.clear(); + this.disabledFields.addAll(disabledFields); + return this; + } + + @Override + public _FinalStage addAllEnabledActions(List enabledActions) { + this.enabledActions.addAll(enabledActions); + return this; + } + + @Override + public _FinalStage addEnabledActions(EnabledActionsEnum enabledActions) { + this.enabledActions.add(enabledActions); + return this; + } + + @Override + @JsonSetter(value = "enabled_actions", nulls = Nulls.SKIP) + public _FinalStage enabledActions(List enabledActions) { + this.enabledActions.clear(); + this.enabledActions.addAll(enabledActions); + return this; + } + + @Override + public CommonModelScopesBodyRequest build() { + return new CommonModelScopesBodyRequest(modelId, enabledActions, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/DataPassthroughRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/types/DataPassthroughRequest.java new file mode 100644 index 000000000..619a7150a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/DataPassthroughRequest.java @@ -0,0 +1,361 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.baseUrlOverride, + this.data, + this.multipartFormData, + this.headers, + this.requestFormat, + this.normalizeResponse); + } + + @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() {} + + @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; + } + + @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. + */ + @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. + */ + @Override + public _FinalStage normalizeResponse(Boolean normalizeResponse) { + this.normalizeResponse = Optional.ofNullable(normalizeResponse); + return this; + } + + @Override + @JsonSetter(value = "normalize_response", nulls = Nulls.SKIP) + public _FinalStage normalizeResponse(Optional normalizeResponse) { + this.normalizeResponse = normalizeResponse; + return this; + } + + @Override + public _FinalStage requestFormat(RequestFormatEnum requestFormat) { + this.requestFormat = Optional.ofNullable(requestFormat); + return this; + } + + @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. + */ + @Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @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. + */ + @Override + public _FinalStage multipartFormData(List multipartFormData) { + this.multipartFormData = Optional.ofNullable(multipartFormData); + return this; + } + + @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. + */ + @Override + public _FinalStage data(String data) { + this.data = Optional.ofNullable(data); + return this; + } + + @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. + */ + @Override + public _FinalStage baseUrlOverride(String baseUrlOverride) { + this.baseUrlOverride = Optional.ofNullable(baseUrlOverride); + return this; + } + + @Override + @JsonSetter(value = "base_url_override", nulls = Nulls.SKIP) + public _FinalStage baseUrlOverride(Optional baseUrlOverride) { + this.baseUrlOverride = baseUrlOverride; + return this; + } + + @Override + public DataPassthroughRequest build() { + return new DataPassthroughRequest( + method, + path, + baseUrlOverride, + data, + multipartFormData, + headers, + requestFormat, + normalizeResponse, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/DebugModeLog.java b/src/main/java/com/merge/legacy/api/resources/ats/types/DebugModeLog.java new file mode 100644 index 000000000..ac64c99e2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/DebugModeLog.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.logId, this.dashboardView, this.logSummary); + } + + @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() {} + + @Override + public Builder from(DebugModeLog other) { + logId(other.getLogId()); + dashboardView(other.getDashboardView()); + logSummary(other.getLogSummary()); + return this; + } + + @Override + @JsonSetter("log_id") + public DashboardViewStage logId(@NotNull String logId) { + this.logId = logId; + return this; + } + + @Override + @JsonSetter("dashboard_view") + public LogSummaryStage dashboardView(@NotNull String dashboardView) { + this.dashboardView = dashboardView; + return this; + } + + @Override + @JsonSetter("log_summary") + public _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary) { + this.logSummary = logSummary; + return this; + } + + @Override + public DebugModeLog build() { + return new DebugModeLog(logId, dashboardView, logSummary, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/DebugModelLogSummary.java b/src/main/java/com/merge/legacy/api/resources/ats/types/DebugModelLogSummary.java new file mode 100644 index 000000000..56574ce03 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/DebugModelLogSummary.java @@ -0,0 +1,141 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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; + } + + @Override + public int hashCode() { + return Objects.hash(this.url, this.method, this.statusCode); + } + + @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() {} + + @Override + public Builder from(DebugModelLogSummary other) { + url(other.getUrl()); + method(other.getMethod()); + statusCode(other.getStatusCode()); + return this; + } + + @Override + @JsonSetter("url") + public MethodStage url(@NotNull String url) { + this.url = url; + return this; + } + + @Override + @JsonSetter("method") + public StatusCodeStage method(@NotNull String method) { + this.method = method; + return this; + } + + @Override + @JsonSetter("status_code") + public _FinalStage statusCode(int statusCode) { + this.statusCode = statusCode; + return this; + } + + @Override + public DebugModelLogSummary build() { + return new DebugModelLogSummary(url, method, statusCode, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/Department.java b/src/main/java/com/merge/legacy/api/resources/ats/types/Department.java new file mode 100644 index 000000000..2e95c1209 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/Department.java @@ -0,0 +1,290 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Department.Builder.class) +public final class Department { + private final Optional id; + + 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 Department( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + 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 department'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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Department && equalTo((Department) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Department other) { + return id.equals(other.id) + && 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Department other) { + id(other.getId()); + 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 = "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 = "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 Department build() { + return new Department( + id, + remoteId, + createdAt, + modifiedAt, + name, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/DisabilityStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/DisabilityStatusEnum.java new file mode 100644 index 000000000..856101a4b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/DisabilityStatusEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum DisabilityStatusEnum { + YES_I_HAVE_A_DISABILITY_OR_PREVIOUSLY_HAD_A_DISABILITY("YES_I_HAVE_A_DISABILITY_OR_PREVIOUSLY_HAD_A_DISABILITY"), + + NO_I_DONT_HAVE_A_DISABILITY("NO_I_DONT_HAVE_A_DISABILITY"), + + I_DONT_WISH_TO_ANSWER("I_DONT_WISH_TO_ANSWER"); + + private final String value; + + DisabilityStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/Eeoc.java b/src/main/java/com/merge/legacy/api/resources/ats/types/Eeoc.java new file mode 100644 index 000000000..a7c47630a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/Eeoc.java @@ -0,0 +1,462 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Eeoc.Builder.class) +public final class Eeoc { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional candidate; + + private final Optional submittedAt; + + private final Optional race; + + private final Optional gender; + + private final Optional veteranStatus; + + private final Optional disabilityStatus; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Eeoc( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional candidate, + Optional submittedAt, + Optional race, + Optional gender, + Optional veteranStatus, + Optional disabilityStatus, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.candidate = candidate; + this.submittedAt = submittedAt; + this.race = race; + this.gender = gender; + this.veteranStatus = veteranStatus; + this.disabilityStatus = disabilityStatus; + 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 candidate being represented. + */ + @JsonProperty("candidate") + public Optional getCandidate() { + return candidate; + } + + /** + * @return When the information was submitted. + */ + @JsonProperty("submitted_at") + public Optional getSubmittedAt() { + return submittedAt; + } + + /** + * @return The candidate's race. + *
    + *
  • AMERICAN_INDIAN_OR_ALASKAN_NATIVE - AMERICAN_INDIAN_OR_ALASKAN_NATIVE
  • + *
  • ASIAN - ASIAN
  • + *
  • BLACK_OR_AFRICAN_AMERICAN - BLACK_OR_AFRICAN_AMERICAN
  • + *
  • HISPANIC_OR_LATINO - HISPANIC_OR_LATINO
  • + *
  • WHITE - WHITE
  • + *
  • NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER - NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER
  • + *
  • TWO_OR_MORE_RACES - TWO_OR_MORE_RACES
  • + *
  • DECLINE_TO_SELF_IDENTIFY - DECLINE_TO_SELF_IDENTIFY
  • + *
+ */ + @JsonProperty("race") + public Optional getRace() { + return race; + } + + /** + * @return The candidate's gender. + *
    + *
  • MALE - MALE
  • + *
  • FEMALE - FEMALE
  • + *
  • NON-BINARY - NON-BINARY
  • + *
  • OTHER - OTHER
  • + *
  • DECLINE_TO_SELF_IDENTIFY - DECLINE_TO_SELF_IDENTIFY
  • + *
+ */ + @JsonProperty("gender") + public Optional getGender() { + return gender; + } + + /** + * @return The candidate's veteran status. + *
    + *
  • I_AM_NOT_A_PROTECTED_VETERAN - I_AM_NOT_A_PROTECTED_VETERAN
  • + *
  • I_IDENTIFY_AS_ONE_OR_MORE_OF_THE_CLASSIFICATIONS_OF_A_PROTECTED_VETERAN - I_IDENTIFY_AS_ONE_OR_MORE_OF_THE_CLASSIFICATIONS_OF_A_PROTECTED_VETERAN
  • + *
  • I_DONT_WISH_TO_ANSWER - I_DONT_WISH_TO_ANSWER
  • + *
+ */ + @JsonProperty("veteran_status") + public Optional getVeteranStatus() { + return veteranStatus; + } + + /** + * @return The candidate's disability status. + *
    + *
  • YES_I_HAVE_A_DISABILITY_OR_PREVIOUSLY_HAD_A_DISABILITY - YES_I_HAVE_A_DISABILITY_OR_PREVIOUSLY_HAD_A_DISABILITY
  • + *
  • NO_I_DONT_HAVE_A_DISABILITY - NO_I_DONT_HAVE_A_DISABILITY
  • + *
  • I_DONT_WISH_TO_ANSWER - I_DONT_WISH_TO_ANSWER
  • + *
+ */ + @JsonProperty("disability_status") + public Optional getDisabilityStatus() { + return disabilityStatus; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Eeoc && equalTo((Eeoc) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Eeoc other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && candidate.equals(other.candidate) + && submittedAt.equals(other.submittedAt) + && race.equals(other.race) + && gender.equals(other.gender) + && veteranStatus.equals(other.veteranStatus) + && disabilityStatus.equals(other.disabilityStatus) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.candidate, + this.submittedAt, + this.race, + this.gender, + this.veteranStatus, + this.disabilityStatus, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 candidate = Optional.empty(); + + private Optional submittedAt = Optional.empty(); + + private Optional race = Optional.empty(); + + private Optional gender = Optional.empty(); + + private Optional veteranStatus = Optional.empty(); + + private Optional disabilityStatus = 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(Eeoc other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + candidate(other.getCandidate()); + submittedAt(other.getSubmittedAt()); + race(other.getRace()); + gender(other.getGender()); + veteranStatus(other.getVeteranStatus()); + disabilityStatus(other.getDisabilityStatus()); + 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 = "candidate", nulls = Nulls.SKIP) + public Builder candidate(Optional candidate) { + this.candidate = candidate; + return this; + } + + public Builder candidate(EeocCandidate candidate) { + this.candidate = Optional.ofNullable(candidate); + return this; + } + + @JsonSetter(value = "submitted_at", nulls = Nulls.SKIP) + public Builder submittedAt(Optional submittedAt) { + this.submittedAt = submittedAt; + return this; + } + + public Builder submittedAt(OffsetDateTime submittedAt) { + this.submittedAt = Optional.ofNullable(submittedAt); + return this; + } + + @JsonSetter(value = "race", nulls = Nulls.SKIP) + public Builder race(Optional race) { + this.race = race; + return this; + } + + public Builder race(EeocRace race) { + this.race = Optional.ofNullable(race); + return this; + } + + @JsonSetter(value = "gender", nulls = Nulls.SKIP) + public Builder gender(Optional gender) { + this.gender = gender; + return this; + } + + public Builder gender(EeocGender gender) { + this.gender = Optional.ofNullable(gender); + return this; + } + + @JsonSetter(value = "veteran_status", nulls = Nulls.SKIP) + public Builder veteranStatus(Optional veteranStatus) { + this.veteranStatus = veteranStatus; + return this; + } + + public Builder veteranStatus(EeocVeteranStatus veteranStatus) { + this.veteranStatus = Optional.ofNullable(veteranStatus); + return this; + } + + @JsonSetter(value = "disability_status", nulls = Nulls.SKIP) + public Builder disabilityStatus(Optional disabilityStatus) { + this.disabilityStatus = disabilityStatus; + return this; + } + + public Builder disabilityStatus(EeocDisabilityStatus disabilityStatus) { + this.disabilityStatus = Optional.ofNullable(disabilityStatus); + 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 Eeoc build() { + return new Eeoc( + id, + remoteId, + createdAt, + modifiedAt, + candidate, + submittedAt, + race, + gender, + veteranStatus, + disabilityStatus, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/EeocCandidate.java b/src/main/java/com/merge/legacy/api/resources/ats/types/EeocCandidate.java new file mode 100644 index 000000000..65cd31e23 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/EeocCandidate.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EeocCandidate.Deserializer.class) +public final class EeocCandidate { + private final Object value; + + private final int type; + + private EeocCandidate(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((Candidate) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EeocCandidate && equalTo((EeocCandidate) other); + } + + private boolean equalTo(EeocCandidate other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EeocCandidate of(String value) { + return new EeocCandidate(value, 0); + } + + public static EeocCandidate of(Candidate value) { + return new EeocCandidate(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Candidate value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EeocCandidate.class); + } + + @Override + public EeocCandidate 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, Candidate.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/EeocDisabilityStatus.java b/src/main/java/com/merge/legacy/api/resources/ats/types/EeocDisabilityStatus.java new file mode 100644 index 000000000..a31bbe739 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/EeocDisabilityStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/EeocGender.java b/src/main/java/com/merge/legacy/api/resources/ats/types/EeocGender.java new file mode 100644 index 000000000..0d7c91b35 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/EeocGender.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/EeocRace.java b/src/main/java/com/merge/legacy/api/resources/ats/types/EeocRace.java new file mode 100644 index 000000000..474a201c8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/EeocRace.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/EeocVeteranStatus.java b/src/main/java/com/merge/legacy/api/resources/ats/types/EeocVeteranStatus.java new file mode 100644 index 000000000..34af9536d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/EeocVeteranStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/EmailAddress.java b/src/main/java/com/merge/legacy/api/resources/ats/types/EmailAddress.java new file mode 100644 index 000000000..be8604ddb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/EmailAddress.java @@ -0,0 +1,209 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.createdAt, this.modifiedAt, this.value, this.emailAddressType, this.remoteWasDeleted); + } + + @Override + 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/legacy/api/resources/ats/types/EmailAddressEmailAddressType.java b/src/main/java/com/merge/legacy/api/resources/ats/types/EmailAddressEmailAddressType.java new file mode 100644 index 000000000..4baf62b01 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/EmailAddressEmailAddressType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/EmailAddressRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/types/EmailAddressRequest.java new file mode 100644 index 000000000..2c8bb94cd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/EmailAddressRequest.java @@ -0,0 +1,176 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value, this.emailAddressType, this.integrationParams, this.linkedAccountParams); + } + + @Override + 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/legacy/api/resources/ats/types/EmailAddressRequestEmailAddressType.java b/src/main/java/com/merge/legacy/api/resources/ats/types/EmailAddressRequestEmailAddressType.java new file mode 100644 index 000000000..7469b7cb0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/EmailAddressRequestEmailAddressType.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/EmailAddressTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/EmailAddressTypeEnum.java new file mode 100644 index 000000000..6d0c81d1b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/EmailAddressTypeEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EmailAddressTypeEnum { + PERSONAL("PERSONAL"), + + WORK("WORK"), + + OTHER("OTHER"); + + private final String value; + + EmailAddressTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/EnabledActionsEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/EnabledActionsEnum.java new file mode 100644 index 000000000..bcf3cec73 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/EnabledActionsEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/EncodingEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/EncodingEnum.java new file mode 100644 index 000000000..f9da968bf --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/EncodingEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ErrorValidationProblem.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ErrorValidationProblem.java new file mode 100644 index 000000000..a57e3ea65 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ErrorValidationProblem.java @@ -0,0 +1,178 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.source, this.title, this.detail, this.problemType); + } + + @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() {} + + @Override + public Builder from(ErrorValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + return this; + } + + @Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @Override + public ErrorValidationProblem build() { + return new ErrorValidationProblem(source, title, detail, problemType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/EventTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/EventTypeEnum.java new file mode 100644 index 000000000..765526ad6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/EventTypeEnum.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ExternalTargetFieldApi.java new file mode 100644 index 000000000..e32fb43d2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ExternalTargetFieldApi.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isMapped); + } + + @Override + 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/legacy/api/resources/ats/types/ExternalTargetFieldApiResponse.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ExternalTargetFieldApiResponse.java new file mode 100644 index 000000000..a4a223614 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ExternalTargetFieldApiResponse.java @@ -0,0 +1,481 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ats/types/FieldMappingApiInstance.java b/src/main/java/com/merge/legacy/api/resources/ats/types/FieldMappingApiInstance.java new file mode 100644 index 000000000..d7b71198e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/FieldMappingApiInstance.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField); + } + + @Override + 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/legacy/api/resources/ats/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/legacy/api/resources/ats/types/FieldMappingApiInstanceRemoteField.java new file mode 100644 index 000000000..8348ee08e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/FieldMappingApiInstanceRemoteField.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.remoteKeyName, this.schema, this.remoteEndpointInfo); + } + + @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() {} + + @Override + public Builder from(FieldMappingApiInstanceRemoteField other) { + remoteKeyName(other.getRemoteKeyName()); + schema(other.getSchema()); + remoteEndpointInfo(other.getRemoteEndpointInfo()); + return this; + } + + @Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo( + @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @Override + public _FinalStage schema(Map schema) { + this.schema = Optional.ofNullable(schema); + return this; + } + + @Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Optional> schema) { + this.schema = schema; + return this; + } + + @Override + public _FinalStage remoteKeyName(String remoteKeyName) { + this.remoteKeyName = Optional.ofNullable(remoteKeyName); + return this; + } + + @Override + @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) + public _FinalStage remoteKeyName(Optional remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @Override + public FieldMappingApiInstanceRemoteField build() { + return new FieldMappingApiInstanceRemoteField( + remoteKeyName, schema, remoteEndpointInfo, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/legacy/api/resources/ats/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java new file mode 100644 index 000000000..d862f44ab --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java @@ -0,0 +1,138 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @Override + 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/legacy/api/resources/ats/types/FieldMappingApiInstanceResponse.java b/src/main/java/com/merge/legacy/api/resources/ats/types/FieldMappingApiInstanceResponse.java new file mode 100644 index 000000000..5e39dea83 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/FieldMappingApiInstanceResponse.java @@ -0,0 +1,481 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ats/types/FieldMappingApiInstanceTargetField.java b/src/main/java/com/merge/legacy/api/resources/ats/types/FieldMappingApiInstanceTargetField.java new file mode 100644 index 000000000..0d8d94d2b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/FieldMappingApiInstanceTargetField.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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; + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isOrganizationWide); + } + + @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() {} + + @Override + public Builder from(FieldMappingApiInstanceTargetField other) { + name(other.getName()); + description(other.getDescription()); + isOrganizationWide(other.getIsOrganizationWide()); + return this; + } + + @Override + @JsonSetter("name") + public DescriptionStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + @JsonSetter("description") + public IsOrganizationWideStage description(@NotNull String description) { + this.description = description; + return this; + } + + @Override + @JsonSetter("is_organization_wide") + public _FinalStage isOrganizationWide(boolean isOrganizationWide) { + this.isOrganizationWide = isOrganizationWide; + return this; + } + + @Override + public FieldMappingApiInstanceTargetField build() { + return new FieldMappingApiInstanceTargetField(name, description, isOrganizationWide, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/FieldMappingInstanceResponse.java b/src/main/java/com/merge/legacy/api/resources/ats/types/FieldMappingInstanceResponse.java new file mode 100644 index 000000000..37abde506 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/FieldMappingInstanceResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @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() {} + + @Override + public Builder from(FieldMappingInstanceResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull FieldMappingApiInstance model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public FieldMappingInstanceResponse build() { + return new FieldMappingInstanceResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/FieldPermissionDeserializer.java b/src/main/java/com/merge/legacy/api/resources/ats/types/FieldPermissionDeserializer.java new file mode 100644 index 000000000..9dc13a49f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/FieldPermissionDeserializer.java @@ -0,0 +1,112 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @Override + 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/legacy/api/resources/ats/types/FieldPermissionDeserializerRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/types/FieldPermissionDeserializerRequest.java new file mode 100644 index 000000000..bbb86f91e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/FieldPermissionDeserializerRequest.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @Override + 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/legacy/api/resources/ats/types/GenderEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/GenderEnum.java new file mode 100644 index 000000000..5275fe5d8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/GenderEnum.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/IndividualCommonModelScopeDeserializer.java b/src/main/java/com/merge/legacy/api/resources/ats/types/IndividualCommonModelScopeDeserializer.java new file mode 100644 index 000000000..25b2505fb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/IndividualCommonModelScopeDeserializer.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @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() {} + + @Override + public Builder from(IndividualCommonModelScopeDeserializer other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @Override + public _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions(Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @Override + public IndividualCommonModelScopeDeserializer build() { + return new IndividualCommonModelScopeDeserializer( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/IndividualCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/types/IndividualCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..9633b8385 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/IndividualCommonModelScopeDeserializerRequest.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @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() {} + + @Override + public Builder from(IndividualCommonModelScopeDeserializerRequest other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @Override + public _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions( + Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @Override + public IndividualCommonModelScopeDeserializerRequest build() { + return new IndividualCommonModelScopeDeserializerRequest( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/Issue.java b/src/main/java/com/merge/legacy/api/resources/ats/types/Issue.java new file mode 100644 index 000000000..e2c630c21 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/Issue.java @@ -0,0 +1,341 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.status, + this.errorDescription, + this.endUser, + this.firstIncidentTime, + this.lastIncidentTime, + this.isMuted, + this.errorDetails); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("error_description") + public _FinalStage errorDescription(@NotNull String errorDescription) { + this.errorDescription = errorDescription; + return this; + } + + @Override + public _FinalStage errorDetails(List errorDetails) { + this.errorDetails = Optional.ofNullable(errorDetails); + return this; + } + + @Override + @JsonSetter(value = "error_details", nulls = Nulls.SKIP) + public _FinalStage errorDetails(Optional> errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + @Override + public _FinalStage isMuted(Boolean isMuted) { + this.isMuted = Optional.ofNullable(isMuted); + return this; + } + + @Override + @JsonSetter(value = "is_muted", nulls = Nulls.SKIP) + public _FinalStage isMuted(Optional isMuted) { + this.isMuted = isMuted; + return this; + } + + @Override + public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { + this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); + return this; + } + + @Override + @JsonSetter(value = "last_incident_time", nulls = Nulls.SKIP) + public _FinalStage lastIncidentTime(Optional lastIncidentTime) { + this.lastIncidentTime = lastIncidentTime; + return this; + } + + @Override + public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { + this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); + return this; + } + + @Override + @JsonSetter(value = "first_incident_time", nulls = Nulls.SKIP) + public _FinalStage firstIncidentTime(Optional firstIncidentTime) { + this.firstIncidentTime = firstIncidentTime; + return this; + } + + @Override + public _FinalStage endUser(Map endUser) { + this.endUser = Optional.ofNullable(endUser); + return this; + } + + @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. + */ + @Override + public _FinalStage status(IssueStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @Override + public Issue build() { + return new Issue( + id, + status, + errorDescription, + endUser, + firstIncidentTime, + lastIncidentTime, + isMuted, + errorDetails, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/IssueStatus.java b/src/main/java/com/merge/legacy/api/resources/ats/types/IssueStatus.java new file mode 100644 index 000000000..df4818088 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/IssueStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/IssueStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/IssueStatusEnum.java new file mode 100644 index 000000000..9795ab7c4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/IssueStatusEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/Job.java b/src/main/java/com/merge/legacy/api/resources/ats/types/Job.java new file mode 100644 index 000000000..0938e6610 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/Job.java @@ -0,0 +1,676 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Job.Builder.class) +public final class Job { + 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 code; + + private final Optional status; + + private final Optional type; + + private final Optional>> jobPostings; + + private final Optional> jobPostingUrls; + + private final Optional remoteCreatedAt; + + private final Optional remoteUpdatedAt; + + private final Optional confidential; + + private final Optional>> departments; + + private final Optional>> offices; + + private final Optional>> hiringManagers; + + private final Optional>> recruiters; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Job( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional description, + Optional code, + Optional status, + Optional type, + Optional>> jobPostings, + Optional> jobPostingUrls, + Optional remoteCreatedAt, + Optional remoteUpdatedAt, + Optional confidential, + Optional>> departments, + Optional>> offices, + Optional>> hiringManagers, + Optional>> recruiters, + 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.code = code; + this.status = status; + this.type = type; + this.jobPostings = jobPostings; + this.jobPostingUrls = jobPostingUrls; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteUpdatedAt = remoteUpdatedAt; + this.confidential = confidential; + this.departments = departments; + this.offices = offices; + this.hiringManagers = hiringManagers; + this.recruiters = recruiters; + 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 job's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The job's description. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The job's code. Typically an additional identifier used to reference the particular job that is displayed on the ATS. + */ + @JsonProperty("code") + public Optional getCode() { + return code; + } + + /** + * @return The job's status. + *
    + *
  • OPEN - OPEN
  • + *
  • CLOSED - CLOSED
  • + *
  • DRAFT - DRAFT
  • + *
  • ARCHIVED - ARCHIVED
  • + *
  • PENDING - PENDING
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The job's type. + *
    + *
  • POSTING - POSTING
  • + *
  • REQUISITION - REQUISITION
  • + *
  • PROFILE - PROFILE
  • + *
+ */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return IDs of JobPosting objects that serve as job postings for this Job. + */ + @JsonProperty("job_postings") + public Optional>> getJobPostings() { + return jobPostings; + } + + @JsonProperty("job_posting_urls") + public Optional> getJobPostingUrls() { + return jobPostingUrls; + } + + /** + * @return When the third party's job was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the third party's job was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @return Whether the job is confidential. + */ + @JsonProperty("confidential") + public Optional getConfidential() { + return confidential; + } + + /** + * @return IDs of Department objects for this Job. + */ + @JsonProperty("departments") + public Optional>> getDepartments() { + return departments; + } + + /** + * @return IDs of Office objects for this Job. + */ + @JsonProperty("offices") + public Optional>> getOffices() { + return offices; + } + + /** + * @return IDs of RemoteUser objects that serve as hiring managers for this Job. + */ + @JsonProperty("hiring_managers") + public Optional>> getHiringManagers() { + return hiringManagers; + } + + /** + * @return IDs of RemoteUser objects that serve as recruiters for this Job. + */ + @JsonProperty("recruiters") + public Optional>> getRecruiters() { + return recruiters; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Job && equalTo((Job) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Job 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) + && code.equals(other.code) + && status.equals(other.status) + && type.equals(other.type) + && jobPostings.equals(other.jobPostings) + && jobPostingUrls.equals(other.jobPostingUrls) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && confidential.equals(other.confidential) + && departments.equals(other.departments) + && offices.equals(other.offices) + && hiringManagers.equals(other.hiringManagers) + && recruiters.equals(other.recruiters) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.description, + this.code, + this.status, + this.type, + this.jobPostings, + this.jobPostingUrls, + this.remoteCreatedAt, + this.remoteUpdatedAt, + this.confidential, + this.departments, + this.offices, + this.hiringManagers, + this.recruiters, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 code = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional>> jobPostings = Optional.empty(); + + private Optional> jobPostingUrls = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional confidential = Optional.empty(); + + private Optional>> departments = Optional.empty(); + + private Optional>> offices = Optional.empty(); + + private Optional>> hiringManagers = Optional.empty(); + + private Optional>> recruiters = 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(Job other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + description(other.getDescription()); + code(other.getCode()); + status(other.getStatus()); + type(other.getType()); + jobPostings(other.getJobPostings()); + jobPostingUrls(other.getJobPostingUrls()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + confidential(other.getConfidential()); + departments(other.getDepartments()); + offices(other.getOffices()); + hiringManagers(other.getHiringManagers()); + recruiters(other.getRecruiters()); + 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 = "code", nulls = Nulls.SKIP) + public Builder code(Optional code) { + this.code = code; + return this; + } + + public Builder code(String code) { + this.code = Optional.ofNullable(code); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(JobStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(JobTypeEnum type) { + this.type = Optional.ofNullable(type); + return this; + } + + @JsonSetter(value = "job_postings", nulls = Nulls.SKIP) + public Builder jobPostings(Optional>> jobPostings) { + this.jobPostings = jobPostings; + return this; + } + + public Builder jobPostings(List> jobPostings) { + this.jobPostings = Optional.ofNullable(jobPostings); + return this; + } + + @JsonSetter(value = "job_posting_urls", nulls = Nulls.SKIP) + public Builder jobPostingUrls(Optional> jobPostingUrls) { + this.jobPostingUrls = jobPostingUrls; + return this; + } + + public Builder jobPostingUrls(List jobPostingUrls) { + this.jobPostingUrls = Optional.ofNullable(jobPostingUrls); + 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_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 = "confidential", nulls = Nulls.SKIP) + public Builder confidential(Optional confidential) { + this.confidential = confidential; + return this; + } + + public Builder confidential(Boolean confidential) { + this.confidential = Optional.ofNullable(confidential); + return this; + } + + @JsonSetter(value = "departments", nulls = Nulls.SKIP) + public Builder departments(Optional>> departments) { + this.departments = departments; + return this; + } + + public Builder departments(List> departments) { + this.departments = Optional.ofNullable(departments); + return this; + } + + @JsonSetter(value = "offices", nulls = Nulls.SKIP) + public Builder offices(Optional>> offices) { + this.offices = offices; + return this; + } + + public Builder offices(List> offices) { + this.offices = Optional.ofNullable(offices); + return this; + } + + @JsonSetter(value = "hiring_managers", nulls = Nulls.SKIP) + public Builder hiringManagers(Optional>> hiringManagers) { + this.hiringManagers = hiringManagers; + return this; + } + + public Builder hiringManagers(List> hiringManagers) { + this.hiringManagers = Optional.ofNullable(hiringManagers); + return this; + } + + @JsonSetter(value = "recruiters", nulls = Nulls.SKIP) + public Builder recruiters(Optional>> recruiters) { + this.recruiters = recruiters; + return this; + } + + public Builder recruiters(List> recruiters) { + this.recruiters = Optional.ofNullable(recruiters); + 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 Job build() { + return new Job( + id, + remoteId, + createdAt, + modifiedAt, + name, + description, + code, + status, + type, + jobPostings, + jobPostingUrls, + remoteCreatedAt, + remoteUpdatedAt, + confidential, + departments, + offices, + hiringManagers, + recruiters, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/JobDepartmentsItem.java b/src/main/java/com/merge/legacy/api/resources/ats/types/JobDepartmentsItem.java new file mode 100644 index 000000000..9206081a7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/JobDepartmentsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = JobDepartmentsItem.Deserializer.class) +public final class JobDepartmentsItem { + private final Object value; + + private final int type; + + private JobDepartmentsItem(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((Department) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JobDepartmentsItem && equalTo((JobDepartmentsItem) other); + } + + private boolean equalTo(JobDepartmentsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static JobDepartmentsItem of(String value) { + return new JobDepartmentsItem(value, 0); + } + + public static JobDepartmentsItem of(Department value) { + return new JobDepartmentsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Department value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(JobDepartmentsItem.class); + } + + @Override + public JobDepartmentsItem 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, Department.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/JobHiringManagersItem.java b/src/main/java/com/merge/legacy/api/resources/ats/types/JobHiringManagersItem.java new file mode 100644 index 000000000..f46ced19d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/JobHiringManagersItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = JobHiringManagersItem.Deserializer.class) +public final class JobHiringManagersItem { + private final Object value; + + private final int type; + + private JobHiringManagersItem(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((RemoteUser) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JobHiringManagersItem && equalTo((JobHiringManagersItem) other); + } + + private boolean equalTo(JobHiringManagersItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static JobHiringManagersItem of(String value) { + return new JobHiringManagersItem(value, 0); + } + + public static JobHiringManagersItem of(RemoteUser value) { + return new JobHiringManagersItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(RemoteUser value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(JobHiringManagersItem.class); + } + + @Override + public JobHiringManagersItem 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, RemoteUser.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/JobInterviewStage.java b/src/main/java/com/merge/legacy/api/resources/ats/types/JobInterviewStage.java new file mode 100644 index 000000000..3ba259935 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/JobInterviewStage.java @@ -0,0 +1,348 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = JobInterviewStage.Builder.class) +public final class JobInterviewStage { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional job; + + private final Optional stageOrder; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private JobInterviewStage( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional job, + Optional stageOrder, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.job = job; + this.stageOrder = stageOrder; + 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 Standard stage names are offered by ATS systems but can be modified by users. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return This field is populated only if the stage is specific to a particular job. If the stage is generic, this field will not be populated. + */ + @JsonProperty("job") + public Optional getJob() { + return job; + } + + /** + * @return The stage’s order, with the lowest values ordered first. If the third-party does not return details on the order of stages, this field will not be populated. + */ + @JsonProperty("stage_order") + public Optional getStageOrder() { + return stageOrder; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JobInterviewStage && equalTo((JobInterviewStage) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(JobInterviewStage other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && job.equals(other.job) + && stageOrder.equals(other.stageOrder) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.job, + this.stageOrder, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 job = Optional.empty(); + + private Optional stageOrder = 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(JobInterviewStage other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + job(other.getJob()); + stageOrder(other.getStageOrder()); + 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 = "job", nulls = Nulls.SKIP) + public Builder job(Optional job) { + this.job = job; + return this; + } + + public Builder job(JobInterviewStageJob job) { + this.job = Optional.ofNullable(job); + return this; + } + + @JsonSetter(value = "stage_order", nulls = Nulls.SKIP) + public Builder stageOrder(Optional stageOrder) { + this.stageOrder = stageOrder; + return this; + } + + public Builder stageOrder(Integer stageOrder) { + this.stageOrder = Optional.ofNullable(stageOrder); + 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 JobInterviewStage build() { + return new JobInterviewStage( + id, + remoteId, + createdAt, + modifiedAt, + name, + job, + stageOrder, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/JobInterviewStageJob.java b/src/main/java/com/merge/legacy/api/resources/ats/types/JobInterviewStageJob.java new file mode 100644 index 000000000..1a0fc0296 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/JobInterviewStageJob.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = JobInterviewStageJob.Deserializer.class) +public final class JobInterviewStageJob { + private final Object value; + + private final int type; + + private JobInterviewStageJob(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((Job) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JobInterviewStageJob && equalTo((JobInterviewStageJob) other); + } + + private boolean equalTo(JobInterviewStageJob other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static JobInterviewStageJob of(String value) { + return new JobInterviewStageJob(value, 0); + } + + public static JobInterviewStageJob of(Job value) { + return new JobInterviewStageJob(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Job value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(JobInterviewStageJob.class); + } + + @Override + public JobInterviewStageJob 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, Job.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/JobOfficesItem.java b/src/main/java/com/merge/legacy/api/resources/ats/types/JobOfficesItem.java new file mode 100644 index 000000000..90cfe10d7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/JobOfficesItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = JobOfficesItem.Deserializer.class) +public final class JobOfficesItem { + private final Object value; + + private final int type; + + private JobOfficesItem(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((Office) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JobOfficesItem && equalTo((JobOfficesItem) other); + } + + private boolean equalTo(JobOfficesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static JobOfficesItem of(String value) { + return new JobOfficesItem(value, 0); + } + + public static JobOfficesItem of(Office value) { + return new JobOfficesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Office value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(JobOfficesItem.class); + } + + @Override + public JobOfficesItem 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, Office.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/JobPosting.java b/src/main/java/com/merge/legacy/api/resources/ats/types/JobPosting.java new file mode 100644 index 000000000..819e88db5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/JobPosting.java @@ -0,0 +1,500 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = JobPosting.Builder.class) +public final class JobPosting { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional title; + + private final Optional> jobPostingUrls; + + private final Optional job; + + private final Optional status; + + private final Optional content; + + private final Optional remoteCreatedAt; + + private final Optional remoteUpdatedAt; + + private final Optional isInternal; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private JobPosting( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional title, + Optional> jobPostingUrls, + Optional job, + Optional status, + Optional content, + Optional remoteCreatedAt, + Optional remoteUpdatedAt, + Optional isInternal, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.title = title; + this.jobPostingUrls = jobPostingUrls; + this.job = job; + this.status = status; + this.content = content; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteUpdatedAt = remoteUpdatedAt; + this.isInternal = isInternal; + 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 job posting’s title. + */ + @JsonProperty("title") + public Optional getTitle() { + return title; + } + + /** + * @return The Url object is used to represent hyperlinks for a candidate to apply to a given job. + */ + @JsonProperty("job_posting_urls") + public Optional> getJobPostingUrls() { + return jobPostingUrls; + } + + /** + * @return ID of Job object for this JobPosting. + */ + @JsonProperty("job") + public Optional getJob() { + return job; + } + + /** + * @return The job posting's status. + *
    + *
  • PUBLISHED - PUBLISHED
  • + *
  • CLOSED - CLOSED
  • + *
  • DRAFT - DRAFT
  • + *
  • INTERNAL - INTERNAL
  • + *
  • PENDING - PENDING
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The job posting’s content. + */ + @JsonProperty("content") + public Optional getContent() { + return content; + } + + /** + * @return When the third party's job posting was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the third party's job posting was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @return Indicates whether the job posting is internal or external. + */ + @JsonProperty("is_internal") + public Optional getIsInternal() { + return isInternal; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JobPosting && equalTo((JobPosting) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(JobPosting other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && title.equals(other.title) + && jobPostingUrls.equals(other.jobPostingUrls) + && job.equals(other.job) + && status.equals(other.status) + && content.equals(other.content) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && isInternal.equals(other.isInternal) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.title, + this.jobPostingUrls, + this.job, + this.status, + this.content, + this.remoteCreatedAt, + this.remoteUpdatedAt, + this.isInternal, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 title = Optional.empty(); + + private Optional> jobPostingUrls = Optional.empty(); + + private Optional job = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional content = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional isInternal = 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(JobPosting other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + title(other.getTitle()); + jobPostingUrls(other.getJobPostingUrls()); + job(other.getJob()); + status(other.getStatus()); + content(other.getContent()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + isInternal(other.getIsInternal()); + 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 = "title", nulls = Nulls.SKIP) + public Builder title(Optional title) { + this.title = title; + return this; + } + + public Builder title(String title) { + this.title = Optional.ofNullable(title); + return this; + } + + @JsonSetter(value = "job_posting_urls", nulls = Nulls.SKIP) + public Builder jobPostingUrls(Optional> jobPostingUrls) { + this.jobPostingUrls = jobPostingUrls; + return this; + } + + public Builder jobPostingUrls(List jobPostingUrls) { + this.jobPostingUrls = Optional.ofNullable(jobPostingUrls); + return this; + } + + @JsonSetter(value = "job", nulls = Nulls.SKIP) + public Builder job(Optional job) { + this.job = job; + return this; + } + + public Builder job(JobPostingJob job) { + this.job = Optional.ofNullable(job); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(JobPostingStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "content", nulls = Nulls.SKIP) + public Builder content(Optional content) { + this.content = content; + return this; + } + + public Builder content(String content) { + this.content = Optional.ofNullable(content); + 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_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 = "is_internal", nulls = Nulls.SKIP) + public Builder isInternal(Optional isInternal) { + this.isInternal = isInternal; + return this; + } + + public Builder isInternal(Boolean isInternal) { + this.isInternal = Optional.ofNullable(isInternal); + 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 JobPosting build() { + return new JobPosting( + id, + remoteId, + createdAt, + modifiedAt, + title, + jobPostingUrls, + job, + status, + content, + remoteCreatedAt, + remoteUpdatedAt, + isInternal, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/JobPostingJob.java b/src/main/java/com/merge/legacy/api/resources/ats/types/JobPostingJob.java new file mode 100644 index 000000000..0f1f1f8bf --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/JobPostingJob.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = JobPostingJob.Deserializer.class) +public final class JobPostingJob { + private final Object value; + + private final int type; + + private JobPostingJob(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((Job) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JobPostingJob && equalTo((JobPostingJob) other); + } + + private boolean equalTo(JobPostingJob other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static JobPostingJob of(String value) { + return new JobPostingJob(value, 0); + } + + public static JobPostingJob of(Job value) { + return new JobPostingJob(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Job value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(JobPostingJob.class); + } + + @Override + public JobPostingJob 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, Job.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/JobPostingJobPostingUrlsItem.java b/src/main/java/com/merge/legacy/api/resources/ats/types/JobPostingJobPostingUrlsItem.java new file mode 100644 index 000000000..d1bbc330c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/JobPostingJobPostingUrlsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = JobPostingJobPostingUrlsItem.Deserializer.class) +public final class JobPostingJobPostingUrlsItem { + private final Object value; + + private final int type; + + private JobPostingJobPostingUrlsItem(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((Url) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JobPostingJobPostingUrlsItem && equalTo((JobPostingJobPostingUrlsItem) other); + } + + private boolean equalTo(JobPostingJobPostingUrlsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static JobPostingJobPostingUrlsItem of(String value) { + return new JobPostingJobPostingUrlsItem(value, 0); + } + + public static JobPostingJobPostingUrlsItem of(Url value) { + return new JobPostingJobPostingUrlsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Url value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(JobPostingJobPostingUrlsItem.class); + } + + @Override + public JobPostingJobPostingUrlsItem 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, Url.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/JobPostingStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/JobPostingStatusEnum.java new file mode 100644 index 000000000..dfda18122 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/JobPostingStatusEnum.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum JobPostingStatusEnum { + PUBLISHED("PUBLISHED"), + + CLOSED("CLOSED"), + + DRAFT("DRAFT"), + + INTERNAL("INTERNAL"), + + PENDING("PENDING"); + + private final String value; + + JobPostingStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/JobRecruitersItem.java b/src/main/java/com/merge/legacy/api/resources/ats/types/JobRecruitersItem.java new file mode 100644 index 000000000..c142ddc9e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/JobRecruitersItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = JobRecruitersItem.Deserializer.class) +public final class JobRecruitersItem { + private final Object value; + + private final int type; + + private JobRecruitersItem(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((RemoteUser) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JobRecruitersItem && equalTo((JobRecruitersItem) other); + } + + private boolean equalTo(JobRecruitersItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static JobRecruitersItem of(String value) { + return new JobRecruitersItem(value, 0); + } + + public static JobRecruitersItem of(RemoteUser value) { + return new JobRecruitersItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(RemoteUser value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(JobRecruitersItem.class); + } + + @Override + public JobRecruitersItem 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, RemoteUser.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/JobStatus.java b/src/main/java/com/merge/legacy/api/resources/ats/types/JobStatus.java new file mode 100644 index 000000000..ad0491ee9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/JobStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/JobStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/JobStatusEnum.java new file mode 100644 index 000000000..7d66cdde7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/JobStatusEnum.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum JobStatusEnum { + OPEN("OPEN"), + + CLOSED("CLOSED"), + + DRAFT("DRAFT"), + + ARCHIVED("ARCHIVED"), + + PENDING("PENDING"); + + private final String value; + + JobStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/JobTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/JobTypeEnum.java new file mode 100644 index 000000000..6a5b76518 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/JobTypeEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum JobTypeEnum { + POSTING("POSTING"), + + REQUISITION("REQUISITION"), + + PROFILE("PROFILE"); + + private final String value; + + JobTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/LanguageEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/LanguageEnum.java new file mode 100644 index 000000000..48fd0ff4b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/LanguageEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/LinkToken.java b/src/main/java/com/merge/legacy/api/resources/ats/types/LinkToken.java new file mode 100644 index 000000000..7b73659d3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/LinkToken.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.linkToken, this.integrationName, this.magicLinkUrl); + } + + @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() {} + + @Override + public Builder from(LinkToken other) { + linkToken(other.getLinkToken()); + integrationName(other.getIntegrationName()); + magicLinkUrl(other.getMagicLinkUrl()); + return this; + } + + @Override + @JsonSetter("link_token") + public _FinalStage linkToken(@NotNull String linkToken) { + this.linkToken = linkToken; + return this; + } + + @Override + public _FinalStage magicLinkUrl(String magicLinkUrl) { + this.magicLinkUrl = Optional.ofNullable(magicLinkUrl); + return this; + } + + @Override + @JsonSetter(value = "magic_link_url", nulls = Nulls.SKIP) + public _FinalStage magicLinkUrl(Optional magicLinkUrl) { + this.magicLinkUrl = magicLinkUrl; + return this; + } + + @Override + public _FinalStage integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @Override + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public _FinalStage integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + @Override + public LinkToken build() { + return new LinkToken(linkToken, integrationName, magicLinkUrl, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/LinkedAccountStatus.java b/src/main/java/com/merge/legacy/api/resources/ats/types/LinkedAccountStatus.java new file mode 100644 index 000000000..e70221ff8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/LinkedAccountStatus.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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; + } + + @Override + public int hashCode() { + return Objects.hash(this.linkedAccountStatus, this.canMakeRequest); + } + + @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() {} + + @Override + public Builder from(LinkedAccountStatus other) { + linkedAccountStatus(other.getLinkedAccountStatus()); + canMakeRequest(other.getCanMakeRequest()); + return this; + } + + @Override + @JsonSetter("linked_account_status") + public CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus) { + this.linkedAccountStatus = linkedAccountStatus; + return this; + } + + @Override + @JsonSetter("can_make_request") + public _FinalStage canMakeRequest(boolean canMakeRequest) { + this.canMakeRequest = canMakeRequest; + return this; + } + + @Override + public LinkedAccountStatus build() { + return new LinkedAccountStatus(linkedAccountStatus, canMakeRequest, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/MetaResponse.java b/src/main/java/com/merge/legacy/api/resources/ats/types/MetaResponse.java new file mode 100644 index 000000000..a6877b75f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/MetaResponse.java @@ -0,0 +1,232 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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; + } + + @Override + public int hashCode() { + return Objects.hash( + this.requestSchema, + this.remoteFieldClasses, + this.status, + this.hasConditionalParams, + this.hasRequiredLinkedAccountParams); + } + + @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() {} + + @Override + public Builder from(MetaResponse other) { + requestSchema(other.getRequestSchema()); + remoteFieldClasses(other.getRemoteFieldClasses()); + status(other.getStatus()); + hasConditionalParams(other.getHasConditionalParams()); + hasRequiredLinkedAccountParams(other.getHasRequiredLinkedAccountParams()); + return this; + } + + @Override + @JsonSetter("has_conditional_params") + public HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams) { + this.hasConditionalParams = hasConditionalParams; + return this; + } + + @Override + @JsonSetter("has_required_linked_account_params") + public _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams) { + this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; + return this; + } + + @Override + public _FinalStage status(LinkedAccountStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @Override + public _FinalStage remoteFieldClasses(Map remoteFieldClasses) { + this.remoteFieldClasses = Optional.ofNullable(remoteFieldClasses); + return this; + } + + @Override + @JsonSetter(value = "remote_field_classes", nulls = Nulls.SKIP) + public _FinalStage remoteFieldClasses(Optional> remoteFieldClasses) { + this.remoteFieldClasses = remoteFieldClasses; + return this; + } + + @Override + public _FinalStage requestSchema(String key, JsonNode value) { + this.requestSchema.put(key, value); + return this; + } + + @Override + public _FinalStage putAllRequestSchema(Map requestSchema) { + this.requestSchema.putAll(requestSchema); + return this; + } + + @Override + @JsonSetter(value = "request_schema", nulls = Nulls.SKIP) + public _FinalStage requestSchema(Map requestSchema) { + this.requestSchema.clear(); + this.requestSchema.putAll(requestSchema); + return this; + } + + @Override + public MetaResponse build() { + return new MetaResponse( + requestSchema, + remoteFieldClasses, + status, + hasConditionalParams, + hasRequiredLinkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/MethodEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/MethodEnum.java new file mode 100644 index 000000000..6630817a0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/MethodEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ModelOperation.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ModelOperation.java new file mode 100644 index 000000000..092b245ac --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ModelOperation.java @@ -0,0 +1,216 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.modelName, this.availableOperations, this.requiredPostParameters, this.supportedFields); + } + + @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() {} + + @Override + public Builder from(ModelOperation other) { + modelName(other.getModelName()); + availableOperations(other.getAvailableOperations()); + requiredPostParameters(other.getRequiredPostParameters()); + supportedFields(other.getSupportedFields()); + return this; + } + + @Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @Override + public _FinalStage addAllSupportedFields(List supportedFields) { + this.supportedFields.addAll(supportedFields); + return this; + } + + @Override + public _FinalStage addSupportedFields(String supportedFields) { + this.supportedFields.add(supportedFields); + return this; + } + + @Override + @JsonSetter(value = "supported_fields", nulls = Nulls.SKIP) + public _FinalStage supportedFields(List supportedFields) { + this.supportedFields.clear(); + this.supportedFields.addAll(supportedFields); + return this; + } + + @Override + public _FinalStage addAllRequiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.addAll(requiredPostParameters); + return this; + } + + @Override + public _FinalStage addRequiredPostParameters(String requiredPostParameters) { + this.requiredPostParameters.add(requiredPostParameters); + return this; + } + + @Override + @JsonSetter(value = "required_post_parameters", nulls = Nulls.SKIP) + public _FinalStage requiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.clear(); + this.requiredPostParameters.addAll(requiredPostParameters); + return this; + } + + @Override + public _FinalStage addAllAvailableOperations(List availableOperations) { + this.availableOperations.addAll(availableOperations); + return this; + } + + @Override + public _FinalStage addAvailableOperations(String availableOperations) { + this.availableOperations.add(availableOperations); + return this; + } + + @Override + @JsonSetter(value = "available_operations", nulls = Nulls.SKIP) + public _FinalStage availableOperations(List availableOperations) { + this.availableOperations.clear(); + this.availableOperations.addAll(availableOperations); + return this; + } + + @Override + public ModelOperation build() { + return new ModelOperation( + modelName, availableOperations, requiredPostParameters, supportedFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ModelPermissionDeserializer.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ModelPermissionDeserializer.java new file mode 100644 index 000000000..8dd2b2d45 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ModelPermissionDeserializer.java @@ -0,0 +1,89 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @Override + 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/legacy/api/resources/ats/types/ModelPermissionDeserializerRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ModelPermissionDeserializerRequest.java new file mode 100644 index 000000000..831897a64 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ModelPermissionDeserializerRequest.java @@ -0,0 +1,90 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @Override + 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/legacy/api/resources/ats/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/types/MultipartFormFieldRequest.java new file mode 100644 index 000000000..6458542f8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/MultipartFormFieldRequest.java @@ -0,0 +1,259 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.data, this.encoding, this.fileName, this.contentType); + } + + @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() {} + + @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. + */ + @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. + */ + @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. + */ + @Override + public _FinalStage contentType(String contentType) { + this.contentType = Optional.ofNullable(contentType); + return this; + } + + @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. + */ + @Override + public _FinalStage fileName(String fileName) { + this.fileName = Optional.ofNullable(fileName); + return this; + } + + @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. + */ + @Override + public _FinalStage encoding(MultipartFormFieldRequestEncoding encoding) { + this.encoding = Optional.ofNullable(encoding); + return this; + } + + @Override + @JsonSetter(value = "encoding", nulls = Nulls.SKIP) + public _FinalStage encoding(Optional encoding) { + this.encoding = encoding; + return this; + } + + @Override + public MultipartFormFieldRequest build() { + return new MultipartFormFieldRequest(name, data, encoding, fileName, contentType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/MultipartFormFieldRequestEncoding.java b/src/main/java/com/merge/legacy/api/resources/ats/types/MultipartFormFieldRequestEncoding.java new file mode 100644 index 000000000..d97c23b0b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/MultipartFormFieldRequestEncoding.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/Offer.java b/src/main/java/com/merge/legacy/api/resources/ats/types/Offer.java new file mode 100644 index 000000000..93954cfb4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/Offer.java @@ -0,0 +1,475 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Offer.Builder.class) +public final class Offer { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional application; + + private final Optional creator; + + private final Optional remoteCreatedAt; + + private final Optional closedAt; + + private final Optional sentAt; + + private final Optional startDate; + + private final Optional status; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Offer( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional application, + Optional creator, + Optional remoteCreatedAt, + Optional closedAt, + Optional sentAt, + Optional startDate, + Optional status, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.application = application; + this.creator = creator; + this.remoteCreatedAt = remoteCreatedAt; + this.closedAt = closedAt; + this.sentAt = sentAt; + this.startDate = startDate; + 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 application who is receiving the offer. + */ + @JsonProperty("application") + public Optional getApplication() { + return application; + } + + /** + * @return The user who created the offer. + */ + @JsonProperty("creator") + public Optional getCreator() { + return creator; + } + + /** + * @return When the third party's offer was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the offer was closed. + */ + @JsonProperty("closed_at") + public Optional getClosedAt() { + return closedAt; + } + + /** + * @return When the offer was sent. + */ + @JsonProperty("sent_at") + public Optional getSentAt() { + return sentAt; + } + + /** + * @return The employment start date on the offer. + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return The offer's status. + *
    + *
  • DRAFT - DRAFT
  • + *
  • APPROVAL-SENT - APPROVAL-SENT
  • + *
  • APPROVED - APPROVED
  • + *
  • SENT - SENT
  • + *
  • SENT-MANUALLY - SENT-MANUALLY
  • + *
  • OPENED - OPENED
  • + *
  • DENIED - DENIED
  • + *
  • SIGNED - SIGNED
  • + *
  • DEPRECATED - DEPRECATED
  • + *
+ */ + @JsonProperty("status") + public Optional 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Offer && equalTo((Offer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Offer other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && application.equals(other.application) + && creator.equals(other.creator) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && closedAt.equals(other.closedAt) + && sentAt.equals(other.sentAt) + && startDate.equals(other.startDate) + && status.equals(other.status) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.application, + this.creator, + this.remoteCreatedAt, + this.closedAt, + this.sentAt, + this.startDate, + this.status, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 application = Optional.empty(); + + private Optional creator = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional closedAt = Optional.empty(); + + private Optional sentAt = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional status = 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(Offer other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + application(other.getApplication()); + creator(other.getCreator()); + remoteCreatedAt(other.getRemoteCreatedAt()); + closedAt(other.getClosedAt()); + sentAt(other.getSentAt()); + startDate(other.getStartDate()); + status(other.getStatus()); + 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 = "application", nulls = Nulls.SKIP) + public Builder application(Optional application) { + this.application = application; + return this; + } + + public Builder application(OfferApplication application) { + this.application = Optional.ofNullable(application); + return this; + } + + @JsonSetter(value = "creator", nulls = Nulls.SKIP) + public Builder creator(Optional creator) { + this.creator = creator; + return this; + } + + public Builder creator(OfferCreator creator) { + this.creator = Optional.ofNullable(creator); + 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 = "closed_at", nulls = Nulls.SKIP) + public Builder closedAt(Optional closedAt) { + this.closedAt = closedAt; + return this; + } + + public Builder closedAt(OffsetDateTime closedAt) { + this.closedAt = Optional.ofNullable(closedAt); + return this; + } + + @JsonSetter(value = "sent_at", nulls = Nulls.SKIP) + public Builder sentAt(Optional sentAt) { + this.sentAt = sentAt; + return this; + } + + public Builder sentAt(OffsetDateTime sentAt) { + this.sentAt = Optional.ofNullable(sentAt); + 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 = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(OfferStatus status) { + this.status = Optional.ofNullable(status); + 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 Offer build() { + return new Offer( + id, + remoteId, + createdAt, + modifiedAt, + application, + creator, + remoteCreatedAt, + closedAt, + sentAt, + startDate, + status, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/OfferApplication.java b/src/main/java/com/merge/legacy/api/resources/ats/types/OfferApplication.java new file mode 100644 index 000000000..c28261e28 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/OfferApplication.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = OfferApplication.Deserializer.class) +public final class OfferApplication { + private final Object value; + + private final int type; + + private OfferApplication(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((Application) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OfferApplication && equalTo((OfferApplication) other); + } + + private boolean equalTo(OfferApplication other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static OfferApplication of(String value) { + return new OfferApplication(value, 0); + } + + public static OfferApplication of(Application value) { + return new OfferApplication(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Application value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(OfferApplication.class); + } + + @Override + public OfferApplication 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, Application.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/OfferCreator.java b/src/main/java/com/merge/legacy/api/resources/ats/types/OfferCreator.java new file mode 100644 index 000000000..e4e2310ef --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/OfferCreator.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = OfferCreator.Deserializer.class) +public final class OfferCreator { + private final Object value; + + private final int type; + + private OfferCreator(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((RemoteUser) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OfferCreator && equalTo((OfferCreator) other); + } + + private boolean equalTo(OfferCreator other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static OfferCreator of(String value) { + return new OfferCreator(value, 0); + } + + public static OfferCreator of(RemoteUser value) { + return new OfferCreator(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(RemoteUser value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(OfferCreator.class); + } + + @Override + public OfferCreator 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, RemoteUser.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/OfferStatus.java b/src/main/java/com/merge/legacy/api/resources/ats/types/OfferStatus.java new file mode 100644 index 000000000..d0abc6f72 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/OfferStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/OfferStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/OfferStatusEnum.java new file mode 100644 index 000000000..38befdc4f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/OfferStatusEnum.java @@ -0,0 +1,38 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum OfferStatusEnum { + DRAFT("DRAFT"), + + APPROVAL_SENT("APPROVAL-SENT"), + + APPROVED("APPROVED"), + + SENT("SENT"), + + SENT_MANUALLY("SENT-MANUALLY"), + + OPENED("OPENED"), + + DENIED("DENIED"), + + SIGNED("SIGNED"), + + DEPRECATED("DEPRECATED"); + + private final String value; + + OfferStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/Office.java b/src/main/java/com/merge/legacy/api/resources/ats/types/Office.java new file mode 100644 index 000000000..7c5e82818 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/Office.java @@ -0,0 +1,319 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Office.Builder.class) +public final class Office { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional location; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Office( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional location, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.location = location; + 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 office's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The office's location. + */ + @JsonProperty("location") + public Optional getLocation() { + return location; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Office && equalTo((Office) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Office other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && location.equals(other.location) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.location, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 location = 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(Office other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + location(other.getLocation()); + 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 = "location", nulls = Nulls.SKIP) + public Builder location(Optional location) { + this.location = location; + return this; + } + + public Builder location(String location) { + this.location = Optional.ofNullable(location); + 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 Office build() { + return new Office( + id, + remoteId, + createdAt, + modifiedAt, + name, + location, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/OverallRecommendationEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/OverallRecommendationEnum.java new file mode 100644 index 000000000..227c68814 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/OverallRecommendationEnum.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum OverallRecommendationEnum { + DEFINITELY_NO("DEFINITELY_NO"), + + NO("NO"), + + YES("YES"), + + STRONG_YES("STRONG_YES"), + + NO_DECISION("NO_DECISION"); + + private final String value; + + OverallRecommendationEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedAccountDetailsAndActionsList.java new file mode 100644 index 000000000..c0ec47699 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedAccountDetailsAndActionsList.java @@ -0,0 +1,135 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/ats/types/PaginatedActivityList.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedActivityList.java new file mode 100644 index 000000000..cbd931a90 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedActivityList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedActivityList.Builder.class) +public final class PaginatedActivityList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedActivityList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedActivityList && equalTo((PaginatedActivityList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedActivityList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedActivityList 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 PaginatedActivityList build() { + return new PaginatedActivityList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedApplicationList.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedApplicationList.java new file mode 100644 index 000000000..cb174feca --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedApplicationList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedApplicationList.Builder.class) +public final class PaginatedApplicationList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedApplicationList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedApplicationList && equalTo((PaginatedApplicationList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedApplicationList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedApplicationList 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 PaginatedApplicationList build() { + return new PaginatedApplicationList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedAttachmentList.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedAttachmentList.java new file mode 100644 index 000000000..e9935a114 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedAttachmentList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/ats/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedAuditLogEventList.java new file mode 100644 index 000000000..026876b4f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedAuditLogEventList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/ats/types/PaginatedCandidateList.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedCandidateList.java new file mode 100644 index 000000000..585b72861 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedCandidateList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedCandidateList.Builder.class) +public final class PaginatedCandidateList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedCandidateList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedCandidateList && equalTo((PaginatedCandidateList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedCandidateList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedCandidateList 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 PaginatedCandidateList build() { + return new PaginatedCandidateList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedDepartmentList.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedDepartmentList.java new file mode 100644 index 000000000..82d510b1c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedDepartmentList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedDepartmentList.Builder.class) +public final class PaginatedDepartmentList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedDepartmentList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedDepartmentList && equalTo((PaginatedDepartmentList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedDepartmentList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedDepartmentList 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 PaginatedDepartmentList build() { + return new PaginatedDepartmentList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedEeocList.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedEeocList.java new file mode 100644 index 000000000..02678fd8b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedEeocList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedEeocList.Builder.class) +public final class PaginatedEeocList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedEeocList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedEeocList && equalTo((PaginatedEeocList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedEeocList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedEeocList 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 PaginatedEeocList build() { + return new PaginatedEeocList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedIssueList.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedIssueList.java new file mode 100644 index 000000000..489018e6c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedIssueList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/ats/types/PaginatedJobInterviewStageList.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedJobInterviewStageList.java new file mode 100644 index 000000000..47b782ee0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedJobInterviewStageList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedJobInterviewStageList.Builder.class) +public final class PaginatedJobInterviewStageList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedJobInterviewStageList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedJobInterviewStageList && equalTo((PaginatedJobInterviewStageList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedJobInterviewStageList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedJobInterviewStageList 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 PaginatedJobInterviewStageList build() { + return new PaginatedJobInterviewStageList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedJobList.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedJobList.java new file mode 100644 index 000000000..13a2dd683 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedJobList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedJobList.Builder.class) +public final class PaginatedJobList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedJobList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedJobList && equalTo((PaginatedJobList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedJobList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedJobList 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 PaginatedJobList build() { + return new PaginatedJobList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedJobPostingList.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedJobPostingList.java new file mode 100644 index 000000000..718ed9008 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedJobPostingList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedJobPostingList.Builder.class) +public final class PaginatedJobPostingList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedJobPostingList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedJobPostingList && equalTo((PaginatedJobPostingList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedJobPostingList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedJobPostingList 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 PaginatedJobPostingList build() { + return new PaginatedJobPostingList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedOfferList.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedOfferList.java new file mode 100644 index 000000000..87905cfd6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedOfferList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedOfferList.Builder.class) +public final class PaginatedOfferList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedOfferList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedOfferList && equalTo((PaginatedOfferList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedOfferList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedOfferList 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 PaginatedOfferList build() { + return new PaginatedOfferList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedOfficeList.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedOfficeList.java new file mode 100644 index 000000000..a178272cc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedOfficeList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedOfficeList.Builder.class) +public final class PaginatedOfficeList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedOfficeList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedOfficeList && equalTo((PaginatedOfficeList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedOfficeList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedOfficeList 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 PaginatedOfficeList build() { + return new PaginatedOfficeList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedRejectReasonList.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedRejectReasonList.java new file mode 100644 index 000000000..ea9f5b387 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedRejectReasonList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedRejectReasonList.Builder.class) +public final class PaginatedRejectReasonList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedRejectReasonList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedRejectReasonList && equalTo((PaginatedRejectReasonList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedRejectReasonList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedRejectReasonList 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 PaginatedRejectReasonList build() { + return new PaginatedRejectReasonList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedRemoteUserList.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedRemoteUserList.java new file mode 100644 index 000000000..98276dc4a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedRemoteUserList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedRemoteUserList.Builder.class) +public final class PaginatedRemoteUserList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedRemoteUserList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedRemoteUserList && equalTo((PaginatedRemoteUserList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedRemoteUserList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedRemoteUserList 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 PaginatedRemoteUserList build() { + return new PaginatedRemoteUserList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedScheduledInterviewList.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedScheduledInterviewList.java new file mode 100644 index 000000000..8e23fbbc1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedScheduledInterviewList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedScheduledInterviewList.Builder.class) +public final class PaginatedScheduledInterviewList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedScheduledInterviewList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedScheduledInterviewList && equalTo((PaginatedScheduledInterviewList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedScheduledInterviewList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedScheduledInterviewList 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 PaginatedScheduledInterviewList build() { + return new PaginatedScheduledInterviewList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedScorecardList.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedScorecardList.java new file mode 100644 index 000000000..4fbedc2fb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedScorecardList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedScorecardList.Builder.class) +public final class PaginatedScorecardList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedScorecardList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedScorecardList && equalTo((PaginatedScorecardList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedScorecardList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedScorecardList 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 PaginatedScorecardList build() { + return new PaginatedScorecardList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedScreeningQuestionList.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedScreeningQuestionList.java new file mode 100644 index 000000000..8f3b8a4d6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedScreeningQuestionList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedScreeningQuestionList.Builder.class) +public final class PaginatedScreeningQuestionList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedScreeningQuestionList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedScreeningQuestionList && equalTo((PaginatedScreeningQuestionList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedScreeningQuestionList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedScreeningQuestionList 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 PaginatedScreeningQuestionList build() { + return new PaginatedScreeningQuestionList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedSyncStatusList.java new file mode 100644 index 000000000..62f0c9119 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedSyncStatusList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/ats/types/PaginatedTagList.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedTagList.java new file mode 100644 index 000000000..c88f2bc75 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PaginatedTagList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/ats/types/PatchedCandidateRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PatchedCandidateRequest.java new file mode 100644 index 000000000..1c166c311 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PatchedCandidateRequest.java @@ -0,0 +1,542 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PatchedCandidateRequest.Builder.class) +public final class PatchedCandidateRequest { + private final Optional firstName; + + private final Optional lastName; + + private final Optional company; + + private final Optional title; + + private final Optional lastInteractionAt; + + private final Optional isPrivate; + + private final Optional canEmail; + + private final Optional>> locations; + + private final Optional> phoneNumbers; + + private final Optional> emailAddresses; + + private final Optional> urls; + + private final Optional>> tags; + + private final Optional>> applications; + + private final Optional>> attachments; + + private final Optional remoteTemplateId; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private PatchedCandidateRequest( + Optional firstName, + Optional lastName, + Optional company, + Optional title, + Optional lastInteractionAt, + Optional isPrivate, + Optional canEmail, + Optional>> locations, + Optional> phoneNumbers, + Optional> emailAddresses, + Optional> urls, + Optional>> tags, + Optional>> applications, + Optional>> attachments, + Optional remoteTemplateId, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.firstName = firstName; + this.lastName = lastName; + this.company = company; + this.title = title; + this.lastInteractionAt = lastInteractionAt; + this.isPrivate = isPrivate; + this.canEmail = canEmail; + this.locations = locations; + this.phoneNumbers = phoneNumbers; + this.emailAddresses = emailAddresses; + this.urls = urls; + this.tags = tags; + this.applications = applications; + this.attachments = attachments; + this.remoteTemplateId = remoteTemplateId; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The candidate's first name. + */ + @JsonProperty("first_name") + public Optional getFirstName() { + return firstName; + } + + /** + * @return The candidate's last name. + */ + @JsonProperty("last_name") + public Optional getLastName() { + return lastName; + } + + /** + * @return The candidate's current company. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The candidate's current title. + */ + @JsonProperty("title") + public Optional getTitle() { + return title; + } + + /** + * @return When the most recent interaction with the candidate occurred. + */ + @JsonProperty("last_interaction_at") + public Optional getLastInteractionAt() { + return lastInteractionAt; + } + + /** + * @return Whether or not the candidate is private. + */ + @JsonProperty("is_private") + public Optional getIsPrivate() { + return isPrivate; + } + + /** + * @return Whether or not the candidate can be emailed. + */ + @JsonProperty("can_email") + public Optional getCanEmail() { + return canEmail; + } + + /** + * @return The candidate's locations. + */ + @JsonProperty("locations") + public Optional>> getLocations() { + return locations; + } + + @JsonProperty("phone_numbers") + public Optional> getPhoneNumbers() { + return phoneNumbers; + } + + @JsonProperty("email_addresses") + public Optional> getEmailAddresses() { + return emailAddresses; + } + + @JsonProperty("urls") + public Optional> getUrls() { + return urls; + } + + /** + * @return Array of Tag names as strings. + */ + @JsonProperty("tags") + public Optional>> getTags() { + return tags; + } + + /** + * @return Array of Application object IDs. + */ + @JsonProperty("applications") + public Optional>> getApplications() { + return applications; + } + + /** + * @return Array of Attachment object IDs. + */ + @JsonProperty("attachments") + public Optional>> getAttachments() { + return attachments; + } + + @JsonProperty("remote_template_id") + public Optional getRemoteTemplateId() { + return remoteTemplateId; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedCandidateRequest && equalTo((PatchedCandidateRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedCandidateRequest other) { + return firstName.equals(other.firstName) + && lastName.equals(other.lastName) + && company.equals(other.company) + && title.equals(other.title) + && lastInteractionAt.equals(other.lastInteractionAt) + && isPrivate.equals(other.isPrivate) + && canEmail.equals(other.canEmail) + && locations.equals(other.locations) + && phoneNumbers.equals(other.phoneNumbers) + && emailAddresses.equals(other.emailAddresses) + && urls.equals(other.urls) + && tags.equals(other.tags) + && applications.equals(other.applications) + && attachments.equals(other.attachments) + && remoteTemplateId.equals(other.remoteTemplateId) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @Override + public int hashCode() { + return Objects.hash( + this.firstName, + this.lastName, + this.company, + this.title, + this.lastInteractionAt, + this.isPrivate, + this.canEmail, + this.locations, + this.phoneNumbers, + this.emailAddresses, + this.urls, + this.tags, + this.applications, + this.attachments, + this.remoteTemplateId, + this.integrationParams, + this.linkedAccountParams); + } + + @Override + 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 company = Optional.empty(); + + private Optional title = Optional.empty(); + + private Optional lastInteractionAt = Optional.empty(); + + private Optional isPrivate = Optional.empty(); + + private Optional canEmail = Optional.empty(); + + private Optional>> locations = Optional.empty(); + + private Optional> phoneNumbers = Optional.empty(); + + private Optional> emailAddresses = Optional.empty(); + + private Optional> urls = Optional.empty(); + + private Optional>> tags = Optional.empty(); + + private Optional>> applications = Optional.empty(); + + private Optional>> attachments = Optional.empty(); + + private Optional remoteTemplateId = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PatchedCandidateRequest other) { + firstName(other.getFirstName()); + lastName(other.getLastName()); + company(other.getCompany()); + title(other.getTitle()); + lastInteractionAt(other.getLastInteractionAt()); + isPrivate(other.getIsPrivate()); + canEmail(other.getCanEmail()); + locations(other.getLocations()); + phoneNumbers(other.getPhoneNumbers()); + emailAddresses(other.getEmailAddresses()); + urls(other.getUrls()); + tags(other.getTags()); + applications(other.getApplications()); + attachments(other.getAttachments()); + remoteTemplateId(other.getRemoteTemplateId()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + 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 = "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 = "title", nulls = Nulls.SKIP) + public Builder title(Optional title) { + this.title = title; + return this; + } + + public Builder title(String title) { + this.title = Optional.ofNullable(title); + return this; + } + + @JsonSetter(value = "last_interaction_at", nulls = Nulls.SKIP) + public Builder lastInteractionAt(Optional lastInteractionAt) { + this.lastInteractionAt = lastInteractionAt; + return this; + } + + public Builder lastInteractionAt(OffsetDateTime lastInteractionAt) { + this.lastInteractionAt = Optional.ofNullable(lastInteractionAt); + return this; + } + + @JsonSetter(value = "is_private", nulls = Nulls.SKIP) + public Builder isPrivate(Optional isPrivate) { + this.isPrivate = isPrivate; + return this; + } + + public Builder isPrivate(Boolean isPrivate) { + this.isPrivate = Optional.ofNullable(isPrivate); + return this; + } + + @JsonSetter(value = "can_email", nulls = Nulls.SKIP) + public Builder canEmail(Optional canEmail) { + this.canEmail = canEmail; + return this; + } + + public Builder canEmail(Boolean canEmail) { + this.canEmail = Optional.ofNullable(canEmail); + return this; + } + + @JsonSetter(value = "locations", nulls = Nulls.SKIP) + public Builder locations(Optional>> locations) { + this.locations = locations; + return this; + } + + public Builder locations(List> locations) { + this.locations = Optional.ofNullable(locations); + 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 = "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 = "urls", nulls = Nulls.SKIP) + public Builder urls(Optional> urls) { + this.urls = urls; + return this; + } + + public Builder urls(List urls) { + this.urls = Optional.ofNullable(urls); + return this; + } + + @JsonSetter(value = "tags", nulls = Nulls.SKIP) + public Builder tags(Optional>> tags) { + this.tags = tags; + return this; + } + + public Builder tags(List> tags) { + this.tags = Optional.ofNullable(tags); + return this; + } + + @JsonSetter(value = "applications", nulls = Nulls.SKIP) + public Builder applications(Optional>> applications) { + this.applications = applications; + return this; + } + + public Builder applications(List> applications) { + this.applications = Optional.ofNullable(applications); + return this; + } + + @JsonSetter(value = "attachments", nulls = Nulls.SKIP) + public Builder attachments(Optional>> attachments) { + this.attachments = attachments; + return this; + } + + public Builder attachments(List> attachments) { + this.attachments = Optional.ofNullable(attachments); + return this; + } + + @JsonSetter(value = "remote_template_id", nulls = Nulls.SKIP) + public Builder remoteTemplateId(Optional remoteTemplateId) { + this.remoteTemplateId = remoteTemplateId; + return this; + } + + public Builder remoteTemplateId(String remoteTemplateId) { + this.remoteTemplateId = Optional.ofNullable(remoteTemplateId); + 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 PatchedCandidateRequest build() { + return new PatchedCandidateRequest( + firstName, + lastName, + company, + title, + lastInteractionAt, + isPrivate, + canEmail, + locations, + phoneNumbers, + emailAddresses, + urls, + tags, + applications, + attachments, + remoteTemplateId, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/PhoneNumber.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PhoneNumber.java new file mode 100644 index 000000000..3f74509bd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PhoneNumber.java @@ -0,0 +1,211 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.createdAt, this.modifiedAt, this.value, this.phoneNumberType, this.remoteWasDeleted); + } + + @Override + 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/legacy/api/resources/ats/types/PhoneNumberPhoneNumberType.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PhoneNumberPhoneNumberType.java new file mode 100644 index 000000000..9d43b58a7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PhoneNumberPhoneNumberType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/PhoneNumberRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PhoneNumberRequest.java new file mode 100644 index 000000000..f5ed74909 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PhoneNumberRequest.java @@ -0,0 +1,178 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value, this.phoneNumberType, this.integrationParams, this.linkedAccountParams); + } + + @Override + 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/legacy/api/resources/ats/types/PhoneNumberRequestPhoneNumberType.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PhoneNumberRequestPhoneNumberType.java new file mode 100644 index 000000000..80a03fe3c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PhoneNumberRequestPhoneNumberType.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/PhoneNumberTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/PhoneNumberTypeEnum.java new file mode 100644 index 000000000..75578ffbf --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/PhoneNumberTypeEnum.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PhoneNumberTypeEnum { + HOME("HOME"), + + WORK("WORK"), + + MOBILE("MOBILE"), + + SKYPE("SKYPE"), + + OTHER("OTHER"); + + private final String value; + + PhoneNumberTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/RaceEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/RaceEnum.java new file mode 100644 index 000000000..0b229f04b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/RaceEnum.java @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum RaceEnum { + AMERICAN_INDIAN_OR_ALASKAN_NATIVE("AMERICAN_INDIAN_OR_ALASKAN_NATIVE"), + + ASIAN("ASIAN"), + + BLACK_OR_AFRICAN_AMERICAN("BLACK_OR_AFRICAN_AMERICAN"), + + HISPANIC_OR_LATINO("HISPANIC_OR_LATINO"), + + WHITE("WHITE"), + + NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER("NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER"), + + TWO_OR_MORE_RACES("TWO_OR_MORE_RACES"), + + DECLINE_TO_SELF_IDENTIFY("DECLINE_TO_SELF_IDENTIFY"); + + private final String value; + + RaceEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ReasonEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ReasonEnum.java new file mode 100644 index 000000000..16c8dbb99 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ReasonEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/RejectReason.java b/src/main/java/com/merge/legacy/api/resources/ats/types/RejectReason.java new file mode 100644 index 000000000..a2f82b9da --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/RejectReason.java @@ -0,0 +1,290 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RejectReason.Builder.class) +public final class RejectReason { + private final Optional id; + + 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 RejectReason( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + 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 rejection reason’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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RejectReason && equalTo((RejectReason) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RejectReason other) { + return id.equals(other.id) + && 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RejectReason other) { + id(other.getId()); + 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 = "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 = "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 RejectReason build() { + return new RejectReason( + id, + remoteId, + createdAt, + modifiedAt, + name, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteData.java b/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteData.java new file mode 100644 index 000000000..f0b4fb935 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteData.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.path, this.data); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("path") + public _FinalStage path(@NotNull String path) { + this.path = path; + return this; + } + + @Override + public _FinalStage data(JsonNode data) { + this.data = Optional.ofNullable(data); + return this; + } + + @Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(Optional data) { + this.data = data; + return this; + } + + @Override + public RemoteData build() { + return new RemoteData(path, data, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteEndpointInfo.java b/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteEndpointInfo.java new file mode 100644 index 000000000..f711ab7f4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteEndpointInfo.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @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() {} + + @Override + public Builder from(RemoteEndpointInfo other) { + method(other.getMethod()); + urlPath(other.getUrlPath()); + fieldTraversalPath(other.getFieldTraversalPath()); + return this; + } + + @Override + @JsonSetter("method") + public UrlPathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @Override + @JsonSetter("url_path") + public _FinalStage urlPath(@NotNull String urlPath) { + this.urlPath = urlPath; + return this; + } + + @Override + public _FinalStage addAllFieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.addAll(fieldTraversalPath); + return this; + } + + @Override + public _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath) { + this.fieldTraversalPath.add(fieldTraversalPath); + return this; + } + + @Override + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) + public _FinalStage fieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.clear(); + this.fieldTraversalPath.addAll(fieldTraversalPath); + return this; + } + + @Override + public RemoteEndpointInfo build() { + return new RemoteEndpointInfo(method, urlPath, fieldTraversalPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteFieldApi.java b/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteFieldApi.java new file mode 100644 index 000000000..15a4596b3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteFieldApi.java @@ -0,0 +1,264 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.schema, + this.remoteKeyName, + this.remoteEndpointInfo, + this.exampleValues, + this.advancedMetadata, + this.coverage); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("remote_key_name") + public RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @Override + public _FinalStage coverage(RemoteFieldApiCoverage coverage) { + this.coverage = Optional.ofNullable(coverage); + return this; + } + + @Override + @JsonSetter(value = "coverage", nulls = Nulls.SKIP) + public _FinalStage coverage(Optional coverage) { + this.coverage = coverage; + return this; + } + + @Override + public _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata) { + this.advancedMetadata = Optional.ofNullable(advancedMetadata); + return this; + } + + @Override + @JsonSetter(value = "advanced_metadata", nulls = Nulls.SKIP) + public _FinalStage advancedMetadata(Optional advancedMetadata) { + this.advancedMetadata = advancedMetadata; + return this; + } + + @Override + public _FinalStage exampleValues(List exampleValues) { + this.exampleValues = Optional.ofNullable(exampleValues); + return this; + } + + @Override + @JsonSetter(value = "example_values", nulls = Nulls.SKIP) + public _FinalStage exampleValues(Optional> exampleValues) { + this.exampleValues = exampleValues; + return this; + } + + @Override + public _FinalStage schema(String key, JsonNode value) { + this.schema.put(key, value); + return this; + } + + @Override + public _FinalStage putAllSchema(Map schema) { + this.schema.putAll(schema); + return this; + } + + @Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Map schema) { + this.schema.clear(); + this.schema.putAll(schema); + return this; + } + + @Override + public RemoteFieldApi build() { + return new RemoteFieldApi( + schema, + remoteKeyName, + remoteEndpointInfo, + exampleValues, + advancedMetadata, + coverage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteFieldApiCoverage.java b/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteFieldApiCoverage.java new file mode 100644 index 000000000..8c2d9d2e3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteFieldApiCoverage.java @@ -0,0 +1,91 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/RemoteFieldApiResponse.java b/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteFieldApiResponse.java new file mode 100644 index 000000000..71cc18657 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteFieldApiResponse.java @@ -0,0 +1,481 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ats/types/RemoteKey.java b/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteKey.java new file mode 100644 index 000000000..8d967306b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteKey.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.key); + } + + @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() {} + + @Override + public Builder from(RemoteKey other) { + name(other.getName()); + key(other.getKey()); + return this; + } + + @Override + @JsonSetter("name") + public KeyStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + @JsonSetter("key") + public _FinalStage key(@NotNull String key) { + this.key = key; + return this; + } + + @Override + public RemoteKey build() { + return new RemoteKey(name, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteResponse.java b/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteResponse.java new file mode 100644 index 000000000..098eba83f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteResponse.java @@ -0,0 +1,271 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.status, + this.response, + this.responseHeaders, + this.responseType, + this.headers); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("method") + public PathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @Override + @JsonSetter("path") + public StatusStage path(@NotNull String path) { + this.path = path; + return this; + } + + @Override + @JsonSetter("status") + public ResponseStage status(int status) { + this.status = status; + return this; + } + + @Override + @JsonSetter("response") + public _FinalStage response(@NotNull JsonNode response) { + this.response = response; + return this; + } + + @Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Optional> headers) { + this.headers = headers; + return this; + } + + @Override + public _FinalStage responseType(RemoteResponseResponseType responseType) { + this.responseType = Optional.ofNullable(responseType); + return this; + } + + @Override + @JsonSetter(value = "response_type", nulls = Nulls.SKIP) + public _FinalStage responseType(Optional responseType) { + this.responseType = responseType; + return this; + } + + @Override + public _FinalStage responseHeaders(Map responseHeaders) { + this.responseHeaders = Optional.ofNullable(responseHeaders); + return this; + } + + @Override + @JsonSetter(value = "response_headers", nulls = Nulls.SKIP) + public _FinalStage responseHeaders(Optional> responseHeaders) { + this.responseHeaders = responseHeaders; + return this; + } + + @Override + public RemoteResponse build() { + return new RemoteResponse( + method, path, status, response, responseHeaders, responseType, headers, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteResponseResponseType.java b/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteResponseResponseType.java new file mode 100644 index 000000000..16d286bb3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteResponseResponseType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/RemoteUser.java b/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteUser.java new file mode 100644 index 000000000..631630930 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteUser.java @@ -0,0 +1,442 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteUser.Builder.class) +public final class RemoteUser { + 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 email; + + private final Optional disabled; + + private final Optional remoteCreatedAt; + + private final Optional accessRole; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private RemoteUser( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional firstName, + Optional lastName, + Optional email, + Optional disabled, + Optional remoteCreatedAt, + Optional accessRole, + 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.email = email; + this.disabled = disabled; + this.remoteCreatedAt = remoteCreatedAt; + this.accessRole = accessRole; + 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 first name. + */ + @JsonProperty("first_name") + public Optional getFirstName() { + return firstName; + } + + /** + * @return The user's last name. + */ + @JsonProperty("last_name") + public Optional getLastName() { + return lastName; + } + + /** + * @return The user's email. + */ + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + /** + * @return Whether the user's account had been disabled. + */ + @JsonProperty("disabled") + public Optional getDisabled() { + return disabled; + } + + /** + * @return When the third party's user was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return The user's role. + *
    + *
  • SUPER_ADMIN - SUPER_ADMIN
  • + *
  • ADMIN - ADMIN
  • + *
  • TEAM_MEMBER - TEAM_MEMBER
  • + *
  • LIMITED_TEAM_MEMBER - LIMITED_TEAM_MEMBER
  • + *
  • INTERVIEWER - INTERVIEWER
  • + *
+ */ + @JsonProperty("access_role") + public Optional getAccessRole() { + return accessRole; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteUser && equalTo((RemoteUser) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteUser 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) + && email.equals(other.email) + && disabled.equals(other.disabled) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && accessRole.equals(other.accessRole) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.firstName, + this.lastName, + this.email, + this.disabled, + this.remoteCreatedAt, + this.accessRole, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 email = Optional.empty(); + + private Optional disabled = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional accessRole = 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(RemoteUser other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + firstName(other.getFirstName()); + lastName(other.getLastName()); + email(other.getEmail()); + disabled(other.getDisabled()); + remoteCreatedAt(other.getRemoteCreatedAt()); + accessRole(other.getAccessRole()); + 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 = "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 = "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 = "disabled", nulls = Nulls.SKIP) + public Builder disabled(Optional disabled) { + this.disabled = disabled; + return this; + } + + public Builder disabled(Boolean disabled) { + this.disabled = Optional.ofNullable(disabled); + 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 = "access_role", nulls = Nulls.SKIP) + public Builder accessRole(Optional accessRole) { + this.accessRole = accessRole; + return this; + } + + public Builder accessRole(RemoteUserAccessRole accessRole) { + this.accessRole = Optional.ofNullable(accessRole); + 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 RemoteUser build() { + return new RemoteUser( + id, + remoteId, + createdAt, + modifiedAt, + firstName, + lastName, + email, + disabled, + remoteCreatedAt, + accessRole, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteUserAccessRole.java b/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteUserAccessRole.java new file mode 100644 index 000000000..e53cf040b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/RemoteUserAccessRole.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/RequestFormatEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/RequestFormatEnum.java new file mode 100644 index 000000000..3c2e3a6ee --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/RequestFormatEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ResponseTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ResponseTypeEnum.java new file mode 100644 index 000000000..561572b25 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ResponseTypeEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/RoleEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/RoleEnum.java new file mode 100644 index 000000000..3f8af1ea2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/RoleEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterview.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterview.java new file mode 100644 index 000000000..b5cb3408b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterview.java @@ -0,0 +1,556 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ScheduledInterview.Builder.class) +public final class ScheduledInterview { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional application; + + private final Optional jobInterviewStage; + + private final Optional organizer; + + private final Optional>> interviewers; + + private final Optional location; + + private final Optional startAt; + + private final Optional endAt; + + private final Optional remoteCreatedAt; + + private final Optional remoteUpdatedAt; + + private final Optional status; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private ScheduledInterview( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional application, + Optional jobInterviewStage, + Optional organizer, + Optional>> interviewers, + Optional location, + Optional startAt, + Optional endAt, + Optional remoteCreatedAt, + Optional remoteUpdatedAt, + Optional status, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.application = application; + this.jobInterviewStage = jobInterviewStage; + this.organizer = organizer; + this.interviewers = interviewers; + this.location = location; + this.startAt = startAt; + this.endAt = endAt; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteUpdatedAt = remoteUpdatedAt; + 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 application being interviewed. + */ + @JsonProperty("application") + public Optional getApplication() { + return application; + } + + /** + * @return The stage of the interview. + */ + @JsonProperty("job_interview_stage") + public Optional getJobInterviewStage() { + return jobInterviewStage; + } + + /** + * @return The user organizing the interview. + */ + @JsonProperty("organizer") + public Optional getOrganizer() { + return organizer; + } + + /** + * @return Array of RemoteUser IDs. + */ + @JsonProperty("interviewers") + public Optional>> getInterviewers() { + return interviewers; + } + + /** + * @return The interview's location. + */ + @JsonProperty("location") + public Optional getLocation() { + return location; + } + + /** + * @return When the interview was started. + */ + @JsonProperty("start_at") + public Optional getStartAt() { + return startAt; + } + + /** + * @return When the interview was ended. + */ + @JsonProperty("end_at") + public Optional getEndAt() { + return endAt; + } + + /** + * @return When the third party's interview was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the third party's interview was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @return The interview's status. + *
    + *
  • SCHEDULED - SCHEDULED
  • + *
  • AWAITING_FEEDBACK - AWAITING_FEEDBACK
  • + *
  • COMPLETE - COMPLETE
  • + *
+ */ + @JsonProperty("status") + public Optional 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScheduledInterview && equalTo((ScheduledInterview) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ScheduledInterview other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && application.equals(other.application) + && jobInterviewStage.equals(other.jobInterviewStage) + && organizer.equals(other.organizer) + && interviewers.equals(other.interviewers) + && location.equals(other.location) + && startAt.equals(other.startAt) + && endAt.equals(other.endAt) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && status.equals(other.status) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.application, + this.jobInterviewStage, + this.organizer, + this.interviewers, + this.location, + this.startAt, + this.endAt, + this.remoteCreatedAt, + this.remoteUpdatedAt, + this.status, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 application = Optional.empty(); + + private Optional jobInterviewStage = Optional.empty(); + + private Optional organizer = Optional.empty(); + + private Optional>> interviewers = Optional.empty(); + + private Optional location = Optional.empty(); + + private Optional startAt = Optional.empty(); + + private Optional endAt = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional status = 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(ScheduledInterview other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + application(other.getApplication()); + jobInterviewStage(other.getJobInterviewStage()); + organizer(other.getOrganizer()); + interviewers(other.getInterviewers()); + location(other.getLocation()); + startAt(other.getStartAt()); + endAt(other.getEndAt()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + status(other.getStatus()); + 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 = "application", nulls = Nulls.SKIP) + public Builder application(Optional application) { + this.application = application; + return this; + } + + public Builder application(ScheduledInterviewApplication application) { + this.application = Optional.ofNullable(application); + return this; + } + + @JsonSetter(value = "job_interview_stage", nulls = Nulls.SKIP) + public Builder jobInterviewStage(Optional jobInterviewStage) { + this.jobInterviewStage = jobInterviewStage; + return this; + } + + public Builder jobInterviewStage(ScheduledInterviewJobInterviewStage jobInterviewStage) { + this.jobInterviewStage = Optional.ofNullable(jobInterviewStage); + return this; + } + + @JsonSetter(value = "organizer", nulls = Nulls.SKIP) + public Builder organizer(Optional organizer) { + this.organizer = organizer; + return this; + } + + public Builder organizer(ScheduledInterviewOrganizer organizer) { + this.organizer = Optional.ofNullable(organizer); + return this; + } + + @JsonSetter(value = "interviewers", nulls = Nulls.SKIP) + public Builder interviewers(Optional>> interviewers) { + this.interviewers = interviewers; + return this; + } + + public Builder interviewers(List> interviewers) { + this.interviewers = Optional.ofNullable(interviewers); + return this; + } + + @JsonSetter(value = "location", nulls = Nulls.SKIP) + public Builder location(Optional location) { + this.location = location; + return this; + } + + public Builder location(String location) { + this.location = Optional.ofNullable(location); + return this; + } + + @JsonSetter(value = "start_at", nulls = Nulls.SKIP) + public Builder startAt(Optional startAt) { + this.startAt = startAt; + return this; + } + + public Builder startAt(OffsetDateTime startAt) { + this.startAt = Optional.ofNullable(startAt); + return this; + } + + @JsonSetter(value = "end_at", nulls = Nulls.SKIP) + public Builder endAt(Optional endAt) { + this.endAt = endAt; + return this; + } + + public Builder endAt(OffsetDateTime endAt) { + this.endAt = Optional.ofNullable(endAt); + 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_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 = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(ScheduledInterviewStatus status) { + this.status = Optional.ofNullable(status); + 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 ScheduledInterview build() { + return new ScheduledInterview( + id, + remoteId, + createdAt, + modifiedAt, + application, + jobInterviewStage, + organizer, + interviewers, + location, + startAt, + endAt, + remoteCreatedAt, + remoteUpdatedAt, + status, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewApplication.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewApplication.java new file mode 100644 index 000000000..8abd2c444 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewApplication.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ScheduledInterviewApplication.Deserializer.class) +public final class ScheduledInterviewApplication { + private final Object value; + + private final int type; + + private ScheduledInterviewApplication(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((Application) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScheduledInterviewApplication && equalTo((ScheduledInterviewApplication) other); + } + + private boolean equalTo(ScheduledInterviewApplication other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ScheduledInterviewApplication of(String value) { + return new ScheduledInterviewApplication(value, 0); + } + + public static ScheduledInterviewApplication of(Application value) { + return new ScheduledInterviewApplication(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Application value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ScheduledInterviewApplication.class); + } + + @Override + public ScheduledInterviewApplication 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, Application.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewInterviewersItem.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewInterviewersItem.java new file mode 100644 index 000000000..6d59efc1b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewInterviewersItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ScheduledInterviewInterviewersItem.Deserializer.class) +public final class ScheduledInterviewInterviewersItem { + private final Object value; + + private final int type; + + private ScheduledInterviewInterviewersItem(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((RemoteUser) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScheduledInterviewInterviewersItem + && equalTo((ScheduledInterviewInterviewersItem) other); + } + + private boolean equalTo(ScheduledInterviewInterviewersItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ScheduledInterviewInterviewersItem of(String value) { + return new ScheduledInterviewInterviewersItem(value, 0); + } + + public static ScheduledInterviewInterviewersItem of(RemoteUser value) { + return new ScheduledInterviewInterviewersItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(RemoteUser value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ScheduledInterviewInterviewersItem.class); + } + + @Override + public ScheduledInterviewInterviewersItem 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, RemoteUser.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewJobInterviewStage.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewJobInterviewStage.java new file mode 100644 index 000000000..d9007329a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewJobInterviewStage.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ScheduledInterviewJobInterviewStage.Deserializer.class) +public final class ScheduledInterviewJobInterviewStage { + private final Object value; + + private final int type; + + private ScheduledInterviewJobInterviewStage(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((JobInterviewStage) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScheduledInterviewJobInterviewStage + && equalTo((ScheduledInterviewJobInterviewStage) other); + } + + private boolean equalTo(ScheduledInterviewJobInterviewStage other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ScheduledInterviewJobInterviewStage of(String value) { + return new ScheduledInterviewJobInterviewStage(value, 0); + } + + public static ScheduledInterviewJobInterviewStage of(JobInterviewStage value) { + return new ScheduledInterviewJobInterviewStage(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(JobInterviewStage value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ScheduledInterviewJobInterviewStage.class); + } + + @Override + public ScheduledInterviewJobInterviewStage 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, JobInterviewStage.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewOrganizer.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewOrganizer.java new file mode 100644 index 000000000..d52b6ee64 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewOrganizer.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ScheduledInterviewOrganizer.Deserializer.class) +public final class ScheduledInterviewOrganizer { + private final Object value; + + private final int type; + + private ScheduledInterviewOrganizer(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((RemoteUser) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScheduledInterviewOrganizer && equalTo((ScheduledInterviewOrganizer) other); + } + + private boolean equalTo(ScheduledInterviewOrganizer other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ScheduledInterviewOrganizer of(String value) { + return new ScheduledInterviewOrganizer(value, 0); + } + + public static ScheduledInterviewOrganizer of(RemoteUser value) { + return new ScheduledInterviewOrganizer(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(RemoteUser value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ScheduledInterviewOrganizer.class); + } + + @Override + public ScheduledInterviewOrganizer 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, RemoteUser.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewRequest.java new file mode 100644 index 000000000..14acb9ed7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewRequest.java @@ -0,0 +1,356 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ScheduledInterviewRequest.Builder.class) +public final class ScheduledInterviewRequest { + private final Optional application; + + private final Optional jobInterviewStage; + + private final Optional organizer; + + private final Optional>> interviewers; + + private final Optional location; + + private final Optional startAt; + + private final Optional endAt; + + private final Optional status; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private ScheduledInterviewRequest( + Optional application, + Optional jobInterviewStage, + Optional organizer, + Optional>> interviewers, + Optional location, + Optional startAt, + Optional endAt, + Optional status, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.application = application; + this.jobInterviewStage = jobInterviewStage; + this.organizer = organizer; + this.interviewers = interviewers; + this.location = location; + this.startAt = startAt; + this.endAt = endAt; + this.status = status; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The application being interviewed. + */ + @JsonProperty("application") + public Optional getApplication() { + return application; + } + + /** + * @return The stage of the interview. + */ + @JsonProperty("job_interview_stage") + public Optional getJobInterviewStage() { + return jobInterviewStage; + } + + /** + * @return The user organizing the interview. + */ + @JsonProperty("organizer") + public Optional getOrganizer() { + return organizer; + } + + /** + * @return Array of RemoteUser IDs. + */ + @JsonProperty("interviewers") + public Optional>> getInterviewers() { + return interviewers; + } + + /** + * @return The interview's location. + */ + @JsonProperty("location") + public Optional getLocation() { + return location; + } + + /** + * @return When the interview was started. + */ + @JsonProperty("start_at") + public Optional getStartAt() { + return startAt; + } + + /** + * @return When the interview was ended. + */ + @JsonProperty("end_at") + public Optional getEndAt() { + return endAt; + } + + /** + * @return The interview's status. + *
    + *
  • SCHEDULED - SCHEDULED
  • + *
  • AWAITING_FEEDBACK - AWAITING_FEEDBACK
  • + *
  • COMPLETE - COMPLETE
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScheduledInterviewRequest && equalTo((ScheduledInterviewRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ScheduledInterviewRequest other) { + return application.equals(other.application) + && jobInterviewStage.equals(other.jobInterviewStage) + && organizer.equals(other.organizer) + && interviewers.equals(other.interviewers) + && location.equals(other.location) + && startAt.equals(other.startAt) + && endAt.equals(other.endAt) + && status.equals(other.status) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @Override + public int hashCode() { + return Objects.hash( + this.application, + this.jobInterviewStage, + this.organizer, + this.interviewers, + this.location, + this.startAt, + this.endAt, + this.status, + this.integrationParams, + this.linkedAccountParams); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional application = Optional.empty(); + + private Optional jobInterviewStage = Optional.empty(); + + private Optional organizer = Optional.empty(); + + private Optional>> interviewers = Optional.empty(); + + private Optional location = Optional.empty(); + + private Optional startAt = Optional.empty(); + + private Optional endAt = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ScheduledInterviewRequest other) { + application(other.getApplication()); + jobInterviewStage(other.getJobInterviewStage()); + organizer(other.getOrganizer()); + interviewers(other.getInterviewers()); + location(other.getLocation()); + startAt(other.getStartAt()); + endAt(other.getEndAt()); + status(other.getStatus()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + return this; + } + + @JsonSetter(value = "application", nulls = Nulls.SKIP) + public Builder application(Optional application) { + this.application = application; + return this; + } + + public Builder application(ScheduledInterviewRequestApplication application) { + this.application = Optional.ofNullable(application); + return this; + } + + @JsonSetter(value = "job_interview_stage", nulls = Nulls.SKIP) + public Builder jobInterviewStage(Optional jobInterviewStage) { + this.jobInterviewStage = jobInterviewStage; + return this; + } + + public Builder jobInterviewStage(ScheduledInterviewRequestJobInterviewStage jobInterviewStage) { + this.jobInterviewStage = Optional.ofNullable(jobInterviewStage); + return this; + } + + @JsonSetter(value = "organizer", nulls = Nulls.SKIP) + public Builder organizer(Optional organizer) { + this.organizer = organizer; + return this; + } + + public Builder organizer(ScheduledInterviewRequestOrganizer organizer) { + this.organizer = Optional.ofNullable(organizer); + return this; + } + + @JsonSetter(value = "interviewers", nulls = Nulls.SKIP) + public Builder interviewers(Optional>> interviewers) { + this.interviewers = interviewers; + return this; + } + + public Builder interviewers(List> interviewers) { + this.interviewers = Optional.ofNullable(interviewers); + return this; + } + + @JsonSetter(value = "location", nulls = Nulls.SKIP) + public Builder location(Optional location) { + this.location = location; + return this; + } + + public Builder location(String location) { + this.location = Optional.ofNullable(location); + return this; + } + + @JsonSetter(value = "start_at", nulls = Nulls.SKIP) + public Builder startAt(Optional startAt) { + this.startAt = startAt; + return this; + } + + public Builder startAt(OffsetDateTime startAt) { + this.startAt = Optional.ofNullable(startAt); + return this; + } + + @JsonSetter(value = "end_at", nulls = Nulls.SKIP) + public Builder endAt(Optional endAt) { + this.endAt = endAt; + return this; + } + + public Builder endAt(OffsetDateTime endAt) { + this.endAt = Optional.ofNullable(endAt); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(ScheduledInterviewRequestStatus status) { + this.status = Optional.ofNullable(status); + 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 ScheduledInterviewRequest build() { + return new ScheduledInterviewRequest( + application, + jobInterviewStage, + organizer, + interviewers, + location, + startAt, + endAt, + status, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewRequestApplication.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewRequestApplication.java new file mode 100644 index 000000000..f1069d0e7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewRequestApplication.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ScheduledInterviewRequestApplication.Deserializer.class) +public final class ScheduledInterviewRequestApplication { + private final Object value; + + private final int type; + + private ScheduledInterviewRequestApplication(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((Application) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScheduledInterviewRequestApplication + && equalTo((ScheduledInterviewRequestApplication) other); + } + + private boolean equalTo(ScheduledInterviewRequestApplication other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ScheduledInterviewRequestApplication of(String value) { + return new ScheduledInterviewRequestApplication(value, 0); + } + + public static ScheduledInterviewRequestApplication of(Application value) { + return new ScheduledInterviewRequestApplication(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Application value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ScheduledInterviewRequestApplication.class); + } + + @Override + public ScheduledInterviewRequestApplication 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, Application.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewRequestInterviewersItem.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewRequestInterviewersItem.java new file mode 100644 index 000000000..c6d23ac24 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewRequestInterviewersItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ScheduledInterviewRequestInterviewersItem.Deserializer.class) +public final class ScheduledInterviewRequestInterviewersItem { + private final Object value; + + private final int type; + + private ScheduledInterviewRequestInterviewersItem(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((RemoteUser) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScheduledInterviewRequestInterviewersItem + && equalTo((ScheduledInterviewRequestInterviewersItem) other); + } + + private boolean equalTo(ScheduledInterviewRequestInterviewersItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ScheduledInterviewRequestInterviewersItem of(String value) { + return new ScheduledInterviewRequestInterviewersItem(value, 0); + } + + public static ScheduledInterviewRequestInterviewersItem of(RemoteUser value) { + return new ScheduledInterviewRequestInterviewersItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(RemoteUser value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ScheduledInterviewRequestInterviewersItem.class); + } + + @Override + public ScheduledInterviewRequestInterviewersItem 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, RemoteUser.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewRequestJobInterviewStage.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewRequestJobInterviewStage.java new file mode 100644 index 000000000..8c41e4d24 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewRequestJobInterviewStage.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ScheduledInterviewRequestJobInterviewStage.Deserializer.class) +public final class ScheduledInterviewRequestJobInterviewStage { + private final Object value; + + private final int type; + + private ScheduledInterviewRequestJobInterviewStage(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((JobInterviewStage) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScheduledInterviewRequestJobInterviewStage + && equalTo((ScheduledInterviewRequestJobInterviewStage) other); + } + + private boolean equalTo(ScheduledInterviewRequestJobInterviewStage other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ScheduledInterviewRequestJobInterviewStage of(String value) { + return new ScheduledInterviewRequestJobInterviewStage(value, 0); + } + + public static ScheduledInterviewRequestJobInterviewStage of(JobInterviewStage value) { + return new ScheduledInterviewRequestJobInterviewStage(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(JobInterviewStage value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ScheduledInterviewRequestJobInterviewStage.class); + } + + @Override + public ScheduledInterviewRequestJobInterviewStage 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, JobInterviewStage.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewRequestOrganizer.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewRequestOrganizer.java new file mode 100644 index 000000000..4eefda538 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewRequestOrganizer.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ScheduledInterviewRequestOrganizer.Deserializer.class) +public final class ScheduledInterviewRequestOrganizer { + private final Object value; + + private final int type; + + private ScheduledInterviewRequestOrganizer(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((RemoteUser) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScheduledInterviewRequestOrganizer + && equalTo((ScheduledInterviewRequestOrganizer) other); + } + + private boolean equalTo(ScheduledInterviewRequestOrganizer other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ScheduledInterviewRequestOrganizer of(String value) { + return new ScheduledInterviewRequestOrganizer(value, 0); + } + + public static ScheduledInterviewRequestOrganizer of(RemoteUser value) { + return new ScheduledInterviewRequestOrganizer(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(RemoteUser value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ScheduledInterviewRequestOrganizer.class); + } + + @Override + public ScheduledInterviewRequestOrganizer 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, RemoteUser.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewRequestStatus.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewRequestStatus.java new file mode 100644 index 000000000..b11ab843f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewRequestStatus.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/ScheduledInterviewResponse.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewResponse.java new file mode 100644 index 000000000..8887b58c4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ScheduledInterviewResponse.Builder.class) +public final class ScheduledInterviewResponse { + private final ScheduledInterview model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private ScheduledInterviewResponse( + ScheduledInterview 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 ScheduledInterview getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScheduledInterviewResponse && equalTo((ScheduledInterviewResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ScheduledInterviewResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull ScheduledInterview model); + + Builder from(ScheduledInterviewResponse other); + } + + public interface _FinalStage { + ScheduledInterviewResponse 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 ScheduledInterview model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(ScheduledInterviewResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull ScheduledInterview model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public ScheduledInterviewResponse build() { + return new ScheduledInterviewResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewStatus.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewStatus.java new file mode 100644 index 000000000..84e51c7f0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/ScheduledInterviewStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewStatusEnum.java new file mode 100644 index 000000000..a9c2cdf7b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScheduledInterviewStatusEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ScheduledInterviewStatusEnum { + SCHEDULED("SCHEDULED"), + + AWAITING_FEEDBACK("AWAITING_FEEDBACK"), + + COMPLETE("COMPLETE"); + + private final String value; + + ScheduledInterviewStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/Scorecard.java b/src/main/java/com/merge/legacy/api/resources/ats/types/Scorecard.java new file mode 100644 index 000000000..2e462fc5a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/Scorecard.java @@ -0,0 +1,442 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Scorecard.Builder.class) +public final class Scorecard { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional application; + + private final Optional interview; + + private final Optional interviewer; + + private final Optional remoteCreatedAt; + + private final Optional submittedAt; + + private final Optional overallRecommendation; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Scorecard( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional application, + Optional interview, + Optional interviewer, + Optional remoteCreatedAt, + Optional submittedAt, + Optional overallRecommendation, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.application = application; + this.interview = interview; + this.interviewer = interviewer; + this.remoteCreatedAt = remoteCreatedAt; + this.submittedAt = submittedAt; + this.overallRecommendation = overallRecommendation; + 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 application being scored. + */ + @JsonProperty("application") + public Optional getApplication() { + return application; + } + + /** + * @return The interview being scored. + */ + @JsonProperty("interview") + public Optional getInterview() { + return interview; + } + + /** + * @return The interviewer doing the scoring. + */ + @JsonProperty("interviewer") + public Optional getInterviewer() { + return interviewer; + } + + /** + * @return When the third party's scorecard was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the scorecard was submitted. + */ + @JsonProperty("submitted_at") + public Optional getSubmittedAt() { + return submittedAt; + } + + /** + * @return The inteviewer's recommendation. + *
    + *
  • DEFINITELY_NO - DEFINITELY_NO
  • + *
  • NO - NO
  • + *
  • YES - YES
  • + *
  • STRONG_YES - STRONG_YES
  • + *
  • NO_DECISION - NO_DECISION
  • + *
+ */ + @JsonProperty("overall_recommendation") + public Optional getOverallRecommendation() { + return overallRecommendation; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Scorecard && equalTo((Scorecard) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Scorecard other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && application.equals(other.application) + && interview.equals(other.interview) + && interviewer.equals(other.interviewer) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && submittedAt.equals(other.submittedAt) + && overallRecommendation.equals(other.overallRecommendation) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.application, + this.interview, + this.interviewer, + this.remoteCreatedAt, + this.submittedAt, + this.overallRecommendation, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 application = Optional.empty(); + + private Optional interview = Optional.empty(); + + private Optional interviewer = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional submittedAt = Optional.empty(); + + private Optional overallRecommendation = 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(Scorecard other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + application(other.getApplication()); + interview(other.getInterview()); + interviewer(other.getInterviewer()); + remoteCreatedAt(other.getRemoteCreatedAt()); + submittedAt(other.getSubmittedAt()); + overallRecommendation(other.getOverallRecommendation()); + 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 = "application", nulls = Nulls.SKIP) + public Builder application(Optional application) { + this.application = application; + return this; + } + + public Builder application(ScorecardApplication application) { + this.application = Optional.ofNullable(application); + return this; + } + + @JsonSetter(value = "interview", nulls = Nulls.SKIP) + public Builder interview(Optional interview) { + this.interview = interview; + return this; + } + + public Builder interview(ScorecardInterview interview) { + this.interview = Optional.ofNullable(interview); + return this; + } + + @JsonSetter(value = "interviewer", nulls = Nulls.SKIP) + public Builder interviewer(Optional interviewer) { + this.interviewer = interviewer; + return this; + } + + public Builder interviewer(ScorecardInterviewer interviewer) { + this.interviewer = Optional.ofNullable(interviewer); + 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 = "submitted_at", nulls = Nulls.SKIP) + public Builder submittedAt(Optional submittedAt) { + this.submittedAt = submittedAt; + return this; + } + + public Builder submittedAt(OffsetDateTime submittedAt) { + this.submittedAt = Optional.ofNullable(submittedAt); + return this; + } + + @JsonSetter(value = "overall_recommendation", nulls = Nulls.SKIP) + public Builder overallRecommendation(Optional overallRecommendation) { + this.overallRecommendation = overallRecommendation; + return this; + } + + public Builder overallRecommendation(ScorecardOverallRecommendation overallRecommendation) { + this.overallRecommendation = Optional.ofNullable(overallRecommendation); + 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 Scorecard build() { + return new Scorecard( + id, + remoteId, + createdAt, + modifiedAt, + application, + interview, + interviewer, + remoteCreatedAt, + submittedAt, + overallRecommendation, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ScorecardApplication.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScorecardApplication.java new file mode 100644 index 000000000..1776183a8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScorecardApplication.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ScorecardApplication.Deserializer.class) +public final class ScorecardApplication { + private final Object value; + + private final int type; + + private ScorecardApplication(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((Application) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScorecardApplication && equalTo((ScorecardApplication) other); + } + + private boolean equalTo(ScorecardApplication other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ScorecardApplication of(String value) { + return new ScorecardApplication(value, 0); + } + + public static ScorecardApplication of(Application value) { + return new ScorecardApplication(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Application value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ScorecardApplication.class); + } + + @Override + public ScorecardApplication 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, Application.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ScorecardInterview.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScorecardInterview.java new file mode 100644 index 000000000..b23610455 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScorecardInterview.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ScorecardInterview.Deserializer.class) +public final class ScorecardInterview { + private final Object value; + + private final int type; + + private ScorecardInterview(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((ScheduledInterview) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScorecardInterview && equalTo((ScorecardInterview) other); + } + + private boolean equalTo(ScorecardInterview other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ScorecardInterview of(String value) { + return new ScorecardInterview(value, 0); + } + + public static ScorecardInterview of(ScheduledInterview value) { + return new ScorecardInterview(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(ScheduledInterview value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ScorecardInterview.class); + } + + @Override + public ScorecardInterview 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, ScheduledInterview.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ScorecardInterviewer.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScorecardInterviewer.java new file mode 100644 index 000000000..d75aef9c2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScorecardInterviewer.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ScorecardInterviewer.Deserializer.class) +public final class ScorecardInterviewer { + private final Object value; + + private final int type; + + private ScorecardInterviewer(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((RemoteUser) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScorecardInterviewer && equalTo((ScorecardInterviewer) other); + } + + private boolean equalTo(ScorecardInterviewer other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ScorecardInterviewer of(String value) { + return new ScorecardInterviewer(value, 0); + } + + public static ScorecardInterviewer of(RemoteUser value) { + return new ScorecardInterviewer(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(RemoteUser value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ScorecardInterviewer.class); + } + + @Override + public ScorecardInterviewer 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, RemoteUser.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ScorecardOverallRecommendation.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScorecardOverallRecommendation.java new file mode 100644 index 000000000..419250141 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScorecardOverallRecommendation.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/ScreeningQuestion.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestion.java new file mode 100644 index 000000000..714b1cb7a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestion.java @@ -0,0 +1,390 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ScreeningQuestion.Builder.class) +public final class ScreeningQuestion { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional job; + + private final Optional description; + + private final Optional title; + + private final Optional type; + + private final Optional required; + + private final Optional> options; + + private final Optional remoteWasDeleted; + + private final Map additionalProperties; + + private ScreeningQuestion( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional job, + Optional description, + Optional title, + Optional type, + Optional required, + Optional> options, + Optional remoteWasDeleted, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.job = job; + this.description = description; + this.title = title; + this.type = type; + this.required = required; + this.options = options; + this.remoteWasDeleted = remoteWasDeleted; + 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 job associated with the screening question. + */ + @JsonProperty("job") + public Optional getJob() { + return job; + } + + /** + * @return The description of the screening question + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The title of the screening question + */ + @JsonProperty("title") + public Optional getTitle() { + return title; + } + + /** + * @return The data type for the screening question. + *
    + *
  • DATE - DATE
  • + *
  • FILE - FILE
  • + *
  • SINGLE_SELECT - SINGLE_SELECT
  • + *
  • MULTI_SELECT - MULTI_SELECT
  • + *
  • SINGLE_LINE_TEXT - SINGLE_LINE_TEXT
  • + *
  • MULTI_LINE_TEXT - MULTI_LINE_TEXT
  • + *
  • NUMERIC - NUMERIC
  • + *
  • BOOLEAN - BOOLEAN
  • + *
+ */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return Whether or not the screening question is required. + */ + @JsonProperty("required") + public Optional getRequired() { + return required; + } + + @JsonProperty("options") + public Optional> getOptions() { + return options; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScreeningQuestion && equalTo((ScreeningQuestion) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ScreeningQuestion other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && job.equals(other.job) + && description.equals(other.description) + && title.equals(other.title) + && type.equals(other.type) + && required.equals(other.required) + && options.equals(other.options) + && remoteWasDeleted.equals(other.remoteWasDeleted); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.job, + this.description, + this.title, + this.type, + this.required, + this.options, + this.remoteWasDeleted); + } + + @Override + 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 job = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional title = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional required = Optional.empty(); + + private Optional> options = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ScreeningQuestion other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + job(other.getJob()); + description(other.getDescription()); + title(other.getTitle()); + type(other.getType()); + required(other.getRequired()); + options(other.getOptions()); + remoteWasDeleted(other.getRemoteWasDeleted()); + 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 = "job", nulls = Nulls.SKIP) + public Builder job(Optional job) { + this.job = job; + return this; + } + + public Builder job(ScreeningQuestionJob job) { + this.job = Optional.ofNullable(job); + 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 = "title", nulls = Nulls.SKIP) + public Builder title(Optional title) { + this.title = title; + return this; + } + + public Builder title(String title) { + this.title = Optional.ofNullable(title); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(ScreeningQuestionType type) { + this.type = Optional.ofNullable(type); + return this; + } + + @JsonSetter(value = "required", nulls = Nulls.SKIP) + public Builder required(Optional required) { + this.required = required; + return this; + } + + public Builder required(Boolean required) { + this.required = Optional.ofNullable(required); + return this; + } + + @JsonSetter(value = "options", nulls = Nulls.SKIP) + public Builder options(Optional> options) { + this.options = options; + return this; + } + + public Builder options(List options) { + this.options = Optional.ofNullable(options); + 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 ScreeningQuestion build() { + return new ScreeningQuestion( + id, + remoteId, + createdAt, + modifiedAt, + job, + description, + title, + type, + required, + options, + remoteWasDeleted, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestionAnswer.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestionAnswer.java new file mode 100644 index 000000000..47fa905ca --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestionAnswer.java @@ -0,0 +1,262 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = ScreeningQuestionAnswer.Builder.class) +public final class ScreeningQuestionAnswer { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional question; + + private final Optional answer; + + private final Optional remoteWasDeleted; + + private final Map additionalProperties; + + private ScreeningQuestionAnswer( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional question, + Optional answer, + Optional remoteWasDeleted, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.question = question; + this.answer = answer; + this.remoteWasDeleted = remoteWasDeleted; + 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 screening question associated with the candidate’s answer. To determine the data type of the answer, you can expand on the screening question by adding screening_question_answers.question to the expand query parameter. + */ + @JsonProperty("question") + public Optional getQuestion() { + return question; + } + + /** + * @return The candidate’s response to the screening question. + */ + @JsonProperty("answer") + public Optional getAnswer() { + return answer; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScreeningQuestionAnswer && equalTo((ScreeningQuestionAnswer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ScreeningQuestionAnswer other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && question.equals(other.question) + && answer.equals(other.answer) + && remoteWasDeleted.equals(other.remoteWasDeleted); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.question, + this.answer, + this.remoteWasDeleted); + } + + @Override + 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 question = Optional.empty(); + + private Optional answer = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ScreeningQuestionAnswer other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + question(other.getQuestion()); + answer(other.getAnswer()); + remoteWasDeleted(other.getRemoteWasDeleted()); + 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 = "question", nulls = Nulls.SKIP) + public Builder question(Optional question) { + this.question = question; + return this; + } + + public Builder question(ScreeningQuestionAnswerQuestion question) { + this.question = Optional.ofNullable(question); + return this; + } + + @JsonSetter(value = "answer", nulls = Nulls.SKIP) + public Builder answer(Optional answer) { + this.answer = answer; + return this; + } + + public Builder answer(String answer) { + this.answer = Optional.ofNullable(answer); + 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 ScreeningQuestionAnswer build() { + return new ScreeningQuestionAnswer( + id, remoteId, createdAt, modifiedAt, question, answer, remoteWasDeleted, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestionAnswerQuestion.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestionAnswerQuestion.java new file mode 100644 index 000000000..f4d366ad9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestionAnswerQuestion.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ScreeningQuestionAnswerQuestion.Deserializer.class) +public final class ScreeningQuestionAnswerQuestion { + private final Object value; + + private final int type; + + private ScreeningQuestionAnswerQuestion(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((ScreeningQuestion) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScreeningQuestionAnswerQuestion && equalTo((ScreeningQuestionAnswerQuestion) other); + } + + private boolean equalTo(ScreeningQuestionAnswerQuestion other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ScreeningQuestionAnswerQuestion of(String value) { + return new ScreeningQuestionAnswerQuestion(value, 0); + } + + public static ScreeningQuestionAnswerQuestion of(ScreeningQuestion value) { + return new ScreeningQuestionAnswerQuestion(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(ScreeningQuestion value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ScreeningQuestionAnswerQuestion.class); + } + + @Override + public ScreeningQuestionAnswerQuestion 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, ScreeningQuestion.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestionAnswerRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestionAnswerRequest.java new file mode 100644 index 000000000..a8e27ea08 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestionAnswerRequest.java @@ -0,0 +1,199 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = ScreeningQuestionAnswerRequest.Builder.class) +public final class ScreeningQuestionAnswerRequest { + private final Optional remoteId; + + private final Optional question; + + private final Optional answer; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private ScreeningQuestionAnswerRequest( + Optional remoteId, + Optional question, + Optional answer, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.remoteId = remoteId; + this.question = question; + this.answer = answer; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The screening question associated with the candidate’s answer. To determine the data type of the answer, you can expand on the screening question by adding screening_question_answers.question to the expand query parameter. + */ + @JsonProperty("question") + public Optional getQuestion() { + return question; + } + + /** + * @return The candidate’s response to the screening question. + */ + @JsonProperty("answer") + public Optional getAnswer() { + return answer; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScreeningQuestionAnswerRequest && equalTo((ScreeningQuestionAnswerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ScreeningQuestionAnswerRequest other) { + return remoteId.equals(other.remoteId) + && question.equals(other.question) + && answer.equals(other.answer) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @Override + public int hashCode() { + return Objects.hash( + this.remoteId, this.question, this.answer, this.integrationParams, this.linkedAccountParams); + } + + @Override + 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 question = Optional.empty(); + + private Optional answer = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ScreeningQuestionAnswerRequest other) { + remoteId(other.getRemoteId()); + question(other.getQuestion()); + answer(other.getAnswer()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + 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 = "question", nulls = Nulls.SKIP) + public Builder question(Optional question) { + this.question = question; + return this; + } + + public Builder question(ScreeningQuestionAnswerRequestQuestion question) { + this.question = Optional.ofNullable(question); + return this; + } + + @JsonSetter(value = "answer", nulls = Nulls.SKIP) + public Builder answer(Optional answer) { + this.answer = answer; + return this; + } + + public Builder answer(String answer) { + this.answer = Optional.ofNullable(answer); + 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 ScreeningQuestionAnswerRequest build() { + return new ScreeningQuestionAnswerRequest( + remoteId, question, answer, integrationParams, linkedAccountParams, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestionAnswerRequestQuestion.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestionAnswerRequestQuestion.java new file mode 100644 index 000000000..05e425daf --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestionAnswerRequestQuestion.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ScreeningQuestionAnswerRequestQuestion.Deserializer.class) +public final class ScreeningQuestionAnswerRequestQuestion { + private final Object value; + + private final int type; + + private ScreeningQuestionAnswerRequestQuestion(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((ScreeningQuestion) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScreeningQuestionAnswerRequestQuestion + && equalTo((ScreeningQuestionAnswerRequestQuestion) other); + } + + private boolean equalTo(ScreeningQuestionAnswerRequestQuestion other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ScreeningQuestionAnswerRequestQuestion of(String value) { + return new ScreeningQuestionAnswerRequestQuestion(value, 0); + } + + public static ScreeningQuestionAnswerRequestQuestion of(ScreeningQuestion value) { + return new ScreeningQuestionAnswerRequestQuestion(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(ScreeningQuestion value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ScreeningQuestionAnswerRequestQuestion.class); + } + + @Override + public ScreeningQuestionAnswerRequestQuestion 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, ScreeningQuestion.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestionJob.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestionJob.java new file mode 100644 index 000000000..3c09225ec --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestionJob.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ScreeningQuestionJob.Deserializer.class) +public final class ScreeningQuestionJob { + private final Object value; + + private final int type; + + private ScreeningQuestionJob(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((Job) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScreeningQuestionJob && equalTo((ScreeningQuestionJob) other); + } + + private boolean equalTo(ScreeningQuestionJob other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ScreeningQuestionJob of(String value) { + return new ScreeningQuestionJob(value, 0); + } + + public static ScreeningQuestionJob of(Job value) { + return new ScreeningQuestionJob(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Job value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ScreeningQuestionJob.class); + } + + @Override + public ScreeningQuestionJob 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, Job.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestionOption.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestionOption.java new file mode 100644 index 000000000..015c4a17e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestionOption.java @@ -0,0 +1,228 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = ScreeningQuestionOption.Builder.class) +public final class ScreeningQuestionOption { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional label; + + private final Optional remoteWasDeleted; + + private final Map additionalProperties; + + private ScreeningQuestionOption( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional label, + Optional remoteWasDeleted, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.label = label; + this.remoteWasDeleted = remoteWasDeleted; + 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 Available response options + */ + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScreeningQuestionOption && equalTo((ScreeningQuestionOption) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ScreeningQuestionOption other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && label.equals(other.label) + && remoteWasDeleted.equals(other.remoteWasDeleted); + } + + @Override + public int hashCode() { + return Objects.hash(this.id, this.remoteId, this.createdAt, this.modifiedAt, this.label, this.remoteWasDeleted); + } + + @Override + 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 label = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ScreeningQuestionOption other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + label(other.getLabel()); + remoteWasDeleted(other.getRemoteWasDeleted()); + 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 = "label", nulls = Nulls.SKIP) + public Builder label(Optional label) { + this.label = label; + return this; + } + + public Builder label(String label) { + this.label = Optional.ofNullable(label); + 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 ScreeningQuestionOption build() { + return new ScreeningQuestionOption( + id, remoteId, createdAt, modifiedAt, label, remoteWasDeleted, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestionType.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestionType.java new file mode 100644 index 000000000..7adc4e945 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestionType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/ScreeningQuestionTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestionTypeEnum.java new file mode 100644 index 000000000..cc0c5bad7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ScreeningQuestionTypeEnum.java @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ScreeningQuestionTypeEnum { + DATE("DATE"), + + FILE("FILE"), + + SINGLE_SELECT("SINGLE_SELECT"), + + MULTI_SELECT("MULTI_SELECT"), + + SINGLE_LINE_TEXT("SINGLE_LINE_TEXT"), + + MULTI_LINE_TEXT("MULTI_LINE_TEXT"), + + NUMERIC("NUMERIC"), + + BOOLEAN("BOOLEAN"); + + private final String value; + + ScreeningQuestionTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/SelectiveSyncConfigurationsUsageEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/SelectiveSyncConfigurationsUsageEnum.java new file mode 100644 index 000000000..d928fc5e4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/SelectiveSyncConfigurationsUsageEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/SyncStatus.java b/src/main/java/com/merge/legacy/api/resources/ats/types/SyncStatus.java new file mode 100644 index 000000000..91a035269 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/SyncStatus.java @@ -0,0 +1,283 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.modelName, + this.modelId, + this.lastSyncStart, + this.nextSyncStart, + this.status, + this.isInitialSync, + this.selectiveSyncConfigurationsUsage); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("model_name") + public ModelIdStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @Override + @JsonSetter("model_id") + public StatusStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @Override + @JsonSetter("status") + public IsInitialSyncStage status(@NotNull SyncStatusStatusEnum status) { + this.status = status; + return this; + } + + @Override + @JsonSetter("is_initial_sync") + public _FinalStage isInitialSync(boolean isInitialSync) { + this.isInitialSync = isInitialSync; + return this; + } + + @Override + public _FinalStage selectiveSyncConfigurationsUsage( + SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = Optional.ofNullable(selectiveSyncConfigurationsUsage); + return this; + } + + @Override + @JsonSetter(value = "selective_sync_configurations_usage", nulls = Nulls.SKIP) + public _FinalStage selectiveSyncConfigurationsUsage( + Optional selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; + return this; + } + + @Override + public _FinalStage nextSyncStart(OffsetDateTime nextSyncStart) { + this.nextSyncStart = Optional.ofNullable(nextSyncStart); + return this; + } + + @Override + @JsonSetter(value = "next_sync_start", nulls = Nulls.SKIP) + public _FinalStage nextSyncStart(Optional nextSyncStart) { + this.nextSyncStart = nextSyncStart; + return this; + } + + @Override + public _FinalStage lastSyncStart(OffsetDateTime lastSyncStart) { + this.lastSyncStart = Optional.ofNullable(lastSyncStart); + return this; + } + + @Override + @JsonSetter(value = "last_sync_start", nulls = Nulls.SKIP) + public _FinalStage lastSyncStart(Optional lastSyncStart) { + this.lastSyncStart = lastSyncStart; + return this; + } + + @Override + public SyncStatus build() { + return new SyncStatus( + modelName, + modelId, + lastSyncStart, + nextSyncStart, + status, + isInitialSync, + selectiveSyncConfigurationsUsage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/SyncStatusStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/SyncStatusStatusEnum.java new file mode 100644 index 000000000..316cfcad8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/SyncStatusStatusEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/Tag.java b/src/main/java/com/merge/legacy/api/resources/ats/types/Tag.java new file mode 100644 index 000000000..81b1c6e60 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/Tag.java @@ -0,0 +1,264 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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/legacy/api/resources/ats/types/Url.java b/src/main/java/com/merge/legacy/api/resources/ats/types/Url.java new file mode 100644 index 000000000..28b41c77f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/Url.java @@ -0,0 +1,212 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = Url.Builder.class) +public final class Url { + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional value; + + private final Optional urlType; + + private final Optional remoteWasDeleted; + + private final Map additionalProperties; + + private Url( + Optional createdAt, + Optional modifiedAt, + Optional value, + Optional urlType, + Optional remoteWasDeleted, + Map additionalProperties) { + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.value = value; + this.urlType = urlType; + 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 site's url. + */ + @JsonProperty("value") + public Optional getValue() { + return value; + } + + /** + * @return The type of site. + *
    + *
  • PERSONAL - PERSONAL
  • + *
  • COMPANY - COMPANY
  • + *
  • PORTFOLIO - PORTFOLIO
  • + *
  • BLOG - BLOG
  • + *
  • SOCIAL_MEDIA - SOCIAL_MEDIA
  • + *
  • OTHER - OTHER
  • + *
  • JOB_POSTING - JOB_POSTING
  • + *
+ */ + @JsonProperty("url_type") + public Optional getUrlType() { + return urlType; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Url && equalTo((Url) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Url other) { + return createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && value.equals(other.value) + && urlType.equals(other.urlType) + && remoteWasDeleted.equals(other.remoteWasDeleted); + } + + @Override + public int hashCode() { + return Objects.hash(this.createdAt, this.modifiedAt, this.value, this.urlType, this.remoteWasDeleted); + } + + @Override + 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 urlType = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Url other) { + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + value(other.getValue()); + urlType(other.getUrlType()); + 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 = "url_type", nulls = Nulls.SKIP) + public Builder urlType(Optional urlType) { + this.urlType = urlType; + return this; + } + + public Builder urlType(UrlUrlType urlType) { + this.urlType = Optional.ofNullable(urlType); + 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 Url build() { + return new Url(createdAt, modifiedAt, value, urlType, remoteWasDeleted, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/UrlRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/types/UrlRequest.java new file mode 100644 index 000000000..dd2d1a202 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/UrlRequest.java @@ -0,0 +1,179 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = UrlRequest.Builder.class) +public final class UrlRequest { + private final Optional value; + + private final Optional urlType; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private UrlRequest( + Optional value, + Optional urlType, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.value = value; + this.urlType = urlType; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The site's url. + */ + @JsonProperty("value") + public Optional getValue() { + return value; + } + + /** + * @return The type of site. + *
    + *
  • PERSONAL - PERSONAL
  • + *
  • COMPANY - COMPANY
  • + *
  • PORTFOLIO - PORTFOLIO
  • + *
  • BLOG - BLOG
  • + *
  • SOCIAL_MEDIA - SOCIAL_MEDIA
  • + *
  • OTHER - OTHER
  • + *
  • JOB_POSTING - JOB_POSTING
  • + *
+ */ + @JsonProperty("url_type") + public Optional getUrlType() { + return urlType; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UrlRequest && equalTo((UrlRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UrlRequest other) { + return value.equals(other.value) + && urlType.equals(other.urlType) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @Override + public int hashCode() { + return Objects.hash(this.value, this.urlType, this.integrationParams, this.linkedAccountParams); + } + + @Override + 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 urlType = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UrlRequest other) { + value(other.getValue()); + urlType(other.getUrlType()); + 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 = "url_type", nulls = Nulls.SKIP) + public Builder urlType(Optional urlType) { + this.urlType = urlType; + return this; + } + + public Builder urlType(UrlRequestUrlType urlType) { + this.urlType = Optional.ofNullable(urlType); + 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 UrlRequest build() { + return new UrlRequest(value, urlType, integrationParams, linkedAccountParams, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/UrlRequestUrlType.java b/src/main/java/com/merge/legacy/api/resources/ats/types/UrlRequestUrlType.java new file mode 100644 index 000000000..7df797410 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/UrlRequestUrlType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/UrlTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/UrlTypeEnum.java new file mode 100644 index 000000000..83552bbb0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/UrlTypeEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum UrlTypeEnum { + PERSONAL("PERSONAL"), + + COMPANY("COMPANY"), + + PORTFOLIO("PORTFOLIO"), + + BLOG("BLOG"), + + SOCIAL_MEDIA("SOCIAL_MEDIA"), + + OTHER("OTHER"), + + JOB_POSTING("JOB_POSTING"); + + private final String value; + + UrlTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/UrlUrlType.java b/src/main/java/com/merge/legacy/api/resources/ats/types/UrlUrlType.java new file mode 100644 index 000000000..0a26bfaa6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/UrlUrlType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ats/types/ValidationProblemSource.java b/src/main/java/com/merge/legacy/api/resources/ats/types/ValidationProblemSource.java new file mode 100644 index 000000000..10b850e7e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/ValidationProblemSource.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.pointer); + } + + @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() {} + + @Override + public Builder from(ValidationProblemSource other) { + pointer(other.getPointer()); + return this; + } + + @Override + @JsonSetter("pointer") + public _FinalStage pointer(@NotNull String pointer) { + this.pointer = pointer; + return this; + } + + @Override + public ValidationProblemSource build() { + return new ValidationProblemSource(pointer, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/VeteranStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/VeteranStatusEnum.java new file mode 100644 index 000000000..376feee8b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/VeteranStatusEnum.java @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum VeteranStatusEnum { + I_AM_NOT_A_PROTECTED_VETERAN("I_AM_NOT_A_PROTECTED_VETERAN"), + + I_IDENTIFY_AS_ONE_OR_MORE_OF_THE_CLASSIFICATIONS_OF_A_PROTECTED_VETERAN( + "I_IDENTIFY_AS_ONE_OR_MORE_OF_THE_CLASSIFICATIONS_OF_A_PROTECTED_VETERAN"), + + I_DONT_WISH_TO_ANSWER("I_DONT_WISH_TO_ANSWER"); + + private final String value; + + VeteranStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/VisibilityEnum.java b/src/main/java/com/merge/legacy/api/resources/ats/types/VisibilityEnum.java new file mode 100644 index 000000000..cd77207be --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/VisibilityEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum VisibilityEnum { + ADMIN_ONLY("ADMIN_ONLY"), + + PUBLIC("PUBLIC"), + + PRIVATE("PRIVATE"); + + private final String value; + + VisibilityEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/WarningValidationProblem.java b/src/main/java/com/merge/legacy/api/resources/ats/types/WarningValidationProblem.java new file mode 100644 index 000000000..d68d35cfd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/WarningValidationProblem.java @@ -0,0 +1,178 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.source, this.title, this.detail, this.problemType); + } + + @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() {} + + @Override + public Builder from(WarningValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + return this; + } + + @Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @Override + public WarningValidationProblem build() { + return new WarningValidationProblem(source, title, detail, problemType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/types/WebhookReceiver.java b/src/main/java/com/merge/legacy/api/resources/ats/types/WebhookReceiver.java new file mode 100644 index 000000000..59d5e492d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/types/WebhookReceiver.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @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() {} + + @Override + public Builder from(WebhookReceiver other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @Override + public WebhookReceiver build() { + return new WebhookReceiver(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ats/users/UsersClient.java b/src/main/java/com/merge/legacy/api/resources/ats/users/UsersClient.java new file mode 100644 index 000000000..736bf7cf4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/users/UsersClient.java @@ -0,0 +1,174 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.users; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.types.PaginatedRemoteUserList; +import com.merge.legacy.api.resources.ats.types.RemoteUser; +import com.merge.legacy.api.resources.ats.users.requests.UsersListRequest; +import com.merge.legacy.api.resources.ats.users.requests.UsersRetrieveRequest; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ats/users/requests/UsersListRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/users/requests/UsersListRequest.java new file mode 100644 index 000000000..4f9b470c2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/users/requests/UsersListRequest.java @@ -0,0 +1,446 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.users.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ats/users/requests/UsersRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/users/requests/UsersRetrieveRequest.java new file mode 100644 index 000000000..926692979 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/users/requests/UsersRetrieveRequest.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.users.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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/legacy/api/resources/ats/webhookreceivers/WebhookReceiversClient.java b/src/main/java/com/merge/legacy/api/resources/ats/webhookreceivers/WebhookReceiversClient.java new file mode 100644 index 000000000..2d31d71b6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/webhookreceivers/WebhookReceiversClient.java @@ -0,0 +1,111 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.webhookreceivers; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ats.types.WebhookReceiver; +import com.merge.legacy.api.resources.ats.webhookreceivers.requests.WebhookReceiverRequest; +import java.io.IOException; +import java.util.List; +import okhttp3.*; + +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/legacy/api/resources/ats/webhookreceivers/requests/WebhookReceiverRequest.java b/src/main/java/com/merge/legacy/api/resources/ats/webhookreceivers/requests/WebhookReceiverRequest.java new file mode 100644 index 000000000..0a8414780 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ats/webhookreceivers/requests/WebhookReceiverRequest.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ats.webhookreceivers.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @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() {} + + @Override + public Builder from(WebhookReceiverRequest other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @Override + public WebhookReceiverRequest build() { + return new WebhookReceiverRequest(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/CrmClient.java b/src/main/java/com/merge/legacy/api/resources/crm/CrmClient.java new file mode 100644 index 000000000..0e2849524 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/CrmClient.java @@ -0,0 +1,264 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm; + +import com.merge.legacy.api.core.ClientOptions; +import com.merge.legacy.api.core.Suppliers; +import com.merge.legacy.api.resources.crm.accountdetails.AccountDetailsClient; +import com.merge.legacy.api.resources.crm.accounts.AccountsClient; +import com.merge.legacy.api.resources.crm.accounttoken.AccountTokenClient; +import com.merge.legacy.api.resources.crm.associations.AssociationsClient; +import com.merge.legacy.api.resources.crm.associationtypes.AssociationTypesClient; +import com.merge.legacy.api.resources.crm.asyncpassthrough.AsyncPassthroughClient; +import com.merge.legacy.api.resources.crm.audittrail.AuditTrailClient; +import com.merge.legacy.api.resources.crm.availableactions.AvailableActionsClient; +import com.merge.legacy.api.resources.crm.contacts.ContactsClient; +import com.merge.legacy.api.resources.crm.customobjectclasses.CustomObjectClassesClient; +import com.merge.legacy.api.resources.crm.customobjects.CustomObjectsClient; +import com.merge.legacy.api.resources.crm.deleteaccount.DeleteAccountClient; +import com.merge.legacy.api.resources.crm.engagements.EngagementsClient; +import com.merge.legacy.api.resources.crm.engagementtypes.EngagementTypesClient; +import com.merge.legacy.api.resources.crm.fieldmapping.FieldMappingClient; +import com.merge.legacy.api.resources.crm.forceresync.ForceResyncClient; +import com.merge.legacy.api.resources.crm.generatekey.GenerateKeyClient; +import com.merge.legacy.api.resources.crm.issues.IssuesClient; +import com.merge.legacy.api.resources.crm.leads.LeadsClient; +import com.merge.legacy.api.resources.crm.linkedaccounts.LinkedAccountsClient; +import com.merge.legacy.api.resources.crm.linktoken.LinkTokenClient; +import com.merge.legacy.api.resources.crm.notes.NotesClient; +import com.merge.legacy.api.resources.crm.opportunities.OpportunitiesClient; +import com.merge.legacy.api.resources.crm.passthrough.PassthroughClient; +import com.merge.legacy.api.resources.crm.regeneratekey.RegenerateKeyClient; +import com.merge.legacy.api.resources.crm.scopes.ScopesClient; +import com.merge.legacy.api.resources.crm.stages.StagesClient; +import com.merge.legacy.api.resources.crm.syncstatus.SyncStatusClient; +import com.merge.legacy.api.resources.crm.tasks.TasksClient; +import com.merge.legacy.api.resources.crm.users.UsersClient; +import com.merge.legacy.api.resources.crm.webhookreceivers.WebhookReceiversClient; +import java.util.function.Supplier; + +public class CrmClient { + 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 CrmClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.accountDetailsClient = Suppliers.memoize(() -> new AccountDetailsClient(clientOptions)); + this.accountTokenClient = Suppliers.memoize(() -> new AccountTokenClient(clientOptions)); + this.accountsClient = Suppliers.memoize(() -> new AccountsClient(clientOptions)); + this.asyncPassthroughClient = Suppliers.memoize(() -> new AsyncPassthroughClient(clientOptions)); + this.auditTrailClient = Suppliers.memoize(() -> new AuditTrailClient(clientOptions)); + this.availableActionsClient = Suppliers.memoize(() -> new AvailableActionsClient(clientOptions)); + this.contactsClient = Suppliers.memoize(() -> new ContactsClient(clientOptions)); + this.customObjectClassesClient = Suppliers.memoize(() -> new CustomObjectClassesClient(clientOptions)); + this.associationTypesClient = Suppliers.memoize(() -> new AssociationTypesClient(clientOptions)); + this.customObjectsClient = Suppliers.memoize(() -> new CustomObjectsClient(clientOptions)); + this.associationsClient = Suppliers.memoize(() -> new AssociationsClient(clientOptions)); + this.scopesClient = Suppliers.memoize(() -> new ScopesClient(clientOptions)); + this.deleteAccountClient = Suppliers.memoize(() -> new DeleteAccountClient(clientOptions)); + this.engagementTypesClient = Suppliers.memoize(() -> new EngagementTypesClient(clientOptions)); + this.engagementsClient = Suppliers.memoize(() -> new EngagementsClient(clientOptions)); + this.fieldMappingClient = Suppliers.memoize(() -> new FieldMappingClient(clientOptions)); + this.generateKeyClient = Suppliers.memoize(() -> new GenerateKeyClient(clientOptions)); + this.issuesClient = Suppliers.memoize(() -> new IssuesClient(clientOptions)); + this.leadsClient = Suppliers.memoize(() -> new LeadsClient(clientOptions)); + this.linkTokenClient = Suppliers.memoize(() -> new LinkTokenClient(clientOptions)); + this.linkedAccountsClient = Suppliers.memoize(() -> new LinkedAccountsClient(clientOptions)); + this.notesClient = Suppliers.memoize(() -> new NotesClient(clientOptions)); + this.opportunitiesClient = Suppliers.memoize(() -> new OpportunitiesClient(clientOptions)); + this.passthroughClient = Suppliers.memoize(() -> new PassthroughClient(clientOptions)); + this.regenerateKeyClient = Suppliers.memoize(() -> new RegenerateKeyClient(clientOptions)); + this.stagesClient = Suppliers.memoize(() -> new StagesClient(clientOptions)); + this.syncStatusClient = Suppliers.memoize(() -> new SyncStatusClient(clientOptions)); + this.forceResyncClient = Suppliers.memoize(() -> new ForceResyncClient(clientOptions)); + this.tasksClient = Suppliers.memoize(() -> new TasksClient(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 AccountsClient accounts() { + return this.accountsClient.get(); + } + + public AsyncPassthroughClient asyncPassthrough() { + return this.asyncPassthroughClient.get(); + } + + public AuditTrailClient auditTrail() { + return this.auditTrailClient.get(); + } + + public AvailableActionsClient availableActions() { + return this.availableActionsClient.get(); + } + + public ContactsClient contacts() { + return this.contactsClient.get(); + } + + public CustomObjectClassesClient customObjectClasses() { + return this.customObjectClassesClient.get(); + } + + public AssociationTypesClient associationTypes() { + return this.associationTypesClient.get(); + } + + public CustomObjectsClient customObjects() { + return this.customObjectsClient.get(); + } + + public AssociationsClient associations() { + return this.associationsClient.get(); + } + + public ScopesClient scopes() { + return this.scopesClient.get(); + } + + public DeleteAccountClient deleteAccount() { + return this.deleteAccountClient.get(); + } + + public EngagementTypesClient engagementTypes() { + return this.engagementTypesClient.get(); + } + + public EngagementsClient engagements() { + return this.engagementsClient.get(); + } + + public FieldMappingClient fieldMapping() { + return this.fieldMappingClient.get(); + } + + public GenerateKeyClient generateKey() { + return this.generateKeyClient.get(); + } + + public IssuesClient issues() { + return this.issuesClient.get(); + } + + public LeadsClient leads() { + return this.leadsClient.get(); + } + + public LinkTokenClient linkToken() { + return this.linkTokenClient.get(); + } + + public LinkedAccountsClient linkedAccounts() { + return this.linkedAccountsClient.get(); + } + + public NotesClient notes() { + return this.notesClient.get(); + } + + public OpportunitiesClient opportunities() { + return this.opportunitiesClient.get(); + } + + public PassthroughClient passthrough() { + return this.passthroughClient.get(); + } + + public RegenerateKeyClient regenerateKey() { + return this.regenerateKeyClient.get(); + } + + public StagesClient stages() { + return this.stagesClient.get(); + } + + public SyncStatusClient syncStatus() { + return this.syncStatusClient.get(); + } + + public ForceResyncClient forceResync() { + return this.forceResyncClient.get(); + } + + public TasksClient tasks() { + return this.tasksClient.get(); + } + + public UsersClient users() { + return this.usersClient.get(); + } + + public WebhookReceiversClient webhookReceivers() { + return this.webhookReceiversClient.get(); + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/accountdetails/AccountDetailsClient.java b/src/main/java/com/merge/legacy/api/resources/crm/accountdetails/AccountDetailsClient.java new file mode 100644 index 000000000..3b4524db9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/accountdetails/AccountDetailsClient.java @@ -0,0 +1,58 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.accountdetails; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.types.AccountDetails; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/crm/accounts/AccountsClient.java b/src/main/java/com/merge/legacy/api/resources/crm/accounts/AccountsClient.java new file mode 100644 index 000000000..9cbf60563 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/accounts/AccountsClient.java @@ -0,0 +1,454 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.accounts; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.accounts.requests.*; +import com.merge.legacy.api.resources.crm.types.*; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/crm/accounts/requests/AccountsListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/accounts/requests/AccountsListRequest.java new file mode 100644 index 000000000..d24eb63ae --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/accounts/requests/AccountsListRequest.java @@ -0,0 +1,475 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.accounts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/crm/accounts/requests/AccountsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/accounts/requests/AccountsRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..e6b7b003f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/accounts/requests/AccountsRemoteFieldClassesListRequest.java @@ -0,0 +1,272 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.accounts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = AccountsRemoteFieldClassesListRequest.Builder.class) +public final class AccountsRemoteFieldClassesListRequest { + 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 AccountsRemoteFieldClassesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountsRemoteFieldClassesListRequest + && equalTo((AccountsRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountsRemoteFieldClassesListRequest 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @Override + 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(AccountsRemoteFieldClassesListRequest 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 AccountsRemoteFieldClassesListRequest build() { + return new AccountsRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + isCommonModelField, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/accounts/requests/AccountsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/accounts/requests/AccountsRetrieveRequest.java new file mode 100644 index 000000000..73118fcc8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/accounts/requests/AccountsRetrieveRequest.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.accounts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields); + } + + @Override + 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/legacy/api/resources/crm/accounts/requests/CrmAccountEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/accounts/requests/CrmAccountEndpointRequest.java new file mode 100644 index 000000000..cbbe2086e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/accounts/requests/CrmAccountEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.accounts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.crm.types.AccountRequest; +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 = CrmAccountEndpointRequest.Builder.class) +public final class CrmAccountEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final AccountRequest model; + + private final Map additionalProperties; + + private CrmAccountEndpointRequest( + Optional isDebugMode, + Optional runAsync, + AccountRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public AccountRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CrmAccountEndpointRequest && equalTo((CrmAccountEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CrmAccountEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull AccountRequest model); + + Builder from(CrmAccountEndpointRequest other); + } + + public interface _FinalStage { + CrmAccountEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private AccountRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CrmAccountEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull AccountRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public CrmAccountEndpointRequest build() { + return new CrmAccountEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/accounts/requests/PatchedCrmAccountEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/accounts/requests/PatchedCrmAccountEndpointRequest.java new file mode 100644 index 000000000..873e79bc5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/accounts/requests/PatchedCrmAccountEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.accounts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.crm.types.PatchedAccountRequest; +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 = PatchedCrmAccountEndpointRequest.Builder.class) +public final class PatchedCrmAccountEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final PatchedAccountRequest model; + + private final Map additionalProperties; + + private PatchedCrmAccountEndpointRequest( + Optional isDebugMode, + Optional runAsync, + PatchedAccountRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public PatchedAccountRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedCrmAccountEndpointRequest && equalTo((PatchedCrmAccountEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedCrmAccountEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull PatchedAccountRequest model); + + Builder from(PatchedCrmAccountEndpointRequest other); + } + + public interface _FinalStage { + PatchedCrmAccountEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private PatchedAccountRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(PatchedCrmAccountEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull PatchedAccountRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public PatchedCrmAccountEndpointRequest build() { + return new PatchedCrmAccountEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/accounttoken/AccountTokenClient.java b/src/main/java/com/merge/legacy/api/resources/crm/accounttoken/AccountTokenClient.java new file mode 100644 index 000000000..89e74db77 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/accounttoken/AccountTokenClient.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.accounttoken; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.types.AccountToken; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/crm/associations/AssociationsClient.java b/src/main/java/com/merge/legacy/api/resources/crm/associations/AssociationsClient.java new file mode 100644 index 000000000..9cbc8162f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/associations/AssociationsClient.java @@ -0,0 +1,215 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.associations; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.associations.requests.CustomObjectClassesCustomObjectsAssociationsListRequest; +import com.merge.legacy.api.resources.crm.associations.requests.CustomObjectClassesCustomObjectsAssociationsUpdateRequest; +import com.merge.legacy.api.resources.crm.types.Association; +import com.merge.legacy.api.resources.crm.types.PaginatedAssociationList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/crm/associations/requests/CustomObjectClassesCustomObjectsAssociationsListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/associations/requests/CustomObjectClassesCustomObjectsAssociationsListRequest.java new file mode 100644 index 000000000..5845f72be --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/associations/requests/CustomObjectClassesCustomObjectsAssociationsListRequest.java @@ -0,0 +1,418 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.associations.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = CustomObjectClassesCustomObjectsAssociationsListRequest.Builder.class) +public final class CustomObjectClassesCustomObjectsAssociationsListRequest { + private final Optional associationTypeId; + + 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 CustomObjectClassesCustomObjectsAssociationsListRequest( + Optional associationTypeId, + 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.associationTypeId = associationTypeId; + 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 opportunities with this association_type. + */ + @JsonProperty("association_type_id") + public Optional getAssociationTypeId() { + return associationTypeId; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomObjectClassesCustomObjectsAssociationsListRequest + && equalTo((CustomObjectClassesCustomObjectsAssociationsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CustomObjectClassesCustomObjectsAssociationsListRequest other) { + return 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) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @Override + public int hashCode() { + return Objects.hash( + this.associationTypeId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional associationTypeId = 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 remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CustomObjectClassesCustomObjectsAssociationsListRequest other) { + associationTypeId(other.getAssociationTypeId()); + 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 = "association_type_id", nulls = Nulls.SKIP) + public Builder associationTypeId(Optional associationTypeId) { + this.associationTypeId = associationTypeId; + return this; + } + + public Builder associationTypeId(String associationTypeId) { + this.associationTypeId = Optional.ofNullable(associationTypeId); + 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 CustomObjectClassesCustomObjectsAssociationsListRequest build() { + return new CustomObjectClassesCustomObjectsAssociationsListRequest( + associationTypeId, + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/associations/requests/CustomObjectClassesCustomObjectsAssociationsUpdateRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/associations/requests/CustomObjectClassesCustomObjectsAssociationsUpdateRequest.java new file mode 100644 index 000000000..680c4a428 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/associations/requests/CustomObjectClassesCustomObjectsAssociationsUpdateRequest.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.associations.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = CustomObjectClassesCustomObjectsAssociationsUpdateRequest.Builder.class) +public final class CustomObjectClassesCustomObjectsAssociationsUpdateRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final Map additionalProperties; + + private CustomObjectClassesCustomObjectsAssociationsUpdateRequest( + Optional isDebugMode, Optional runAsync, Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomObjectClassesCustomObjectsAssociationsUpdateRequest + && equalTo((CustomObjectClassesCustomObjectsAssociationsUpdateRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CustomObjectClassesCustomObjectsAssociationsUpdateRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional isDebugMode = Optional.empty(); + + private Optional runAsync = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CustomObjectClassesCustomObjectsAssociationsUpdateRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + return this; + } + + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public Builder isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + public Builder isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @JsonSetter(value = "run_async", nulls = Nulls.SKIP) + public Builder runAsync(Optional runAsync) { + this.runAsync = runAsync; + return this; + } + + public Builder runAsync(Boolean runAsync) { + this.runAsync = Optional.ofNullable(runAsync); + return this; + } + + public CustomObjectClassesCustomObjectsAssociationsUpdateRequest build() { + return new CustomObjectClassesCustomObjectsAssociationsUpdateRequest( + isDebugMode, runAsync, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/associationtypes/AssociationTypesClient.java b/src/main/java/com/merge/legacy/api/resources/crm/associationtypes/AssociationTypesClient.java new file mode 100644 index 000000000..7665b4b5a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/associationtypes/AssociationTypesClient.java @@ -0,0 +1,290 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.associationtypes; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.associationtypes.requests.CrmAssociationTypeEndpointRequest; +import com.merge.legacy.api.resources.crm.associationtypes.requests.CustomObjectClassesAssociationTypesListRequest; +import com.merge.legacy.api.resources.crm.associationtypes.requests.CustomObjectClassesAssociationTypesRetrieveRequest; +import com.merge.legacy.api.resources.crm.types.AssociationType; +import com.merge.legacy.api.resources.crm.types.CrmAssociationTypeResponse; +import com.merge.legacy.api.resources.crm.types.MetaResponse; +import com.merge.legacy.api.resources.crm.types.PaginatedAssociationTypeList; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/crm/associationtypes/requests/CrmAssociationTypeEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/associationtypes/requests/CrmAssociationTypeEndpointRequest.java new file mode 100644 index 000000000..e29d39b86 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/associationtypes/requests/CrmAssociationTypeEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.associationtypes.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.crm.types.AssociationTypeRequestRequest; +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 = CrmAssociationTypeEndpointRequest.Builder.class) +public final class CrmAssociationTypeEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final AssociationTypeRequestRequest model; + + private final Map additionalProperties; + + private CrmAssociationTypeEndpointRequest( + Optional isDebugMode, + Optional runAsync, + AssociationTypeRequestRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public AssociationTypeRequestRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CrmAssociationTypeEndpointRequest && equalTo((CrmAssociationTypeEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CrmAssociationTypeEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull AssociationTypeRequestRequest model); + + Builder from(CrmAssociationTypeEndpointRequest other); + } + + public interface _FinalStage { + CrmAssociationTypeEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private AssociationTypeRequestRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CrmAssociationTypeEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull AssociationTypeRequestRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public CrmAssociationTypeEndpointRequest build() { + return new CrmAssociationTypeEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/associationtypes/requests/CustomObjectClassesAssociationTypesListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/associationtypes/requests/CustomObjectClassesAssociationTypesListRequest.java new file mode 100644 index 000000000..3137266d7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/associationtypes/requests/CustomObjectClassesAssociationTypesListRequest.java @@ -0,0 +1,389 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.associationtypes.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = CustomObjectClassesAssociationTypesListRequest.Builder.class) +public final class CustomObjectClassesAssociationTypesListRequest { + 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 CustomObjectClassesAssociationTypesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomObjectClassesAssociationTypesListRequest + && equalTo((CustomObjectClassesAssociationTypesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CustomObjectClassesAssociationTypesListRequest 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); + } + + @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); + } + + @Override + 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(CustomObjectClassesAssociationTypesListRequest 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 CustomObjectClassesAssociationTypesListRequest build() { + return new CustomObjectClassesAssociationTypesListRequest( + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/associationtypes/requests/CustomObjectClassesAssociationTypesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/associationtypes/requests/CustomObjectClassesAssociationTypesRetrieveRequest.java new file mode 100644 index 000000000..139e46902 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/associationtypes/requests/CustomObjectClassesAssociationTypesRetrieveRequest.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.associationtypes.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/crm/asyncpassthrough/AsyncPassthroughClient.java b/src/main/java/com/merge/legacy/api/resources/crm/asyncpassthrough/AsyncPassthroughClient.java new file mode 100644 index 000000000..82245e001 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/asyncpassthrough/AsyncPassthroughClient.java @@ -0,0 +1,110 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.asyncpassthrough; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.asyncpassthrough.types.AsyncPassthroughRetrieveResponse; +import com.merge.legacy.api.resources.crm.types.AsyncPassthroughReciept; +import com.merge.legacy.api.resources.crm.types.DataPassthroughRequest; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/crm/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java b/src/main/java/com/merge/legacy/api/resources/crm/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java new file mode 100644 index 000000000..739f6f134 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import com.merge.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/audittrail/AuditTrailClient.java b/src/main/java/com/merge/legacy/api/resources/crm/audittrail/AuditTrailClient.java new file mode 100644 index 000000000..2dd861ede --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/audittrail/AuditTrailClient.java @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.audittrail; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.audittrail.requests.AuditTrailListRequest; +import com.merge.legacy.api.resources.crm.types.PaginatedAuditLogEventList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/crm/audittrail/requests/AuditTrailListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/audittrail/requests/AuditTrailListRequest.java new file mode 100644 index 000000000..f3ea724a4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/audittrail/requests/AuditTrailListRequest.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.audittrail.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.cursor, this.endDate, this.eventType, this.pageSize, this.startDate, this.userEmail); + } + + @Override + 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/legacy/api/resources/crm/availableactions/AvailableActionsClient.java b/src/main/java/com/merge/legacy/api/resources/crm/availableactions/AvailableActionsClient.java new file mode 100644 index 000000000..1542cbf88 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/availableactions/AvailableActionsClient.java @@ -0,0 +1,58 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.availableactions; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.types.AvailableActions; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/crm/contacts/ContactsClient.java b/src/main/java/com/merge/legacy/api/resources/crm/contacts/ContactsClient.java new file mode 100644 index 000000000..78c07b15c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/contacts/ContactsClient.java @@ -0,0 +1,507 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.contacts; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.contacts.requests.*; +import com.merge.legacy.api.resources.crm.types.*; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/crm/contacts/requests/ContactsListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/contacts/requests/ContactsListRequest.java new file mode 100644 index 000000000..0b1b5aa3d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/contacts/requests/ContactsListRequest.java @@ -0,0 +1,505 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.contacts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/crm/contacts/requests/ContactsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/contacts/requests/ContactsRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..985934984 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/contacts/requests/ContactsRemoteFieldClassesListRequest.java @@ -0,0 +1,272 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.contacts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @Override + 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/legacy/api/resources/crm/contacts/requests/ContactsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/contacts/requests/ContactsRetrieveRequest.java new file mode 100644 index 000000000..b9046e4f3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/contacts/requests/ContactsRetrieveRequest.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.contacts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields); + } + + @Override + 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/legacy/api/resources/crm/contacts/requests/CrmContactEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/contacts/requests/CrmContactEndpointRequest.java new file mode 100644 index 000000000..bc3240a07 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/contacts/requests/CrmContactEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.contacts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.crm.types.ContactRequest; +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 = CrmContactEndpointRequest.Builder.class) +public final class CrmContactEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final ContactRequest model; + + private final Map additionalProperties; + + private CrmContactEndpointRequest( + Optional isDebugMode, + Optional runAsync, + ContactRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public ContactRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CrmContactEndpointRequest && equalTo((CrmContactEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CrmContactEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull ContactRequest model); + + Builder from(CrmContactEndpointRequest other); + } + + public interface _FinalStage { + CrmContactEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private ContactRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CrmContactEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull ContactRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public CrmContactEndpointRequest build() { + return new CrmContactEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/contacts/requests/PatchedCrmContactEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/contacts/requests/PatchedCrmContactEndpointRequest.java new file mode 100644 index 000000000..d4a074770 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/contacts/requests/PatchedCrmContactEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.contacts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.crm.types.PatchedContactRequest; +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 = PatchedCrmContactEndpointRequest.Builder.class) +public final class PatchedCrmContactEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final PatchedContactRequest model; + + private final Map additionalProperties; + + private PatchedCrmContactEndpointRequest( + Optional isDebugMode, + Optional runAsync, + PatchedContactRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public PatchedContactRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedCrmContactEndpointRequest && equalTo((PatchedCrmContactEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedCrmContactEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull PatchedContactRequest model); + + Builder from(PatchedCrmContactEndpointRequest other); + } + + public interface _FinalStage { + PatchedCrmContactEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private PatchedContactRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(PatchedCrmContactEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull PatchedContactRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public PatchedCrmContactEndpointRequest build() { + return new PatchedCrmContactEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/contacts/types/ContactsListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/crm/contacts/types/ContactsListRequestExpand.java new file mode 100644 index 000000000..9b981ee13 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/contacts/types/ContactsListRequestExpand.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/contacts/types/ContactsRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/crm/contacts/types/ContactsRetrieveRequestExpand.java new file mode 100644 index 000000000..78a437cb8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/contacts/types/ContactsRetrieveRequestExpand.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/customobjectclasses/CustomObjectClassesClient.java b/src/main/java/com/merge/legacy/api/resources/crm/customobjectclasses/CustomObjectClassesClient.java new file mode 100644 index 000000000..fd0671708 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/customobjectclasses/CustomObjectClassesClient.java @@ -0,0 +1,164 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.customobjectclasses; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.customobjectclasses.requests.CustomObjectClassesListRequest; +import com.merge.legacy.api.resources.crm.customobjectclasses.requests.CustomObjectClassesRetrieveRequest; +import com.merge.legacy.api.resources.crm.types.CustomObjectClass; +import com.merge.legacy.api.resources.crm.types.PaginatedCustomObjectClassList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/crm/customobjectclasses/requests/CustomObjectClassesListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/customobjectclasses/requests/CustomObjectClassesListRequest.java new file mode 100644 index 000000000..707bd5fdc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/customobjectclasses/requests/CustomObjectClassesListRequest.java @@ -0,0 +1,388 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.customobjectclasses.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = CustomObjectClassesListRequest.Builder.class) +public final class CustomObjectClassesListRequest { + 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 CustomObjectClassesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomObjectClassesListRequest && equalTo((CustomObjectClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CustomObjectClassesListRequest 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); + } + + @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); + } + + @Override + 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(CustomObjectClassesListRequest 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 CustomObjectClassesListRequest build() { + return new CustomObjectClassesListRequest( + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/customobjectclasses/requests/CustomObjectClassesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/customobjectclasses/requests/CustomObjectClassesRetrieveRequest.java new file mode 100644 index 000000000..4f83aea70 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/customobjectclasses/requests/CustomObjectClassesRetrieveRequest.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.customobjectclasses.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/crm/customobjects/CustomObjectsClient.java b/src/main/java/com/merge/legacy/api/resources/crm/customobjects/CustomObjectsClient.java new file mode 100644 index 000000000..176907cff --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/customobjects/CustomObjectsClient.java @@ -0,0 +1,372 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.customobjects; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.customobjects.requests.CrmCustomObjectEndpointRequest; +import com.merge.legacy.api.resources.crm.customobjects.requests.CustomObjectClassesCustomObjectsListRequest; +import com.merge.legacy.api.resources.crm.customobjects.requests.CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest; +import com.merge.legacy.api.resources.crm.customobjects.requests.CustomObjectClassesCustomObjectsRetrieveRequest; +import com.merge.legacy.api.resources.crm.types.*; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/crm/customobjects/requests/CrmCustomObjectEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/customobjects/requests/CrmCustomObjectEndpointRequest.java new file mode 100644 index 000000000..10e156acb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/customobjects/requests/CrmCustomObjectEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.customobjects.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.crm.types.CustomObjectRequest; +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 = CrmCustomObjectEndpointRequest.Builder.class) +public final class CrmCustomObjectEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final CustomObjectRequest model; + + private final Map additionalProperties; + + private CrmCustomObjectEndpointRequest( + Optional isDebugMode, + Optional runAsync, + CustomObjectRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public CustomObjectRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CrmCustomObjectEndpointRequest && equalTo((CrmCustomObjectEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CrmCustomObjectEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull CustomObjectRequest model); + + Builder from(CrmCustomObjectEndpointRequest other); + } + + public interface _FinalStage { + CrmCustomObjectEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private CustomObjectRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CrmCustomObjectEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull CustomObjectRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public CrmCustomObjectEndpointRequest build() { + return new CrmCustomObjectEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/customobjects/requests/CustomObjectClassesCustomObjectsListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/customobjects/requests/CustomObjectClassesCustomObjectsListRequest.java new file mode 100644 index 000000000..6471f4559 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/customobjects/requests/CustomObjectClassesCustomObjectsListRequest.java @@ -0,0 +1,389 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.customobjects.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = CustomObjectClassesCustomObjectsListRequest.Builder.class) +public final class CustomObjectClassesCustomObjectsListRequest { + 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 pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private CustomObjectClassesCustomObjectsListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + 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.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 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomObjectClassesCustomObjectsListRequest + && equalTo((CustomObjectClassesCustomObjectsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CustomObjectClassesCustomObjectsListRequest other) { + return 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) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @Override + 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 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(CustomObjectClassesCustomObjectsListRequest other) { + 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()); + 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_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 CustomObjectClassesCustomObjectsListRequest build() { + return new CustomObjectClassesCustomObjectsListRequest( + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/customobjects/requests/CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/customobjects/requests/CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..d0e8612aa --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/customobjects/requests/CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.java @@ -0,0 +1,272 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.customobjects.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.Builder.class) +public final class CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest { + 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 CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest + && equalTo((CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @Override + 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(CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest 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 CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest build() { + return new CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + isCommonModelField, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/customobjects/requests/CustomObjectClassesCustomObjectsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/customobjects/requests/CustomObjectClassesCustomObjectsRetrieveRequest.java new file mode 100644 index 000000000..6edfeb366 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/customobjects/requests/CustomObjectClassesCustomObjectsRetrieveRequest.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.customobjects.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = CustomObjectClassesCustomObjectsRetrieveRequest.Builder.class) +public final class CustomObjectClassesCustomObjectsRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Map additionalProperties; + + private CustomObjectClassesCustomObjectsRetrieveRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomObjectClassesCustomObjectsRetrieveRequest + && equalTo((CustomObjectClassesCustomObjectsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CustomObjectClassesCustomObjectsRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeRemoteFields); + } + + @Override + 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(CustomObjectClassesCustomObjectsRetrieveRequest 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 CustomObjectClassesCustomObjectsRetrieveRequest build() { + return new CustomObjectClassesCustomObjectsRetrieveRequest( + includeRemoteData, includeRemoteFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/deleteaccount/DeleteAccountClient.java b/src/main/java/com/merge/legacy/api/resources/crm/deleteaccount/DeleteAccountClient.java new file mode 100644 index 000000000..21994eb17 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/deleteaccount/DeleteAccountClient.java @@ -0,0 +1,55 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.deleteaccount; + +import com.merge.legacy.api.core.*; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/crm/engagements/EngagementsClient.java b/src/main/java/com/merge/legacy/api/resources/crm/engagements/EngagementsClient.java new file mode 100644 index 000000000..e3aadfe8a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/engagements/EngagementsClient.java @@ -0,0 +1,456 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.engagements; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.engagements.requests.*; +import com.merge.legacy.api.resources.crm.types.*; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/crm/engagements/requests/EngagementEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/engagements/requests/EngagementEndpointRequest.java new file mode 100644 index 000000000..aad253474 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/engagements/requests/EngagementEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.engagements.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.crm.types.EngagementRequest; +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 = EngagementEndpointRequest.Builder.class) +public final class EngagementEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final EngagementRequest model; + + private final Map additionalProperties; + + private EngagementEndpointRequest( + Optional isDebugMode, + Optional runAsync, + EngagementRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public EngagementRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EngagementEndpointRequest && equalTo((EngagementEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EngagementEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull EngagementRequest model); + + Builder from(EngagementEndpointRequest other); + } + + public interface _FinalStage { + EngagementEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private EngagementRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(EngagementEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull EngagementRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public EngagementEndpointRequest build() { + return new EngagementEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/engagements/requests/EngagementsListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/engagements/requests/EngagementsListRequest.java new file mode 100644 index 000000000..dddb18012 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/engagements/requests/EngagementsListRequest.java @@ -0,0 +1,476 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.engagements.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.crm.engagements.types.EngagementsListRequestExpand; +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 = EngagementsListRequest.Builder.class) +public final class EngagementsListRequest { + 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 pageSize; + + private final Optional remoteId; + + private final Optional startedAfter; + + private final Optional startedBefore; + + private final Map additionalProperties; + + private EngagementsListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Optional startedAfter, + Optional startedBefore, + 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.pageSize = pageSize; + this.remoteId = remoteId; + this.startedAfter = startedAfter; + this.startedBefore = startedBefore; + 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 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 engagements started after this datetime. + */ + @JsonProperty("started_after") + public Optional getStartedAfter() { + return startedAfter; + } + + /** + * @return If provided, will only return engagements started before this datetime. + */ + @JsonProperty("started_before") + public Optional getStartedBefore() { + return startedBefore; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EngagementsListRequest && equalTo((EngagementsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EngagementsListRequest 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) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId) + && startedAfter.equals(other.startedAfter) + && startedBefore.equals(other.startedBefore); + } + + @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.pageSize, + this.remoteId, + this.startedAfter, + this.startedBefore); + } + + @Override + 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 pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional startedAfter = Optional.empty(); + + private Optional startedBefore = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EngagementsListRequest 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()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + startedAfter(other.getStartedAfter()); + startedBefore(other.getStartedBefore()); + 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(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; + 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; + } + + @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; + } + + public EngagementsListRequest build() { + return new EngagementsListRequest( + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + startedAfter, + startedBefore, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/engagements/requests/EngagementsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/engagements/requests/EngagementsRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..37730dc6c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/engagements/requests/EngagementsRemoteFieldClassesListRequest.java @@ -0,0 +1,272 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.engagements.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = EngagementsRemoteFieldClassesListRequest.Builder.class) +public final class EngagementsRemoteFieldClassesListRequest { + 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 EngagementsRemoteFieldClassesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EngagementsRemoteFieldClassesListRequest + && equalTo((EngagementsRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EngagementsRemoteFieldClassesListRequest 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @Override + 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(EngagementsRemoteFieldClassesListRequest 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 EngagementsRemoteFieldClassesListRequest build() { + return new EngagementsRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + isCommonModelField, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/engagements/requests/EngagementsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/engagements/requests/EngagementsRetrieveRequest.java new file mode 100644 index 000000000..5448124df --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/engagements/requests/EngagementsRetrieveRequest.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.engagements.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields); + } + + @Override + 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/legacy/api/resources/crm/engagements/requests/PatchedEngagementEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/engagements/requests/PatchedEngagementEndpointRequest.java new file mode 100644 index 000000000..ec88760b2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/engagements/requests/PatchedEngagementEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.engagements.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.crm.types.PatchedEngagementRequest; +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 = PatchedEngagementEndpointRequest.Builder.class) +public final class PatchedEngagementEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final PatchedEngagementRequest model; + + private final Map additionalProperties; + + private PatchedEngagementEndpointRequest( + Optional isDebugMode, + Optional runAsync, + PatchedEngagementRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public PatchedEngagementRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedEngagementEndpointRequest && equalTo((PatchedEngagementEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedEngagementEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull PatchedEngagementRequest model); + + Builder from(PatchedEngagementEndpointRequest other); + } + + public interface _FinalStage { + PatchedEngagementEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private PatchedEngagementRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(PatchedEngagementEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull PatchedEngagementRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public PatchedEngagementEndpointRequest build() { + return new PatchedEngagementEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/engagements/types/EngagementsListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/crm/engagements/types/EngagementsListRequestExpand.java new file mode 100644 index 000000000..19ab028e8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/engagements/types/EngagementsListRequestExpand.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/engagements/types/EngagementsRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/crm/engagements/types/EngagementsRetrieveRequestExpand.java new file mode 100644 index 000000000..e7c6c759a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/engagements/types/EngagementsRetrieveRequestExpand.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/engagementtypes/EngagementTypesClient.java b/src/main/java/com/merge/legacy/api/resources/crm/engagementtypes/EngagementTypesClient.java new file mode 100644 index 000000000..f29e2081d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/engagementtypes/EngagementTypesClient.java @@ -0,0 +1,247 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.engagementtypes; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.engagementtypes.requests.EngagementTypesListRequest; +import com.merge.legacy.api.resources.crm.engagementtypes.requests.EngagementTypesRemoteFieldClassesListRequest; +import com.merge.legacy.api.resources.crm.engagementtypes.requests.EngagementTypesRetrieveRequest; +import com.merge.legacy.api.resources.crm.types.EngagementType; +import com.merge.legacy.api.resources.crm.types.PaginatedEngagementTypeList; +import com.merge.legacy.api.resources.crm.types.PaginatedRemoteFieldClassList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/crm/engagementtypes/requests/EngagementTypesListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/engagementtypes/requests/EngagementTypesListRequest.java new file mode 100644 index 000000000..0dc224c85 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/engagementtypes/requests/EngagementTypesListRequest.java @@ -0,0 +1,388 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.engagementtypes.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = EngagementTypesListRequest.Builder.class) +public final class EngagementTypesListRequest { + 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 pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private EngagementTypesListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + 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.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 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EngagementTypesListRequest && equalTo((EngagementTypesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EngagementTypesListRequest other) { + return 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) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @Override + 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 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(EngagementTypesListRequest other) { + 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()); + 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_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 EngagementTypesListRequest build() { + return new EngagementTypesListRequest( + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/engagementtypes/requests/EngagementTypesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/engagementtypes/requests/EngagementTypesRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..31596b302 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/engagementtypes/requests/EngagementTypesRemoteFieldClassesListRequest.java @@ -0,0 +1,272 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.engagementtypes.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = EngagementTypesRemoteFieldClassesListRequest.Builder.class) +public final class EngagementTypesRemoteFieldClassesListRequest { + 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 EngagementTypesRemoteFieldClassesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EngagementTypesRemoteFieldClassesListRequest + && equalTo((EngagementTypesRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EngagementTypesRemoteFieldClassesListRequest 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @Override + 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(EngagementTypesRemoteFieldClassesListRequest 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 EngagementTypesRemoteFieldClassesListRequest build() { + return new EngagementTypesRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + isCommonModelField, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/engagementtypes/requests/EngagementTypesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/engagementtypes/requests/EngagementTypesRetrieveRequest.java new file mode 100644 index 000000000..090ab42f1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/engagementtypes/requests/EngagementTypesRetrieveRequest.java @@ -0,0 +1,121 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.engagementtypes.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = EngagementTypesRetrieveRequest.Builder.class) +public final class EngagementTypesRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Map additionalProperties; + + private EngagementTypesRetrieveRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EngagementTypesRetrieveRequest && equalTo((EngagementTypesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EngagementTypesRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeRemoteFields); + } + + @Override + 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(EngagementTypesRetrieveRequest 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 EngagementTypesRetrieveRequest build() { + return new EngagementTypesRetrieveRequest(includeRemoteData, includeRemoteFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/fieldmapping/FieldMappingClient.java b/src/main/java/com/merge/legacy/api/resources/crm/fieldmapping/FieldMappingClient.java new file mode 100644 index 000000000..27afd2b46 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/fieldmapping/FieldMappingClient.java @@ -0,0 +1,338 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.fieldmapping; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.fieldmapping.requests.CreateFieldMappingRequest; +import com.merge.legacy.api.resources.crm.fieldmapping.requests.FieldMappingsRetrieveRequest; +import com.merge.legacy.api.resources.crm.fieldmapping.requests.PatchedEditFieldMappingRequest; +import com.merge.legacy.api.resources.crm.fieldmapping.requests.RemoteFieldsRetrieveRequest; +import com.merge.legacy.api.resources.crm.types.ExternalTargetFieldApiResponse; +import com.merge.legacy.api.resources.crm.types.FieldMappingApiInstanceResponse; +import com.merge.legacy.api.resources.crm.types.FieldMappingInstanceResponse; +import com.merge.legacy.api.resources.crm.types.RemoteFieldApiResponse; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/crm/fieldmapping/requests/CreateFieldMappingRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/fieldmapping/requests/CreateFieldMappingRequest.java new file mode 100644 index 000000000..e5864d534 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/fieldmapping/requests/CreateFieldMappingRequest.java @@ -0,0 +1,337 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.fieldmapping.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.excludeRemoteFieldMetadata, + this.targetFieldName, + this.targetFieldDescription, + this.remoteFieldTraversalPath, + this.remoteMethod, + this.remoteUrlPath, + this.commonModelName); + } + + @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() {} + + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @Override + public _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.add(remoteFieldTraversalPath); + return this; + } + + @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. + */ + @Override + public _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); + return this; + } + + @Override + @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) + public _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + return this; + } + + @Override + public CreateFieldMappingRequest build() { + return new CreateFieldMappingRequest( + excludeRemoteFieldMetadata, + targetFieldName, + targetFieldDescription, + remoteFieldTraversalPath, + remoteMethod, + remoteUrlPath, + commonModelName, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/fieldmapping/requests/FieldMappingsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/fieldmapping/requests/FieldMappingsRetrieveRequest.java new file mode 100644 index 000000000..f93b5b54c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/fieldmapping/requests/FieldMappingsRetrieveRequest.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.fieldmapping.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.excludeRemoteFieldMetadata); + } + + @Override + 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/legacy/api/resources/crm/fieldmapping/requests/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/fieldmapping/requests/PatchedEditFieldMappingRequest.java new file mode 100644 index 000000000..35edcbe3a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/fieldmapping/requests/PatchedEditFieldMappingRequest.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.fieldmapping.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath); + } + + @Override + 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/legacy/api/resources/crm/fieldmapping/requests/RemoteFieldsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/fieldmapping/requests/RemoteFieldsRetrieveRequest.java new file mode 100644 index 000000000..31aebcd1e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/fieldmapping/requests/RemoteFieldsRetrieveRequest.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.fieldmapping.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.commonModels, this.includeExampleValues); + } + + @Override + 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/legacy/api/resources/crm/forceresync/ForceResyncClient.java b/src/main/java/com/merge/legacy/api/resources/crm/forceresync/ForceResyncClient.java new file mode 100644 index 000000000..57591dca3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/forceresync/ForceResyncClient.java @@ -0,0 +1,61 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.forceresync; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.types.SyncStatus; +import java.io.IOException; +import java.util.List; +import okhttp3.*; + +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/legacy/api/resources/crm/generatekey/GenerateKeyClient.java b/src/main/java/com/merge/legacy/api/resources/crm/generatekey/GenerateKeyClient.java new file mode 100644 index 000000000..7e1aaeefa --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/generatekey/GenerateKeyClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.generatekey; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.generatekey.requests.GenerateRemoteKeyRequest; +import com.merge.legacy.api.resources.crm.types.RemoteKey; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/crm/generatekey/requests/GenerateRemoteKeyRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/generatekey/requests/GenerateRemoteKeyRequest.java new file mode 100644 index 000000000..cf91b7daf --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/generatekey/requests/GenerateRemoteKeyRequest.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.generatekey.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + public GenerateRemoteKeyRequest build() { + return new GenerateRemoteKeyRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/issues/IssuesClient.java b/src/main/java/com/merge/legacy/api/resources/crm/issues/IssuesClient.java new file mode 100644 index 000000000..0c2c7b32a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/issues/IssuesClient.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.issues; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.issues.requests.IssuesListRequest; +import com.merge.legacy.api.resources.crm.types.Issue; +import com.merge.legacy.api.resources.crm.types.PaginatedIssueList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/crm/issues/requests/IssuesListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/issues/requests/IssuesListRequest.java new file mode 100644 index 000000000..c80a60077 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/issues/requests/IssuesListRequest.java @@ -0,0 +1,471 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.issues.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/crm/issues/types/IssuesListRequestStatus.java b/src/main/java/com/merge/legacy/api/resources/crm/issues/types/IssuesListRequestStatus.java new file mode 100644 index 000000000..87bc802ff --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/issues/types/IssuesListRequestStatus.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/leads/LeadsClient.java b/src/main/java/com/merge/legacy/api/resources/crm/leads/LeadsClient.java new file mode 100644 index 000000000..7ab9d0854 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/leads/LeadsClient.java @@ -0,0 +1,369 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.leads; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.leads.requests.LeadEndpointRequest; +import com.merge.legacy.api.resources.crm.leads.requests.LeadsListRequest; +import com.merge.legacy.api.resources.crm.leads.requests.LeadsRemoteFieldClassesListRequest; +import com.merge.legacy.api.resources.crm.leads.requests.LeadsRetrieveRequest; +import com.merge.legacy.api.resources.crm.types.*; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/crm/leads/requests/LeadEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/leads/requests/LeadEndpointRequest.java new file mode 100644 index 000000000..0af19417f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/leads/requests/LeadEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.leads.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.crm.types.LeadRequest; +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 = LeadEndpointRequest.Builder.class) +public final class LeadEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final LeadRequest model; + + private final Map additionalProperties; + + private LeadEndpointRequest( + Optional isDebugMode, + Optional runAsync, + LeadRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public LeadRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LeadEndpointRequest && equalTo((LeadEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LeadEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull LeadRequest model); + + Builder from(LeadEndpointRequest other); + } + + public interface _FinalStage { + LeadEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private LeadRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(LeadEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull LeadRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public LeadEndpointRequest build() { + return new LeadEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/leads/requests/LeadsListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/leads/requests/LeadsListRequest.java new file mode 100644 index 000000000..7e9cd695d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/leads/requests/LeadsListRequest.java @@ -0,0 +1,563 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.leads.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.crm.leads.types.LeadsListRequestExpand; +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 = LeadsListRequest.Builder.class) +public final class LeadsListRequest { + private final Optional convertedAccountId; + + private final Optional convertedContactId; + + 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 ownerId; + + private final Optional pageSize; + + private final Optional phoneNumbers; + + private final Optional remoteId; + + private final Map additionalProperties; + + private LeadsListRequest( + Optional convertedAccountId, + Optional convertedContactId, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional emailAddresses, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional ownerId, + Optional pageSize, + Optional phoneNumbers, + Optional remoteId, + Map additionalProperties) { + 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; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.ownerId = ownerId; + this.pageSize = pageSize; + this.phoneNumbers = phoneNumbers; + this.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return leads with this account. + */ + @JsonProperty("converted_account_id") + public Optional getConvertedAccountId() { + return convertedAccountId; + } + + /** + * @return If provided, will only return leads with this contact. + */ + @JsonProperty("converted_contact_id") + public Optional getConvertedContactId() { + return convertedContactId; + } + + /** + * @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 If provided, will only return leads 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 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LeadsListRequest && equalTo((LeadsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LeadsListRequest other) { + return 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) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && ownerId.equals(other.ownerId) + && pageSize.equals(other.pageSize) + && phoneNumbers.equals(other.phoneNumbers) + && remoteId.equals(other.remoteId); + } + + @Override + public int hashCode() { + return Objects.hash( + this.convertedAccountId, + this.convertedContactId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.emailAddresses, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.ownerId, + this.pageSize, + this.phoneNumbers, + this.remoteId); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional convertedAccountId = Optional.empty(); + + private Optional convertedContactId = 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 ownerId = 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(LeadsListRequest other) { + 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()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + ownerId(other.getOwnerId()); + pageSize(other.getPageSize()); + phoneNumbers(other.getPhoneNumbers()); + remoteId(other.getRemoteId()); + return this; + } + + @JsonSetter(value = "converted_account_id", nulls = Nulls.SKIP) + public Builder convertedAccountId(Optional convertedAccountId) { + this.convertedAccountId = convertedAccountId; + return this; + } + + public Builder convertedAccountId(String convertedAccountId) { + this.convertedAccountId = Optional.ofNullable(convertedAccountId); + return this; + } + + @JsonSetter(value = "converted_contact_id", nulls = Nulls.SKIP) + public Builder convertedContactId(Optional convertedContactId) { + this.convertedContactId = convertedContactId; + return this; + } + + public Builder convertedContactId(String convertedContactId) { + this.convertedContactId = Optional.ofNullable(convertedContactId); + 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(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; + 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 = "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 = "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 LeadsListRequest build() { + return new LeadsListRequest( + convertedAccountId, + convertedContactId, + createdAfter, + createdBefore, + cursor, + emailAddresses, + expand, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + modifiedAfter, + modifiedBefore, + ownerId, + pageSize, + phoneNumbers, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/leads/requests/LeadsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/leads/requests/LeadsRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..6028085de --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/leads/requests/LeadsRemoteFieldClassesListRequest.java @@ -0,0 +1,272 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.leads.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = LeadsRemoteFieldClassesListRequest.Builder.class) +public final class LeadsRemoteFieldClassesListRequest { + 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 LeadsRemoteFieldClassesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LeadsRemoteFieldClassesListRequest + && equalTo((LeadsRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LeadsRemoteFieldClassesListRequest 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @Override + 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(LeadsRemoteFieldClassesListRequest 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 LeadsRemoteFieldClassesListRequest build() { + return new LeadsRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + isCommonModelField, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/leads/requests/LeadsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/leads/requests/LeadsRetrieveRequest.java new file mode 100644 index 000000000..21ff89e81 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/leads/requests/LeadsRetrieveRequest.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.leads.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields); + } + + @Override + 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/legacy/api/resources/crm/leads/types/LeadsListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/crm/leads/types/LeadsListRequestExpand.java new file mode 100644 index 000000000..f0c52100f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/leads/types/LeadsListRequestExpand.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/leads/types/LeadsRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/crm/leads/types/LeadsRetrieveRequestExpand.java new file mode 100644 index 000000000..397c2f218 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/leads/types/LeadsRetrieveRequestExpand.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/linkedaccounts/LinkedAccountsClient.java b/src/main/java/com/merge/legacy/api/resources/crm/linkedaccounts/LinkedAccountsClient.java new file mode 100644 index 000000000..1e17f52ae --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/linkedaccounts/LinkedAccountsClient.java @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.linkedaccounts; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.linkedaccounts.requests.LinkedAccountsListRequest; +import com.merge.legacy.api.resources.crm.types.PaginatedAccountDetailsAndActionsList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/crm/linkedaccounts/requests/LinkedAccountsListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/linkedaccounts/requests/LinkedAccountsListRequest.java new file mode 100644 index 000000000..235dbec17 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/linkedaccounts/requests/LinkedAccountsListRequest.java @@ -0,0 +1,452 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.linkedaccounts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/crm/linkedaccounts/types/LinkedAccountsListRequestCategory.java b/src/main/java/com/merge/legacy/api/resources/crm/linkedaccounts/types/LinkedAccountsListRequestCategory.java new file mode 100644 index 000000000..f6ce46b73 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/linkedaccounts/types/LinkedAccountsListRequestCategory.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/linktoken/LinkTokenClient.java b/src/main/java/com/merge/legacy/api/resources/crm/linktoken/LinkTokenClient.java new file mode 100644 index 000000000..b53aed930 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/linktoken/LinkTokenClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.linktoken; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.linktoken.requests.EndUserDetailsRequest; +import com.merge.legacy.api.resources.crm.types.LinkToken; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/crm/linktoken/requests/EndUserDetailsRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/linktoken/requests/EndUserDetailsRequest.java new file mode 100644 index 000000000..d4c7d03b7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/linktoken/requests/EndUserDetailsRequest.java @@ -0,0 +1,600 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.linktoken.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.crm.types.CategoriesEnum; +import com.merge.legacy.api.resources.crm.types.CommonModelScopesBodyRequest; +import com.merge.legacy.api.resources.crm.types.IndividualCommonModelScopeDeserializerRequest; +import com.merge.legacy.api.resources.crm.types.LanguageEnum; +import java.util.*; +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; + } + + @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); + } + + @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); + } + + @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() {} + + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @Override + public _FinalStage integrationSpecificConfig(Map integrationSpecificConfig) { + this.integrationSpecificConfig = Optional.ofNullable(integrationSpecificConfig); + return this; + } + + @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. + */ + @Override + public _FinalStage areSyncsDisabled(Boolean areSyncsDisabled) { + this.areSyncsDisabled = Optional.ofNullable(areSyncsDisabled); + return this; + } + + @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. + */ + @Override + public _FinalStage language(LanguageEnum language) { + this.language = Optional.ofNullable(language); + return this; + } + + @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. + */ + @Override + public _FinalStage categoryCommonModelScopes( + Map>> categoryCommonModelScopes) { + this.categoryCommonModelScopes = Optional.ofNullable(categoryCommonModelScopes); + return this; + } + + @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. + */ + @Override + public _FinalStage commonModels(List commonModels) { + this.commonModels = Optional.ofNullable(commonModels); + return this; + } + + @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. + */ + @Override + public _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink) { + this.hideAdminMagicLink = Optional.ofNullable(hideAdminMagicLink); + return this; + } + + @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. + */ + @Override + public _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl) { + this.shouldCreateMagicLinkUrl = Optional.ofNullable(shouldCreateMagicLinkUrl); + return this; + } + + @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. + */ + @Override + public _FinalStage linkExpiryMins(Integer linkExpiryMins) { + this.linkExpiryMins = Optional.ofNullable(linkExpiryMins); + return this; + } + + @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. + */ + @Override + public _FinalStage integration(String integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @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. + */ + @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. + */ + @Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + this.categories.addAll(categories); + return this; + } + + @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/legacy/api/resources/crm/notes/NotesClient.java b/src/main/java/com/merge/legacy/api/resources/crm/notes/NotesClient.java new file mode 100644 index 000000000..0313f9fc7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/notes/NotesClient.java @@ -0,0 +1,364 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.notes; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.notes.requests.NoteEndpointRequest; +import com.merge.legacy.api.resources.crm.notes.requests.NotesListRequest; +import com.merge.legacy.api.resources.crm.notes.requests.NotesRemoteFieldClassesListRequest; +import com.merge.legacy.api.resources.crm.notes.requests.NotesRetrieveRequest; +import com.merge.legacy.api.resources.crm.types.*; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/crm/notes/requests/NoteEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/notes/requests/NoteEndpointRequest.java new file mode 100644 index 000000000..ffcc6c950 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/notes/requests/NoteEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.notes.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.crm.types.NoteRequest; +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 = NoteEndpointRequest.Builder.class) +public final class NoteEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final NoteRequest model; + + private final Map additionalProperties; + + private NoteEndpointRequest( + Optional isDebugMode, + Optional runAsync, + NoteRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public NoteRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NoteEndpointRequest && equalTo((NoteEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(NoteEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull NoteRequest model); + + Builder from(NoteEndpointRequest other); + } + + public interface _FinalStage { + NoteEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private NoteRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(NoteEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull NoteRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public NoteEndpointRequest build() { + return new NoteEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/notes/requests/NotesListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/notes/requests/NotesListRequest.java new file mode 100644 index 000000000..c593cc0ae --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/notes/requests/NotesListRequest.java @@ -0,0 +1,534 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.notes.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.crm.notes.types.NotesListRequestExpand; +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 = NotesListRequest.Builder.class) +public final class NotesListRequest { + private final Optional accountId; + + private final Optional contactId; + + 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 opportunityId; + + private final Optional ownerId; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private NotesListRequest( + Optional accountId, + Optional contactId, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional opportunityId, + Optional ownerId, + Optional pageSize, + Optional remoteId, + Map additionalProperties) { + 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; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.opportunityId = opportunityId; + this.ownerId = ownerId; + this.pageSize = pageSize; + this.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return notes with this account. + */ + @JsonProperty("account_id") + public Optional getAccountId() { + return accountId; + } + + /** + * @return If provided, will only return notes with this contact. + */ + @JsonProperty("contact_id") + public Optional getContactId() { + return contactId; + } + + /** + * @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 notes with this opportunity. + */ + @JsonProperty("opportunity_id") + public Optional getOpportunityId() { + return opportunityId; + } + + /** + * @return If provided, will only return notes 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NotesListRequest && equalTo((NotesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(NotesListRequest other) { + return 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) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && opportunityId.equals(other.opportunityId) + && ownerId.equals(other.ownerId) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @Override + public int hashCode() { + return Objects.hash( + this.accountId, + this.contactId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.opportunityId, + this.ownerId, + this.pageSize, + this.remoteId); + } + + @Override + 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 contactId = 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 includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional opportunityId = 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(NotesListRequest other) { + 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()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + opportunityId(other.getOpportunityId()); + ownerId(other.getOwnerId()); + pageSize(other.getPageSize()); + 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 = "contact_id", nulls = Nulls.SKIP) + public Builder contactId(Optional contactId) { + this.contactId = contactId; + return this; + } + + public Builder contactId(String contactId) { + this.contactId = Optional.ofNullable(contactId); + 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(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; + 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 = "opportunity_id", nulls = Nulls.SKIP) + public Builder opportunityId(Optional opportunityId) { + this.opportunityId = opportunityId; + return this; + } + + public Builder opportunityId(String opportunityId) { + this.opportunityId = Optional.ofNullable(opportunityId); + 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 NotesListRequest build() { + return new NotesListRequest( + accountId, + contactId, + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + modifiedAfter, + modifiedBefore, + opportunityId, + ownerId, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/notes/requests/NotesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/notes/requests/NotesRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..624135106 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/notes/requests/NotesRemoteFieldClassesListRequest.java @@ -0,0 +1,272 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.notes.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = NotesRemoteFieldClassesListRequest.Builder.class) +public final class NotesRemoteFieldClassesListRequest { + 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 NotesRemoteFieldClassesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NotesRemoteFieldClassesListRequest + && equalTo((NotesRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(NotesRemoteFieldClassesListRequest 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @Override + 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(NotesRemoteFieldClassesListRequest 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 NotesRemoteFieldClassesListRequest build() { + return new NotesRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + isCommonModelField, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/notes/requests/NotesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/notes/requests/NotesRetrieveRequest.java new file mode 100644 index 000000000..fd7be879c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/notes/requests/NotesRetrieveRequest.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.notes.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields); + } + + @Override + 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/legacy/api/resources/crm/notes/types/NotesListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/crm/notes/types/NotesListRequestExpand.java new file mode 100644 index 000000000..d92375872 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/notes/types/NotesListRequestExpand.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/notes/types/NotesRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/crm/notes/types/NotesRetrieveRequestExpand.java new file mode 100644 index 000000000..1aebd85f8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/notes/types/NotesRetrieveRequestExpand.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/opportunities/OpportunitiesClient.java b/src/main/java/com/merge/legacy/api/resources/crm/opportunities/OpportunitiesClient.java new file mode 100644 index 000000000..d03dde097 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/opportunities/OpportunitiesClient.java @@ -0,0 +1,479 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.opportunities; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.opportunities.requests.*; +import com.merge.legacy.api.resources.crm.types.*; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/crm/opportunities/requests/OpportunitiesListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/opportunities/requests/OpportunitiesListRequest.java new file mode 100644 index 000000000..0b27f2640 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/opportunities/requests/OpportunitiesListRequest.java @@ -0,0 +1,627 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.opportunities.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.crm.opportunities.types.OpportunitiesListRequestExpand; +import com.merge.legacy.api.resources.crm.opportunities.types.OpportunitiesListRequestStatus; +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 = OpportunitiesListRequest.Builder.class) +public final class OpportunitiesListRequest { + private final Optional accountId; + + 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 ownerId; + + private final Optional pageSize; + + private final Optional remoteCreatedAfter; + + private final Optional remoteFields; + + private final Optional remoteId; + + private final Optional showEnumOrigins; + + private final Optional stageId; + + private final Optional status; + + private final Map additionalProperties; + + private OpportunitiesListRequest( + Optional accountId, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional ownerId, + Optional pageSize, + Optional remoteCreatedAfter, + Optional remoteFields, + Optional remoteId, + Optional showEnumOrigins, + Optional stageId, + Optional status, + Map additionalProperties) { + this.accountId = accountId; + 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.ownerId = ownerId; + this.pageSize = pageSize; + this.remoteCreatedAfter = remoteCreatedAfter; + this.remoteFields = remoteFields; + this.remoteId = remoteId; + this.showEnumOrigins = showEnumOrigins; + this.stageId = stageId; + this.status = status; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return opportunities 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 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 opportunities 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 If provided, will only return opportunities created in the third party platform after this datetime. + */ + @JsonProperty("remote_created_after") + public Optional getRemoteCreatedAfter() { + return remoteCreatedAfter; + } + + /** + * @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 opportunities with this stage. + */ + @JsonProperty("stage_id") + public Optional getStageId() { + return stageId; + } + + /** + * @return If provided, will only return opportunities with this status. Options: ('OPEN', 'WON', 'LOST') + *
    + *
  • OPEN - OPEN
  • + *
  • WON - WON
  • + *
  • LOST - LOST
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OpportunitiesListRequest && equalTo((OpportunitiesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OpportunitiesListRequest other) { + return 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) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && ownerId.equals(other.ownerId) + && pageSize.equals(other.pageSize) + && remoteCreatedAfter.equals(other.remoteCreatedAfter) + && remoteFields.equals(other.remoteFields) + && remoteId.equals(other.remoteId) + && showEnumOrigins.equals(other.showEnumOrigins) + && stageId.equals(other.stageId) + && status.equals(other.status); + } + + @Override + public int hashCode() { + return Objects.hash( + this.accountId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.ownerId, + this.pageSize, + this.remoteCreatedAfter, + this.remoteFields, + this.remoteId, + this.showEnumOrigins, + this.stageId, + this.status); + } + + @Override + 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 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 ownerId = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteCreatedAfter = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + private Optional stageId = Optional.empty(); + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(OpportunitiesListRequest other) { + accountId(other.getAccountId()); + 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()); + ownerId(other.getOwnerId()); + pageSize(other.getPageSize()); + remoteCreatedAfter(other.getRemoteCreatedAfter()); + remoteFields(other.getRemoteFields()); + remoteId(other.getRemoteId()); + showEnumOrigins(other.getShowEnumOrigins()); + stageId(other.getStageId()); + status(other.getStatus()); + 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 = "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; + 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 = "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_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_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 = "stage_id", nulls = Nulls.SKIP) + public Builder stageId(Optional stageId) { + this.stageId = stageId; + return this; + } + + public Builder stageId(String stageId) { + this.stageId = Optional.ofNullable(stageId); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(OpportunitiesListRequestStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + public OpportunitiesListRequest build() { + return new OpportunitiesListRequest( + accountId, + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + modifiedAfter, + modifiedBefore, + ownerId, + pageSize, + remoteCreatedAfter, + remoteFields, + remoteId, + showEnumOrigins, + stageId, + status, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/opportunities/requests/OpportunitiesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/opportunities/requests/OpportunitiesRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..4730eb8fa --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/opportunities/requests/OpportunitiesRemoteFieldClassesListRequest.java @@ -0,0 +1,272 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.opportunities.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = OpportunitiesRemoteFieldClassesListRequest.Builder.class) +public final class OpportunitiesRemoteFieldClassesListRequest { + 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 OpportunitiesRemoteFieldClassesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OpportunitiesRemoteFieldClassesListRequest + && equalTo((OpportunitiesRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OpportunitiesRemoteFieldClassesListRequest 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @Override + 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(OpportunitiesRemoteFieldClassesListRequest 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 OpportunitiesRemoteFieldClassesListRequest build() { + return new OpportunitiesRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + isCommonModelField, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/opportunities/requests/OpportunitiesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/opportunities/requests/OpportunitiesRetrieveRequest.java new file mode 100644 index 000000000..8ef226084 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/opportunities/requests/OpportunitiesRetrieveRequest.java @@ -0,0 +1,210 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.opportunities.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.crm.opportunities.types.OpportunitiesRetrieveRequestExpand; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = OpportunitiesRetrieveRequest.Builder.class) +public final class OpportunitiesRetrieveRequest { + 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 OpportunitiesRetrieveRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OpportunitiesRetrieveRequest && equalTo((OpportunitiesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OpportunitiesRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @Override + public int hashCode() { + return Objects.hash( + this.expand, this.includeRemoteData, this.includeRemoteFields, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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(OpportunitiesRetrieveRequest 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(OpportunitiesRetrieveRequestExpand 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 OpportunitiesRetrieveRequest build() { + return new OpportunitiesRetrieveRequest( + expand, + includeRemoteData, + includeRemoteFields, + remoteFields, + showEnumOrigins, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/opportunities/requests/OpportunityEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/opportunities/requests/OpportunityEndpointRequest.java new file mode 100644 index 000000000..1228b5d5e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/opportunities/requests/OpportunityEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.opportunities.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.crm.types.OpportunityRequest; +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 = OpportunityEndpointRequest.Builder.class) +public final class OpportunityEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final OpportunityRequest model; + + private final Map additionalProperties; + + private OpportunityEndpointRequest( + Optional isDebugMode, + Optional runAsync, + OpportunityRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public OpportunityRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OpportunityEndpointRequest && equalTo((OpportunityEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OpportunityEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull OpportunityRequest model); + + Builder from(OpportunityEndpointRequest other); + } + + public interface _FinalStage { + OpportunityEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private OpportunityRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(OpportunityEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull OpportunityRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public OpportunityEndpointRequest build() { + return new OpportunityEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/opportunities/requests/PatchedOpportunityEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/opportunities/requests/PatchedOpportunityEndpointRequest.java new file mode 100644 index 000000000..ce6044c34 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/opportunities/requests/PatchedOpportunityEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.opportunities.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.crm.types.PatchedOpportunityRequest; +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 = PatchedOpportunityEndpointRequest.Builder.class) +public final class PatchedOpportunityEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final PatchedOpportunityRequest model; + + private final Map additionalProperties; + + private PatchedOpportunityEndpointRequest( + Optional isDebugMode, + Optional runAsync, + PatchedOpportunityRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public PatchedOpportunityRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedOpportunityEndpointRequest && equalTo((PatchedOpportunityEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedOpportunityEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull PatchedOpportunityRequest model); + + Builder from(PatchedOpportunityEndpointRequest other); + } + + public interface _FinalStage { + PatchedOpportunityEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private PatchedOpportunityRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(PatchedOpportunityEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull PatchedOpportunityRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public PatchedOpportunityEndpointRequest build() { + return new PatchedOpportunityEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/opportunities/types/OpportunitiesListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/crm/opportunities/types/OpportunitiesListRequestExpand.java new file mode 100644 index 000000000..ed7f9708d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/opportunities/types/OpportunitiesListRequestExpand.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/opportunities/types/OpportunitiesListRequestStatus.java b/src/main/java/com/merge/legacy/api/resources/crm/opportunities/types/OpportunitiesListRequestStatus.java new file mode 100644 index 000000000..b9180eb99 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/opportunities/types/OpportunitiesListRequestStatus.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.opportunities.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum OpportunitiesListRequestStatus { + LOST("LOST"), + + OPEN("OPEN"), + + WON("WON"); + + private final String value; + + OpportunitiesListRequestStatus(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/opportunities/types/OpportunitiesRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/crm/opportunities/types/OpportunitiesRetrieveRequestExpand.java new file mode 100644 index 000000000..4e019968e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/opportunities/types/OpportunitiesRetrieveRequestExpand.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/passthrough/PassthroughClient.java b/src/main/java/com/merge/legacy/api/resources/crm/passthrough/PassthroughClient.java new file mode 100644 index 000000000..fd9e0f3fc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/passthrough/PassthroughClient.java @@ -0,0 +1,66 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.passthrough; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.types.DataPassthroughRequest; +import com.merge.legacy.api.resources.crm.types.RemoteResponse; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/crm/regeneratekey/RegenerateKeyClient.java b/src/main/java/com/merge/legacy/api/resources/crm/regeneratekey/RegenerateKeyClient.java new file mode 100644 index 000000000..0e289da3c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/regeneratekey/RegenerateKeyClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.regeneratekey; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.regeneratekey.requests.RemoteKeyForRegenerationRequest; +import com.merge.legacy.api.resources.crm.types.RemoteKey; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/crm/regeneratekey/requests/RemoteKeyForRegenerationRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/regeneratekey/requests/RemoteKeyForRegenerationRequest.java new file mode 100644 index 000000000..98fb3fe6f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/regeneratekey/requests/RemoteKeyForRegenerationRequest.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.regeneratekey.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + public RemoteKeyForRegenerationRequest build() { + return new RemoteKeyForRegenerationRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/scopes/ScopesClient.java b/src/main/java/com/merge/legacy/api/resources/crm/scopes/ScopesClient.java new file mode 100644 index 000000000..7e4e05806 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/scopes/ScopesClient.java @@ -0,0 +1,150 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.scopes; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.scopes.requests.LinkedAccountCommonModelScopeDeserializerRequest; +import com.merge.legacy.api.resources.crm.types.CommonModelScopeApi; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/crm/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..309beff25 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.scopes.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.crm.types.IndividualCommonModelScopeDeserializerRequest; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @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/legacy/api/resources/crm/stages/StagesClient.java b/src/main/java/com/merge/legacy/api/resources/crm/stages/StagesClient.java new file mode 100644 index 000000000..2bc665860 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/stages/StagesClient.java @@ -0,0 +1,247 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.stages; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.stages.requests.StagesListRequest; +import com.merge.legacy.api.resources.crm.stages.requests.StagesRemoteFieldClassesListRequest; +import com.merge.legacy.api.resources.crm.stages.requests.StagesRetrieveRequest; +import com.merge.legacy.api.resources.crm.types.PaginatedRemoteFieldClassList; +import com.merge.legacy.api.resources.crm.types.PaginatedStageList; +import com.merge.legacy.api.resources.crm.types.Stage; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/crm/stages/requests/StagesListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/stages/requests/StagesListRequest.java new file mode 100644 index 000000000..3daafae61 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/stages/requests/StagesListRequest.java @@ -0,0 +1,388 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.stages.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = StagesListRequest.Builder.class) +public final class StagesListRequest { + 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 pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private StagesListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + 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.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 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof StagesListRequest && equalTo((StagesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(StagesListRequest other) { + return 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) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @Override + 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 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(StagesListRequest other) { + 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()); + 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_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 StagesListRequest build() { + return new StagesListRequest( + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/stages/requests/StagesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/stages/requests/StagesRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..6deb30d77 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/stages/requests/StagesRemoteFieldClassesListRequest.java @@ -0,0 +1,272 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.stages.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = StagesRemoteFieldClassesListRequest.Builder.class) +public final class StagesRemoteFieldClassesListRequest { + 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 StagesRemoteFieldClassesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof StagesRemoteFieldClassesListRequest + && equalTo((StagesRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(StagesRemoteFieldClassesListRequest 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @Override + 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(StagesRemoteFieldClassesListRequest 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 StagesRemoteFieldClassesListRequest build() { + return new StagesRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + isCommonModelField, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/stages/requests/StagesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/stages/requests/StagesRetrieveRequest.java new file mode 100644 index 000000000..f56bed514 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/stages/requests/StagesRetrieveRequest.java @@ -0,0 +1,121 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.stages.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = StagesRetrieveRequest.Builder.class) +public final class StagesRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Map additionalProperties; + + private StagesRetrieveRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof StagesRetrieveRequest && equalTo((StagesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(StagesRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeRemoteFields); + } + + @Override + 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(StagesRetrieveRequest 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 StagesRetrieveRequest build() { + return new StagesRetrieveRequest(includeRemoteData, includeRemoteFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/syncstatus/SyncStatusClient.java b/src/main/java/com/merge/legacy/api/resources/crm/syncstatus/SyncStatusClient.java new file mode 100644 index 000000000..22b25275a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/syncstatus/SyncStatusClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.syncstatus; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.syncstatus.requests.SyncStatusListRequest; +import com.merge.legacy.api.resources.crm.types.PaginatedSyncStatusList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/crm/syncstatus/requests/SyncStatusListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/syncstatus/requests/SyncStatusListRequest.java new file mode 100644 index 000000000..6ef51bdb4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/syncstatus/requests/SyncStatusListRequest.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.syncstatus.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.cursor, this.pageSize); + } + + @Override + 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/legacy/api/resources/crm/tasks/TasksClient.java b/src/main/java/com/merge/legacy/api/resources/crm/tasks/TasksClient.java new file mode 100644 index 000000000..1b4cb215a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/tasks/TasksClient.java @@ -0,0 +1,447 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.tasks; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.tasks.requests.*; +import com.merge.legacy.api.resources.crm.types.*; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/crm/tasks/requests/PatchedTaskEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/tasks/requests/PatchedTaskEndpointRequest.java new file mode 100644 index 000000000..27d4a275c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/tasks/requests/PatchedTaskEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.tasks.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.crm.types.PatchedTaskRequest; +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 = PatchedTaskEndpointRequest.Builder.class) +public final class PatchedTaskEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final PatchedTaskRequest model; + + private final Map additionalProperties; + + private PatchedTaskEndpointRequest( + Optional isDebugMode, + Optional runAsync, + PatchedTaskRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public PatchedTaskRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedTaskEndpointRequest && equalTo((PatchedTaskEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedTaskEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull PatchedTaskRequest model); + + Builder from(PatchedTaskEndpointRequest other); + } + + public interface _FinalStage { + PatchedTaskEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private PatchedTaskRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(PatchedTaskEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull PatchedTaskRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public PatchedTaskEndpointRequest build() { + return new PatchedTaskEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/tasks/requests/TaskEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/tasks/requests/TaskEndpointRequest.java new file mode 100644 index 000000000..2fa0502df --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/tasks/requests/TaskEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.tasks.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.crm.types.TaskRequest; +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 = TaskEndpointRequest.Builder.class) +public final class TaskEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final TaskRequest model; + + private final Map additionalProperties; + + private TaskEndpointRequest( + Optional isDebugMode, + Optional runAsync, + TaskRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public TaskRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TaskEndpointRequest && equalTo((TaskEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TaskEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull TaskRequest model); + + Builder from(TaskEndpointRequest other); + } + + public interface _FinalStage { + TaskEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private TaskRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(TaskEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull TaskRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public TaskEndpointRequest build() { + return new TaskEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/tasks/requests/TasksListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/tasks/requests/TasksListRequest.java new file mode 100644 index 000000000..ef49f3540 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/tasks/requests/TasksListRequest.java @@ -0,0 +1,418 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.tasks.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.crm.tasks.types.TasksListRequestExpand; +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 = TasksListRequest.Builder.class) +public final class TasksListRequest { + 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 pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private TasksListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional expand, + 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.expand = expand; + 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 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 The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TasksListRequest && equalTo((TasksListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TasksListRequest 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) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @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.pageSize, + this.remoteId); + } + + @Override + 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 pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TasksListRequest 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()); + 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(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; + 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 TasksListRequest build() { + return new TasksListRequest( + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/tasks/requests/TasksRemoteFieldClassesListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/tasks/requests/TasksRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..86237c3c9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/tasks/requests/TasksRemoteFieldClassesListRequest.java @@ -0,0 +1,272 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.tasks.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = TasksRemoteFieldClassesListRequest.Builder.class) +public final class TasksRemoteFieldClassesListRequest { + 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 TasksRemoteFieldClassesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TasksRemoteFieldClassesListRequest + && equalTo((TasksRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TasksRemoteFieldClassesListRequest 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @Override + 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(TasksRemoteFieldClassesListRequest 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 TasksRemoteFieldClassesListRequest build() { + return new TasksRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + isCommonModelField, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/tasks/requests/TasksRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/tasks/requests/TasksRetrieveRequest.java new file mode 100644 index 000000000..0fd673964 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/tasks/requests/TasksRetrieveRequest.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.tasks.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields); + } + + @Override + 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/legacy/api/resources/crm/tasks/types/TasksListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/crm/tasks/types/TasksListRequestExpand.java new file mode 100644 index 000000000..bd468eea5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/tasks/types/TasksListRequestExpand.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/tasks/types/TasksRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/crm/tasks/types/TasksRetrieveRequestExpand.java new file mode 100644 index 000000000..6c9e44591 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/tasks/types/TasksRetrieveRequestExpand.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/Account.java b/src/main/java/com/merge/legacy/api/resources/crm/types/Account.java new file mode 100644 index 000000000..0e16d0785 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/Account.java @@ -0,0 +1,600 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/crm/types/AccountDetails.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AccountDetails.java new file mode 100644 index 000000000..8c7f2d5b0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AccountDetails.java @@ -0,0 +1,387 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/crm/types/AccountDetailsAndActions.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AccountDetailsAndActions.java new file mode 100644 index 000000000..37c1f13e1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AccountDetailsAndActions.java @@ -0,0 +1,474 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("id") + public StatusStage id(@NotNull String id) { + this.id = id; + return this; + } + + @Override + @JsonSetter("status") + public EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status) { + this.status = status; + return this; + } + + @Override + @JsonSetter("end_user_organization_name") + public EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + @Override + @JsonSetter("end_user_email_address") + public WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + @Override + @JsonSetter("webhook_listener_url") + public AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl) { + this.webhookListenerUrl = webhookListenerUrl; + return this; + } + + @Override + @JsonSetter("account_type") + public CompletedAtStage accountType(@NotNull String accountType) { + this.accountType = accountType; + return this; + } + + @Override + @JsonSetter("completed_at") + public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { + this.completedAt = completedAt; + return this; + } + + @Override + public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @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. + */ + @Override + public _FinalStage isDuplicate(Boolean isDuplicate) { + this.isDuplicate = Optional.ofNullable(isDuplicate); + return this; + } + + @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. + */ + @Override + public _FinalStage subdomain(String subdomain) { + this.subdomain = Optional.ofNullable(subdomain); + return this; + } + + @Override + @JsonSetter(value = "subdomain", nulls = Nulls.SKIP) + public _FinalStage subdomain(Optional subdomain) { + this.subdomain = subdomain; + return this; + } + + @Override + public _FinalStage endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @Override + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public _FinalStage endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + @Override + public _FinalStage statusDetail(String statusDetail) { + this.statusDetail = Optional.ofNullable(statusDetail); + return this; + } + + @Override + @JsonSetter(value = "status_detail", nulls = Nulls.SKIP) + public _FinalStage statusDetail(Optional statusDetail) { + this.statusDetail = statusDetail; + return this; + } + + @Override + public _FinalStage category(CategoryEnum category) { + this.category = Optional.ofNullable(category); + return this; + } + + @Override + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public _FinalStage category(Optional category) { + this.category = category; + return this; + } + + @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/legacy/api/resources/crm/types/AccountDetailsAndActionsIntegration.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AccountDetailsAndActionsIntegration.java new file mode 100644 index 000000000..f187c3af5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AccountDetailsAndActionsIntegration.java @@ -0,0 +1,317 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.categories, + this.image, + this.squareImage, + this.color, + this.slug, + this.passthroughAvailable, + this.availableModelOperations); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("name") + public ColorStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + @JsonSetter("color") + public SlugStage color(@NotNull String color) { + this.color = color; + return this; + } + + @Override + @JsonSetter("slug") + public PassthroughAvailableStage slug(@NotNull String slug) { + this.slug = slug; + return this; + } + + @Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @Override + @JsonSetter(value = "square_image", nulls = Nulls.SKIP) + public _FinalStage squareImage(Optional squareImage) { + this.squareImage = squareImage; + return this; + } + + @Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @Override + @JsonSetter(value = "image", nulls = Nulls.SKIP) + public _FinalStage image(Optional image) { + this.image = image; + return this; + } + + @Override + public _FinalStage addAllCategories(List categories) { + this.categories.addAll(categories); + return this; + } + + @Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + this.categories.addAll(categories); + return this; + } + + @Override + public AccountDetailsAndActionsIntegration build() { + return new AccountDetailsAndActionsIntegration( + name, + categories, + image, + squareImage, + color, + slug, + passthroughAvailable, + availableModelOperations, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/AccountDetailsAndActionsStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AccountDetailsAndActionsStatusEnum.java new file mode 100644 index 000000000..0871d0ff8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AccountDetailsAndActionsStatusEnum.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/AccountIntegration.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AccountIntegration.java new file mode 100644 index 000000000..91e19f364 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AccountIntegration.java @@ -0,0 +1,453 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @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); + } + + @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() {} + + @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. + */ + @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. + */ + @Override + public _FinalStage categoryBetaStatus(Map categoryBetaStatus) { + this.categoryBetaStatus = Optional.ofNullable(categoryBetaStatus); + return this; + } + + @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. + */ + @Override + public _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl) { + this.webhookSetupGuideUrl = Optional.ofNullable(webhookSetupGuideUrl); + return this; + } + + @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. + */ + @Override + public _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = Optional.ofNullable(apiEndpointsToDocumentationUrls); + return this; + } + + @Override + @JsonSetter(value = "api_endpoints_to_documentation_urls", nulls = Nulls.SKIP) + public _FinalStage apiEndpointsToDocumentationUrls( + Optional> apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; + return this; + } + + @Override + public _FinalStage slug(String slug) { + this.slug = Optional.ofNullable(slug); + return this; + } + + @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. + */ + @Override + public _FinalStage color(String color) { + this.color = Optional.ofNullable(color); + return this; + } + + @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. + */ + @Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @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. + */ + @Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @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. + */ + @Override + public _FinalStage categories(List categories) { + this.categories = Optional.ofNullable(categories); + return this; + } + + @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. + */ + @Override + public _FinalStage abbreviatedName(String abbreviatedName) { + this.abbreviatedName = Optional.ofNullable(abbreviatedName); + return this; + } + + @Override + @JsonSetter(value = "abbreviated_name", nulls = Nulls.SKIP) + public _FinalStage abbreviatedName(Optional abbreviatedName) { + this.abbreviatedName = abbreviatedName; + return this; + } + + @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/legacy/api/resources/crm/types/AccountOwner.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AccountOwner.java new file mode 100644 index 000000000..471143c17 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AccountOwner.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AccountOwner.Deserializer.class) +public final class AccountOwner { + private final Object value; + + private final int type; + + private AccountOwner(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((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountOwner && equalTo((AccountOwner) other); + } + + private boolean equalTo(AccountOwner other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static AccountOwner of(String value) { + return new AccountOwner(value, 0); + } + + public static AccountOwner of(User value) { + return new AccountOwner(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AccountOwner.class); + } + + @Override + public AccountOwner 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, User.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/AccountRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AccountRequest.java new file mode 100644 index 000000000..3c817145f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AccountRequest.java @@ -0,0 +1,374 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/crm/types/AccountRequestOwner.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AccountRequestOwner.java new file mode 100644 index 000000000..ee9d3b3bd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AccountRequestOwner.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AccountRequestOwner.Deserializer.class) +public final class AccountRequestOwner { + private final Object value; + + private final int type; + + private AccountRequestOwner(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((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountRequestOwner && equalTo((AccountRequestOwner) other); + } + + private boolean equalTo(AccountRequestOwner other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static AccountRequestOwner of(String value) { + return new AccountRequestOwner(value, 0); + } + + public static AccountRequestOwner of(User value) { + return new AccountRequestOwner(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AccountRequestOwner.class); + } + + @Override + public AccountRequestOwner 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, User.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/AccountToken.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AccountToken.java new file mode 100644 index 000000000..1975a1723 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AccountToken.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.accountToken, this.integration); + } + + @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() {} + + @Override + public Builder from(AccountToken other) { + accountToken(other.getAccountToken()); + integration(other.getIntegration()); + return this; + } + + @Override + @JsonSetter("account_token") + public IntegrationStage accountToken(@NotNull String accountToken) { + this.accountToken = accountToken; + return this; + } + + @Override + @JsonSetter("integration") + public _FinalStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @Override + public AccountToken build() { + return new AccountToken(accountToken, integration, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/ActivityTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/ActivityTypeEnum.java new file mode 100644 index 000000000..e12e63c37 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/ActivityTypeEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/Address.java b/src/main/java/com/merge/legacy/api/resources/crm/types/Address.java new file mode 100644 index 000000000..6b0056fac --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/Address.java @@ -0,0 +1,585 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/crm/types/AddressAddressType.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AddressAddressType.java new file mode 100644 index 000000000..a82d396aa --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AddressAddressType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/AddressCountry.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AddressCountry.java new file mode 100644 index 000000000..c849eed65 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AddressCountry.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/AddressRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AddressRequest.java new file mode 100644 index 000000000..b49309c59 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AddressRequest.java @@ -0,0 +1,579 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/crm/types/AddressRequestAddressType.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AddressRequestAddressType.java new file mode 100644 index 000000000..3e0c7299a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AddressRequestAddressType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/AddressRequestCountry.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AddressRequestCountry.java new file mode 100644 index 000000000..190d476e8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AddressRequestCountry.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/AddressTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AddressTypeEnum.java new file mode 100644 index 000000000..fccf99cdf --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AddressTypeEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/AdvancedMetadata.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AdvancedMetadata.java new file mode 100644 index 000000000..6a59b00c3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AdvancedMetadata.java @@ -0,0 +1,250 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, this.displayName, this.description, this.isRequired, this.isCustom, this.fieldChoices); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = id; + return this; + } + + @Override + public _FinalStage fieldChoices(List fieldChoices) { + this.fieldChoices = Optional.ofNullable(fieldChoices); + return this; + } + + @Override + @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) + public _FinalStage fieldChoices(Optional> fieldChoices) { + this.fieldChoices = fieldChoices; + return this; + } + + @Override + public _FinalStage isCustom(Boolean isCustom) { + this.isCustom = Optional.ofNullable(isCustom); + return this; + } + + @Override + @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) + public _FinalStage isCustom(Optional isCustom) { + this.isCustom = isCustom; + return this; + } + + @Override + public _FinalStage isRequired(Boolean isRequired) { + this.isRequired = Optional.ofNullable(isRequired); + return this; + } + + @Override + @JsonSetter(value = "is_required", nulls = Nulls.SKIP) + public _FinalStage isRequired(Optional isRequired) { + this.isRequired = isRequired; + return this; + } + + @Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + @Override + public _FinalStage displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @Override + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public _FinalStage displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + @Override + public AdvancedMetadata build() { + return new AdvancedMetadata( + id, displayName, description, isRequired, isCustom, fieldChoices, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/Association.java b/src/main/java/com/merge/legacy/api/resources/crm/types/Association.java new file mode 100644 index 000000000..84071f777 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/Association.java @@ -0,0 +1,199 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = Association.Builder.class) +public final class Association { + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional sourceObject; + + private final Optional targetObject; + + private final Optional associationType; + + private final Map additionalProperties; + + private Association( + Optional createdAt, + Optional modifiedAt, + Optional sourceObject, + Optional targetObject, + Optional associationType, + Map additionalProperties) { + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.sourceObject = sourceObject; + this.targetObject = targetObject; + this.associationType = associationType; + 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; + } + + @JsonProperty("source_object") + public Optional getSourceObject() { + return sourceObject; + } + + @JsonProperty("target_object") + public Optional getTargetObject() { + return targetObject; + } + + /** + * @return The association type the association belongs to. + */ + @JsonProperty("association_type") + public Optional getAssociationType() { + return associationType; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Association && equalTo((Association) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Association other) { + return createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && sourceObject.equals(other.sourceObject) + && targetObject.equals(other.targetObject) + && associationType.equals(other.associationType); + } + + @Override + public int hashCode() { + return Objects.hash( + this.createdAt, this.modifiedAt, this.sourceObject, this.targetObject, this.associationType); + } + + @Override + 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 sourceObject = Optional.empty(); + + private Optional targetObject = Optional.empty(); + + private Optional associationType = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Association other) { + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + sourceObject(other.getSourceObject()); + targetObject(other.getTargetObject()); + associationType(other.getAssociationType()); + 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 = "source_object", nulls = Nulls.SKIP) + public Builder sourceObject(Optional sourceObject) { + this.sourceObject = sourceObject; + return this; + } + + public Builder sourceObject(String sourceObject) { + this.sourceObject = Optional.ofNullable(sourceObject); + return this; + } + + @JsonSetter(value = "target_object", nulls = Nulls.SKIP) + public Builder targetObject(Optional targetObject) { + this.targetObject = targetObject; + return this; + } + + public Builder targetObject(String targetObject) { + this.targetObject = Optional.ofNullable(targetObject); + return this; + } + + @JsonSetter(value = "association_type", nulls = Nulls.SKIP) + public Builder associationType(Optional associationType) { + this.associationType = associationType; + return this; + } + + public Builder associationType(AssociationAssociationType associationType) { + this.associationType = Optional.ofNullable(associationType); + return this; + } + + public Association build() { + return new Association( + createdAt, modifiedAt, sourceObject, targetObject, associationType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/AssociationAssociationType.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AssociationAssociationType.java new file mode 100644 index 000000000..3a321e9bd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AssociationAssociationType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AssociationAssociationType.Deserializer.class) +public final class AssociationAssociationType { + private final Object value; + + private final int type; + + private AssociationAssociationType(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((AssociationType) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AssociationAssociationType && equalTo((AssociationAssociationType) other); + } + + private boolean equalTo(AssociationAssociationType other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static AssociationAssociationType of(String value) { + return new AssociationAssociationType(value, 0); + } + + public static AssociationAssociationType of(AssociationType value) { + return new AssociationAssociationType(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(AssociationType value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AssociationAssociationType.class); + } + + @Override + public AssociationAssociationType 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, AssociationType.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/AssociationSubType.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AssociationSubType.java new file mode 100644 index 000000000..62f95c9a7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AssociationSubType.java @@ -0,0 +1,170 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = AssociationSubType.Builder.class) +public final class AssociationSubType { + private final Optional id; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional originType; + + private final Map additionalProperties; + + private AssociationSubType( + Optional id, + Optional createdAt, + Optional modifiedAt, + Optional originType, + Map additionalProperties) { + this.id = id; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.originType = originType; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @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("origin_type") + public Optional getOriginType() { + return originType; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AssociationSubType && equalTo((AssociationSubType) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AssociationSubType other) { + return id.equals(other.id) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && originType.equals(other.originType); + } + + @Override + public int hashCode() { + return Objects.hash(this.id, this.createdAt, this.modifiedAt, this.originType); + } + + @Override + 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 createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional originType = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AssociationSubType other) { + id(other.getId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + originType(other.getOriginType()); + 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 = "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 = "origin_type", nulls = Nulls.SKIP) + public Builder originType(Optional originType) { + this.originType = originType; + return this; + } + + public Builder originType(String originType) { + this.originType = Optional.ofNullable(originType); + return this; + } + + public AssociationSubType build() { + return new AssociationSubType(id, createdAt, modifiedAt, originType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/AssociationType.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AssociationType.java new file mode 100644 index 000000000..b30d20147 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AssociationType.java @@ -0,0 +1,339 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AssociationType.Builder.class) +public final class AssociationType { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional> sourceObjectClass; + + private final Optional> targetObjectClasses; + + private final Optional remoteKeyName; + + private final Optional displayName; + + private final Optional cardinality; + + private final Optional isRequired; + + private final Map additionalProperties; + + private AssociationType( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional> sourceObjectClass, + Optional> targetObjectClasses, + Optional remoteKeyName, + Optional displayName, + Optional cardinality, + Optional isRequired, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.sourceObjectClass = sourceObjectClass; + this.targetObjectClasses = targetObjectClasses; + this.remoteKeyName = remoteKeyName; + this.displayName = displayName; + this.cardinality = cardinality; + this.isRequired = isRequired; + 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 class of the source object (Custom Object or Common Model) for the association type. + */ + @JsonProperty("source_object_class") + public Optional> getSourceObjectClass() { + return sourceObjectClass; + } + + @JsonProperty("target_object_classes") + public Optional> getTargetObjectClasses() { + return targetObjectClasses; + } + + @JsonProperty("remote_key_name") + public Optional getRemoteKeyName() { + return remoteKeyName; + } + + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("cardinality") + public Optional getCardinality() { + return cardinality; + } + + @JsonProperty("is_required") + public Optional getIsRequired() { + return isRequired; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AssociationType && equalTo((AssociationType) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AssociationType other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && sourceObjectClass.equals(other.sourceObjectClass) + && targetObjectClasses.equals(other.targetObjectClasses) + && remoteKeyName.equals(other.remoteKeyName) + && displayName.equals(other.displayName) + && cardinality.equals(other.cardinality) + && isRequired.equals(other.isRequired); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.sourceObjectClass, + this.targetObjectClasses, + this.remoteKeyName, + this.displayName, + this.cardinality, + this.isRequired); + } + + @Override + 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> sourceObjectClass = Optional.empty(); + + private Optional> targetObjectClasses = Optional.empty(); + + private Optional remoteKeyName = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional cardinality = Optional.empty(); + + private Optional isRequired = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AssociationType other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + sourceObjectClass(other.getSourceObjectClass()); + targetObjectClasses(other.getTargetObjectClasses()); + remoteKeyName(other.getRemoteKeyName()); + displayName(other.getDisplayName()); + cardinality(other.getCardinality()); + isRequired(other.getIsRequired()); + 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 = "source_object_class", nulls = Nulls.SKIP) + public Builder sourceObjectClass(Optional> sourceObjectClass) { + this.sourceObjectClass = sourceObjectClass; + return this; + } + + public Builder sourceObjectClass(Map sourceObjectClass) { + this.sourceObjectClass = Optional.ofNullable(sourceObjectClass); + return this; + } + + @JsonSetter(value = "target_object_classes", nulls = Nulls.SKIP) + public Builder targetObjectClasses(Optional> targetObjectClasses) { + this.targetObjectClasses = targetObjectClasses; + return this; + } + + public Builder targetObjectClasses(List targetObjectClasses) { + this.targetObjectClasses = Optional.ofNullable(targetObjectClasses); + 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 = "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 = "cardinality", nulls = Nulls.SKIP) + public Builder cardinality(Optional cardinality) { + this.cardinality = cardinality; + return this; + } + + public Builder cardinality(AssociationTypeCardinality cardinality) { + this.cardinality = Optional.ofNullable(cardinality); + 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; + } + + public AssociationType build() { + return new AssociationType( + id, + remoteId, + createdAt, + modifiedAt, + sourceObjectClass, + targetObjectClasses, + remoteKeyName, + displayName, + cardinality, + isRequired, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/AssociationTypeCardinality.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AssociationTypeCardinality.java new file mode 100644 index 000000000..267be2578 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AssociationTypeCardinality.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/AssociationTypeRequestRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AssociationTypeRequestRequest.java new file mode 100644 index 000000000..342fc4fd1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AssociationTypeRequestRequest.java @@ -0,0 +1,263 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AssociationTypeRequestRequest.Builder.class) +public final class AssociationTypeRequestRequest { + private final ObjectClassDescriptionRequest sourceObjectClass; + + private final List targetObjectClasses; + + private final String remoteKeyName; + + private final Optional displayName; + + private final Optional cardinality; + + private final Optional isRequired; + + private final Map additionalProperties; + + private AssociationTypeRequestRequest( + ObjectClassDescriptionRequest sourceObjectClass, + List targetObjectClasses, + String remoteKeyName, + Optional displayName, + Optional cardinality, + Optional isRequired, + Map additionalProperties) { + this.sourceObjectClass = sourceObjectClass; + this.targetObjectClasses = targetObjectClasses; + this.remoteKeyName = remoteKeyName; + this.displayName = displayName; + this.cardinality = cardinality; + this.isRequired = isRequired; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("source_object_class") + public ObjectClassDescriptionRequest getSourceObjectClass() { + return sourceObjectClass; + } + + @JsonProperty("target_object_classes") + public List getTargetObjectClasses() { + return targetObjectClasses; + } + + @JsonProperty("remote_key_name") + public String getRemoteKeyName() { + return remoteKeyName; + } + + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("cardinality") + public Optional getCardinality() { + return cardinality; + } + + @JsonProperty("is_required") + public Optional getIsRequired() { + return isRequired; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AssociationTypeRequestRequest && equalTo((AssociationTypeRequestRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AssociationTypeRequestRequest other) { + return sourceObjectClass.equals(other.sourceObjectClass) + && targetObjectClasses.equals(other.targetObjectClasses) + && remoteKeyName.equals(other.remoteKeyName) + && displayName.equals(other.displayName) + && cardinality.equals(other.cardinality) + && isRequired.equals(other.isRequired); + } + + @Override + public int hashCode() { + return Objects.hash( + this.sourceObjectClass, + this.targetObjectClasses, + this.remoteKeyName, + this.displayName, + this.cardinality, + this.isRequired); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static SourceObjectClassStage builder() { + return new Builder(); + } + + public interface SourceObjectClassStage { + RemoteKeyNameStage sourceObjectClass(@NotNull ObjectClassDescriptionRequest sourceObjectClass); + + Builder from(AssociationTypeRequestRequest other); + } + + public interface RemoteKeyNameStage { + _FinalStage remoteKeyName(@NotNull String remoteKeyName); + } + + public interface _FinalStage { + AssociationTypeRequestRequest build(); + + _FinalStage targetObjectClasses(List targetObjectClasses); + + _FinalStage addTargetObjectClasses(ObjectClassDescriptionRequest targetObjectClasses); + + _FinalStage addAllTargetObjectClasses(List targetObjectClasses); + + _FinalStage displayName(Optional displayName); + + _FinalStage displayName(String displayName); + + _FinalStage cardinality(Optional cardinality); + + _FinalStage cardinality(CardinalityEnum cardinality); + + _FinalStage isRequired(Optional isRequired); + + _FinalStage isRequired(Boolean isRequired); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements SourceObjectClassStage, RemoteKeyNameStage, _FinalStage { + private ObjectClassDescriptionRequest sourceObjectClass; + + private String remoteKeyName; + + private Optional isRequired = Optional.empty(); + + private Optional cardinality = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private List targetObjectClasses = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(AssociationTypeRequestRequest other) { + sourceObjectClass(other.getSourceObjectClass()); + targetObjectClasses(other.getTargetObjectClasses()); + remoteKeyName(other.getRemoteKeyName()); + displayName(other.getDisplayName()); + cardinality(other.getCardinality()); + isRequired(other.getIsRequired()); + return this; + } + + @Override + @JsonSetter("source_object_class") + public RemoteKeyNameStage sourceObjectClass(@NotNull ObjectClassDescriptionRequest sourceObjectClass) { + this.sourceObjectClass = sourceObjectClass; + return this; + } + + @Override + @JsonSetter("remote_key_name") + public _FinalStage remoteKeyName(@NotNull String remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @Override + public _FinalStage isRequired(Boolean isRequired) { + this.isRequired = Optional.ofNullable(isRequired); + return this; + } + + @Override + @JsonSetter(value = "is_required", nulls = Nulls.SKIP) + public _FinalStage isRequired(Optional isRequired) { + this.isRequired = isRequired; + return this; + } + + @Override + public _FinalStage cardinality(CardinalityEnum cardinality) { + this.cardinality = Optional.ofNullable(cardinality); + return this; + } + + @Override + @JsonSetter(value = "cardinality", nulls = Nulls.SKIP) + public _FinalStage cardinality(Optional cardinality) { + this.cardinality = cardinality; + return this; + } + + @Override + public _FinalStage displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @Override + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public _FinalStage displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + @Override + public _FinalStage addAllTargetObjectClasses(List targetObjectClasses) { + this.targetObjectClasses.addAll(targetObjectClasses); + return this; + } + + @Override + public _FinalStage addTargetObjectClasses(ObjectClassDescriptionRequest targetObjectClasses) { + this.targetObjectClasses.add(targetObjectClasses); + return this; + } + + @Override + @JsonSetter(value = "target_object_classes", nulls = Nulls.SKIP) + public _FinalStage targetObjectClasses(List targetObjectClasses) { + this.targetObjectClasses.clear(); + this.targetObjectClasses.addAll(targetObjectClasses); + return this; + } + + @Override + public AssociationTypeRequestRequest build() { + return new AssociationTypeRequestRequest( + sourceObjectClass, + targetObjectClasses, + remoteKeyName, + displayName, + cardinality, + isRequired, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/AsyncPassthroughReciept.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AsyncPassthroughReciept.java new file mode 100644 index 000000000..c85fba912 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AsyncPassthroughReciept.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.asyncPassthroughReceiptId); + } + + @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() {} + + @Override + public Builder from(AsyncPassthroughReciept other) { + asyncPassthroughReceiptId(other.getAsyncPassthroughReceiptId()); + return this; + } + + @Override + @JsonSetter("async_passthrough_receipt_id") + public _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId) { + this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; + return this; + } + + @Override + public AsyncPassthroughReciept build() { + return new AsyncPassthroughReciept(asyncPassthroughReceiptId, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/AuditLogEvent.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AuditLogEvent.java new file mode 100644 index 000000000..b38073b7c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AuditLogEvent.java @@ -0,0 +1,441 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.userName, + this.userEmail, + this.role, + this.ipAddress, + this.eventType, + this.eventDescription, + this.createdAt); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("role") + public IpAddressStage role(@NotNull AuditLogEventRole role) { + this.role = role; + return this; + } + + @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. + */ + @Override + @JsonSetter("event_type") + public EventDescriptionStage eventType(@NotNull AuditLogEventEventType eventType) { + this.eventType = eventType; + return this; + } + + @Override + @JsonSetter("event_description") + public _FinalStage eventDescription(@NotNull String eventDescription) { + this.eventDescription = eventDescription; + return this; + } + + @Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @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. + */ + @Override + public _FinalStage userEmail(String userEmail) { + this.userEmail = Optional.ofNullable(userEmail); + return this; + } + + @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. + */ + @Override + public _FinalStage userName(String userName) { + this.userName = Optional.ofNullable(userName); + return this; + } + + @Override + @JsonSetter(value = "user_name", nulls = Nulls.SKIP) + public _FinalStage userName(Optional userName) { + this.userName = userName; + return this; + } + + @Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @Override + public AuditLogEvent build() { + return new AuditLogEvent( + id, + userName, + userEmail, + role, + ipAddress, + eventType, + eventDescription, + createdAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/AuditLogEventEventType.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AuditLogEventEventType.java new file mode 100644 index 000000000..0a8c5b70e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AuditLogEventEventType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/AuditLogEventRole.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AuditLogEventRole.java new file mode 100644 index 000000000..c512fa23e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AuditLogEventRole.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/AvailableActions.java b/src/main/java/com/merge/legacy/api/resources/crm/types/AvailableActions.java new file mode 100644 index 000000000..f8586c360 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/AvailableActions.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.integration, this.passthroughAvailable, this.availableModelOperations); + } + + @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() {} + + @Override + public Builder from(AvailableActions other) { + integration(other.getIntegration()); + passthroughAvailable(other.getPassthroughAvailable()); + availableModelOperations(other.getAvailableModelOperations()); + return this; + } + + @Override + @JsonSetter("integration") + public PassthroughAvailableStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @Override + public AvailableActions build() { + return new AvailableActions( + integration, passthroughAvailable, availableModelOperations, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/CardinalityEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/CardinalityEnum.java new file mode 100644 index 000000000..22f74f12d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/CardinalityEnum.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CardinalityEnum { + ONE_TO_ONE("ONE_TO_ONE"), + + MANY_TO_ONE("MANY_TO_ONE"), + + MANY_TO_MANY("MANY_TO_MANY"), + + ONE_TO_MANY("ONE_TO_MANY"); + + private final String value; + + CardinalityEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/CategoriesEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/CategoriesEnum.java new file mode 100644 index 000000000..76be40eb8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/CategoriesEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/CategoryEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/CategoryEnum.java new file mode 100644 index 000000000..a70b2ad66 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/CategoryEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/CommonModelScopeApi.java b/src/main/java/com/merge/legacy/api/resources/crm/types/CommonModelScopeApi.java new file mode 100644 index 000000000..d1dfb39fe --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/CommonModelScopeApi.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @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/legacy/api/resources/crm/types/CommonModelScopesBodyRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/CommonModelScopesBodyRequest.java new file mode 100644 index 000000000..3f789ef8e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/CommonModelScopesBodyRequest.java @@ -0,0 +1,175 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.modelId, this.enabledActions, this.disabledFields); + } + + @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() {} + + @Override + public Builder from(CommonModelScopesBodyRequest other) { + modelId(other.getModelId()); + enabledActions(other.getEnabledActions()); + disabledFields(other.getDisabledFields()); + return this; + } + + @Override + @JsonSetter("model_id") + public _FinalStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @Override + public _FinalStage addAllDisabledFields(List disabledFields) { + this.disabledFields.addAll(disabledFields); + return this; + } + + @Override + public _FinalStage addDisabledFields(String disabledFields) { + this.disabledFields.add(disabledFields); + return this; + } + + @Override + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public _FinalStage disabledFields(List disabledFields) { + this.disabledFields.clear(); + this.disabledFields.addAll(disabledFields); + return this; + } + + @Override + public _FinalStage addAllEnabledActions(List enabledActions) { + this.enabledActions.addAll(enabledActions); + return this; + } + + @Override + public _FinalStage addEnabledActions(EnabledActionsEnum enabledActions) { + this.enabledActions.add(enabledActions); + return this; + } + + @Override + @JsonSetter(value = "enabled_actions", nulls = Nulls.SKIP) + public _FinalStage enabledActions(List enabledActions) { + this.enabledActions.clear(); + this.enabledActions.addAll(enabledActions); + return this; + } + + @Override + public CommonModelScopesBodyRequest build() { + return new CommonModelScopesBodyRequest(modelId, enabledActions, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/Contact.java b/src/main/java/com/merge/legacy/api/resources/crm/types/Contact.java new file mode 100644 index 000000000..b6b53a0bc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/Contact.java @@ -0,0 +1,539 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/crm/types/ContactAccount.java b/src/main/java/com/merge/legacy/api/resources/crm/types/ContactAccount.java new file mode 100644 index 000000000..c9b84f5b2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/ContactAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/ContactOwner.java b/src/main/java/com/merge/legacy/api/resources/crm/types/ContactOwner.java new file mode 100644 index 000000000..b4bdf2628 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/ContactOwner.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ContactOwner.Deserializer.class) +public final class ContactOwner { + private final Object value; + + private final int type; + + private ContactOwner(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((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactOwner && equalTo((ContactOwner) other); + } + + private boolean equalTo(ContactOwner other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ContactOwner of(String value) { + return new ContactOwner(value, 0); + } + + public static ContactOwner of(User value) { + return new ContactOwner(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ContactOwner.class); + } + + @Override + public ContactOwner 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, User.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/ContactRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/ContactRequest.java new file mode 100644 index 000000000..4d53083de --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/ContactRequest.java @@ -0,0 +1,368 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/crm/types/ContactRequestAccount.java b/src/main/java/com/merge/legacy/api/resources/crm/types/ContactRequestAccount.java new file mode 100644 index 000000000..40bb3b686 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/ContactRequestAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/ContactRequestOwner.java b/src/main/java/com/merge/legacy/api/resources/crm/types/ContactRequestOwner.java new file mode 100644 index 000000000..492e85837 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/ContactRequestOwner.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ContactRequestOwner.Deserializer.class) +public final class ContactRequestOwner { + private final Object value; + + private final int type; + + private ContactRequestOwner(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((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactRequestOwner && equalTo((ContactRequestOwner) other); + } + + private boolean equalTo(ContactRequestOwner other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ContactRequestOwner of(String value) { + return new ContactRequestOwner(value, 0); + } + + public static ContactRequestOwner of(User value) { + return new ContactRequestOwner(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ContactRequestOwner.class); + } + + @Override + public ContactRequestOwner 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, User.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/CountryEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/CountryEnum.java new file mode 100644 index 000000000..6667c99fe --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/CountryEnum.java @@ -0,0 +1,518 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/CrmAccountResponse.java b/src/main/java/com/merge/legacy/api/resources/crm/types/CrmAccountResponse.java new file mode 100644 index 000000000..9b02d7e7e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/CrmAccountResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CrmAccountResponse.Builder.class) +public final class CrmAccountResponse { + private final Account model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private CrmAccountResponse( + Account 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 Account getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CrmAccountResponse && equalTo((CrmAccountResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CrmAccountResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull Account model); + + Builder from(CrmAccountResponse other); + } + + public interface _FinalStage { + CrmAccountResponse 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 Account model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CrmAccountResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull Account model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public CrmAccountResponse build() { + return new CrmAccountResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/CrmAssociationTypeResponse.java b/src/main/java/com/merge/legacy/api/resources/crm/types/CrmAssociationTypeResponse.java new file mode 100644 index 000000000..92c665efe --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/CrmAssociationTypeResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CrmAssociationTypeResponse.Builder.class) +public final class CrmAssociationTypeResponse { + private final AssociationType model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private CrmAssociationTypeResponse( + AssociationType 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 AssociationType getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CrmAssociationTypeResponse && equalTo((CrmAssociationTypeResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CrmAssociationTypeResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull AssociationType model); + + Builder from(CrmAssociationTypeResponse other); + } + + public interface _FinalStage { + CrmAssociationTypeResponse 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 AssociationType model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CrmAssociationTypeResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull AssociationType model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public CrmAssociationTypeResponse build() { + return new CrmAssociationTypeResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/CrmContactResponse.java b/src/main/java/com/merge/legacy/api/resources/crm/types/CrmContactResponse.java new file mode 100644 index 000000000..278dfae41 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/CrmContactResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CrmContactResponse.Builder.class) +public final class CrmContactResponse { + private final Contact model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private CrmContactResponse( + Contact 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 Contact getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CrmContactResponse && equalTo((CrmContactResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CrmContactResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull Contact model); + + Builder from(CrmContactResponse other); + } + + public interface _FinalStage { + CrmContactResponse 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 Contact model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CrmContactResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull Contact model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public CrmContactResponse build() { + return new CrmContactResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/CrmCustomObjectResponse.java b/src/main/java/com/merge/legacy/api/resources/crm/types/CrmCustomObjectResponse.java new file mode 100644 index 000000000..db0eed465 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/CrmCustomObjectResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CrmCustomObjectResponse.Builder.class) +public final class CrmCustomObjectResponse { + private final CustomObject model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private CrmCustomObjectResponse( + CustomObject 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 CustomObject getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CrmCustomObjectResponse && equalTo((CrmCustomObjectResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CrmCustomObjectResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull CustomObject model); + + Builder from(CrmCustomObjectResponse other); + } + + public interface _FinalStage { + CrmCustomObjectResponse 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 CustomObject model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CrmCustomObjectResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull CustomObject model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public CrmCustomObjectResponse build() { + return new CrmCustomObjectResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/CustomObject.java b/src/main/java/com/merge/legacy/api/resources/crm/types/CustomObject.java new file mode 100644 index 000000000..0cc44e919 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/CustomObject.java @@ -0,0 +1,257 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CustomObject.Builder.class) +public final class CustomObject { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional objectClass; + + private final Optional> fields; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private CustomObject( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional objectClass, + Optional> fields, + Optional> remoteFields, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.objectClass = objectClass; + this.fields = fields; + 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 custom object class the custom object record belongs to. + */ + @JsonProperty("object_class") + public Optional getObjectClass() { + return objectClass; + } + + /** + * @return The fields and values contained within the custom object record. + */ + @JsonProperty("fields") + public Optional> getFields() { + return fields; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomObject && equalTo((CustomObject) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CustomObject other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && objectClass.equals(other.objectClass) + && fields.equals(other.fields) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.objectClass, + this.fields, + this.remoteFields); + } + + @Override + 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 objectClass = Optional.empty(); + + private Optional> fields = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CustomObject other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + objectClass(other.getObjectClass()); + fields(other.getFields()); + 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 = "object_class", nulls = Nulls.SKIP) + public Builder objectClass(Optional objectClass) { + this.objectClass = objectClass; + return this; + } + + public Builder objectClass(String objectClass) { + this.objectClass = Optional.ofNullable(objectClass); + return this; + } + + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(Optional> fields) { + this.fields = fields; + return this; + } + + public Builder fields(Map fields) { + this.fields = Optional.ofNullable(fields); + 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 CustomObject build() { + return new CustomObject( + id, remoteId, createdAt, modifiedAt, objectClass, fields, remoteFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/CustomObjectClass.java b/src/main/java/com/merge/legacy/api/resources/crm/types/CustomObjectClass.java new file mode 100644 index 000000000..f35ba73db --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/CustomObjectClass.java @@ -0,0 +1,316 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CustomObjectClass.Builder.class) +public final class CustomObjectClass { + 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>> labels; + + private final Optional> fields; + + private final Optional>> associationTypes; + + private final Map additionalProperties; + + private CustomObjectClass( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional description, + Optional>> labels, + Optional> fields, + Optional>> associationTypes, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.description = description; + this.labels = labels; + this.fields = fields; + this.associationTypes = associationTypes; + 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; + } + + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The custom object class's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The custom object class's description. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The custom object class's singular and plural labels. + */ + @JsonProperty("labels") + public Optional>> getLabels() { + return labels; + } + + @JsonProperty("fields") + public Optional> getFields() { + return fields; + } + + /** + * @return The types of associations with other models that the custom object class can have. + */ + @JsonProperty("association_types") + public Optional>> getAssociationTypes() { + return associationTypes; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomObjectClass && equalTo((CustomObjectClass) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CustomObjectClass 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) + && labels.equals(other.labels) + && fields.equals(other.fields) + && associationTypes.equals(other.associationTypes); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.description, + this.labels, + this.fields, + this.associationTypes); + } + + @Override + 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>> labels = Optional.empty(); + + private Optional> fields = Optional.empty(); + + private Optional>> associationTypes = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CustomObjectClass other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + description(other.getDescription()); + labels(other.getLabels()); + fields(other.getFields()); + associationTypes(other.getAssociationTypes()); + 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 = "labels", nulls = Nulls.SKIP) + public Builder labels(Optional>> labels) { + this.labels = labels; + return this; + } + + public Builder labels(Map> labels) { + this.labels = Optional.ofNullable(labels); + return this; + } + + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(Optional> fields) { + this.fields = fields; + return this; + } + + public Builder fields(List fields) { + this.fields = Optional.ofNullable(fields); + return this; + } + + @JsonSetter(value = "association_types", nulls = Nulls.SKIP) + public Builder associationTypes(Optional>> associationTypes) { + this.associationTypes = associationTypes; + return this; + } + + public Builder associationTypes(List> associationTypes) { + this.associationTypes = Optional.ofNullable(associationTypes); + return this; + } + + public CustomObjectClass build() { + return new CustomObjectClass( + id, + remoteId, + createdAt, + modifiedAt, + name, + description, + labels, + fields, + associationTypes, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/CustomObjectRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/CustomObjectRequest.java new file mode 100644 index 000000000..75033efb4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/CustomObjectRequest.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CustomObjectRequest.Builder.class) +public final class CustomObjectRequest { + private final Map fields; + + private final Map additionalProperties; + + private CustomObjectRequest(Map fields, Map additionalProperties) { + this.fields = fields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("fields") + public Map getFields() { + return fields; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomObjectRequest && equalTo((CustomObjectRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CustomObjectRequest other) { + return fields.equals(other.fields); + } + + @Override + public int hashCode() { + return Objects.hash(this.fields); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Map fields = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CustomObjectRequest other) { + fields(other.getFields()); + return this; + } + + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public Builder fields(Map fields) { + this.fields.clear(); + this.fields.putAll(fields); + return this; + } + + public Builder putAllFields(Map fields) { + this.fields.putAll(fields); + return this; + } + + public Builder fields(String key, JsonNode value) { + this.fields.put(key, value); + return this; + } + + public CustomObjectRequest build() { + return new CustomObjectRequest(fields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/DataPassthroughRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/DataPassthroughRequest.java new file mode 100644 index 000000000..badeb17a5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/DataPassthroughRequest.java @@ -0,0 +1,361 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.baseUrlOverride, + this.data, + this.multipartFormData, + this.headers, + this.requestFormat, + this.normalizeResponse); + } + + @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() {} + + @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; + } + + @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. + */ + @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. + */ + @Override + public _FinalStage normalizeResponse(Boolean normalizeResponse) { + this.normalizeResponse = Optional.ofNullable(normalizeResponse); + return this; + } + + @Override + @JsonSetter(value = "normalize_response", nulls = Nulls.SKIP) + public _FinalStage normalizeResponse(Optional normalizeResponse) { + this.normalizeResponse = normalizeResponse; + return this; + } + + @Override + public _FinalStage requestFormat(RequestFormatEnum requestFormat) { + this.requestFormat = Optional.ofNullable(requestFormat); + return this; + } + + @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. + */ + @Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @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. + */ + @Override + public _FinalStage multipartFormData(List multipartFormData) { + this.multipartFormData = Optional.ofNullable(multipartFormData); + return this; + } + + @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. + */ + @Override + public _FinalStage data(String data) { + this.data = Optional.ofNullable(data); + return this; + } + + @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. + */ + @Override + public _FinalStage baseUrlOverride(String baseUrlOverride) { + this.baseUrlOverride = Optional.ofNullable(baseUrlOverride); + return this; + } + + @Override + @JsonSetter(value = "base_url_override", nulls = Nulls.SKIP) + public _FinalStage baseUrlOverride(Optional baseUrlOverride) { + this.baseUrlOverride = baseUrlOverride; + return this; + } + + @Override + public DataPassthroughRequest build() { + return new DataPassthroughRequest( + method, + path, + baseUrlOverride, + data, + multipartFormData, + headers, + requestFormat, + normalizeResponse, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/DebugModeLog.java b/src/main/java/com/merge/legacy/api/resources/crm/types/DebugModeLog.java new file mode 100644 index 000000000..a9e92cb25 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/DebugModeLog.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.logId, this.dashboardView, this.logSummary); + } + + @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() {} + + @Override + public Builder from(DebugModeLog other) { + logId(other.getLogId()); + dashboardView(other.getDashboardView()); + logSummary(other.getLogSummary()); + return this; + } + + @Override + @JsonSetter("log_id") + public DashboardViewStage logId(@NotNull String logId) { + this.logId = logId; + return this; + } + + @Override + @JsonSetter("dashboard_view") + public LogSummaryStage dashboardView(@NotNull String dashboardView) { + this.dashboardView = dashboardView; + return this; + } + + @Override + @JsonSetter("log_summary") + public _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary) { + this.logSummary = logSummary; + return this; + } + + @Override + public DebugModeLog build() { + return new DebugModeLog(logId, dashboardView, logSummary, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/DebugModelLogSummary.java b/src/main/java/com/merge/legacy/api/resources/crm/types/DebugModelLogSummary.java new file mode 100644 index 000000000..68737b862 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/DebugModelLogSummary.java @@ -0,0 +1,141 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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; + } + + @Override + public int hashCode() { + return Objects.hash(this.url, this.method, this.statusCode); + } + + @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() {} + + @Override + public Builder from(DebugModelLogSummary other) { + url(other.getUrl()); + method(other.getMethod()); + statusCode(other.getStatusCode()); + return this; + } + + @Override + @JsonSetter("url") + public MethodStage url(@NotNull String url) { + this.url = url; + return this; + } + + @Override + @JsonSetter("method") + public StatusCodeStage method(@NotNull String method) { + this.method = method; + return this; + } + + @Override + @JsonSetter("status_code") + public _FinalStage statusCode(int statusCode) { + this.statusCode = statusCode; + return this; + } + + @Override + public DebugModelLogSummary build() { + return new DebugModelLogSummary(url, method, statusCode, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/DirectionEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/DirectionEnum.java new file mode 100644 index 000000000..85ba793df --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/DirectionEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum DirectionEnum { + INBOUND("INBOUND"), + + OUTBOUND("OUTBOUND"); + + private final String value; + + DirectionEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/EmailAddress.java b/src/main/java/com/merge/legacy/api/resources/crm/types/EmailAddress.java new file mode 100644 index 000000000..8fb5f71af --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/EmailAddress.java @@ -0,0 +1,176 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.createdAt, this.modifiedAt, this.emailAddress, this.emailAddressType); + } + + @Override + 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/legacy/api/resources/crm/types/EmailAddressRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/EmailAddressRequest.java new file mode 100644 index 000000000..31273f3c9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/EmailAddressRequest.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.emailAddress, this.emailAddressType, this.integrationParams, this.linkedAccountParams); + } + + @Override + 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/legacy/api/resources/crm/types/EnabledActionsEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/EnabledActionsEnum.java new file mode 100644 index 000000000..9fcbef966 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/EnabledActionsEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/EncodingEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/EncodingEnum.java new file mode 100644 index 000000000..ad9b8bbe0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/EncodingEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/Engagement.java b/src/main/java/com/merge/legacy/api/resources/crm/types/Engagement.java new file mode 100644 index 000000000..9c6fa9f35 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/Engagement.java @@ -0,0 +1,549 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Engagement.Builder.class) +public final class Engagement { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional owner; + + private final Optional content; + + private final Optional subject; + + private final Optional direction; + + private final Optional engagementType; + + private final Optional startTime; + + private final Optional endTime; + + private final Optional account; + + private final Optional>> contacts; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private Engagement( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional owner, + Optional content, + Optional subject, + Optional direction, + Optional engagementType, + Optional startTime, + Optional endTime, + Optional account, + Optional>> contacts, + 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.content = content; + this.subject = subject; + this.direction = direction; + this.engagementType = engagementType; + this.startTime = startTime; + this.endTime = endTime; + this.account = account; + this.contacts = contacts; + 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 engagement's owner. + */ + @JsonProperty("owner") + public Optional getOwner() { + return owner; + } + + /** + * @return The engagement's content. + */ + @JsonProperty("content") + public Optional getContent() { + return content; + } + + /** + * @return The engagement's subject. + */ + @JsonProperty("subject") + public Optional getSubject() { + return subject; + } + + /** + * @return The engagement's direction. + *
    + *
  • INBOUND - INBOUND
  • + *
  • OUTBOUND - OUTBOUND
  • + *
+ */ + @JsonProperty("direction") + public Optional getDirection() { + return direction; + } + + /** + * @return The engagement type of the engagement. + */ + @JsonProperty("engagement_type") + public Optional getEngagementType() { + return engagementType; + } + + /** + * @return The time at which the engagement started. + */ + @JsonProperty("start_time") + public Optional getStartTime() { + return startTime; + } + + /** + * @return The time at which the engagement ended. + */ + @JsonProperty("end_time") + public Optional getEndTime() { + return endTime; + } + + /** + * @return The account of the engagement. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + @JsonProperty("contacts") + public Optional>> getContacts() { + return contacts; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Engagement && equalTo((Engagement) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Engagement other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && owner.equals(other.owner) + && content.equals(other.content) + && subject.equals(other.subject) + && direction.equals(other.direction) + && engagementType.equals(other.engagementType) + && startTime.equals(other.startTime) + && endTime.equals(other.endTime) + && account.equals(other.account) + && contacts.equals(other.contacts) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.owner, + this.content, + this.subject, + this.direction, + this.engagementType, + this.startTime, + this.endTime, + this.account, + this.contacts, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData, + this.remoteFields); + } + + @Override + 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 content = Optional.empty(); + + private Optional subject = Optional.empty(); + + private Optional direction = Optional.empty(); + + private Optional engagementType = Optional.empty(); + + private Optional startTime = Optional.empty(); + + private Optional endTime = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional>> contacts = 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(Engagement other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + owner(other.getOwner()); + content(other.getContent()); + subject(other.getSubject()); + direction(other.getDirection()); + engagementType(other.getEngagementType()); + startTime(other.getStartTime()); + endTime(other.getEndTime()); + account(other.getAccount()); + contacts(other.getContacts()); + 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(EngagementOwner owner) { + this.owner = Optional.ofNullable(owner); + return this; + } + + @JsonSetter(value = "content", nulls = Nulls.SKIP) + public Builder content(Optional content) { + this.content = content; + return this; + } + + public Builder content(String content) { + this.content = Optional.ofNullable(content); + return this; + } + + @JsonSetter(value = "subject", nulls = Nulls.SKIP) + public Builder subject(Optional subject) { + this.subject = subject; + return this; + } + + public Builder subject(String subject) { + this.subject = Optional.ofNullable(subject); + return this; + } + + @JsonSetter(value = "direction", nulls = Nulls.SKIP) + public Builder direction(Optional direction) { + this.direction = direction; + return this; + } + + public Builder direction(EngagementDirection direction) { + this.direction = Optional.ofNullable(direction); + return this; + } + + @JsonSetter(value = "engagement_type", nulls = Nulls.SKIP) + public Builder engagementType(Optional engagementType) { + this.engagementType = engagementType; + return this; + } + + public Builder engagementType(EngagementEngagementType engagementType) { + this.engagementType = Optional.ofNullable(engagementType); + return this; + } + + @JsonSetter(value = "start_time", nulls = Nulls.SKIP) + public Builder startTime(Optional startTime) { + this.startTime = startTime; + return this; + } + + public Builder startTime(OffsetDateTime startTime) { + this.startTime = Optional.ofNullable(startTime); + return this; + } + + @JsonSetter(value = "end_time", nulls = Nulls.SKIP) + public Builder endTime(Optional endTime) { + this.endTime = endTime; + return this; + } + + public Builder endTime(OffsetDateTime endTime) { + this.endTime = Optional.ofNullable(endTime); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(EngagementAccount account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "contacts", nulls = Nulls.SKIP) + public Builder contacts(Optional>> contacts) { + this.contacts = contacts; + return this; + } + + public Builder contacts(List> contacts) { + this.contacts = Optional.ofNullable(contacts); + 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 Engagement build() { + return new Engagement( + id, + remoteId, + createdAt, + modifiedAt, + owner, + content, + subject, + direction, + engagementType, + startTime, + endTime, + account, + contacts, + remoteWasDeleted, + fieldMappings, + remoteData, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementAccount.java b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementAccount.java new file mode 100644 index 000000000..3de3478ad --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EngagementAccount.Deserializer.class) +public final class EngagementAccount { + private final Object value; + + private final int type; + + private EngagementAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EngagementAccount && equalTo((EngagementAccount) other); + } + + private boolean equalTo(EngagementAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EngagementAccount of(String value) { + return new EngagementAccount(value, 0); + } + + public static EngagementAccount of(Account value) { + return new EngagementAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EngagementAccount.class); + } + + @Override + public EngagementAccount 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/legacy/api/resources/crm/types/EngagementContactsItem.java b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementContactsItem.java new file mode 100644 index 000000000..640d00cb1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementContactsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EngagementContactsItem.Deserializer.class) +public final class EngagementContactsItem { + private final Object value; + + private final int type; + + private EngagementContactsItem(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EngagementContactsItem && equalTo((EngagementContactsItem) other); + } + + private boolean equalTo(EngagementContactsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EngagementContactsItem of(String value) { + return new EngagementContactsItem(value, 0); + } + + public static EngagementContactsItem of(Contact value) { + return new EngagementContactsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EngagementContactsItem.class); + } + + @Override + public EngagementContactsItem 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementDirection.java b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementDirection.java new file mode 100644 index 000000000..b4ba76eab --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementDirection.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/EngagementEngagementType.java b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementEngagementType.java new file mode 100644 index 000000000..cfea092ba --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementEngagementType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EngagementEngagementType.Deserializer.class) +public final class EngagementEngagementType { + private final Object value; + + private final int type; + + private EngagementEngagementType(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((EngagementType) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EngagementEngagementType && equalTo((EngagementEngagementType) other); + } + + private boolean equalTo(EngagementEngagementType other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EngagementEngagementType of(String value) { + return new EngagementEngagementType(value, 0); + } + + public static EngagementEngagementType of(EngagementType value) { + return new EngagementEngagementType(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(EngagementType value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EngagementEngagementType.class); + } + + @Override + public EngagementEngagementType 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, EngagementType.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementOwner.java b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementOwner.java new file mode 100644 index 000000000..f5aa007d6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementOwner.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EngagementOwner.Deserializer.class) +public final class EngagementOwner { + private final Object value; + + private final int type; + + private EngagementOwner(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((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EngagementOwner && equalTo((EngagementOwner) other); + } + + private boolean equalTo(EngagementOwner other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EngagementOwner of(String value) { + return new EngagementOwner(value, 0); + } + + public static EngagementOwner of(User value) { + return new EngagementOwner(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EngagementOwner.class); + } + + @Override + public EngagementOwner 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, User.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementRequest.java new file mode 100644 index 000000000..8c8428a27 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementRequest.java @@ -0,0 +1,407 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EngagementRequest.Builder.class) +public final class EngagementRequest { + private final Optional owner; + + private final Optional content; + + private final Optional subject; + + private final Optional direction; + + private final Optional engagementType; + + private final Optional startTime; + + private final Optional endTime; + + private final Optional account; + + private final Optional>> contacts; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private EngagementRequest( + Optional owner, + Optional content, + Optional subject, + Optional direction, + Optional engagementType, + Optional startTime, + Optional endTime, + Optional account, + Optional>> contacts, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.owner = owner; + this.content = content; + this.subject = subject; + this.direction = direction; + this.engagementType = engagementType; + this.startTime = startTime; + this.endTime = endTime; + this.account = account; + this.contacts = contacts; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The engagement's owner. + */ + @JsonProperty("owner") + public Optional getOwner() { + return owner; + } + + /** + * @return The engagement's content. + */ + @JsonProperty("content") + public Optional getContent() { + return content; + } + + /** + * @return The engagement's subject. + */ + @JsonProperty("subject") + public Optional getSubject() { + return subject; + } + + /** + * @return The engagement's direction. + *
    + *
  • INBOUND - INBOUND
  • + *
  • OUTBOUND - OUTBOUND
  • + *
+ */ + @JsonProperty("direction") + public Optional getDirection() { + return direction; + } + + /** + * @return The engagement type of the engagement. + */ + @JsonProperty("engagement_type") + public Optional getEngagementType() { + return engagementType; + } + + /** + * @return The time at which the engagement started. + */ + @JsonProperty("start_time") + public Optional getStartTime() { + return startTime; + } + + /** + * @return The time at which the engagement ended. + */ + @JsonProperty("end_time") + public Optional getEndTime() { + return endTime; + } + + /** + * @return The account of the engagement. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + @JsonProperty("contacts") + public Optional>> getContacts() { + return contacts; + } + + @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EngagementRequest && equalTo((EngagementRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EngagementRequest other) { + return owner.equals(other.owner) + && content.equals(other.content) + && subject.equals(other.subject) + && direction.equals(other.direction) + && engagementType.equals(other.engagementType) + && startTime.equals(other.startTime) + && endTime.equals(other.endTime) + && account.equals(other.account) + && contacts.equals(other.contacts) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.owner, + this.content, + this.subject, + this.direction, + this.engagementType, + this.startTime, + this.endTime, + this.account, + this.contacts, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @Override + 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 content = Optional.empty(); + + private Optional subject = Optional.empty(); + + private Optional direction = Optional.empty(); + + private Optional engagementType = Optional.empty(); + + private Optional startTime = Optional.empty(); + + private Optional endTime = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional>> contacts = 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(EngagementRequest other) { + owner(other.getOwner()); + content(other.getContent()); + subject(other.getSubject()); + direction(other.getDirection()); + engagementType(other.getEngagementType()); + startTime(other.getStartTime()); + endTime(other.getEndTime()); + account(other.getAccount()); + contacts(other.getContacts()); + 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(EngagementRequestOwner owner) { + this.owner = Optional.ofNullable(owner); + return this; + } + + @JsonSetter(value = "content", nulls = Nulls.SKIP) + public Builder content(Optional content) { + this.content = content; + return this; + } + + public Builder content(String content) { + this.content = Optional.ofNullable(content); + return this; + } + + @JsonSetter(value = "subject", nulls = Nulls.SKIP) + public Builder subject(Optional subject) { + this.subject = subject; + return this; + } + + public Builder subject(String subject) { + this.subject = Optional.ofNullable(subject); + return this; + } + + @JsonSetter(value = "direction", nulls = Nulls.SKIP) + public Builder direction(Optional direction) { + this.direction = direction; + return this; + } + + public Builder direction(EngagementRequestDirection direction) { + this.direction = Optional.ofNullable(direction); + return this; + } + + @JsonSetter(value = "engagement_type", nulls = Nulls.SKIP) + public Builder engagementType(Optional engagementType) { + this.engagementType = engagementType; + return this; + } + + public Builder engagementType(EngagementRequestEngagementType engagementType) { + this.engagementType = Optional.ofNullable(engagementType); + return this; + } + + @JsonSetter(value = "start_time", nulls = Nulls.SKIP) + public Builder startTime(Optional startTime) { + this.startTime = startTime; + return this; + } + + public Builder startTime(OffsetDateTime startTime) { + this.startTime = Optional.ofNullable(startTime); + return this; + } + + @JsonSetter(value = "end_time", nulls = Nulls.SKIP) + public Builder endTime(Optional endTime) { + this.endTime = endTime; + return this; + } + + public Builder endTime(OffsetDateTime endTime) { + this.endTime = Optional.ofNullable(endTime); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(EngagementRequestAccount account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "contacts", nulls = Nulls.SKIP) + public Builder contacts(Optional>> contacts) { + this.contacts = contacts; + return this; + } + + public Builder contacts(List> contacts) { + this.contacts = Optional.ofNullable(contacts); + 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 EngagementRequest build() { + return new EngagementRequest( + owner, + content, + subject, + direction, + engagementType, + startTime, + endTime, + account, + contacts, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementRequestAccount.java b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementRequestAccount.java new file mode 100644 index 000000000..1124a80dc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementRequestAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EngagementRequestAccount.Deserializer.class) +public final class EngagementRequestAccount { + private final Object value; + + private final int type; + + private EngagementRequestAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EngagementRequestAccount && equalTo((EngagementRequestAccount) other); + } + + private boolean equalTo(EngagementRequestAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EngagementRequestAccount of(String value) { + return new EngagementRequestAccount(value, 0); + } + + public static EngagementRequestAccount of(Account value) { + return new EngagementRequestAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EngagementRequestAccount.class); + } + + @Override + public EngagementRequestAccount 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/legacy/api/resources/crm/types/EngagementRequestContactsItem.java b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementRequestContactsItem.java new file mode 100644 index 000000000..6690d395d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementRequestContactsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EngagementRequestContactsItem.Deserializer.class) +public final class EngagementRequestContactsItem { + private final Object value; + + private final int type; + + private EngagementRequestContactsItem(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EngagementRequestContactsItem && equalTo((EngagementRequestContactsItem) other); + } + + private boolean equalTo(EngagementRequestContactsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EngagementRequestContactsItem of(String value) { + return new EngagementRequestContactsItem(value, 0); + } + + public static EngagementRequestContactsItem of(Contact value) { + return new EngagementRequestContactsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EngagementRequestContactsItem.class); + } + + @Override + public EngagementRequestContactsItem 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementRequestDirection.java b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementRequestDirection.java new file mode 100644 index 000000000..928936a94 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementRequestDirection.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/EngagementRequestEngagementType.java b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementRequestEngagementType.java new file mode 100644 index 000000000..cc1e63c2f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementRequestEngagementType.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EngagementRequestEngagementType.Deserializer.class) +public final class EngagementRequestEngagementType { + private final Object value; + + private final int type; + + private EngagementRequestEngagementType(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((EngagementType) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EngagementRequestEngagementType && equalTo((EngagementRequestEngagementType) other); + } + + private boolean equalTo(EngagementRequestEngagementType other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EngagementRequestEngagementType of(String value) { + return new EngagementRequestEngagementType(value, 0); + } + + public static EngagementRequestEngagementType of(EngagementType value) { + return new EngagementRequestEngagementType(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(EngagementType value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EngagementRequestEngagementType.class); + } + + @Override + public EngagementRequestEngagementType 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, EngagementType.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementRequestOwner.java b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementRequestOwner.java new file mode 100644 index 000000000..7da3f55d3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementRequestOwner.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EngagementRequestOwner.Deserializer.class) +public final class EngagementRequestOwner { + private final Object value; + + private final int type; + + private EngagementRequestOwner(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((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EngagementRequestOwner && equalTo((EngagementRequestOwner) other); + } + + private boolean equalTo(EngagementRequestOwner other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EngagementRequestOwner of(String value) { + return new EngagementRequestOwner(value, 0); + } + + public static EngagementRequestOwner of(User value) { + return new EngagementRequestOwner(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EngagementRequestOwner.class); + } + + @Override + public EngagementRequestOwner 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, User.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementResponse.java b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementResponse.java new file mode 100644 index 000000000..5896c9087 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EngagementResponse.Builder.class) +public final class EngagementResponse { + private final Engagement model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private EngagementResponse( + Engagement 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 Engagement getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EngagementResponse && equalTo((EngagementResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EngagementResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull Engagement model); + + Builder from(EngagementResponse other); + } + + public interface _FinalStage { + EngagementResponse 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 Engagement model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(EngagementResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull Engagement model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public EngagementResponse build() { + return new EngagementResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementType.java b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementType.java new file mode 100644 index 000000000..67fb02cef --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementType.java @@ -0,0 +1,261 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EngagementType.Builder.class) +public final class EngagementType { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional activityType; + + private final Optional name; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private EngagementType( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional activityType, + Optional name, + Optional> remoteFields, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.activityType = activityType; + this.name = name; + 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 engagement type's activity type. + *
    + *
  • CALL - CALL
  • + *
  • MEETING - MEETING
  • + *
  • EMAIL - EMAIL
  • + *
+ */ + @JsonProperty("activity_type") + public Optional getActivityType() { + return activityType; + } + + /** + * @return The engagement type's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EngagementType && equalTo((EngagementType) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EngagementType other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && activityType.equals(other.activityType) + && name.equals(other.name) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.activityType, + this.name, + this.remoteFields); + } + + @Override + 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 activityType = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EngagementType other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + activityType(other.getActivityType()); + name(other.getName()); + 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 = "activity_type", nulls = Nulls.SKIP) + public Builder activityType(Optional activityType) { + this.activityType = activityType; + return this; + } + + public Builder activityType(EngagementTypeActivityType activityType) { + this.activityType = Optional.ofNullable(activityType); + 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_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 EngagementType build() { + return new EngagementType( + id, remoteId, createdAt, modifiedAt, activityType, name, remoteFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementTypeActivityType.java b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementTypeActivityType.java new file mode 100644 index 000000000..e7bc60234 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/EngagementTypeActivityType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/ErrorValidationProblem.java b/src/main/java/com/merge/legacy/api/resources/crm/types/ErrorValidationProblem.java new file mode 100644 index 000000000..4eeea0298 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/ErrorValidationProblem.java @@ -0,0 +1,178 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.source, this.title, this.detail, this.problemType); + } + + @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() {} + + @Override + public Builder from(ErrorValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + return this; + } + + @Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @Override + public ErrorValidationProblem build() { + return new ErrorValidationProblem(source, title, detail, problemType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/EventTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/EventTypeEnum.java new file mode 100644 index 000000000..89c925f89 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/EventTypeEnum.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/legacy/api/resources/crm/types/ExternalTargetFieldApi.java new file mode 100644 index 000000000..621e08553 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/ExternalTargetFieldApi.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isMapped); + } + + @Override + 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/legacy/api/resources/crm/types/ExternalTargetFieldApiResponse.java b/src/main/java/com/merge/legacy/api/resources/crm/types/ExternalTargetFieldApiResponse.java new file mode 100644 index 000000000..bd53e83a7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/ExternalTargetFieldApiResponse.java @@ -0,0 +1,290 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/crm/types/FieldFormatEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/FieldFormatEnum.java new file mode 100644 index 000000000..324a47a76 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/FieldFormatEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/FieldMappingApiInstance.java b/src/main/java/com/merge/legacy/api/resources/crm/types/FieldMappingApiInstance.java new file mode 100644 index 000000000..33c892d13 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/FieldMappingApiInstance.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField); + } + + @Override + 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/legacy/api/resources/crm/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/legacy/api/resources/crm/types/FieldMappingApiInstanceRemoteField.java new file mode 100644 index 000000000..6ae7a7cfd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/FieldMappingApiInstanceRemoteField.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.remoteKeyName, this.schema, this.remoteEndpointInfo); + } + + @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() {} + + @Override + public Builder from(FieldMappingApiInstanceRemoteField other) { + remoteKeyName(other.getRemoteKeyName()); + schema(other.getSchema()); + remoteEndpointInfo(other.getRemoteEndpointInfo()); + return this; + } + + @Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo( + @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @Override + public _FinalStage schema(Map schema) { + this.schema = Optional.ofNullable(schema); + return this; + } + + @Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Optional> schema) { + this.schema = schema; + return this; + } + + @Override + public _FinalStage remoteKeyName(String remoteKeyName) { + this.remoteKeyName = Optional.ofNullable(remoteKeyName); + return this; + } + + @Override + @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) + public _FinalStage remoteKeyName(Optional remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @Override + public FieldMappingApiInstanceRemoteField build() { + return new FieldMappingApiInstanceRemoteField( + remoteKeyName, schema, remoteEndpointInfo, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/legacy/api/resources/crm/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java new file mode 100644 index 000000000..6501b05e3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java @@ -0,0 +1,138 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @Override + 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/legacy/api/resources/crm/types/FieldMappingApiInstanceResponse.java b/src/main/java/com/merge/legacy/api/resources/crm/types/FieldMappingApiInstanceResponse.java new file mode 100644 index 000000000..719641407 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/FieldMappingApiInstanceResponse.java @@ -0,0 +1,290 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/crm/types/FieldMappingApiInstanceTargetField.java b/src/main/java/com/merge/legacy/api/resources/crm/types/FieldMappingApiInstanceTargetField.java new file mode 100644 index 000000000..d878c26cd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/FieldMappingApiInstanceTargetField.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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; + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isOrganizationWide); + } + + @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() {} + + @Override + public Builder from(FieldMappingApiInstanceTargetField other) { + name(other.getName()); + description(other.getDescription()); + isOrganizationWide(other.getIsOrganizationWide()); + return this; + } + + @Override + @JsonSetter("name") + public DescriptionStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + @JsonSetter("description") + public IsOrganizationWideStage description(@NotNull String description) { + this.description = description; + return this; + } + + @Override + @JsonSetter("is_organization_wide") + public _FinalStage isOrganizationWide(boolean isOrganizationWide) { + this.isOrganizationWide = isOrganizationWide; + return this; + } + + @Override + public FieldMappingApiInstanceTargetField build() { + return new FieldMappingApiInstanceTargetField(name, description, isOrganizationWide, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/FieldMappingInstanceResponse.java b/src/main/java/com/merge/legacy/api/resources/crm/types/FieldMappingInstanceResponse.java new file mode 100644 index 000000000..37bcc5bce --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/FieldMappingInstanceResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @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() {} + + @Override + public Builder from(FieldMappingInstanceResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull FieldMappingApiInstance model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public FieldMappingInstanceResponse build() { + return new FieldMappingInstanceResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/FieldPermissionDeserializer.java b/src/main/java/com/merge/legacy/api/resources/crm/types/FieldPermissionDeserializer.java new file mode 100644 index 000000000..91f3b00a7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/FieldPermissionDeserializer.java @@ -0,0 +1,112 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @Override + 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/legacy/api/resources/crm/types/FieldPermissionDeserializerRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/FieldPermissionDeserializerRequest.java new file mode 100644 index 000000000..b11b42b24 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/FieldPermissionDeserializerRequest.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @Override + 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/legacy/api/resources/crm/types/FieldTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/FieldTypeEnum.java new file mode 100644 index 000000000..ebb3295f0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/FieldTypeEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/IgnoreCommonModelRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/IgnoreCommonModelRequest.java new file mode 100644 index 000000000..62eec6070 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/IgnoreCommonModelRequest.java @@ -0,0 +1,127 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.reason, this.message); + } + + @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() {} + + @Override + public Builder from(IgnoreCommonModelRequest other) { + reason(other.getReason()); + message(other.getMessage()); + return this; + } + + @Override + @JsonSetter("reason") + public _FinalStage reason(@NotNull ReasonEnum reason) { + this.reason = reason; + return this; + } + + @Override + public _FinalStage message(String message) { + this.message = Optional.ofNullable(message); + return this; + } + + @Override + @JsonSetter(value = "message", nulls = Nulls.SKIP) + public _FinalStage message(Optional message) { + this.message = message; + return this; + } + + @Override + public IgnoreCommonModelRequest build() { + return new IgnoreCommonModelRequest(reason, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/IndividualCommonModelScopeDeserializer.java b/src/main/java/com/merge/legacy/api/resources/crm/types/IndividualCommonModelScopeDeserializer.java new file mode 100644 index 000000000..d93d9105c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/IndividualCommonModelScopeDeserializer.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @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() {} + + @Override + public Builder from(IndividualCommonModelScopeDeserializer other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @Override + public _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions(Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @Override + public IndividualCommonModelScopeDeserializer build() { + return new IndividualCommonModelScopeDeserializer( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/IndividualCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/IndividualCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..fa77bda2b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/IndividualCommonModelScopeDeserializerRequest.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @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() {} + + @Override + public Builder from(IndividualCommonModelScopeDeserializerRequest other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @Override + public _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions( + Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @Override + public IndividualCommonModelScopeDeserializerRequest build() { + return new IndividualCommonModelScopeDeserializerRequest( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/Issue.java b/src/main/java/com/merge/legacy/api/resources/crm/types/Issue.java new file mode 100644 index 000000000..e897ea4c7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/Issue.java @@ -0,0 +1,341 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.status, + this.errorDescription, + this.endUser, + this.firstIncidentTime, + this.lastIncidentTime, + this.isMuted, + this.errorDetails); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("error_description") + public _FinalStage errorDescription(@NotNull String errorDescription) { + this.errorDescription = errorDescription; + return this; + } + + @Override + public _FinalStage errorDetails(List errorDetails) { + this.errorDetails = Optional.ofNullable(errorDetails); + return this; + } + + @Override + @JsonSetter(value = "error_details", nulls = Nulls.SKIP) + public _FinalStage errorDetails(Optional> errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + @Override + public _FinalStage isMuted(Boolean isMuted) { + this.isMuted = Optional.ofNullable(isMuted); + return this; + } + + @Override + @JsonSetter(value = "is_muted", nulls = Nulls.SKIP) + public _FinalStage isMuted(Optional isMuted) { + this.isMuted = isMuted; + return this; + } + + @Override + public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { + this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); + return this; + } + + @Override + @JsonSetter(value = "last_incident_time", nulls = Nulls.SKIP) + public _FinalStage lastIncidentTime(Optional lastIncidentTime) { + this.lastIncidentTime = lastIncidentTime; + return this; + } + + @Override + public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { + this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); + return this; + } + + @Override + @JsonSetter(value = "first_incident_time", nulls = Nulls.SKIP) + public _FinalStage firstIncidentTime(Optional firstIncidentTime) { + this.firstIncidentTime = firstIncidentTime; + return this; + } + + @Override + public _FinalStage endUser(Map endUser) { + this.endUser = Optional.ofNullable(endUser); + return this; + } + + @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. + */ + @Override + public _FinalStage status(IssueStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @Override + public Issue build() { + return new Issue( + id, + status, + errorDescription, + endUser, + firstIncidentTime, + lastIncidentTime, + isMuted, + errorDetails, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/IssueStatus.java b/src/main/java/com/merge/legacy/api/resources/crm/types/IssueStatus.java new file mode 100644 index 000000000..4e61820a0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/IssueStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/IssueStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/IssueStatusEnum.java new file mode 100644 index 000000000..549db1e6c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/IssueStatusEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/ItemFormatEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/ItemFormatEnum.java new file mode 100644 index 000000000..1fda8a2da --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/ItemFormatEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/ItemSchema.java b/src/main/java/com/merge/legacy/api/resources/crm/types/ItemSchema.java new file mode 100644 index 000000000..45c4f2ba1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/ItemSchema.java @@ -0,0 +1,136 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.itemType, this.itemFormat, this.itemChoices); + } + + @Override + 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/legacy/api/resources/crm/types/ItemTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/ItemTypeEnum.java new file mode 100644 index 000000000..4e2a7993e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/ItemTypeEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/LanguageEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/LanguageEnum.java new file mode 100644 index 000000000..90c36a7fb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/LanguageEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/Lead.java b/src/main/java/com/merge/legacy/api/resources/crm/types/Lead.java new file mode 100644 index 000000000..8e64260ef --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/Lead.java @@ -0,0 +1,684 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Lead.Builder.class) +public final class Lead { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional owner; + + private final Optional leadSource; + + private final Optional title; + + private final Optional company; + + private final Optional firstName; + + private final Optional lastName; + + private final Optional> addresses; + + private final Optional> emailAddresses; + + private final Optional> phoneNumbers; + + private final Optional remoteUpdatedAt; + + private final Optional remoteCreatedAt; + + private final Optional convertedDate; + + private final Optional convertedContact; + + private final Optional convertedAccount; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private Lead( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional owner, + Optional leadSource, + Optional title, + Optional company, + Optional firstName, + Optional lastName, + Optional> addresses, + Optional> emailAddresses, + Optional> phoneNumbers, + Optional remoteUpdatedAt, + Optional remoteCreatedAt, + Optional convertedDate, + Optional convertedContact, + Optional convertedAccount, + 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.leadSource = leadSource; + this.title = title; + this.company = company; + this.firstName = firstName; + this.lastName = lastName; + this.addresses = addresses; + this.emailAddresses = emailAddresses; + this.phoneNumbers = phoneNumbers; + this.remoteUpdatedAt = remoteUpdatedAt; + this.remoteCreatedAt = remoteCreatedAt; + this.convertedDate = convertedDate; + this.convertedContact = convertedContact; + this.convertedAccount = convertedAccount; + 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 lead's owner. + */ + @JsonProperty("owner") + public Optional getOwner() { + return owner; + } + + /** + * @return The lead's source. + */ + @JsonProperty("lead_source") + public Optional getLeadSource() { + return leadSource; + } + + /** + * @return The lead's title. + */ + @JsonProperty("title") + public Optional getTitle() { + return title; + } + + /** + * @return The lead's company. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The lead's first name. + */ + @JsonProperty("first_name") + public Optional getFirstName() { + return firstName; + } + + /** + * @return The lead's last name. + */ + @JsonProperty("last_name") + public Optional getLastName() { + return lastName; + } + + @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 third party's lead was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @return When the third party's lead was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the lead was converted. + */ + @JsonProperty("converted_date") + public Optional getConvertedDate() { + return convertedDate; + } + + /** + * @return The contact of the converted lead. + */ + @JsonProperty("converted_contact") + public Optional getConvertedContact() { + return convertedContact; + } + + /** + * @return The account of the converted lead. + */ + @JsonProperty("converted_account") + public Optional getConvertedAccount() { + return convertedAccount; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Lead && equalTo((Lead) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Lead other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && owner.equals(other.owner) + && leadSource.equals(other.leadSource) + && title.equals(other.title) + && company.equals(other.company) + && firstName.equals(other.firstName) + && lastName.equals(other.lastName) + && addresses.equals(other.addresses) + && emailAddresses.equals(other.emailAddresses) + && phoneNumbers.equals(other.phoneNumbers) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && convertedDate.equals(other.convertedDate) + && convertedContact.equals(other.convertedContact) + && convertedAccount.equals(other.convertedAccount) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.owner, + this.leadSource, + this.title, + this.company, + this.firstName, + this.lastName, + this.addresses, + this.emailAddresses, + this.phoneNumbers, + this.remoteUpdatedAt, + this.remoteCreatedAt, + this.convertedDate, + this.convertedContact, + this.convertedAccount, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData, + this.remoteFields); + } + + @Override + 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 leadSource = Optional.empty(); + + private Optional title = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional firstName = Optional.empty(); + + private Optional lastName = Optional.empty(); + + private Optional> addresses = Optional.empty(); + + private Optional> emailAddresses = Optional.empty(); + + private Optional> phoneNumbers = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional convertedDate = Optional.empty(); + + private Optional convertedContact = Optional.empty(); + + private Optional convertedAccount = 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(Lead other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + owner(other.getOwner()); + leadSource(other.getLeadSource()); + title(other.getTitle()); + company(other.getCompany()); + firstName(other.getFirstName()); + lastName(other.getLastName()); + addresses(other.getAddresses()); + emailAddresses(other.getEmailAddresses()); + phoneNumbers(other.getPhoneNumbers()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + remoteCreatedAt(other.getRemoteCreatedAt()); + convertedDate(other.getConvertedDate()); + convertedContact(other.getConvertedContact()); + convertedAccount(other.getConvertedAccount()); + 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(LeadOwner owner) { + this.owner = Optional.ofNullable(owner); + return this; + } + + @JsonSetter(value = "lead_source", nulls = Nulls.SKIP) + public Builder leadSource(Optional leadSource) { + this.leadSource = leadSource; + return this; + } + + public Builder leadSource(String leadSource) { + this.leadSource = Optional.ofNullable(leadSource); + return this; + } + + @JsonSetter(value = "title", nulls = Nulls.SKIP) + public Builder title(Optional title) { + this.title = title; + return this; + } + + public Builder title(String title) { + this.title = Optional.ofNullable(title); + 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 = "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 = "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 = "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 = "converted_date", nulls = Nulls.SKIP) + public Builder convertedDate(Optional convertedDate) { + this.convertedDate = convertedDate; + return this; + } + + public Builder convertedDate(OffsetDateTime convertedDate) { + this.convertedDate = Optional.ofNullable(convertedDate); + return this; + } + + @JsonSetter(value = "converted_contact", nulls = Nulls.SKIP) + public Builder convertedContact(Optional convertedContact) { + this.convertedContact = convertedContact; + return this; + } + + public Builder convertedContact(LeadConvertedContact convertedContact) { + this.convertedContact = Optional.ofNullable(convertedContact); + return this; + } + + @JsonSetter(value = "converted_account", nulls = Nulls.SKIP) + public Builder convertedAccount(Optional convertedAccount) { + this.convertedAccount = convertedAccount; + return this; + } + + public Builder convertedAccount(LeadConvertedAccount convertedAccount) { + this.convertedAccount = Optional.ofNullable(convertedAccount); + 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 Lead build() { + return new Lead( + id, + remoteId, + createdAt, + modifiedAt, + owner, + leadSource, + title, + company, + firstName, + lastName, + addresses, + emailAddresses, + phoneNumbers, + remoteUpdatedAt, + remoteCreatedAt, + convertedDate, + convertedContact, + convertedAccount, + remoteWasDeleted, + fieldMappings, + remoteData, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/LeadConvertedAccount.java b/src/main/java/com/merge/legacy/api/resources/crm/types/LeadConvertedAccount.java new file mode 100644 index 000000000..371de5bd9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/LeadConvertedAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = LeadConvertedAccount.Deserializer.class) +public final class LeadConvertedAccount { + private final Object value; + + private final int type; + + private LeadConvertedAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LeadConvertedAccount && equalTo((LeadConvertedAccount) other); + } + + private boolean equalTo(LeadConvertedAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static LeadConvertedAccount of(String value) { + return new LeadConvertedAccount(value, 0); + } + + public static LeadConvertedAccount of(Account value) { + return new LeadConvertedAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(LeadConvertedAccount.class); + } + + @Override + public LeadConvertedAccount 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/legacy/api/resources/crm/types/LeadConvertedContact.java b/src/main/java/com/merge/legacy/api/resources/crm/types/LeadConvertedContact.java new file mode 100644 index 000000000..99ee26bef --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/LeadConvertedContact.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = LeadConvertedContact.Deserializer.class) +public final class LeadConvertedContact { + private final Object value; + + private final int type; + + private LeadConvertedContact(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LeadConvertedContact && equalTo((LeadConvertedContact) other); + } + + private boolean equalTo(LeadConvertedContact other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static LeadConvertedContact of(String value) { + return new LeadConvertedContact(value, 0); + } + + public static LeadConvertedContact of(Contact value) { + return new LeadConvertedContact(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(LeadConvertedContact.class); + } + + @Override + public LeadConvertedContact 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/LeadOwner.java b/src/main/java/com/merge/legacy/api/resources/crm/types/LeadOwner.java new file mode 100644 index 000000000..e4a72e39b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/LeadOwner.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = LeadOwner.Deserializer.class) +public final class LeadOwner { + private final Object value; + + private final int type; + + private LeadOwner(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((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LeadOwner && equalTo((LeadOwner) other); + } + + private boolean equalTo(LeadOwner other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static LeadOwner of(String value) { + return new LeadOwner(value, 0); + } + + public static LeadOwner of(User value) { + return new LeadOwner(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(LeadOwner.class); + } + + @Override + public LeadOwner 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, User.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/LeadRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/LeadRequest.java new file mode 100644 index 000000000..cf8ce4337 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/LeadRequest.java @@ -0,0 +1,484 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LeadRequest.Builder.class) +public final class LeadRequest { + private final Optional owner; + + private final Optional leadSource; + + private final Optional title; + + private final Optional company; + + private final Optional firstName; + + private final Optional lastName; + + private final Optional> addresses; + + private final Optional> emailAddresses; + + private final Optional> phoneNumbers; + + private final Optional convertedDate; + + private final Optional convertedContact; + + private final Optional convertedAccount; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private LeadRequest( + Optional owner, + Optional leadSource, + Optional title, + Optional company, + Optional firstName, + Optional lastName, + Optional> addresses, + Optional> emailAddresses, + Optional> phoneNumbers, + Optional convertedDate, + Optional convertedContact, + Optional convertedAccount, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.owner = owner; + this.leadSource = leadSource; + this.title = title; + this.company = company; + this.firstName = firstName; + this.lastName = lastName; + this.addresses = addresses; + this.emailAddresses = emailAddresses; + this.phoneNumbers = phoneNumbers; + this.convertedDate = convertedDate; + this.convertedContact = convertedContact; + this.convertedAccount = convertedAccount; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The lead's owner. + */ + @JsonProperty("owner") + public Optional getOwner() { + return owner; + } + + /** + * @return The lead's source. + */ + @JsonProperty("lead_source") + public Optional getLeadSource() { + return leadSource; + } + + /** + * @return The lead's title. + */ + @JsonProperty("title") + public Optional getTitle() { + return title; + } + + /** + * @return The lead's company. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The lead's first name. + */ + @JsonProperty("first_name") + public Optional getFirstName() { + return firstName; + } + + /** + * @return The lead's last name. + */ + @JsonProperty("last_name") + public Optional getLastName() { + return lastName; + } + + @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 lead was converted. + */ + @JsonProperty("converted_date") + public Optional getConvertedDate() { + return convertedDate; + } + + /** + * @return The contact of the converted lead. + */ + @JsonProperty("converted_contact") + public Optional getConvertedContact() { + return convertedContact; + } + + /** + * @return The account of the converted lead. + */ + @JsonProperty("converted_account") + public Optional getConvertedAccount() { + return convertedAccount; + } + + @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LeadRequest && equalTo((LeadRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LeadRequest other) { + return owner.equals(other.owner) + && leadSource.equals(other.leadSource) + && title.equals(other.title) + && company.equals(other.company) + && firstName.equals(other.firstName) + && lastName.equals(other.lastName) + && addresses.equals(other.addresses) + && emailAddresses.equals(other.emailAddresses) + && phoneNumbers.equals(other.phoneNumbers) + && convertedDate.equals(other.convertedDate) + && convertedContact.equals(other.convertedContact) + && convertedAccount.equals(other.convertedAccount) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.owner, + this.leadSource, + this.title, + this.company, + this.firstName, + this.lastName, + this.addresses, + this.emailAddresses, + this.phoneNumbers, + this.convertedDate, + this.convertedContact, + this.convertedAccount, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @Override + 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 leadSource = Optional.empty(); + + private Optional title = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional firstName = Optional.empty(); + + private Optional lastName = Optional.empty(); + + private Optional> addresses = Optional.empty(); + + private Optional> emailAddresses = Optional.empty(); + + private Optional> phoneNumbers = Optional.empty(); + + private Optional convertedDate = Optional.empty(); + + private Optional convertedContact = Optional.empty(); + + private Optional convertedAccount = 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(LeadRequest other) { + owner(other.getOwner()); + leadSource(other.getLeadSource()); + title(other.getTitle()); + company(other.getCompany()); + firstName(other.getFirstName()); + lastName(other.getLastName()); + addresses(other.getAddresses()); + emailAddresses(other.getEmailAddresses()); + phoneNumbers(other.getPhoneNumbers()); + convertedDate(other.getConvertedDate()); + convertedContact(other.getConvertedContact()); + convertedAccount(other.getConvertedAccount()); + 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(LeadRequestOwner owner) { + this.owner = Optional.ofNullable(owner); + return this; + } + + @JsonSetter(value = "lead_source", nulls = Nulls.SKIP) + public Builder leadSource(Optional leadSource) { + this.leadSource = leadSource; + return this; + } + + public Builder leadSource(String leadSource) { + this.leadSource = Optional.ofNullable(leadSource); + return this; + } + + @JsonSetter(value = "title", nulls = Nulls.SKIP) + public Builder title(Optional title) { + this.title = title; + return this; + } + + public Builder title(String title) { + this.title = Optional.ofNullable(title); + 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 = "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 = "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 = "converted_date", nulls = Nulls.SKIP) + public Builder convertedDate(Optional convertedDate) { + this.convertedDate = convertedDate; + return this; + } + + public Builder convertedDate(OffsetDateTime convertedDate) { + this.convertedDate = Optional.ofNullable(convertedDate); + return this; + } + + @JsonSetter(value = "converted_contact", nulls = Nulls.SKIP) + public Builder convertedContact(Optional convertedContact) { + this.convertedContact = convertedContact; + return this; + } + + public Builder convertedContact(LeadRequestConvertedContact convertedContact) { + this.convertedContact = Optional.ofNullable(convertedContact); + return this; + } + + @JsonSetter(value = "converted_account", nulls = Nulls.SKIP) + public Builder convertedAccount(Optional convertedAccount) { + this.convertedAccount = convertedAccount; + return this; + } + + public Builder convertedAccount(LeadRequestConvertedAccount convertedAccount) { + this.convertedAccount = Optional.ofNullable(convertedAccount); + 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 LeadRequest build() { + return new LeadRequest( + owner, + leadSource, + title, + company, + firstName, + lastName, + addresses, + emailAddresses, + phoneNumbers, + convertedDate, + convertedContact, + convertedAccount, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/LeadRequestConvertedAccount.java b/src/main/java/com/merge/legacy/api/resources/crm/types/LeadRequestConvertedAccount.java new file mode 100644 index 000000000..572eececd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/LeadRequestConvertedAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = LeadRequestConvertedAccount.Deserializer.class) +public final class LeadRequestConvertedAccount { + private final Object value; + + private final int type; + + private LeadRequestConvertedAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LeadRequestConvertedAccount && equalTo((LeadRequestConvertedAccount) other); + } + + private boolean equalTo(LeadRequestConvertedAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static LeadRequestConvertedAccount of(String value) { + return new LeadRequestConvertedAccount(value, 0); + } + + public static LeadRequestConvertedAccount of(Account value) { + return new LeadRequestConvertedAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(LeadRequestConvertedAccount.class); + } + + @Override + public LeadRequestConvertedAccount 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/legacy/api/resources/crm/types/LeadRequestConvertedContact.java b/src/main/java/com/merge/legacy/api/resources/crm/types/LeadRequestConvertedContact.java new file mode 100644 index 000000000..42999022f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/LeadRequestConvertedContact.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = LeadRequestConvertedContact.Deserializer.class) +public final class LeadRequestConvertedContact { + private final Object value; + + private final int type; + + private LeadRequestConvertedContact(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LeadRequestConvertedContact && equalTo((LeadRequestConvertedContact) other); + } + + private boolean equalTo(LeadRequestConvertedContact other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static LeadRequestConvertedContact of(String value) { + return new LeadRequestConvertedContact(value, 0); + } + + public static LeadRequestConvertedContact of(Contact value) { + return new LeadRequestConvertedContact(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(LeadRequestConvertedContact.class); + } + + @Override + public LeadRequestConvertedContact 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/LeadRequestOwner.java b/src/main/java/com/merge/legacy/api/resources/crm/types/LeadRequestOwner.java new file mode 100644 index 000000000..1d378c9ea --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/LeadRequestOwner.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = LeadRequestOwner.Deserializer.class) +public final class LeadRequestOwner { + private final Object value; + + private final int type; + + private LeadRequestOwner(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((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LeadRequestOwner && equalTo((LeadRequestOwner) other); + } + + private boolean equalTo(LeadRequestOwner other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static LeadRequestOwner of(String value) { + return new LeadRequestOwner(value, 0); + } + + public static LeadRequestOwner of(User value) { + return new LeadRequestOwner(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(LeadRequestOwner.class); + } + + @Override + public LeadRequestOwner 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, User.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/LeadResponse.java b/src/main/java/com/merge/legacy/api/resources/crm/types/LeadResponse.java new file mode 100644 index 000000000..f885ca5bc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/LeadResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LeadResponse.Builder.class) +public final class LeadResponse { + private final Lead model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private LeadResponse( + Lead 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 Lead getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LeadResponse && equalTo((LeadResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LeadResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull Lead model); + + Builder from(LeadResponse other); + } + + public interface _FinalStage { + LeadResponse 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 Lead model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(LeadResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull Lead model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public LeadResponse build() { + return new LeadResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/LinkToken.java b/src/main/java/com/merge/legacy/api/resources/crm/types/LinkToken.java new file mode 100644 index 000000000..18fea2781 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/LinkToken.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.linkToken, this.integrationName, this.magicLinkUrl); + } + + @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() {} + + @Override + public Builder from(LinkToken other) { + linkToken(other.getLinkToken()); + integrationName(other.getIntegrationName()); + magicLinkUrl(other.getMagicLinkUrl()); + return this; + } + + @Override + @JsonSetter("link_token") + public _FinalStage linkToken(@NotNull String linkToken) { + this.linkToken = linkToken; + return this; + } + + @Override + public _FinalStage magicLinkUrl(String magicLinkUrl) { + this.magicLinkUrl = Optional.ofNullable(magicLinkUrl); + return this; + } + + @Override + @JsonSetter(value = "magic_link_url", nulls = Nulls.SKIP) + public _FinalStage magicLinkUrl(Optional magicLinkUrl) { + this.magicLinkUrl = magicLinkUrl; + return this; + } + + @Override + public _FinalStage integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @Override + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public _FinalStage integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + @Override + public LinkToken build() { + return new LinkToken(linkToken, integrationName, magicLinkUrl, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/LinkedAccountStatus.java b/src/main/java/com/merge/legacy/api/resources/crm/types/LinkedAccountStatus.java new file mode 100644 index 000000000..ebd0b5460 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/LinkedAccountStatus.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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; + } + + @Override + public int hashCode() { + return Objects.hash(this.linkedAccountStatus, this.canMakeRequest); + } + + @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() {} + + @Override + public Builder from(LinkedAccountStatus other) { + linkedAccountStatus(other.getLinkedAccountStatus()); + canMakeRequest(other.getCanMakeRequest()); + return this; + } + + @Override + @JsonSetter("linked_account_status") + public CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus) { + this.linkedAccountStatus = linkedAccountStatus; + return this; + } + + @Override + @JsonSetter("can_make_request") + public _FinalStage canMakeRequest(boolean canMakeRequest) { + this.canMakeRequest = canMakeRequest; + return this; + } + + @Override + public LinkedAccountStatus build() { + return new LinkedAccountStatus(linkedAccountStatus, canMakeRequest, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/MetaResponse.java b/src/main/java/com/merge/legacy/api/resources/crm/types/MetaResponse.java new file mode 100644 index 000000000..77b7506e3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/MetaResponse.java @@ -0,0 +1,232 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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; + } + + @Override + public int hashCode() { + return Objects.hash( + this.requestSchema, + this.remoteFieldClasses, + this.status, + this.hasConditionalParams, + this.hasRequiredLinkedAccountParams); + } + + @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() {} + + @Override + public Builder from(MetaResponse other) { + requestSchema(other.getRequestSchema()); + remoteFieldClasses(other.getRemoteFieldClasses()); + status(other.getStatus()); + hasConditionalParams(other.getHasConditionalParams()); + hasRequiredLinkedAccountParams(other.getHasRequiredLinkedAccountParams()); + return this; + } + + @Override + @JsonSetter("has_conditional_params") + public HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams) { + this.hasConditionalParams = hasConditionalParams; + return this; + } + + @Override + @JsonSetter("has_required_linked_account_params") + public _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams) { + this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; + return this; + } + + @Override + public _FinalStage status(LinkedAccountStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @Override + public _FinalStage remoteFieldClasses(Map remoteFieldClasses) { + this.remoteFieldClasses = Optional.ofNullable(remoteFieldClasses); + return this; + } + + @Override + @JsonSetter(value = "remote_field_classes", nulls = Nulls.SKIP) + public _FinalStage remoteFieldClasses(Optional> remoteFieldClasses) { + this.remoteFieldClasses = remoteFieldClasses; + return this; + } + + @Override + public _FinalStage requestSchema(String key, JsonNode value) { + this.requestSchema.put(key, value); + return this; + } + + @Override + public _FinalStage putAllRequestSchema(Map requestSchema) { + this.requestSchema.putAll(requestSchema); + return this; + } + + @Override + @JsonSetter(value = "request_schema", nulls = Nulls.SKIP) + public _FinalStage requestSchema(Map requestSchema) { + this.requestSchema.clear(); + this.requestSchema.putAll(requestSchema); + return this; + } + + @Override + public MetaResponse build() { + return new MetaResponse( + requestSchema, + remoteFieldClasses, + status, + hasConditionalParams, + hasRequiredLinkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/MethodEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/MethodEnum.java new file mode 100644 index 000000000..12f664435 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/MethodEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/ModelOperation.java b/src/main/java/com/merge/legacy/api/resources/crm/types/ModelOperation.java new file mode 100644 index 000000000..ff2b0518b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/ModelOperation.java @@ -0,0 +1,216 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.modelName, this.availableOperations, this.requiredPostParameters, this.supportedFields); + } + + @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() {} + + @Override + public Builder from(ModelOperation other) { + modelName(other.getModelName()); + availableOperations(other.getAvailableOperations()); + requiredPostParameters(other.getRequiredPostParameters()); + supportedFields(other.getSupportedFields()); + return this; + } + + @Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @Override + public _FinalStage addAllSupportedFields(List supportedFields) { + this.supportedFields.addAll(supportedFields); + return this; + } + + @Override + public _FinalStage addSupportedFields(String supportedFields) { + this.supportedFields.add(supportedFields); + return this; + } + + @Override + @JsonSetter(value = "supported_fields", nulls = Nulls.SKIP) + public _FinalStage supportedFields(List supportedFields) { + this.supportedFields.clear(); + this.supportedFields.addAll(supportedFields); + return this; + } + + @Override + public _FinalStage addAllRequiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.addAll(requiredPostParameters); + return this; + } + + @Override + public _FinalStage addRequiredPostParameters(String requiredPostParameters) { + this.requiredPostParameters.add(requiredPostParameters); + return this; + } + + @Override + @JsonSetter(value = "required_post_parameters", nulls = Nulls.SKIP) + public _FinalStage requiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.clear(); + this.requiredPostParameters.addAll(requiredPostParameters); + return this; + } + + @Override + public _FinalStage addAllAvailableOperations(List availableOperations) { + this.availableOperations.addAll(availableOperations); + return this; + } + + @Override + public _FinalStage addAvailableOperations(String availableOperations) { + this.availableOperations.add(availableOperations); + return this; + } + + @Override + @JsonSetter(value = "available_operations", nulls = Nulls.SKIP) + public _FinalStage availableOperations(List availableOperations) { + this.availableOperations.clear(); + this.availableOperations.addAll(availableOperations); + return this; + } + + @Override + public ModelOperation build() { + return new ModelOperation( + modelName, availableOperations, requiredPostParameters, supportedFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/ModelPermissionDeserializer.java b/src/main/java/com/merge/legacy/api/resources/crm/types/ModelPermissionDeserializer.java new file mode 100644 index 000000000..c6aeeefe9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/ModelPermissionDeserializer.java @@ -0,0 +1,89 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @Override + 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/legacy/api/resources/crm/types/ModelPermissionDeserializerRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/ModelPermissionDeserializerRequest.java new file mode 100644 index 000000000..c1d11a8f4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/ModelPermissionDeserializerRequest.java @@ -0,0 +1,90 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @Override + 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/legacy/api/resources/crm/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/MultipartFormFieldRequest.java new file mode 100644 index 000000000..23c9e1884 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/MultipartFormFieldRequest.java @@ -0,0 +1,259 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.data, this.encoding, this.fileName, this.contentType); + } + + @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() {} + + @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. + */ + @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. + */ + @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. + */ + @Override + public _FinalStage contentType(String contentType) { + this.contentType = Optional.ofNullable(contentType); + return this; + } + + @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. + */ + @Override + public _FinalStage fileName(String fileName) { + this.fileName = Optional.ofNullable(fileName); + return this; + } + + @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. + */ + @Override + public _FinalStage encoding(MultipartFormFieldRequestEncoding encoding) { + this.encoding = Optional.ofNullable(encoding); + return this; + } + + @Override + @JsonSetter(value = "encoding", nulls = Nulls.SKIP) + public _FinalStage encoding(Optional encoding) { + this.encoding = encoding; + return this; + } + + @Override + public MultipartFormFieldRequest build() { + return new MultipartFormFieldRequest(name, data, encoding, fileName, contentType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/MultipartFormFieldRequestEncoding.java b/src/main/java/com/merge/legacy/api/resources/crm/types/MultipartFormFieldRequestEncoding.java new file mode 100644 index 000000000..920606435 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/MultipartFormFieldRequestEncoding.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/Note.java b/src/main/java/com/merge/legacy/api/resources/crm/types/Note.java new file mode 100644 index 000000000..f3d999991 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/Note.java @@ -0,0 +1,490 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Note.Builder.class) +public final class Note { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional owner; + + private final Optional content; + + private final Optional contact; + + private final Optional account; + + private final Optional opportunity; + + 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 Note( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional owner, + Optional content, + Optional contact, + Optional account, + Optional opportunity, + 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.content = content; + this.contact = contact; + this.account = account; + this.opportunity = opportunity; + 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 note's owner. + */ + @JsonProperty("owner") + public Optional getOwner() { + return owner; + } + + /** + * @return The note's content. + */ + @JsonProperty("content") + public Optional getContent() { + return content; + } + + /** + * @return The note's contact. + */ + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + + /** + * @return The note's account. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The note's opportunity. + */ + @JsonProperty("opportunity") + public Optional getOpportunity() { + return opportunity; + } + + /** + * @return When the third party's lead was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @return When the third party's lead 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Note && equalTo((Note) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Note other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && owner.equals(other.owner) + && content.equals(other.content) + && contact.equals(other.contact) + && account.equals(other.account) + && opportunity.equals(other.opportunity) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.owner, + this.content, + this.contact, + this.account, + this.opportunity, + this.remoteUpdatedAt, + this.remoteCreatedAt, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData, + this.remoteFields); + } + + @Override + 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 content = Optional.empty(); + + private Optional contact = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional opportunity = 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(Note other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + owner(other.getOwner()); + content(other.getContent()); + contact(other.getContact()); + account(other.getAccount()); + opportunity(other.getOpportunity()); + 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(NoteOwner owner) { + this.owner = Optional.ofNullable(owner); + return this; + } + + @JsonSetter(value = "content", nulls = Nulls.SKIP) + public Builder content(Optional content) { + this.content = content; + return this; + } + + public Builder content(String content) { + this.content = Optional.ofNullable(content); + return this; + } + + @JsonSetter(value = "contact", nulls = Nulls.SKIP) + public Builder contact(Optional contact) { + this.contact = contact; + return this; + } + + public Builder contact(NoteContact contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(NoteAccount account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "opportunity", nulls = Nulls.SKIP) + public Builder opportunity(Optional opportunity) { + this.opportunity = opportunity; + return this; + } + + public Builder opportunity(NoteOpportunity opportunity) { + this.opportunity = Optional.ofNullable(opportunity); + 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 Note build() { + return new Note( + id, + remoteId, + createdAt, + modifiedAt, + owner, + content, + contact, + account, + opportunity, + remoteUpdatedAt, + remoteCreatedAt, + remoteWasDeleted, + fieldMappings, + remoteData, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/NoteAccount.java b/src/main/java/com/merge/legacy/api/resources/crm/types/NoteAccount.java new file mode 100644 index 000000000..e40cd4e81 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/NoteAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = NoteAccount.Deserializer.class) +public final class NoteAccount { + private final Object value; + + private final int type; + + private NoteAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NoteAccount && equalTo((NoteAccount) other); + } + + private boolean equalTo(NoteAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static NoteAccount of(String value) { + return new NoteAccount(value, 0); + } + + public static NoteAccount of(Account value) { + return new NoteAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(NoteAccount.class); + } + + @Override + public NoteAccount 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/legacy/api/resources/crm/types/NoteContact.java b/src/main/java/com/merge/legacy/api/resources/crm/types/NoteContact.java new file mode 100644 index 000000000..9ae102a39 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/NoteContact.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = NoteContact.Deserializer.class) +public final class NoteContact { + private final Object value; + + private final int type; + + private NoteContact(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NoteContact && equalTo((NoteContact) other); + } + + private boolean equalTo(NoteContact other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static NoteContact of(String value) { + return new NoteContact(value, 0); + } + + public static NoteContact of(Contact value) { + return new NoteContact(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(NoteContact.class); + } + + @Override + public NoteContact 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/NoteOpportunity.java b/src/main/java/com/merge/legacy/api/resources/crm/types/NoteOpportunity.java new file mode 100644 index 000000000..cb6212826 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/NoteOpportunity.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = NoteOpportunity.Deserializer.class) +public final class NoteOpportunity { + private final Object value; + + private final int type; + + private NoteOpportunity(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((Opportunity) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NoteOpportunity && equalTo((NoteOpportunity) other); + } + + private boolean equalTo(NoteOpportunity other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static NoteOpportunity of(String value) { + return new NoteOpportunity(value, 0); + } + + public static NoteOpportunity of(Opportunity value) { + return new NoteOpportunity(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Opportunity value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(NoteOpportunity.class); + } + + @Override + public NoteOpportunity 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, Opportunity.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/NoteOwner.java b/src/main/java/com/merge/legacy/api/resources/crm/types/NoteOwner.java new file mode 100644 index 000000000..304738e8e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/NoteOwner.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = NoteOwner.Deserializer.class) +public final class NoteOwner { + private final Object value; + + private final int type; + + private NoteOwner(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((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NoteOwner && equalTo((NoteOwner) other); + } + + private boolean equalTo(NoteOwner other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static NoteOwner of(String value) { + return new NoteOwner(value, 0); + } + + public static NoteOwner of(User value) { + return new NoteOwner(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(NoteOwner.class); + } + + @Override + public NoteOwner 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, User.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/NoteRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/NoteRequest.java new file mode 100644 index 000000000..c14a84328 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/NoteRequest.java @@ -0,0 +1,289 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = NoteRequest.Builder.class) +public final class NoteRequest { + private final Optional owner; + + private final Optional content; + + private final Optional contact; + + private final Optional account; + + private final Optional opportunity; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private NoteRequest( + Optional owner, + Optional content, + Optional contact, + Optional account, + Optional opportunity, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.owner = owner; + this.content = content; + this.contact = contact; + this.account = account; + this.opportunity = opportunity; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The note's owner. + */ + @JsonProperty("owner") + public Optional getOwner() { + return owner; + } + + /** + * @return The note's content. + */ + @JsonProperty("content") + public Optional getContent() { + return content; + } + + /** + * @return The note's contact. + */ + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + + /** + * @return The note's account. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The note's opportunity. + */ + @JsonProperty("opportunity") + public Optional getOpportunity() { + return opportunity; + } + + @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NoteRequest && equalTo((NoteRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(NoteRequest other) { + return owner.equals(other.owner) + && content.equals(other.content) + && contact.equals(other.contact) + && account.equals(other.account) + && opportunity.equals(other.opportunity) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.owner, + this.content, + this.contact, + this.account, + this.opportunity, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @Override + 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 content = Optional.empty(); + + private Optional contact = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional opportunity = 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(NoteRequest other) { + owner(other.getOwner()); + content(other.getContent()); + contact(other.getContact()); + account(other.getAccount()); + opportunity(other.getOpportunity()); + 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(NoteRequestOwner owner) { + this.owner = Optional.ofNullable(owner); + return this; + } + + @JsonSetter(value = "content", nulls = Nulls.SKIP) + public Builder content(Optional content) { + this.content = content; + return this; + } + + public Builder content(String content) { + this.content = Optional.ofNullable(content); + return this; + } + + @JsonSetter(value = "contact", nulls = Nulls.SKIP) + public Builder contact(Optional contact) { + this.contact = contact; + return this; + } + + public Builder contact(NoteRequestContact contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(NoteRequestAccount account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "opportunity", nulls = Nulls.SKIP) + public Builder opportunity(Optional opportunity) { + this.opportunity = opportunity; + return this; + } + + public Builder opportunity(NoteRequestOpportunity opportunity) { + this.opportunity = Optional.ofNullable(opportunity); + 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 NoteRequest build() { + return new NoteRequest( + owner, + content, + contact, + account, + opportunity, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/NoteRequestAccount.java b/src/main/java/com/merge/legacy/api/resources/crm/types/NoteRequestAccount.java new file mode 100644 index 000000000..20aa947b7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/NoteRequestAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = NoteRequestAccount.Deserializer.class) +public final class NoteRequestAccount { + private final Object value; + + private final int type; + + private NoteRequestAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NoteRequestAccount && equalTo((NoteRequestAccount) other); + } + + private boolean equalTo(NoteRequestAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static NoteRequestAccount of(String value) { + return new NoteRequestAccount(value, 0); + } + + public static NoteRequestAccount of(Account value) { + return new NoteRequestAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(NoteRequestAccount.class); + } + + @Override + public NoteRequestAccount 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/legacy/api/resources/crm/types/NoteRequestContact.java b/src/main/java/com/merge/legacy/api/resources/crm/types/NoteRequestContact.java new file mode 100644 index 000000000..759e815bf --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/NoteRequestContact.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = NoteRequestContact.Deserializer.class) +public final class NoteRequestContact { + private final Object value; + + private final int type; + + private NoteRequestContact(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NoteRequestContact && equalTo((NoteRequestContact) other); + } + + private boolean equalTo(NoteRequestContact other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static NoteRequestContact of(String value) { + return new NoteRequestContact(value, 0); + } + + public static NoteRequestContact of(Contact value) { + return new NoteRequestContact(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(NoteRequestContact.class); + } + + @Override + public NoteRequestContact 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/NoteRequestOpportunity.java b/src/main/java/com/merge/legacy/api/resources/crm/types/NoteRequestOpportunity.java new file mode 100644 index 000000000..87aad1097 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/NoteRequestOpportunity.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = NoteRequestOpportunity.Deserializer.class) +public final class NoteRequestOpportunity { + private final Object value; + + private final int type; + + private NoteRequestOpportunity(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((Opportunity) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NoteRequestOpportunity && equalTo((NoteRequestOpportunity) other); + } + + private boolean equalTo(NoteRequestOpportunity other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static NoteRequestOpportunity of(String value) { + return new NoteRequestOpportunity(value, 0); + } + + public static NoteRequestOpportunity of(Opportunity value) { + return new NoteRequestOpportunity(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Opportunity value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(NoteRequestOpportunity.class); + } + + @Override + public NoteRequestOpportunity 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, Opportunity.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/NoteRequestOwner.java b/src/main/java/com/merge/legacy/api/resources/crm/types/NoteRequestOwner.java new file mode 100644 index 000000000..125853310 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/NoteRequestOwner.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = NoteRequestOwner.Deserializer.class) +public final class NoteRequestOwner { + private final Object value; + + private final int type; + + private NoteRequestOwner(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((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NoteRequestOwner && equalTo((NoteRequestOwner) other); + } + + private boolean equalTo(NoteRequestOwner other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static NoteRequestOwner of(String value) { + return new NoteRequestOwner(value, 0); + } + + public static NoteRequestOwner of(User value) { + return new NoteRequestOwner(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(NoteRequestOwner.class); + } + + @Override + public NoteRequestOwner 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, User.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/NoteResponse.java b/src/main/java/com/merge/legacy/api/resources/crm/types/NoteResponse.java new file mode 100644 index 000000000..745dfee48 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/NoteResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = NoteResponse.Builder.class) +public final class NoteResponse { + private final Note model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private NoteResponse( + Note 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 Note getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NoteResponse && equalTo((NoteResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(NoteResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull Note model); + + Builder from(NoteResponse other); + } + + public interface _FinalStage { + NoteResponse 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 Note model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(NoteResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull Note model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public NoteResponse build() { + return new NoteResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/ObjectClassDescriptionRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/ObjectClassDescriptionRequest.java new file mode 100644 index 000000000..4deee76f0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/ObjectClassDescriptionRequest.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = ObjectClassDescriptionRequest.Builder.class) +public final class ObjectClassDescriptionRequest { + private final String id; + + private final OriginTypeEnum originType; + + private final Map additionalProperties; + + private ObjectClassDescriptionRequest( + String id, OriginTypeEnum originType, Map additionalProperties) { + this.id = id; + this.originType = originType; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("origin_type") + public OriginTypeEnum getOriginType() { + return originType; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ObjectClassDescriptionRequest && equalTo((ObjectClassDescriptionRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ObjectClassDescriptionRequest other) { + return id.equals(other.id) && originType.equals(other.originType); + } + + @Override + public int hashCode() { + return Objects.hash(this.id, this.originType); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + OriginTypeStage id(@NotNull String id); + + Builder from(ObjectClassDescriptionRequest other); + } + + public interface OriginTypeStage { + _FinalStage originType(@NotNull OriginTypeEnum originType); + } + + public interface _FinalStage { + ObjectClassDescriptionRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, OriginTypeStage, _FinalStage { + private String id; + + private OriginTypeEnum originType; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(ObjectClassDescriptionRequest other) { + id(other.getId()); + originType(other.getOriginType()); + return this; + } + + @Override + @JsonSetter("id") + public OriginTypeStage id(@NotNull String id) { + this.id = id; + return this; + } + + @Override + @JsonSetter("origin_type") + public _FinalStage originType(@NotNull OriginTypeEnum originType) { + this.originType = originType; + return this; + } + + @Override + public ObjectClassDescriptionRequest build() { + return new ObjectClassDescriptionRequest(id, originType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/Opportunity.java b/src/main/java/com/merge/legacy/api/resources/crm/types/Opportunity.java new file mode 100644 index 000000000..3b17b8a3e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/Opportunity.java @@ -0,0 +1,582 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Opportunity.Builder.class) +public final class Opportunity { + 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 amount; + + private final Optional owner; + + private final Optional account; + + private final Optional stage; + + private final Optional status; + + private final Optional lastActivityAt; + + private final Optional closeDate; + + 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 Opportunity( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional description, + Optional amount, + Optional owner, + Optional account, + Optional stage, + Optional status, + Optional lastActivityAt, + Optional closeDate, + 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.name = name; + this.description = description; + this.amount = amount; + this.owner = owner; + this.account = account; + this.stage = stage; + this.status = status; + this.lastActivityAt = lastActivityAt; + this.closeDate = closeDate; + 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 opportunity's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The opportunity's description. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The opportunity's amount. + */ + @JsonProperty("amount") + public Optional getAmount() { + return amount; + } + + /** + * @return The opportunity's owner. + */ + @JsonProperty("owner") + public Optional getOwner() { + return owner; + } + + /** + * @return The account of the opportunity. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The stage of the opportunity. + */ + @JsonProperty("stage") + public Optional getStage() { + return stage; + } + + /** + * @return The opportunity's status. + *
    + *
  • OPEN - OPEN
  • + *
  • WON - WON
  • + *
  • LOST - LOST
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return When the opportunity's last activity occurred. + */ + @JsonProperty("last_activity_at") + public Optional getLastActivityAt() { + return lastActivityAt; + } + + /** + * @return When the opportunity was closed. + */ + @JsonProperty("close_date") + public Optional getCloseDate() { + return closeDate; + } + + /** + * @return When the third party's opportunity 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Opportunity && equalTo((Opportunity) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Opportunity 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) + && amount.equals(other.amount) + && owner.equals(other.owner) + && account.equals(other.account) + && stage.equals(other.stage) + && status.equals(other.status) + && lastActivityAt.equals(other.lastActivityAt) + && closeDate.equals(other.closeDate) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.description, + this.amount, + this.owner, + this.account, + this.stage, + this.status, + this.lastActivityAt, + this.closeDate, + this.remoteCreatedAt, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData, + this.remoteFields); + } + + @Override + 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 amount = Optional.empty(); + + private Optional owner = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional stage = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional lastActivityAt = Optional.empty(); + + private Optional closeDate = 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(Opportunity other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + description(other.getDescription()); + amount(other.getAmount()); + owner(other.getOwner()); + account(other.getAccount()); + stage(other.getStage()); + status(other.getStatus()); + lastActivityAt(other.getLastActivityAt()); + closeDate(other.getCloseDate()); + 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 = "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 = "amount", nulls = Nulls.SKIP) + public Builder amount(Optional amount) { + this.amount = amount; + return this; + } + + public Builder amount(Integer amount) { + this.amount = Optional.ofNullable(amount); + return this; + } + + @JsonSetter(value = "owner", nulls = Nulls.SKIP) + public Builder owner(Optional owner) { + this.owner = owner; + return this; + } + + public Builder owner(OpportunityOwner owner) { + this.owner = Optional.ofNullable(owner); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(OpportunityAccount account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "stage", nulls = Nulls.SKIP) + public Builder stage(Optional stage) { + this.stage = stage; + return this; + } + + public Builder stage(OpportunityStage stage) { + this.stage = Optional.ofNullable(stage); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(OpportunityStatus status) { + this.status = Optional.ofNullable(status); + 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 = "close_date", nulls = Nulls.SKIP) + public Builder closeDate(Optional closeDate) { + this.closeDate = closeDate; + return this; + } + + public Builder closeDate(OffsetDateTime closeDate) { + this.closeDate = Optional.ofNullable(closeDate); + 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 Opportunity build() { + return new Opportunity( + id, + remoteId, + createdAt, + modifiedAt, + name, + description, + amount, + owner, + account, + stage, + status, + lastActivityAt, + closeDate, + remoteCreatedAt, + remoteWasDeleted, + fieldMappings, + remoteData, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityAccount.java b/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityAccount.java new file mode 100644 index 000000000..8e3edaaf9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = OpportunityAccount.Deserializer.class) +public final class OpportunityAccount { + private final Object value; + + private final int type; + + private OpportunityAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OpportunityAccount && equalTo((OpportunityAccount) other); + } + + private boolean equalTo(OpportunityAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static OpportunityAccount of(String value) { + return new OpportunityAccount(value, 0); + } + + public static OpportunityAccount of(Account value) { + return new OpportunityAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(OpportunityAccount.class); + } + + @Override + public OpportunityAccount 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/legacy/api/resources/crm/types/OpportunityOwner.java b/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityOwner.java new file mode 100644 index 000000000..f6213e766 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityOwner.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = OpportunityOwner.Deserializer.class) +public final class OpportunityOwner { + private final Object value; + + private final int type; + + private OpportunityOwner(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((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OpportunityOwner && equalTo((OpportunityOwner) other); + } + + private boolean equalTo(OpportunityOwner other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static OpportunityOwner of(String value) { + return new OpportunityOwner(value, 0); + } + + public static OpportunityOwner of(User value) { + return new OpportunityOwner(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(OpportunityOwner.class); + } + + @Override + public OpportunityOwner 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, User.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityRequest.java new file mode 100644 index 000000000..ee9fb4e2d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityRequest.java @@ -0,0 +1,411 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = OpportunityRequest.Builder.class) +public final class OpportunityRequest { + private final Optional name; + + private final Optional description; + + private final Optional amount; + + private final Optional owner; + + private final Optional account; + + private final Optional stage; + + private final Optional status; + + private final Optional lastActivityAt; + + private final Optional closeDate; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private OpportunityRequest( + Optional name, + Optional description, + Optional amount, + Optional owner, + Optional account, + Optional stage, + Optional status, + Optional lastActivityAt, + Optional closeDate, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.name = name; + this.description = description; + this.amount = amount; + this.owner = owner; + this.account = account; + this.stage = stage; + this.status = status; + this.lastActivityAt = lastActivityAt; + this.closeDate = closeDate; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The opportunity's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The opportunity's description. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The opportunity's amount. + */ + @JsonProperty("amount") + public Optional getAmount() { + return amount; + } + + /** + * @return The opportunity's owner. + */ + @JsonProperty("owner") + public Optional getOwner() { + return owner; + } + + /** + * @return The account of the opportunity. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The stage of the opportunity. + */ + @JsonProperty("stage") + public Optional getStage() { + return stage; + } + + /** + * @return The opportunity's status. + *
    + *
  • OPEN - OPEN
  • + *
  • WON - WON
  • + *
  • LOST - LOST
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return When the opportunity's last activity occurred. + */ + @JsonProperty("last_activity_at") + public Optional getLastActivityAt() { + return lastActivityAt; + } + + /** + * @return When the opportunity was closed. + */ + @JsonProperty("close_date") + public Optional getCloseDate() { + return closeDate; + } + + @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OpportunityRequest && equalTo((OpportunityRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OpportunityRequest other) { + return name.equals(other.name) + && description.equals(other.description) + && amount.equals(other.amount) + && owner.equals(other.owner) + && account.equals(other.account) + && stage.equals(other.stage) + && status.equals(other.status) + && lastActivityAt.equals(other.lastActivityAt) + && closeDate.equals(other.closeDate) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.description, + this.amount, + this.owner, + this.account, + this.stage, + this.status, + this.lastActivityAt, + this.closeDate, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @Override + 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 amount = Optional.empty(); + + private Optional owner = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional stage = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional lastActivityAt = Optional.empty(); + + private Optional closeDate = 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(OpportunityRequest other) { + name(other.getName()); + description(other.getDescription()); + amount(other.getAmount()); + owner(other.getOwner()); + account(other.getAccount()); + stage(other.getStage()); + status(other.getStatus()); + lastActivityAt(other.getLastActivityAt()); + closeDate(other.getCloseDate()); + 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 = "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 = "amount", nulls = Nulls.SKIP) + public Builder amount(Optional amount) { + this.amount = amount; + return this; + } + + public Builder amount(Integer amount) { + this.amount = Optional.ofNullable(amount); + return this; + } + + @JsonSetter(value = "owner", nulls = Nulls.SKIP) + public Builder owner(Optional owner) { + this.owner = owner; + return this; + } + + public Builder owner(OpportunityRequestOwner owner) { + this.owner = Optional.ofNullable(owner); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(OpportunityRequestAccount account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "stage", nulls = Nulls.SKIP) + public Builder stage(Optional stage) { + this.stage = stage; + return this; + } + + public Builder stage(OpportunityRequestStage stage) { + this.stage = Optional.ofNullable(stage); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(OpportunityRequestStatus status) { + this.status = Optional.ofNullable(status); + 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 = "close_date", nulls = Nulls.SKIP) + public Builder closeDate(Optional closeDate) { + this.closeDate = closeDate; + return this; + } + + public Builder closeDate(OffsetDateTime closeDate) { + this.closeDate = Optional.ofNullable(closeDate); + 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 OpportunityRequest build() { + return new OpportunityRequest( + name, + description, + amount, + owner, + account, + stage, + status, + lastActivityAt, + closeDate, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityRequestAccount.java b/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityRequestAccount.java new file mode 100644 index 000000000..46b9a6a8e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityRequestAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = OpportunityRequestAccount.Deserializer.class) +public final class OpportunityRequestAccount { + private final Object value; + + private final int type; + + private OpportunityRequestAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OpportunityRequestAccount && equalTo((OpportunityRequestAccount) other); + } + + private boolean equalTo(OpportunityRequestAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static OpportunityRequestAccount of(String value) { + return new OpportunityRequestAccount(value, 0); + } + + public static OpportunityRequestAccount of(Account value) { + return new OpportunityRequestAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(OpportunityRequestAccount.class); + } + + @Override + public OpportunityRequestAccount 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/legacy/api/resources/crm/types/OpportunityRequestOwner.java b/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityRequestOwner.java new file mode 100644 index 000000000..2575a1741 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityRequestOwner.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = OpportunityRequestOwner.Deserializer.class) +public final class OpportunityRequestOwner { + private final Object value; + + private final int type; + + private OpportunityRequestOwner(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((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OpportunityRequestOwner && equalTo((OpportunityRequestOwner) other); + } + + private boolean equalTo(OpportunityRequestOwner other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static OpportunityRequestOwner of(String value) { + return new OpportunityRequestOwner(value, 0); + } + + public static OpportunityRequestOwner of(User value) { + return new OpportunityRequestOwner(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(OpportunityRequestOwner.class); + } + + @Override + public OpportunityRequestOwner 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, User.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityRequestStage.java b/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityRequestStage.java new file mode 100644 index 000000000..35745427c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityRequestStage.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = OpportunityRequestStage.Deserializer.class) +public final class OpportunityRequestStage { + private final Object value; + + private final int type; + + private OpportunityRequestStage(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((Stage) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OpportunityRequestStage && equalTo((OpportunityRequestStage) other); + } + + private boolean equalTo(OpportunityRequestStage other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static OpportunityRequestStage of(String value) { + return new OpportunityRequestStage(value, 0); + } + + public static OpportunityRequestStage of(Stage value) { + return new OpportunityRequestStage(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Stage value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(OpportunityRequestStage.class); + } + + @Override + public OpportunityRequestStage 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, Stage.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityRequestStatus.java b/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityRequestStatus.java new file mode 100644 index 000000000..f74fb0234 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityRequestStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/OpportunityResponse.java b/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityResponse.java new file mode 100644 index 000000000..3e7f311b4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = OpportunityResponse.Builder.class) +public final class OpportunityResponse { + private final Opportunity model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private OpportunityResponse( + Opportunity 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 Opportunity getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OpportunityResponse && equalTo((OpportunityResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OpportunityResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull Opportunity model); + + Builder from(OpportunityResponse other); + } + + public interface _FinalStage { + OpportunityResponse 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 Opportunity model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(OpportunityResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull Opportunity model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public OpportunityResponse build() { + return new OpportunityResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityStage.java b/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityStage.java new file mode 100644 index 000000000..121d294d8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityStage.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = OpportunityStage.Deserializer.class) +public final class OpportunityStage { + private final Object value; + + private final int type; + + private OpportunityStage(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((Stage) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OpportunityStage && equalTo((OpportunityStage) other); + } + + private boolean equalTo(OpportunityStage other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static OpportunityStage of(String value) { + return new OpportunityStage(value, 0); + } + + public static OpportunityStage of(Stage value) { + return new OpportunityStage(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Stage value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(OpportunityStage.class); + } + + @Override + public OpportunityStage 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, Stage.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityStatus.java b/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityStatus.java new file mode 100644 index 000000000..c19edca0d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/OpportunityStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityStatusEnum.java new file mode 100644 index 000000000..758221aea --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/OpportunityStatusEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum OpportunityStatusEnum { + OPEN("OPEN"), + + WON("WON"), + + LOST("LOST"); + + private final String value; + + OpportunityStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/OriginTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/OriginTypeEnum.java new file mode 100644 index 000000000..ccf239dfb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/OriginTypeEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum OriginTypeEnum { + CUSTOM_OBJECT("CUSTOM_OBJECT"), + + COMMON_MODEL("COMMON_MODEL"), + + REMOTE_ONLY_MODEL("REMOTE_ONLY_MODEL"); + + private final String value; + + OriginTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedAccountDetailsAndActionsList.java new file mode 100644 index 000000000..6ac2800bf --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedAccountDetailsAndActionsList.java @@ -0,0 +1,135 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/crm/types/PaginatedAccountList.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedAccountList.java new file mode 100644 index 000000000..55716e517 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedAccountList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/crm/types/PaginatedAssociationList.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedAssociationList.java new file mode 100644 index 000000000..38d72cdff --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedAssociationList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAssociationList.Builder.class) +public final class PaginatedAssociationList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAssociationList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAssociationList && equalTo((PaginatedAssociationList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAssociationList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedAssociationList 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 PaginatedAssociationList build() { + return new PaginatedAssociationList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedAssociationTypeList.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedAssociationTypeList.java new file mode 100644 index 000000000..620f34136 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedAssociationTypeList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAssociationTypeList.Builder.class) +public final class PaginatedAssociationTypeList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAssociationTypeList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAssociationTypeList && equalTo((PaginatedAssociationTypeList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAssociationTypeList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedAssociationTypeList 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 PaginatedAssociationTypeList build() { + return new PaginatedAssociationTypeList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedAuditLogEventList.java new file mode 100644 index 000000000..b4dc2eb1f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedAuditLogEventList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/crm/types/PaginatedContactList.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedContactList.java new file mode 100644 index 000000000..541f7b8f4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedContactList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/crm/types/PaginatedCustomObjectClassList.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedCustomObjectClassList.java new file mode 100644 index 000000000..c32b2ebfd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedCustomObjectClassList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedCustomObjectClassList.Builder.class) +public final class PaginatedCustomObjectClassList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedCustomObjectClassList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedCustomObjectClassList && equalTo((PaginatedCustomObjectClassList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedCustomObjectClassList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedCustomObjectClassList 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 PaginatedCustomObjectClassList build() { + return new PaginatedCustomObjectClassList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedCustomObjectList.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedCustomObjectList.java new file mode 100644 index 000000000..5cc53f48a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedCustomObjectList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedCustomObjectList.Builder.class) +public final class PaginatedCustomObjectList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedCustomObjectList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedCustomObjectList && equalTo((PaginatedCustomObjectList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedCustomObjectList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedCustomObjectList 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 PaginatedCustomObjectList build() { + return new PaginatedCustomObjectList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedEngagementList.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedEngagementList.java new file mode 100644 index 000000000..053bf57f7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedEngagementList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedEngagementList.Builder.class) +public final class PaginatedEngagementList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedEngagementList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedEngagementList && equalTo((PaginatedEngagementList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedEngagementList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedEngagementList 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 PaginatedEngagementList build() { + return new PaginatedEngagementList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedEngagementTypeList.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedEngagementTypeList.java new file mode 100644 index 000000000..a756531c9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedEngagementTypeList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedEngagementTypeList.Builder.class) +public final class PaginatedEngagementTypeList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedEngagementTypeList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedEngagementTypeList && equalTo((PaginatedEngagementTypeList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedEngagementTypeList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedEngagementTypeList 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 PaginatedEngagementTypeList build() { + return new PaginatedEngagementTypeList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedIssueList.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedIssueList.java new file mode 100644 index 000000000..671c9d5ca --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedIssueList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/crm/types/PaginatedLeadList.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedLeadList.java new file mode 100644 index 000000000..39a0267ff --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedLeadList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedLeadList.Builder.class) +public final class PaginatedLeadList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedLeadList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedLeadList && equalTo((PaginatedLeadList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedLeadList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedLeadList 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 PaginatedLeadList build() { + return new PaginatedLeadList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedNoteList.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedNoteList.java new file mode 100644 index 000000000..893732c17 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedNoteList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedNoteList.Builder.class) +public final class PaginatedNoteList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedNoteList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedNoteList && equalTo((PaginatedNoteList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedNoteList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedNoteList 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 PaginatedNoteList build() { + return new PaginatedNoteList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedOpportunityList.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedOpportunityList.java new file mode 100644 index 000000000..34076ccfd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedOpportunityList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedOpportunityList.Builder.class) +public final class PaginatedOpportunityList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedOpportunityList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedOpportunityList && equalTo((PaginatedOpportunityList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedOpportunityList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedOpportunityList 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 PaginatedOpportunityList build() { + return new PaginatedOpportunityList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedRemoteFieldClassList.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedRemoteFieldClassList.java new file mode 100644 index 000000000..237ac5ef9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedRemoteFieldClassList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/crm/types/PaginatedStageList.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedStageList.java new file mode 100644 index 000000000..361c6e62a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedStageList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedStageList.Builder.class) +public final class PaginatedStageList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedStageList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedStageList && equalTo((PaginatedStageList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedStageList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedStageList 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 PaginatedStageList build() { + return new PaginatedStageList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedSyncStatusList.java new file mode 100644 index 000000000..4ef9de30b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedSyncStatusList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/crm/types/PaginatedTaskList.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedTaskList.java new file mode 100644 index 000000000..d9fbd2999 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedTaskList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedTaskList.Builder.class) +public final class PaginatedTaskList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedTaskList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedTaskList && equalTo((PaginatedTaskList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedTaskList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedTaskList 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 PaginatedTaskList build() { + return new PaginatedTaskList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedUserList.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedUserList.java new file mode 100644 index 000000000..21f4afbc1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PaginatedUserList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/crm/types/PatchedAccountRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PatchedAccountRequest.java new file mode 100644 index 000000000..a1a59e2b4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PatchedAccountRequest.java @@ -0,0 +1,374 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PatchedAccountRequest.Builder.class) +public final class PatchedAccountRequest { + 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 PatchedAccountRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedAccountRequest && equalTo((PatchedAccountRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedAccountRequest 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); + } + + @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); + } + + @Override + 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(PatchedAccountRequest 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(String 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 PatchedAccountRequest build() { + return new PatchedAccountRequest( + owner, + name, + description, + industry, + website, + numberOfEmployees, + addresses, + lastActivityAt, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/PatchedContactRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PatchedContactRequest.java new file mode 100644 index 000000000..319c2597f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PatchedContactRequest.java @@ -0,0 +1,368 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PatchedContactRequest.Builder.class) +public final class PatchedContactRequest { + 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 PatchedContactRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedContactRequest && equalTo((PatchedContactRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedContactRequest 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); + } + + @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); + } + + @Override + 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(PatchedContactRequest 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(String 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(PatchedContactRequestOwner 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 PatchedContactRequest build() { + return new PatchedContactRequest( + firstName, + lastName, + account, + owner, + addresses, + emailAddresses, + phoneNumbers, + lastActivityAt, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/PatchedContactRequestOwner.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PatchedContactRequestOwner.java new file mode 100644 index 000000000..5df806f84 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PatchedContactRequestOwner.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PatchedContactRequestOwner.Deserializer.class) +public final class PatchedContactRequestOwner { + private final Object value; + + private final int type; + + private PatchedContactRequestOwner(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((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedContactRequestOwner && equalTo((PatchedContactRequestOwner) other); + } + + private boolean equalTo(PatchedContactRequestOwner other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PatchedContactRequestOwner of(String value) { + return new PatchedContactRequestOwner(value, 0); + } + + public static PatchedContactRequestOwner of(User value) { + return new PatchedContactRequestOwner(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PatchedContactRequestOwner.class); + } + + @Override + public PatchedContactRequestOwner 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, User.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/PatchedEngagementRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PatchedEngagementRequest.java new file mode 100644 index 000000000..9185f8b42 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PatchedEngagementRequest.java @@ -0,0 +1,407 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PatchedEngagementRequest.Builder.class) +public final class PatchedEngagementRequest { + private final Optional owner; + + private final Optional content; + + private final Optional subject; + + private final Optional direction; + + private final Optional engagementType; + + private final Optional startTime; + + private final Optional endTime; + + private final Optional account; + + private final Optional>> contacts; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private PatchedEngagementRequest( + Optional owner, + Optional content, + Optional subject, + Optional direction, + Optional engagementType, + Optional startTime, + Optional endTime, + Optional account, + Optional>> contacts, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.owner = owner; + this.content = content; + this.subject = subject; + this.direction = direction; + this.engagementType = engagementType; + this.startTime = startTime; + this.endTime = endTime; + this.account = account; + this.contacts = contacts; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The engagement's owner. + */ + @JsonProperty("owner") + public Optional getOwner() { + return owner; + } + + /** + * @return The engagement's content. + */ + @JsonProperty("content") + public Optional getContent() { + return content; + } + + /** + * @return The engagement's subject. + */ + @JsonProperty("subject") + public Optional getSubject() { + return subject; + } + + /** + * @return The engagement's direction. + *
    + *
  • INBOUND - INBOUND
  • + *
  • OUTBOUND - OUTBOUND
  • + *
+ */ + @JsonProperty("direction") + public Optional getDirection() { + return direction; + } + + /** + * @return The engagement type of the engagement. + */ + @JsonProperty("engagement_type") + public Optional getEngagementType() { + return engagementType; + } + + /** + * @return The time at which the engagement started. + */ + @JsonProperty("start_time") + public Optional getStartTime() { + return startTime; + } + + /** + * @return The time at which the engagement ended. + */ + @JsonProperty("end_time") + public Optional getEndTime() { + return endTime; + } + + /** + * @return The account of the engagement. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + @JsonProperty("contacts") + public Optional>> getContacts() { + return contacts; + } + + @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedEngagementRequest && equalTo((PatchedEngagementRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedEngagementRequest other) { + return owner.equals(other.owner) + && content.equals(other.content) + && subject.equals(other.subject) + && direction.equals(other.direction) + && engagementType.equals(other.engagementType) + && startTime.equals(other.startTime) + && endTime.equals(other.endTime) + && account.equals(other.account) + && contacts.equals(other.contacts) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.owner, + this.content, + this.subject, + this.direction, + this.engagementType, + this.startTime, + this.endTime, + this.account, + this.contacts, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @Override + 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 content = Optional.empty(); + + private Optional subject = Optional.empty(); + + private Optional direction = Optional.empty(); + + private Optional engagementType = Optional.empty(); + + private Optional startTime = Optional.empty(); + + private Optional endTime = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional>> contacts = 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(PatchedEngagementRequest other) { + owner(other.getOwner()); + content(other.getContent()); + subject(other.getSubject()); + direction(other.getDirection()); + engagementType(other.getEngagementType()); + startTime(other.getStartTime()); + endTime(other.getEndTime()); + account(other.getAccount()); + contacts(other.getContacts()); + 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(String owner) { + this.owner = Optional.ofNullable(owner); + return this; + } + + @JsonSetter(value = "content", nulls = Nulls.SKIP) + public Builder content(Optional content) { + this.content = content; + return this; + } + + public Builder content(String content) { + this.content = Optional.ofNullable(content); + return this; + } + + @JsonSetter(value = "subject", nulls = Nulls.SKIP) + public Builder subject(Optional subject) { + this.subject = subject; + return this; + } + + public Builder subject(String subject) { + this.subject = Optional.ofNullable(subject); + return this; + } + + @JsonSetter(value = "direction", nulls = Nulls.SKIP) + public Builder direction(Optional direction) { + this.direction = direction; + return this; + } + + public Builder direction(PatchedEngagementRequestDirection direction) { + this.direction = Optional.ofNullable(direction); + return this; + } + + @JsonSetter(value = "engagement_type", nulls = Nulls.SKIP) + public Builder engagementType(Optional engagementType) { + this.engagementType = engagementType; + return this; + } + + public Builder engagementType(String engagementType) { + this.engagementType = Optional.ofNullable(engagementType); + return this; + } + + @JsonSetter(value = "start_time", nulls = Nulls.SKIP) + public Builder startTime(Optional startTime) { + this.startTime = startTime; + return this; + } + + public Builder startTime(OffsetDateTime startTime) { + this.startTime = Optional.ofNullable(startTime); + return this; + } + + @JsonSetter(value = "end_time", nulls = Nulls.SKIP) + public Builder endTime(Optional endTime) { + this.endTime = endTime; + return this; + } + + public Builder endTime(OffsetDateTime endTime) { + this.endTime = Optional.ofNullable(endTime); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(String account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "contacts", nulls = Nulls.SKIP) + public Builder contacts(Optional>> contacts) { + this.contacts = contacts; + return this; + } + + public Builder contacts(List> contacts) { + this.contacts = Optional.ofNullable(contacts); + 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 PatchedEngagementRequest build() { + return new PatchedEngagementRequest( + owner, + content, + subject, + direction, + engagementType, + startTime, + endTime, + account, + contacts, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/PatchedEngagementRequestDirection.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PatchedEngagementRequestDirection.java new file mode 100644 index 000000000..da5d8a000 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PatchedEngagementRequestDirection.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/PatchedOpportunityRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PatchedOpportunityRequest.java new file mode 100644 index 000000000..216860179 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PatchedOpportunityRequest.java @@ -0,0 +1,411 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PatchedOpportunityRequest.Builder.class) +public final class PatchedOpportunityRequest { + private final Optional name; + + private final Optional description; + + private final Optional amount; + + private final Optional owner; + + private final Optional account; + + private final Optional stage; + + private final Optional status; + + private final Optional lastActivityAt; + + private final Optional closeDate; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private PatchedOpportunityRequest( + Optional name, + Optional description, + Optional amount, + Optional owner, + Optional account, + Optional stage, + Optional status, + Optional lastActivityAt, + Optional closeDate, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.name = name; + this.description = description; + this.amount = amount; + this.owner = owner; + this.account = account; + this.stage = stage; + this.status = status; + this.lastActivityAt = lastActivityAt; + this.closeDate = closeDate; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The opportunity's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The opportunity's description. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The opportunity's amount. + */ + @JsonProperty("amount") + public Optional getAmount() { + return amount; + } + + /** + * @return The opportunity's owner. + */ + @JsonProperty("owner") + public Optional getOwner() { + return owner; + } + + /** + * @return The account of the opportunity. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The stage of the opportunity. + */ + @JsonProperty("stage") + public Optional getStage() { + return stage; + } + + /** + * @return The opportunity's status. + *
    + *
  • OPEN - OPEN
  • + *
  • WON - WON
  • + *
  • LOST - LOST
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return When the opportunity's last activity occurred. + */ + @JsonProperty("last_activity_at") + public Optional getLastActivityAt() { + return lastActivityAt; + } + + /** + * @return When the opportunity was closed. + */ + @JsonProperty("close_date") + public Optional getCloseDate() { + return closeDate; + } + + @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedOpportunityRequest && equalTo((PatchedOpportunityRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedOpportunityRequest other) { + return name.equals(other.name) + && description.equals(other.description) + && amount.equals(other.amount) + && owner.equals(other.owner) + && account.equals(other.account) + && stage.equals(other.stage) + && status.equals(other.status) + && lastActivityAt.equals(other.lastActivityAt) + && closeDate.equals(other.closeDate) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.description, + this.amount, + this.owner, + this.account, + this.stage, + this.status, + this.lastActivityAt, + this.closeDate, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @Override + 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 amount = Optional.empty(); + + private Optional owner = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional stage = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional lastActivityAt = Optional.empty(); + + private Optional closeDate = 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(PatchedOpportunityRequest other) { + name(other.getName()); + description(other.getDescription()); + amount(other.getAmount()); + owner(other.getOwner()); + account(other.getAccount()); + stage(other.getStage()); + status(other.getStatus()); + lastActivityAt(other.getLastActivityAt()); + closeDate(other.getCloseDate()); + 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 = "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 = "amount", nulls = Nulls.SKIP) + public Builder amount(Optional amount) { + this.amount = amount; + return this; + } + + public Builder amount(Integer amount) { + this.amount = Optional.ofNullable(amount); + return this; + } + + @JsonSetter(value = "owner", nulls = Nulls.SKIP) + public Builder owner(Optional owner) { + this.owner = owner; + return this; + } + + public Builder owner(String owner) { + this.owner = Optional.ofNullable(owner); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(String account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "stage", nulls = Nulls.SKIP) + public Builder stage(Optional stage) { + this.stage = stage; + return this; + } + + public Builder stage(String stage) { + this.stage = Optional.ofNullable(stage); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(PatchedOpportunityRequestStatus status) { + this.status = Optional.ofNullable(status); + 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 = "close_date", nulls = Nulls.SKIP) + public Builder closeDate(Optional closeDate) { + this.closeDate = closeDate; + return this; + } + + public Builder closeDate(OffsetDateTime closeDate) { + this.closeDate = Optional.ofNullable(closeDate); + 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 PatchedOpportunityRequest build() { + return new PatchedOpportunityRequest( + name, + description, + amount, + owner, + account, + stage, + status, + lastActivityAt, + closeDate, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/PatchedOpportunityRequestStatus.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PatchedOpportunityRequestStatus.java new file mode 100644 index 000000000..c7a9a4fd0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PatchedOpportunityRequestStatus.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/PatchedTaskRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PatchedTaskRequest.java new file mode 100644 index 000000000..50b08036f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PatchedTaskRequest.java @@ -0,0 +1,381 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PatchedTaskRequest.Builder.class) +public final class PatchedTaskRequest { + private final Optional subject; + + private final Optional content; + + private final Optional owner; + + private final Optional account; + + private final Optional opportunity; + + private final Optional completedDate; + + private final Optional dueDate; + + private final Optional status; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private PatchedTaskRequest( + Optional subject, + Optional content, + Optional owner, + Optional account, + Optional opportunity, + Optional completedDate, + Optional dueDate, + Optional status, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.subject = subject; + this.content = content; + this.owner = owner; + this.account = account; + this.opportunity = opportunity; + this.completedDate = completedDate; + this.dueDate = dueDate; + this.status = status; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The task's subject. + */ + @JsonProperty("subject") + public Optional getSubject() { + return subject; + } + + /** + * @return The task's content. + */ + @JsonProperty("content") + public Optional getContent() { + return content; + } + + /** + * @return The task's owner. + */ + @JsonProperty("owner") + public Optional getOwner() { + return owner; + } + + /** + * @return The task's account. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The task's opportunity. + */ + @JsonProperty("opportunity") + public Optional getOpportunity() { + return opportunity; + } + + /** + * @return When the task is completed. + */ + @JsonProperty("completed_date") + public Optional getCompletedDate() { + return completedDate; + } + + /** + * @return When the task is due. + */ + @JsonProperty("due_date") + public Optional getDueDate() { + return dueDate; + } + + /** + * @return The task's status. + *
    + *
  • OPEN - OPEN
  • + *
  • CLOSED - CLOSED
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedTaskRequest && equalTo((PatchedTaskRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedTaskRequest other) { + return subject.equals(other.subject) + && content.equals(other.content) + && owner.equals(other.owner) + && account.equals(other.account) + && opportunity.equals(other.opportunity) + && completedDate.equals(other.completedDate) + && dueDate.equals(other.dueDate) + && status.equals(other.status) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.subject, + this.content, + this.owner, + this.account, + this.opportunity, + this.completedDate, + this.dueDate, + this.status, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional subject = Optional.empty(); + + private Optional content = Optional.empty(); + + private Optional owner = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional opportunity = Optional.empty(); + + private Optional completedDate = Optional.empty(); + + private Optional dueDate = Optional.empty(); + + private Optional status = 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(PatchedTaskRequest other) { + subject(other.getSubject()); + content(other.getContent()); + owner(other.getOwner()); + account(other.getAccount()); + opportunity(other.getOpportunity()); + completedDate(other.getCompletedDate()); + dueDate(other.getDueDate()); + status(other.getStatus()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + remoteFields(other.getRemoteFields()); + return this; + } + + @JsonSetter(value = "subject", nulls = Nulls.SKIP) + public Builder subject(Optional subject) { + this.subject = subject; + return this; + } + + public Builder subject(String subject) { + this.subject = Optional.ofNullable(subject); + return this; + } + + @JsonSetter(value = "content", nulls = Nulls.SKIP) + public Builder content(Optional content) { + this.content = content; + return this; + } + + public Builder content(String content) { + this.content = Optional.ofNullable(content); + return this; + } + + @JsonSetter(value = "owner", nulls = Nulls.SKIP) + public Builder owner(Optional owner) { + this.owner = owner; + return this; + } + + public Builder owner(String owner) { + this.owner = Optional.ofNullable(owner); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(String account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "opportunity", nulls = Nulls.SKIP) + public Builder opportunity(Optional opportunity) { + this.opportunity = opportunity; + return this; + } + + public Builder opportunity(String opportunity) { + this.opportunity = Optional.ofNullable(opportunity); + return this; + } + + @JsonSetter(value = "completed_date", nulls = Nulls.SKIP) + public Builder completedDate(Optional completedDate) { + this.completedDate = completedDate; + return this; + } + + public Builder completedDate(OffsetDateTime completedDate) { + this.completedDate = Optional.ofNullable(completedDate); + return this; + } + + @JsonSetter(value = "due_date", nulls = Nulls.SKIP) + public Builder dueDate(Optional dueDate) { + this.dueDate = dueDate; + return this; + } + + public Builder dueDate(OffsetDateTime dueDate) { + this.dueDate = Optional.ofNullable(dueDate); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(PatchedTaskRequestStatus status) { + this.status = Optional.ofNullable(status); + 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 PatchedTaskRequest build() { + return new PatchedTaskRequest( + subject, + content, + owner, + account, + opportunity, + completedDate, + dueDate, + status, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/PatchedTaskRequestStatus.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PatchedTaskRequestStatus.java new file mode 100644 index 000000000..7a28f3d51 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PatchedTaskRequestStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/PhoneNumber.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PhoneNumber.java new file mode 100644 index 000000000..a88cba0d0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PhoneNumber.java @@ -0,0 +1,176 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.createdAt, this.modifiedAt, this.phoneNumber, this.phoneNumberType); + } + + @Override + 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/legacy/api/resources/crm/types/PhoneNumberRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/PhoneNumberRequest.java new file mode 100644 index 000000000..0ebacbb1c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/PhoneNumberRequest.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.phoneNumber, this.phoneNumberType, this.integrationParams, this.linkedAccountParams); + } + + @Override + 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/legacy/api/resources/crm/types/ReasonEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/ReasonEnum.java new file mode 100644 index 000000000..5f617ea7c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/ReasonEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteData.java b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteData.java new file mode 100644 index 000000000..f424f8885 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteData.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.path, this.data); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("path") + public _FinalStage path(@NotNull String path) { + this.path = path; + return this; + } + + @Override + public _FinalStage data(JsonNode data) { + this.data = Optional.ofNullable(data); + return this; + } + + @Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(Optional data) { + this.data = data; + return this; + } + + @Override + public RemoteData build() { + return new RemoteData(path, data, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteEndpointInfo.java b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteEndpointInfo.java new file mode 100644 index 000000000..802fd7e3b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteEndpointInfo.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @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() {} + + @Override + public Builder from(RemoteEndpointInfo other) { + method(other.getMethod()); + urlPath(other.getUrlPath()); + fieldTraversalPath(other.getFieldTraversalPath()); + return this; + } + + @Override + @JsonSetter("method") + public UrlPathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @Override + @JsonSetter("url_path") + public _FinalStage urlPath(@NotNull String urlPath) { + this.urlPath = urlPath; + return this; + } + + @Override + public _FinalStage addAllFieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.addAll(fieldTraversalPath); + return this; + } + + @Override + public _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath) { + this.fieldTraversalPath.add(fieldTraversalPath); + return this; + } + + @Override + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) + public _FinalStage fieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.clear(); + this.fieldTraversalPath.addAll(fieldTraversalPath); + return this; + } + + @Override + public RemoteEndpointInfo build() { + return new RemoteEndpointInfo(method, urlPath, fieldTraversalPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteField.java b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteField.java new file mode 100644 index 000000000..1b52cc8f4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteField.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.remoteFieldClass, this.value); + } + + @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() {} + + @Override + public Builder from(RemoteField other) { + remoteFieldClass(other.getRemoteFieldClass()); + value(other.getValue()); + return this; + } + + @Override + @JsonSetter("remote_field_class") + public _FinalStage remoteFieldClass(@NotNull RemoteFieldRemoteFieldClass remoteFieldClass) { + this.remoteFieldClass = remoteFieldClass; + return this; + } + + @Override + public _FinalStage value(JsonNode value) { + this.value = Optional.ofNullable(value); + return this; + } + + @Override + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public _FinalStage value(Optional value) { + this.value = value; + return this; + } + + @Override + public RemoteField build() { + return new RemoteField(remoteFieldClass, value, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldApi.java b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldApi.java new file mode 100644 index 000000000..64c37f8ae --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldApi.java @@ -0,0 +1,264 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.schema, + this.remoteKeyName, + this.remoteEndpointInfo, + this.exampleValues, + this.advancedMetadata, + this.coverage); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("remote_key_name") + public RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @Override + public _FinalStage coverage(RemoteFieldApiCoverage coverage) { + this.coverage = Optional.ofNullable(coverage); + return this; + } + + @Override + @JsonSetter(value = "coverage", nulls = Nulls.SKIP) + public _FinalStage coverage(Optional coverage) { + this.coverage = coverage; + return this; + } + + @Override + public _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata) { + this.advancedMetadata = Optional.ofNullable(advancedMetadata); + return this; + } + + @Override + @JsonSetter(value = "advanced_metadata", nulls = Nulls.SKIP) + public _FinalStage advancedMetadata(Optional advancedMetadata) { + this.advancedMetadata = advancedMetadata; + return this; + } + + @Override + public _FinalStage exampleValues(List exampleValues) { + this.exampleValues = Optional.ofNullable(exampleValues); + return this; + } + + @Override + @JsonSetter(value = "example_values", nulls = Nulls.SKIP) + public _FinalStage exampleValues(Optional> exampleValues) { + this.exampleValues = exampleValues; + return this; + } + + @Override + public _FinalStage schema(String key, JsonNode value) { + this.schema.put(key, value); + return this; + } + + @Override + public _FinalStage putAllSchema(Map schema) { + this.schema.putAll(schema); + return this; + } + + @Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Map schema) { + this.schema.clear(); + this.schema.putAll(schema); + return this; + } + + @Override + public RemoteFieldApi build() { + return new RemoteFieldApi( + schema, + remoteKeyName, + remoteEndpointInfo, + exampleValues, + advancedMetadata, + coverage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldApiCoverage.java b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldApiCoverage.java new file mode 100644 index 000000000..d2493efd2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldApiCoverage.java @@ -0,0 +1,91 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/RemoteFieldApiResponse.java b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldApiResponse.java new file mode 100644 index 000000000..8ee4d755d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldApiResponse.java @@ -0,0 +1,290 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/crm/types/RemoteFieldClass.java b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldClass.java new file mode 100644 index 000000000..b0c39f6f2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldClass.java @@ -0,0 +1,325 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/crm/types/RemoteFieldClassFieldChoicesItem.java b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldClassFieldChoicesItem.java new file mode 100644 index 000000000..c3c88a9f8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldClassFieldChoicesItem.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value, this.displayName); + } + + @Override + 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/legacy/api/resources/crm/types/RemoteFieldClassFieldFormat.java b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldClassFieldFormat.java new file mode 100644 index 000000000..71a663806 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldClassFieldFormat.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/RemoteFieldClassFieldType.java b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldClassFieldType.java new file mode 100644 index 000000000..36a0ce2ef --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldClassFieldType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/RemoteFieldClassForCustomObjectClass.java b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldClassForCustomObjectClass.java new file mode 100644 index 000000000..fdb1b916a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldClassForCustomObjectClass.java @@ -0,0 +1,333 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldClassForCustomObjectClass.Builder.class) +public final class RemoteFieldClassForCustomObjectClass { + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional displayName; + + private final Optional remoteKeyName; + + private final Optional description; + + 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 RemoteFieldClassForCustomObjectClass( + Optional createdAt, + Optional modifiedAt, + Optional displayName, + Optional remoteKeyName, + Optional description, + Optional isRequired, + Optional fieldType, + Optional fieldFormat, + Optional> fieldChoices, + Optional itemSchema, + Map additionalProperties) { + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.displayName = displayName; + this.remoteKeyName = remoteKeyName; + this.description = description; + this.isRequired = isRequired; + this.fieldType = fieldType; + this.fieldFormat = fieldFormat; + this.fieldChoices = fieldChoices; + this.itemSchema = itemSchema; + 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; + } + + @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_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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldClassForCustomObjectClass + && equalTo((RemoteFieldClassForCustomObjectClass) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldClassForCustomObjectClass other) { + return createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && displayName.equals(other.displayName) + && remoteKeyName.equals(other.remoteKeyName) + && description.equals(other.description) + && isRequired.equals(other.isRequired) + && fieldType.equals(other.fieldType) + && fieldFormat.equals(other.fieldFormat) + && fieldChoices.equals(other.fieldChoices) + && itemSchema.equals(other.itemSchema); + } + + @Override + public int hashCode() { + return Objects.hash( + this.createdAt, + this.modifiedAt, + this.displayName, + this.remoteKeyName, + this.description, + this.isRequired, + this.fieldType, + this.fieldFormat, + this.fieldChoices, + this.itemSchema); + } + + @Override + 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 displayName = Optional.empty(); + + private Optional remoteKeyName = Optional.empty(); + + private Optional description = 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(RemoteFieldClassForCustomObjectClass other) { + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + displayName(other.getDisplayName()); + remoteKeyName(other.getRemoteKeyName()); + description(other.getDescription()); + isRequired(other.getIsRequired()); + fieldType(other.getFieldType()); + fieldFormat(other.getFieldFormat()); + fieldChoices(other.getFieldChoices()); + itemSchema(other.getItemSchema()); + 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 = "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_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(RemoteFieldClassForCustomObjectClassFieldType 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(RemoteFieldClassForCustomObjectClassFieldFormat 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(RemoteFieldClassForCustomObjectClassItemSchema itemSchema) { + this.itemSchema = Optional.ofNullable(itemSchema); + return this; + } + + public RemoteFieldClassForCustomObjectClass build() { + return new RemoteFieldClassForCustomObjectClass( + createdAt, + modifiedAt, + displayName, + remoteKeyName, + description, + isRequired, + fieldType, + fieldFormat, + fieldChoices, + itemSchema, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldClassForCustomObjectClassFieldChoicesItem.java b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldClassForCustomObjectClassFieldChoicesItem.java new file mode 100644 index 000000000..4bfb5bd38 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldClassForCustomObjectClassFieldChoicesItem.java @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = RemoteFieldClassForCustomObjectClassFieldChoicesItem.Builder.class) +public final class RemoteFieldClassForCustomObjectClassFieldChoicesItem { + private final Optional value; + + private final Optional displayName; + + private final Map additionalProperties; + + private RemoteFieldClassForCustomObjectClassFieldChoicesItem( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldClassForCustomObjectClassFieldChoicesItem + && equalTo((RemoteFieldClassForCustomObjectClassFieldChoicesItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldClassForCustomObjectClassFieldChoicesItem other) { + return value.equals(other.value) && displayName.equals(other.displayName); + } + + @Override + public int hashCode() { + return Objects.hash(this.value, this.displayName); + } + + @Override + 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(RemoteFieldClassForCustomObjectClassFieldChoicesItem 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 RemoteFieldClassForCustomObjectClassFieldChoicesItem build() { + return new RemoteFieldClassForCustomObjectClassFieldChoicesItem(value, displayName, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldClassForCustomObjectClassFieldFormat.java b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldClassForCustomObjectClassFieldFormat.java new file mode 100644 index 000000000..ed00de9fc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldClassForCustomObjectClassFieldFormat.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/RemoteFieldClassForCustomObjectClassFieldType.java b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldClassForCustomObjectClassFieldType.java new file mode 100644 index 000000000..5dc017588 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldClassForCustomObjectClassFieldType.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/RemoteFieldClassForCustomObjectClassItemSchema.java b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldClassForCustomObjectClassItemSchema.java new file mode 100644 index 000000000..8da21eb38 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldClassForCustomObjectClassItemSchema.java @@ -0,0 +1,138 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldClassForCustomObjectClassItemSchema.Builder.class) +public final class RemoteFieldClassForCustomObjectClassItemSchema { + private final Optional itemType; + + private final Optional itemFormat; + + private final Optional>> itemChoices; + + private final Map additionalProperties; + + private RemoteFieldClassForCustomObjectClassItemSchema( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldClassForCustomObjectClassItemSchema + && equalTo((RemoteFieldClassForCustomObjectClassItemSchema) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldClassForCustomObjectClassItemSchema other) { + return itemType.equals(other.itemType) + && itemFormat.equals(other.itemFormat) + && itemChoices.equals(other.itemChoices); + } + + @Override + public int hashCode() { + return Objects.hash(this.itemType, this.itemFormat, this.itemChoices); + } + + @Override + 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(RemoteFieldClassForCustomObjectClassItemSchema 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(String 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(String 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 RemoteFieldClassForCustomObjectClassItemSchema build() { + return new RemoteFieldClassForCustomObjectClassItemSchema( + itemType, itemFormat, itemChoices, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldRemoteFieldClass.java b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldRemoteFieldClass.java new file mode 100644 index 000000000..3a226b4a0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldRemoteFieldClass.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/RemoteFieldRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldRequest.java new file mode 100644 index 000000000..d0e2ac4b5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldRequest.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.remoteFieldClass, this.value); + } + + @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() {} + + @Override + public Builder from(RemoteFieldRequest other) { + remoteFieldClass(other.getRemoteFieldClass()); + value(other.getValue()); + return this; + } + + @Override + @JsonSetter("remote_field_class") + public _FinalStage remoteFieldClass(@NotNull RemoteFieldRequestRemoteFieldClass remoteFieldClass) { + this.remoteFieldClass = remoteFieldClass; + return this; + } + + @Override + public _FinalStage value(JsonNode value) { + this.value = Optional.ofNullable(value); + return this; + } + + @Override + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public _FinalStage value(Optional value) { + this.value = value; + return this; + } + + @Override + public RemoteFieldRequest build() { + return new RemoteFieldRequest(remoteFieldClass, value, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldRequestRemoteFieldClass.java b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldRequestRemoteFieldClass.java new file mode 100644 index 000000000..3150349a7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteFieldRequestRemoteFieldClass.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/RemoteKey.java b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteKey.java new file mode 100644 index 000000000..35b3a63cc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteKey.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.key); + } + + @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() {} + + @Override + public Builder from(RemoteKey other) { + name(other.getName()); + key(other.getKey()); + return this; + } + + @Override + @JsonSetter("name") + public KeyStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + @JsonSetter("key") + public _FinalStage key(@NotNull String key) { + this.key = key; + return this; + } + + @Override + public RemoteKey build() { + return new RemoteKey(name, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteResponse.java b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteResponse.java new file mode 100644 index 000000000..5e15f90de --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/RemoteResponse.java @@ -0,0 +1,271 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.status, + this.response, + this.responseHeaders, + this.responseType, + this.headers); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("method") + public PathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @Override + @JsonSetter("path") + public StatusStage path(@NotNull String path) { + this.path = path; + return this; + } + + @Override + @JsonSetter("status") + public ResponseStage status(int status) { + this.status = status; + return this; + } + + @Override + @JsonSetter("response") + public _FinalStage response(@NotNull JsonNode response) { + this.response = response; + return this; + } + + @Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Optional> headers) { + this.headers = headers; + return this; + } + + @Override + public _FinalStage responseType(ResponseTypeEnum responseType) { + this.responseType = Optional.ofNullable(responseType); + return this; + } + + @Override + @JsonSetter(value = "response_type", nulls = Nulls.SKIP) + public _FinalStage responseType(Optional responseType) { + this.responseType = responseType; + return this; + } + + @Override + public _FinalStage responseHeaders(Map responseHeaders) { + this.responseHeaders = Optional.ofNullable(responseHeaders); + return this; + } + + @Override + @JsonSetter(value = "response_headers", nulls = Nulls.SKIP) + public _FinalStage responseHeaders(Optional> responseHeaders) { + this.responseHeaders = responseHeaders; + return this; + } + + @Override + public RemoteResponse build() { + return new RemoteResponse( + method, path, status, response, responseHeaders, responseType, headers, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/RequestFormatEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/RequestFormatEnum.java new file mode 100644 index 000000000..ad5657236 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/RequestFormatEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/ResponseTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/ResponseTypeEnum.java new file mode 100644 index 000000000..29b6969fd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/ResponseTypeEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/RoleEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/RoleEnum.java new file mode 100644 index 000000000..7ee5888a6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/RoleEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/SelectiveSyncConfigurationsUsageEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/SelectiveSyncConfigurationsUsageEnum.java new file mode 100644 index 000000000..2425cddc5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/SelectiveSyncConfigurationsUsageEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/Stage.java b/src/main/java/com/merge/legacy/api/resources/crm/types/Stage.java new file mode 100644 index 000000000..c779003d0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/Stage.java @@ -0,0 +1,316 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Stage.Builder.class) +public final class Stage { + private final Optional id; + + 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 Optional> remoteFields; + + private final Map additionalProperties; + + private Stage( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + 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.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 stage'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; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Stage && equalTo((Stage) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Stage other) { + return id.equals(other.id) + && 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) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData, + this.remoteFields); + } + + @Override + 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 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(Stage other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + 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 = "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 Stage build() { + return new Stage( + id, + remoteId, + createdAt, + modifiedAt, + name, + remoteWasDeleted, + fieldMappings, + remoteData, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/SyncStatus.java b/src/main/java/com/merge/legacy/api/resources/crm/types/SyncStatus.java new file mode 100644 index 000000000..4a6cd79e4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/SyncStatus.java @@ -0,0 +1,283 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.modelName, + this.modelId, + this.lastSyncStart, + this.nextSyncStart, + this.status, + this.isInitialSync, + this.selectiveSyncConfigurationsUsage); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("model_name") + public ModelIdStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @Override + @JsonSetter("model_id") + public StatusStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @Override + @JsonSetter("status") + public IsInitialSyncStage status(@NotNull SyncStatusStatusEnum status) { + this.status = status; + return this; + } + + @Override + @JsonSetter("is_initial_sync") + public _FinalStage isInitialSync(boolean isInitialSync) { + this.isInitialSync = isInitialSync; + return this; + } + + @Override + public _FinalStage selectiveSyncConfigurationsUsage( + SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = Optional.ofNullable(selectiveSyncConfigurationsUsage); + return this; + } + + @Override + @JsonSetter(value = "selective_sync_configurations_usage", nulls = Nulls.SKIP) + public _FinalStage selectiveSyncConfigurationsUsage( + Optional selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; + return this; + } + + @Override + public _FinalStage nextSyncStart(OffsetDateTime nextSyncStart) { + this.nextSyncStart = Optional.ofNullable(nextSyncStart); + return this; + } + + @Override + @JsonSetter(value = "next_sync_start", nulls = Nulls.SKIP) + public _FinalStage nextSyncStart(Optional nextSyncStart) { + this.nextSyncStart = nextSyncStart; + return this; + } + + @Override + public _FinalStage lastSyncStart(OffsetDateTime lastSyncStart) { + this.lastSyncStart = Optional.ofNullable(lastSyncStart); + return this; + } + + @Override + @JsonSetter(value = "last_sync_start", nulls = Nulls.SKIP) + public _FinalStage lastSyncStart(Optional lastSyncStart) { + this.lastSyncStart = lastSyncStart; + return this; + } + + @Override + public SyncStatus build() { + return new SyncStatus( + modelName, + modelId, + lastSyncStart, + nextSyncStart, + status, + isInitialSync, + selectiveSyncConfigurationsUsage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/SyncStatusStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/SyncStatusStatusEnum.java new file mode 100644 index 000000000..3e6aea005 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/SyncStatusStatusEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/Task.java b/src/main/java/com/merge/legacy/api/resources/crm/types/Task.java new file mode 100644 index 000000000..1851f795f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/Task.java @@ -0,0 +1,523 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Task.Builder.class) +public final class Task { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional subject; + + private final Optional content; + + private final Optional owner; + + private final Optional account; + + private final Optional opportunity; + + private final Optional completedDate; + + private final Optional dueDate; + + private final Optional status; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private Task( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional subject, + Optional content, + Optional owner, + Optional account, + Optional opportunity, + Optional completedDate, + Optional dueDate, + Optional status, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Optional> remoteFields, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.subject = subject; + this.content = content; + this.owner = owner; + this.account = account; + this.opportunity = opportunity; + this.completedDate = completedDate; + this.dueDate = dueDate; + this.status = status; + 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 task's subject. + */ + @JsonProperty("subject") + public Optional getSubject() { + return subject; + } + + /** + * @return The task's content. + */ + @JsonProperty("content") + public Optional getContent() { + return content; + } + + /** + * @return The task's owner. + */ + @JsonProperty("owner") + public Optional getOwner() { + return owner; + } + + /** + * @return The task's account. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The task's opportunity. + */ + @JsonProperty("opportunity") + public Optional getOpportunity() { + return opportunity; + } + + /** + * @return When the task is completed. + */ + @JsonProperty("completed_date") + public Optional getCompletedDate() { + return completedDate; + } + + /** + * @return When the task is due. + */ + @JsonProperty("due_date") + public Optional getDueDate() { + return dueDate; + } + + /** + * @return The task's status. + *
    + *
  • OPEN - OPEN
  • + *
  • CLOSED - CLOSED
  • + *
+ */ + @JsonProperty("status") + public Optional 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; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Task && equalTo((Task) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Task other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && subject.equals(other.subject) + && content.equals(other.content) + && owner.equals(other.owner) + && account.equals(other.account) + && opportunity.equals(other.opportunity) + && completedDate.equals(other.completedDate) + && dueDate.equals(other.dueDate) + && status.equals(other.status) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.subject, + this.content, + this.owner, + this.account, + this.opportunity, + this.completedDate, + this.dueDate, + this.status, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData, + this.remoteFields); + } + + @Override + 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 subject = Optional.empty(); + + private Optional content = Optional.empty(); + + private Optional owner = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional opportunity = Optional.empty(); + + private Optional completedDate = Optional.empty(); + + private Optional dueDate = Optional.empty(); + + private Optional status = 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(Task other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + subject(other.getSubject()); + content(other.getContent()); + owner(other.getOwner()); + account(other.getAccount()); + opportunity(other.getOpportunity()); + completedDate(other.getCompletedDate()); + dueDate(other.getDueDate()); + status(other.getStatus()); + 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 = "subject", nulls = Nulls.SKIP) + public Builder subject(Optional subject) { + this.subject = subject; + return this; + } + + public Builder subject(String subject) { + this.subject = Optional.ofNullable(subject); + return this; + } + + @JsonSetter(value = "content", nulls = Nulls.SKIP) + public Builder content(Optional content) { + this.content = content; + return this; + } + + public Builder content(String content) { + this.content = Optional.ofNullable(content); + return this; + } + + @JsonSetter(value = "owner", nulls = Nulls.SKIP) + public Builder owner(Optional owner) { + this.owner = owner; + return this; + } + + public Builder owner(TaskOwner owner) { + this.owner = Optional.ofNullable(owner); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(TaskAccount account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "opportunity", nulls = Nulls.SKIP) + public Builder opportunity(Optional opportunity) { + this.opportunity = opportunity; + return this; + } + + public Builder opportunity(TaskOpportunity opportunity) { + this.opportunity = Optional.ofNullable(opportunity); + return this; + } + + @JsonSetter(value = "completed_date", nulls = Nulls.SKIP) + public Builder completedDate(Optional completedDate) { + this.completedDate = completedDate; + return this; + } + + public Builder completedDate(OffsetDateTime completedDate) { + this.completedDate = Optional.ofNullable(completedDate); + return this; + } + + @JsonSetter(value = "due_date", nulls = Nulls.SKIP) + public Builder dueDate(Optional dueDate) { + this.dueDate = dueDate; + return this; + } + + public Builder dueDate(OffsetDateTime dueDate) { + this.dueDate = Optional.ofNullable(dueDate); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(TaskStatus status) { + this.status = Optional.ofNullable(status); + 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 Task build() { + return new Task( + id, + remoteId, + createdAt, + modifiedAt, + subject, + content, + owner, + account, + opportunity, + completedDate, + dueDate, + status, + remoteWasDeleted, + fieldMappings, + remoteData, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/TaskAccount.java b/src/main/java/com/merge/legacy/api/resources/crm/types/TaskAccount.java new file mode 100644 index 000000000..f7ebb95d6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/TaskAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TaskAccount.Deserializer.class) +public final class TaskAccount { + private final Object value; + + private final int type; + + private TaskAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TaskAccount && equalTo((TaskAccount) other); + } + + private boolean equalTo(TaskAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TaskAccount of(String value) { + return new TaskAccount(value, 0); + } + + public static TaskAccount of(Account value) { + return new TaskAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TaskAccount.class); + } + + @Override + public TaskAccount 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/legacy/api/resources/crm/types/TaskOpportunity.java b/src/main/java/com/merge/legacy/api/resources/crm/types/TaskOpportunity.java new file mode 100644 index 000000000..9e41a4332 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/TaskOpportunity.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TaskOpportunity.Deserializer.class) +public final class TaskOpportunity { + private final Object value; + + private final int type; + + private TaskOpportunity(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((Opportunity) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TaskOpportunity && equalTo((TaskOpportunity) other); + } + + private boolean equalTo(TaskOpportunity other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TaskOpportunity of(String value) { + return new TaskOpportunity(value, 0); + } + + public static TaskOpportunity of(Opportunity value) { + return new TaskOpportunity(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Opportunity value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TaskOpportunity.class); + } + + @Override + public TaskOpportunity 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, Opportunity.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/TaskOwner.java b/src/main/java/com/merge/legacy/api/resources/crm/types/TaskOwner.java new file mode 100644 index 000000000..febe7cfd2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/TaskOwner.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TaskOwner.Deserializer.class) +public final class TaskOwner { + private final Object value; + + private final int type; + + private TaskOwner(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((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TaskOwner && equalTo((TaskOwner) other); + } + + private boolean equalTo(TaskOwner other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TaskOwner of(String value) { + return new TaskOwner(value, 0); + } + + public static TaskOwner of(User value) { + return new TaskOwner(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TaskOwner.class); + } + + @Override + public TaskOwner 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, User.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/TaskRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/types/TaskRequest.java new file mode 100644 index 000000000..018a93dec --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/TaskRequest.java @@ -0,0 +1,381 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TaskRequest.Builder.class) +public final class TaskRequest { + private final Optional subject; + + private final Optional content; + + private final Optional owner; + + private final Optional account; + + private final Optional opportunity; + + private final Optional completedDate; + + private final Optional dueDate; + + private final Optional status; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private TaskRequest( + Optional subject, + Optional content, + Optional owner, + Optional account, + Optional opportunity, + Optional completedDate, + Optional dueDate, + Optional status, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.subject = subject; + this.content = content; + this.owner = owner; + this.account = account; + this.opportunity = opportunity; + this.completedDate = completedDate; + this.dueDate = dueDate; + this.status = status; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The task's subject. + */ + @JsonProperty("subject") + public Optional getSubject() { + return subject; + } + + /** + * @return The task's content. + */ + @JsonProperty("content") + public Optional getContent() { + return content; + } + + /** + * @return The task's owner. + */ + @JsonProperty("owner") + public Optional getOwner() { + return owner; + } + + /** + * @return The task's account. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The task's opportunity. + */ + @JsonProperty("opportunity") + public Optional getOpportunity() { + return opportunity; + } + + /** + * @return When the task is completed. + */ + @JsonProperty("completed_date") + public Optional getCompletedDate() { + return completedDate; + } + + /** + * @return When the task is due. + */ + @JsonProperty("due_date") + public Optional getDueDate() { + return dueDate; + } + + /** + * @return The task's status. + *
    + *
  • OPEN - OPEN
  • + *
  • CLOSED - CLOSED
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TaskRequest && equalTo((TaskRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TaskRequest other) { + return subject.equals(other.subject) + && content.equals(other.content) + && owner.equals(other.owner) + && account.equals(other.account) + && opportunity.equals(other.opportunity) + && completedDate.equals(other.completedDate) + && dueDate.equals(other.dueDate) + && status.equals(other.status) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.subject, + this.content, + this.owner, + this.account, + this.opportunity, + this.completedDate, + this.dueDate, + this.status, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional subject = Optional.empty(); + + private Optional content = Optional.empty(); + + private Optional owner = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional opportunity = Optional.empty(); + + private Optional completedDate = Optional.empty(); + + private Optional dueDate = Optional.empty(); + + private Optional status = 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(TaskRequest other) { + subject(other.getSubject()); + content(other.getContent()); + owner(other.getOwner()); + account(other.getAccount()); + opportunity(other.getOpportunity()); + completedDate(other.getCompletedDate()); + dueDate(other.getDueDate()); + status(other.getStatus()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + remoteFields(other.getRemoteFields()); + return this; + } + + @JsonSetter(value = "subject", nulls = Nulls.SKIP) + public Builder subject(Optional subject) { + this.subject = subject; + return this; + } + + public Builder subject(String subject) { + this.subject = Optional.ofNullable(subject); + return this; + } + + @JsonSetter(value = "content", nulls = Nulls.SKIP) + public Builder content(Optional content) { + this.content = content; + return this; + } + + public Builder content(String content) { + this.content = Optional.ofNullable(content); + return this; + } + + @JsonSetter(value = "owner", nulls = Nulls.SKIP) + public Builder owner(Optional owner) { + this.owner = owner; + return this; + } + + public Builder owner(TaskRequestOwner owner) { + this.owner = Optional.ofNullable(owner); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(TaskRequestAccount account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "opportunity", nulls = Nulls.SKIP) + public Builder opportunity(Optional opportunity) { + this.opportunity = opportunity; + return this; + } + + public Builder opportunity(TaskRequestOpportunity opportunity) { + this.opportunity = Optional.ofNullable(opportunity); + return this; + } + + @JsonSetter(value = "completed_date", nulls = Nulls.SKIP) + public Builder completedDate(Optional completedDate) { + this.completedDate = completedDate; + return this; + } + + public Builder completedDate(OffsetDateTime completedDate) { + this.completedDate = Optional.ofNullable(completedDate); + return this; + } + + @JsonSetter(value = "due_date", nulls = Nulls.SKIP) + public Builder dueDate(Optional dueDate) { + this.dueDate = dueDate; + return this; + } + + public Builder dueDate(OffsetDateTime dueDate) { + this.dueDate = Optional.ofNullable(dueDate); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(TaskRequestStatus status) { + this.status = Optional.ofNullable(status); + 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 TaskRequest build() { + return new TaskRequest( + subject, + content, + owner, + account, + opportunity, + completedDate, + dueDate, + status, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/TaskRequestAccount.java b/src/main/java/com/merge/legacy/api/resources/crm/types/TaskRequestAccount.java new file mode 100644 index 000000000..35c972e56 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/TaskRequestAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TaskRequestAccount.Deserializer.class) +public final class TaskRequestAccount { + private final Object value; + + private final int type; + + private TaskRequestAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TaskRequestAccount && equalTo((TaskRequestAccount) other); + } + + private boolean equalTo(TaskRequestAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TaskRequestAccount of(String value) { + return new TaskRequestAccount(value, 0); + } + + public static TaskRequestAccount of(Account value) { + return new TaskRequestAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TaskRequestAccount.class); + } + + @Override + public TaskRequestAccount 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/legacy/api/resources/crm/types/TaskRequestOpportunity.java b/src/main/java/com/merge/legacy/api/resources/crm/types/TaskRequestOpportunity.java new file mode 100644 index 000000000..f0b2ec3d9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/TaskRequestOpportunity.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TaskRequestOpportunity.Deserializer.class) +public final class TaskRequestOpportunity { + private final Object value; + + private final int type; + + private TaskRequestOpportunity(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((Opportunity) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TaskRequestOpportunity && equalTo((TaskRequestOpportunity) other); + } + + private boolean equalTo(TaskRequestOpportunity other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TaskRequestOpportunity of(String value) { + return new TaskRequestOpportunity(value, 0); + } + + public static TaskRequestOpportunity of(Opportunity value) { + return new TaskRequestOpportunity(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Opportunity value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TaskRequestOpportunity.class); + } + + @Override + public TaskRequestOpportunity 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, Opportunity.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/TaskRequestOwner.java b/src/main/java/com/merge/legacy/api/resources/crm/types/TaskRequestOwner.java new file mode 100644 index 000000000..dba8884c0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/TaskRequestOwner.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TaskRequestOwner.Deserializer.class) +public final class TaskRequestOwner { + private final Object value; + + private final int type; + + private TaskRequestOwner(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((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TaskRequestOwner && equalTo((TaskRequestOwner) other); + } + + private boolean equalTo(TaskRequestOwner other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TaskRequestOwner of(String value) { + return new TaskRequestOwner(value, 0); + } + + public static TaskRequestOwner of(User value) { + return new TaskRequestOwner(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TaskRequestOwner.class); + } + + @Override + public TaskRequestOwner 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, User.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/TaskRequestStatus.java b/src/main/java/com/merge/legacy/api/resources/crm/types/TaskRequestStatus.java new file mode 100644 index 000000000..ce98011a8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/TaskRequestStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/TaskResponse.java b/src/main/java/com/merge/legacy/api/resources/crm/types/TaskResponse.java new file mode 100644 index 000000000..30959db78 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/TaskResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TaskResponse.Builder.class) +public final class TaskResponse { + private final Task model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private TaskResponse( + Task 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 Task getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TaskResponse && equalTo((TaskResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TaskResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull Task model); + + Builder from(TaskResponse other); + } + + public interface _FinalStage { + TaskResponse 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 Task model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(TaskResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull Task model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public TaskResponse build() { + return new TaskResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/TaskStatus.java b/src/main/java/com/merge/legacy/api/resources/crm/types/TaskStatus.java new file mode 100644 index 000000000..491227cee --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/TaskStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/crm/types/TaskStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/crm/types/TaskStatusEnum.java new file mode 100644 index 000000000..2bc75ca0d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/TaskStatusEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TaskStatusEnum { + OPEN("OPEN"), + + CLOSED("CLOSED"); + + private final String value; + + TaskStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/User.java b/src/main/java/com/merge/legacy/api/resources/crm/types/User.java new file mode 100644 index 000000000..aff96e961 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/User.java @@ -0,0 +1,374 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/crm/types/ValidationProblemSource.java b/src/main/java/com/merge/legacy/api/resources/crm/types/ValidationProblemSource.java new file mode 100644 index 000000000..91c19ba80 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/ValidationProblemSource.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.pointer); + } + + @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() {} + + @Override + public Builder from(ValidationProblemSource other) { + pointer(other.getPointer()); + return this; + } + + @Override + @JsonSetter("pointer") + public _FinalStage pointer(@NotNull String pointer) { + this.pointer = pointer; + return this; + } + + @Override + public ValidationProblemSource build() { + return new ValidationProblemSource(pointer, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/WarningValidationProblem.java b/src/main/java/com/merge/legacy/api/resources/crm/types/WarningValidationProblem.java new file mode 100644 index 000000000..5fe5b775e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/WarningValidationProblem.java @@ -0,0 +1,178 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.source, this.title, this.detail, this.problemType); + } + + @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() {} + + @Override + public Builder from(WarningValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + return this; + } + + @Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @Override + public WarningValidationProblem build() { + return new WarningValidationProblem(source, title, detail, problemType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/types/WebhookReceiver.java b/src/main/java/com/merge/legacy/api/resources/crm/types/WebhookReceiver.java new file mode 100644 index 000000000..58e6592cb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/types/WebhookReceiver.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @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() {} + + @Override + public Builder from(WebhookReceiver other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @Override + public WebhookReceiver build() { + return new WebhookReceiver(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/users/UsersClient.java b/src/main/java/com/merge/legacy/api/resources/crm/users/UsersClient.java new file mode 100644 index 000000000..7f381df36 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/users/UsersClient.java @@ -0,0 +1,300 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.users; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.types.IgnoreCommonModelRequest; +import com.merge.legacy.api.resources.crm.types.PaginatedRemoteFieldClassList; +import com.merge.legacy.api.resources.crm.types.PaginatedUserList; +import com.merge.legacy.api.resources.crm.types.User; +import com.merge.legacy.api.resources.crm.users.requests.UsersListRequest; +import com.merge.legacy.api.resources.crm.users.requests.UsersRemoteFieldClassesListRequest; +import com.merge.legacy.api.resources.crm.users.requests.UsersRetrieveRequest; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/crm/users/requests/UsersListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/users/requests/UsersListRequest.java new file mode 100644 index 000000000..b7610e0c0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/users/requests/UsersListRequest.java @@ -0,0 +1,417 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.users.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/crm/users/requests/UsersRemoteFieldClassesListRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/users/requests/UsersRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..537ffac81 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/users/requests/UsersRemoteFieldClassesListRequest.java @@ -0,0 +1,272 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.users.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = UsersRemoteFieldClassesListRequest.Builder.class) +public final class UsersRemoteFieldClassesListRequest { + 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 UsersRemoteFieldClassesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersRemoteFieldClassesListRequest + && equalTo((UsersRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersRemoteFieldClassesListRequest 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @Override + 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(UsersRemoteFieldClassesListRequest 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 UsersRemoteFieldClassesListRequest build() { + return new UsersRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + isCommonModelField, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/crm/users/requests/UsersRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/users/requests/UsersRetrieveRequest.java new file mode 100644 index 000000000..f91c40c5b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/users/requests/UsersRetrieveRequest.java @@ -0,0 +1,121 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.users.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeRemoteFields); + } + + @Override + 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/legacy/api/resources/crm/webhookreceivers/WebhookReceiversClient.java b/src/main/java/com/merge/legacy/api/resources/crm/webhookreceivers/WebhookReceiversClient.java new file mode 100644 index 000000000..0c6db3e7b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/webhookreceivers/WebhookReceiversClient.java @@ -0,0 +1,111 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.webhookreceivers; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.crm.types.WebhookReceiver; +import com.merge.legacy.api.resources.crm.webhookreceivers.requests.WebhookReceiverRequest; +import java.io.IOException; +import java.util.List; +import okhttp3.*; + +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/legacy/api/resources/crm/webhookreceivers/requests/WebhookReceiverRequest.java b/src/main/java/com/merge/legacy/api/resources/crm/webhookreceivers/requests/WebhookReceiverRequest.java new file mode 100644 index 000000000..1caa3e719 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/crm/webhookreceivers/requests/WebhookReceiverRequest.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.crm.webhookreceivers.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @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() {} + + @Override + public Builder from(WebhookReceiverRequest other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @Override + public WebhookReceiverRequest build() { + return new WebhookReceiverRequest(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/FilestorageClient.java b/src/main/java/com/merge/legacy/api/resources/filestorage/FilestorageClient.java new file mode 100644 index 000000000..8582e10e5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/FilestorageClient.java @@ -0,0 +1,192 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage; + +import com.merge.legacy.api.core.ClientOptions; +import com.merge.legacy.api.core.Suppliers; +import com.merge.legacy.api.resources.filestorage.accountdetails.AccountDetailsClient; +import com.merge.legacy.api.resources.filestorage.accounttoken.AccountTokenClient; +import com.merge.legacy.api.resources.filestorage.asyncpassthrough.AsyncPassthroughClient; +import com.merge.legacy.api.resources.filestorage.audittrail.AuditTrailClient; +import com.merge.legacy.api.resources.filestorage.availableactions.AvailableActionsClient; +import com.merge.legacy.api.resources.filestorage.deleteaccount.DeleteAccountClient; +import com.merge.legacy.api.resources.filestorage.drives.DrivesClient; +import com.merge.legacy.api.resources.filestorage.fieldmapping.FieldMappingClient; +import com.merge.legacy.api.resources.filestorage.files.FilesClient; +import com.merge.legacy.api.resources.filestorage.folders.FoldersClient; +import com.merge.legacy.api.resources.filestorage.forceresync.ForceResyncClient; +import com.merge.legacy.api.resources.filestorage.generatekey.GenerateKeyClient; +import com.merge.legacy.api.resources.filestorage.groups.GroupsClient; +import com.merge.legacy.api.resources.filestorage.issues.IssuesClient; +import com.merge.legacy.api.resources.filestorage.linkedaccounts.LinkedAccountsClient; +import com.merge.legacy.api.resources.filestorage.linktoken.LinkTokenClient; +import com.merge.legacy.api.resources.filestorage.passthrough.PassthroughClient; +import com.merge.legacy.api.resources.filestorage.regeneratekey.RegenerateKeyClient; +import com.merge.legacy.api.resources.filestorage.scopes.ScopesClient; +import com.merge.legacy.api.resources.filestorage.syncstatus.SyncStatusClient; +import com.merge.legacy.api.resources.filestorage.users.UsersClient; +import com.merge.legacy.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/legacy/api/resources/filestorage/accountdetails/AccountDetailsClient.java b/src/main/java/com/merge/legacy/api/resources/filestorage/accountdetails/AccountDetailsClient.java new file mode 100644 index 000000000..2b357b3b2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/accountdetails/AccountDetailsClient.java @@ -0,0 +1,58 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.accountdetails; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.filestorage.types.AccountDetails; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/filestorage/accounttoken/AccountTokenClient.java b/src/main/java/com/merge/legacy/api/resources/filestorage/accounttoken/AccountTokenClient.java new file mode 100644 index 000000000..823f44661 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/accounttoken/AccountTokenClient.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.accounttoken; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.filestorage.types.AccountToken; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/filestorage/asyncpassthrough/AsyncPassthroughClient.java b/src/main/java/com/merge/legacy/api/resources/filestorage/asyncpassthrough/AsyncPassthroughClient.java new file mode 100644 index 000000000..5c1557a69 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/asyncpassthrough/AsyncPassthroughClient.java @@ -0,0 +1,110 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.asyncpassthrough; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.filestorage.asyncpassthrough.types.AsyncPassthroughRetrieveResponse; +import com.merge.legacy.api.resources.filestorage.types.AsyncPassthroughReciept; +import com.merge.legacy.api.resources.filestorage.types.DataPassthroughRequest; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/filestorage/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java b/src/main/java/com/merge/legacy/api/resources/filestorage/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java new file mode 100644 index 000000000..1ffca125d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import com.merge.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/filestorage/audittrail/AuditTrailClient.java b/src/main/java/com/merge/legacy/api/resources/filestorage/audittrail/AuditTrailClient.java new file mode 100644 index 000000000..8823805db --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/audittrail/AuditTrailClient.java @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.audittrail; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.filestorage.audittrail.requests.AuditTrailListRequest; +import com.merge.legacy.api.resources.filestorage.types.PaginatedAuditLogEventList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/filestorage/audittrail/requests/AuditTrailListRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/audittrail/requests/AuditTrailListRequest.java new file mode 100644 index 000000000..6ae1e6810 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/audittrail/requests/AuditTrailListRequest.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.audittrail.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.cursor, this.endDate, this.eventType, this.pageSize, this.startDate, this.userEmail); + } + + @Override + 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/legacy/api/resources/filestorage/availableactions/AvailableActionsClient.java b/src/main/java/com/merge/legacy/api/resources/filestorage/availableactions/AvailableActionsClient.java new file mode 100644 index 000000000..733c5e45a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/availableactions/AvailableActionsClient.java @@ -0,0 +1,58 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.availableactions; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.filestorage.types.AvailableActions; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/filestorage/deleteaccount/DeleteAccountClient.java b/src/main/java/com/merge/legacy/api/resources/filestorage/deleteaccount/DeleteAccountClient.java new file mode 100644 index 000000000..fc919c97e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/deleteaccount/DeleteAccountClient.java @@ -0,0 +1,55 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.deleteaccount; + +import com.merge.legacy.api.core.*; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/filestorage/drives/DrivesClient.java b/src/main/java/com/merge/legacy/api/resources/filestorage/drives/DrivesClient.java new file mode 100644 index 000000000..34b98d979 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/drives/DrivesClient.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.drives; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.filestorage.drives.requests.DrivesListRequest; +import com.merge.legacy.api.resources.filestorage.drives.requests.DrivesRetrieveRequest; +import com.merge.legacy.api.resources.filestorage.types.Drive; +import com.merge.legacy.api.resources.filestorage.types.PaginatedDriveList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/filestorage/drives/requests/DrivesListRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/drives/requests/DrivesListRequest.java new file mode 100644 index 000000000..0db7325f1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/drives/requests/DrivesListRequest.java @@ -0,0 +1,388 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.drives.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = DrivesListRequest.Builder.class) +public final class DrivesListRequest { + 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 remoteId; + + private final Map additionalProperties; + + private DrivesListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional name, + 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.name = name; + 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 If provided, will only return drives with this name. This performs an exact match. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DrivesListRequest && equalTo((DrivesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DrivesListRequest 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) + && name.equals(other.name) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.name, + this.pageSize, + this.remoteId); + } + + @Override + 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 name = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DrivesListRequest 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()); + name(other.getName()); + 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 = "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_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 DrivesListRequest build() { + return new DrivesListRequest( + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + name, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/drives/requests/DrivesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/drives/requests/DrivesRetrieveRequest.java new file mode 100644 index 000000000..257762de4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/drives/requests/DrivesRetrieveRequest.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.drives.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/filestorage/fieldmapping/FieldMappingClient.java b/src/main/java/com/merge/legacy/api/resources/filestorage/fieldmapping/FieldMappingClient.java new file mode 100644 index 000000000..0b0176b53 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/fieldmapping/FieldMappingClient.java @@ -0,0 +1,338 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.fieldmapping; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.filestorage.fieldmapping.requests.CreateFieldMappingRequest; +import com.merge.legacy.api.resources.filestorage.fieldmapping.requests.FieldMappingsRetrieveRequest; +import com.merge.legacy.api.resources.filestorage.fieldmapping.requests.PatchedEditFieldMappingRequest; +import com.merge.legacy.api.resources.filestorage.fieldmapping.requests.RemoteFieldsRetrieveRequest; +import com.merge.legacy.api.resources.filestorage.types.ExternalTargetFieldApiResponse; +import com.merge.legacy.api.resources.filestorage.types.FieldMappingApiInstanceResponse; +import com.merge.legacy.api.resources.filestorage.types.FieldMappingInstanceResponse; +import com.merge.legacy.api.resources.filestorage.types.RemoteFieldApiResponse; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/filestorage/fieldmapping/requests/CreateFieldMappingRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/fieldmapping/requests/CreateFieldMappingRequest.java new file mode 100644 index 000000000..7d52c3a5b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/fieldmapping/requests/CreateFieldMappingRequest.java @@ -0,0 +1,337 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.fieldmapping.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.excludeRemoteFieldMetadata, + this.targetFieldName, + this.targetFieldDescription, + this.remoteFieldTraversalPath, + this.remoteMethod, + this.remoteUrlPath, + this.commonModelName); + } + + @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() {} + + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @Override + public _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.add(remoteFieldTraversalPath); + return this; + } + + @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. + */ + @Override + public _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); + return this; + } + + @Override + @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) + public _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + return this; + } + + @Override + public CreateFieldMappingRequest build() { + return new CreateFieldMappingRequest( + excludeRemoteFieldMetadata, + targetFieldName, + targetFieldDescription, + remoteFieldTraversalPath, + remoteMethod, + remoteUrlPath, + commonModelName, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/fieldmapping/requests/FieldMappingsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/fieldmapping/requests/FieldMappingsRetrieveRequest.java new file mode 100644 index 000000000..0f635e6ee --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/fieldmapping/requests/FieldMappingsRetrieveRequest.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.fieldmapping.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.excludeRemoteFieldMetadata); + } + + @Override + 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/legacy/api/resources/filestorage/fieldmapping/requests/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/fieldmapping/requests/PatchedEditFieldMappingRequest.java new file mode 100644 index 000000000..b43c3c735 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/fieldmapping/requests/PatchedEditFieldMappingRequest.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.fieldmapping.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath); + } + + @Override + 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/legacy/api/resources/filestorage/fieldmapping/requests/RemoteFieldsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/fieldmapping/requests/RemoteFieldsRetrieveRequest.java new file mode 100644 index 000000000..19bb1313d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/fieldmapping/requests/RemoteFieldsRetrieveRequest.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.fieldmapping.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.commonModels, this.includeExampleValues); + } + + @Override + 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/legacy/api/resources/filestorage/files/FilesClient.java b/src/main/java/com/merge/legacy/api/resources/filestorage/files/FilesClient.java new file mode 100644 index 000000000..ec53f59df --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/files/FilesClient.java @@ -0,0 +1,332 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.files; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.filestorage.files.requests.FileStorageFileEndpointRequest; +import com.merge.legacy.api.resources.filestorage.files.requests.FilesDownloadRetrieveRequest; +import com.merge.legacy.api.resources.filestorage.files.requests.FilesListRequest; +import com.merge.legacy.api.resources.filestorage.files.requests.FilesRetrieveRequest; +import com.merge.legacy.api.resources.filestorage.types.File; +import com.merge.legacy.api.resources.filestorage.types.FileStorageFileResponse; +import com.merge.legacy.api.resources.filestorage.types.MetaResponse; +import com.merge.legacy.api.resources.filestorage.types.PaginatedFileList; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/filestorage/files/requests/FileStorageFileEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/files/requests/FileStorageFileEndpointRequest.java new file mode 100644 index 000000000..5bbf3d743 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/files/requests/FileStorageFileEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.files.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.filestorage.types.FileRequest; +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 = FileStorageFileEndpointRequest.Builder.class) +public final class FileStorageFileEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final FileRequest model; + + private final Map additionalProperties; + + private FileStorageFileEndpointRequest( + Optional isDebugMode, + Optional runAsync, + FileRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public FileRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FileStorageFileEndpointRequest && equalTo((FileStorageFileEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FileStorageFileEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull FileRequest model); + + Builder from(FileStorageFileEndpointRequest other); + } + + public interface _FinalStage { + FileStorageFileEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private FileRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(FileStorageFileEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull FileRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public FileStorageFileEndpointRequest build() { + return new FileStorageFileEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/files/requests/FilesDownloadRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/files/requests/FilesDownloadRetrieveRequest.java new file mode 100644 index 000000000..7950588b0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/files/requests/FilesDownloadRetrieveRequest.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.files.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.mimeType); + } + + @Override + 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/legacy/api/resources/filestorage/files/requests/FilesListRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/files/requests/FilesListRequest.java new file mode 100644 index 000000000..576933434 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/files/requests/FilesListRequest.java @@ -0,0 +1,505 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.files.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.filestorage.files.types.FilesListRequestExpand; +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 = FilesListRequest.Builder.class) +public final class FilesListRequest { + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional driveId; + + private final Optional expand; + + private final Optional folderId; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional mimeType; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional name; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private FilesListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional driveId, + Optional expand, + Optional folderId, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional mimeType, + Optional modifiedAfter, + Optional modifiedBefore, + Optional name, + Optional pageSize, + Optional remoteId, + Map additionalProperties) { + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.driveId = driveId; + this.expand = expand; + this.folderId = folderId; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.mimeType = mimeType; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.name = name; + 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 Specifying a drive id returns only the files in that drive. Specifying null returns only the files outside the top-level drive. + */ + @JsonProperty("drive_id") + 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. + */ + @JsonProperty("folder_id") + public Optional getFolderId() { + return folderId; + } + + /** + * @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 files with these mime_types. Multiple values can be separated by commas. + */ + @JsonProperty("mime_type") + public Optional getMimeType() { + return mimeType; + } + + /** + * @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 files with this name. This performs an exact match. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FilesListRequest && equalTo((FilesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FilesListRequest other) { + return 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) + && includeShellData.equals(other.includeShellData) + && mimeType.equals(other.mimeType) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && name.equals(other.name) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.driveId, + this.expand, + this.folderId, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.mimeType, + this.modifiedAfter, + this.modifiedBefore, + this.name, + this.pageSize, + this.remoteId); + } + + @Override + 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 driveId = Optional.empty(); + + private Optional expand = Optional.empty(); + + private Optional folderId = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional mimeType = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FilesListRequest other) { + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + driveId(other.getDriveId()); + expand(other.getExpand()); + folderId(other.getFolderId()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + mimeType(other.getMimeType()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + name(other.getName()); + 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 = "drive_id", nulls = Nulls.SKIP) + public Builder driveId(Optional driveId) { + this.driveId = driveId; + return this; + } + + public Builder driveId(String driveId) { + this.driveId = Optional.ofNullable(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; + return this; + } + + public Builder folderId(String folderId) { + this.folderId = Optional.ofNullable(folderId); + 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 = "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 = "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_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 FilesListRequest build() { + return new FilesListRequest( + createdAfter, + createdBefore, + cursor, + driveId, + expand, + folderId, + includeDeletedData, + includeRemoteData, + includeShellData, + mimeType, + modifiedAfter, + modifiedBefore, + name, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/files/requests/FilesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/files/requests/FilesRetrieveRequest.java new file mode 100644 index 000000000..a9749686c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/files/requests/FilesRetrieveRequest.java @@ -0,0 +1,121 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.files.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/filestorage/files/types/FilesListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/filestorage/files/types/FilesListRequestExpand.java new file mode 100644 index 000000000..d4880141b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/files/types/FilesListRequestExpand.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/files/types/FilesRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/filestorage/files/types/FilesRetrieveRequestExpand.java new file mode 100644 index 000000000..99f0ad9fd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/files/types/FilesRetrieveRequestExpand.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/folders/FoldersClient.java b/src/main/java/com/merge/legacy/api/resources/filestorage/folders/FoldersClient.java new file mode 100644 index 000000000..563a41b2e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/folders/FoldersClient.java @@ -0,0 +1,275 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.folders; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.filestorage.folders.requests.FileStorageFolderEndpointRequest; +import com.merge.legacy.api.resources.filestorage.folders.requests.FoldersListRequest; +import com.merge.legacy.api.resources.filestorage.folders.requests.FoldersRetrieveRequest; +import com.merge.legacy.api.resources.filestorage.types.FileStorageFolderResponse; +import com.merge.legacy.api.resources.filestorage.types.Folder; +import com.merge.legacy.api.resources.filestorage.types.MetaResponse; +import com.merge.legacy.api.resources.filestorage.types.PaginatedFolderList; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/filestorage/folders/requests/FileStorageFolderEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/folders/requests/FileStorageFolderEndpointRequest.java new file mode 100644 index 000000000..576ed9214 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/folders/requests/FileStorageFolderEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.folders.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.filestorage.types.FolderRequest; +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 = FileStorageFolderEndpointRequest.Builder.class) +public final class FileStorageFolderEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final FolderRequest model; + + private final Map additionalProperties; + + private FileStorageFolderEndpointRequest( + Optional isDebugMode, + Optional runAsync, + FolderRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public FolderRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FileStorageFolderEndpointRequest && equalTo((FileStorageFolderEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FileStorageFolderEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull FolderRequest model); + + Builder from(FileStorageFolderEndpointRequest other); + } + + public interface _FinalStage { + FileStorageFolderEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private FolderRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(FileStorageFolderEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull FolderRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public FileStorageFolderEndpointRequest build() { + return new FileStorageFolderEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/folders/requests/FoldersListRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/folders/requests/FoldersListRequest.java new file mode 100644 index 000000000..04181e0e7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/folders/requests/FoldersListRequest.java @@ -0,0 +1,476 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.folders.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.filestorage.folders.types.FoldersListRequestExpand; +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 = FoldersListRequest.Builder.class) +public final class FoldersListRequest { + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional driveId; + + 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 name; + + private final Optional pageSize; + + private final Optional parentFolderId; + + private final Optional remoteId; + + private final Map additionalProperties; + + private FoldersListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional driveId, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional name, + Optional pageSize, + Optional parentFolderId, + Optional remoteId, + Map additionalProperties) { + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.driveId = driveId; + 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.parentFolderId = parentFolderId; + 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 folders in this drive. + */ + @JsonProperty("drive_id") + 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. + */ + @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 folders with this name. This performs an exact match. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return If provided, will only return folders in this parent folder. If null, will return folders in root directory. + */ + @JsonProperty("parent_folder_id") + public Optional getParentFolderId() { + return parentFolderId; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FoldersListRequest && equalTo((FoldersListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FoldersListRequest other) { + return 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) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && name.equals(other.name) + && pageSize.equals(other.pageSize) + && parentFolderId.equals(other.parentFolderId) + && remoteId.equals(other.remoteId); + } + + @Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.driveId, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.name, + this.pageSize, + this.parentFolderId, + this.remoteId); + } + + @Override + 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 driveId = 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 name = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional parentFolderId = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FoldersListRequest other) { + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + driveId(other.getDriveId()); + expand(other.getExpand()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + name(other.getName()); + pageSize(other.getPageSize()); + parentFolderId(other.getParentFolderId()); + 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 = "drive_id", nulls = Nulls.SKIP) + public Builder driveId(Optional driveId) { + this.driveId = driveId; + return this; + } + + public Builder driveId(String driveId) { + this.driveId = Optional.ofNullable(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; + 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 = "parent_folder_id", nulls = Nulls.SKIP) + public Builder parentFolderId(Optional parentFolderId) { + this.parentFolderId = parentFolderId; + return this; + } + + public Builder parentFolderId(String parentFolderId) { + this.parentFolderId = Optional.ofNullable(parentFolderId); + 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 FoldersListRequest build() { + return new FoldersListRequest( + createdAfter, + createdBefore, + cursor, + driveId, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + name, + pageSize, + parentFolderId, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/folders/requests/FoldersRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/folders/requests/FoldersRetrieveRequest.java new file mode 100644 index 000000000..52de90c27 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/folders/requests/FoldersRetrieveRequest.java @@ -0,0 +1,121 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.folders.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/filestorage/folders/types/FoldersListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/filestorage/folders/types/FoldersListRequestExpand.java new file mode 100644 index 000000000..cf3cbaa37 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/folders/types/FoldersListRequestExpand.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/folders/types/FoldersRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/filestorage/folders/types/FoldersRetrieveRequestExpand.java new file mode 100644 index 000000000..feb94055c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/folders/types/FoldersRetrieveRequestExpand.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/forceresync/ForceResyncClient.java b/src/main/java/com/merge/legacy/api/resources/filestorage/forceresync/ForceResyncClient.java new file mode 100644 index 000000000..42711ab51 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/forceresync/ForceResyncClient.java @@ -0,0 +1,61 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.forceresync; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.filestorage.types.SyncStatus; +import java.io.IOException; +import java.util.List; +import okhttp3.*; + +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/legacy/api/resources/filestorage/generatekey/GenerateKeyClient.java b/src/main/java/com/merge/legacy/api/resources/filestorage/generatekey/GenerateKeyClient.java new file mode 100644 index 000000000..8a8223756 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/generatekey/GenerateKeyClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.generatekey; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.filestorage.generatekey.requests.GenerateRemoteKeyRequest; +import com.merge.legacy.api.resources.filestorage.types.RemoteKey; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/filestorage/generatekey/requests/GenerateRemoteKeyRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/generatekey/requests/GenerateRemoteKeyRequest.java new file mode 100644 index 000000000..af1e8bc84 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/generatekey/requests/GenerateRemoteKeyRequest.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.generatekey.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + public GenerateRemoteKeyRequest build() { + return new GenerateRemoteKeyRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/groups/GroupsClient.java b/src/main/java/com/merge/legacy/api/resources/filestorage/groups/GroupsClient.java new file mode 100644 index 000000000..277ecf323 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/groups/GroupsClient.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.groups; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.filestorage.groups.requests.GroupsListRequest; +import com.merge.legacy.api.resources.filestorage.groups.requests.GroupsRetrieveRequest; +import com.merge.legacy.api.resources.filestorage.types.Group; +import com.merge.legacy.api.resources.filestorage.types.PaginatedGroupList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/filestorage/groups/requests/GroupsListRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/groups/requests/GroupsListRequest.java new file mode 100644 index 000000000..09edff73c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/groups/requests/GroupsListRequest.java @@ -0,0 +1,388 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.groups.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/filestorage/groups/requests/GroupsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/groups/requests/GroupsRetrieveRequest.java new file mode 100644 index 000000000..fd3b0cabe --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/groups/requests/GroupsRetrieveRequest.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.groups.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/filestorage/issues/IssuesClient.java b/src/main/java/com/merge/legacy/api/resources/filestorage/issues/IssuesClient.java new file mode 100644 index 000000000..45c17785c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/issues/IssuesClient.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.issues; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.filestorage.issues.requests.IssuesListRequest; +import com.merge.legacy.api.resources.filestorage.types.Issue; +import com.merge.legacy.api.resources.filestorage.types.PaginatedIssueList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/filestorage/issues/requests/IssuesListRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/issues/requests/IssuesListRequest.java new file mode 100644 index 000000000..30e67b3cf --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/issues/requests/IssuesListRequest.java @@ -0,0 +1,471 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.issues.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/filestorage/issues/types/IssuesListRequestStatus.java b/src/main/java/com/merge/legacy/api/resources/filestorage/issues/types/IssuesListRequestStatus.java new file mode 100644 index 000000000..de09919aa --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/issues/types/IssuesListRequestStatus.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/linkedaccounts/LinkedAccountsClient.java b/src/main/java/com/merge/legacy/api/resources/filestorage/linkedaccounts/LinkedAccountsClient.java new file mode 100644 index 000000000..751e519f2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/linkedaccounts/LinkedAccountsClient.java @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.linkedaccounts; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.filestorage.linkedaccounts.requests.LinkedAccountsListRequest; +import com.merge.legacy.api.resources.filestorage.types.PaginatedAccountDetailsAndActionsList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/filestorage/linkedaccounts/requests/LinkedAccountsListRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/linkedaccounts/requests/LinkedAccountsListRequest.java new file mode 100644 index 000000000..3eeb2de21 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/linkedaccounts/requests/LinkedAccountsListRequest.java @@ -0,0 +1,452 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.linkedaccounts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/filestorage/linkedaccounts/types/LinkedAccountsListRequestCategory.java b/src/main/java/com/merge/legacy/api/resources/filestorage/linkedaccounts/types/LinkedAccountsListRequestCategory.java new file mode 100644 index 000000000..1a291afb2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/linkedaccounts/types/LinkedAccountsListRequestCategory.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/linktoken/LinkTokenClient.java b/src/main/java/com/merge/legacy/api/resources/filestorage/linktoken/LinkTokenClient.java new file mode 100644 index 000000000..64be313e2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/linktoken/LinkTokenClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.linktoken; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.filestorage.linktoken.requests.EndUserDetailsRequest; +import com.merge.legacy.api.resources.filestorage.types.LinkToken; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/filestorage/linktoken/requests/EndUserDetailsRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/linktoken/requests/EndUserDetailsRequest.java new file mode 100644 index 000000000..2afda621e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/linktoken/requests/EndUserDetailsRequest.java @@ -0,0 +1,600 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.linktoken.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.filestorage.types.CategoriesEnum; +import com.merge.legacy.api.resources.filestorage.types.CommonModelScopesBodyRequest; +import com.merge.legacy.api.resources.filestorage.types.IndividualCommonModelScopeDeserializerRequest; +import com.merge.legacy.api.resources.filestorage.types.LanguageEnum; +import java.util.*; +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; + } + + @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); + } + + @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); + } + + @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() {} + + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @Override + public _FinalStage integrationSpecificConfig(Map integrationSpecificConfig) { + this.integrationSpecificConfig = Optional.ofNullable(integrationSpecificConfig); + return this; + } + + @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. + */ + @Override + public _FinalStage areSyncsDisabled(Boolean areSyncsDisabled) { + this.areSyncsDisabled = Optional.ofNullable(areSyncsDisabled); + return this; + } + + @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. + */ + @Override + public _FinalStage language(LanguageEnum language) { + this.language = Optional.ofNullable(language); + return this; + } + + @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. + */ + @Override + public _FinalStage categoryCommonModelScopes( + Map>> categoryCommonModelScopes) { + this.categoryCommonModelScopes = Optional.ofNullable(categoryCommonModelScopes); + return this; + } + + @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. + */ + @Override + public _FinalStage commonModels(List commonModels) { + this.commonModels = Optional.ofNullable(commonModels); + return this; + } + + @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. + */ + @Override + public _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink) { + this.hideAdminMagicLink = Optional.ofNullable(hideAdminMagicLink); + return this; + } + + @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. + */ + @Override + public _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl) { + this.shouldCreateMagicLinkUrl = Optional.ofNullable(shouldCreateMagicLinkUrl); + return this; + } + + @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. + */ + @Override + public _FinalStage linkExpiryMins(Integer linkExpiryMins) { + this.linkExpiryMins = Optional.ofNullable(linkExpiryMins); + return this; + } + + @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. + */ + @Override + public _FinalStage integration(String integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @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. + */ + @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. + */ + @Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + this.categories.addAll(categories); + return this; + } + + @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/legacy/api/resources/filestorage/passthrough/PassthroughClient.java b/src/main/java/com/merge/legacy/api/resources/filestorage/passthrough/PassthroughClient.java new file mode 100644 index 000000000..21d78a824 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/passthrough/PassthroughClient.java @@ -0,0 +1,66 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.passthrough; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.filestorage.types.DataPassthroughRequest; +import com.merge.legacy.api.resources.filestorage.types.RemoteResponse; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/filestorage/regeneratekey/RegenerateKeyClient.java b/src/main/java/com/merge/legacy/api/resources/filestorage/regeneratekey/RegenerateKeyClient.java new file mode 100644 index 000000000..374d5aacc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/regeneratekey/RegenerateKeyClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.regeneratekey; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.filestorage.regeneratekey.requests.RemoteKeyForRegenerationRequest; +import com.merge.legacy.api.resources.filestorage.types.RemoteKey; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/filestorage/regeneratekey/requests/RemoteKeyForRegenerationRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/regeneratekey/requests/RemoteKeyForRegenerationRequest.java new file mode 100644 index 000000000..1bb6f6972 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/regeneratekey/requests/RemoteKeyForRegenerationRequest.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.regeneratekey.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + public RemoteKeyForRegenerationRequest build() { + return new RemoteKeyForRegenerationRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/scopes/ScopesClient.java b/src/main/java/com/merge/legacy/api/resources/filestorage/scopes/ScopesClient.java new file mode 100644 index 000000000..f887fb164 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/scopes/ScopesClient.java @@ -0,0 +1,150 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.scopes; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.filestorage.scopes.requests.LinkedAccountCommonModelScopeDeserializerRequest; +import com.merge.legacy.api.resources.filestorage.types.CommonModelScopeApi; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/filestorage/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..c11cc0937 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.scopes.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.filestorage.types.IndividualCommonModelScopeDeserializerRequest; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @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/legacy/api/resources/filestorage/syncstatus/SyncStatusClient.java b/src/main/java/com/merge/legacy/api/resources/filestorage/syncstatus/SyncStatusClient.java new file mode 100644 index 000000000..ee3a2e44b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/syncstatus/SyncStatusClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.syncstatus; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.filestorage.syncstatus.requests.SyncStatusListRequest; +import com.merge.legacy.api.resources.filestorage.types.PaginatedSyncStatusList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/filestorage/syncstatus/requests/SyncStatusListRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/syncstatus/requests/SyncStatusListRequest.java new file mode 100644 index 000000000..225744eaa --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/syncstatus/requests/SyncStatusListRequest.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.syncstatus.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.cursor, this.pageSize); + } + + @Override + 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/legacy/api/resources/filestorage/types/AccountDetails.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/AccountDetails.java new file mode 100644 index 000000000..fb29ed2fc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/AccountDetails.java @@ -0,0 +1,387 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/filestorage/types/AccountDetailsAndActions.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/AccountDetailsAndActions.java new file mode 100644 index 000000000..7ebef9be6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/AccountDetailsAndActions.java @@ -0,0 +1,474 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("id") + public StatusStage id(@NotNull String id) { + this.id = id; + return this; + } + + @Override + @JsonSetter("status") + public EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status) { + this.status = status; + return this; + } + + @Override + @JsonSetter("end_user_organization_name") + public EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + @Override + @JsonSetter("end_user_email_address") + public WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + @Override + @JsonSetter("webhook_listener_url") + public AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl) { + this.webhookListenerUrl = webhookListenerUrl; + return this; + } + + @Override + @JsonSetter("account_type") + public CompletedAtStage accountType(@NotNull String accountType) { + this.accountType = accountType; + return this; + } + + @Override + @JsonSetter("completed_at") + public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { + this.completedAt = completedAt; + return this; + } + + @Override + public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @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. + */ + @Override + public _FinalStage isDuplicate(Boolean isDuplicate) { + this.isDuplicate = Optional.ofNullable(isDuplicate); + return this; + } + + @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. + */ + @Override + public _FinalStage subdomain(String subdomain) { + this.subdomain = Optional.ofNullable(subdomain); + return this; + } + + @Override + @JsonSetter(value = "subdomain", nulls = Nulls.SKIP) + public _FinalStage subdomain(Optional subdomain) { + this.subdomain = subdomain; + return this; + } + + @Override + public _FinalStage endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @Override + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public _FinalStage endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + @Override + public _FinalStage statusDetail(String statusDetail) { + this.statusDetail = Optional.ofNullable(statusDetail); + return this; + } + + @Override + @JsonSetter(value = "status_detail", nulls = Nulls.SKIP) + public _FinalStage statusDetail(Optional statusDetail) { + this.statusDetail = statusDetail; + return this; + } + + @Override + public _FinalStage category(CategoryEnum category) { + this.category = Optional.ofNullable(category); + return this; + } + + @Override + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public _FinalStage category(Optional category) { + this.category = category; + return this; + } + + @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/legacy/api/resources/filestorage/types/AccountDetailsAndActionsIntegration.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/AccountDetailsAndActionsIntegration.java new file mode 100644 index 000000000..24bd84580 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/AccountDetailsAndActionsIntegration.java @@ -0,0 +1,317 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.categories, + this.image, + this.squareImage, + this.color, + this.slug, + this.passthroughAvailable, + this.availableModelOperations); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("name") + public ColorStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + @JsonSetter("color") + public SlugStage color(@NotNull String color) { + this.color = color; + return this; + } + + @Override + @JsonSetter("slug") + public PassthroughAvailableStage slug(@NotNull String slug) { + this.slug = slug; + return this; + } + + @Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @Override + @JsonSetter(value = "square_image", nulls = Nulls.SKIP) + public _FinalStage squareImage(Optional squareImage) { + this.squareImage = squareImage; + return this; + } + + @Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @Override + @JsonSetter(value = "image", nulls = Nulls.SKIP) + public _FinalStage image(Optional image) { + this.image = image; + return this; + } + + @Override + public _FinalStage addAllCategories(List categories) { + this.categories.addAll(categories); + return this; + } + + @Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + this.categories.addAll(categories); + return this; + } + + @Override + public AccountDetailsAndActionsIntegration build() { + return new AccountDetailsAndActionsIntegration( + name, + categories, + image, + squareImage, + color, + slug, + passthroughAvailable, + availableModelOperations, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/AccountDetailsAndActionsStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/AccountDetailsAndActionsStatusEnum.java new file mode 100644 index 000000000..18441c8c1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/AccountDetailsAndActionsStatusEnum.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/AccountIntegration.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/AccountIntegration.java new file mode 100644 index 000000000..9e95dd095 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/AccountIntegration.java @@ -0,0 +1,453 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @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); + } + + @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() {} + + @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. + */ + @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. + */ + @Override + public _FinalStage categoryBetaStatus(Map categoryBetaStatus) { + this.categoryBetaStatus = Optional.ofNullable(categoryBetaStatus); + return this; + } + + @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. + */ + @Override + public _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl) { + this.webhookSetupGuideUrl = Optional.ofNullable(webhookSetupGuideUrl); + return this; + } + + @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. + */ + @Override + public _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = Optional.ofNullable(apiEndpointsToDocumentationUrls); + return this; + } + + @Override + @JsonSetter(value = "api_endpoints_to_documentation_urls", nulls = Nulls.SKIP) + public _FinalStage apiEndpointsToDocumentationUrls( + Optional> apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; + return this; + } + + @Override + public _FinalStage slug(String slug) { + this.slug = Optional.ofNullable(slug); + return this; + } + + @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. + */ + @Override + public _FinalStage color(String color) { + this.color = Optional.ofNullable(color); + return this; + } + + @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. + */ + @Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @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. + */ + @Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @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. + */ + @Override + public _FinalStage categories(List categories) { + this.categories = Optional.ofNullable(categories); + return this; + } + + @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. + */ + @Override + public _FinalStage abbreviatedName(String abbreviatedName) { + this.abbreviatedName = Optional.ofNullable(abbreviatedName); + return this; + } + + @Override + @JsonSetter(value = "abbreviated_name", nulls = Nulls.SKIP) + public _FinalStage abbreviatedName(Optional abbreviatedName) { + this.abbreviatedName = abbreviatedName; + return this; + } + + @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/legacy/api/resources/filestorage/types/AccountToken.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/AccountToken.java new file mode 100644 index 000000000..f5a1e72e6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/AccountToken.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.accountToken, this.integration); + } + + @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() {} + + @Override + public Builder from(AccountToken other) { + accountToken(other.getAccountToken()); + integration(other.getIntegration()); + return this; + } + + @Override + @JsonSetter("account_token") + public IntegrationStage accountToken(@NotNull String accountToken) { + this.accountToken = accountToken; + return this; + } + + @Override + @JsonSetter("integration") + public _FinalStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @Override + public AccountToken build() { + return new AccountToken(accountToken, integration, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/AdvancedMetadata.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/AdvancedMetadata.java new file mode 100644 index 000000000..97491d976 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/AdvancedMetadata.java @@ -0,0 +1,250 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, this.displayName, this.description, this.isRequired, this.isCustom, this.fieldChoices); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = id; + return this; + } + + @Override + public _FinalStage fieldChoices(List fieldChoices) { + this.fieldChoices = Optional.ofNullable(fieldChoices); + return this; + } + + @Override + @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) + public _FinalStage fieldChoices(Optional> fieldChoices) { + this.fieldChoices = fieldChoices; + return this; + } + + @Override + public _FinalStage isCustom(Boolean isCustom) { + this.isCustom = Optional.ofNullable(isCustom); + return this; + } + + @Override + @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) + public _FinalStage isCustom(Optional isCustom) { + this.isCustom = isCustom; + return this; + } + + @Override + public _FinalStage isRequired(Boolean isRequired) { + this.isRequired = Optional.ofNullable(isRequired); + return this; + } + + @Override + @JsonSetter(value = "is_required", nulls = Nulls.SKIP) + public _FinalStage isRequired(Optional isRequired) { + this.isRequired = isRequired; + return this; + } + + @Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + @Override + public _FinalStage displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @Override + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public _FinalStage displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + @Override + public AdvancedMetadata build() { + return new AdvancedMetadata( + id, displayName, description, isRequired, isCustom, fieldChoices, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/AsyncPassthroughReciept.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/AsyncPassthroughReciept.java new file mode 100644 index 000000000..527b5dd67 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/AsyncPassthroughReciept.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.asyncPassthroughReceiptId); + } + + @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() {} + + @Override + public Builder from(AsyncPassthroughReciept other) { + asyncPassthroughReceiptId(other.getAsyncPassthroughReceiptId()); + return this; + } + + @Override + @JsonSetter("async_passthrough_receipt_id") + public _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId) { + this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; + return this; + } + + @Override + public AsyncPassthroughReciept build() { + return new AsyncPassthroughReciept(asyncPassthroughReceiptId, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/AuditLogEvent.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/AuditLogEvent.java new file mode 100644 index 000000000..e36f104f3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/AuditLogEvent.java @@ -0,0 +1,441 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.userName, + this.userEmail, + this.role, + this.ipAddress, + this.eventType, + this.eventDescription, + this.createdAt); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("role") + public IpAddressStage role(@NotNull AuditLogEventRole role) { + this.role = role; + return this; + } + + @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. + */ + @Override + @JsonSetter("event_type") + public EventDescriptionStage eventType(@NotNull AuditLogEventEventType eventType) { + this.eventType = eventType; + return this; + } + + @Override + @JsonSetter("event_description") + public _FinalStage eventDescription(@NotNull String eventDescription) { + this.eventDescription = eventDescription; + return this; + } + + @Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @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. + */ + @Override + public _FinalStage userEmail(String userEmail) { + this.userEmail = Optional.ofNullable(userEmail); + return this; + } + + @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. + */ + @Override + public _FinalStage userName(String userName) { + this.userName = Optional.ofNullable(userName); + return this; + } + + @Override + @JsonSetter(value = "user_name", nulls = Nulls.SKIP) + public _FinalStage userName(Optional userName) { + this.userName = userName; + return this; + } + + @Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @Override + public AuditLogEvent build() { + return new AuditLogEvent( + id, + userName, + userEmail, + role, + ipAddress, + eventType, + eventDescription, + createdAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/AuditLogEventEventType.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/AuditLogEventEventType.java new file mode 100644 index 000000000..164bd83bd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/AuditLogEventEventType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/filestorage/types/AuditLogEventRole.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/AuditLogEventRole.java new file mode 100644 index 000000000..265a2d2b0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/AuditLogEventRole.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/filestorage/types/AvailableActions.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/AvailableActions.java new file mode 100644 index 000000000..f04efc419 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/AvailableActions.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.integration, this.passthroughAvailable, this.availableModelOperations); + } + + @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() {} + + @Override + public Builder from(AvailableActions other) { + integration(other.getIntegration()); + passthroughAvailable(other.getPassthroughAvailable()); + availableModelOperations(other.getAvailableModelOperations()); + return this; + } + + @Override + @JsonSetter("integration") + public PassthroughAvailableStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @Override + public AvailableActions build() { + return new AvailableActions( + integration, passthroughAvailable, availableModelOperations, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/CategoriesEnum.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/CategoriesEnum.java new file mode 100644 index 000000000..c52088f7d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/CategoriesEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/CategoryEnum.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/CategoryEnum.java new file mode 100644 index 000000000..fc45924df --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/CategoryEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/CommonModelScopeApi.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/CommonModelScopeApi.java new file mode 100644 index 000000000..b406a5ebf --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/CommonModelScopeApi.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @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/legacy/api/resources/filestorage/types/CommonModelScopesBodyRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/CommonModelScopesBodyRequest.java new file mode 100644 index 000000000..de0e61c2c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/CommonModelScopesBodyRequest.java @@ -0,0 +1,175 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.modelId, this.enabledActions, this.disabledFields); + } + + @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() {} + + @Override + public Builder from(CommonModelScopesBodyRequest other) { + modelId(other.getModelId()); + enabledActions(other.getEnabledActions()); + disabledFields(other.getDisabledFields()); + return this; + } + + @Override + @JsonSetter("model_id") + public _FinalStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @Override + public _FinalStage addAllDisabledFields(List disabledFields) { + this.disabledFields.addAll(disabledFields); + return this; + } + + @Override + public _FinalStage addDisabledFields(String disabledFields) { + this.disabledFields.add(disabledFields); + return this; + } + + @Override + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public _FinalStage disabledFields(List disabledFields) { + this.disabledFields.clear(); + this.disabledFields.addAll(disabledFields); + return this; + } + + @Override + public _FinalStage addAllEnabledActions(List enabledActions) { + this.enabledActions.addAll(enabledActions); + return this; + } + + @Override + public _FinalStage addEnabledActions(EnabledActionsEnum enabledActions) { + this.enabledActions.add(enabledActions); + return this; + } + + @Override + @JsonSetter(value = "enabled_actions", nulls = Nulls.SKIP) + public _FinalStage enabledActions(List enabledActions) { + this.enabledActions.clear(); + this.enabledActions.addAll(enabledActions); + return this; + } + + @Override + public CommonModelScopesBodyRequest build() { + return new CommonModelScopesBodyRequest(modelId, enabledActions, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/DataPassthroughRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/DataPassthroughRequest.java new file mode 100644 index 000000000..5bed234ad --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/DataPassthroughRequest.java @@ -0,0 +1,361 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.baseUrlOverride, + this.data, + this.multipartFormData, + this.headers, + this.requestFormat, + this.normalizeResponse); + } + + @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() {} + + @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; + } + + @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. + */ + @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. + */ + @Override + public _FinalStage normalizeResponse(Boolean normalizeResponse) { + this.normalizeResponse = Optional.ofNullable(normalizeResponse); + return this; + } + + @Override + @JsonSetter(value = "normalize_response", nulls = Nulls.SKIP) + public _FinalStage normalizeResponse(Optional normalizeResponse) { + this.normalizeResponse = normalizeResponse; + return this; + } + + @Override + public _FinalStage requestFormat(RequestFormatEnum requestFormat) { + this.requestFormat = Optional.ofNullable(requestFormat); + return this; + } + + @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. + */ + @Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @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. + */ + @Override + public _FinalStage multipartFormData(List multipartFormData) { + this.multipartFormData = Optional.ofNullable(multipartFormData); + return this; + } + + @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. + */ + @Override + public _FinalStage data(String data) { + this.data = Optional.ofNullable(data); + return this; + } + + @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. + */ + @Override + public _FinalStage baseUrlOverride(String baseUrlOverride) { + this.baseUrlOverride = Optional.ofNullable(baseUrlOverride); + return this; + } + + @Override + @JsonSetter(value = "base_url_override", nulls = Nulls.SKIP) + public _FinalStage baseUrlOverride(Optional baseUrlOverride) { + this.baseUrlOverride = baseUrlOverride; + return this; + } + + @Override + public DataPassthroughRequest build() { + return new DataPassthroughRequest( + method, + path, + baseUrlOverride, + data, + multipartFormData, + headers, + requestFormat, + normalizeResponse, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/DebugModeLog.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/DebugModeLog.java new file mode 100644 index 000000000..f349cb28b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/DebugModeLog.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.logId, this.dashboardView, this.logSummary); + } + + @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() {} + + @Override + public Builder from(DebugModeLog other) { + logId(other.getLogId()); + dashboardView(other.getDashboardView()); + logSummary(other.getLogSummary()); + return this; + } + + @Override + @JsonSetter("log_id") + public DashboardViewStage logId(@NotNull String logId) { + this.logId = logId; + return this; + } + + @Override + @JsonSetter("dashboard_view") + public LogSummaryStage dashboardView(@NotNull String dashboardView) { + this.dashboardView = dashboardView; + return this; + } + + @Override + @JsonSetter("log_summary") + public _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary) { + this.logSummary = logSummary; + return this; + } + + @Override + public DebugModeLog build() { + return new DebugModeLog(logId, dashboardView, logSummary, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/DebugModelLogSummary.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/DebugModelLogSummary.java new file mode 100644 index 000000000..24a304b14 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/DebugModelLogSummary.java @@ -0,0 +1,141 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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; + } + + @Override + public int hashCode() { + return Objects.hash(this.url, this.method, this.statusCode); + } + + @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() {} + + @Override + public Builder from(DebugModelLogSummary other) { + url(other.getUrl()); + method(other.getMethod()); + statusCode(other.getStatusCode()); + return this; + } + + @Override + @JsonSetter("url") + public MethodStage url(@NotNull String url) { + this.url = url; + return this; + } + + @Override + @JsonSetter("method") + public StatusCodeStage method(@NotNull String method) { + this.method = method; + return this; + } + + @Override + @JsonSetter("status_code") + public _FinalStage statusCode(int statusCode) { + this.statusCode = statusCode; + return this; + } + + @Override + public DebugModelLogSummary build() { + return new DebugModelLogSummary(url, method, statusCode, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/Drive.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/Drive.java new file mode 100644 index 000000000..de844e7cd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/Drive.java @@ -0,0 +1,348 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Drive.Builder.class) +public final class Drive { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional remoteCreatedAt; + + private final Optional driveUrl; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Drive( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional remoteCreatedAt, + Optional driveUrl, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.remoteCreatedAt = remoteCreatedAt; + this.driveUrl = driveUrl; + 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 drive's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return When the third party's drive was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return The drive's url. + */ + @JsonProperty("drive_url") + public Optional getDriveUrl() { + return driveUrl; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Drive && equalTo((Drive) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Drive other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && driveUrl.equals(other.driveUrl) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.remoteCreatedAt, + this.driveUrl, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 remoteCreatedAt = Optional.empty(); + + private Optional driveUrl = 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(Drive other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + remoteCreatedAt(other.getRemoteCreatedAt()); + driveUrl(other.getDriveUrl()); + 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 = "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 = "drive_url", nulls = Nulls.SKIP) + public Builder driveUrl(Optional driveUrl) { + this.driveUrl = driveUrl; + return this; + } + + public Builder driveUrl(String driveUrl) { + this.driveUrl = Optional.ofNullable(driveUrl); + 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 Drive build() { + return new Drive( + id, + remoteId, + createdAt, + modifiedAt, + name, + remoteCreatedAt, + driveUrl, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/EnabledActionsEnum.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/EnabledActionsEnum.java new file mode 100644 index 000000000..90578f4d7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/EnabledActionsEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/EncodingEnum.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/EncodingEnum.java new file mode 100644 index 000000000..b1047c356 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/EncodingEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/ErrorValidationProblem.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/ErrorValidationProblem.java new file mode 100644 index 000000000..d9b3d6af0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/ErrorValidationProblem.java @@ -0,0 +1,178 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.source, this.title, this.detail, this.problemType); + } + + @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() {} + + @Override + public Builder from(ErrorValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + return this; + } + + @Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @Override + public ErrorValidationProblem build() { + return new ErrorValidationProblem(source, title, detail, problemType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/EventTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/EventTypeEnum.java new file mode 100644 index 000000000..08fe9c498 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/EventTypeEnum.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/ExternalTargetFieldApi.java new file mode 100644 index 000000000..d709cf1a0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/ExternalTargetFieldApi.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isMapped); + } + + @Override + 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/legacy/api/resources/filestorage/types/ExternalTargetFieldApiResponse.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/ExternalTargetFieldApiResponse.java new file mode 100644 index 000000000..d6a9d732d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/ExternalTargetFieldApiResponse.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.file, this.folder, this.drive, this.group, this.user); + } + + @Override + 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/legacy/api/resources/filestorage/types/FieldMappingApiInstance.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FieldMappingApiInstance.java new file mode 100644 index 000000000..cea1e7437 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FieldMappingApiInstance.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField); + } + + @Override + 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/legacy/api/resources/filestorage/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FieldMappingApiInstanceRemoteField.java new file mode 100644 index 000000000..79f1b1ad9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FieldMappingApiInstanceRemoteField.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.remoteKeyName, this.schema, this.remoteEndpointInfo); + } + + @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() {} + + @Override + public Builder from(FieldMappingApiInstanceRemoteField other) { + remoteKeyName(other.getRemoteKeyName()); + schema(other.getSchema()); + remoteEndpointInfo(other.getRemoteEndpointInfo()); + return this; + } + + @Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo( + @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @Override + public _FinalStage schema(Map schema) { + this.schema = Optional.ofNullable(schema); + return this; + } + + @Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Optional> schema) { + this.schema = schema; + return this; + } + + @Override + public _FinalStage remoteKeyName(String remoteKeyName) { + this.remoteKeyName = Optional.ofNullable(remoteKeyName); + return this; + } + + @Override + @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) + public _FinalStage remoteKeyName(Optional remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @Override + public FieldMappingApiInstanceRemoteField build() { + return new FieldMappingApiInstanceRemoteField( + remoteKeyName, schema, remoteEndpointInfo, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java new file mode 100644 index 000000000..e21c5170b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java @@ -0,0 +1,138 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @Override + 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/legacy/api/resources/filestorage/types/FieldMappingApiInstanceResponse.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FieldMappingApiInstanceResponse.java new file mode 100644 index 000000000..97773ad40 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FieldMappingApiInstanceResponse.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.file, this.folder, this.drive, this.group, this.user); + } + + @Override + 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/legacy/api/resources/filestorage/types/FieldMappingApiInstanceTargetField.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FieldMappingApiInstanceTargetField.java new file mode 100644 index 000000000..b1d7ab2c0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FieldMappingApiInstanceTargetField.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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; + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isOrganizationWide); + } + + @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() {} + + @Override + public Builder from(FieldMappingApiInstanceTargetField other) { + name(other.getName()); + description(other.getDescription()); + isOrganizationWide(other.getIsOrganizationWide()); + return this; + } + + @Override + @JsonSetter("name") + public DescriptionStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + @JsonSetter("description") + public IsOrganizationWideStage description(@NotNull String description) { + this.description = description; + return this; + } + + @Override + @JsonSetter("is_organization_wide") + public _FinalStage isOrganizationWide(boolean isOrganizationWide) { + this.isOrganizationWide = isOrganizationWide; + return this; + } + + @Override + public FieldMappingApiInstanceTargetField build() { + return new FieldMappingApiInstanceTargetField(name, description, isOrganizationWide, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/FieldMappingInstanceResponse.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FieldMappingInstanceResponse.java new file mode 100644 index 000000000..7e0083dac --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FieldMappingInstanceResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @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() {} + + @Override + public Builder from(FieldMappingInstanceResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull FieldMappingApiInstance model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public FieldMappingInstanceResponse build() { + return new FieldMappingInstanceResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/FieldPermissionDeserializer.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FieldPermissionDeserializer.java new file mode 100644 index 000000000..db2b4af5a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FieldPermissionDeserializer.java @@ -0,0 +1,112 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @Override + 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/legacy/api/resources/filestorage/types/FieldPermissionDeserializerRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FieldPermissionDeserializerRequest.java new file mode 100644 index 000000000..34fd5e94f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FieldPermissionDeserializerRequest.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @Override + 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/legacy/api/resources/filestorage/types/File.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/File.java new file mode 100644 index 000000000..b47263f3a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/File.java @@ -0,0 +1,580 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = File.Builder.class) +public final class File { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional fileUrl; + + private final Optional fileThumbnailUrl; + + private final Optional size; + + private final Optional mimeType; + + private final Optional description; + + private final Optional folder; + + private final Optional permissions; + + private final Optional drive; + + private final Optional remoteCreatedAt; + + private final Optional remoteUpdatedAt; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private File( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional fileUrl, + Optional fileThumbnailUrl, + Optional size, + Optional mimeType, + Optional description, + Optional folder, + Optional permissions, + Optional drive, + Optional remoteCreatedAt, + Optional remoteUpdatedAt, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.fileUrl = fileUrl; + this.fileThumbnailUrl = fileThumbnailUrl; + this.size = size; + this.mimeType = mimeType; + this.description = description; + this.folder = folder; + this.permissions = permissions; + this.drive = drive; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteUpdatedAt = remoteUpdatedAt; + 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 file's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The URL to access the file. + */ + @JsonProperty("file_url") + public Optional getFileUrl() { + return fileUrl; + } + + /** + * @return The URL that produces a thumbnail preview of the file. Typically an image. + */ + @JsonProperty("file_thumbnail_url") + public Optional getFileThumbnailUrl() { + return fileThumbnailUrl; + } + + /** + * @return The file's size, in bytes. + */ + @JsonProperty("size") + public Optional getSize() { + return size; + } + + /** + * @return The file's mime type. + */ + @JsonProperty("mime_type") + public Optional getMimeType() { + return mimeType; + } + + /** + * @return The file's description. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The folder that the file belongs to. + */ + @JsonProperty("folder") + public Optional getFolder() { + return folder; + } + + /** + * @return The Permission object is used to represent a user's or group's access to a File or Folder. Permissions are unexpanded by default. Use the query param expand=permissions to see more details under GET /files. + */ + @JsonProperty("permissions") + public Optional getPermissions() { + return permissions; + } + + /** + * @return The drive that the file belongs to. + */ + @JsonProperty("drive") + public Optional getDrive() { + return drive; + } + + /** + * @return When the third party's file was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the third party's file was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof File && equalTo((File) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(File other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && fileUrl.equals(other.fileUrl) + && fileThumbnailUrl.equals(other.fileThumbnailUrl) + && size.equals(other.size) + && mimeType.equals(other.mimeType) + && description.equals(other.description) + && folder.equals(other.folder) + && permissions.equals(other.permissions) + && drive.equals(other.drive) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.fileUrl, + this.fileThumbnailUrl, + this.size, + this.mimeType, + this.description, + this.folder, + this.permissions, + this.drive, + this.remoteCreatedAt, + this.remoteUpdatedAt, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 fileUrl = Optional.empty(); + + private Optional fileThumbnailUrl = Optional.empty(); + + private Optional size = Optional.empty(); + + private Optional mimeType = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional folder = Optional.empty(); + + private Optional permissions = Optional.empty(); + + private Optional drive = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteUpdatedAt = 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(File other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + fileUrl(other.getFileUrl()); + fileThumbnailUrl(other.getFileThumbnailUrl()); + size(other.getSize()); + mimeType(other.getMimeType()); + description(other.getDescription()); + folder(other.getFolder()); + permissions(other.getPermissions()); + drive(other.getDrive()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + 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 = "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 = "file_thumbnail_url", nulls = Nulls.SKIP) + public Builder fileThumbnailUrl(Optional fileThumbnailUrl) { + this.fileThumbnailUrl = fileThumbnailUrl; + return this; + } + + public Builder fileThumbnailUrl(String fileThumbnailUrl) { + this.fileThumbnailUrl = Optional.ofNullable(fileThumbnailUrl); + return this; + } + + @JsonSetter(value = "size", nulls = Nulls.SKIP) + public Builder size(Optional size) { + this.size = size; + return this; + } + + public Builder size(Long size) { + this.size = Optional.ofNullable(size); + 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 = "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 = "folder", nulls = Nulls.SKIP) + public Builder folder(Optional folder) { + this.folder = folder; + return this; + } + + public Builder folder(FileFolder folder) { + this.folder = Optional.ofNullable(folder); + return this; + } + + @JsonSetter(value = "permissions", nulls = Nulls.SKIP) + public Builder permissions(Optional permissions) { + this.permissions = permissions; + return this; + } + + public Builder permissions(FilePermissions permissions) { + this.permissions = Optional.ofNullable(permissions); + return this; + } + + @JsonSetter(value = "drive", nulls = Nulls.SKIP) + public Builder drive(Optional drive) { + this.drive = drive; + return this; + } + + public Builder drive(FileDrive drive) { + this.drive = Optional.ofNullable(drive); + 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_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_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 File build() { + return new File( + id, + remoteId, + createdAt, + modifiedAt, + name, + fileUrl, + fileThumbnailUrl, + size, + mimeType, + description, + folder, + permissions, + drive, + remoteCreatedAt, + remoteUpdatedAt, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileDrive.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileDrive.java new file mode 100644 index 000000000..e5ede0c22 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileDrive.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FileDrive.Deserializer.class) +public final class FileDrive { + private final Object value; + + private final int type; + + private FileDrive(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((Drive) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FileDrive && equalTo((FileDrive) other); + } + + private boolean equalTo(FileDrive other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static FileDrive of(String value) { + return new FileDrive(value, 0); + } + + public static FileDrive of(Drive value) { + return new FileDrive(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Drive value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FileDrive.class); + } + + @Override + public FileDrive 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, Drive.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileFolder.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileFolder.java new file mode 100644 index 000000000..f1ffad2d4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileFolder.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FileFolder.Deserializer.class) +public final class FileFolder { + private final Object value; + + private final int type; + + private FileFolder(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((Folder) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FileFolder && equalTo((FileFolder) other); + } + + private boolean equalTo(FileFolder other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static FileFolder of(String value) { + return new FileFolder(value, 0); + } + + public static FileFolder of(Folder value) { + return new FileFolder(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Folder value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FileFolder.class); + } + + @Override + public FileFolder 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, Folder.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/FilePermissions.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FilePermissions.java new file mode 100644 index 000000000..58ee3964c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FilePermissions.java @@ -0,0 +1,109 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.List; +import java.util.Objects; + +@JsonDeserialize(using = FilePermissions.Deserializer.class) +public final class FilePermissions { + private final Object value; + + private final int type; + + private FilePermissions(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((PermissionRequest) this.value); + } else if (this.type == 2) { + return visitor.visit((List) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FilePermissions && equalTo((FilePermissions) other); + } + + private boolean equalTo(FilePermissions other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static FilePermissions of(String value) { + return new FilePermissions(value, 0); + } + + public static FilePermissions of(PermissionRequest value) { + return new FilePermissions(value, 1); + } + + public static FilePermissions of(List value) { + return new FilePermissions(value, 2); + } + + public interface Visitor { + T visit(String value); + + T visit(PermissionRequest value); + + T visit(List value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FilePermissions.class); + } + + @Override + public FilePermissions 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, PermissionRequest.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, new TypeReference>() {})); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/FilePermissionsItem.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FilePermissionsItem.java new file mode 100644 index 000000000..102e4361c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FilePermissionsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FilePermissionsItem.Deserializer.class) +public final class FilePermissionsItem { + private final Object value; + + private final int type; + + private FilePermissionsItem(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((PermissionRequest) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FilePermissionsItem && equalTo((FilePermissionsItem) other); + } + + private boolean equalTo(FilePermissionsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static FilePermissionsItem of(String value) { + return new FilePermissionsItem(value, 0); + } + + public static FilePermissionsItem of(PermissionRequest value) { + return new FilePermissionsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PermissionRequest value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FilePermissionsItem.class); + } + + @Override + public FilePermissionsItem 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, PermissionRequest.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileRequest.java new file mode 100644 index 000000000..216ce285a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileRequest.java @@ -0,0 +1,382 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = FileRequest.Builder.class) +public final class FileRequest { + private final Optional name; + + private final Optional fileUrl; + + private final Optional fileThumbnailUrl; + + private final Optional size; + + private final Optional mimeType; + + private final Optional description; + + private final Optional folder; + + private final Optional permissions; + + private final Optional drive; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private FileRequest( + Optional name, + Optional fileUrl, + Optional fileThumbnailUrl, + Optional size, + Optional mimeType, + Optional description, + Optional folder, + Optional permissions, + Optional drive, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.name = name; + this.fileUrl = fileUrl; + this.fileThumbnailUrl = fileThumbnailUrl; + this.size = size; + this.mimeType = mimeType; + this.description = description; + this.folder = folder; + this.permissions = permissions; + this.drive = drive; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The file's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The URL to access the file. + */ + @JsonProperty("file_url") + public Optional getFileUrl() { + return fileUrl; + } + + /** + * @return The URL that produces a thumbnail preview of the file. Typically an image. + */ + @JsonProperty("file_thumbnail_url") + public Optional getFileThumbnailUrl() { + return fileThumbnailUrl; + } + + /** + * @return The file's size, in bytes. + */ + @JsonProperty("size") + public Optional getSize() { + return size; + } + + /** + * @return The file's mime type. + */ + @JsonProperty("mime_type") + public Optional getMimeType() { + return mimeType; + } + + /** + * @return The file's description. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The folder that the file belongs to. + */ + @JsonProperty("folder") + public Optional getFolder() { + return folder; + } + + /** + * @return The Permission object is used to represent a user's or group's access to a File or Folder. Permissions are unexpanded by default. Use the query param expand=permissions to see more details under GET /files. + */ + @JsonProperty("permissions") + public Optional getPermissions() { + return permissions; + } + + /** + * @return The drive that the file belongs to. + */ + @JsonProperty("drive") + public Optional getDrive() { + return drive; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FileRequest && equalTo((FileRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FileRequest other) { + return name.equals(other.name) + && fileUrl.equals(other.fileUrl) + && fileThumbnailUrl.equals(other.fileThumbnailUrl) + && size.equals(other.size) + && mimeType.equals(other.mimeType) + && description.equals(other.description) + && folder.equals(other.folder) + && permissions.equals(other.permissions) + && drive.equals(other.drive) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.fileUrl, + this.fileThumbnailUrl, + this.size, + this.mimeType, + this.description, + this.folder, + this.permissions, + this.drive, + this.integrationParams, + this.linkedAccountParams); + } + + @Override + 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 fileUrl = Optional.empty(); + + private Optional fileThumbnailUrl = Optional.empty(); + + private Optional size = Optional.empty(); + + private Optional mimeType = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional folder = Optional.empty(); + + private Optional permissions = Optional.empty(); + + private Optional drive = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FileRequest other) { + name(other.getName()); + fileUrl(other.getFileUrl()); + fileThumbnailUrl(other.getFileThumbnailUrl()); + size(other.getSize()); + mimeType(other.getMimeType()); + description(other.getDescription()); + folder(other.getFolder()); + permissions(other.getPermissions()); + drive(other.getDrive()); + 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 = "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 = "file_thumbnail_url", nulls = Nulls.SKIP) + public Builder fileThumbnailUrl(Optional fileThumbnailUrl) { + this.fileThumbnailUrl = fileThumbnailUrl; + return this; + } + + public Builder fileThumbnailUrl(String fileThumbnailUrl) { + this.fileThumbnailUrl = Optional.ofNullable(fileThumbnailUrl); + return this; + } + + @JsonSetter(value = "size", nulls = Nulls.SKIP) + public Builder size(Optional size) { + this.size = size; + return this; + } + + public Builder size(Long size) { + this.size = Optional.ofNullable(size); + 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 = "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 = "folder", nulls = Nulls.SKIP) + public Builder folder(Optional folder) { + this.folder = folder; + return this; + } + + public Builder folder(FileRequestFolder folder) { + this.folder = Optional.ofNullable(folder); + return this; + } + + @JsonSetter(value = "permissions", nulls = Nulls.SKIP) + public Builder permissions(Optional permissions) { + this.permissions = permissions; + return this; + } + + public Builder permissions(FileRequestPermissions permissions) { + this.permissions = Optional.ofNullable(permissions); + return this; + } + + @JsonSetter(value = "drive", nulls = Nulls.SKIP) + public Builder drive(Optional drive) { + this.drive = drive; + return this; + } + + public Builder drive(FileRequestDrive drive) { + this.drive = Optional.ofNullable(drive); + 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 FileRequest build() { + return new FileRequest( + name, + fileUrl, + fileThumbnailUrl, + size, + mimeType, + description, + folder, + permissions, + drive, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileRequestDrive.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileRequestDrive.java new file mode 100644 index 000000000..62c16dbf9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileRequestDrive.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FileRequestDrive.Deserializer.class) +public final class FileRequestDrive { + private final Object value; + + private final int type; + + private FileRequestDrive(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((Drive) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FileRequestDrive && equalTo((FileRequestDrive) other); + } + + private boolean equalTo(FileRequestDrive other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static FileRequestDrive of(String value) { + return new FileRequestDrive(value, 0); + } + + public static FileRequestDrive of(Drive value) { + return new FileRequestDrive(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Drive value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FileRequestDrive.class); + } + + @Override + public FileRequestDrive 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, Drive.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileRequestFolder.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileRequestFolder.java new file mode 100644 index 000000000..0175559b0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileRequestFolder.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FileRequestFolder.Deserializer.class) +public final class FileRequestFolder { + private final Object value; + + private final int type; + + private FileRequestFolder(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((Folder) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FileRequestFolder && equalTo((FileRequestFolder) other); + } + + private boolean equalTo(FileRequestFolder other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static FileRequestFolder of(String value) { + return new FileRequestFolder(value, 0); + } + + public static FileRequestFolder of(Folder value) { + return new FileRequestFolder(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Folder value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FileRequestFolder.class); + } + + @Override + public FileRequestFolder 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, Folder.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileRequestPermissions.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileRequestPermissions.java new file mode 100644 index 000000000..4d5274bd8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileRequestPermissions.java @@ -0,0 +1,109 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.List; +import java.util.Objects; + +@JsonDeserialize(using = FileRequestPermissions.Deserializer.class) +public final class FileRequestPermissions { + private final Object value; + + private final int type; + + private FileRequestPermissions(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((PermissionRequest) this.value); + } else if (this.type == 2) { + return visitor.visit((List) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FileRequestPermissions && equalTo((FileRequestPermissions) other); + } + + private boolean equalTo(FileRequestPermissions other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static FileRequestPermissions of(String value) { + return new FileRequestPermissions(value, 0); + } + + public static FileRequestPermissions of(PermissionRequest value) { + return new FileRequestPermissions(value, 1); + } + + public static FileRequestPermissions of(List value) { + return new FileRequestPermissions(value, 2); + } + + public interface Visitor { + T visit(String value); + + T visit(PermissionRequest value); + + T visit(List value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FileRequestPermissions.class); + } + + @Override + public FileRequestPermissions 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, PermissionRequest.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, new TypeReference>() {})); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileRequestPermissionsItem.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileRequestPermissionsItem.java new file mode 100644 index 000000000..62cddc36c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileRequestPermissionsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FileRequestPermissionsItem.Deserializer.class) +public final class FileRequestPermissionsItem { + private final Object value; + + private final int type; + + private FileRequestPermissionsItem(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((PermissionRequest) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FileRequestPermissionsItem && equalTo((FileRequestPermissionsItem) other); + } + + private boolean equalTo(FileRequestPermissionsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static FileRequestPermissionsItem of(String value) { + return new FileRequestPermissionsItem(value, 0); + } + + public static FileRequestPermissionsItem of(PermissionRequest value) { + return new FileRequestPermissionsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PermissionRequest value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FileRequestPermissionsItem.class); + } + + @Override + public FileRequestPermissionsItem 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, PermissionRequest.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileStorageFileResponse.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileStorageFileResponse.java new file mode 100644 index 000000000..ce11c1241 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileStorageFileResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FileStorageFileResponse.Builder.class) +public final class FileStorageFileResponse { + private final File model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private FileStorageFileResponse( + File 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 File getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FileStorageFileResponse && equalTo((FileStorageFileResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FileStorageFileResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull File model); + + Builder from(FileStorageFileResponse other); + } + + public interface _FinalStage { + FileStorageFileResponse 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 File model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(FileStorageFileResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull File model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public FileStorageFileResponse build() { + return new FileStorageFileResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileStorageFolderResponse.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileStorageFolderResponse.java new file mode 100644 index 000000000..faa5e3dbe --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FileStorageFolderResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FileStorageFolderResponse.Builder.class) +public final class FileStorageFolderResponse { + private final Folder model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private FileStorageFolderResponse( + Folder 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 Folder getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FileStorageFolderResponse && equalTo((FileStorageFolderResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FileStorageFolderResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull Folder model); + + Builder from(FileStorageFolderResponse other); + } + + public interface _FinalStage { + FileStorageFolderResponse 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 Folder model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(FileStorageFolderResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull Folder model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public FileStorageFolderResponse build() { + return new FileStorageFolderResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/Folder.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/Folder.java new file mode 100644 index 000000000..884ba4a6f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/Folder.java @@ -0,0 +1,522 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Folder.Builder.class) +public final class Folder { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional folderUrl; + + private final Optional size; + + private final Optional description; + + private final Optional parentFolder; + + private final Optional drive; + + private final Optional permissions; + + private final Optional remoteCreatedAt; + + private final Optional remoteUpdatedAt; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Folder( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional folderUrl, + Optional size, + Optional description, + Optional parentFolder, + Optional drive, + Optional permissions, + Optional remoteCreatedAt, + Optional remoteUpdatedAt, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.folderUrl = folderUrl; + this.size = size; + this.description = description; + this.parentFolder = parentFolder; + this.drive = drive; + this.permissions = permissions; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteUpdatedAt = remoteUpdatedAt; + 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 folder's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The URL to access the folder. + */ + @JsonProperty("folder_url") + public Optional getFolderUrl() { + return folderUrl; + } + + /** + * @return The folder's size, in bytes. + */ + @JsonProperty("size") + public Optional getSize() { + return size; + } + + /** + * @return The folder's description. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The folder that the folder belongs to. + */ + @JsonProperty("parent_folder") + public Optional getParentFolder() { + return parentFolder; + } + + /** + * @return The drive that the folder belongs to. + */ + @JsonProperty("drive") + public Optional getDrive() { + return drive; + } + + /** + * @return The Permission object is used to represent a user's or group's access to a File or Folder. Permissions are unexpanded by default. Use the query param expand=permissions to see more details under GET /folders. + */ + @JsonProperty("permissions") + public Optional getPermissions() { + return permissions; + } + + /** + * @return When the third party's folder was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the third party's folder was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Folder && equalTo((Folder) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Folder other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && folderUrl.equals(other.folderUrl) + && size.equals(other.size) + && description.equals(other.description) + && parentFolder.equals(other.parentFolder) + && drive.equals(other.drive) + && permissions.equals(other.permissions) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.folderUrl, + this.size, + this.description, + this.parentFolder, + this.drive, + this.permissions, + this.remoteCreatedAt, + this.remoteUpdatedAt, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 folderUrl = Optional.empty(); + + private Optional size = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional parentFolder = Optional.empty(); + + private Optional drive = Optional.empty(); + + private Optional permissions = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteUpdatedAt = 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(Folder other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + folderUrl(other.getFolderUrl()); + size(other.getSize()); + description(other.getDescription()); + parentFolder(other.getParentFolder()); + drive(other.getDrive()); + permissions(other.getPermissions()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + 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 = "folder_url", nulls = Nulls.SKIP) + public Builder folderUrl(Optional folderUrl) { + this.folderUrl = folderUrl; + return this; + } + + public Builder folderUrl(String folderUrl) { + this.folderUrl = Optional.ofNullable(folderUrl); + return this; + } + + @JsonSetter(value = "size", nulls = Nulls.SKIP) + public Builder size(Optional size) { + this.size = size; + return this; + } + + public Builder size(Long size) { + this.size = Optional.ofNullable(size); + 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 = "parent_folder", nulls = Nulls.SKIP) + public Builder parentFolder(Optional parentFolder) { + this.parentFolder = parentFolder; + return this; + } + + public Builder parentFolder(FolderParentFolder parentFolder) { + this.parentFolder = Optional.ofNullable(parentFolder); + return this; + } + + @JsonSetter(value = "drive", nulls = Nulls.SKIP) + public Builder drive(Optional drive) { + this.drive = drive; + return this; + } + + public Builder drive(FolderDrive drive) { + this.drive = Optional.ofNullable(drive); + return this; + } + + @JsonSetter(value = "permissions", nulls = Nulls.SKIP) + public Builder permissions(Optional permissions) { + this.permissions = permissions; + return this; + } + + public Builder permissions(FolderPermissions permissions) { + this.permissions = Optional.ofNullable(permissions); + 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_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_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 Folder build() { + return new Folder( + id, + remoteId, + createdAt, + modifiedAt, + name, + folderUrl, + size, + description, + parentFolder, + drive, + permissions, + remoteCreatedAt, + remoteUpdatedAt, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderDrive.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderDrive.java new file mode 100644 index 000000000..644f483af --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderDrive.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FolderDrive.Deserializer.class) +public final class FolderDrive { + private final Object value; + + private final int type; + + private FolderDrive(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((Drive) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FolderDrive && equalTo((FolderDrive) other); + } + + private boolean equalTo(FolderDrive other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static FolderDrive of(String value) { + return new FolderDrive(value, 0); + } + + public static FolderDrive of(Drive value) { + return new FolderDrive(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Drive value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FolderDrive.class); + } + + @Override + public FolderDrive 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, Drive.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderParentFolder.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderParentFolder.java new file mode 100644 index 000000000..fbd7a837d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderParentFolder.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FolderParentFolder.Deserializer.class) +public final class FolderParentFolder { + private final Object value; + + private final int type; + + private FolderParentFolder(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((Folder) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FolderParentFolder && equalTo((FolderParentFolder) other); + } + + private boolean equalTo(FolderParentFolder other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static FolderParentFolder of(String value) { + return new FolderParentFolder(value, 0); + } + + public static FolderParentFolder of(Folder value) { + return new FolderParentFolder(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Folder value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FolderParentFolder.class); + } + + @Override + public FolderParentFolder 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, Folder.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderPermissions.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderPermissions.java new file mode 100644 index 000000000..e36aca145 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderPermissions.java @@ -0,0 +1,109 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.List; +import java.util.Objects; + +@JsonDeserialize(using = FolderPermissions.Deserializer.class) +public final class FolderPermissions { + private final Object value; + + private final int type; + + private FolderPermissions(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((PermissionRequest) this.value); + } else if (this.type == 2) { + return visitor.visit((List) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FolderPermissions && equalTo((FolderPermissions) other); + } + + private boolean equalTo(FolderPermissions other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static FolderPermissions of(String value) { + return new FolderPermissions(value, 0); + } + + public static FolderPermissions of(PermissionRequest value) { + return new FolderPermissions(value, 1); + } + + public static FolderPermissions of(List value) { + return new FolderPermissions(value, 2); + } + + public interface Visitor { + T visit(String value); + + T visit(PermissionRequest value); + + T visit(List value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FolderPermissions.class); + } + + @Override + public FolderPermissions 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, PermissionRequest.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, new TypeReference>() {})); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderPermissionsItem.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderPermissionsItem.java new file mode 100644 index 000000000..f2cb144bd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderPermissionsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FolderPermissionsItem.Deserializer.class) +public final class FolderPermissionsItem { + private final Object value; + + private final int type; + + private FolderPermissionsItem(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((PermissionRequest) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FolderPermissionsItem && equalTo((FolderPermissionsItem) other); + } + + private boolean equalTo(FolderPermissionsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static FolderPermissionsItem of(String value) { + return new FolderPermissionsItem(value, 0); + } + + public static FolderPermissionsItem of(PermissionRequest value) { + return new FolderPermissionsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PermissionRequest value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FolderPermissionsItem.class); + } + + @Override + public FolderPermissionsItem 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, PermissionRequest.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderRequest.java new file mode 100644 index 000000000..963f6f8ef --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderRequest.java @@ -0,0 +1,324 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = FolderRequest.Builder.class) +public final class FolderRequest { + private final Optional name; + + private final Optional folderUrl; + + private final Optional size; + + private final Optional description; + + private final Optional parentFolder; + + private final Optional drive; + + private final Optional permissions; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private FolderRequest( + Optional name, + Optional folderUrl, + Optional size, + Optional description, + Optional parentFolder, + Optional drive, + Optional permissions, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.name = name; + this.folderUrl = folderUrl; + this.size = size; + this.description = description; + this.parentFolder = parentFolder; + this.drive = drive; + this.permissions = permissions; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The folder's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The URL to access the folder. + */ + @JsonProperty("folder_url") + public Optional getFolderUrl() { + return folderUrl; + } + + /** + * @return The folder's size, in bytes. + */ + @JsonProperty("size") + public Optional getSize() { + return size; + } + + /** + * @return The folder's description. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The folder that the folder belongs to. + */ + @JsonProperty("parent_folder") + public Optional getParentFolder() { + return parentFolder; + } + + /** + * @return The drive that the folder belongs to. + */ + @JsonProperty("drive") + public Optional getDrive() { + return drive; + } + + /** + * @return The Permission object is used to represent a user's or group's access to a File or Folder. Permissions are unexpanded by default. Use the query param expand=permissions to see more details under GET /folders. + */ + @JsonProperty("permissions") + public Optional getPermissions() { + return permissions; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FolderRequest && equalTo((FolderRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FolderRequest other) { + return name.equals(other.name) + && folderUrl.equals(other.folderUrl) + && size.equals(other.size) + && description.equals(other.description) + && parentFolder.equals(other.parentFolder) + && drive.equals(other.drive) + && permissions.equals(other.permissions) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.folderUrl, + this.size, + this.description, + this.parentFolder, + this.drive, + this.permissions, + this.integrationParams, + this.linkedAccountParams); + } + + @Override + 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 folderUrl = Optional.empty(); + + private Optional size = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional parentFolder = Optional.empty(); + + private Optional drive = Optional.empty(); + + private Optional permissions = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FolderRequest other) { + name(other.getName()); + folderUrl(other.getFolderUrl()); + size(other.getSize()); + description(other.getDescription()); + parentFolder(other.getParentFolder()); + drive(other.getDrive()); + permissions(other.getPermissions()); + 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 = "folder_url", nulls = Nulls.SKIP) + public Builder folderUrl(Optional folderUrl) { + this.folderUrl = folderUrl; + return this; + } + + public Builder folderUrl(String folderUrl) { + this.folderUrl = Optional.ofNullable(folderUrl); + return this; + } + + @JsonSetter(value = "size", nulls = Nulls.SKIP) + public Builder size(Optional size) { + this.size = size; + return this; + } + + public Builder size(Long size) { + this.size = Optional.ofNullable(size); + 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 = "parent_folder", nulls = Nulls.SKIP) + public Builder parentFolder(Optional parentFolder) { + this.parentFolder = parentFolder; + return this; + } + + public Builder parentFolder(FolderRequestParentFolder parentFolder) { + this.parentFolder = Optional.ofNullable(parentFolder); + return this; + } + + @JsonSetter(value = "drive", nulls = Nulls.SKIP) + public Builder drive(Optional drive) { + this.drive = drive; + return this; + } + + public Builder drive(FolderRequestDrive drive) { + this.drive = Optional.ofNullable(drive); + return this; + } + + @JsonSetter(value = "permissions", nulls = Nulls.SKIP) + public Builder permissions(Optional permissions) { + this.permissions = permissions; + return this; + } + + public Builder permissions(FolderRequestPermissions permissions) { + this.permissions = Optional.ofNullable(permissions); + 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 FolderRequest build() { + return new FolderRequest( + name, + folderUrl, + size, + description, + parentFolder, + drive, + permissions, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderRequestDrive.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderRequestDrive.java new file mode 100644 index 000000000..5b61b503f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderRequestDrive.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FolderRequestDrive.Deserializer.class) +public final class FolderRequestDrive { + private final Object value; + + private final int type; + + private FolderRequestDrive(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((Drive) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FolderRequestDrive && equalTo((FolderRequestDrive) other); + } + + private boolean equalTo(FolderRequestDrive other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static FolderRequestDrive of(String value) { + return new FolderRequestDrive(value, 0); + } + + public static FolderRequestDrive of(Drive value) { + return new FolderRequestDrive(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Drive value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FolderRequestDrive.class); + } + + @Override + public FolderRequestDrive 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, Drive.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderRequestParentFolder.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderRequestParentFolder.java new file mode 100644 index 000000000..944f2f757 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderRequestParentFolder.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FolderRequestParentFolder.Deserializer.class) +public final class FolderRequestParentFolder { + private final Object value; + + private final int type; + + private FolderRequestParentFolder(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((Folder) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FolderRequestParentFolder && equalTo((FolderRequestParentFolder) other); + } + + private boolean equalTo(FolderRequestParentFolder other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static FolderRequestParentFolder of(String value) { + return new FolderRequestParentFolder(value, 0); + } + + public static FolderRequestParentFolder of(Folder value) { + return new FolderRequestParentFolder(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Folder value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FolderRequestParentFolder.class); + } + + @Override + public FolderRequestParentFolder 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, Folder.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderRequestPermissions.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderRequestPermissions.java new file mode 100644 index 000000000..a07679d24 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderRequestPermissions.java @@ -0,0 +1,109 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.List; +import java.util.Objects; + +@JsonDeserialize(using = FolderRequestPermissions.Deserializer.class) +public final class FolderRequestPermissions { + private final Object value; + + private final int type; + + private FolderRequestPermissions(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((PermissionRequest) this.value); + } else if (this.type == 2) { + return visitor.visit((List) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FolderRequestPermissions && equalTo((FolderRequestPermissions) other); + } + + private boolean equalTo(FolderRequestPermissions other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static FolderRequestPermissions of(String value) { + return new FolderRequestPermissions(value, 0); + } + + public static FolderRequestPermissions of(PermissionRequest value) { + return new FolderRequestPermissions(value, 1); + } + + public static FolderRequestPermissions of(List value) { + return new FolderRequestPermissions(value, 2); + } + + public interface Visitor { + T visit(String value); + + T visit(PermissionRequest value); + + T visit(List value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FolderRequestPermissions.class); + } + + @Override + public FolderRequestPermissions 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, PermissionRequest.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, new TypeReference>() {})); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderRequestPermissionsItem.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderRequestPermissionsItem.java new file mode 100644 index 000000000..276e40df9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/FolderRequestPermissionsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = FolderRequestPermissionsItem.Deserializer.class) +public final class FolderRequestPermissionsItem { + private final Object value; + + private final int type; + + private FolderRequestPermissionsItem(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((PermissionRequest) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FolderRequestPermissionsItem && equalTo((FolderRequestPermissionsItem) other); + } + + private boolean equalTo(FolderRequestPermissionsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static FolderRequestPermissionsItem of(String value) { + return new FolderRequestPermissionsItem(value, 0); + } + + public static FolderRequestPermissionsItem of(PermissionRequest value) { + return new FolderRequestPermissionsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PermissionRequest value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(FolderRequestPermissionsItem.class); + } + + @Override + public FolderRequestPermissionsItem 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, PermissionRequest.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/Group.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/Group.java new file mode 100644 index 000000000..d6e6c7d0b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/Group.java @@ -0,0 +1,354 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/filestorage/types/GroupChildGroupsItem.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/GroupChildGroupsItem.java new file mode 100644 index 000000000..7b88055a4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/GroupChildGroupsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = GroupChildGroupsItem.Deserializer.class) +public final class GroupChildGroupsItem { + private final Object value; + + private final int type; + + private GroupChildGroupsItem(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((Group) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GroupChildGroupsItem && equalTo((GroupChildGroupsItem) other); + } + + private boolean equalTo(GroupChildGroupsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static GroupChildGroupsItem of(String value) { + return new GroupChildGroupsItem(value, 0); + } + + public static GroupChildGroupsItem of(Group value) { + return new GroupChildGroupsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Group value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(GroupChildGroupsItem.class); + } + + @Override + public GroupChildGroupsItem 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, Group.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/IndividualCommonModelScopeDeserializer.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/IndividualCommonModelScopeDeserializer.java new file mode 100644 index 000000000..81d9499fc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/IndividualCommonModelScopeDeserializer.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @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() {} + + @Override + public Builder from(IndividualCommonModelScopeDeserializer other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @Override + public _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions(Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @Override + public IndividualCommonModelScopeDeserializer build() { + return new IndividualCommonModelScopeDeserializer( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/IndividualCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/IndividualCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..76c8eb403 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/IndividualCommonModelScopeDeserializerRequest.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @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() {} + + @Override + public Builder from(IndividualCommonModelScopeDeserializerRequest other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @Override + public _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions( + Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @Override + public IndividualCommonModelScopeDeserializerRequest build() { + return new IndividualCommonModelScopeDeserializerRequest( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/Issue.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/Issue.java new file mode 100644 index 000000000..852784ae3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/Issue.java @@ -0,0 +1,341 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.status, + this.errorDescription, + this.endUser, + this.firstIncidentTime, + this.lastIncidentTime, + this.isMuted, + this.errorDetails); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("error_description") + public _FinalStage errorDescription(@NotNull String errorDescription) { + this.errorDescription = errorDescription; + return this; + } + + @Override + public _FinalStage errorDetails(List errorDetails) { + this.errorDetails = Optional.ofNullable(errorDetails); + return this; + } + + @Override + @JsonSetter(value = "error_details", nulls = Nulls.SKIP) + public _FinalStage errorDetails(Optional> errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + @Override + public _FinalStage isMuted(Boolean isMuted) { + this.isMuted = Optional.ofNullable(isMuted); + return this; + } + + @Override + @JsonSetter(value = "is_muted", nulls = Nulls.SKIP) + public _FinalStage isMuted(Optional isMuted) { + this.isMuted = isMuted; + return this; + } + + @Override + public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { + this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); + return this; + } + + @Override + @JsonSetter(value = "last_incident_time", nulls = Nulls.SKIP) + public _FinalStage lastIncidentTime(Optional lastIncidentTime) { + this.lastIncidentTime = lastIncidentTime; + return this; + } + + @Override + public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { + this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); + return this; + } + + @Override + @JsonSetter(value = "first_incident_time", nulls = Nulls.SKIP) + public _FinalStage firstIncidentTime(Optional firstIncidentTime) { + this.firstIncidentTime = firstIncidentTime; + return this; + } + + @Override + public _FinalStage endUser(Map endUser) { + this.endUser = Optional.ofNullable(endUser); + return this; + } + + @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. + */ + @Override + public _FinalStage status(IssueStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @Override + public Issue build() { + return new Issue( + id, + status, + errorDescription, + endUser, + firstIncidentTime, + lastIncidentTime, + isMuted, + errorDetails, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/IssueStatus.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/IssueStatus.java new file mode 100644 index 000000000..f0e27cb4f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/IssueStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/filestorage/types/IssueStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/IssueStatusEnum.java new file mode 100644 index 000000000..5ba6b8f9c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/IssueStatusEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/LanguageEnum.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/LanguageEnum.java new file mode 100644 index 000000000..2f185eea5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/LanguageEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/LinkToken.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/LinkToken.java new file mode 100644 index 000000000..d8d8aa3c1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/LinkToken.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.linkToken, this.integrationName, this.magicLinkUrl); + } + + @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() {} + + @Override + public Builder from(LinkToken other) { + linkToken(other.getLinkToken()); + integrationName(other.getIntegrationName()); + magicLinkUrl(other.getMagicLinkUrl()); + return this; + } + + @Override + @JsonSetter("link_token") + public _FinalStage linkToken(@NotNull String linkToken) { + this.linkToken = linkToken; + return this; + } + + @Override + public _FinalStage magicLinkUrl(String magicLinkUrl) { + this.magicLinkUrl = Optional.ofNullable(magicLinkUrl); + return this; + } + + @Override + @JsonSetter(value = "magic_link_url", nulls = Nulls.SKIP) + public _FinalStage magicLinkUrl(Optional magicLinkUrl) { + this.magicLinkUrl = magicLinkUrl; + return this; + } + + @Override + public _FinalStage integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @Override + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public _FinalStage integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + @Override + public LinkToken build() { + return new LinkToken(linkToken, integrationName, magicLinkUrl, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/LinkedAccountStatus.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/LinkedAccountStatus.java new file mode 100644 index 000000000..fd9125fd5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/LinkedAccountStatus.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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; + } + + @Override + public int hashCode() { + return Objects.hash(this.linkedAccountStatus, this.canMakeRequest); + } + + @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() {} + + @Override + public Builder from(LinkedAccountStatus other) { + linkedAccountStatus(other.getLinkedAccountStatus()); + canMakeRequest(other.getCanMakeRequest()); + return this; + } + + @Override + @JsonSetter("linked_account_status") + public CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus) { + this.linkedAccountStatus = linkedAccountStatus; + return this; + } + + @Override + @JsonSetter("can_make_request") + public _FinalStage canMakeRequest(boolean canMakeRequest) { + this.canMakeRequest = canMakeRequest; + return this; + } + + @Override + public LinkedAccountStatus build() { + return new LinkedAccountStatus(linkedAccountStatus, canMakeRequest, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/MetaResponse.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/MetaResponse.java new file mode 100644 index 000000000..2110bb037 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/MetaResponse.java @@ -0,0 +1,232 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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; + } + + @Override + public int hashCode() { + return Objects.hash( + this.requestSchema, + this.remoteFieldClasses, + this.status, + this.hasConditionalParams, + this.hasRequiredLinkedAccountParams); + } + + @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() {} + + @Override + public Builder from(MetaResponse other) { + requestSchema(other.getRequestSchema()); + remoteFieldClasses(other.getRemoteFieldClasses()); + status(other.getStatus()); + hasConditionalParams(other.getHasConditionalParams()); + hasRequiredLinkedAccountParams(other.getHasRequiredLinkedAccountParams()); + return this; + } + + @Override + @JsonSetter("has_conditional_params") + public HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams) { + this.hasConditionalParams = hasConditionalParams; + return this; + } + + @Override + @JsonSetter("has_required_linked_account_params") + public _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams) { + this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; + return this; + } + + @Override + public _FinalStage status(LinkedAccountStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @Override + public _FinalStage remoteFieldClasses(Map remoteFieldClasses) { + this.remoteFieldClasses = Optional.ofNullable(remoteFieldClasses); + return this; + } + + @Override + @JsonSetter(value = "remote_field_classes", nulls = Nulls.SKIP) + public _FinalStage remoteFieldClasses(Optional> remoteFieldClasses) { + this.remoteFieldClasses = remoteFieldClasses; + return this; + } + + @Override + public _FinalStage requestSchema(String key, JsonNode value) { + this.requestSchema.put(key, value); + return this; + } + + @Override + public _FinalStage putAllRequestSchema(Map requestSchema) { + this.requestSchema.putAll(requestSchema); + return this; + } + + @Override + @JsonSetter(value = "request_schema", nulls = Nulls.SKIP) + public _FinalStage requestSchema(Map requestSchema) { + this.requestSchema.clear(); + this.requestSchema.putAll(requestSchema); + return this; + } + + @Override + public MetaResponse build() { + return new MetaResponse( + requestSchema, + remoteFieldClasses, + status, + hasConditionalParams, + hasRequiredLinkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/MethodEnum.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/MethodEnum.java new file mode 100644 index 000000000..8f4ab382c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/MethodEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/ModelOperation.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/ModelOperation.java new file mode 100644 index 000000000..a816e0b69 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/ModelOperation.java @@ -0,0 +1,216 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.modelName, this.availableOperations, this.requiredPostParameters, this.supportedFields); + } + + @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() {} + + @Override + public Builder from(ModelOperation other) { + modelName(other.getModelName()); + availableOperations(other.getAvailableOperations()); + requiredPostParameters(other.getRequiredPostParameters()); + supportedFields(other.getSupportedFields()); + return this; + } + + @Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @Override + public _FinalStage addAllSupportedFields(List supportedFields) { + this.supportedFields.addAll(supportedFields); + return this; + } + + @Override + public _FinalStage addSupportedFields(String supportedFields) { + this.supportedFields.add(supportedFields); + return this; + } + + @Override + @JsonSetter(value = "supported_fields", nulls = Nulls.SKIP) + public _FinalStage supportedFields(List supportedFields) { + this.supportedFields.clear(); + this.supportedFields.addAll(supportedFields); + return this; + } + + @Override + public _FinalStage addAllRequiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.addAll(requiredPostParameters); + return this; + } + + @Override + public _FinalStage addRequiredPostParameters(String requiredPostParameters) { + this.requiredPostParameters.add(requiredPostParameters); + return this; + } + + @Override + @JsonSetter(value = "required_post_parameters", nulls = Nulls.SKIP) + public _FinalStage requiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.clear(); + this.requiredPostParameters.addAll(requiredPostParameters); + return this; + } + + @Override + public _FinalStage addAllAvailableOperations(List availableOperations) { + this.availableOperations.addAll(availableOperations); + return this; + } + + @Override + public _FinalStage addAvailableOperations(String availableOperations) { + this.availableOperations.add(availableOperations); + return this; + } + + @Override + @JsonSetter(value = "available_operations", nulls = Nulls.SKIP) + public _FinalStage availableOperations(List availableOperations) { + this.availableOperations.clear(); + this.availableOperations.addAll(availableOperations); + return this; + } + + @Override + public ModelOperation build() { + return new ModelOperation( + modelName, availableOperations, requiredPostParameters, supportedFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/ModelPermissionDeserializer.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/ModelPermissionDeserializer.java new file mode 100644 index 000000000..7a7896599 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/ModelPermissionDeserializer.java @@ -0,0 +1,89 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @Override + 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/legacy/api/resources/filestorage/types/ModelPermissionDeserializerRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/ModelPermissionDeserializerRequest.java new file mode 100644 index 000000000..e713ba66d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/ModelPermissionDeserializerRequest.java @@ -0,0 +1,90 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @Override + 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/legacy/api/resources/filestorage/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/MultipartFormFieldRequest.java new file mode 100644 index 000000000..4ad751815 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/MultipartFormFieldRequest.java @@ -0,0 +1,259 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.data, this.encoding, this.fileName, this.contentType); + } + + @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() {} + + @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. + */ + @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. + */ + @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. + */ + @Override + public _FinalStage contentType(String contentType) { + this.contentType = Optional.ofNullable(contentType); + return this; + } + + @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. + */ + @Override + public _FinalStage fileName(String fileName) { + this.fileName = Optional.ofNullable(fileName); + return this; + } + + @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. + */ + @Override + public _FinalStage encoding(MultipartFormFieldRequestEncoding encoding) { + this.encoding = Optional.ofNullable(encoding); + return this; + } + + @Override + @JsonSetter(value = "encoding", nulls = Nulls.SKIP) + public _FinalStage encoding(Optional encoding) { + this.encoding = encoding; + return this; + } + + @Override + public MultipartFormFieldRequest build() { + return new MultipartFormFieldRequest(name, data, encoding, fileName, contentType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/MultipartFormFieldRequestEncoding.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/MultipartFormFieldRequestEncoding.java new file mode 100644 index 000000000..a255a0c47 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/MultipartFormFieldRequestEncoding.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/filestorage/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PaginatedAccountDetailsAndActionsList.java new file mode 100644 index 000000000..16f155e0f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PaginatedAccountDetailsAndActionsList.java @@ -0,0 +1,135 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/filestorage/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PaginatedAuditLogEventList.java new file mode 100644 index 000000000..2952b433f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PaginatedAuditLogEventList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/filestorage/types/PaginatedDriveList.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PaginatedDriveList.java new file mode 100644 index 000000000..6702f0a30 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PaginatedDriveList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedDriveList.Builder.class) +public final class PaginatedDriveList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedDriveList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedDriveList && equalTo((PaginatedDriveList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedDriveList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedDriveList 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 PaginatedDriveList build() { + return new PaginatedDriveList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/PaginatedFileList.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PaginatedFileList.java new file mode 100644 index 000000000..be684b517 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PaginatedFileList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedFileList.Builder.class) +public final class PaginatedFileList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedFileList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedFileList && equalTo((PaginatedFileList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedFileList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedFileList 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 PaginatedFileList build() { + return new PaginatedFileList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/PaginatedFolderList.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PaginatedFolderList.java new file mode 100644 index 000000000..62fc70b4b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PaginatedFolderList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedFolderList.Builder.class) +public final class PaginatedFolderList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedFolderList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedFolderList && equalTo((PaginatedFolderList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedFolderList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedFolderList 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 PaginatedFolderList build() { + return new PaginatedFolderList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/PaginatedGroupList.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PaginatedGroupList.java new file mode 100644 index 000000000..9a2a4c41c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PaginatedGroupList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/filestorage/types/PaginatedIssueList.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PaginatedIssueList.java new file mode 100644 index 000000000..c2ddfdaec --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PaginatedIssueList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/filestorage/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PaginatedSyncStatusList.java new file mode 100644 index 000000000..ec657859a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PaginatedSyncStatusList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/filestorage/types/PaginatedUserList.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PaginatedUserList.java new file mode 100644 index 000000000..de837ed93 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PaginatedUserList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/filestorage/types/Permission.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/Permission.java new file mode 100644 index 000000000..a3f726ce1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/Permission.java @@ -0,0 +1,285 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Permission.Builder.class) +public final class Permission { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional user; + + private final Optional group; + + private final Optional type; + + private final Optional>> roles; + + private final Map additionalProperties; + + private Permission( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional user, + Optional group, + Optional type, + Optional>> roles, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.user = user; + this.group = group; + this.type = type; + this.roles = roles; + 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 that is granted this permission. This will only be populated if the type is USER. + */ + @JsonProperty("user") + public Optional getUser() { + return user; + } + + /** + * @return The group that is granted this permission. This will only be populated if the type is GROUP. + */ + @JsonProperty("group") + public Optional getGroup() { + return group; + } + + /** + * @return Denotes what type of people have access to the file. + *
    + *
  • USER - USER
  • + *
  • GROUP - GROUP
  • + *
  • COMPANY - COMPANY
  • + *
  • ANYONE - ANYONE
  • + *
+ */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @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() { + return roles; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Permission && equalTo((Permission) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Permission other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && user.equals(other.user) + && group.equals(other.group) + && type.equals(other.type) + && roles.equals(other.roles); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, this.remoteId, this.createdAt, this.modifiedAt, this.user, this.group, this.type, this.roles); + } + + @Override + 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 user = Optional.empty(); + + private Optional group = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional>> roles = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Permission other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + user(other.getUser()); + group(other.getGroup()); + type(other.getType()); + roles(other.getRoles()); + 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 = "user", nulls = Nulls.SKIP) + public Builder user(Optional user) { + this.user = user; + return this; + } + + public Builder user(PermissionUser user) { + this.user = Optional.ofNullable(user); + return this; + } + + @JsonSetter(value = "group", nulls = Nulls.SKIP) + public Builder group(Optional group) { + this.group = group; + return this; + } + + public Builder group(PermissionGroup group) { + this.group = Optional.ofNullable(group); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(PermissionType type) { + this.type = Optional.ofNullable(type); + 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; + } + + public Permission build() { + return new Permission(id, remoteId, createdAt, modifiedAt, user, group, type, roles, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/PermissionGroup.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PermissionGroup.java new file mode 100644 index 000000000..e834b9ebb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PermissionGroup.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PermissionGroup.Deserializer.class) +public final class PermissionGroup { + private final Object value; + + private final int type; + + private PermissionGroup(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((Group) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PermissionGroup && equalTo((PermissionGroup) other); + } + + private boolean equalTo(PermissionGroup other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PermissionGroup of(String value) { + return new PermissionGroup(value, 0); + } + + public static PermissionGroup of(Group value) { + return new PermissionGroup(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Group value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PermissionGroup.class); + } + + @Override + public PermissionGroup 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, Group.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/PermissionRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PermissionRequest.java new file mode 100644 index 000000000..39d872923 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PermissionRequest.java @@ -0,0 +1,262 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PermissionRequest.Builder.class) +public final class PermissionRequest { + private final Optional remoteId; + + private final Optional user; + + private final Optional group; + + private final Optional type; + + private final Optional>> roles; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private PermissionRequest( + Optional remoteId, + Optional user, + Optional group, + Optional type, + Optional>> roles, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.remoteId = remoteId; + this.user = user; + this.group = group; + this.type = type; + this.roles = roles; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The user that is granted this permission. This will only be populated if the type is USER. + */ + @JsonProperty("user") + public Optional getUser() { + return user; + } + + /** + * @return The group that is granted this permission. This will only be populated if the type is GROUP. + */ + @JsonProperty("group") + public Optional getGroup() { + return group; + } + + /** + * @return Denotes what type of people have access to the file. + *
    + *
  • USER - USER
  • + *
  • GROUP - GROUP
  • + *
  • COMPANY - COMPANY
  • + *
  • ANYONE - ANYONE
  • + *
+ */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @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() { + return roles; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PermissionRequest && equalTo((PermissionRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PermissionRequest other) { + return remoteId.equals(other.remoteId) + && user.equals(other.user) + && group.equals(other.group) + && type.equals(other.type) + && roles.equals(other.roles) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @Override + public int hashCode() { + return Objects.hash( + this.remoteId, + this.user, + this.group, + this.type, + this.roles, + this.integrationParams, + this.linkedAccountParams); + } + + @Override + 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 user = Optional.empty(); + + private Optional group = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional>> roles = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PermissionRequest other) { + remoteId(other.getRemoteId()); + user(other.getUser()); + group(other.getGroup()); + type(other.getType()); + roles(other.getRoles()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + 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 = "user", nulls = Nulls.SKIP) + public Builder user(Optional user) { + this.user = user; + return this; + } + + public Builder user(PermissionRequestUser user) { + this.user = Optional.ofNullable(user); + return this; + } + + @JsonSetter(value = "group", nulls = Nulls.SKIP) + public Builder group(Optional group) { + this.group = group; + return this; + } + + public Builder group(PermissionRequestGroup group) { + this.group = Optional.ofNullable(group); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(PermissionRequestType type) { + this.type = Optional.ofNullable(type); + 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 = "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 PermissionRequest build() { + return new PermissionRequest( + remoteId, user, group, type, roles, integrationParams, linkedAccountParams, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/PermissionRequestGroup.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PermissionRequestGroup.java new file mode 100644 index 000000000..08d7a5ad8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PermissionRequestGroup.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PermissionRequestGroup.Deserializer.class) +public final class PermissionRequestGroup { + private final Object value; + + private final int type; + + private PermissionRequestGroup(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((Group) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PermissionRequestGroup && equalTo((PermissionRequestGroup) other); + } + + private boolean equalTo(PermissionRequestGroup other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PermissionRequestGroup of(String value) { + return new PermissionRequestGroup(value, 0); + } + + public static PermissionRequestGroup of(Group value) { + return new PermissionRequestGroup(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Group value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PermissionRequestGroup.class); + } + + @Override + public PermissionRequestGroup 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, Group.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/PermissionRequestRolesItem.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PermissionRequestRolesItem.java new file mode 100644 index 000000000..f5a7d8f2c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PermissionRequestRolesItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/filestorage/types/PermissionRequestType.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PermissionRequestType.java new file mode 100644 index 000000000..b9e47a5e4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PermissionRequestType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/filestorage/types/PermissionRequestUser.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PermissionRequestUser.java new file mode 100644 index 000000000..3686a58fb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PermissionRequestUser.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PermissionRequestUser.Deserializer.class) +public final class PermissionRequestUser { + private final Object value; + + private final int type; + + private PermissionRequestUser(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((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PermissionRequestUser && equalTo((PermissionRequestUser) other); + } + + private boolean equalTo(PermissionRequestUser other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PermissionRequestUser of(String value) { + return new PermissionRequestUser(value, 0); + } + + public static PermissionRequestUser of(User value) { + return new PermissionRequestUser(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PermissionRequestUser.class); + } + + @Override + public PermissionRequestUser 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, User.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/PermissionRolesItem.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PermissionRolesItem.java new file mode 100644 index 000000000..6296578a1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PermissionRolesItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/filestorage/types/PermissionType.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PermissionType.java new file mode 100644 index 000000000..7500edc22 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PermissionType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/filestorage/types/PermissionUser.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PermissionUser.java new file mode 100644 index 000000000..91a16cd87 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/PermissionUser.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PermissionUser.Deserializer.class) +public final class PermissionUser { + private final Object value; + + private final int type; + + private PermissionUser(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((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PermissionUser && equalTo((PermissionUser) other); + } + + private boolean equalTo(PermissionUser other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static PermissionUser of(String value) { + return new PermissionUser(value, 0); + } + + public static PermissionUser of(User value) { + return new PermissionUser(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PermissionUser.class); + } + + @Override + public PermissionUser 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, User.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/RemoteData.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/RemoteData.java new file mode 100644 index 000000000..e6ee75a6c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/RemoteData.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.path, this.data); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("path") + public _FinalStage path(@NotNull String path) { + this.path = path; + return this; + } + + @Override + public _FinalStage data(JsonNode data) { + this.data = Optional.ofNullable(data); + return this; + } + + @Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(Optional data) { + this.data = data; + return this; + } + + @Override + public RemoteData build() { + return new RemoteData(path, data, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/RemoteEndpointInfo.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/RemoteEndpointInfo.java new file mode 100644 index 000000000..7ab0e9bee --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/RemoteEndpointInfo.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @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() {} + + @Override + public Builder from(RemoteEndpointInfo other) { + method(other.getMethod()); + urlPath(other.getUrlPath()); + fieldTraversalPath(other.getFieldTraversalPath()); + return this; + } + + @Override + @JsonSetter("method") + public UrlPathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @Override + @JsonSetter("url_path") + public _FinalStage urlPath(@NotNull String urlPath) { + this.urlPath = urlPath; + return this; + } + + @Override + public _FinalStage addAllFieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.addAll(fieldTraversalPath); + return this; + } + + @Override + public _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath) { + this.fieldTraversalPath.add(fieldTraversalPath); + return this; + } + + @Override + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) + public _FinalStage fieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.clear(); + this.fieldTraversalPath.addAll(fieldTraversalPath); + return this; + } + + @Override + public RemoteEndpointInfo build() { + return new RemoteEndpointInfo(method, urlPath, fieldTraversalPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/RemoteFieldApi.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/RemoteFieldApi.java new file mode 100644 index 000000000..c3ab1a702 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/RemoteFieldApi.java @@ -0,0 +1,264 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.schema, + this.remoteKeyName, + this.remoteEndpointInfo, + this.exampleValues, + this.advancedMetadata, + this.coverage); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("remote_key_name") + public RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @Override + public _FinalStage coverage(RemoteFieldApiCoverage coverage) { + this.coverage = Optional.ofNullable(coverage); + return this; + } + + @Override + @JsonSetter(value = "coverage", nulls = Nulls.SKIP) + public _FinalStage coverage(Optional coverage) { + this.coverage = coverage; + return this; + } + + @Override + public _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata) { + this.advancedMetadata = Optional.ofNullable(advancedMetadata); + return this; + } + + @Override + @JsonSetter(value = "advanced_metadata", nulls = Nulls.SKIP) + public _FinalStage advancedMetadata(Optional advancedMetadata) { + this.advancedMetadata = advancedMetadata; + return this; + } + + @Override + public _FinalStage exampleValues(List exampleValues) { + this.exampleValues = Optional.ofNullable(exampleValues); + return this; + } + + @Override + @JsonSetter(value = "example_values", nulls = Nulls.SKIP) + public _FinalStage exampleValues(Optional> exampleValues) { + this.exampleValues = exampleValues; + return this; + } + + @Override + public _FinalStage schema(String key, JsonNode value) { + this.schema.put(key, value); + return this; + } + + @Override + public _FinalStage putAllSchema(Map schema) { + this.schema.putAll(schema); + return this; + } + + @Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Map schema) { + this.schema.clear(); + this.schema.putAll(schema); + return this; + } + + @Override + public RemoteFieldApi build() { + return new RemoteFieldApi( + schema, + remoteKeyName, + remoteEndpointInfo, + exampleValues, + advancedMetadata, + coverage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/RemoteFieldApiCoverage.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/RemoteFieldApiCoverage.java new file mode 100644 index 000000000..e9ac12423 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/RemoteFieldApiCoverage.java @@ -0,0 +1,91 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/filestorage/types/RemoteFieldApiResponse.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/RemoteFieldApiResponse.java new file mode 100644 index 000000000..2b0601087 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/RemoteFieldApiResponse.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.file, this.folder, this.drive, this.group, this.user); + } + + @Override + 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/legacy/api/resources/filestorage/types/RemoteKey.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/RemoteKey.java new file mode 100644 index 000000000..b5612f53e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/RemoteKey.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.key); + } + + @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() {} + + @Override + public Builder from(RemoteKey other) { + name(other.getName()); + key(other.getKey()); + return this; + } + + @Override + @JsonSetter("name") + public KeyStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + @JsonSetter("key") + public _FinalStage key(@NotNull String key) { + this.key = key; + return this; + } + + @Override + public RemoteKey build() { + return new RemoteKey(name, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/RemoteResponse.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/RemoteResponse.java new file mode 100644 index 000000000..c4053ed45 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/RemoteResponse.java @@ -0,0 +1,271 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.status, + this.response, + this.responseHeaders, + this.responseType, + this.headers); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("method") + public PathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @Override + @JsonSetter("path") + public StatusStage path(@NotNull String path) { + this.path = path; + return this; + } + + @Override + @JsonSetter("status") + public ResponseStage status(int status) { + this.status = status; + return this; + } + + @Override + @JsonSetter("response") + public _FinalStage response(@NotNull JsonNode response) { + this.response = response; + return this; + } + + @Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Optional> headers) { + this.headers = headers; + return this; + } + + @Override + public _FinalStage responseType(ResponseTypeEnum responseType) { + this.responseType = Optional.ofNullable(responseType); + return this; + } + + @Override + @JsonSetter(value = "response_type", nulls = Nulls.SKIP) + public _FinalStage responseType(Optional responseType) { + this.responseType = responseType; + return this; + } + + @Override + public _FinalStage responseHeaders(Map responseHeaders) { + this.responseHeaders = Optional.ofNullable(responseHeaders); + return this; + } + + @Override + @JsonSetter(value = "response_headers", nulls = Nulls.SKIP) + public _FinalStage responseHeaders(Optional> responseHeaders) { + this.responseHeaders = responseHeaders; + return this; + } + + @Override + public RemoteResponse build() { + return new RemoteResponse( + method, path, status, response, responseHeaders, responseType, headers, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/RequestFormatEnum.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/RequestFormatEnum.java new file mode 100644 index 000000000..33bfa0089 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/RequestFormatEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/ResponseTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/ResponseTypeEnum.java new file mode 100644 index 000000000..c0461cf49 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/ResponseTypeEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/RoleEnum.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/RoleEnum.java new file mode 100644 index 000000000..029933505 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/RoleEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/RolesEnum.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/RolesEnum.java new file mode 100644 index 000000000..6c9b39fe6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/RolesEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum RolesEnum { + READ("READ"), + + WRITE("WRITE"), + + OWNER("OWNER"); + + private final String value; + + RolesEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/SelectiveSyncConfigurationsUsageEnum.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/SelectiveSyncConfigurationsUsageEnum.java new file mode 100644 index 000000000..11e809736 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/SelectiveSyncConfigurationsUsageEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/SyncStatus.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/SyncStatus.java new file mode 100644 index 000000000..498bab341 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/SyncStatus.java @@ -0,0 +1,283 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.modelName, + this.modelId, + this.lastSyncStart, + this.nextSyncStart, + this.status, + this.isInitialSync, + this.selectiveSyncConfigurationsUsage); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("model_name") + public ModelIdStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @Override + @JsonSetter("model_id") + public StatusStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @Override + @JsonSetter("status") + public IsInitialSyncStage status(@NotNull SyncStatusStatusEnum status) { + this.status = status; + return this; + } + + @Override + @JsonSetter("is_initial_sync") + public _FinalStage isInitialSync(boolean isInitialSync) { + this.isInitialSync = isInitialSync; + return this; + } + + @Override + public _FinalStage selectiveSyncConfigurationsUsage( + SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = Optional.ofNullable(selectiveSyncConfigurationsUsage); + return this; + } + + @Override + @JsonSetter(value = "selective_sync_configurations_usage", nulls = Nulls.SKIP) + public _FinalStage selectiveSyncConfigurationsUsage( + Optional selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; + return this; + } + + @Override + public _FinalStage nextSyncStart(OffsetDateTime nextSyncStart) { + this.nextSyncStart = Optional.ofNullable(nextSyncStart); + return this; + } + + @Override + @JsonSetter(value = "next_sync_start", nulls = Nulls.SKIP) + public _FinalStage nextSyncStart(Optional nextSyncStart) { + this.nextSyncStart = nextSyncStart; + return this; + } + + @Override + public _FinalStage lastSyncStart(OffsetDateTime lastSyncStart) { + this.lastSyncStart = Optional.ofNullable(lastSyncStart); + return this; + } + + @Override + @JsonSetter(value = "last_sync_start", nulls = Nulls.SKIP) + public _FinalStage lastSyncStart(Optional lastSyncStart) { + this.lastSyncStart = lastSyncStart; + return this; + } + + @Override + public SyncStatus build() { + return new SyncStatus( + modelName, + modelId, + lastSyncStart, + nextSyncStart, + status, + isInitialSync, + selectiveSyncConfigurationsUsage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/SyncStatusStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/SyncStatusStatusEnum.java new file mode 100644 index 000000000..2c36e3bd7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/SyncStatusStatusEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/TypeEnum.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/TypeEnum.java new file mode 100644 index 000000000..1c0161512 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/TypeEnum.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TypeEnum { + USER("USER"), + + GROUP("GROUP"), + + COMPANY("COMPANY"), + + ANYONE("ANYONE"); + + private final String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/User.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/User.java new file mode 100644 index 000000000..3e826eee3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/User.java @@ -0,0 +1,348 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/filestorage/types/ValidationProblemSource.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/ValidationProblemSource.java new file mode 100644 index 000000000..11789d263 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/ValidationProblemSource.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.pointer); + } + + @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() {} + + @Override + public Builder from(ValidationProblemSource other) { + pointer(other.getPointer()); + return this; + } + + @Override + @JsonSetter("pointer") + public _FinalStage pointer(@NotNull String pointer) { + this.pointer = pointer; + return this; + } + + @Override + public ValidationProblemSource build() { + return new ValidationProblemSource(pointer, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/WarningValidationProblem.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/WarningValidationProblem.java new file mode 100644 index 000000000..0bab73f6e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/WarningValidationProblem.java @@ -0,0 +1,178 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.source, this.title, this.detail, this.problemType); + } + + @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() {} + + @Override + public Builder from(WarningValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + return this; + } + + @Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @Override + public WarningValidationProblem build() { + return new WarningValidationProblem(source, title, detail, problemType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/types/WebhookReceiver.java b/src/main/java/com/merge/legacy/api/resources/filestorage/types/WebhookReceiver.java new file mode 100644 index 000000000..f037f7304 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/types/WebhookReceiver.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @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() {} + + @Override + public Builder from(WebhookReceiver other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @Override + public WebhookReceiver build() { + return new WebhookReceiver(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/filestorage/users/UsersClient.java b/src/main/java/com/merge/legacy/api/resources/filestorage/users/UsersClient.java new file mode 100644 index 000000000..6d460fdb7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/users/UsersClient.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.users; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.filestorage.types.PaginatedUserList; +import com.merge.legacy.api.resources.filestorage.types.User; +import com.merge.legacy.api.resources.filestorage.users.requests.UsersListRequest; +import com.merge.legacy.api.resources.filestorage.users.requests.UsersRetrieveRequest; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/filestorage/users/requests/UsersListRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/users/requests/UsersListRequest.java new file mode 100644 index 000000000..b58fe4d05 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/users/requests/UsersListRequest.java @@ -0,0 +1,388 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.users.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/filestorage/users/requests/UsersRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/users/requests/UsersRetrieveRequest.java new file mode 100644 index 000000000..36bda88d5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/users/requests/UsersRetrieveRequest.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.users.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/filestorage/webhookreceivers/WebhookReceiversClient.java b/src/main/java/com/merge/legacy/api/resources/filestorage/webhookreceivers/WebhookReceiversClient.java new file mode 100644 index 000000000..8f9e01024 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/webhookreceivers/WebhookReceiversClient.java @@ -0,0 +1,111 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.webhookreceivers; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.filestorage.types.WebhookReceiver; +import com.merge.legacy.api.resources.filestorage.webhookreceivers.requests.WebhookReceiverRequest; +import java.io.IOException; +import java.util.List; +import okhttp3.*; + +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/legacy/api/resources/filestorage/webhookreceivers/requests/WebhookReceiverRequest.java b/src/main/java/com/merge/legacy/api/resources/filestorage/webhookreceivers/requests/WebhookReceiverRequest.java new file mode 100644 index 000000000..d82e958f3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/filestorage/webhookreceivers/requests/WebhookReceiverRequest.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.filestorage.webhookreceivers.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @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() {} + + @Override + public Builder from(WebhookReceiverRequest other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @Override + public WebhookReceiverRequest build() { + return new WebhookReceiverRequest(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/HrisClient.java b/src/main/java/com/merge/legacy/api/resources/hris/HrisClient.java new file mode 100644 index 000000000..741dd5a31 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/HrisClient.java @@ -0,0 +1,280 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris; + +import com.merge.legacy.api.core.ClientOptions; +import com.merge.legacy.api.core.Suppliers; +import com.merge.legacy.api.resources.hris.accountdetails.AccountDetailsClient; +import com.merge.legacy.api.resources.hris.accounttoken.AccountTokenClient; +import com.merge.legacy.api.resources.hris.asyncpassthrough.AsyncPassthroughClient; +import com.merge.legacy.api.resources.hris.audittrail.AuditTrailClient; +import com.merge.legacy.api.resources.hris.availableactions.AvailableActionsClient; +import com.merge.legacy.api.resources.hris.bankinfo.BankInfoClient; +import com.merge.legacy.api.resources.hris.benefits.BenefitsClient; +import com.merge.legacy.api.resources.hris.companies.CompaniesClient; +import com.merge.legacy.api.resources.hris.deleteaccount.DeleteAccountClient; +import com.merge.legacy.api.resources.hris.dependents.DependentsClient; +import com.merge.legacy.api.resources.hris.employeepayrollruns.EmployeePayrollRunsClient; +import com.merge.legacy.api.resources.hris.employees.EmployeesClient; +import com.merge.legacy.api.resources.hris.employerbenefits.EmployerBenefitsClient; +import com.merge.legacy.api.resources.hris.employments.EmploymentsClient; +import com.merge.legacy.api.resources.hris.fieldmapping.FieldMappingClient; +import com.merge.legacy.api.resources.hris.forceresync.ForceResyncClient; +import com.merge.legacy.api.resources.hris.generatekey.GenerateKeyClient; +import com.merge.legacy.api.resources.hris.groups.GroupsClient; +import com.merge.legacy.api.resources.hris.issues.IssuesClient; +import com.merge.legacy.api.resources.hris.linkedaccounts.LinkedAccountsClient; +import com.merge.legacy.api.resources.hris.linktoken.LinkTokenClient; +import com.merge.legacy.api.resources.hris.locations.LocationsClient; +import com.merge.legacy.api.resources.hris.passthrough.PassthroughClient; +import com.merge.legacy.api.resources.hris.paygroups.PayGroupsClient; +import com.merge.legacy.api.resources.hris.payrollruns.PayrollRunsClient; +import com.merge.legacy.api.resources.hris.regeneratekey.RegenerateKeyClient; +import com.merge.legacy.api.resources.hris.scopes.ScopesClient; +import com.merge.legacy.api.resources.hris.syncstatus.SyncStatusClient; +import com.merge.legacy.api.resources.hris.teams.TeamsClient; +import com.merge.legacy.api.resources.hris.timeoff.TimeOffClient; +import com.merge.legacy.api.resources.hris.timeoffbalances.TimeOffBalancesClient; +import com.merge.legacy.api.resources.hris.timesheetentries.TimesheetEntriesClient; +import com.merge.legacy.api.resources.hris.webhookreceivers.WebhookReceiversClient; +import java.util.function.Supplier; + +public class HrisClient { + 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 HrisClient(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.bankInfoClient = Suppliers.memoize(() -> new BankInfoClient(clientOptions)); + this.benefitsClient = Suppliers.memoize(() -> new BenefitsClient(clientOptions)); + this.companiesClient = Suppliers.memoize(() -> new CompaniesClient(clientOptions)); + this.scopesClient = Suppliers.memoize(() -> new ScopesClient(clientOptions)); + this.deleteAccountClient = Suppliers.memoize(() -> new DeleteAccountClient(clientOptions)); + this.dependentsClient = Suppliers.memoize(() -> new DependentsClient(clientOptions)); + this.employeePayrollRunsClient = Suppliers.memoize(() -> new EmployeePayrollRunsClient(clientOptions)); + this.employeesClient = Suppliers.memoize(() -> new EmployeesClient(clientOptions)); + this.employerBenefitsClient = Suppliers.memoize(() -> new EmployerBenefitsClient(clientOptions)); + this.employmentsClient = Suppliers.memoize(() -> new EmploymentsClient(clientOptions)); + this.fieldMappingClient = Suppliers.memoize(() -> new FieldMappingClient(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.locationsClient = Suppliers.memoize(() -> new LocationsClient(clientOptions)); + this.passthroughClient = Suppliers.memoize(() -> new PassthroughClient(clientOptions)); + this.payGroupsClient = Suppliers.memoize(() -> new PayGroupsClient(clientOptions)); + this.payrollRunsClient = Suppliers.memoize(() -> new PayrollRunsClient(clientOptions)); + this.regenerateKeyClient = Suppliers.memoize(() -> new RegenerateKeyClient(clientOptions)); + this.syncStatusClient = Suppliers.memoize(() -> new SyncStatusClient(clientOptions)); + this.forceResyncClient = Suppliers.memoize(() -> new ForceResyncClient(clientOptions)); + this.teamsClient = Suppliers.memoize(() -> new TeamsClient(clientOptions)); + this.timeOffClient = Suppliers.memoize(() -> new TimeOffClient(clientOptions)); + this.timeOffBalancesClient = Suppliers.memoize(() -> new TimeOffBalancesClient(clientOptions)); + this.timesheetEntriesClient = Suppliers.memoize(() -> new TimesheetEntriesClient(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 BankInfoClient bankInfo() { + return this.bankInfoClient.get(); + } + + public BenefitsClient benefits() { + return this.benefitsClient.get(); + } + + public CompaniesClient companies() { + return this.companiesClient.get(); + } + + public ScopesClient scopes() { + return this.scopesClient.get(); + } + + public DeleteAccountClient deleteAccount() { + return this.deleteAccountClient.get(); + } + + public DependentsClient dependents() { + return this.dependentsClient.get(); + } + + public EmployeePayrollRunsClient employeePayrollRuns() { + return this.employeePayrollRunsClient.get(); + } + + public EmployeesClient employees() { + return this.employeesClient.get(); + } + + public EmployerBenefitsClient employerBenefits() { + return this.employerBenefitsClient.get(); + } + + public EmploymentsClient employments() { + return this.employmentsClient.get(); + } + + public FieldMappingClient fieldMapping() { + return this.fieldMappingClient.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 LocationsClient locations() { + return this.locationsClient.get(); + } + + public PassthroughClient passthrough() { + return this.passthroughClient.get(); + } + + public PayGroupsClient payGroups() { + return this.payGroupsClient.get(); + } + + public PayrollRunsClient payrollRuns() { + return this.payrollRunsClient.get(); + } + + public RegenerateKeyClient regenerateKey() { + return this.regenerateKeyClient.get(); + } + + public SyncStatusClient syncStatus() { + return this.syncStatusClient.get(); + } + + public ForceResyncClient forceResync() { + return this.forceResyncClient.get(); + } + + public TeamsClient teams() { + return this.teamsClient.get(); + } + + public TimeOffClient timeOff() { + return this.timeOffClient.get(); + } + + public TimeOffBalancesClient timeOffBalances() { + return this.timeOffBalancesClient.get(); + } + + public TimesheetEntriesClient timesheetEntries() { + return this.timesheetEntriesClient.get(); + } + + public WebhookReceiversClient webhookReceivers() { + return this.webhookReceiversClient.get(); + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/accountdetails/AccountDetailsClient.java b/src/main/java/com/merge/legacy/api/resources/hris/accountdetails/AccountDetailsClient.java new file mode 100644 index 000000000..483435b89 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/accountdetails/AccountDetailsClient.java @@ -0,0 +1,58 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.accountdetails; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.types.AccountDetails; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/accounttoken/AccountTokenClient.java b/src/main/java/com/merge/legacy/api/resources/hris/accounttoken/AccountTokenClient.java new file mode 100644 index 000000000..442399ddb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/accounttoken/AccountTokenClient.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.accounttoken; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.types.AccountToken; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/asyncpassthrough/AsyncPassthroughClient.java b/src/main/java/com/merge/legacy/api/resources/hris/asyncpassthrough/AsyncPassthroughClient.java new file mode 100644 index 000000000..bdf1efbc6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/asyncpassthrough/AsyncPassthroughClient.java @@ -0,0 +1,110 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.asyncpassthrough; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.asyncpassthrough.types.AsyncPassthroughRetrieveResponse; +import com.merge.legacy.api.resources.hris.types.AsyncPassthroughReciept; +import com.merge.legacy.api.resources.hris.types.DataPassthroughRequest; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java b/src/main/java/com/merge/legacy/api/resources/hris/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java new file mode 100644 index 000000000..7009c64af --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import com.merge.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/audittrail/AuditTrailClient.java b/src/main/java/com/merge/legacy/api/resources/hris/audittrail/AuditTrailClient.java new file mode 100644 index 000000000..e9409a563 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/audittrail/AuditTrailClient.java @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.audittrail; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.audittrail.requests.AuditTrailListRequest; +import com.merge.legacy.api.resources.hris.types.PaginatedAuditLogEventList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/audittrail/requests/AuditTrailListRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/audittrail/requests/AuditTrailListRequest.java new file mode 100644 index 000000000..38fbc567b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/audittrail/requests/AuditTrailListRequest.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.audittrail.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.cursor, this.endDate, this.eventType, this.pageSize, this.startDate, this.userEmail); + } + + @Override + 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/legacy/api/resources/hris/availableactions/AvailableActionsClient.java b/src/main/java/com/merge/legacy/api/resources/hris/availableactions/AvailableActionsClient.java new file mode 100644 index 000000000..6440a93e4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/availableactions/AvailableActionsClient.java @@ -0,0 +1,58 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.availableactions; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.types.AvailableActions; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/bankinfo/BankInfoClient.java b/src/main/java/com/merge/legacy/api/resources/hris/bankinfo/BankInfoClient.java new file mode 100644 index 000000000..f18af68d2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/bankinfo/BankInfoClient.java @@ -0,0 +1,190 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.bankinfo; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.bankinfo.requests.BankInfoListRequest; +import com.merge.legacy.api.resources.hris.bankinfo.requests.BankInfoRetrieveRequest; +import com.merge.legacy.api.resources.hris.types.BankInfo; +import com.merge.legacy.api.resources.hris.types.PaginatedBankInfoList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/bankinfo/requests/BankInfoListRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/bankinfo/requests/BankInfoListRequest.java new file mode 100644 index 000000000..aa9d3c67e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/bankinfo/requests/BankInfoListRequest.java @@ -0,0 +1,568 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.bankinfo.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.hris.bankinfo.types.BankInfoListRequestAccountType; +import com.merge.legacy.api.resources.hris.bankinfo.types.BankInfoListRequestOrderBy; +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 = BankInfoListRequest.Builder.class) +public final class BankInfoListRequest { + private final Optional accountType; + + private final Optional bankName; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional employeeId; + + 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 orderBy; + + private final Optional pageSize; + + private final Optional remoteFields; + + private final Optional remoteId; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private BankInfoListRequest( + Optional accountType, + Optional bankName, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional employeeId, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional orderBy, + Optional pageSize, + Optional remoteFields, + Optional remoteId, + Optional showEnumOrigins, + Map additionalProperties) { + 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; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.orderBy = orderBy; + this.pageSize = pageSize; + this.remoteFields = remoteFields; + this.remoteId = remoteId; + this.showEnumOrigins = showEnumOrigins; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return BankInfo's with this account type. Options: ('SAVINGS', 'CHECKING') + *
    + *
  • SAVINGS - SAVINGS
  • + *
  • CHECKING - CHECKING
  • + *
+ */ + @JsonProperty("account_type") + public Optional getAccountType() { + return accountType; + } + + /** + * @return If provided, will only return BankInfo's with this bank name. + */ + @JsonProperty("bank_name") + public Optional getBankName() { + return bankName; + } + + /** + * @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 bank accounts for this employee. + */ + @JsonProperty("employee_id") + 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. + */ + @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 Overrides the default ordering for this endpoint. Possible values include: remote_created_at, -remote_created_at. + */ + @JsonProperty("order_by") + public Optional getOrderBy() { + return orderBy; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BankInfoListRequest && equalTo((BankInfoListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BankInfoListRequest other) { + return 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) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && orderBy.equals(other.orderBy) + && pageSize.equals(other.pageSize) + && remoteFields.equals(other.remoteFields) + && remoteId.equals(other.remoteId) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @Override + public int hashCode() { + return Objects.hash( + this.accountType, + this.bankName, + this.createdAfter, + this.createdBefore, + this.cursor, + this.employeeId, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.orderBy, + this.pageSize, + this.remoteFields, + this.remoteId, + this.showEnumOrigins); + } + + @Override + 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 bankName = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional employeeId = 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 orderBy = 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(BankInfoListRequest other) { + 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()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + orderBy(other.getOrderBy()); + 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(BankInfoListRequestAccountType accountType) { + this.accountType = Optional.ofNullable(accountType); + return this; + } + + @JsonSetter(value = "bank_name", nulls = Nulls.SKIP) + public Builder bankName(Optional bankName) { + this.bankName = bankName; + return this; + } + + public Builder bankName(String bankName) { + this.bankName = Optional.ofNullable(bankName); + 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 = "employee_id", nulls = Nulls.SKIP) + public Builder employeeId(Optional employeeId) { + this.employeeId = employeeId; + return this; + } + + public Builder employeeId(String employeeId) { + this.employeeId = Optional.ofNullable(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; + 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 = "order_by", nulls = Nulls.SKIP) + public Builder orderBy(Optional orderBy) { + this.orderBy = orderBy; + return this; + } + + public Builder orderBy(BankInfoListRequestOrderBy orderBy) { + this.orderBy = Optional.ofNullable(orderBy); + 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 BankInfoListRequest build() { + return new BankInfoListRequest( + accountType, + bankName, + createdAfter, + createdBefore, + cursor, + employeeId, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + orderBy, + pageSize, + remoteFields, + remoteId, + showEnumOrigins, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/bankinfo/requests/BankInfoRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/bankinfo/requests/BankInfoRetrieveRequest.java new file mode 100644 index 000000000..2cc38ceb6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/bankinfo/requests/BankInfoRetrieveRequest.java @@ -0,0 +1,176 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.bankinfo.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = BankInfoRetrieveRequest.Builder.class) +public final class BankInfoRetrieveRequest { + private final Optional expand; + + private final Optional includeRemoteData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private BankInfoRetrieveRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BankInfoRetrieveRequest && equalTo((BankInfoRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BankInfoRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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(BankInfoRetrieveRequest 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 BankInfoRetrieveRequest build() { + return new BankInfoRetrieveRequest( + expand, includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/bankinfo/types/BankInfoListRequestAccountType.java b/src/main/java/com/merge/legacy/api/resources/hris/bankinfo/types/BankInfoListRequestAccountType.java new file mode 100644 index 000000000..2a920f445 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/bankinfo/types/BankInfoListRequestAccountType.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.bankinfo.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum BankInfoListRequestAccountType { + CHECKING("CHECKING"), + + SAVINGS("SAVINGS"); + + private final String value; + + BankInfoListRequestAccountType(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/bankinfo/types/BankInfoListRequestOrderBy.java b/src/main/java/com/merge/legacy/api/resources/hris/bankinfo/types/BankInfoListRequestOrderBy.java new file mode 100644 index 000000000..a3059baa5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/bankinfo/types/BankInfoListRequestOrderBy.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.bankinfo.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum BankInfoListRequestOrderBy { + REMOTE_CREATED_AT_DESCENDING("-remote_created_at"), + + REMOTE_CREATED_AT_ASCENDING("remote_created_at"); + + private final String value; + + BankInfoListRequestOrderBy(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/benefits/BenefitsClient.java b/src/main/java/com/merge/legacy/api/resources/hris/benefits/BenefitsClient.java new file mode 100644 index 000000000..16de0be8c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/benefits/BenefitsClient.java @@ -0,0 +1,166 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.benefits; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.benefits.requests.BenefitsListRequest; +import com.merge.legacy.api.resources.hris.benefits.requests.BenefitsRetrieveRequest; +import com.merge.legacy.api.resources.hris.types.Benefit; +import com.merge.legacy.api.resources.hris.types.PaginatedBenefitList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/benefits/requests/BenefitsListRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/benefits/requests/BenefitsListRequest.java new file mode 100644 index 000000000..701334fbc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/benefits/requests/BenefitsListRequest.java @@ -0,0 +1,417 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.benefits.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = BenefitsListRequest.Builder.class) +public final class BenefitsListRequest { + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional employeeId; + + 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 BenefitsListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional employeeId, + 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.employeeId = employeeId; + 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 return the benefits associated with the employee. + */ + @JsonProperty("employee_id") + 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. + */ + @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BenefitsListRequest && equalTo((BenefitsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BenefitsListRequest other) { + return 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) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.employeeId, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @Override + 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 employeeId = 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(BenefitsListRequest other) { + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + employeeId(other.getEmployeeId()); + 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 = "employee_id", nulls = Nulls.SKIP) + public Builder employeeId(Optional employeeId) { + this.employeeId = employeeId; + return this; + } + + public Builder employeeId(String employeeId) { + this.employeeId = Optional.ofNullable(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; + 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 BenefitsListRequest build() { + return new BenefitsListRequest( + createdAfter, + createdBefore, + cursor, + employeeId, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/benefits/requests/BenefitsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/benefits/requests/BenefitsRetrieveRequest.java new file mode 100644 index 000000000..a34c0db77 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/benefits/requests/BenefitsRetrieveRequest.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.benefits.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/hris/companies/CompaniesClient.java b/src/main/java/com/merge/legacy/api/resources/hris/companies/CompaniesClient.java new file mode 100644 index 000000000..7df608ee3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/companies/CompaniesClient.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.companies; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.companies.requests.CompaniesListRequest; +import com.merge.legacy.api.resources.hris.companies.requests.CompaniesRetrieveRequest; +import com.merge.legacy.api.resources.hris.types.Company; +import com.merge.legacy.api.resources.hris.types.PaginatedCompanyList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/companies/requests/CompaniesListRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/companies/requests/CompaniesListRequest.java new file mode 100644 index 000000000..cb6500d69 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/companies/requests/CompaniesListRequest.java @@ -0,0 +1,359 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.companies.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = CompaniesListRequest.Builder.class) +public final class CompaniesListRequest { + 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 CompaniesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CompaniesListRequest && equalTo((CompaniesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CompaniesListRequest 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); + } + + @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); + } + + @Override + 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(CompaniesListRequest 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 CompaniesListRequest build() { + return new CompaniesListRequest( + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/companies/requests/CompaniesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/companies/requests/CompaniesRetrieveRequest.java new file mode 100644 index 000000000..fa2a66750 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/companies/requests/CompaniesRetrieveRequest.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.companies.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/hris/deleteaccount/DeleteAccountClient.java b/src/main/java/com/merge/legacy/api/resources/hris/deleteaccount/DeleteAccountClient.java new file mode 100644 index 000000000..a2e46ad0e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/deleteaccount/DeleteAccountClient.java @@ -0,0 +1,55 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.deleteaccount; + +import com.merge.legacy.api.core.*; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/dependents/DependentsClient.java b/src/main/java/com/merge/legacy/api/resources/hris/dependents/DependentsClient.java new file mode 100644 index 000000000..b666acd9d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/dependents/DependentsClient.java @@ -0,0 +1,167 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.dependents; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.dependents.requests.DependentsListRequest; +import com.merge.legacy.api.resources.hris.dependents.requests.DependentsRetrieveRequest; +import com.merge.legacy.api.resources.hris.types.Dependent; +import com.merge.legacy.api.resources.hris.types.PaginatedDependentList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/dependents/requests/DependentsListRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/dependents/requests/DependentsListRequest.java new file mode 100644 index 000000000..0fd369a20 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/dependents/requests/DependentsListRequest.java @@ -0,0 +1,388 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.dependents.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = DependentsListRequest.Builder.class) +public final class DependentsListRequest { + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeSensitiveFields; + + 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 DependentsListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeSensitiveFields, + 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.includeSensitiveFields = includeSensitiveFields; + 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 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, 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DependentsListRequest && equalTo((DependentsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DependentsListRequest other) { + return createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeSensitiveFields.equals(other.includeSensitiveFields) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeSensitiveFields, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @Override + 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 includeSensitiveFields = 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(DependentsListRequest other) { + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeSensitiveFields(other.getIncludeSensitiveFields()); + 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_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 = "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 DependentsListRequest build() { + return new DependentsListRequest( + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeSensitiveFields, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/dependents/requests/DependentsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/dependents/requests/DependentsRetrieveRequest.java new file mode 100644 index 000000000..00badd065 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/dependents/requests/DependentsRetrieveRequest.java @@ -0,0 +1,121 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.dependents.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = DependentsRetrieveRequest.Builder.class) +public final class DependentsRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeSensitiveFields; + + private final Map additionalProperties; + + private DependentsRetrieveRequest( + Optional includeRemoteData, + Optional includeSensitiveFields, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeSensitiveFields = includeSensitiveFields; + 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 sensitive fields (such as social security numbers) in the response. + */ + @JsonProperty("include_sensitive_fields") + public Optional getIncludeSensitiveFields() { + return includeSensitiveFields; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DependentsRetrieveRequest && equalTo((DependentsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DependentsRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) + && includeSensitiveFields.equals(other.includeSensitiveFields); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeSensitiveFields); + } + + @Override + 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 includeSensitiveFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DependentsRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeSensitiveFields(other.getIncludeSensitiveFields()); + 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; + } + + public DependentsRetrieveRequest build() { + return new DependentsRetrieveRequest(includeRemoteData, includeSensitiveFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/employeepayrollruns/EmployeePayrollRunsClient.java b/src/main/java/com/merge/legacy/api/resources/hris/employeepayrollruns/EmployeePayrollRunsClient.java new file mode 100644 index 000000000..fa4073a59 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employeepayrollruns/EmployeePayrollRunsClient.java @@ -0,0 +1,188 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.employeepayrollruns; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.employeepayrollruns.requests.EmployeePayrollRunsListRequest; +import com.merge.legacy.api.resources.hris.employeepayrollruns.requests.EmployeePayrollRunsRetrieveRequest; +import com.merge.legacy.api.resources.hris.types.EmployeePayrollRun; +import com.merge.legacy.api.resources.hris.types.PaginatedEmployeePayrollRunList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/employeepayrollruns/requests/EmployeePayrollRunsListRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/employeepayrollruns/requests/EmployeePayrollRunsListRequest.java new file mode 100644 index 000000000..8e7d11692 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employeepayrollruns/requests/EmployeePayrollRunsListRequest.java @@ -0,0 +1,563 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.employeepayrollruns.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.hris.employeepayrollruns.types.EmployeePayrollRunsListRequestExpand; +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 = EmployeePayrollRunsListRequest.Builder.class) +public final class EmployeePayrollRunsListRequest { + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional employeeId; + + private final Optional endedAfter; + + private final Optional endedBefore; + + 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 payrollRunId; + + private final Optional remoteId; + + private final Optional startedAfter; + + private final Optional startedBefore; + + private final Map additionalProperties; + + private EmployeePayrollRunsListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional employeeId, + Optional endedAfter, + Optional endedBefore, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional payrollRunId, + Optional remoteId, + Optional startedAfter, + Optional startedBefore, + Map additionalProperties) { + 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; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.payrollRunId = payrollRunId; + this.remoteId = remoteId; + this.startedAfter = startedAfter; + this.startedBefore = startedBefore; + 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 employee payroll runs for this employee. + */ + @JsonProperty("employee_id") + public Optional getEmployeeId() { + return employeeId; + } + + /** + * @return If provided, will only return employee payroll runs ended after this datetime. + */ + @JsonProperty("ended_after") + public Optional getEndedAfter() { + return endedAfter; + } + + /** + * @return If provided, will only return employee payroll runs ended before this datetime. + */ + @JsonProperty("ended_before") + 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. + */ + @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 employee payroll runs for this employee. + */ + @JsonProperty("payroll_run_id") + public Optional getPayrollRunId() { + return payrollRunId; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return If provided, will only return employee payroll runs started after this datetime. + */ + @JsonProperty("started_after") + public Optional getStartedAfter() { + return startedAfter; + } + + /** + * @return If provided, will only return employee payroll runs started before this datetime. + */ + @JsonProperty("started_before") + public Optional getStartedBefore() { + return startedBefore; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeePayrollRunsListRequest && equalTo((EmployeePayrollRunsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmployeePayrollRunsListRequest other) { + return 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) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && payrollRunId.equals(other.payrollRunId) + && remoteId.equals(other.remoteId) + && startedAfter.equals(other.startedAfter) + && startedBefore.equals(other.startedBefore); + } + + @Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.employeeId, + this.endedAfter, + this.endedBefore, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.payrollRunId, + this.remoteId, + this.startedAfter, + this.startedBefore); + } + + @Override + 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 employeeId = Optional.empty(); + + private Optional endedAfter = Optional.empty(); + + private Optional endedBefore = 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 payrollRunId = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional startedAfter = Optional.empty(); + + private Optional startedBefore = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EmployeePayrollRunsListRequest other) { + 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()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + payrollRunId(other.getPayrollRunId()); + remoteId(other.getRemoteId()); + startedAfter(other.getStartedAfter()); + startedBefore(other.getStartedBefore()); + 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 = "employee_id", nulls = Nulls.SKIP) + public Builder employeeId(Optional employeeId) { + this.employeeId = employeeId; + return this; + } + + public Builder employeeId(String employeeId) { + this.employeeId = Optional.ofNullable(employeeId); + return this; + } + + @JsonSetter(value = "ended_after", nulls = Nulls.SKIP) + public Builder endedAfter(Optional endedAfter) { + this.endedAfter = endedAfter; + return this; + } + + public Builder endedAfter(OffsetDateTime endedAfter) { + this.endedAfter = Optional.ofNullable(endedAfter); + return this; + } + + @JsonSetter(value = "ended_before", nulls = Nulls.SKIP) + public Builder endedBefore(Optional endedBefore) { + this.endedBefore = endedBefore; + return this; + } + + public Builder endedBefore(OffsetDateTime endedBefore) { + this.endedBefore = Optional.ofNullable(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; + 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 = "payroll_run_id", nulls = Nulls.SKIP) + public Builder payrollRunId(Optional payrollRunId) { + this.payrollRunId = payrollRunId; + return this; + } + + public Builder payrollRunId(String payrollRunId) { + this.payrollRunId = Optional.ofNullable(payrollRunId); + 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 = "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; + } + + public EmployeePayrollRunsListRequest build() { + return new EmployeePayrollRunsListRequest( + createdAfter, + createdBefore, + cursor, + employeeId, + endedAfter, + endedBefore, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + payrollRunId, + remoteId, + startedAfter, + startedBefore, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/employeepayrollruns/requests/EmployeePayrollRunsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/employeepayrollruns/requests/EmployeePayrollRunsRetrieveRequest.java new file mode 100644 index 000000000..23f4a9b1f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employeepayrollruns/requests/EmployeePayrollRunsRetrieveRequest.java @@ -0,0 +1,122 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.employeepayrollruns.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/hris/employeepayrollruns/types/EmployeePayrollRunsListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/hris/employeepayrollruns/types/EmployeePayrollRunsListRequestExpand.java new file mode 100644 index 000000000..fa5e9dfd1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employeepayrollruns/types/EmployeePayrollRunsListRequestExpand.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/employeepayrollruns/types/EmployeePayrollRunsRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/hris/employeepayrollruns/types/EmployeePayrollRunsRetrieveRequestExpand.java new file mode 100644 index 000000000..e19588cbd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employeepayrollruns/types/EmployeePayrollRunsRetrieveRequestExpand.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/employees/EmployeesClient.java b/src/main/java/com/merge/legacy/api/resources/hris/employees/EmployeesClient.java new file mode 100644 index 000000000..5cf3d7fda --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employees/EmployeesClient.java @@ -0,0 +1,408 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.employees; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.employees.requests.EmployeeEndpointRequest; +import com.merge.legacy.api.resources.hris.employees.requests.EmployeesListRequest; +import com.merge.legacy.api.resources.hris.employees.requests.EmployeesRetrieveRequest; +import com.merge.legacy.api.resources.hris.employees.requests.IgnoreCommonModelRequest; +import com.merge.legacy.api.resources.hris.types.Employee; +import com.merge.legacy.api.resources.hris.types.EmployeeResponse; +import com.merge.legacy.api.resources.hris.types.MetaResponse; +import com.merge.legacy.api.resources.hris.types.PaginatedEmployeeList; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/hris/employees/requests/EmployeeEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/employees/requests/EmployeeEndpointRequest.java new file mode 100644 index 000000000..4ea87d11e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employees/requests/EmployeeEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.employees.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.hris.types.EmployeeRequest; +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 = EmployeeEndpointRequest.Builder.class) +public final class EmployeeEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final EmployeeRequest model; + + private final Map additionalProperties; + + private EmployeeEndpointRequest( + Optional isDebugMode, + Optional runAsync, + EmployeeRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public EmployeeRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeeEndpointRequest && equalTo((EmployeeEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmployeeEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull EmployeeRequest model); + + Builder from(EmployeeEndpointRequest other); + } + + public interface _FinalStage { + EmployeeEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private EmployeeRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(EmployeeEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull EmployeeRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public EmployeeEndpointRequest build() { + return new EmployeeEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/employees/requests/EmployeesListRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/employees/requests/EmployeesListRequest.java new file mode 100644 index 000000000..27bd55f4f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employees/requests/EmployeesListRequest.java @@ -0,0 +1,1035 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.employees.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.hris.employees.types.EmployeesListRequestEmploymentStatus; +import com.merge.legacy.api.resources.hris.employees.types.EmployeesListRequestExpand; +import com.merge.legacy.api.resources.hris.employees.types.EmployeesListRequestRemoteFields; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/hris/employees/requests/EmployeesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/employees/requests/EmployeesRetrieveRequest.java new file mode 100644 index 000000000..42ce7be46 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employees/requests/EmployeesRetrieveRequest.java @@ -0,0 +1,216 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.employees.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.hris.employees.types.EmployeesRetrieveRequestExpand; +import com.merge.legacy.api.resources.hris.employees.types.EmployeesRetrieveRequestRemoteFields; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.expand, + this.includeRemoteData, + this.includeSensitiveFields, + this.remoteFields, + this.showEnumOrigins); + } + + @Override + 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/legacy/api/resources/hris/employees/requests/IgnoreCommonModelRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/employees/requests/IgnoreCommonModelRequest.java new file mode 100644 index 000000000..b1ad123d3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employees/requests/IgnoreCommonModelRequest.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.employees.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.reason, this.message); + } + + @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() {} + + @Override + public Builder from(IgnoreCommonModelRequest other) { + reason(other.getReason()); + message(other.getMessage()); + return this; + } + + @Override + @JsonSetter("reason") + public _FinalStage reason(@NotNull IgnoreCommonModelRequestReason reason) { + this.reason = reason; + return this; + } + + @Override + public _FinalStage message(String message) { + this.message = Optional.ofNullable(message); + return this; + } + + @Override + @JsonSetter(value = "message", nulls = Nulls.SKIP) + public _FinalStage message(Optional message) { + this.message = message; + return this; + } + + @Override + public IgnoreCommonModelRequest build() { + return new IgnoreCommonModelRequest(reason, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/employees/types/EmployeesListRequestEmploymentStatus.java b/src/main/java/com/merge/legacy/api/resources/hris/employees/types/EmployeesListRequestEmploymentStatus.java new file mode 100644 index 000000000..45ba4b6e2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employees/types/EmployeesListRequestEmploymentStatus.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.employees.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EmployeesListRequestEmploymentStatus { + ACTIVE("ACTIVE"), + + INACTIVE("INACTIVE"), + + PENDING("PENDING"); + + private final String value; + + EmployeesListRequestEmploymentStatus(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/employees/types/EmployeesListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/hris/employees/types/EmployeesListRequestExpand.java new file mode 100644 index 000000000..7ecd46299 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employees/types/EmployeesListRequestExpand.java @@ -0,0 +1,560 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/employees/types/EmployeesListRequestRemoteFields.java b/src/main/java/com/merge/legacy/api/resources/hris/employees/types/EmployeesListRequestRemoteFields.java new file mode 100644 index 000000000..987ed5edd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employees/types/EmployeesListRequestRemoteFields.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.employees.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EmployeesListRequestRemoteFields { + EMPLOYMENT_STATUS("employment_status"), + + EMPLOYMENT_STATUS_ETHNICITY("employment_status,ethnicity"), + + EMPLOYMENT_STATUS_ETHNICITY_GENDER("employment_status,ethnicity,gender"), + + EMPLOYMENT_STATUS_ETHNICITY_GENDER_MARITAL_STATUS("employment_status,ethnicity,gender,marital_status"), + + EMPLOYMENT_STATUS_ETHNICITY_MARITAL_STATUS("employment_status,ethnicity,marital_status"), + + EMPLOYMENT_STATUS_GENDER("employment_status,gender"), + + EMPLOYMENT_STATUS_GENDER_MARITAL_STATUS("employment_status,gender,marital_status"), + + EMPLOYMENT_STATUS_MARITAL_STATUS("employment_status,marital_status"), + + ETHNICITY("ethnicity"), + + ETHNICITY_GENDER("ethnicity,gender"), + + ETHNICITY_GENDER_MARITAL_STATUS("ethnicity,gender,marital_status"), + + ETHNICITY_MARITAL_STATUS("ethnicity,marital_status"), + + GENDER("gender"), + + GENDER_MARITAL_STATUS("gender,marital_status"), + + MARITAL_STATUS("marital_status"); + + private final String value; + + EmployeesListRequestRemoteFields(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/employees/types/EmployeesListRequestShowEnumOrigins.java b/src/main/java/com/merge/legacy/api/resources/hris/employees/types/EmployeesListRequestShowEnumOrigins.java new file mode 100644 index 000000000..bd6822e4c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employees/types/EmployeesListRequestShowEnumOrigins.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.employees.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EmployeesListRequestShowEnumOrigins { + EMPLOYMENT_STATUS("employment_status"), + + EMPLOYMENT_STATUS_ETHNICITY("employment_status,ethnicity"), + + EMPLOYMENT_STATUS_ETHNICITY_GENDER("employment_status,ethnicity,gender"), + + EMPLOYMENT_STATUS_ETHNICITY_GENDER_MARITAL_STATUS("employment_status,ethnicity,gender,marital_status"), + + EMPLOYMENT_STATUS_ETHNICITY_MARITAL_STATUS("employment_status,ethnicity,marital_status"), + + EMPLOYMENT_STATUS_GENDER("employment_status,gender"), + + EMPLOYMENT_STATUS_GENDER_MARITAL_STATUS("employment_status,gender,marital_status"), + + EMPLOYMENT_STATUS_MARITAL_STATUS("employment_status,marital_status"), + + ETHNICITY("ethnicity"), + + ETHNICITY_GENDER("ethnicity,gender"), + + ETHNICITY_GENDER_MARITAL_STATUS("ethnicity,gender,marital_status"), + + ETHNICITY_MARITAL_STATUS("ethnicity,marital_status"), + + GENDER("gender"), + + GENDER_MARITAL_STATUS("gender,marital_status"), + + MARITAL_STATUS("marital_status"); + + private final String value; + + EmployeesListRequestShowEnumOrigins(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/employees/types/EmployeesRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/hris/employees/types/EmployeesRetrieveRequestExpand.java new file mode 100644 index 000000000..0e0de161f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employees/types/EmployeesRetrieveRequestExpand.java @@ -0,0 +1,560 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/employees/types/EmployeesRetrieveRequestRemoteFields.java b/src/main/java/com/merge/legacy/api/resources/hris/employees/types/EmployeesRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..831aa6afb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employees/types/EmployeesRetrieveRequestRemoteFields.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.employees.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EmployeesRetrieveRequestRemoteFields { + EMPLOYMENT_STATUS("employment_status"), + + EMPLOYMENT_STATUS_ETHNICITY("employment_status,ethnicity"), + + EMPLOYMENT_STATUS_ETHNICITY_GENDER("employment_status,ethnicity,gender"), + + EMPLOYMENT_STATUS_ETHNICITY_GENDER_MARITAL_STATUS("employment_status,ethnicity,gender,marital_status"), + + EMPLOYMENT_STATUS_ETHNICITY_MARITAL_STATUS("employment_status,ethnicity,marital_status"), + + EMPLOYMENT_STATUS_GENDER("employment_status,gender"), + + EMPLOYMENT_STATUS_GENDER_MARITAL_STATUS("employment_status,gender,marital_status"), + + EMPLOYMENT_STATUS_MARITAL_STATUS("employment_status,marital_status"), + + ETHNICITY("ethnicity"), + + ETHNICITY_GENDER("ethnicity,gender"), + + ETHNICITY_GENDER_MARITAL_STATUS("ethnicity,gender,marital_status"), + + ETHNICITY_MARITAL_STATUS("ethnicity,marital_status"), + + GENDER("gender"), + + GENDER_MARITAL_STATUS("gender,marital_status"), + + MARITAL_STATUS("marital_status"); + + private final String value; + + EmployeesRetrieveRequestRemoteFields(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/employees/types/EmployeesRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/legacy/api/resources/hris/employees/types/EmployeesRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..45d1f2c64 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employees/types/EmployeesRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.employees.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EmployeesRetrieveRequestShowEnumOrigins { + EMPLOYMENT_STATUS("employment_status"), + + EMPLOYMENT_STATUS_ETHNICITY("employment_status,ethnicity"), + + EMPLOYMENT_STATUS_ETHNICITY_GENDER("employment_status,ethnicity,gender"), + + EMPLOYMENT_STATUS_ETHNICITY_GENDER_MARITAL_STATUS("employment_status,ethnicity,gender,marital_status"), + + EMPLOYMENT_STATUS_ETHNICITY_MARITAL_STATUS("employment_status,ethnicity,marital_status"), + + EMPLOYMENT_STATUS_GENDER("employment_status,gender"), + + EMPLOYMENT_STATUS_GENDER_MARITAL_STATUS("employment_status,gender,marital_status"), + + EMPLOYMENT_STATUS_MARITAL_STATUS("employment_status,marital_status"), + + ETHNICITY("ethnicity"), + + ETHNICITY_GENDER("ethnicity,gender"), + + ETHNICITY_GENDER_MARITAL_STATUS("ethnicity,gender,marital_status"), + + ETHNICITY_MARITAL_STATUS("ethnicity,marital_status"), + + GENDER("gender"), + + GENDER_MARITAL_STATUS("gender,marital_status"), + + MARITAL_STATUS("marital_status"); + + private final String value; + + EmployeesRetrieveRequestShowEnumOrigins(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/employees/types/IgnoreCommonModelRequestReason.java b/src/main/java/com/merge/legacy/api/resources/hris/employees/types/IgnoreCommonModelRequestReason.java new file mode 100644 index 000000000..40ddda3a5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employees/types/IgnoreCommonModelRequestReason.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import com.merge.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/employerbenefits/EmployerBenefitsClient.java b/src/main/java/com/merge/legacy/api/resources/hris/employerbenefits/EmployerBenefitsClient.java new file mode 100644 index 000000000..7a5facd9c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employerbenefits/EmployerBenefitsClient.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.employerbenefits; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.employerbenefits.requests.EmployerBenefitsListRequest; +import com.merge.legacy.api.resources.hris.employerbenefits.requests.EmployerBenefitsRetrieveRequest; +import com.merge.legacy.api.resources.hris.types.EmployerBenefit; +import com.merge.legacy.api.resources.hris.types.PaginatedEmployerBenefitList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/employerbenefits/requests/EmployerBenefitsListRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/employerbenefits/requests/EmployerBenefitsListRequest.java new file mode 100644 index 000000000..3067e775e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employerbenefits/requests/EmployerBenefitsListRequest.java @@ -0,0 +1,359 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.employerbenefits.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = EmployerBenefitsListRequest.Builder.class) +public final class EmployerBenefitsListRequest { + 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 EmployerBenefitsListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployerBenefitsListRequest && equalTo((EmployerBenefitsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmployerBenefitsListRequest 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); + } + + @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); + } + + @Override + 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(EmployerBenefitsListRequest 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 EmployerBenefitsListRequest build() { + return new EmployerBenefitsListRequest( + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/employerbenefits/requests/EmployerBenefitsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/employerbenefits/requests/EmployerBenefitsRetrieveRequest.java new file mode 100644 index 000000000..55f6a1b8d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employerbenefits/requests/EmployerBenefitsRetrieveRequest.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.employerbenefits.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/hris/employments/EmploymentsClient.java b/src/main/java/com/merge/legacy/api/resources/hris/employments/EmploymentsClient.java new file mode 100644 index 000000000..ced771767 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employments/EmploymentsClient.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.employments; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.employments.requests.EmploymentsListRequest; +import com.merge.legacy.api.resources.hris.employments.requests.EmploymentsRetrieveRequest; +import com.merge.legacy.api.resources.hris.types.Employment; +import com.merge.legacy.api.resources.hris.types.PaginatedEmploymentList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/employments/requests/EmploymentsListRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/employments/requests/EmploymentsListRequest.java new file mode 100644 index 000000000..687f356ee --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employments/requests/EmploymentsListRequest.java @@ -0,0 +1,508 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.employments.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.hris.employments.types.EmploymentsListRequestExpand; +import com.merge.legacy.api.resources.hris.employments.types.EmploymentsListRequestOrderBy; +import com.merge.legacy.api.resources.hris.employments.types.EmploymentsListRequestRemoteFields; +import com.merge.legacy.api.resources.hris.employments.types.EmploymentsListRequestShowEnumOrigins; +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 = EmploymentsListRequest.Builder.class) +public final class EmploymentsListRequest { + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional employeeId; + + 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 orderBy; + + private final Optional pageSize; + + private final Optional remoteFields; + + private final Optional remoteId; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private EmploymentsListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional employeeId, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional orderBy, + Optional pageSize, + Optional remoteFields, + Optional remoteId, + Optional showEnumOrigins, + Map additionalProperties) { + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.employeeId = employeeId; + this.expand = expand; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.orderBy = orderBy; + 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 employments for this employee. + */ + @JsonProperty("employee_id") + 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. + */ + @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 Overrides the default ordering for this endpoint. Possible values include: effective_date, -effective_date. + */ + @JsonProperty("order_by") + public Optional getOrderBy() { + return orderBy; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmploymentsListRequest && equalTo((EmploymentsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmploymentsListRequest other) { + return 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) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && orderBy.equals(other.orderBy) + && pageSize.equals(other.pageSize) + && remoteFields.equals(other.remoteFields) + && remoteId.equals(other.remoteId) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.employeeId, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.orderBy, + this.pageSize, + this.remoteFields, + this.remoteId, + this.showEnumOrigins); + } + + @Override + 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 employeeId = 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 orderBy = 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(EmploymentsListRequest other) { + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + employeeId(other.getEmployeeId()); + expand(other.getExpand()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + orderBy(other.getOrderBy()); + 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 = "employee_id", nulls = Nulls.SKIP) + public Builder employeeId(Optional employeeId) { + this.employeeId = employeeId; + return this; + } + + public Builder employeeId(String employeeId) { + this.employeeId = Optional.ofNullable(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; + 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 = "order_by", nulls = Nulls.SKIP) + public Builder orderBy(Optional orderBy) { + this.orderBy = orderBy; + return this; + } + + public Builder orderBy(EmploymentsListRequestOrderBy orderBy) { + this.orderBy = Optional.ofNullable(orderBy); + 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(EmploymentsListRequestRemoteFields 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(EmploymentsListRequestShowEnumOrigins showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public EmploymentsListRequest build() { + return new EmploymentsListRequest( + createdAfter, + createdBefore, + cursor, + employeeId, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + orderBy, + pageSize, + remoteFields, + remoteId, + showEnumOrigins, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/employments/requests/EmploymentsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/employments/requests/EmploymentsRetrieveRequest.java new file mode 100644 index 000000000..2966d2c39 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employments/requests/EmploymentsRetrieveRequest.java @@ -0,0 +1,179 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.employments.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.hris.employments.types.EmploymentsRetrieveRequestExpand; +import com.merge.legacy.api.resources.hris.employments.types.EmploymentsRetrieveRequestRemoteFields; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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/legacy/api/resources/hris/employments/types/EmploymentsListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/hris/employments/types/EmploymentsListRequestExpand.java new file mode 100644 index 000000000..41715ec20 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employments/types/EmploymentsListRequestExpand.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/employments/types/EmploymentsListRequestOrderBy.java b/src/main/java/com/merge/legacy/api/resources/hris/employments/types/EmploymentsListRequestOrderBy.java new file mode 100644 index 000000000..4956c351c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employments/types/EmploymentsListRequestOrderBy.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.employments.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EmploymentsListRequestOrderBy { + EFFECTIVE_DATE_DESCENDING("-effective_date"), + + EFFECTIVE_DATE_ASCENDING("effective_date"); + + private final String value; + + EmploymentsListRequestOrderBy(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/employments/types/EmploymentsListRequestRemoteFields.java b/src/main/java/com/merge/legacy/api/resources/hris/employments/types/EmploymentsListRequestRemoteFields.java new file mode 100644 index 000000000..dbdaef2d8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employments/types/EmploymentsListRequestRemoteFields.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.employments.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EmploymentsListRequestRemoteFields { + EMPLOYMENT_TYPE("employment_type"), + + EMPLOYMENT_TYPE_FLSA_STATUS("employment_type,flsa_status"), + + EMPLOYMENT_TYPE_FLSA_STATUS_PAY_FREQUENCY("employment_type,flsa_status,pay_frequency"), + + EMPLOYMENT_TYPE_FLSA_STATUS_PAY_FREQUENCY_PAY_PERIOD("employment_type,flsa_status,pay_frequency,pay_period"), + + EMPLOYMENT_TYPE_FLSA_STATUS_PAY_PERIOD("employment_type,flsa_status,pay_period"), + + EMPLOYMENT_TYPE_PAY_FREQUENCY("employment_type,pay_frequency"), + + EMPLOYMENT_TYPE_PAY_FREQUENCY_PAY_PERIOD("employment_type,pay_frequency,pay_period"), + + EMPLOYMENT_TYPE_PAY_PERIOD("employment_type,pay_period"), + + FLSA_STATUS("flsa_status"), + + FLSA_STATUS_PAY_FREQUENCY("flsa_status,pay_frequency"), + + FLSA_STATUS_PAY_FREQUENCY_PAY_PERIOD("flsa_status,pay_frequency,pay_period"), + + FLSA_STATUS_PAY_PERIOD("flsa_status,pay_period"), + + PAY_FREQUENCY("pay_frequency"), + + PAY_FREQUENCY_PAY_PERIOD("pay_frequency,pay_period"), + + PAY_PERIOD("pay_period"); + + private final String value; + + EmploymentsListRequestRemoteFields(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/employments/types/EmploymentsListRequestShowEnumOrigins.java b/src/main/java/com/merge/legacy/api/resources/hris/employments/types/EmploymentsListRequestShowEnumOrigins.java new file mode 100644 index 000000000..fdab97fba --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employments/types/EmploymentsListRequestShowEnumOrigins.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.employments.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EmploymentsListRequestShowEnumOrigins { + EMPLOYMENT_TYPE("employment_type"), + + EMPLOYMENT_TYPE_FLSA_STATUS("employment_type,flsa_status"), + + EMPLOYMENT_TYPE_FLSA_STATUS_PAY_FREQUENCY("employment_type,flsa_status,pay_frequency"), + + EMPLOYMENT_TYPE_FLSA_STATUS_PAY_FREQUENCY_PAY_PERIOD("employment_type,flsa_status,pay_frequency,pay_period"), + + EMPLOYMENT_TYPE_FLSA_STATUS_PAY_PERIOD("employment_type,flsa_status,pay_period"), + + EMPLOYMENT_TYPE_PAY_FREQUENCY("employment_type,pay_frequency"), + + EMPLOYMENT_TYPE_PAY_FREQUENCY_PAY_PERIOD("employment_type,pay_frequency,pay_period"), + + EMPLOYMENT_TYPE_PAY_PERIOD("employment_type,pay_period"), + + FLSA_STATUS("flsa_status"), + + FLSA_STATUS_PAY_FREQUENCY("flsa_status,pay_frequency"), + + FLSA_STATUS_PAY_FREQUENCY_PAY_PERIOD("flsa_status,pay_frequency,pay_period"), + + FLSA_STATUS_PAY_PERIOD("flsa_status,pay_period"), + + PAY_FREQUENCY("pay_frequency"), + + PAY_FREQUENCY_PAY_PERIOD("pay_frequency,pay_period"), + + PAY_PERIOD("pay_period"); + + private final String value; + + EmploymentsListRequestShowEnumOrigins(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/employments/types/EmploymentsRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/hris/employments/types/EmploymentsRetrieveRequestExpand.java new file mode 100644 index 000000000..56bd89448 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employments/types/EmploymentsRetrieveRequestExpand.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/employments/types/EmploymentsRetrieveRequestRemoteFields.java b/src/main/java/com/merge/legacy/api/resources/hris/employments/types/EmploymentsRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..50117e304 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employments/types/EmploymentsRetrieveRequestRemoteFields.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.employments.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EmploymentsRetrieveRequestRemoteFields { + EMPLOYMENT_TYPE("employment_type"), + + EMPLOYMENT_TYPE_FLSA_STATUS("employment_type,flsa_status"), + + EMPLOYMENT_TYPE_FLSA_STATUS_PAY_FREQUENCY("employment_type,flsa_status,pay_frequency"), + + EMPLOYMENT_TYPE_FLSA_STATUS_PAY_FREQUENCY_PAY_PERIOD("employment_type,flsa_status,pay_frequency,pay_period"), + + EMPLOYMENT_TYPE_FLSA_STATUS_PAY_PERIOD("employment_type,flsa_status,pay_period"), + + EMPLOYMENT_TYPE_PAY_FREQUENCY("employment_type,pay_frequency"), + + EMPLOYMENT_TYPE_PAY_FREQUENCY_PAY_PERIOD("employment_type,pay_frequency,pay_period"), + + EMPLOYMENT_TYPE_PAY_PERIOD("employment_type,pay_period"), + + FLSA_STATUS("flsa_status"), + + FLSA_STATUS_PAY_FREQUENCY("flsa_status,pay_frequency"), + + FLSA_STATUS_PAY_FREQUENCY_PAY_PERIOD("flsa_status,pay_frequency,pay_period"), + + FLSA_STATUS_PAY_PERIOD("flsa_status,pay_period"), + + PAY_FREQUENCY("pay_frequency"), + + PAY_FREQUENCY_PAY_PERIOD("pay_frequency,pay_period"), + + PAY_PERIOD("pay_period"); + + private final String value; + + EmploymentsRetrieveRequestRemoteFields(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/employments/types/EmploymentsRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/legacy/api/resources/hris/employments/types/EmploymentsRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..bf992f54b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/employments/types/EmploymentsRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.employments.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EmploymentsRetrieveRequestShowEnumOrigins { + EMPLOYMENT_TYPE("employment_type"), + + EMPLOYMENT_TYPE_FLSA_STATUS("employment_type,flsa_status"), + + EMPLOYMENT_TYPE_FLSA_STATUS_PAY_FREQUENCY("employment_type,flsa_status,pay_frequency"), + + EMPLOYMENT_TYPE_FLSA_STATUS_PAY_FREQUENCY_PAY_PERIOD("employment_type,flsa_status,pay_frequency,pay_period"), + + EMPLOYMENT_TYPE_FLSA_STATUS_PAY_PERIOD("employment_type,flsa_status,pay_period"), + + EMPLOYMENT_TYPE_PAY_FREQUENCY("employment_type,pay_frequency"), + + EMPLOYMENT_TYPE_PAY_FREQUENCY_PAY_PERIOD("employment_type,pay_frequency,pay_period"), + + EMPLOYMENT_TYPE_PAY_PERIOD("employment_type,pay_period"), + + FLSA_STATUS("flsa_status"), + + FLSA_STATUS_PAY_FREQUENCY("flsa_status,pay_frequency"), + + FLSA_STATUS_PAY_FREQUENCY_PAY_PERIOD("flsa_status,pay_frequency,pay_period"), + + FLSA_STATUS_PAY_PERIOD("flsa_status,pay_period"), + + PAY_FREQUENCY("pay_frequency"), + + PAY_FREQUENCY_PAY_PERIOD("pay_frequency,pay_period"), + + PAY_PERIOD("pay_period"); + + private final String value; + + EmploymentsRetrieveRequestShowEnumOrigins(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/fieldmapping/FieldMappingClient.java b/src/main/java/com/merge/legacy/api/resources/hris/fieldmapping/FieldMappingClient.java new file mode 100644 index 000000000..f51b99934 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/fieldmapping/FieldMappingClient.java @@ -0,0 +1,338 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.fieldmapping; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.fieldmapping.requests.CreateFieldMappingRequest; +import com.merge.legacy.api.resources.hris.fieldmapping.requests.FieldMappingsRetrieveRequest; +import com.merge.legacy.api.resources.hris.fieldmapping.requests.PatchedEditFieldMappingRequest; +import com.merge.legacy.api.resources.hris.fieldmapping.requests.RemoteFieldsRetrieveRequest; +import com.merge.legacy.api.resources.hris.types.ExternalTargetFieldApiResponse; +import com.merge.legacy.api.resources.hris.types.FieldMappingApiInstanceResponse; +import com.merge.legacy.api.resources.hris.types.FieldMappingInstanceResponse; +import com.merge.legacy.api.resources.hris.types.RemoteFieldApiResponse; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/hris/fieldmapping/requests/CreateFieldMappingRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/fieldmapping/requests/CreateFieldMappingRequest.java new file mode 100644 index 000000000..b75907b8a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/fieldmapping/requests/CreateFieldMappingRequest.java @@ -0,0 +1,337 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.fieldmapping.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.excludeRemoteFieldMetadata, + this.targetFieldName, + this.targetFieldDescription, + this.remoteFieldTraversalPath, + this.remoteMethod, + this.remoteUrlPath, + this.commonModelName); + } + + @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() {} + + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @Override + public _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.add(remoteFieldTraversalPath); + return this; + } + + @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. + */ + @Override + public _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); + return this; + } + + @Override + @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) + public _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + return this; + } + + @Override + public CreateFieldMappingRequest build() { + return new CreateFieldMappingRequest( + excludeRemoteFieldMetadata, + targetFieldName, + targetFieldDescription, + remoteFieldTraversalPath, + remoteMethod, + remoteUrlPath, + commonModelName, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/fieldmapping/requests/FieldMappingsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/fieldmapping/requests/FieldMappingsRetrieveRequest.java new file mode 100644 index 000000000..626645ea0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/fieldmapping/requests/FieldMappingsRetrieveRequest.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.fieldmapping.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.excludeRemoteFieldMetadata); + } + + @Override + 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/legacy/api/resources/hris/fieldmapping/requests/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/fieldmapping/requests/PatchedEditFieldMappingRequest.java new file mode 100644 index 000000000..64236128d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/fieldmapping/requests/PatchedEditFieldMappingRequest.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.fieldmapping.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath); + } + + @Override + 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/legacy/api/resources/hris/fieldmapping/requests/RemoteFieldsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/fieldmapping/requests/RemoteFieldsRetrieveRequest.java new file mode 100644 index 000000000..c9fcc7d04 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/fieldmapping/requests/RemoteFieldsRetrieveRequest.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.fieldmapping.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.commonModels, this.includeExampleValues); + } + + @Override + 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/legacy/api/resources/hris/forceresync/ForceResyncClient.java b/src/main/java/com/merge/legacy/api/resources/hris/forceresync/ForceResyncClient.java new file mode 100644 index 000000000..73381745a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/forceresync/ForceResyncClient.java @@ -0,0 +1,61 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.forceresync; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.types.SyncStatus; +import java.io.IOException; +import java.util.List; +import okhttp3.*; + +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/legacy/api/resources/hris/generatekey/GenerateKeyClient.java b/src/main/java/com/merge/legacy/api/resources/hris/generatekey/GenerateKeyClient.java new file mode 100644 index 000000000..eb6f2e1b4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/generatekey/GenerateKeyClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.generatekey; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.generatekey.requests.GenerateRemoteKeyRequest; +import com.merge.legacy.api.resources.hris.types.RemoteKey; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/generatekey/requests/GenerateRemoteKeyRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/generatekey/requests/GenerateRemoteKeyRequest.java new file mode 100644 index 000000000..95408c1c3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/generatekey/requests/GenerateRemoteKeyRequest.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.generatekey.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + public GenerateRemoteKeyRequest build() { + return new GenerateRemoteKeyRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/groups/GroupsClient.java b/src/main/java/com/merge/legacy/api/resources/hris/groups/GroupsClient.java new file mode 100644 index 000000000..0d2dbb0b8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/groups/GroupsClient.java @@ -0,0 +1,182 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.groups; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.groups.requests.GroupsListRequest; +import com.merge.legacy.api.resources.hris.groups.requests.GroupsRetrieveRequest; +import com.merge.legacy.api.resources.hris.types.Group; +import com.merge.legacy.api.resources.hris.types.PaginatedGroupList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/groups/requests/GroupsListRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/groups/requests/GroupsListRequest.java new file mode 100644 index 000000000..e7280b08f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/groups/requests/GroupsListRequest.java @@ -0,0 +1,504 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.groups.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/hris/groups/requests/GroupsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/groups/requests/GroupsRetrieveRequest.java new file mode 100644 index 000000000..f4b9789fe --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/groups/requests/GroupsRetrieveRequest.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.groups.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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/legacy/api/resources/hris/issues/IssuesClient.java b/src/main/java/com/merge/legacy/api/resources/hris/issues/IssuesClient.java new file mode 100644 index 000000000..570e0bd92 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/issues/IssuesClient.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.issues; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.issues.requests.IssuesListRequest; +import com.merge.legacy.api.resources.hris.types.Issue; +import com.merge.legacy.api.resources.hris.types.PaginatedIssueList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/issues/requests/IssuesListRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/issues/requests/IssuesListRequest.java new file mode 100644 index 000000000..ee7e6a6b7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/issues/requests/IssuesListRequest.java @@ -0,0 +1,471 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.issues.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/hris/issues/types/IssuesListRequestStatus.java b/src/main/java/com/merge/legacy/api/resources/hris/issues/types/IssuesListRequestStatus.java new file mode 100644 index 000000000..2b24ea83a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/issues/types/IssuesListRequestStatus.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/linkedaccounts/LinkedAccountsClient.java b/src/main/java/com/merge/legacy/api/resources/hris/linkedaccounts/LinkedAccountsClient.java new file mode 100644 index 000000000..8ccb982c7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/linkedaccounts/LinkedAccountsClient.java @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.linkedaccounts; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.linkedaccounts.requests.LinkedAccountsListRequest; +import com.merge.legacy.api.resources.hris.types.PaginatedAccountDetailsAndActionsList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/linkedaccounts/requests/LinkedAccountsListRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/linkedaccounts/requests/LinkedAccountsListRequest.java new file mode 100644 index 000000000..e26024ee9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/linkedaccounts/requests/LinkedAccountsListRequest.java @@ -0,0 +1,452 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.linkedaccounts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/hris/linkedaccounts/types/LinkedAccountsListRequestCategory.java b/src/main/java/com/merge/legacy/api/resources/hris/linkedaccounts/types/LinkedAccountsListRequestCategory.java new file mode 100644 index 000000000..840c71ff1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/linkedaccounts/types/LinkedAccountsListRequestCategory.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/linktoken/LinkTokenClient.java b/src/main/java/com/merge/legacy/api/resources/hris/linktoken/LinkTokenClient.java new file mode 100644 index 000000000..5426e0330 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/linktoken/LinkTokenClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.linktoken; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.linktoken.requests.EndUserDetailsRequest; +import com.merge.legacy.api.resources.hris.types.LinkToken; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/linktoken/requests/EndUserDetailsRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/linktoken/requests/EndUserDetailsRequest.java new file mode 100644 index 000000000..9807c7175 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/linktoken/requests/EndUserDetailsRequest.java @@ -0,0 +1,600 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.linktoken.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.hris.types.CategoriesEnum; +import com.merge.legacy.api.resources.hris.types.CommonModelScopesBodyRequest; +import com.merge.legacy.api.resources.hris.types.IndividualCommonModelScopeDeserializerRequest; +import com.merge.legacy.api.resources.hris.types.LanguageEnum; +import java.util.*; +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; + } + + @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); + } + + @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); + } + + @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() {} + + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @Override + public _FinalStage integrationSpecificConfig(Map integrationSpecificConfig) { + this.integrationSpecificConfig = Optional.ofNullable(integrationSpecificConfig); + return this; + } + + @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. + */ + @Override + public _FinalStage areSyncsDisabled(Boolean areSyncsDisabled) { + this.areSyncsDisabled = Optional.ofNullable(areSyncsDisabled); + return this; + } + + @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. + */ + @Override + public _FinalStage language(LanguageEnum language) { + this.language = Optional.ofNullable(language); + return this; + } + + @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. + */ + @Override + public _FinalStage categoryCommonModelScopes( + Map>> categoryCommonModelScopes) { + this.categoryCommonModelScopes = Optional.ofNullable(categoryCommonModelScopes); + return this; + } + + @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. + */ + @Override + public _FinalStage commonModels(List commonModels) { + this.commonModels = Optional.ofNullable(commonModels); + return this; + } + + @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. + */ + @Override + public _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink) { + this.hideAdminMagicLink = Optional.ofNullable(hideAdminMagicLink); + return this; + } + + @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. + */ + @Override + public _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl) { + this.shouldCreateMagicLinkUrl = Optional.ofNullable(shouldCreateMagicLinkUrl); + return this; + } + + @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. + */ + @Override + public _FinalStage linkExpiryMins(Integer linkExpiryMins) { + this.linkExpiryMins = Optional.ofNullable(linkExpiryMins); + return this; + } + + @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. + */ + @Override + public _FinalStage integration(String integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @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. + */ + @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. + */ + @Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + this.categories.addAll(categories); + return this; + } + + @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/legacy/api/resources/hris/locations/LocationsClient.java b/src/main/java/com/merge/legacy/api/resources/hris/locations/LocationsClient.java new file mode 100644 index 000000000..ea9a40ec4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/locations/LocationsClient.java @@ -0,0 +1,177 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.locations; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.locations.requests.LocationsListRequest; +import com.merge.legacy.api.resources.hris.locations.requests.LocationsRetrieveRequest; +import com.merge.legacy.api.resources.hris.types.Location; +import com.merge.legacy.api.resources.hris.types.PaginatedLocationList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/locations/requests/LocationsListRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/locations/requests/LocationsListRequest.java new file mode 100644 index 000000000..f322f39cc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/locations/requests/LocationsListRequest.java @@ -0,0 +1,453 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.locations.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.hris.locations.types.LocationsListRequestLocationType; +import com.merge.legacy.api.resources.hris.locations.types.LocationsListRequestRemoteFields; +import com.merge.legacy.api.resources.hris.locations.types.LocationsListRequestShowEnumOrigins; +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 = LocationsListRequest.Builder.class) +public final class LocationsListRequest { + 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 locationType; + + 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 LocationsListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional locationType, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteFields, + Optional remoteId, + Optional showEnumOrigins, + Map additionalProperties) { + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.locationType = locationType; + 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 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 locations with this location_type + *
    + *
  • HOME - HOME
  • + *
  • WORK - WORK
  • + *
+ */ + @JsonProperty("location_type") + public Optional getLocationType() { + return locationType; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LocationsListRequest && equalTo((LocationsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LocationsListRequest 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) + && locationType.equals(other.locationType) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteFields.equals(other.remoteFields) + && remoteId.equals(other.remoteId) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.locationType, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteFields, + this.remoteId, + this.showEnumOrigins); + } + + @Override + 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 locationType = 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(LocationsListRequest other) { + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + locationType(other.getLocationType()); + 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 = "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 = "location_type", nulls = Nulls.SKIP) + public Builder locationType(Optional locationType) { + this.locationType = locationType; + return this; + } + + public Builder locationType(LocationsListRequestLocationType locationType) { + this.locationType = Optional.ofNullable(locationType); + 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(LocationsListRequestRemoteFields 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(LocationsListRequestShowEnumOrigins showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public LocationsListRequest build() { + return new LocationsListRequest( + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + locationType, + modifiedAfter, + modifiedBefore, + pageSize, + remoteFields, + remoteId, + showEnumOrigins, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/locations/requests/LocationsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/locations/requests/LocationsRetrieveRequest.java new file mode 100644 index 000000000..f4fb750fa --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/locations/requests/LocationsRetrieveRequest.java @@ -0,0 +1,150 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.locations.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.hris.locations.types.LocationsRetrieveRequestRemoteFields; +import com.merge.legacy.api.resources.hris.locations.types.LocationsRetrieveRequestShowEnumOrigins; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LocationsRetrieveRequest.Builder.class) +public final class LocationsRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private LocationsRetrieveRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LocationsRetrieveRequest && equalTo((LocationsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LocationsRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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(LocationsRetrieveRequest 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(LocationsRetrieveRequestRemoteFields 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(LocationsRetrieveRequestShowEnumOrigins showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public LocationsRetrieveRequest build() { + return new LocationsRetrieveRequest(includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/locations/types/LocationsListRequestLocationType.java b/src/main/java/com/merge/legacy/api/resources/hris/locations/types/LocationsListRequestLocationType.java new file mode 100644 index 000000000..27b01ddfe --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/locations/types/LocationsListRequestLocationType.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.locations.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LocationsListRequestLocationType { + HOME("HOME"), + + WORK("WORK"); + + private final String value; + + LocationsListRequestLocationType(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/locations/types/LocationsListRequestRemoteFields.java b/src/main/java/com/merge/legacy/api/resources/hris/locations/types/LocationsListRequestRemoteFields.java new file mode 100644 index 000000000..dbf6a8a5d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/locations/types/LocationsListRequestRemoteFields.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.locations.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LocationsListRequestRemoteFields { + COUNTRY("country"), + + COUNTRY_LOCATION_TYPE("country,location_type"), + + LOCATION_TYPE("location_type"); + + private final String value; + + LocationsListRequestRemoteFields(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/locations/types/LocationsListRequestShowEnumOrigins.java b/src/main/java/com/merge/legacy/api/resources/hris/locations/types/LocationsListRequestShowEnumOrigins.java new file mode 100644 index 000000000..4a7d56ff6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/locations/types/LocationsListRequestShowEnumOrigins.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.locations.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LocationsListRequestShowEnumOrigins { + COUNTRY("country"), + + COUNTRY_LOCATION_TYPE("country,location_type"), + + LOCATION_TYPE("location_type"); + + private final String value; + + LocationsListRequestShowEnumOrigins(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/locations/types/LocationsRetrieveRequestRemoteFields.java b/src/main/java/com/merge/legacy/api/resources/hris/locations/types/LocationsRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..9550f875e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/locations/types/LocationsRetrieveRequestRemoteFields.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.locations.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LocationsRetrieveRequestRemoteFields { + COUNTRY("country"), + + COUNTRY_LOCATION_TYPE("country,location_type"), + + LOCATION_TYPE("location_type"); + + private final String value; + + LocationsRetrieveRequestRemoteFields(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/locations/types/LocationsRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/legacy/api/resources/hris/locations/types/LocationsRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..a9568211e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/locations/types/LocationsRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.locations.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LocationsRetrieveRequestShowEnumOrigins { + COUNTRY("country"), + + COUNTRY_LOCATION_TYPE("country,location_type"), + + LOCATION_TYPE("location_type"); + + private final String value; + + LocationsRetrieveRequestShowEnumOrigins(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/passthrough/PassthroughClient.java b/src/main/java/com/merge/legacy/api/resources/hris/passthrough/PassthroughClient.java new file mode 100644 index 000000000..77ee1d9db --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/passthrough/PassthroughClient.java @@ -0,0 +1,66 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.passthrough; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.types.DataPassthroughRequest; +import com.merge.legacy.api.resources.hris.types.RemoteResponse; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/paygroups/PayGroupsClient.java b/src/main/java/com/merge/legacy/api/resources/hris/paygroups/PayGroupsClient.java new file mode 100644 index 000000000..e4bf1227e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/paygroups/PayGroupsClient.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.paygroups; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.paygroups.requests.PayGroupsListRequest; +import com.merge.legacy.api.resources.hris.paygroups.requests.PayGroupsRetrieveRequest; +import com.merge.legacy.api.resources.hris.types.PaginatedPayGroupList; +import com.merge.legacy.api.resources.hris.types.PayGroup; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/paygroups/requests/PayGroupsListRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/paygroups/requests/PayGroupsListRequest.java new file mode 100644 index 000000000..7b64f0f72 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/paygroups/requests/PayGroupsListRequest.java @@ -0,0 +1,359 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.paygroups.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = PayGroupsListRequest.Builder.class) +public final class PayGroupsListRequest { + 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 PayGroupsListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PayGroupsListRequest && equalTo((PayGroupsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PayGroupsListRequest 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); + } + + @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); + } + + @Override + 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(PayGroupsListRequest 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 PayGroupsListRequest build() { + return new PayGroupsListRequest( + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/paygroups/requests/PayGroupsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/paygroups/requests/PayGroupsRetrieveRequest.java new file mode 100644 index 000000000..9276f25fa --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/paygroups/requests/PayGroupsRetrieveRequest.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.paygroups.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/hris/payrollruns/PayrollRunsClient.java b/src/main/java/com/merge/legacy/api/resources/hris/payrollruns/PayrollRunsClient.java new file mode 100644 index 000000000..aab220c39 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/payrollruns/PayrollRunsClient.java @@ -0,0 +1,192 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.payrollruns; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.payrollruns.requests.PayrollRunsListRequest; +import com.merge.legacy.api.resources.hris.payrollruns.requests.PayrollRunsRetrieveRequest; +import com.merge.legacy.api.resources.hris.types.PaginatedPayrollRunList; +import com.merge.legacy.api.resources.hris.types.PayrollRun; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/payrollruns/requests/PayrollRunsListRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/payrollruns/requests/PayrollRunsListRequest.java new file mode 100644 index 000000000..3f8879e7b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/payrollruns/requests/PayrollRunsListRequest.java @@ -0,0 +1,572 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.payrollruns.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.hris.payrollruns.types.PayrollRunsListRequestRemoteFields; +import com.merge.legacy.api.resources.hris.payrollruns.types.PayrollRunsListRequestRunType; +import com.merge.legacy.api.resources.hris.payrollruns.types.PayrollRunsListRequestShowEnumOrigins; +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 = PayrollRunsListRequest.Builder.class) +public final class PayrollRunsListRequest { + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional endedAfter; + + private final Optional endedBefore; + + 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 runType; + + private final Optional showEnumOrigins; + + private final Optional startedAfter; + + private final Optional startedBefore; + + private final Map additionalProperties; + + private PayrollRunsListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional endedAfter, + Optional endedBefore, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteFields, + Optional remoteId, + Optional runType, + Optional showEnumOrigins, + Optional startedAfter, + Optional startedBefore, + Map additionalProperties) { + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.endedAfter = endedAfter; + this.endedBefore = endedBefore; + 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.runType = runType; + this.showEnumOrigins = showEnumOrigins; + this.startedAfter = startedAfter; + this.startedBefore = startedBefore; + 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 payroll runs ended after this datetime. + */ + @JsonProperty("ended_after") + public Optional getEndedAfter() { + return endedAfter; + } + + /** + * @return If provided, will only return payroll runs ended before this datetime. + */ + @JsonProperty("ended_before") + public Optional getEndedBefore() { + return endedBefore; + } + + /** + * @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 If provided, will only return PayrollRun's with this status. Options: ('REGULAR', 'OFF_CYCLE', 'CORRECTION', 'TERMINATION', 'SIGN_ON_BONUS') + *
    + *
  • REGULAR - REGULAR
  • + *
  • OFF_CYCLE - OFF_CYCLE
  • + *
  • CORRECTION - CORRECTION
  • + *
  • TERMINATION - TERMINATION
  • + *
  • SIGN_ON_BONUS - SIGN_ON_BONUS
  • + *
+ */ + @JsonProperty("run_type") + public Optional getRunType() { + return runType; + } + + /** + * @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 payroll runs started after this datetime. + */ + @JsonProperty("started_after") + public Optional getStartedAfter() { + return startedAfter; + } + + /** + * @return If provided, will only return payroll runs started before this datetime. + */ + @JsonProperty("started_before") + public Optional getStartedBefore() { + return startedBefore; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PayrollRunsListRequest && equalTo((PayrollRunsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PayrollRunsListRequest other) { + return createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && endedAfter.equals(other.endedAfter) + && endedBefore.equals(other.endedBefore) + && 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) + && runType.equals(other.runType) + && showEnumOrigins.equals(other.showEnumOrigins) + && startedAfter.equals(other.startedAfter) + && startedBefore.equals(other.startedBefore); + } + + @Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.endedAfter, + this.endedBefore, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteFields, + this.remoteId, + this.runType, + this.showEnumOrigins, + this.startedAfter, + this.startedBefore); + } + + @Override + 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 endedAfter = Optional.empty(); + + private Optional endedBefore = 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 runType = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + private Optional startedAfter = Optional.empty(); + + private Optional startedBefore = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PayrollRunsListRequest other) { + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + endedAfter(other.getEndedAfter()); + endedBefore(other.getEndedBefore()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteFields(other.getRemoteFields()); + remoteId(other.getRemoteId()); + runType(other.getRunType()); + showEnumOrigins(other.getShowEnumOrigins()); + startedAfter(other.getStartedAfter()); + startedBefore(other.getStartedBefore()); + 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 = "ended_after", nulls = Nulls.SKIP) + public Builder endedAfter(Optional endedAfter) { + this.endedAfter = endedAfter; + return this; + } + + public Builder endedAfter(OffsetDateTime endedAfter) { + this.endedAfter = Optional.ofNullable(endedAfter); + return this; + } + + @JsonSetter(value = "ended_before", nulls = Nulls.SKIP) + public Builder endedBefore(Optional endedBefore) { + this.endedBefore = endedBefore; + return this; + } + + public Builder endedBefore(OffsetDateTime endedBefore) { + this.endedBefore = Optional.ofNullable(endedBefore); + 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(PayrollRunsListRequestRemoteFields 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 = "run_type", nulls = Nulls.SKIP) + public Builder runType(Optional runType) { + this.runType = runType; + return this; + } + + public Builder runType(PayrollRunsListRequestRunType runType) { + this.runType = Optional.ofNullable(runType); + return this; + } + + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(PayrollRunsListRequestShowEnumOrigins 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; + } + + public PayrollRunsListRequest build() { + return new PayrollRunsListRequest( + createdAfter, + createdBefore, + cursor, + endedAfter, + endedBefore, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteFields, + remoteId, + runType, + showEnumOrigins, + startedAfter, + startedBefore, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/payrollruns/requests/PayrollRunsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/payrollruns/requests/PayrollRunsRetrieveRequest.java new file mode 100644 index 000000000..35022bbe3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/payrollruns/requests/PayrollRunsRetrieveRequest.java @@ -0,0 +1,151 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.payrollruns.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.hris.payrollruns.types.PayrollRunsRetrieveRequestRemoteFields; +import com.merge.legacy.api.resources.hris.payrollruns.types.PayrollRunsRetrieveRequestShowEnumOrigins; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PayrollRunsRetrieveRequest.Builder.class) +public final class PayrollRunsRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private PayrollRunsRetrieveRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PayrollRunsRetrieveRequest && equalTo((PayrollRunsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PayrollRunsRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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(PayrollRunsRetrieveRequest 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(PayrollRunsRetrieveRequestRemoteFields 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(PayrollRunsRetrieveRequestShowEnumOrigins showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public PayrollRunsRetrieveRequest build() { + return new PayrollRunsRetrieveRequest( + includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/payrollruns/types/PayrollRunsListRequestRemoteFields.java b/src/main/java/com/merge/legacy/api/resources/hris/payrollruns/types/PayrollRunsListRequestRemoteFields.java new file mode 100644 index 000000000..33c2e354d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/payrollruns/types/PayrollRunsListRequestRemoteFields.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.payrollruns.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PayrollRunsListRequestRemoteFields { + RUN_STATE("run_state"), + + RUN_STATE_RUN_TYPE("run_state,run_type"), + + RUN_TYPE("run_type"); + + private final String value; + + PayrollRunsListRequestRemoteFields(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/payrollruns/types/PayrollRunsListRequestRunType.java b/src/main/java/com/merge/legacy/api/resources/hris/payrollruns/types/PayrollRunsListRequestRunType.java new file mode 100644 index 000000000..3ce0335d3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/payrollruns/types/PayrollRunsListRequestRunType.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.payrollruns.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PayrollRunsListRequestRunType { + CORRECTION("CORRECTION"), + + OFF_CYCLE("OFF_CYCLE"), + + REGULAR("REGULAR"), + + SIGN_ON_BONUS("SIGN_ON_BONUS"), + + TERMINATION("TERMINATION"); + + private final String value; + + PayrollRunsListRequestRunType(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/payrollruns/types/PayrollRunsListRequestShowEnumOrigins.java b/src/main/java/com/merge/legacy/api/resources/hris/payrollruns/types/PayrollRunsListRequestShowEnumOrigins.java new file mode 100644 index 000000000..695f4d0d3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/payrollruns/types/PayrollRunsListRequestShowEnumOrigins.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.payrollruns.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PayrollRunsListRequestShowEnumOrigins { + RUN_STATE("run_state"), + + RUN_STATE_RUN_TYPE("run_state,run_type"), + + RUN_TYPE("run_type"); + + private final String value; + + PayrollRunsListRequestShowEnumOrigins(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/payrollruns/types/PayrollRunsRetrieveRequestRemoteFields.java b/src/main/java/com/merge/legacy/api/resources/hris/payrollruns/types/PayrollRunsRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..f514ffa99 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/payrollruns/types/PayrollRunsRetrieveRequestRemoteFields.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.payrollruns.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PayrollRunsRetrieveRequestRemoteFields { + RUN_STATE("run_state"), + + RUN_STATE_RUN_TYPE("run_state,run_type"), + + RUN_TYPE("run_type"); + + private final String value; + + PayrollRunsRetrieveRequestRemoteFields(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/payrollruns/types/PayrollRunsRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/legacy/api/resources/hris/payrollruns/types/PayrollRunsRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..c4d049c6e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/payrollruns/types/PayrollRunsRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.payrollruns.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PayrollRunsRetrieveRequestShowEnumOrigins { + RUN_STATE("run_state"), + + RUN_STATE_RUN_TYPE("run_state,run_type"), + + RUN_TYPE("run_type"); + + private final String value; + + PayrollRunsRetrieveRequestShowEnumOrigins(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/regeneratekey/RegenerateKeyClient.java b/src/main/java/com/merge/legacy/api/resources/hris/regeneratekey/RegenerateKeyClient.java new file mode 100644 index 000000000..3966567a0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/regeneratekey/RegenerateKeyClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.regeneratekey; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.regeneratekey.requests.RemoteKeyForRegenerationRequest; +import com.merge.legacy.api.resources.hris.types.RemoteKey; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/regeneratekey/requests/RemoteKeyForRegenerationRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/regeneratekey/requests/RemoteKeyForRegenerationRequest.java new file mode 100644 index 000000000..33954b150 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/regeneratekey/requests/RemoteKeyForRegenerationRequest.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.regeneratekey.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + public RemoteKeyForRegenerationRequest build() { + return new RemoteKeyForRegenerationRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/scopes/ScopesClient.java b/src/main/java/com/merge/legacy/api/resources/hris/scopes/ScopesClient.java new file mode 100644 index 000000000..2e6605422 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/scopes/ScopesClient.java @@ -0,0 +1,150 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.scopes; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.scopes.requests.LinkedAccountCommonModelScopeDeserializerRequest; +import com.merge.legacy.api.resources.hris.types.CommonModelScopeApi; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..fcbbec53d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.scopes.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.hris.types.IndividualCommonModelScopeDeserializerRequest; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @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/legacy/api/resources/hris/syncstatus/SyncStatusClient.java b/src/main/java/com/merge/legacy/api/resources/hris/syncstatus/SyncStatusClient.java new file mode 100644 index 000000000..fc1b2fdc4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/syncstatus/SyncStatusClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.syncstatus; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.syncstatus.requests.SyncStatusListRequest; +import com.merge.legacy.api.resources.hris.types.PaginatedSyncStatusList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/syncstatus/requests/SyncStatusListRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/syncstatus/requests/SyncStatusListRequest.java new file mode 100644 index 000000000..5a07d43cb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/syncstatus/requests/SyncStatusListRequest.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.syncstatus.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.cursor, this.pageSize); + } + + @Override + 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/legacy/api/resources/hris/teams/TeamsClient.java b/src/main/java/com/merge/legacy/api/resources/hris/teams/TeamsClient.java new file mode 100644 index 000000000..bbe12fee9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/teams/TeamsClient.java @@ -0,0 +1,167 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.teams; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.teams.requests.TeamsListRequest; +import com.merge.legacy.api.resources.hris.teams.requests.TeamsRetrieveRequest; +import com.merge.legacy.api.resources.hris.types.PaginatedTeamList; +import com.merge.legacy.api.resources.hris.types.Team; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/teams/requests/TeamsListRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/teams/requests/TeamsListRequest.java new file mode 100644 index 000000000..94fcd12f2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/teams/requests/TeamsListRequest.java @@ -0,0 +1,417 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.teams.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/hris/teams/requests/TeamsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/teams/requests/TeamsRetrieveRequest.java new file mode 100644 index 000000000..5e62fb503 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/teams/requests/TeamsRetrieveRequest.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.teams.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/hris/timeoff/TimeOffClient.java b/src/main/java/com/merge/legacy/api/resources/hris/timeoff/TimeOffClient.java new file mode 100644 index 000000000..fc9776362 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/timeoff/TimeOffClient.java @@ -0,0 +1,310 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.timeoff; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.timeoff.requests.TimeOffEndpointRequest; +import com.merge.legacy.api.resources.hris.timeoff.requests.TimeOffListRequest; +import com.merge.legacy.api.resources.hris.timeoff.requests.TimeOffRetrieveRequest; +import com.merge.legacy.api.resources.hris.types.MetaResponse; +import com.merge.legacy.api.resources.hris.types.PaginatedTimeOffList; +import com.merge.legacy.api.resources.hris.types.TimeOff; +import com.merge.legacy.api.resources.hris.types.TimeOffResponse; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/hris/timeoff/requests/TimeOffEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/timeoff/requests/TimeOffEndpointRequest.java new file mode 100644 index 000000000..0b1bd1f73 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/timeoff/requests/TimeOffEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.timeoff.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.hris.types.TimeOffRequest; +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 = TimeOffEndpointRequest.Builder.class) +public final class TimeOffEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final TimeOffRequest model; + + private final Map additionalProperties; + + private TimeOffEndpointRequest( + Optional isDebugMode, + Optional runAsync, + TimeOffRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public TimeOffRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TimeOffEndpointRequest && equalTo((TimeOffEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TimeOffEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull TimeOffRequest model); + + Builder from(TimeOffEndpointRequest other); + } + + public interface _FinalStage { + TimeOffEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private TimeOffRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(TimeOffEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull TimeOffRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public TimeOffEndpointRequest build() { + return new TimeOffEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/timeoff/requests/TimeOffListRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/timeoff/requests/TimeOffListRequest.java new file mode 100644 index 000000000..2df64300e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/timeoff/requests/TimeOffListRequest.java @@ -0,0 +1,694 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.timeoff.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.hris.timeoff.types.*; +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 = TimeOffListRequest.Builder.class) +public final class TimeOffListRequest { + private final Optional approverId; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional employeeId; + + private final Optional endedAfter; + + private final Optional endedBefore; + + 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 requestType; + + private final Optional showEnumOrigins; + + private final Optional startedAfter; + + private final Optional startedBefore; + + private final Optional status; + + private final Map additionalProperties; + + private TimeOffListRequest( + Optional approverId, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional employeeId, + Optional endedAfter, + Optional endedBefore, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteFields, + Optional remoteId, + Optional requestType, + Optional showEnumOrigins, + Optional startedAfter, + Optional startedBefore, + Optional status, + Map additionalProperties) { + this.approverId = approverId; + 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; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.remoteFields = remoteFields; + this.remoteId = remoteId; + this.requestType = requestType; + this.showEnumOrigins = showEnumOrigins; + this.startedAfter = startedAfter; + this.startedBefore = startedBefore; + this.status = status; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return time off for this approver. + */ + @JsonProperty("approver_id") + public Optional getApproverId() { + return approverId; + } + + /** + * @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 time off for this employee. + */ + @JsonProperty("employee_id") + public Optional getEmployeeId() { + return employeeId; + } + + /** + * @return If provided, will only return employees that ended after this datetime. + */ + @JsonProperty("ended_after") + public Optional getEndedAfter() { + return endedAfter; + } + + /** + * @return If provided, will only return time-offs that ended before this datetime. + */ + @JsonProperty("ended_before") + 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. + */ + @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 If provided, will only return TimeOff with this request type. Options: ('VACATION', 'SICK', 'PERSONAL', 'JURY_DUTY', 'VOLUNTEER', 'BEREAVEMENT') + *
    + *
  • VACATION - VACATION
  • + *
  • SICK - SICK
  • + *
  • PERSONAL - PERSONAL
  • + *
  • JURY_DUTY - JURY_DUTY
  • + *
  • VOLUNTEER - VOLUNTEER
  • + *
  • BEREAVEMENT - BEREAVEMENT
  • + *
+ */ + @JsonProperty("request_type") + public Optional getRequestType() { + return requestType; + } + + /** + * @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 time-offs that started after this datetime. + */ + @JsonProperty("started_after") + public Optional getStartedAfter() { + return startedAfter; + } + + /** + * @return If provided, will only return time-offs that started before this datetime. + */ + @JsonProperty("started_before") + public Optional getStartedBefore() { + return startedBefore; + } + + /** + * @return If provided, will only return TimeOff with this status. Options: ('REQUESTED', 'APPROVED', 'DECLINED', 'CANCELLED', 'DELETED') + *
    + *
  • REQUESTED - REQUESTED
  • + *
  • APPROVED - APPROVED
  • + *
  • DECLINED - DECLINED
  • + *
  • CANCELLED - CANCELLED
  • + *
  • DELETED - DELETED
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TimeOffListRequest && equalTo((TimeOffListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TimeOffListRequest other) { + return 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) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteFields.equals(other.remoteFields) + && remoteId.equals(other.remoteId) + && requestType.equals(other.requestType) + && showEnumOrigins.equals(other.showEnumOrigins) + && startedAfter.equals(other.startedAfter) + && startedBefore.equals(other.startedBefore) + && status.equals(other.status); + } + + @Override + public int hashCode() { + return Objects.hash( + this.approverId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.employeeId, + this.endedAfter, + this.endedBefore, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteFields, + this.remoteId, + this.requestType, + this.showEnumOrigins, + this.startedAfter, + this.startedBefore, + this.status); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional approverId = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional employeeId = Optional.empty(); + + private Optional endedAfter = Optional.empty(); + + private Optional endedBefore = 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 requestType = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + private Optional startedAfter = Optional.empty(); + + private Optional startedBefore = Optional.empty(); + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TimeOffListRequest other) { + approverId(other.getApproverId()); + 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()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteFields(other.getRemoteFields()); + remoteId(other.getRemoteId()); + requestType(other.getRequestType()); + showEnumOrigins(other.getShowEnumOrigins()); + startedAfter(other.getStartedAfter()); + startedBefore(other.getStartedBefore()); + status(other.getStatus()); + return this; + } + + @JsonSetter(value = "approver_id", nulls = Nulls.SKIP) + public Builder approverId(Optional approverId) { + this.approverId = approverId; + return this; + } + + public Builder approverId(String approverId) { + this.approverId = Optional.ofNullable(approverId); + 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 = "employee_id", nulls = Nulls.SKIP) + public Builder employeeId(Optional employeeId) { + this.employeeId = employeeId; + return this; + } + + public Builder employeeId(String employeeId) { + this.employeeId = Optional.ofNullable(employeeId); + return this; + } + + @JsonSetter(value = "ended_after", nulls = Nulls.SKIP) + public Builder endedAfter(Optional endedAfter) { + this.endedAfter = endedAfter; + return this; + } + + public Builder endedAfter(OffsetDateTime endedAfter) { + this.endedAfter = Optional.ofNullable(endedAfter); + return this; + } + + @JsonSetter(value = "ended_before", nulls = Nulls.SKIP) + public Builder endedBefore(Optional endedBefore) { + this.endedBefore = endedBefore; + return this; + } + + public Builder endedBefore(OffsetDateTime endedBefore) { + this.endedBefore = Optional.ofNullable(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; + 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(TimeOffListRequestRemoteFields 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 = "request_type", nulls = Nulls.SKIP) + public Builder requestType(Optional requestType) { + this.requestType = requestType; + return this; + } + + public Builder requestType(TimeOffListRequestRequestType requestType) { + this.requestType = Optional.ofNullable(requestType); + return this; + } + + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(TimeOffListRequestShowEnumOrigins 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 = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(TimeOffListRequestStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + public TimeOffListRequest build() { + return new TimeOffListRequest( + approverId, + createdAfter, + createdBefore, + cursor, + employeeId, + endedAfter, + endedBefore, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteFields, + remoteId, + requestType, + showEnumOrigins, + startedAfter, + startedBefore, + status, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/timeoff/requests/TimeOffRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/timeoff/requests/TimeOffRetrieveRequest.java new file mode 100644 index 000000000..1b2182a2c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/timeoff/requests/TimeOffRetrieveRequest.java @@ -0,0 +1,179 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.timeoff.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.hris.timeoff.types.TimeOffRetrieveRequestExpand; +import com.merge.legacy.api.resources.hris.timeoff.types.TimeOffRetrieveRequestRemoteFields; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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/legacy/api/resources/hris/timeoff/types/TimeOffListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/hris/timeoff/types/TimeOffListRequestExpand.java new file mode 100644 index 000000000..e4b895ce7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/timeoff/types/TimeOffListRequestExpand.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/timeoff/types/TimeOffListRequestRemoteFields.java b/src/main/java/com/merge/legacy/api/resources/hris/timeoff/types/TimeOffListRequestRemoteFields.java new file mode 100644 index 000000000..6afa67600 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/timeoff/types/TimeOffListRequestRemoteFields.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.timeoff.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TimeOffListRequestRemoteFields { + REQUEST_TYPE("request_type"), + + REQUEST_TYPE_STATUS("request_type,status"), + + REQUEST_TYPE_STATUS_UNITS("request_type,status,units"), + + REQUEST_TYPE_UNITS("request_type,units"), + + STATUS("status"), + + STATUS_UNITS("status,units"), + + UNITS("units"); + + private final String value; + + TimeOffListRequestRemoteFields(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/timeoff/types/TimeOffListRequestRequestType.java b/src/main/java/com/merge/legacy/api/resources/hris/timeoff/types/TimeOffListRequestRequestType.java new file mode 100644 index 000000000..1a7c13152 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/timeoff/types/TimeOffListRequestRequestType.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.timeoff.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TimeOffListRequestRequestType { + BEREAVEMENT("BEREAVEMENT"), + + JURY_DUTY("JURY_DUTY"), + + PERSONAL("PERSONAL"), + + SICK("SICK"), + + VACATION("VACATION"), + + VOLUNTEER("VOLUNTEER"); + + private final String value; + + TimeOffListRequestRequestType(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/timeoff/types/TimeOffListRequestShowEnumOrigins.java b/src/main/java/com/merge/legacy/api/resources/hris/timeoff/types/TimeOffListRequestShowEnumOrigins.java new file mode 100644 index 000000000..4d2444bb1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/timeoff/types/TimeOffListRequestShowEnumOrigins.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.timeoff.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TimeOffListRequestShowEnumOrigins { + REQUEST_TYPE("request_type"), + + REQUEST_TYPE_STATUS("request_type,status"), + + REQUEST_TYPE_STATUS_UNITS("request_type,status,units"), + + REQUEST_TYPE_UNITS("request_type,units"), + + STATUS("status"), + + STATUS_UNITS("status,units"), + + UNITS("units"); + + private final String value; + + TimeOffListRequestShowEnumOrigins(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/timeoff/types/TimeOffListRequestStatus.java b/src/main/java/com/merge/legacy/api/resources/hris/timeoff/types/TimeOffListRequestStatus.java new file mode 100644 index 000000000..88c6902cb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/timeoff/types/TimeOffListRequestStatus.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.timeoff.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TimeOffListRequestStatus { + APPROVED("APPROVED"), + + CANCELLED("CANCELLED"), + + DECLINED("DECLINED"), + + DELETED("DELETED"), + + REQUESTED("REQUESTED"); + + private final String value; + + TimeOffListRequestStatus(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/timeoff/types/TimeOffRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/hris/timeoff/types/TimeOffRetrieveRequestExpand.java new file mode 100644 index 000000000..cfbb38fe3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/timeoff/types/TimeOffRetrieveRequestExpand.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/timeoff/types/TimeOffRetrieveRequestRemoteFields.java b/src/main/java/com/merge/legacy/api/resources/hris/timeoff/types/TimeOffRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..28c928d0a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/timeoff/types/TimeOffRetrieveRequestRemoteFields.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.timeoff.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TimeOffRetrieveRequestRemoteFields { + REQUEST_TYPE("request_type"), + + REQUEST_TYPE_STATUS("request_type,status"), + + REQUEST_TYPE_STATUS_UNITS("request_type,status,units"), + + REQUEST_TYPE_UNITS("request_type,units"), + + STATUS("status"), + + STATUS_UNITS("status,units"), + + UNITS("units"); + + private final String value; + + TimeOffRetrieveRequestRemoteFields(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/timeoff/types/TimeOffRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/legacy/api/resources/hris/timeoff/types/TimeOffRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..95ce2ec73 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/timeoff/types/TimeOffRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.timeoff.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TimeOffRetrieveRequestShowEnumOrigins { + REQUEST_TYPE("request_type"), + + REQUEST_TYPE_STATUS("request_type,status"), + + REQUEST_TYPE_STATUS_UNITS("request_type,status,units"), + + REQUEST_TYPE_UNITS("request_type,units"), + + STATUS("status"), + + STATUS_UNITS("status,units"), + + UNITS("units"); + + private final String value; + + TimeOffRetrieveRequestShowEnumOrigins(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/timeoffbalances/TimeOffBalancesClient.java b/src/main/java/com/merge/legacy/api/resources/hris/timeoffbalances/TimeOffBalancesClient.java new file mode 100644 index 000000000..7524b9ad2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/timeoffbalances/TimeOffBalancesClient.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.timeoffbalances; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.timeoffbalances.requests.TimeOffBalancesListRequest; +import com.merge.legacy.api.resources.hris.timeoffbalances.requests.TimeOffBalancesRetrieveRequest; +import com.merge.legacy.api.resources.hris.types.PaginatedTimeOffBalanceList; +import com.merge.legacy.api.resources.hris.types.TimeOffBalance; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/hris/timeoffbalances/requests/TimeOffBalancesListRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/timeoffbalances/requests/TimeOffBalancesListRequest.java new file mode 100644 index 000000000..95ec07aab --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/timeoffbalances/requests/TimeOffBalancesListRequest.java @@ -0,0 +1,513 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.timeoffbalances.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.hris.timeoffbalances.types.TimeOffBalancesListRequestPolicyType; +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 = TimeOffBalancesListRequest.Builder.class) +public final class TimeOffBalancesListRequest { + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional employeeId; + + 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 policyType; + + private final Optional remoteFields; + + private final Optional remoteId; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private TimeOffBalancesListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional employeeId, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional policyType, + Optional remoteFields, + Optional remoteId, + Optional showEnumOrigins, + Map additionalProperties) { + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.employeeId = employeeId; + this.expand = expand; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.policyType = policyType; + 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 time off balances for this employee. + */ + @JsonProperty("employee_id") + 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. + */ + @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 TimeOffBalance with this policy type. Options: ('VACATION', 'SICK', 'PERSONAL', 'JURY_DUTY', 'VOLUNTEER', 'BEREAVEMENT') + *
    + *
  • VACATION - VACATION
  • + *
  • SICK - SICK
  • + *
  • PERSONAL - PERSONAL
  • + *
  • JURY_DUTY - JURY_DUTY
  • + *
  • VOLUNTEER - VOLUNTEER
  • + *
  • BEREAVEMENT - BEREAVEMENT
  • + *
+ */ + @JsonProperty("policy_type") + public Optional getPolicyType() { + return policyType; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TimeOffBalancesListRequest && equalTo((TimeOffBalancesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TimeOffBalancesListRequest other) { + return 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) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && policyType.equals(other.policyType) + && remoteFields.equals(other.remoteFields) + && remoteId.equals(other.remoteId) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.employeeId, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.policyType, + this.remoteFields, + this.remoteId, + this.showEnumOrigins); + } + + @Override + 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 employeeId = 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 policyType = 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(TimeOffBalancesListRequest other) { + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + employeeId(other.getEmployeeId()); + expand(other.getExpand()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + policyType(other.getPolicyType()); + 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 = "employee_id", nulls = Nulls.SKIP) + public Builder employeeId(Optional employeeId) { + this.employeeId = employeeId; + return this; + } + + public Builder employeeId(String employeeId) { + this.employeeId = Optional.ofNullable(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; + 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 = "policy_type", nulls = Nulls.SKIP) + public Builder policyType(Optional policyType) { + this.policyType = policyType; + return this; + } + + public Builder policyType(TimeOffBalancesListRequestPolicyType policyType) { + this.policyType = Optional.ofNullable(policyType); + 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 TimeOffBalancesListRequest build() { + return new TimeOffBalancesListRequest( + createdAfter, + createdBefore, + cursor, + employeeId, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + policyType, + remoteFields, + remoteId, + showEnumOrigins, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/timeoffbalances/requests/TimeOffBalancesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/timeoffbalances/requests/TimeOffBalancesRetrieveRequest.java new file mode 100644 index 000000000..4a7121d0d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/timeoffbalances/requests/TimeOffBalancesRetrieveRequest.java @@ -0,0 +1,176 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.timeoffbalances.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = TimeOffBalancesRetrieveRequest.Builder.class) +public final class TimeOffBalancesRetrieveRequest { + private final Optional expand; + + private final Optional includeRemoteData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private TimeOffBalancesRetrieveRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TimeOffBalancesRetrieveRequest && equalTo((TimeOffBalancesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TimeOffBalancesRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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(TimeOffBalancesRetrieveRequest 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 TimeOffBalancesRetrieveRequest build() { + return new TimeOffBalancesRetrieveRequest( + expand, includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/timeoffbalances/types/TimeOffBalancesListRequestPolicyType.java b/src/main/java/com/merge/legacy/api/resources/hris/timeoffbalances/types/TimeOffBalancesListRequestPolicyType.java new file mode 100644 index 000000000..5e775d338 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/timeoffbalances/types/TimeOffBalancesListRequestPolicyType.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.timeoffbalances.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TimeOffBalancesListRequestPolicyType { + BEREAVEMENT("BEREAVEMENT"), + + JURY_DUTY("JURY_DUTY"), + + PERSONAL("PERSONAL"), + + SICK("SICK"), + + VACATION("VACATION"), + + VOLUNTEER("VOLUNTEER"); + + private final String value; + + TimeOffBalancesListRequestPolicyType(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/timesheetentries/TimesheetEntriesClient.java b/src/main/java/com/merge/legacy/api/resources/hris/timesheetentries/TimesheetEntriesClient.java new file mode 100644 index 000000000..86299a155 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/timesheetentries/TimesheetEntriesClient.java @@ -0,0 +1,287 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.timesheetentries; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.timesheetentries.requests.TimesheetEntriesListRequest; +import com.merge.legacy.api.resources.hris.timesheetentries.requests.TimesheetEntriesRetrieveRequest; +import com.merge.legacy.api.resources.hris.timesheetentries.requests.TimesheetEntryEndpointRequest; +import com.merge.legacy.api.resources.hris.types.MetaResponse; +import com.merge.legacy.api.resources.hris.types.PaginatedTimesheetEntryList; +import com.merge.legacy.api.resources.hris.types.TimesheetEntry; +import com.merge.legacy.api.resources.hris.types.TimesheetEntryResponse; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/hris/timesheetentries/requests/TimesheetEntriesListRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/timesheetentries/requests/TimesheetEntriesListRequest.java new file mode 100644 index 000000000..bc66c3129 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/timesheetentries/requests/TimesheetEntriesListRequest.java @@ -0,0 +1,563 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.timesheetentries.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.hris.timesheetentries.types.TimesheetEntriesListRequestOrderBy; +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 = TimesheetEntriesListRequest.Builder.class) +public final class TimesheetEntriesListRequest { + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional employeeId; + + private final Optional endedAfter; + + private final Optional endedBefore; + + 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 orderBy; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Optional startedAfter; + + private final Optional startedBefore; + + private final Map additionalProperties; + + private TimesheetEntriesListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional employeeId, + Optional endedAfter, + Optional endedBefore, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional orderBy, + Optional pageSize, + Optional remoteId, + Optional startedAfter, + Optional startedBefore, + Map additionalProperties) { + 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; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.orderBy = orderBy; + this.pageSize = pageSize; + this.remoteId = remoteId; + this.startedAfter = startedAfter; + this.startedBefore = startedBefore; + 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 timesheet entries for this employee. + */ + @JsonProperty("employee_id") + public Optional getEmployeeId() { + return employeeId; + } + + /** + * @return If provided, will only return timesheet entries ended after this datetime. + */ + @JsonProperty("ended_after") + public Optional getEndedAfter() { + return endedAfter; + } + + /** + * @return If provided, will only return timesheet entries ended before this datetime. + */ + @JsonProperty("ended_before") + 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. + */ + @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 Overrides the default ordering for this endpoint. Possible values include: start_time, -start_time. + */ + @JsonProperty("order_by") + public Optional getOrderBy() { + return orderBy; + } + + /** + * @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 timesheet entries started after this datetime. + */ + @JsonProperty("started_after") + public Optional getStartedAfter() { + return startedAfter; + } + + /** + * @return If provided, will only return timesheet entries started before this datetime. + */ + @JsonProperty("started_before") + public Optional getStartedBefore() { + return startedBefore; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TimesheetEntriesListRequest && equalTo((TimesheetEntriesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TimesheetEntriesListRequest other) { + return 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) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && orderBy.equals(other.orderBy) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId) + && startedAfter.equals(other.startedAfter) + && startedBefore.equals(other.startedBefore); + } + + @Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.employeeId, + this.endedAfter, + this.endedBefore, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.orderBy, + this.pageSize, + this.remoteId, + this.startedAfter, + this.startedBefore); + } + + @Override + 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 employeeId = Optional.empty(); + + private Optional endedAfter = Optional.empty(); + + private Optional endedBefore = 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 orderBy = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional startedAfter = Optional.empty(); + + private Optional startedBefore = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TimesheetEntriesListRequest other) { + 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()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + orderBy(other.getOrderBy()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + startedAfter(other.getStartedAfter()); + startedBefore(other.getStartedBefore()); + 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 = "employee_id", nulls = Nulls.SKIP) + public Builder employeeId(Optional employeeId) { + this.employeeId = employeeId; + return this; + } + + public Builder employeeId(String employeeId) { + this.employeeId = Optional.ofNullable(employeeId); + return this; + } + + @JsonSetter(value = "ended_after", nulls = Nulls.SKIP) + public Builder endedAfter(Optional endedAfter) { + this.endedAfter = endedAfter; + return this; + } + + public Builder endedAfter(OffsetDateTime endedAfter) { + this.endedAfter = Optional.ofNullable(endedAfter); + return this; + } + + @JsonSetter(value = "ended_before", nulls = Nulls.SKIP) + public Builder endedBefore(Optional endedBefore) { + this.endedBefore = endedBefore; + return this; + } + + public Builder endedBefore(OffsetDateTime endedBefore) { + this.endedBefore = Optional.ofNullable(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; + 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 = "order_by", nulls = Nulls.SKIP) + public Builder orderBy(Optional orderBy) { + this.orderBy = orderBy; + return this; + } + + public Builder orderBy(TimesheetEntriesListRequestOrderBy orderBy) { + this.orderBy = Optional.ofNullable(orderBy); + 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 = "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; + } + + public TimesheetEntriesListRequest build() { + return new TimesheetEntriesListRequest( + createdAfter, + createdBefore, + cursor, + employeeId, + endedAfter, + endedBefore, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + orderBy, + pageSize, + remoteId, + startedAfter, + startedBefore, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/timesheetentries/requests/TimesheetEntriesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/timesheetentries/requests/TimesheetEntriesRetrieveRequest.java new file mode 100644 index 000000000..bc795b4e5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/timesheetentries/requests/TimesheetEntriesRetrieveRequest.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.timesheetentries.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/hris/timesheetentries/requests/TimesheetEntryEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/timesheetentries/requests/TimesheetEntryEndpointRequest.java new file mode 100644 index 000000000..69e97314f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/timesheetentries/requests/TimesheetEntryEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.timesheetentries.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.hris.types.TimesheetEntryRequest; +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 = TimesheetEntryEndpointRequest.Builder.class) +public final class TimesheetEntryEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final TimesheetEntryRequest model; + + private final Map additionalProperties; + + private TimesheetEntryEndpointRequest( + Optional isDebugMode, + Optional runAsync, + TimesheetEntryRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public TimesheetEntryRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TimesheetEntryEndpointRequest && equalTo((TimesheetEntryEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TimesheetEntryEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull TimesheetEntryRequest model); + + Builder from(TimesheetEntryEndpointRequest other); + } + + public interface _FinalStage { + TimesheetEntryEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private TimesheetEntryRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(TimesheetEntryEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull TimesheetEntryRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public TimesheetEntryEndpointRequest build() { + return new TimesheetEntryEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/timesheetentries/types/TimesheetEntriesListRequestOrderBy.java b/src/main/java/com/merge/legacy/api/resources/hris/timesheetentries/types/TimesheetEntriesListRequestOrderBy.java new file mode 100644 index 000000000..767672bd6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/timesheetentries/types/TimesheetEntriesListRequestOrderBy.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.timesheetentries.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TimesheetEntriesListRequestOrderBy { + START_TIME_DESCENDING("-start_time"), + + START_TIME_ASCENDING("start_time"); + + private final String value; + + TimesheetEntriesListRequestOrderBy(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/AccountDetails.java b/src/main/java/com/merge/legacy/api/resources/hris/types/AccountDetails.java new file mode 100644 index 000000000..0926ac166 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/AccountDetails.java @@ -0,0 +1,387 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/hris/types/AccountDetailsAndActions.java b/src/main/java/com/merge/legacy/api/resources/hris/types/AccountDetailsAndActions.java new file mode 100644 index 000000000..107bac06f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/AccountDetailsAndActions.java @@ -0,0 +1,474 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("id") + public StatusStage id(@NotNull String id) { + this.id = id; + return this; + } + + @Override + @JsonSetter("status") + public EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status) { + this.status = status; + return this; + } + + @Override + @JsonSetter("end_user_organization_name") + public EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + @Override + @JsonSetter("end_user_email_address") + public WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + @Override + @JsonSetter("webhook_listener_url") + public AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl) { + this.webhookListenerUrl = webhookListenerUrl; + return this; + } + + @Override + @JsonSetter("account_type") + public CompletedAtStage accountType(@NotNull String accountType) { + this.accountType = accountType; + return this; + } + + @Override + @JsonSetter("completed_at") + public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { + this.completedAt = completedAt; + return this; + } + + @Override + public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @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. + */ + @Override + public _FinalStage isDuplicate(Boolean isDuplicate) { + this.isDuplicate = Optional.ofNullable(isDuplicate); + return this; + } + + @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. + */ + @Override + public _FinalStage subdomain(String subdomain) { + this.subdomain = Optional.ofNullable(subdomain); + return this; + } + + @Override + @JsonSetter(value = "subdomain", nulls = Nulls.SKIP) + public _FinalStage subdomain(Optional subdomain) { + this.subdomain = subdomain; + return this; + } + + @Override + public _FinalStage endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @Override + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public _FinalStage endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + @Override + public _FinalStage statusDetail(String statusDetail) { + this.statusDetail = Optional.ofNullable(statusDetail); + return this; + } + + @Override + @JsonSetter(value = "status_detail", nulls = Nulls.SKIP) + public _FinalStage statusDetail(Optional statusDetail) { + this.statusDetail = statusDetail; + return this; + } + + @Override + public _FinalStage category(CategoryEnum category) { + this.category = Optional.ofNullable(category); + return this; + } + + @Override + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public _FinalStage category(Optional category) { + this.category = category; + return this; + } + + @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/legacy/api/resources/hris/types/AccountDetailsAndActionsIntegration.java b/src/main/java/com/merge/legacy/api/resources/hris/types/AccountDetailsAndActionsIntegration.java new file mode 100644 index 000000000..e5d825c6f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/AccountDetailsAndActionsIntegration.java @@ -0,0 +1,317 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.categories, + this.image, + this.squareImage, + this.color, + this.slug, + this.passthroughAvailable, + this.availableModelOperations); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("name") + public ColorStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + @JsonSetter("color") + public SlugStage color(@NotNull String color) { + this.color = color; + return this; + } + + @Override + @JsonSetter("slug") + public PassthroughAvailableStage slug(@NotNull String slug) { + this.slug = slug; + return this; + } + + @Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @Override + @JsonSetter(value = "square_image", nulls = Nulls.SKIP) + public _FinalStage squareImage(Optional squareImage) { + this.squareImage = squareImage; + return this; + } + + @Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @Override + @JsonSetter(value = "image", nulls = Nulls.SKIP) + public _FinalStage image(Optional image) { + this.image = image; + return this; + } + + @Override + public _FinalStage addAllCategories(List categories) { + this.categories.addAll(categories); + return this; + } + + @Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + this.categories.addAll(categories); + return this; + } + + @Override + public AccountDetailsAndActionsIntegration build() { + return new AccountDetailsAndActionsIntegration( + name, + categories, + image, + squareImage, + color, + slug, + passthroughAvailable, + availableModelOperations, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/AccountDetailsAndActionsStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/AccountDetailsAndActionsStatusEnum.java new file mode 100644 index 000000000..ec6965735 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/AccountDetailsAndActionsStatusEnum.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/AccountIntegration.java b/src/main/java/com/merge/legacy/api/resources/hris/types/AccountIntegration.java new file mode 100644 index 000000000..ae5830eec --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/AccountIntegration.java @@ -0,0 +1,453 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @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); + } + + @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() {} + + @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. + */ + @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. + */ + @Override + public _FinalStage categoryBetaStatus(Map categoryBetaStatus) { + this.categoryBetaStatus = Optional.ofNullable(categoryBetaStatus); + return this; + } + + @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. + */ + @Override + public _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl) { + this.webhookSetupGuideUrl = Optional.ofNullable(webhookSetupGuideUrl); + return this; + } + + @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. + */ + @Override + public _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = Optional.ofNullable(apiEndpointsToDocumentationUrls); + return this; + } + + @Override + @JsonSetter(value = "api_endpoints_to_documentation_urls", nulls = Nulls.SKIP) + public _FinalStage apiEndpointsToDocumentationUrls( + Optional> apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; + return this; + } + + @Override + public _FinalStage slug(String slug) { + this.slug = Optional.ofNullable(slug); + return this; + } + + @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. + */ + @Override + public _FinalStage color(String color) { + this.color = Optional.ofNullable(color); + return this; + } + + @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. + */ + @Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @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. + */ + @Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @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. + */ + @Override + public _FinalStage categories(List categories) { + this.categories = Optional.ofNullable(categories); + return this; + } + + @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. + */ + @Override + public _FinalStage abbreviatedName(String abbreviatedName) { + this.abbreviatedName = Optional.ofNullable(abbreviatedName); + return this; + } + + @Override + @JsonSetter(value = "abbreviated_name", nulls = Nulls.SKIP) + public _FinalStage abbreviatedName(Optional abbreviatedName) { + this.abbreviatedName = abbreviatedName; + return this; + } + + @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/legacy/api/resources/hris/types/AccountToken.java b/src/main/java/com/merge/legacy/api/resources/hris/types/AccountToken.java new file mode 100644 index 000000000..eea928a01 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/AccountToken.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.accountToken, this.integration); + } + + @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() {} + + @Override + public Builder from(AccountToken other) { + accountToken(other.getAccountToken()); + integration(other.getIntegration()); + return this; + } + + @Override + @JsonSetter("account_token") + public IntegrationStage accountToken(@NotNull String accountToken) { + this.accountToken = accountToken; + return this; + } + + @Override + @JsonSetter("integration") + public _FinalStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @Override + public AccountToken build() { + return new AccountToken(accountToken, integration, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/AccountTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/AccountTypeEnum.java new file mode 100644 index 000000000..06869031a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/AccountTypeEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AccountTypeEnum { + SAVINGS("SAVINGS"), + + CHECKING("CHECKING"); + + private final String value; + + AccountTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/AdvancedMetadata.java b/src/main/java/com/merge/legacy/api/resources/hris/types/AdvancedMetadata.java new file mode 100644 index 000000000..0cf6e380d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/AdvancedMetadata.java @@ -0,0 +1,250 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, this.displayName, this.description, this.isRequired, this.isCustom, this.fieldChoices); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = id; + return this; + } + + @Override + public _FinalStage fieldChoices(List fieldChoices) { + this.fieldChoices = Optional.ofNullable(fieldChoices); + return this; + } + + @Override + @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) + public _FinalStage fieldChoices(Optional> fieldChoices) { + this.fieldChoices = fieldChoices; + return this; + } + + @Override + public _FinalStage isCustom(Boolean isCustom) { + this.isCustom = Optional.ofNullable(isCustom); + return this; + } + + @Override + @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) + public _FinalStage isCustom(Optional isCustom) { + this.isCustom = isCustom; + return this; + } + + @Override + public _FinalStage isRequired(Boolean isRequired) { + this.isRequired = Optional.ofNullable(isRequired); + return this; + } + + @Override + @JsonSetter(value = "is_required", nulls = Nulls.SKIP) + public _FinalStage isRequired(Optional isRequired) { + this.isRequired = isRequired; + return this; + } + + @Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + @Override + public _FinalStage displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @Override + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public _FinalStage displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + @Override + public AdvancedMetadata build() { + return new AdvancedMetadata( + id, displayName, description, isRequired, isCustom, fieldChoices, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/AsyncPassthroughReciept.java b/src/main/java/com/merge/legacy/api/resources/hris/types/AsyncPassthroughReciept.java new file mode 100644 index 000000000..de539e068 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/AsyncPassthroughReciept.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.asyncPassthroughReceiptId); + } + + @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() {} + + @Override + public Builder from(AsyncPassthroughReciept other) { + asyncPassthroughReceiptId(other.getAsyncPassthroughReceiptId()); + return this; + } + + @Override + @JsonSetter("async_passthrough_receipt_id") + public _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId) { + this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; + return this; + } + + @Override + public AsyncPassthroughReciept build() { + return new AsyncPassthroughReciept(asyncPassthroughReceiptId, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/AuditLogEvent.java b/src/main/java/com/merge/legacy/api/resources/hris/types/AuditLogEvent.java new file mode 100644 index 000000000..6a0bf6ef2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/AuditLogEvent.java @@ -0,0 +1,441 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.userName, + this.userEmail, + this.role, + this.ipAddress, + this.eventType, + this.eventDescription, + this.createdAt); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("role") + public IpAddressStage role(@NotNull AuditLogEventRole role) { + this.role = role; + return this; + } + + @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. + */ + @Override + @JsonSetter("event_type") + public EventDescriptionStage eventType(@NotNull AuditLogEventEventType eventType) { + this.eventType = eventType; + return this; + } + + @Override + @JsonSetter("event_description") + public _FinalStage eventDescription(@NotNull String eventDescription) { + this.eventDescription = eventDescription; + return this; + } + + @Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @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. + */ + @Override + public _FinalStage userEmail(String userEmail) { + this.userEmail = Optional.ofNullable(userEmail); + return this; + } + + @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. + */ + @Override + public _FinalStage userName(String userName) { + this.userName = Optional.ofNullable(userName); + return this; + } + + @Override + @JsonSetter(value = "user_name", nulls = Nulls.SKIP) + public _FinalStage userName(Optional userName) { + this.userName = userName; + return this; + } + + @Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @Override + public AuditLogEvent build() { + return new AuditLogEvent( + id, + userName, + userEmail, + role, + ipAddress, + eventType, + eventDescription, + createdAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/AuditLogEventEventType.java b/src/main/java/com/merge/legacy/api/resources/hris/types/AuditLogEventEventType.java new file mode 100644 index 000000000..ae8f4178a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/AuditLogEventEventType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/AuditLogEventRole.java b/src/main/java/com/merge/legacy/api/resources/hris/types/AuditLogEventRole.java new file mode 100644 index 000000000..cb19e914d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/AuditLogEventRole.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/AvailableActions.java b/src/main/java/com/merge/legacy/api/resources/hris/types/AvailableActions.java new file mode 100644 index 000000000..7d5fa5cff --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/AvailableActions.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.integration, this.passthroughAvailable, this.availableModelOperations); + } + + @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() {} + + @Override + public Builder from(AvailableActions other) { + integration(other.getIntegration()); + passthroughAvailable(other.getPassthroughAvailable()); + availableModelOperations(other.getAvailableModelOperations()); + return this; + } + + @Override + @JsonSetter("integration") + public PassthroughAvailableStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @Override + public AvailableActions build() { + return new AvailableActions( + integration, passthroughAvailable, availableModelOperations, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/BankInfo.java b/src/main/java/com/merge/legacy/api/resources/hris/types/BankInfo.java new file mode 100644 index 000000000..7298e37c5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/BankInfo.java @@ -0,0 +1,439 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BankInfo.Builder.class) +public final class BankInfo { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional employee; + + private final Optional accountNumber; + + private final Optional routingNumber; + + private final Optional bankName; + + private final Optional accountType; + + private final Optional remoteCreatedAt; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private BankInfo( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional employee, + Optional accountNumber, + Optional routingNumber, + Optional bankName, + Optional accountType, + Optional remoteCreatedAt, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.employee = employee; + this.accountNumber = accountNumber; + this.routingNumber = routingNumber; + this.bankName = bankName; + this.accountType = accountType; + 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 employee with this bank account. + */ + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + /** + * @return The account number. + */ + @JsonProperty("account_number") + public Optional getAccountNumber() { + return accountNumber; + } + + /** + * @return The routing number. + */ + @JsonProperty("routing_number") + public Optional getRoutingNumber() { + return routingNumber; + } + + /** + * @return The bank name. + */ + @JsonProperty("bank_name") + public Optional getBankName() { + return bankName; + } + + /** + * @return The bank account type + *
    + *
  • SAVINGS - SAVINGS
  • + *
  • CHECKING - CHECKING
  • + *
+ */ + @JsonProperty("account_type") + public Optional getAccountType() { + return accountType; + } + + /** + * @return When the matching bank object was created in the third party system. + */ + @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BankInfo && equalTo((BankInfo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BankInfo other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && employee.equals(other.employee) + && accountNumber.equals(other.accountNumber) + && routingNumber.equals(other.routingNumber) + && bankName.equals(other.bankName) + && accountType.equals(other.accountType) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.employee, + this.accountNumber, + this.routingNumber, + this.bankName, + this.accountType, + this.remoteCreatedAt, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 employee = Optional.empty(); + + private Optional accountNumber = Optional.empty(); + + private Optional routingNumber = Optional.empty(); + + private Optional bankName = Optional.empty(); + + private Optional accountType = 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(BankInfo other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + employee(other.getEmployee()); + accountNumber(other.getAccountNumber()); + routingNumber(other.getRoutingNumber()); + bankName(other.getBankName()); + accountType(other.getAccountType()); + 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 = "employee", nulls = Nulls.SKIP) + public Builder employee(Optional employee) { + this.employee = employee; + return this; + } + + public Builder employee(BankInfoEmployee employee) { + this.employee = Optional.ofNullable(employee); + 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 = "routing_number", nulls = Nulls.SKIP) + public Builder routingNumber(Optional routingNumber) { + this.routingNumber = routingNumber; + return this; + } + + public Builder routingNumber(String routingNumber) { + this.routingNumber = Optional.ofNullable(routingNumber); + return this; + } + + @JsonSetter(value = "bank_name", nulls = Nulls.SKIP) + public Builder bankName(Optional bankName) { + this.bankName = bankName; + return this; + } + + public Builder bankName(String bankName) { + this.bankName = Optional.ofNullable(bankName); + return this; + } + + @JsonSetter(value = "account_type", nulls = Nulls.SKIP) + public Builder accountType(Optional accountType) { + this.accountType = accountType; + return this; + } + + public Builder accountType(BankInfoAccountType accountType) { + this.accountType = Optional.ofNullable(accountType); + 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 BankInfo build() { + return new BankInfo( + id, + remoteId, + createdAt, + modifiedAt, + employee, + accountNumber, + routingNumber, + bankName, + accountType, + remoteCreatedAt, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/BankInfoAccountType.java b/src/main/java/com/merge/legacy/api/resources/hris/types/BankInfoAccountType.java new file mode 100644 index 000000000..5ee85282e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/BankInfoAccountType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/BankInfoEmployee.java b/src/main/java/com/merge/legacy/api/resources/hris/types/BankInfoEmployee.java new file mode 100644 index 000000000..7751287cd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/BankInfoEmployee.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = BankInfoEmployee.Deserializer.class) +public final class BankInfoEmployee { + private final Object value; + + private final int type; + + private BankInfoEmployee(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((Employee) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BankInfoEmployee && equalTo((BankInfoEmployee) other); + } + + private boolean equalTo(BankInfoEmployee other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static BankInfoEmployee of(String value) { + return new BankInfoEmployee(value, 0); + } + + public static BankInfoEmployee of(Employee value) { + return new BankInfoEmployee(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employee value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(BankInfoEmployee.class); + } + + @Override + public BankInfoEmployee 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, Employee.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/Benefit.java b/src/main/java/com/merge/legacy/api/resources/hris/types/Benefit.java new file mode 100644 index 000000000..7e9e7ad3e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/Benefit.java @@ -0,0 +1,493 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Benefit.Builder.class) +public final class Benefit { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional employee; + + private final Optional providerName; + + private final Optional benefitPlanType; + + private final Optional employeeContribution; + + private final Optional companyContribution; + + private final Optional startDate; + + private final Optional endDate; + + private final Optional remoteWasDeleted; + + private final Optional employerBenefit; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Benefit( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional employee, + Optional providerName, + Optional benefitPlanType, + Optional employeeContribution, + Optional companyContribution, + Optional startDate, + Optional endDate, + Optional remoteWasDeleted, + Optional employerBenefit, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.employee = employee; + this.providerName = providerName; + this.benefitPlanType = benefitPlanType; + this.employeeContribution = employeeContribution; + this.companyContribution = companyContribution; + this.startDate = startDate; + this.endDate = endDate; + this.remoteWasDeleted = remoteWasDeleted; + this.employerBenefit = employerBenefit; + 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 on the plan. + */ + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + /** + * @return The name of the benefit provider. + */ + @JsonProperty("provider_name") + public Optional getProviderName() { + return providerName; + } + + /** + * @return The type of benefit plan + */ + @JsonProperty("benefit_plan_type") + public Optional getBenefitPlanType() { + return benefitPlanType; + } + + /** + * @return The employee's contribution. + */ + @JsonProperty("employee_contribution") + public Optional getEmployeeContribution() { + return employeeContribution; + } + + /** + * @return The company's contribution. + */ + @JsonProperty("company_contribution") + public Optional getCompanyContribution() { + return companyContribution; + } + + /** + * @return The day and time the benefit started. + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return The day and time the benefit ended. + */ + @JsonProperty("end_date") + public Optional getEndDate() { + return endDate; + } + + /** + * @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 The employer benefit plan the employee is enrolled in. + */ + @JsonProperty("employer_benefit") + public Optional getEmployerBenefit() { + return employerBenefit; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Benefit && equalTo((Benefit) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Benefit other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && employee.equals(other.employee) + && providerName.equals(other.providerName) + && benefitPlanType.equals(other.benefitPlanType) + && employeeContribution.equals(other.employeeContribution) + && companyContribution.equals(other.companyContribution) + && startDate.equals(other.startDate) + && endDate.equals(other.endDate) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && employerBenefit.equals(other.employerBenefit) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.employee, + this.providerName, + this.benefitPlanType, + this.employeeContribution, + this.companyContribution, + this.startDate, + this.endDate, + this.remoteWasDeleted, + this.employerBenefit, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 employee = Optional.empty(); + + private Optional providerName = Optional.empty(); + + private Optional benefitPlanType = Optional.empty(); + + private Optional employeeContribution = Optional.empty(); + + private Optional companyContribution = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional endDate = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional employerBenefit = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Benefit other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + employee(other.getEmployee()); + providerName(other.getProviderName()); + benefitPlanType(other.getBenefitPlanType()); + employeeContribution(other.getEmployeeContribution()); + companyContribution(other.getCompanyContribution()); + startDate(other.getStartDate()); + endDate(other.getEndDate()); + remoteWasDeleted(other.getRemoteWasDeleted()); + employerBenefit(other.getEmployerBenefit()); + 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", nulls = Nulls.SKIP) + public Builder employee(Optional employee) { + this.employee = employee; + return this; + } + + public Builder employee(BenefitEmployee employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "provider_name", nulls = Nulls.SKIP) + public Builder providerName(Optional providerName) { + this.providerName = providerName; + return this; + } + + public Builder providerName(String providerName) { + this.providerName = Optional.ofNullable(providerName); + return this; + } + + @JsonSetter(value = "benefit_plan_type", nulls = Nulls.SKIP) + public Builder benefitPlanType(Optional benefitPlanType) { + this.benefitPlanType = benefitPlanType; + return this; + } + + public Builder benefitPlanType(String benefitPlanType) { + this.benefitPlanType = Optional.ofNullable(benefitPlanType); + return this; + } + + @JsonSetter(value = "employee_contribution", nulls = Nulls.SKIP) + public Builder employeeContribution(Optional employeeContribution) { + this.employeeContribution = employeeContribution; + return this; + } + + public Builder employeeContribution(Double employeeContribution) { + this.employeeContribution = Optional.ofNullable(employeeContribution); + return this; + } + + @JsonSetter(value = "company_contribution", nulls = Nulls.SKIP) + public Builder companyContribution(Optional companyContribution) { + this.companyContribution = companyContribution; + return this; + } + + public Builder companyContribution(Double companyContribution) { + this.companyContribution = Optional.ofNullable(companyContribution); + 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 = "end_date", nulls = Nulls.SKIP) + public Builder endDate(Optional endDate) { + this.endDate = endDate; + return this; + } + + public Builder endDate(OffsetDateTime endDate) { + this.endDate = Optional.ofNullable(endDate); + 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 = "employer_benefit", nulls = Nulls.SKIP) + public Builder employerBenefit(Optional employerBenefit) { + this.employerBenefit = employerBenefit; + return this; + } + + public Builder employerBenefit(String employerBenefit) { + this.employerBenefit = Optional.ofNullable(employerBenefit); + 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 Benefit build() { + return new Benefit( + id, + remoteId, + createdAt, + modifiedAt, + employee, + providerName, + benefitPlanType, + employeeContribution, + companyContribution, + startDate, + endDate, + remoteWasDeleted, + employerBenefit, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/BenefitEmployee.java b/src/main/java/com/merge/legacy/api/resources/hris/types/BenefitEmployee.java new file mode 100644 index 000000000..e4e975ccd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/BenefitEmployee.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = BenefitEmployee.Deserializer.class) +public final class BenefitEmployee { + private final Object value; + + private final int type; + + private BenefitEmployee(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((Employee) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BenefitEmployee && equalTo((BenefitEmployee) other); + } + + private boolean equalTo(BenefitEmployee other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static BenefitEmployee of(String value) { + return new BenefitEmployee(value, 0); + } + + public static BenefitEmployee of(Employee value) { + return new BenefitEmployee(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employee value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(BenefitEmployee.class); + } + + @Override + public BenefitEmployee 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, Employee.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/BenefitPlanTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/BenefitPlanTypeEnum.java new file mode 100644 index 000000000..83329bc12 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/BenefitPlanTypeEnum.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum BenefitPlanTypeEnum { + MEDICAL("MEDICAL"), + + HEALTH_SAVINGS("HEALTH_SAVINGS"), + + INSURANCE("INSURANCE"), + + RETIREMENT("RETIREMENT"), + + OTHER("OTHER"); + + private final String value; + + BenefitPlanTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/CategoriesEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/CategoriesEnum.java new file mode 100644 index 000000000..25988ad2d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/CategoriesEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/CategoryEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/CategoryEnum.java new file mode 100644 index 000000000..55e389412 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/CategoryEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/CommonModelScopeApi.java b/src/main/java/com/merge/legacy/api/resources/hris/types/CommonModelScopeApi.java new file mode 100644 index 000000000..8570e8765 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/CommonModelScopeApi.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @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/legacy/api/resources/hris/types/CommonModelScopesBodyRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/types/CommonModelScopesBodyRequest.java new file mode 100644 index 000000000..784a84acd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/CommonModelScopesBodyRequest.java @@ -0,0 +1,175 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.modelId, this.enabledActions, this.disabledFields); + } + + @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() {} + + @Override + public Builder from(CommonModelScopesBodyRequest other) { + modelId(other.getModelId()); + enabledActions(other.getEnabledActions()); + disabledFields(other.getDisabledFields()); + return this; + } + + @Override + @JsonSetter("model_id") + public _FinalStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @Override + public _FinalStage addAllDisabledFields(List disabledFields) { + this.disabledFields.addAll(disabledFields); + return this; + } + + @Override + public _FinalStage addDisabledFields(String disabledFields) { + this.disabledFields.add(disabledFields); + return this; + } + + @Override + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public _FinalStage disabledFields(List disabledFields) { + this.disabledFields.clear(); + this.disabledFields.addAll(disabledFields); + return this; + } + + @Override + public _FinalStage addAllEnabledActions(List enabledActions) { + this.enabledActions.addAll(enabledActions); + return this; + } + + @Override + public _FinalStage addEnabledActions(EnabledActionsEnum enabledActions) { + this.enabledActions.add(enabledActions); + return this; + } + + @Override + @JsonSetter(value = "enabled_actions", nulls = Nulls.SKIP) + public _FinalStage enabledActions(List enabledActions) { + this.enabledActions.clear(); + this.enabledActions.addAll(enabledActions); + return this; + } + + @Override + public CommonModelScopesBodyRequest build() { + return new CommonModelScopesBodyRequest(modelId, enabledActions, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/Company.java b/src/main/java/com/merge/legacy/api/resources/hris/types/Company.java new file mode 100644 index 000000000..c9ac18081 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/Company.java @@ -0,0 +1,348 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Company.Builder.class) +public final class Company { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional legalName; + + private final Optional displayName; + + private final Optional>> eins; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Company( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional legalName, + Optional displayName, + Optional>> eins, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.legalName = legalName; + this.displayName = displayName; + this.eins = eins; + 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 company's legal name. + */ + @JsonProperty("legal_name") + public Optional getLegalName() { + return legalName; + } + + /** + * @return The company's display name. + */ + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + /** + * @return The company's Employer Identification Numbers. + */ + @JsonProperty("eins") + public Optional>> getEins() { + return eins; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Company && equalTo((Company) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Company other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && legalName.equals(other.legalName) + && displayName.equals(other.displayName) + && eins.equals(other.eins) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.legalName, + this.displayName, + this.eins, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 legalName = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional>> eins = 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(Company other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + legalName(other.getLegalName()); + displayName(other.getDisplayName()); + eins(other.getEins()); + 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 = "legal_name", nulls = Nulls.SKIP) + public Builder legalName(Optional legalName) { + this.legalName = legalName; + return this; + } + + public Builder legalName(String legalName) { + this.legalName = Optional.ofNullable(legalName); + 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 = "eins", nulls = Nulls.SKIP) + public Builder eins(Optional>> eins) { + this.eins = eins; + return this; + } + + public Builder eins(List> eins) { + this.eins = Optional.ofNullable(eins); + 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 Company build() { + return new Company( + id, + remoteId, + createdAt, + modifiedAt, + legalName, + displayName, + eins, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/CountryEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/CountryEnum.java new file mode 100644 index 000000000..eac5ac768 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/CountryEnum.java @@ -0,0 +1,518 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/DataPassthroughRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/types/DataPassthroughRequest.java new file mode 100644 index 000000000..e63762058 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/DataPassthroughRequest.java @@ -0,0 +1,361 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.baseUrlOverride, + this.data, + this.multipartFormData, + this.headers, + this.requestFormat, + this.normalizeResponse); + } + + @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() {} + + @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; + } + + @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. + */ + @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. + */ + @Override + public _FinalStage normalizeResponse(Boolean normalizeResponse) { + this.normalizeResponse = Optional.ofNullable(normalizeResponse); + return this; + } + + @Override + @JsonSetter(value = "normalize_response", nulls = Nulls.SKIP) + public _FinalStage normalizeResponse(Optional normalizeResponse) { + this.normalizeResponse = normalizeResponse; + return this; + } + + @Override + public _FinalStage requestFormat(RequestFormatEnum requestFormat) { + this.requestFormat = Optional.ofNullable(requestFormat); + return this; + } + + @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. + */ + @Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @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. + */ + @Override + public _FinalStage multipartFormData(List multipartFormData) { + this.multipartFormData = Optional.ofNullable(multipartFormData); + return this; + } + + @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. + */ + @Override + public _FinalStage data(String data) { + this.data = Optional.ofNullable(data); + return this; + } + + @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. + */ + @Override + public _FinalStage baseUrlOverride(String baseUrlOverride) { + this.baseUrlOverride = Optional.ofNullable(baseUrlOverride); + return this; + } + + @Override + @JsonSetter(value = "base_url_override", nulls = Nulls.SKIP) + public _FinalStage baseUrlOverride(Optional baseUrlOverride) { + this.baseUrlOverride = baseUrlOverride; + return this; + } + + @Override + public DataPassthroughRequest build() { + return new DataPassthroughRequest( + method, + path, + baseUrlOverride, + data, + multipartFormData, + headers, + requestFormat, + normalizeResponse, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/DebugModeLog.java b/src/main/java/com/merge/legacy/api/resources/hris/types/DebugModeLog.java new file mode 100644 index 000000000..c372ae9e9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/DebugModeLog.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.logId, this.dashboardView, this.logSummary); + } + + @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() {} + + @Override + public Builder from(DebugModeLog other) { + logId(other.getLogId()); + dashboardView(other.getDashboardView()); + logSummary(other.getLogSummary()); + return this; + } + + @Override + @JsonSetter("log_id") + public DashboardViewStage logId(@NotNull String logId) { + this.logId = logId; + return this; + } + + @Override + @JsonSetter("dashboard_view") + public LogSummaryStage dashboardView(@NotNull String dashboardView) { + this.dashboardView = dashboardView; + return this; + } + + @Override + @JsonSetter("log_summary") + public _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary) { + this.logSummary = logSummary; + return this; + } + + @Override + public DebugModeLog build() { + return new DebugModeLog(logId, dashboardView, logSummary, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/DebugModelLogSummary.java b/src/main/java/com/merge/legacy/api/resources/hris/types/DebugModelLogSummary.java new file mode 100644 index 000000000..637558935 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/DebugModelLogSummary.java @@ -0,0 +1,141 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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; + } + + @Override + public int hashCode() { + return Objects.hash(this.url, this.method, this.statusCode); + } + + @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() {} + + @Override + public Builder from(DebugModelLogSummary other) { + url(other.getUrl()); + method(other.getMethod()); + statusCode(other.getStatusCode()); + return this; + } + + @Override + @JsonSetter("url") + public MethodStage url(@NotNull String url) { + this.url = url; + return this; + } + + @Override + @JsonSetter("method") + public StatusCodeStage method(@NotNull String method) { + this.method = method; + return this; + } + + @Override + @JsonSetter("status_code") + public _FinalStage statusCode(int statusCode) { + this.statusCode = statusCode; + return this; + } + + @Override + public DebugModelLogSummary build() { + return new DebugModelLogSummary(url, method, statusCode, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/Deduction.java b/src/main/java/com/merge/legacy/api/resources/hris/types/Deduction.java new file mode 100644 index 000000000..0542c0493 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/Deduction.java @@ -0,0 +1,374 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Deduction.Builder.class) +public final class Deduction { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional employeePayrollRun; + + private final Optional name; + + private final Optional employeeDeduction; + + private final Optional companyDeduction; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Deduction( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional employeePayrollRun, + Optional name, + Optional employeeDeduction, + Optional companyDeduction, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.employeePayrollRun = employeePayrollRun; + this.name = name; + this.employeeDeduction = employeeDeduction; + this.companyDeduction = companyDeduction; + 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; + } + + @JsonProperty("employee_payroll_run") + public Optional getEmployeePayrollRun() { + return employeePayrollRun; + } + + /** + * @return The deduction's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The amount of money that is withheld from an employee's gross pay by the employee. + */ + @JsonProperty("employee_deduction") + public Optional getEmployeeDeduction() { + return employeeDeduction; + } + + /** + * @return The amount of money that is withheld on behalf of an employee by the company. + */ + @JsonProperty("company_deduction") + public Optional getCompanyDeduction() { + return companyDeduction; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Deduction && equalTo((Deduction) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Deduction other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && employeePayrollRun.equals(other.employeePayrollRun) + && name.equals(other.name) + && employeeDeduction.equals(other.employeeDeduction) + && companyDeduction.equals(other.companyDeduction) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.employeePayrollRun, + this.name, + this.employeeDeduction, + this.companyDeduction, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 employeePayrollRun = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional employeeDeduction = Optional.empty(); + + private Optional companyDeduction = 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(Deduction other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + employeePayrollRun(other.getEmployeePayrollRun()); + name(other.getName()); + employeeDeduction(other.getEmployeeDeduction()); + companyDeduction(other.getCompanyDeduction()); + 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_payroll_run", nulls = Nulls.SKIP) + public Builder employeePayrollRun(Optional employeePayrollRun) { + this.employeePayrollRun = employeePayrollRun; + return this; + } + + public Builder employeePayrollRun(String employeePayrollRun) { + this.employeePayrollRun = Optional.ofNullable(employeePayrollRun); + 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 = "employee_deduction", nulls = Nulls.SKIP) + public Builder employeeDeduction(Optional employeeDeduction) { + this.employeeDeduction = employeeDeduction; + return this; + } + + public Builder employeeDeduction(Double employeeDeduction) { + this.employeeDeduction = Optional.ofNullable(employeeDeduction); + return this; + } + + @JsonSetter(value = "company_deduction", nulls = Nulls.SKIP) + public Builder companyDeduction(Optional companyDeduction) { + this.companyDeduction = companyDeduction; + return this; + } + + public Builder companyDeduction(Double companyDeduction) { + this.companyDeduction = Optional.ofNullable(companyDeduction); + 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 Deduction build() { + return new Deduction( + id, + remoteId, + createdAt, + modifiedAt, + employeePayrollRun, + name, + employeeDeduction, + companyDeduction, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/Dependent.java b/src/main/java/com/merge/legacy/api/resources/hris/types/Dependent.java new file mode 100644 index 000000000..d4f19aef0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/Dependent.java @@ -0,0 +1,592 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Dependent.Builder.class) +public final class Dependent { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional firstName; + + private final Optional middleName; + + private final Optional lastName; + + private final Optional relationship; + + private final Optional employee; + + private final Optional dateOfBirth; + + private final Optional gender; + + private final Optional phoneNumber; + + private final Optional homeLocation; + + private final Optional isStudent; + + private final Optional ssn; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Dependent( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional firstName, + Optional middleName, + Optional lastName, + Optional relationship, + Optional employee, + Optional dateOfBirth, + Optional gender, + Optional phoneNumber, + Optional homeLocation, + Optional isStudent, + Optional ssn, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.firstName = firstName; + this.middleName = middleName; + this.lastName = lastName; + this.relationship = relationship; + this.employee = employee; + this.dateOfBirth = dateOfBirth; + this.gender = gender; + this.phoneNumber = phoneNumber; + this.homeLocation = homeLocation; + this.isStudent = isStudent; + this.ssn = ssn; + 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 dependents's first name. + */ + @JsonProperty("first_name") + public Optional getFirstName() { + return firstName; + } + + /** + * @return The dependents's middle name. + */ + @JsonProperty("middle_name") + public Optional getMiddleName() { + return middleName; + } + + /** + * @return The dependents's last name. + */ + @JsonProperty("last_name") + public Optional getLastName() { + return lastName; + } + + /** + * @return The dependent's relationship to the employee. + *
    + *
  • CHILD - CHILD
  • + *
  • SPOUSE - SPOUSE
  • + *
  • DOMESTIC_PARTNER - DOMESTIC_PARTNER
  • + *
+ */ + @JsonProperty("relationship") + public Optional getRelationship() { + return relationship; + } + + /** + * @return The employee this person is a dependent of. + */ + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + /** + * @return The dependent's date of birth. + */ + @JsonProperty("date_of_birth") + public Optional getDateOfBirth() { + return dateOfBirth; + } + + /** + * @return The dependent'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 dependent's phone number. + */ + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + /** + * @return The dependents's home address. + */ + @JsonProperty("home_location") + public Optional getHomeLocation() { + return homeLocation; + } + + /** + * @return Whether or not the dependent is a student + */ + @JsonProperty("is_student") + public Optional getIsStudent() { + return isStudent; + } + + /** + * @return The dependents's social security number. + */ + @JsonProperty("ssn") + public Optional getSsn() { + return ssn; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Dependent && equalTo((Dependent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Dependent other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && firstName.equals(other.firstName) + && middleName.equals(other.middleName) + && lastName.equals(other.lastName) + && relationship.equals(other.relationship) + && employee.equals(other.employee) + && dateOfBirth.equals(other.dateOfBirth) + && gender.equals(other.gender) + && phoneNumber.equals(other.phoneNumber) + && homeLocation.equals(other.homeLocation) + && isStudent.equals(other.isStudent) + && ssn.equals(other.ssn) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.firstName, + this.middleName, + this.lastName, + this.relationship, + this.employee, + this.dateOfBirth, + this.gender, + this.phoneNumber, + this.homeLocation, + this.isStudent, + this.ssn, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 middleName = Optional.empty(); + + private Optional lastName = Optional.empty(); + + private Optional relationship = Optional.empty(); + + private Optional employee = Optional.empty(); + + private Optional dateOfBirth = Optional.empty(); + + private Optional gender = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional homeLocation = Optional.empty(); + + private Optional isStudent = Optional.empty(); + + private Optional ssn = 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(Dependent other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + firstName(other.getFirstName()); + middleName(other.getMiddleName()); + lastName(other.getLastName()); + relationship(other.getRelationship()); + employee(other.getEmployee()); + dateOfBirth(other.getDateOfBirth()); + gender(other.getGender()); + phoneNumber(other.getPhoneNumber()); + homeLocation(other.getHomeLocation()); + isStudent(other.getIsStudent()); + ssn(other.getSsn()); + 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 = "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 = "middle_name", nulls = Nulls.SKIP) + public Builder middleName(Optional middleName) { + this.middleName = middleName; + return this; + } + + public Builder middleName(String middleName) { + this.middleName = Optional.ofNullable(middleName); + 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 = "relationship", nulls = Nulls.SKIP) + public Builder relationship(Optional relationship) { + this.relationship = relationship; + return this; + } + + public Builder relationship(DependentRelationship relationship) { + this.relationship = Optional.ofNullable(relationship); + return this; + } + + @JsonSetter(value = "employee", nulls = Nulls.SKIP) + public Builder employee(Optional employee) { + this.employee = employee; + return this; + } + + public Builder employee(String employee) { + this.employee = Optional.ofNullable(employee); + 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 = "gender", nulls = Nulls.SKIP) + public Builder gender(Optional gender) { + this.gender = gender; + return this; + } + + public Builder gender(DependentGender gender) { + this.gender = Optional.ofNullable(gender); + 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 = "home_location", nulls = Nulls.SKIP) + public Builder homeLocation(Optional homeLocation) { + this.homeLocation = homeLocation; + return this; + } + + public Builder homeLocation(String homeLocation) { + this.homeLocation = Optional.ofNullable(homeLocation); + return this; + } + + @JsonSetter(value = "is_student", nulls = Nulls.SKIP) + public Builder isStudent(Optional isStudent) { + this.isStudent = isStudent; + return this; + } + + public Builder isStudent(Boolean isStudent) { + this.isStudent = Optional.ofNullable(isStudent); + 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 = "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 Dependent build() { + return new Dependent( + id, + remoteId, + createdAt, + modifiedAt, + firstName, + middleName, + lastName, + relationship, + employee, + dateOfBirth, + gender, + phoneNumber, + homeLocation, + isStudent, + ssn, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/DependentGender.java b/src/main/java/com/merge/legacy/api/resources/hris/types/DependentGender.java new file mode 100644 index 000000000..ae32b315e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/DependentGender.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/DependentRelationship.java b/src/main/java/com/merge/legacy/api/resources/hris/types/DependentRelationship.java new file mode 100644 index 000000000..d08a668d6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/DependentRelationship.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/Earning.java b/src/main/java/com/merge/legacy/api/resources/hris/types/Earning.java new file mode 100644 index 000000000..69ece9fa2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/Earning.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Earning.Builder.class) +public final class Earning { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional employeePayrollRun; + + private final Optional amount; + + private final Optional type; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Earning( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional employeePayrollRun, + Optional amount, + Optional type, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.employeePayrollRun = employeePayrollRun; + this.amount = amount; + this.type = type; + 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; + } + + @JsonProperty("employee_payroll_run") + public Optional getEmployeePayrollRun() { + return employeePayrollRun; + } + + /** + * @return The amount earned. + */ + @JsonProperty("amount") + public Optional getAmount() { + return amount; + } + + /** + * @return The type of earning. + *
    + *
  • SALARY - SALARY
  • + *
  • REIMBURSEMENT - REIMBURSEMENT
  • + *
  • OVERTIME - OVERTIME
  • + *
  • BONUS - BONUS
  • + *
+ */ + @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; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Earning && equalTo((Earning) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Earning other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && employeePayrollRun.equals(other.employeePayrollRun) + && amount.equals(other.amount) + && type.equals(other.type) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.employeePayrollRun, + this.amount, + this.type, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 employeePayrollRun = Optional.empty(); + + private Optional amount = Optional.empty(); + + private Optional type = 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(Earning other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + employeePayrollRun(other.getEmployeePayrollRun()); + amount(other.getAmount()); + type(other.getType()); + 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_payroll_run", nulls = Nulls.SKIP) + public Builder employeePayrollRun(Optional employeePayrollRun) { + this.employeePayrollRun = employeePayrollRun; + return this; + } + + public Builder employeePayrollRun(String employeePayrollRun) { + this.employeePayrollRun = Optional.ofNullable(employeePayrollRun); + return this; + } + + @JsonSetter(value = "amount", nulls = Nulls.SKIP) + public Builder amount(Optional amount) { + this.amount = amount; + return this; + } + + public Builder amount(Double amount) { + this.amount = Optional.ofNullable(amount); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(EarningType 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 = "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 Earning build() { + return new Earning( + id, + remoteId, + createdAt, + modifiedAt, + employeePayrollRun, + amount, + type, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EarningType.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EarningType.java new file mode 100644 index 000000000..35f32d883 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EarningType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/EarningTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EarningTypeEnum.java new file mode 100644 index 000000000..603f28e91 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EarningTypeEnum.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EarningTypeEnum { + SALARY("SALARY"), + + REIMBURSEMENT("REIMBURSEMENT"), + + OVERTIME("OVERTIME"), + + BONUS("BONUS"); + + private final String value; + + EarningTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/Employee.java b/src/main/java/com/merge/legacy/api/resources/hris/types/Employee.java new file mode 100644 index 000000000..3c33dea0c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/Employee.java @@ -0,0 +1,1128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/hris/types/EmployeeCompany.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeCompany.java new file mode 100644 index 000000000..457560d5e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeCompany.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/EmployeeEmploymentStatus.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeEmploymentStatus.java new file mode 100644 index 000000000..6e8d36864 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeEmploymentStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/EmployeeEmploymentsItem.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeEmploymentsItem.java new file mode 100644 index 000000000..dfc9f7692 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeEmploymentsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EmployeeEmploymentsItem.Deserializer.class) +public final class EmployeeEmploymentsItem { + private final Object value; + + private final int type; + + private EmployeeEmploymentsItem(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((Employment) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeeEmploymentsItem && equalTo((EmployeeEmploymentsItem) other); + } + + private boolean equalTo(EmployeeEmploymentsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EmployeeEmploymentsItem of(String value) { + return new EmployeeEmploymentsItem(value, 0); + } + + public static EmployeeEmploymentsItem of(Employment value) { + return new EmployeeEmploymentsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employment value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EmployeeEmploymentsItem.class); + } + + @Override + public EmployeeEmploymentsItem 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, Employment.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeEthnicity.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeEthnicity.java new file mode 100644 index 000000000..2b64b87b1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeEthnicity.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/EmployeeGender.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeGender.java new file mode 100644 index 000000000..cfff972a6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeGender.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/EmployeeGroupsItem.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeGroupsItem.java new file mode 100644 index 000000000..fa1421641 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeGroupsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EmployeeGroupsItem.Deserializer.class) +public final class EmployeeGroupsItem { + private final Object value; + + private final int type; + + private EmployeeGroupsItem(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((Group) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeeGroupsItem && equalTo((EmployeeGroupsItem) other); + } + + private boolean equalTo(EmployeeGroupsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EmployeeGroupsItem of(String value) { + return new EmployeeGroupsItem(value, 0); + } + + public static EmployeeGroupsItem of(Group value) { + return new EmployeeGroupsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Group value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EmployeeGroupsItem.class); + } + + @Override + public EmployeeGroupsItem 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, Group.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeHomeLocation.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeHomeLocation.java new file mode 100644 index 000000000..6a36eb832 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeHomeLocation.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EmployeeHomeLocation.Deserializer.class) +public final class EmployeeHomeLocation { + private final Object value; + + private final int type; + + private EmployeeHomeLocation(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((Location) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeeHomeLocation && equalTo((EmployeeHomeLocation) other); + } + + private boolean equalTo(EmployeeHomeLocation other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EmployeeHomeLocation of(String value) { + return new EmployeeHomeLocation(value, 0); + } + + public static EmployeeHomeLocation of(Location value) { + return new EmployeeHomeLocation(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Location value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EmployeeHomeLocation.class); + } + + @Override + public EmployeeHomeLocation 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, Location.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeManager.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeManager.java new file mode 100644 index 000000000..0a10c6367 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeManager.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EmployeeManager.Deserializer.class) +public final class EmployeeManager { + private final Object value; + + private final int type; + + private EmployeeManager(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((Employee) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeeManager && equalTo((EmployeeManager) other); + } + + private boolean equalTo(EmployeeManager other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EmployeeManager of(String value) { + return new EmployeeManager(value, 0); + } + + public static EmployeeManager of(Employee value) { + return new EmployeeManager(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employee value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EmployeeManager.class); + } + + @Override + public EmployeeManager 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, Employee.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeMaritalStatus.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeMaritalStatus.java new file mode 100644 index 000000000..e8a7815bb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeMaritalStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/EmployeePayGroup.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeePayGroup.java new file mode 100644 index 000000000..7ef53f75f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeePayGroup.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EmployeePayGroup.Deserializer.class) +public final class EmployeePayGroup { + private final Object value; + + private final int type; + + private EmployeePayGroup(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((PayGroup) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeePayGroup && equalTo((EmployeePayGroup) other); + } + + private boolean equalTo(EmployeePayGroup other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EmployeePayGroup of(String value) { + return new EmployeePayGroup(value, 0); + } + + public static EmployeePayGroup of(PayGroup value) { + return new EmployeePayGroup(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PayGroup value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EmployeePayGroup.class); + } + + @Override + public EmployeePayGroup 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, PayGroup.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeePayrollRun.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeePayrollRun.java new file mode 100644 index 000000000..81fcdc9a2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeePayrollRun.java @@ -0,0 +1,542 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EmployeePayrollRun.Builder.class) +public final class EmployeePayrollRun { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional employee; + + private final Optional payrollRun; + + private final Optional grossPay; + + private final Optional netPay; + + private final Optional startDate; + + private final Optional endDate; + + private final Optional checkDate; + + private final Optional> earnings; + + private final Optional> deductions; + + private final Optional> taxes; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private EmployeePayrollRun( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional employee, + Optional payrollRun, + Optional grossPay, + Optional netPay, + Optional startDate, + Optional endDate, + Optional checkDate, + Optional> earnings, + Optional> deductions, + Optional> taxes, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.employee = employee; + this.payrollRun = payrollRun; + this.grossPay = grossPay; + this.netPay = netPay; + this.startDate = startDate; + this.endDate = endDate; + this.checkDate = checkDate; + this.earnings = earnings; + this.deductions = deductions; + this.taxes = taxes; + 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 whose payroll is being run. + */ + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + /** + * @return The payroll being run. + */ + @JsonProperty("payroll_run") + public Optional getPayrollRun() { + return payrollRun; + } + + /** + * @return The total earnings throughout a given period for an employee before any deductions are made. + */ + @JsonProperty("gross_pay") + public Optional getGrossPay() { + return grossPay; + } + + /** + * @return The take-home pay throughout a given period for an employee after deductions are made. + */ + @JsonProperty("net_pay") + public Optional getNetPay() { + return netPay; + } + + /** + * @return The day and time the payroll run started. + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return The day and time the payroll run ended. + */ + @JsonProperty("end_date") + public Optional getEndDate() { + return endDate; + } + + /** + * @return The day and time the payroll run was checked. + */ + @JsonProperty("check_date") + public Optional getCheckDate() { + return checkDate; + } + + @JsonProperty("earnings") + public Optional> getEarnings() { + return earnings; + } + + @JsonProperty("deductions") + public Optional> getDeductions() { + return deductions; + } + + @JsonProperty("taxes") + public Optional> getTaxes() { + return taxes; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeePayrollRun && equalTo((EmployeePayrollRun) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmployeePayrollRun other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && employee.equals(other.employee) + && payrollRun.equals(other.payrollRun) + && grossPay.equals(other.grossPay) + && netPay.equals(other.netPay) + && startDate.equals(other.startDate) + && endDate.equals(other.endDate) + && checkDate.equals(other.checkDate) + && earnings.equals(other.earnings) + && deductions.equals(other.deductions) + && taxes.equals(other.taxes) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.employee, + this.payrollRun, + this.grossPay, + this.netPay, + this.startDate, + this.endDate, + this.checkDate, + this.earnings, + this.deductions, + this.taxes, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 employee = Optional.empty(); + + private Optional payrollRun = Optional.empty(); + + private Optional grossPay = Optional.empty(); + + private Optional netPay = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional endDate = Optional.empty(); + + private Optional checkDate = Optional.empty(); + + private Optional> earnings = Optional.empty(); + + private Optional> deductions = Optional.empty(); + + private Optional> taxes = 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(EmployeePayrollRun other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + employee(other.getEmployee()); + payrollRun(other.getPayrollRun()); + grossPay(other.getGrossPay()); + netPay(other.getNetPay()); + startDate(other.getStartDate()); + endDate(other.getEndDate()); + checkDate(other.getCheckDate()); + earnings(other.getEarnings()); + deductions(other.getDeductions()); + taxes(other.getTaxes()); + 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", nulls = Nulls.SKIP) + public Builder employee(Optional employee) { + this.employee = employee; + return this; + } + + public Builder employee(EmployeePayrollRunEmployee employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "payroll_run", nulls = Nulls.SKIP) + public Builder payrollRun(Optional payrollRun) { + this.payrollRun = payrollRun; + return this; + } + + public Builder payrollRun(EmployeePayrollRunPayrollRun payrollRun) { + this.payrollRun = Optional.ofNullable(payrollRun); + return this; + } + + @JsonSetter(value = "gross_pay", nulls = Nulls.SKIP) + public Builder grossPay(Optional grossPay) { + this.grossPay = grossPay; + return this; + } + + public Builder grossPay(Double grossPay) { + this.grossPay = Optional.ofNullable(grossPay); + return this; + } + + @JsonSetter(value = "net_pay", nulls = Nulls.SKIP) + public Builder netPay(Optional netPay) { + this.netPay = netPay; + return this; + } + + public Builder netPay(Double netPay) { + this.netPay = Optional.ofNullable(netPay); + 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 = "end_date", nulls = Nulls.SKIP) + public Builder endDate(Optional endDate) { + this.endDate = endDate; + return this; + } + + public Builder endDate(OffsetDateTime endDate) { + this.endDate = Optional.ofNullable(endDate); + return this; + } + + @JsonSetter(value = "check_date", nulls = Nulls.SKIP) + public Builder checkDate(Optional checkDate) { + this.checkDate = checkDate; + return this; + } + + public Builder checkDate(OffsetDateTime checkDate) { + this.checkDate = Optional.ofNullable(checkDate); + return this; + } + + @JsonSetter(value = "earnings", nulls = Nulls.SKIP) + public Builder earnings(Optional> earnings) { + this.earnings = earnings; + return this; + } + + public Builder earnings(List earnings) { + this.earnings = Optional.ofNullable(earnings); + return this; + } + + @JsonSetter(value = "deductions", nulls = Nulls.SKIP) + public Builder deductions(Optional> deductions) { + this.deductions = deductions; + return this; + } + + public Builder deductions(List deductions) { + this.deductions = Optional.ofNullable(deductions); + return this; + } + + @JsonSetter(value = "taxes", nulls = Nulls.SKIP) + public Builder taxes(Optional> taxes) { + this.taxes = taxes; + return this; + } + + public Builder taxes(List taxes) { + this.taxes = Optional.ofNullable(taxes); + 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 EmployeePayrollRun build() { + return new EmployeePayrollRun( + id, + remoteId, + createdAt, + modifiedAt, + employee, + payrollRun, + grossPay, + netPay, + startDate, + endDate, + checkDate, + earnings, + deductions, + taxes, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeePayrollRunEmployee.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeePayrollRunEmployee.java new file mode 100644 index 000000000..8fa6c4fec --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeePayrollRunEmployee.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EmployeePayrollRunEmployee.Deserializer.class) +public final class EmployeePayrollRunEmployee { + private final Object value; + + private final int type; + + private EmployeePayrollRunEmployee(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((Employee) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeePayrollRunEmployee && equalTo((EmployeePayrollRunEmployee) other); + } + + private boolean equalTo(EmployeePayrollRunEmployee other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EmployeePayrollRunEmployee of(String value) { + return new EmployeePayrollRunEmployee(value, 0); + } + + public static EmployeePayrollRunEmployee of(Employee value) { + return new EmployeePayrollRunEmployee(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employee value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EmployeePayrollRunEmployee.class); + } + + @Override + public EmployeePayrollRunEmployee 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, Employee.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeePayrollRunPayrollRun.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeePayrollRunPayrollRun.java new file mode 100644 index 000000000..0b56fc0b6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeePayrollRunPayrollRun.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EmployeePayrollRunPayrollRun.Deserializer.class) +public final class EmployeePayrollRunPayrollRun { + private final Object value; + + private final int type; + + private EmployeePayrollRunPayrollRun(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((PayrollRun) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeePayrollRunPayrollRun && equalTo((EmployeePayrollRunPayrollRun) other); + } + + private boolean equalTo(EmployeePayrollRunPayrollRun other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EmployeePayrollRunPayrollRun of(String value) { + return new EmployeePayrollRunPayrollRun(value, 0); + } + + public static EmployeePayrollRunPayrollRun of(PayrollRun value) { + return new EmployeePayrollRunPayrollRun(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PayrollRun value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EmployeePayrollRunPayrollRun.class); + } + + @Override + public EmployeePayrollRunPayrollRun 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, PayrollRun.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequest.java new file mode 100644 index 000000000..a4dc6dc29 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequest.java @@ -0,0 +1,928 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EmployeeRequest.Builder.class) +public final class EmployeeRequest { + 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 employmentStatus; + + private final Optional terminationDate; + + private final Optional avatar; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private EmployeeRequest( + 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 employmentStatus, + Optional terminationDate, + Optional avatar, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + 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.employmentStatus = employmentStatus; + this.terminationDate = terminationDate; + this.avatar = avatar; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @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 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; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeeRequest && equalTo((EmployeeRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmployeeRequest other) { + return 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) + && employmentStatus.equals(other.employmentStatus) + && terminationDate.equals(other.terminationDate) + && avatar.equals(other.avatar) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @Override + public int hashCode() { + return Objects.hash( + 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.employmentStatus, + this.terminationDate, + this.avatar, + this.integrationParams, + this.linkedAccountParams); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + 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 employmentStatus = Optional.empty(); + + private Optional terminationDate = Optional.empty(); + + private Optional avatar = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EmployeeRequest other) { + 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()); + employmentStatus(other.getEmploymentStatus()); + terminationDate(other.getTerminationDate()); + avatar(other.getAvatar()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + 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(EmployeeRequestCompany 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(EmployeeRequestHomeLocation 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(EmployeeRequestWorkLocation 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(EmployeeRequestManager 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(EmployeeRequestTeam 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(EmployeeRequestPayGroup 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(EmployeeRequestGender 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(EmployeeRequestEthnicity 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(EmployeeRequestMaritalStatus 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 = "employment_status", nulls = Nulls.SKIP) + public Builder employmentStatus(Optional employmentStatus) { + this.employmentStatus = employmentStatus; + return this; + } + + public Builder employmentStatus(EmployeeRequestEmploymentStatus 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 = "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 EmployeeRequest build() { + return new EmployeeRequest( + employeeNumber, + company, + firstName, + lastName, + preferredName, + displayFullName, + username, + groups, + workEmail, + personalEmail, + mobilePhoneNumber, + employments, + homeLocation, + workLocation, + manager, + team, + payGroup, + ssn, + gender, + ethnicity, + maritalStatus, + dateOfBirth, + hireDate, + startDate, + employmentStatus, + terminationDate, + avatar, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestCompany.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestCompany.java new file mode 100644 index 000000000..47cd05e34 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestCompany.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EmployeeRequestCompany.Deserializer.class) +public final class EmployeeRequestCompany { + private final Object value; + + private final int type; + + private EmployeeRequestCompany(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeeRequestCompany && equalTo((EmployeeRequestCompany) other); + } + + private boolean equalTo(EmployeeRequestCompany other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EmployeeRequestCompany of(String value) { + return new EmployeeRequestCompany(value, 0); + } + + public static EmployeeRequestCompany of(Company value) { + return new EmployeeRequestCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Company value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EmployeeRequestCompany.class); + } + + @Override + public EmployeeRequestCompany 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/legacy/api/resources/hris/types/EmployeeRequestEmploymentStatus.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestEmploymentStatus.java new file mode 100644 index 000000000..ff2cb5a64 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestEmploymentStatus.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/EmployeeRequestEmploymentsItem.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestEmploymentsItem.java new file mode 100644 index 000000000..4efcdaf3d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestEmploymentsItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EmployeeRequestEmploymentsItem.Deserializer.class) +public final class EmployeeRequestEmploymentsItem { + private final Object value; + + private final int type; + + private EmployeeRequestEmploymentsItem(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((Employment) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeeRequestEmploymentsItem && equalTo((EmployeeRequestEmploymentsItem) other); + } + + private boolean equalTo(EmployeeRequestEmploymentsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EmployeeRequestEmploymentsItem of(String value) { + return new EmployeeRequestEmploymentsItem(value, 0); + } + + public static EmployeeRequestEmploymentsItem of(Employment value) { + return new EmployeeRequestEmploymentsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employment value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EmployeeRequestEmploymentsItem.class); + } + + @Override + public EmployeeRequestEmploymentsItem 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, Employment.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestEthnicity.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestEthnicity.java new file mode 100644 index 000000000..c43fdc024 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestEthnicity.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/EmployeeRequestGender.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestGender.java new file mode 100644 index 000000000..799ce94ce --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestGender.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/EmployeeRequestGroupsItem.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestGroupsItem.java new file mode 100644 index 000000000..0cca122a0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestGroupsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EmployeeRequestGroupsItem.Deserializer.class) +public final class EmployeeRequestGroupsItem { + private final Object value; + + private final int type; + + private EmployeeRequestGroupsItem(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((Group) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeeRequestGroupsItem && equalTo((EmployeeRequestGroupsItem) other); + } + + private boolean equalTo(EmployeeRequestGroupsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EmployeeRequestGroupsItem of(String value) { + return new EmployeeRequestGroupsItem(value, 0); + } + + public static EmployeeRequestGroupsItem of(Group value) { + return new EmployeeRequestGroupsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Group value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EmployeeRequestGroupsItem.class); + } + + @Override + public EmployeeRequestGroupsItem 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, Group.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestHomeLocation.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestHomeLocation.java new file mode 100644 index 000000000..c9b989840 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestHomeLocation.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EmployeeRequestHomeLocation.Deserializer.class) +public final class EmployeeRequestHomeLocation { + private final Object value; + + private final int type; + + private EmployeeRequestHomeLocation(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((Location) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeeRequestHomeLocation && equalTo((EmployeeRequestHomeLocation) other); + } + + private boolean equalTo(EmployeeRequestHomeLocation other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EmployeeRequestHomeLocation of(String value) { + return new EmployeeRequestHomeLocation(value, 0); + } + + public static EmployeeRequestHomeLocation of(Location value) { + return new EmployeeRequestHomeLocation(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Location value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EmployeeRequestHomeLocation.class); + } + + @Override + public EmployeeRequestHomeLocation 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, Location.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestManager.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestManager.java new file mode 100644 index 000000000..a81977fc1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestManager.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EmployeeRequestManager.Deserializer.class) +public final class EmployeeRequestManager { + private final Object value; + + private final int type; + + private EmployeeRequestManager(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((Employee) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeeRequestManager && equalTo((EmployeeRequestManager) other); + } + + private boolean equalTo(EmployeeRequestManager other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EmployeeRequestManager of(String value) { + return new EmployeeRequestManager(value, 0); + } + + public static EmployeeRequestManager of(Employee value) { + return new EmployeeRequestManager(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employee value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EmployeeRequestManager.class); + } + + @Override + public EmployeeRequestManager 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, Employee.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestMaritalStatus.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestMaritalStatus.java new file mode 100644 index 000000000..8be71f73f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestMaritalStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/EmployeeRequestPayGroup.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestPayGroup.java new file mode 100644 index 000000000..5a1508b9b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestPayGroup.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EmployeeRequestPayGroup.Deserializer.class) +public final class EmployeeRequestPayGroup { + private final Object value; + + private final int type; + + private EmployeeRequestPayGroup(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((PayGroup) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeeRequestPayGroup && equalTo((EmployeeRequestPayGroup) other); + } + + private boolean equalTo(EmployeeRequestPayGroup other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EmployeeRequestPayGroup of(String value) { + return new EmployeeRequestPayGroup(value, 0); + } + + public static EmployeeRequestPayGroup of(PayGroup value) { + return new EmployeeRequestPayGroup(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PayGroup value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EmployeeRequestPayGroup.class); + } + + @Override + public EmployeeRequestPayGroup 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, PayGroup.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestTeam.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestTeam.java new file mode 100644 index 000000000..34f7b0121 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestTeam.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EmployeeRequestTeam.Deserializer.class) +public final class EmployeeRequestTeam { + private final Object value; + + private final int type; + + private EmployeeRequestTeam(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeeRequestTeam && equalTo((EmployeeRequestTeam) other); + } + + private boolean equalTo(EmployeeRequestTeam other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EmployeeRequestTeam of(String value) { + return new EmployeeRequestTeam(value, 0); + } + + public static EmployeeRequestTeam of(Team value) { + return new EmployeeRequestTeam(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Team value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EmployeeRequestTeam.class); + } + + @Override + public EmployeeRequestTeam 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/legacy/api/resources/hris/types/EmployeeRequestWorkLocation.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestWorkLocation.java new file mode 100644 index 000000000..346618817 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeRequestWorkLocation.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EmployeeRequestWorkLocation.Deserializer.class) +public final class EmployeeRequestWorkLocation { + private final Object value; + + private final int type; + + private EmployeeRequestWorkLocation(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((Location) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeeRequestWorkLocation && equalTo((EmployeeRequestWorkLocation) other); + } + + private boolean equalTo(EmployeeRequestWorkLocation other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EmployeeRequestWorkLocation of(String value) { + return new EmployeeRequestWorkLocation(value, 0); + } + + public static EmployeeRequestWorkLocation of(Location value) { + return new EmployeeRequestWorkLocation(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Location value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EmployeeRequestWorkLocation.class); + } + + @Override + public EmployeeRequestWorkLocation 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, Location.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeResponse.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeResponse.java new file mode 100644 index 000000000..4e5fe637d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EmployeeResponse.Builder.class) +public final class EmployeeResponse { + private final Employee model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private EmployeeResponse( + Employee 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 Employee getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeeResponse && equalTo((EmployeeResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmployeeResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull Employee model); + + Builder from(EmployeeResponse other); + } + + public interface _FinalStage { + EmployeeResponse 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 Employee model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(EmployeeResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull Employee model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public EmployeeResponse build() { + return new EmployeeResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeTeam.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeTeam.java new file mode 100644 index 000000000..7317cbb1d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeTeam.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EmployeeTeam.Deserializer.class) +public final class EmployeeTeam { + private final Object value; + + private final int type; + + private EmployeeTeam(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeeTeam && equalTo((EmployeeTeam) other); + } + + private boolean equalTo(EmployeeTeam other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EmployeeTeam of(String value) { + return new EmployeeTeam(value, 0); + } + + public static EmployeeTeam of(Team value) { + return new EmployeeTeam(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Team value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EmployeeTeam.class); + } + + @Override + public EmployeeTeam 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/legacy/api/resources/hris/types/EmployeeWorkLocation.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeWorkLocation.java new file mode 100644 index 000000000..57d2d776b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployeeWorkLocation.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EmployeeWorkLocation.Deserializer.class) +public final class EmployeeWorkLocation { + private final Object value; + + private final int type; + + private EmployeeWorkLocation(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((Location) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeeWorkLocation && equalTo((EmployeeWorkLocation) other); + } + + private boolean equalTo(EmployeeWorkLocation other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EmployeeWorkLocation of(String value) { + return new EmployeeWorkLocation(value, 0); + } + + public static EmployeeWorkLocation of(Location value) { + return new EmployeeWorkLocation(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Location value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EmployeeWorkLocation.class); + } + + @Override + public EmployeeWorkLocation 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, Location.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EmployerBenefit.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployerBenefit.java new file mode 100644 index 000000000..907922382 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployerBenefit.java @@ -0,0 +1,384 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EmployerBenefit.Builder.class) +public final class EmployerBenefit { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional benefitPlanType; + + private final Optional name; + + private final Optional description; + + private final Optional deductionCode; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private EmployerBenefit( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional benefitPlanType, + Optional name, + Optional description, + Optional deductionCode, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.benefitPlanType = benefitPlanType; + this.name = name; + this.description = description; + this.deductionCode = deductionCode; + 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 type of benefit plan. + *
    + *
  • MEDICAL - MEDICAL
  • + *
  • HEALTH_SAVINGS - HEALTH_SAVINGS
  • + *
  • INSURANCE - INSURANCE
  • + *
  • RETIREMENT - RETIREMENT
  • + *
  • OTHER - OTHER
  • + *
+ */ + @JsonProperty("benefit_plan_type") + public Optional getBenefitPlanType() { + return benefitPlanType; + } + + /** + * @return The employer benefit's name - typically the carrier or network name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The employer benefit's description. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The employer benefit's deduction code. + */ + @JsonProperty("deduction_code") + public Optional getDeductionCode() { + return deductionCode; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployerBenefit && equalTo((EmployerBenefit) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmployerBenefit other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && benefitPlanType.equals(other.benefitPlanType) + && name.equals(other.name) + && description.equals(other.description) + && deductionCode.equals(other.deductionCode) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.benefitPlanType, + this.name, + this.description, + this.deductionCode, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 benefitPlanType = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional deductionCode = 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(EmployerBenefit other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + benefitPlanType(other.getBenefitPlanType()); + name(other.getName()); + description(other.getDescription()); + deductionCode(other.getDeductionCode()); + 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 = "benefit_plan_type", nulls = Nulls.SKIP) + public Builder benefitPlanType(Optional benefitPlanType) { + this.benefitPlanType = benefitPlanType; + return this; + } + + public Builder benefitPlanType(EmployerBenefitBenefitPlanType benefitPlanType) { + this.benefitPlanType = Optional.ofNullable(benefitPlanType); + 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 = "deduction_code", nulls = Nulls.SKIP) + public Builder deductionCode(Optional deductionCode) { + this.deductionCode = deductionCode; + return this; + } + + public Builder deductionCode(String deductionCode) { + this.deductionCode = Optional.ofNullable(deductionCode); + 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 EmployerBenefit build() { + return new EmployerBenefit( + id, + remoteId, + createdAt, + modifiedAt, + benefitPlanType, + name, + description, + deductionCode, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EmployerBenefitBenefitPlanType.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployerBenefitBenefitPlanType.java new file mode 100644 index 000000000..1a0446473 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmployerBenefitBenefitPlanType.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/Employment.java b/src/main/java/com/merge/legacy/api/resources/hris/types/Employment.java new file mode 100644 index 000000000..92464237e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/Employment.java @@ -0,0 +1,894 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Employment.Builder.class) +public final class Employment { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional employee; + + private final Optional jobTitle; + + private final Optional payRate; + + private final Optional payPeriod; + + private final Optional payFrequency; + + private final Optional payCurrency; + + private final Optional payGroup; + + private final Optional flsaStatus; + + private final Optional effectiveDate; + + private final Optional employmentType; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Employment( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional employee, + Optional jobTitle, + Optional payRate, + Optional payPeriod, + Optional payFrequency, + Optional payCurrency, + Optional payGroup, + Optional flsaStatus, + Optional effectiveDate, + Optional employmentType, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.employee = employee; + this.jobTitle = jobTitle; + this.payRate = payRate; + this.payPeriod = payPeriod; + this.payFrequency = payFrequency; + this.payCurrency = payCurrency; + this.payGroup = payGroup; + this.flsaStatus = flsaStatus; + this.effectiveDate = effectiveDate; + this.employmentType = employmentType; + 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 holding this position. + */ + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + /** + * @return The position's title. + */ + @JsonProperty("job_title") + public Optional getJobTitle() { + return jobTitle; + } + + /** + * @return The position's pay rate. + */ + @JsonProperty("pay_rate") + public Optional getPayRate() { + return payRate; + } + + /** + * @return The time period this pay rate encompasses. + *
    + *
  • HOUR - HOUR
  • + *
  • DAY - DAY
  • + *
  • WEEK - WEEK
  • + *
  • EVERY_TWO_WEEKS - EVERY_TWO_WEEKS
  • + *
  • SEMIMONTHLY - SEMIMONTHLY
  • + *
  • MONTH - MONTH
  • + *
  • QUARTER - QUARTER
  • + *
  • EVERY_SIX_MONTHS - EVERY_SIX_MONTHS
  • + *
  • YEAR - YEAR
  • + *
+ */ + @JsonProperty("pay_period") + public Optional getPayPeriod() { + return payPeriod; + } + + /** + * @return The position's pay frequency. + *
    + *
  • WEEKLY - WEEKLY
  • + *
  • BIWEEKLY - BIWEEKLY
  • + *
  • MONTHLY - MONTHLY
  • + *
  • QUARTERLY - QUARTERLY
  • + *
  • SEMIANNUALLY - SEMIANNUALLY
  • + *
  • ANNUALLY - ANNUALLY
  • + *
  • THIRTEEN-MONTHLY - THIRTEEN-MONTHLY
  • + *
  • PRO_RATA - PRO_RATA
  • + *
  • SEMIMONTHLY - SEMIMONTHLY
  • + *
+ */ + @JsonProperty("pay_frequency") + public Optional getPayFrequency() { + return payFrequency; + } + + /** + * @return The position's currency code. + *
    + *
  • 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("pay_currency") + public Optional getPayCurrency() { + return payCurrency; + } + + /** + * @return The employment's pay group + */ + @JsonProperty("pay_group") + public Optional getPayGroup() { + return payGroup; + } + + /** + * @return The position's FLSA status. + *
    + *
  • EXEMPT - EXEMPT
  • + *
  • SALARIED_NONEXEMPT - SALARIED_NONEXEMPT
  • + *
  • NONEXEMPT - NONEXEMPT
  • + *
  • OWNER - OWNER
  • + *
+ */ + @JsonProperty("flsa_status") + public Optional getFlsaStatus() { + return flsaStatus; + } + + /** + * @return The position's effective date. + */ + @JsonProperty("effective_date") + public Optional getEffectiveDate() { + return effectiveDate; + } + + /** + * @return The position's type of employment. + *
    + *
  • FULL_TIME - FULL_TIME
  • + *
  • PART_TIME - PART_TIME
  • + *
  • INTERN - INTERN
  • + *
  • CONTRACTOR - CONTRACTOR
  • + *
  • FREELANCE - FREELANCE
  • + *
+ */ + @JsonProperty("employment_type") + public Optional getEmploymentType() { + return employmentType; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Employment && equalTo((Employment) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Employment other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && employee.equals(other.employee) + && jobTitle.equals(other.jobTitle) + && payRate.equals(other.payRate) + && payPeriod.equals(other.payPeriod) + && payFrequency.equals(other.payFrequency) + && payCurrency.equals(other.payCurrency) + && payGroup.equals(other.payGroup) + && flsaStatus.equals(other.flsaStatus) + && effectiveDate.equals(other.effectiveDate) + && employmentType.equals(other.employmentType) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.employee, + this.jobTitle, + this.payRate, + this.payPeriod, + this.payFrequency, + this.payCurrency, + this.payGroup, + this.flsaStatus, + this.effectiveDate, + this.employmentType, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 employee = Optional.empty(); + + private Optional jobTitle = Optional.empty(); + + private Optional payRate = Optional.empty(); + + private Optional payPeriod = Optional.empty(); + + private Optional payFrequency = Optional.empty(); + + private Optional payCurrency = Optional.empty(); + + private Optional payGroup = Optional.empty(); + + private Optional flsaStatus = Optional.empty(); + + private Optional effectiveDate = Optional.empty(); + + private Optional employmentType = 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(Employment other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + employee(other.getEmployee()); + jobTitle(other.getJobTitle()); + payRate(other.getPayRate()); + payPeriod(other.getPayPeriod()); + payFrequency(other.getPayFrequency()); + payCurrency(other.getPayCurrency()); + payGroup(other.getPayGroup()); + flsaStatus(other.getFlsaStatus()); + effectiveDate(other.getEffectiveDate()); + employmentType(other.getEmploymentType()); + 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", nulls = Nulls.SKIP) + public Builder employee(Optional employee) { + this.employee = employee; + return this; + } + + public Builder employee(EmploymentEmployee employee) { + this.employee = Optional.ofNullable(employee); + 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 = "pay_rate", nulls = Nulls.SKIP) + public Builder payRate(Optional payRate) { + this.payRate = payRate; + return this; + } + + public Builder payRate(Double payRate) { + this.payRate = Optional.ofNullable(payRate); + return this; + } + + @JsonSetter(value = "pay_period", nulls = Nulls.SKIP) + public Builder payPeriod(Optional payPeriod) { + this.payPeriod = payPeriod; + return this; + } + + public Builder payPeriod(EmploymentPayPeriod payPeriod) { + this.payPeriod = Optional.ofNullable(payPeriod); + return this; + } + + @JsonSetter(value = "pay_frequency", nulls = Nulls.SKIP) + public Builder payFrequency(Optional payFrequency) { + this.payFrequency = payFrequency; + return this; + } + + public Builder payFrequency(EmploymentPayFrequency payFrequency) { + this.payFrequency = Optional.ofNullable(payFrequency); + return this; + } + + @JsonSetter(value = "pay_currency", nulls = Nulls.SKIP) + public Builder payCurrency(Optional payCurrency) { + this.payCurrency = payCurrency; + return this; + } + + public Builder payCurrency(EmploymentPayCurrency payCurrency) { + this.payCurrency = Optional.ofNullable(payCurrency); + return this; + } + + @JsonSetter(value = "pay_group", nulls = Nulls.SKIP) + public Builder payGroup(Optional payGroup) { + this.payGroup = payGroup; + return this; + } + + public Builder payGroup(EmploymentPayGroup payGroup) { + this.payGroup = Optional.ofNullable(payGroup); + return this; + } + + @JsonSetter(value = "flsa_status", nulls = Nulls.SKIP) + public Builder flsaStatus(Optional flsaStatus) { + this.flsaStatus = flsaStatus; + return this; + } + + public Builder flsaStatus(EmploymentFlsaStatus flsaStatus) { + this.flsaStatus = Optional.ofNullable(flsaStatus); + return this; + } + + @JsonSetter(value = "effective_date", nulls = Nulls.SKIP) + public Builder effectiveDate(Optional effectiveDate) { + this.effectiveDate = effectiveDate; + return this; + } + + public Builder effectiveDate(OffsetDateTime effectiveDate) { + this.effectiveDate = Optional.ofNullable(effectiveDate); + return this; + } + + @JsonSetter(value = "employment_type", nulls = Nulls.SKIP) + public Builder employmentType(Optional employmentType) { + this.employmentType = employmentType; + return this; + } + + public Builder employmentType(EmploymentEmploymentType employmentType) { + this.employmentType = Optional.ofNullable(employmentType); + 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 Employment build() { + return new Employment( + id, + remoteId, + createdAt, + modifiedAt, + employee, + jobTitle, + payRate, + payPeriod, + payFrequency, + payCurrency, + payGroup, + flsaStatus, + effectiveDate, + employmentType, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EmploymentEmployee.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmploymentEmployee.java new file mode 100644 index 000000000..85f4f849e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmploymentEmployee.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EmploymentEmployee.Deserializer.class) +public final class EmploymentEmployee { + private final Object value; + + private final int type; + + private EmploymentEmployee(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((Employee) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmploymentEmployee && equalTo((EmploymentEmployee) other); + } + + private boolean equalTo(EmploymentEmployee other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EmploymentEmployee of(String value) { + return new EmploymentEmployee(value, 0); + } + + public static EmploymentEmployee of(Employee value) { + return new EmploymentEmployee(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employee value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EmploymentEmployee.class); + } + + @Override + public EmploymentEmployee 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, Employee.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EmploymentEmploymentType.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmploymentEmploymentType.java new file mode 100644 index 000000000..d39044dee --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmploymentEmploymentType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/EmploymentFlsaStatus.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmploymentFlsaStatus.java new file mode 100644 index 000000000..9852c9581 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmploymentFlsaStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/EmploymentPayCurrency.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmploymentPayCurrency.java new file mode 100644 index 000000000..24a629898 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmploymentPayCurrency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/EmploymentPayFrequency.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmploymentPayFrequency.java new file mode 100644 index 000000000..30890d005 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmploymentPayFrequency.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/EmploymentPayGroup.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmploymentPayGroup.java new file mode 100644 index 000000000..a35f23461 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmploymentPayGroup.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EmploymentPayGroup.Deserializer.class) +public final class EmploymentPayGroup { + private final Object value; + + private final int type; + + private EmploymentPayGroup(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((PayGroup) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmploymentPayGroup && equalTo((EmploymentPayGroup) other); + } + + private boolean equalTo(EmploymentPayGroup other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static EmploymentPayGroup of(String value) { + return new EmploymentPayGroup(value, 0); + } + + public static EmploymentPayGroup of(PayGroup value) { + return new EmploymentPayGroup(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PayGroup value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EmploymentPayGroup.class); + } + + @Override + public EmploymentPayGroup 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, PayGroup.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EmploymentPayPeriod.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmploymentPayPeriod.java new file mode 100644 index 000000000..7d5e2b5c8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmploymentPayPeriod.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/EmploymentStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmploymentStatusEnum.java new file mode 100644 index 000000000..5cd353390 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmploymentStatusEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EmploymentStatusEnum { + ACTIVE("ACTIVE"), + + PENDING("PENDING"), + + INACTIVE("INACTIVE"); + + private final String value; + + EmploymentStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EmploymentTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EmploymentTypeEnum.java new file mode 100644 index 000000000..9f8efc36f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EmploymentTypeEnum.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EmploymentTypeEnum { + FULL_TIME("FULL_TIME"), + + PART_TIME("PART_TIME"), + + INTERN("INTERN"), + + CONTRACTOR("CONTRACTOR"), + + FREELANCE("FREELANCE"); + + private final String value; + + EmploymentTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EnabledActionsEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EnabledActionsEnum.java new file mode 100644 index 000000000..1892daa46 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EnabledActionsEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EncodingEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EncodingEnum.java new file mode 100644 index 000000000..866c68c80 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EncodingEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/ErrorValidationProblem.java b/src/main/java/com/merge/legacy/api/resources/hris/types/ErrorValidationProblem.java new file mode 100644 index 000000000..cbe8e795b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/ErrorValidationProblem.java @@ -0,0 +1,178 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.source, this.title, this.detail, this.problemType); + } + + @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() {} + + @Override + public Builder from(ErrorValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + return this; + } + + @Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @Override + public ErrorValidationProblem build() { + return new ErrorValidationProblem(source, title, detail, problemType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EthnicityEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EthnicityEnum.java new file mode 100644 index 000000000..1f229c960 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EthnicityEnum.java @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EthnicityEnum { + 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"); + + private final String value; + + EthnicityEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/EventTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/EventTypeEnum.java new file mode 100644 index 000000000..039241261 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/EventTypeEnum.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/legacy/api/resources/hris/types/ExternalTargetFieldApi.java new file mode 100644 index 000000000..0c0559ebf --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/ExternalTargetFieldApi.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isMapped); + } + + @Override + 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/legacy/api/resources/hris/types/ExternalTargetFieldApiResponse.java b/src/main/java/com/merge/legacy/api/resources/hris/types/ExternalTargetFieldApiResponse.java new file mode 100644 index 000000000..a2ab89fdd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/ExternalTargetFieldApiResponse.java @@ -0,0 +1,481 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/hris/types/FieldMappingApiInstance.java b/src/main/java/com/merge/legacy/api/resources/hris/types/FieldMappingApiInstance.java new file mode 100644 index 000000000..592d17c8d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/FieldMappingApiInstance.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField); + } + + @Override + 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/legacy/api/resources/hris/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/legacy/api/resources/hris/types/FieldMappingApiInstanceRemoteField.java new file mode 100644 index 000000000..f988a5e2a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/FieldMappingApiInstanceRemoteField.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.remoteKeyName, this.schema, this.remoteEndpointInfo); + } + + @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() {} + + @Override + public Builder from(FieldMappingApiInstanceRemoteField other) { + remoteKeyName(other.getRemoteKeyName()); + schema(other.getSchema()); + remoteEndpointInfo(other.getRemoteEndpointInfo()); + return this; + } + + @Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo( + @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @Override + public _FinalStage schema(Map schema) { + this.schema = Optional.ofNullable(schema); + return this; + } + + @Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Optional> schema) { + this.schema = schema; + return this; + } + + @Override + public _FinalStage remoteKeyName(String remoteKeyName) { + this.remoteKeyName = Optional.ofNullable(remoteKeyName); + return this; + } + + @Override + @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) + public _FinalStage remoteKeyName(Optional remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @Override + public FieldMappingApiInstanceRemoteField build() { + return new FieldMappingApiInstanceRemoteField( + remoteKeyName, schema, remoteEndpointInfo, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/legacy/api/resources/hris/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java new file mode 100644 index 000000000..8e3f6279f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java @@ -0,0 +1,138 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @Override + 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/legacy/api/resources/hris/types/FieldMappingApiInstanceResponse.java b/src/main/java/com/merge/legacy/api/resources/hris/types/FieldMappingApiInstanceResponse.java new file mode 100644 index 000000000..497c6ac20 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/FieldMappingApiInstanceResponse.java @@ -0,0 +1,481 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/hris/types/FieldMappingApiInstanceTargetField.java b/src/main/java/com/merge/legacy/api/resources/hris/types/FieldMappingApiInstanceTargetField.java new file mode 100644 index 000000000..abc05de73 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/FieldMappingApiInstanceTargetField.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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; + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isOrganizationWide); + } + + @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() {} + + @Override + public Builder from(FieldMappingApiInstanceTargetField other) { + name(other.getName()); + description(other.getDescription()); + isOrganizationWide(other.getIsOrganizationWide()); + return this; + } + + @Override + @JsonSetter("name") + public DescriptionStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + @JsonSetter("description") + public IsOrganizationWideStage description(@NotNull String description) { + this.description = description; + return this; + } + + @Override + @JsonSetter("is_organization_wide") + public _FinalStage isOrganizationWide(boolean isOrganizationWide) { + this.isOrganizationWide = isOrganizationWide; + return this; + } + + @Override + public FieldMappingApiInstanceTargetField build() { + return new FieldMappingApiInstanceTargetField(name, description, isOrganizationWide, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/FieldMappingInstanceResponse.java b/src/main/java/com/merge/legacy/api/resources/hris/types/FieldMappingInstanceResponse.java new file mode 100644 index 000000000..439b3b565 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/FieldMappingInstanceResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @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() {} + + @Override + public Builder from(FieldMappingInstanceResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull FieldMappingApiInstance model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public FieldMappingInstanceResponse build() { + return new FieldMappingInstanceResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/FieldPermissionDeserializer.java b/src/main/java/com/merge/legacy/api/resources/hris/types/FieldPermissionDeserializer.java new file mode 100644 index 000000000..c51ae6156 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/FieldPermissionDeserializer.java @@ -0,0 +1,112 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @Override + 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/legacy/api/resources/hris/types/FieldPermissionDeserializerRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/types/FieldPermissionDeserializerRequest.java new file mode 100644 index 000000000..ceca8cbe2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/FieldPermissionDeserializerRequest.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @Override + 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/legacy/api/resources/hris/types/FlsaStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/FlsaStatusEnum.java new file mode 100644 index 000000000..44d82ca96 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/FlsaStatusEnum.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FlsaStatusEnum { + EXEMPT("EXEMPT"), + + SALARIED_NONEXEMPT("SALARIED_NONEXEMPT"), + + NONEXEMPT("NONEXEMPT"), + + OWNER("OWNER"); + + private final String value; + + FlsaStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/GenderEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/GenderEnum.java new file mode 100644 index 000000000..1e19590f2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/GenderEnum.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/Group.java b/src/main/java/com/merge/legacy/api/resources/hris/types/Group.java new file mode 100644 index 000000000..b76cef4f5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/Group.java @@ -0,0 +1,384 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/hris/types/GroupType.java b/src/main/java/com/merge/legacy/api/resources/hris/types/GroupType.java new file mode 100644 index 000000000..545815d00 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/GroupType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/GroupTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/GroupTypeEnum.java new file mode 100644 index 000000000..efce85302 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/GroupTypeEnum.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum GroupTypeEnum { + TEAM("TEAM"), + + DEPARTMENT("DEPARTMENT"), + + COST_CENTER("COST_CENTER"), + + BUSINESS_UNIT("BUSINESS_UNIT"), + + GROUP("GROUP"); + + private final String value; + + GroupTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/IndividualCommonModelScopeDeserializer.java b/src/main/java/com/merge/legacy/api/resources/hris/types/IndividualCommonModelScopeDeserializer.java new file mode 100644 index 000000000..4edb96ad2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/IndividualCommonModelScopeDeserializer.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @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() {} + + @Override + public Builder from(IndividualCommonModelScopeDeserializer other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @Override + public _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions(Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @Override + public IndividualCommonModelScopeDeserializer build() { + return new IndividualCommonModelScopeDeserializer( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/IndividualCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/types/IndividualCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..f072a3d72 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/IndividualCommonModelScopeDeserializerRequest.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @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() {} + + @Override + public Builder from(IndividualCommonModelScopeDeserializerRequest other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @Override + public _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions( + Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @Override + public IndividualCommonModelScopeDeserializerRequest build() { + return new IndividualCommonModelScopeDeserializerRequest( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/Issue.java b/src/main/java/com/merge/legacy/api/resources/hris/types/Issue.java new file mode 100644 index 000000000..a296d110b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/Issue.java @@ -0,0 +1,341 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.status, + this.errorDescription, + this.endUser, + this.firstIncidentTime, + this.lastIncidentTime, + this.isMuted, + this.errorDetails); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("error_description") + public _FinalStage errorDescription(@NotNull String errorDescription) { + this.errorDescription = errorDescription; + return this; + } + + @Override + public _FinalStage errorDetails(List errorDetails) { + this.errorDetails = Optional.ofNullable(errorDetails); + return this; + } + + @Override + @JsonSetter(value = "error_details", nulls = Nulls.SKIP) + public _FinalStage errorDetails(Optional> errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + @Override + public _FinalStage isMuted(Boolean isMuted) { + this.isMuted = Optional.ofNullable(isMuted); + return this; + } + + @Override + @JsonSetter(value = "is_muted", nulls = Nulls.SKIP) + public _FinalStage isMuted(Optional isMuted) { + this.isMuted = isMuted; + return this; + } + + @Override + public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { + this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); + return this; + } + + @Override + @JsonSetter(value = "last_incident_time", nulls = Nulls.SKIP) + public _FinalStage lastIncidentTime(Optional lastIncidentTime) { + this.lastIncidentTime = lastIncidentTime; + return this; + } + + @Override + public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { + this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); + return this; + } + + @Override + @JsonSetter(value = "first_incident_time", nulls = Nulls.SKIP) + public _FinalStage firstIncidentTime(Optional firstIncidentTime) { + this.firstIncidentTime = firstIncidentTime; + return this; + } + + @Override + public _FinalStage endUser(Map endUser) { + this.endUser = Optional.ofNullable(endUser); + return this; + } + + @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. + */ + @Override + public _FinalStage status(IssueStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @Override + public Issue build() { + return new Issue( + id, + status, + errorDescription, + endUser, + firstIncidentTime, + lastIncidentTime, + isMuted, + errorDetails, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/IssueStatus.java b/src/main/java/com/merge/legacy/api/resources/hris/types/IssueStatus.java new file mode 100644 index 000000000..ddb0521d5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/IssueStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/IssueStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/IssueStatusEnum.java new file mode 100644 index 000000000..18bde75ad --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/IssueStatusEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/LanguageEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/LanguageEnum.java new file mode 100644 index 000000000..ce282617c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/LanguageEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/LinkToken.java b/src/main/java/com/merge/legacy/api/resources/hris/types/LinkToken.java new file mode 100644 index 000000000..7b6db739f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/LinkToken.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.linkToken, this.integrationName, this.magicLinkUrl); + } + + @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() {} + + @Override + public Builder from(LinkToken other) { + linkToken(other.getLinkToken()); + integrationName(other.getIntegrationName()); + magicLinkUrl(other.getMagicLinkUrl()); + return this; + } + + @Override + @JsonSetter("link_token") + public _FinalStage linkToken(@NotNull String linkToken) { + this.linkToken = linkToken; + return this; + } + + @Override + public _FinalStage magicLinkUrl(String magicLinkUrl) { + this.magicLinkUrl = Optional.ofNullable(magicLinkUrl); + return this; + } + + @Override + @JsonSetter(value = "magic_link_url", nulls = Nulls.SKIP) + public _FinalStage magicLinkUrl(Optional magicLinkUrl) { + this.magicLinkUrl = magicLinkUrl; + return this; + } + + @Override + public _FinalStage integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @Override + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public _FinalStage integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + @Override + public LinkToken build() { + return new LinkToken(linkToken, integrationName, magicLinkUrl, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/LinkedAccountStatus.java b/src/main/java/com/merge/legacy/api/resources/hris/types/LinkedAccountStatus.java new file mode 100644 index 000000000..2148da564 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/LinkedAccountStatus.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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; + } + + @Override + public int hashCode() { + return Objects.hash(this.linkedAccountStatus, this.canMakeRequest); + } + + @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() {} + + @Override + public Builder from(LinkedAccountStatus other) { + linkedAccountStatus(other.getLinkedAccountStatus()); + canMakeRequest(other.getCanMakeRequest()); + return this; + } + + @Override + @JsonSetter("linked_account_status") + public CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus) { + this.linkedAccountStatus = linkedAccountStatus; + return this; + } + + @Override + @JsonSetter("can_make_request") + public _FinalStage canMakeRequest(boolean canMakeRequest) { + this.canMakeRequest = canMakeRequest; + return this; + } + + @Override + public LinkedAccountStatus build() { + return new LinkedAccountStatus(linkedAccountStatus, canMakeRequest, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/Location.java b/src/main/java/com/merge/legacy/api/resources/hris/types/Location.java new file mode 100644 index 000000000..f2decd4ed --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/Location.java @@ -0,0 +1,777 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Location.Builder.class) +public final class Location { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional phoneNumber; + + private final Optional street1; + + private final Optional street2; + + private final Optional city; + + private final Optional state; + + private final Optional zipCode; + + private final Optional country; + + private final Optional locationType; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Location( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional phoneNumber, + Optional street1, + Optional street2, + Optional city, + Optional state, + Optional zipCode, + Optional country, + Optional locationType, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.phoneNumber = phoneNumber; + this.street1 = street1; + this.street2 = street2; + this.city = city; + this.state = state; + this.zipCode = zipCode; + this.country = country; + this.locationType = locationType; + 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 location's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The location's phone number. + */ + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + /** + * @return Line 1 of the location's street address. + */ + @JsonProperty("street_1") + public Optional getStreet1() { + return street1; + } + + /** + * @return Line 2 of the location's street address. + */ + @JsonProperty("street_2") + public Optional getStreet2() { + return street2; + } + + /** + * @return The location's city. + */ + @JsonProperty("city") + public Optional getCity() { + return city; + } + + /** + * @return The location's state. Represents a region if outside of the US. + */ + @JsonProperty("state") + public Optional getState() { + return state; + } + + /** + * @return The location's zip code or postal code. + */ + @JsonProperty("zip_code") + public Optional getZipCode() { + return zipCode; + } + + /** + * @return The location'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 location's type. Can be either WORK or HOME + *
    + *
  • HOME - HOME
  • + *
  • WORK - WORK
  • + *
+ */ + @JsonProperty("location_type") + public Optional getLocationType() { + return locationType; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Location && equalTo((Location) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Location other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && phoneNumber.equals(other.phoneNumber) + && street1.equals(other.street1) + && street2.equals(other.street2) + && city.equals(other.city) + && state.equals(other.state) + && zipCode.equals(other.zipCode) + && country.equals(other.country) + && locationType.equals(other.locationType) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.phoneNumber, + this.street1, + this.street2, + this.city, + this.state, + this.zipCode, + this.country, + this.locationType, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 phoneNumber = Optional.empty(); + + private Optional street1 = Optional.empty(); + + private Optional street2 = Optional.empty(); + + private Optional city = Optional.empty(); + + private Optional state = Optional.empty(); + + private Optional zipCode = Optional.empty(); + + private Optional country = Optional.empty(); + + private Optional locationType = 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(Location other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + phoneNumber(other.getPhoneNumber()); + street1(other.getStreet1()); + street2(other.getStreet2()); + city(other.getCity()); + state(other.getState()); + zipCode(other.getZipCode()); + country(other.getCountry()); + locationType(other.getLocationType()); + 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 = "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 = "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 = "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 = "country", nulls = Nulls.SKIP) + public Builder country(Optional country) { + this.country = country; + return this; + } + + public Builder country(LocationCountry country) { + this.country = Optional.ofNullable(country); + return this; + } + + @JsonSetter(value = "location_type", nulls = Nulls.SKIP) + public Builder locationType(Optional locationType) { + this.locationType = locationType; + return this; + } + + public Builder locationType(LocationLocationType locationType) { + this.locationType = Optional.ofNullable(locationType); + 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 Location build() { + return new Location( + id, + remoteId, + createdAt, + modifiedAt, + name, + phoneNumber, + street1, + street2, + city, + state, + zipCode, + country, + locationType, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/LocationCountry.java b/src/main/java/com/merge/legacy/api/resources/hris/types/LocationCountry.java new file mode 100644 index 000000000..158d60ace --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/LocationCountry.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/LocationLocationType.java b/src/main/java/com/merge/legacy/api/resources/hris/types/LocationLocationType.java new file mode 100644 index 000000000..ee443b44f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/LocationLocationType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/LocationTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/LocationTypeEnum.java new file mode 100644 index 000000000..7151d78c4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/LocationTypeEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LocationTypeEnum { + HOME("HOME"), + + WORK("WORK"); + + private final String value; + + LocationTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/MaritalStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/MaritalStatusEnum.java new file mode 100644 index 000000000..582b1fa87 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/MaritalStatusEnum.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum MaritalStatusEnum { + 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"); + + private final String value; + + MaritalStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/MetaResponse.java b/src/main/java/com/merge/legacy/api/resources/hris/types/MetaResponse.java new file mode 100644 index 000000000..b7dbc4571 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/MetaResponse.java @@ -0,0 +1,232 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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; + } + + @Override + public int hashCode() { + return Objects.hash( + this.requestSchema, + this.remoteFieldClasses, + this.status, + this.hasConditionalParams, + this.hasRequiredLinkedAccountParams); + } + + @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() {} + + @Override + public Builder from(MetaResponse other) { + requestSchema(other.getRequestSchema()); + remoteFieldClasses(other.getRemoteFieldClasses()); + status(other.getStatus()); + hasConditionalParams(other.getHasConditionalParams()); + hasRequiredLinkedAccountParams(other.getHasRequiredLinkedAccountParams()); + return this; + } + + @Override + @JsonSetter("has_conditional_params") + public HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams) { + this.hasConditionalParams = hasConditionalParams; + return this; + } + + @Override + @JsonSetter("has_required_linked_account_params") + public _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams) { + this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; + return this; + } + + @Override + public _FinalStage status(LinkedAccountStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @Override + public _FinalStage remoteFieldClasses(Map remoteFieldClasses) { + this.remoteFieldClasses = Optional.ofNullable(remoteFieldClasses); + return this; + } + + @Override + @JsonSetter(value = "remote_field_classes", nulls = Nulls.SKIP) + public _FinalStage remoteFieldClasses(Optional> remoteFieldClasses) { + this.remoteFieldClasses = remoteFieldClasses; + return this; + } + + @Override + public _FinalStage requestSchema(String key, JsonNode value) { + this.requestSchema.put(key, value); + return this; + } + + @Override + public _FinalStage putAllRequestSchema(Map requestSchema) { + this.requestSchema.putAll(requestSchema); + return this; + } + + @Override + @JsonSetter(value = "request_schema", nulls = Nulls.SKIP) + public _FinalStage requestSchema(Map requestSchema) { + this.requestSchema.clear(); + this.requestSchema.putAll(requestSchema); + return this; + } + + @Override + public MetaResponse build() { + return new MetaResponse( + requestSchema, + remoteFieldClasses, + status, + hasConditionalParams, + hasRequiredLinkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/MethodEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/MethodEnum.java new file mode 100644 index 000000000..7016108c0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/MethodEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/ModelOperation.java b/src/main/java/com/merge/legacy/api/resources/hris/types/ModelOperation.java new file mode 100644 index 000000000..b77e38406 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/ModelOperation.java @@ -0,0 +1,216 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.modelName, this.availableOperations, this.requiredPostParameters, this.supportedFields); + } + + @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() {} + + @Override + public Builder from(ModelOperation other) { + modelName(other.getModelName()); + availableOperations(other.getAvailableOperations()); + requiredPostParameters(other.getRequiredPostParameters()); + supportedFields(other.getSupportedFields()); + return this; + } + + @Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @Override + public _FinalStage addAllSupportedFields(List supportedFields) { + this.supportedFields.addAll(supportedFields); + return this; + } + + @Override + public _FinalStage addSupportedFields(String supportedFields) { + this.supportedFields.add(supportedFields); + return this; + } + + @Override + @JsonSetter(value = "supported_fields", nulls = Nulls.SKIP) + public _FinalStage supportedFields(List supportedFields) { + this.supportedFields.clear(); + this.supportedFields.addAll(supportedFields); + return this; + } + + @Override + public _FinalStage addAllRequiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.addAll(requiredPostParameters); + return this; + } + + @Override + public _FinalStage addRequiredPostParameters(String requiredPostParameters) { + this.requiredPostParameters.add(requiredPostParameters); + return this; + } + + @Override + @JsonSetter(value = "required_post_parameters", nulls = Nulls.SKIP) + public _FinalStage requiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.clear(); + this.requiredPostParameters.addAll(requiredPostParameters); + return this; + } + + @Override + public _FinalStage addAllAvailableOperations(List availableOperations) { + this.availableOperations.addAll(availableOperations); + return this; + } + + @Override + public _FinalStage addAvailableOperations(String availableOperations) { + this.availableOperations.add(availableOperations); + return this; + } + + @Override + @JsonSetter(value = "available_operations", nulls = Nulls.SKIP) + public _FinalStage availableOperations(List availableOperations) { + this.availableOperations.clear(); + this.availableOperations.addAll(availableOperations); + return this; + } + + @Override + public ModelOperation build() { + return new ModelOperation( + modelName, availableOperations, requiredPostParameters, supportedFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/ModelPermissionDeserializer.java b/src/main/java/com/merge/legacy/api/resources/hris/types/ModelPermissionDeserializer.java new file mode 100644 index 000000000..42bef933b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/ModelPermissionDeserializer.java @@ -0,0 +1,89 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @Override + 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/legacy/api/resources/hris/types/ModelPermissionDeserializerRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/types/ModelPermissionDeserializerRequest.java new file mode 100644 index 000000000..0e519c4a5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/ModelPermissionDeserializerRequest.java @@ -0,0 +1,90 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @Override + 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/legacy/api/resources/hris/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/types/MultipartFormFieldRequest.java new file mode 100644 index 000000000..f6a52e33c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/MultipartFormFieldRequest.java @@ -0,0 +1,259 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.data, this.encoding, this.fileName, this.contentType); + } + + @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() {} + + @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. + */ + @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. + */ + @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. + */ + @Override + public _FinalStage contentType(String contentType) { + this.contentType = Optional.ofNullable(contentType); + return this; + } + + @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. + */ + @Override + public _FinalStage fileName(String fileName) { + this.fileName = Optional.ofNullable(fileName); + return this; + } + + @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. + */ + @Override + public _FinalStage encoding(MultipartFormFieldRequestEncoding encoding) { + this.encoding = Optional.ofNullable(encoding); + return this; + } + + @Override + @JsonSetter(value = "encoding", nulls = Nulls.SKIP) + public _FinalStage encoding(Optional encoding) { + this.encoding = encoding; + return this; + } + + @Override + public MultipartFormFieldRequest build() { + return new MultipartFormFieldRequest(name, data, encoding, fileName, contentType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/MultipartFormFieldRequestEncoding.java b/src/main/java/com/merge/legacy/api/resources/hris/types/MultipartFormFieldRequestEncoding.java new file mode 100644 index 000000000..dff5d668a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/MultipartFormFieldRequestEncoding.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedAccountDetailsAndActionsList.java new file mode 100644 index 000000000..6759754b1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedAccountDetailsAndActionsList.java @@ -0,0 +1,135 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/hris/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedAuditLogEventList.java new file mode 100644 index 000000000..368c5b8ef --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedAuditLogEventList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/hris/types/PaginatedBankInfoList.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedBankInfoList.java new file mode 100644 index 000000000..f7071ab07 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedBankInfoList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedBankInfoList.Builder.class) +public final class PaginatedBankInfoList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedBankInfoList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedBankInfoList && equalTo((PaginatedBankInfoList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedBankInfoList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedBankInfoList 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 PaginatedBankInfoList build() { + return new PaginatedBankInfoList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedBenefitList.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedBenefitList.java new file mode 100644 index 000000000..0d2a64766 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedBenefitList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedBenefitList.Builder.class) +public final class PaginatedBenefitList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedBenefitList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedBenefitList && equalTo((PaginatedBenefitList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedBenefitList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedBenefitList 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 PaginatedBenefitList build() { + return new PaginatedBenefitList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedCompanyList.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedCompanyList.java new file mode 100644 index 000000000..60f6edb43 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedCompanyList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedCompanyList.Builder.class) +public final class PaginatedCompanyList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedCompanyList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedCompanyList && equalTo((PaginatedCompanyList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedCompanyList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedCompanyList 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 PaginatedCompanyList build() { + return new PaginatedCompanyList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedDependentList.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedDependentList.java new file mode 100644 index 000000000..2edd80a65 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedDependentList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedDependentList.Builder.class) +public final class PaginatedDependentList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedDependentList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedDependentList && equalTo((PaginatedDependentList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedDependentList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedDependentList 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 PaginatedDependentList build() { + return new PaginatedDependentList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedEmployeeList.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedEmployeeList.java new file mode 100644 index 000000000..c4ecc42e0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedEmployeeList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/hris/types/PaginatedEmployeePayrollRunList.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedEmployeePayrollRunList.java new file mode 100644 index 000000000..aa6eee6bf --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedEmployeePayrollRunList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedEmployeePayrollRunList.Builder.class) +public final class PaginatedEmployeePayrollRunList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedEmployeePayrollRunList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedEmployeePayrollRunList && equalTo((PaginatedEmployeePayrollRunList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedEmployeePayrollRunList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedEmployeePayrollRunList 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 PaginatedEmployeePayrollRunList build() { + return new PaginatedEmployeePayrollRunList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedEmployerBenefitList.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedEmployerBenefitList.java new file mode 100644 index 000000000..91fba3b23 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedEmployerBenefitList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedEmployerBenefitList.Builder.class) +public final class PaginatedEmployerBenefitList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedEmployerBenefitList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedEmployerBenefitList && equalTo((PaginatedEmployerBenefitList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedEmployerBenefitList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedEmployerBenefitList 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 PaginatedEmployerBenefitList build() { + return new PaginatedEmployerBenefitList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedEmploymentList.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedEmploymentList.java new file mode 100644 index 000000000..e6d980960 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedEmploymentList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedEmploymentList.Builder.class) +public final class PaginatedEmploymentList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedEmploymentList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedEmploymentList && equalTo((PaginatedEmploymentList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedEmploymentList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedEmploymentList 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 PaginatedEmploymentList build() { + return new PaginatedEmploymentList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedGroupList.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedGroupList.java new file mode 100644 index 000000000..fbf24a480 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedGroupList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/hris/types/PaginatedIssueList.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedIssueList.java new file mode 100644 index 000000000..9f96279b4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedIssueList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/hris/types/PaginatedLocationList.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedLocationList.java new file mode 100644 index 000000000..2cef3617d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedLocationList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedLocationList.Builder.class) +public final class PaginatedLocationList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedLocationList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedLocationList && equalTo((PaginatedLocationList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedLocationList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedLocationList 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 PaginatedLocationList build() { + return new PaginatedLocationList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedPayGroupList.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedPayGroupList.java new file mode 100644 index 000000000..09f780330 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedPayGroupList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedPayGroupList.Builder.class) +public final class PaginatedPayGroupList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedPayGroupList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedPayGroupList && equalTo((PaginatedPayGroupList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedPayGroupList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedPayGroupList 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 PaginatedPayGroupList build() { + return new PaginatedPayGroupList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedPayrollRunList.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedPayrollRunList.java new file mode 100644 index 000000000..5b0a56b26 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedPayrollRunList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedPayrollRunList.Builder.class) +public final class PaginatedPayrollRunList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedPayrollRunList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedPayrollRunList && equalTo((PaginatedPayrollRunList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedPayrollRunList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedPayrollRunList 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 PaginatedPayrollRunList build() { + return new PaginatedPayrollRunList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedSyncStatusList.java new file mode 100644 index 000000000..e27aa0db0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedSyncStatusList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/hris/types/PaginatedTeamList.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedTeamList.java new file mode 100644 index 000000000..ad18b033a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedTeamList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/hris/types/PaginatedTimeOffBalanceList.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedTimeOffBalanceList.java new file mode 100644 index 000000000..bdee059a4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedTimeOffBalanceList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedTimeOffBalanceList.Builder.class) +public final class PaginatedTimeOffBalanceList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedTimeOffBalanceList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedTimeOffBalanceList && equalTo((PaginatedTimeOffBalanceList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedTimeOffBalanceList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedTimeOffBalanceList 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 PaginatedTimeOffBalanceList build() { + return new PaginatedTimeOffBalanceList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedTimeOffList.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedTimeOffList.java new file mode 100644 index 000000000..d09e98e53 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedTimeOffList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedTimeOffList.Builder.class) +public final class PaginatedTimeOffList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedTimeOffList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedTimeOffList && equalTo((PaginatedTimeOffList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedTimeOffList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedTimeOffList 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 PaginatedTimeOffList build() { + return new PaginatedTimeOffList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedTimesheetEntryList.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedTimesheetEntryList.java new file mode 100644 index 000000000..0c3469d5f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PaginatedTimesheetEntryList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedTimesheetEntryList.Builder.class) +public final class PaginatedTimesheetEntryList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedTimesheetEntryList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedTimesheetEntryList && equalTo((PaginatedTimesheetEntryList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedTimesheetEntryList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedTimesheetEntryList 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 PaginatedTimesheetEntryList build() { + return new PaginatedTimesheetEntryList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/PayCurrencyEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PayCurrencyEnum.java new file mode 100644 index 000000000..4d907cc95 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PayCurrencyEnum.java @@ -0,0 +1,632 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PayCurrencyEnum { + XUA("XUA"), + + AFN("AFN"), + + AFA("AFA"), + + ALL("ALL"), + + ALK("ALK"), + + DZD("DZD"), + + ADP("ADP"), + + AOA("AOA"), + + AOK("AOK"), + + AON("AON"), + + AOR("AOR"), + + ARA("ARA"), + + ARS("ARS"), + + ARM("ARM"), + + ARP("ARP"), + + ARL("ARL"), + + AMD("AMD"), + + AWG("AWG"), + + AUD("AUD"), + + ATS("ATS"), + + AZN("AZN"), + + AZM("AZM"), + + BSD("BSD"), + + BHD("BHD"), + + BDT("BDT"), + + BBD("BBD"), + + BYN("BYN"), + + BYB("BYB"), + + BYR("BYR"), + + BEF("BEF"), + + BEC("BEC"), + + BEL("BEL"), + + BZD("BZD"), + + BMD("BMD"), + + BTN("BTN"), + + BOB("BOB"), + + BOL("BOL"), + + BOV("BOV"), + + BOP("BOP"), + + BAM("BAM"), + + BAD("BAD"), + + BAN("BAN"), + + BWP("BWP"), + + BRC("BRC"), + + BRZ("BRZ"), + + BRE("BRE"), + + BRR("BRR"), + + BRN("BRN"), + + BRB("BRB"), + + BRL("BRL"), + + GBP("GBP"), + + BND("BND"), + + BGL("BGL"), + + BGN("BGN"), + + BGO("BGO"), + + BGM("BGM"), + + BUK("BUK"), + + BIF("BIF"), + + XPF("XPF"), + + KHR("KHR"), + + CAD("CAD"), + + CVE("CVE"), + + KYD("KYD"), + + XAF("XAF"), + + CLE("CLE"), + + CLP("CLP"), + + CLF("CLF"), + + CNX("CNX"), + + CNY("CNY"), + + CNH("CNH"), + + COP("COP"), + + COU("COU"), + + KMF("KMF"), + + CDF("CDF"), + + CRC("CRC"), + + HRD("HRD"), + + HRK("HRK"), + + CUC("CUC"), + + CUP("CUP"), + + CYP("CYP"), + + CZK("CZK"), + + CSK("CSK"), + + DKK("DKK"), + + DJF("DJF"), + + DOP("DOP"), + + NLG("NLG"), + + XCD("XCD"), + + DDM("DDM"), + + ECS("ECS"), + + ECV("ECV"), + + EGP("EGP"), + + GQE("GQE"), + + ERN("ERN"), + + EEK("EEK"), + + ETB("ETB"), + + EUR("EUR"), + + XBA("XBA"), + + XEU("XEU"), + + XBB("XBB"), + + XBC("XBC"), + + XBD("XBD"), + + FKP("FKP"), + + FJD("FJD"), + + FIM("FIM"), + + FRF("FRF"), + + XFO("XFO"), + + XFU("XFU"), + + GMD("GMD"), + + GEK("GEK"), + + GEL("GEL"), + + DEM("DEM"), + + GHS("GHS"), + + GHC("GHC"), + + GIP("GIP"), + + XAU("XAU"), + + GRD("GRD"), + + GTQ("GTQ"), + + GWP("GWP"), + + GNF("GNF"), + + GNS("GNS"), + + GYD("GYD"), + + HTG("HTG"), + + HNL("HNL"), + + HKD("HKD"), + + HUF("HUF"), + + IMP("IMP"), + + ISK("ISK"), + + ISJ("ISJ"), + + INR("INR"), + + IDR("IDR"), + + IRR("IRR"), + + IQD("IQD"), + + IEP("IEP"), + + ILS("ILS"), + + ILP("ILP"), + + ILR("ILR"), + + ITL("ITL"), + + JMD("JMD"), + + JPY("JPY"), + + JOD("JOD"), + + KZT("KZT"), + + KES("KES"), + + KWD("KWD"), + + KGS("KGS"), + + LAK("LAK"), + + LVL("LVL"), + + LVR("LVR"), + + LBP("LBP"), + + LSL("LSL"), + + LRD("LRD"), + + LYD("LYD"), + + LTL("LTL"), + + LTT("LTT"), + + LUL("LUL"), + + LUC("LUC"), + + LUF("LUF"), + + MOP("MOP"), + + MKD("MKD"), + + MKN("MKN"), + + MGA("MGA"), + + MGF("MGF"), + + MWK("MWK"), + + MYR("MYR"), + + MVR("MVR"), + + MVP("MVP"), + + MLF("MLF"), + + MTL("MTL"), + + MTP("MTP"), + + MRU("MRU"), + + MRO("MRO"), + + MUR("MUR"), + + MXV("MXV"), + + MXN("MXN"), + + MXP("MXP"), + + MDC("MDC"), + + MDL("MDL"), + + MCF("MCF"), + + MNT("MNT"), + + MAD("MAD"), + + MAF("MAF"), + + MZE("MZE"), + + MZN("MZN"), + + MZM("MZM"), + + MMK("MMK"), + + NAD("NAD"), + + NPR("NPR"), + + ANG("ANG"), + + TWD("TWD"), + + NZD("NZD"), + + NIO("NIO"), + + NIC("NIC"), + + NGN("NGN"), + + KPW("KPW"), + + NOK("NOK"), + + OMR("OMR"), + + PKR("PKR"), + + XPD("XPD"), + + PAB("PAB"), + + PGK("PGK"), + + PYG("PYG"), + + PEI("PEI"), + + PEN("PEN"), + + PES("PES"), + + PHP("PHP"), + + XPT("XPT"), + + PLN("PLN"), + + PLZ("PLZ"), + + PTE("PTE"), + + GWE("GWE"), + + QAR("QAR"), + + XRE("XRE"), + + RHD("RHD"), + + RON("RON"), + + ROL("ROL"), + + RUB("RUB"), + + RUR("RUR"), + + RWF("RWF"), + + SVC("SVC"), + + WST("WST"), + + SAR("SAR"), + + RSD("RSD"), + + CSD("CSD"), + + SCR("SCR"), + + SLL("SLL"), + + XAG("XAG"), + + SGD("SGD"), + + SKK("SKK"), + + SIT("SIT"), + + SBD("SBD"), + + SOS("SOS"), + + ZAR("ZAR"), + + ZAL("ZAL"), + + KRH("KRH"), + + KRW("KRW"), + + KRO("KRO"), + + SSP("SSP"), + + SUR("SUR"), + + ESP("ESP"), + + ESA("ESA"), + + ESB("ESB"), + + XDR("XDR"), + + LKR("LKR"), + + SHP("SHP"), + + XSU("XSU"), + + SDD("SDD"), + + SDG("SDG"), + + SDP("SDP"), + + SRD("SRD"), + + SRG("SRG"), + + SZL("SZL"), + + SEK("SEK"), + + CHF("CHF"), + + SYP("SYP"), + + STN("STN"), + + STD("STD"), + + TVD("TVD"), + + TJR("TJR"), + + TJS("TJS"), + + TZS("TZS"), + + XTS("XTS"), + + THB("THB"), + + XXX("XXX"), + + TPE("TPE"), + + TOP("TOP"), + + TTD("TTD"), + + TND("TND"), + + TRY("TRY"), + + TRL("TRL"), + + TMT("TMT"), + + TMM("TMM"), + + USD("USD"), + + USN("USN"), + + USS("USS"), + + UGX("UGX"), + + UGS("UGS"), + + UAH("UAH"), + + UAK("UAK"), + + AED("AED"), + + UYW("UYW"), + + UYU("UYU"), + + UYP("UYP"), + + UYI("UYI"), + + UZS("UZS"), + + VUV("VUV"), + + VES("VES"), + + VEB("VEB"), + + VEF("VEF"), + + VND("VND"), + + VNN("VNN"), + + CHE("CHE"), + + CHW("CHW"), + + XOF("XOF"), + + YDD("YDD"), + + YER("YER"), + + YUN("YUN"), + + YUD("YUD"), + + YUM("YUM"), + + YUR("YUR"), + + ZWN("ZWN"), + + ZRN("ZRN"), + + ZRZ("ZRZ"), + + ZMW("ZMW"), + + ZMK("ZMK"), + + ZWD("ZWD"), + + ZWR("ZWR"), + + ZWL("ZWL"); + + private final String value; + + PayCurrencyEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/PayFrequencyEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PayFrequencyEnum.java new file mode 100644 index 000000000..96e5fc25b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PayFrequencyEnum.java @@ -0,0 +1,38 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PayFrequencyEnum { + WEEKLY("WEEKLY"), + + BIWEEKLY("BIWEEKLY"), + + MONTHLY("MONTHLY"), + + QUARTERLY("QUARTERLY"), + + SEMIANNUALLY("SEMIANNUALLY"), + + ANNUALLY("ANNUALLY"), + + THIRTEEN_MONTHLY("THIRTEEN-MONTHLY"), + + PRO_RATA("PRO_RATA"), + + SEMIMONTHLY("SEMIMONTHLY"); + + private final String value; + + PayFrequencyEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/PayGroup.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PayGroup.java new file mode 100644 index 000000000..0a68f0b8f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PayGroup.java @@ -0,0 +1,290 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PayGroup.Builder.class) +public final class PayGroup { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional payGroupName; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private PayGroup( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional payGroupName, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.payGroupName = payGroupName; + 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 pay group name. + */ + @JsonProperty("pay_group_name") + public Optional getPayGroupName() { + return payGroupName; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PayGroup && equalTo((PayGroup) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PayGroup other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && payGroupName.equals(other.payGroupName) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.payGroupName, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 payGroupName = 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(PayGroup other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + payGroupName(other.getPayGroupName()); + 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 = "pay_group_name", nulls = Nulls.SKIP) + public Builder payGroupName(Optional payGroupName) { + this.payGroupName = payGroupName; + return this; + } + + public Builder payGroupName(String payGroupName) { + this.payGroupName = Optional.ofNullable(payGroupName); + 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 PayGroup build() { + return new PayGroup( + id, + remoteId, + createdAt, + modifiedAt, + payGroupName, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/PayPeriodEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PayPeriodEnum.java new file mode 100644 index 000000000..2463ab375 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PayPeriodEnum.java @@ -0,0 +1,38 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PayPeriodEnum { + HOUR("HOUR"), + + DAY("DAY"), + + WEEK("WEEK"), + + EVERY_TWO_WEEKS("EVERY_TWO_WEEKS"), + + SEMIMONTHLY("SEMIMONTHLY"), + + MONTH("MONTH"), + + QUARTER("QUARTER"), + + EVERY_SIX_MONTHS("EVERY_SIX_MONTHS"), + + YEAR("YEAR"); + + private final String value; + + PayPeriodEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/PayrollRun.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PayrollRun.java new file mode 100644 index 000000000..84659ec72 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PayrollRun.java @@ -0,0 +1,420 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PayrollRun.Builder.class) +public final class PayrollRun { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional runState; + + private final Optional runType; + + private final Optional startDate; + + private final Optional endDate; + + private final Optional checkDate; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private PayrollRun( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional runState, + Optional runType, + Optional startDate, + Optional endDate, + Optional checkDate, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.runState = runState; + this.runType = runType; + this.startDate = startDate; + this.endDate = endDate; + this.checkDate = checkDate; + 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 state of the payroll run + *
    + *
  • PAID - PAID
  • + *
  • DRAFT - DRAFT
  • + *
  • APPROVED - APPROVED
  • + *
  • FAILED - FAILED
  • + *
  • CLOSED - CLOSED
  • + *
+ */ + @JsonProperty("run_state") + public Optional getRunState() { + return runState; + } + + /** + * @return The type of the payroll run + *
    + *
  • REGULAR - REGULAR
  • + *
  • OFF_CYCLE - OFF_CYCLE
  • + *
  • CORRECTION - CORRECTION
  • + *
  • TERMINATION - TERMINATION
  • + *
  • SIGN_ON_BONUS - SIGN_ON_BONUS
  • + *
+ */ + @JsonProperty("run_type") + public Optional getRunType() { + return runType; + } + + /** + * @return The day and time the payroll run started. + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return The day and time the payroll run ended. + */ + @JsonProperty("end_date") + public Optional getEndDate() { + return endDate; + } + + /** + * @return The day and time the payroll run was checked. + */ + @JsonProperty("check_date") + public Optional getCheckDate() { + return checkDate; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PayrollRun && equalTo((PayrollRun) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PayrollRun other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && runState.equals(other.runState) + && runType.equals(other.runType) + && startDate.equals(other.startDate) + && endDate.equals(other.endDate) + && checkDate.equals(other.checkDate) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.runState, + this.runType, + this.startDate, + this.endDate, + this.checkDate, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 runState = Optional.empty(); + + private Optional runType = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional endDate = Optional.empty(); + + private Optional checkDate = 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(PayrollRun other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + runState(other.getRunState()); + runType(other.getRunType()); + startDate(other.getStartDate()); + endDate(other.getEndDate()); + checkDate(other.getCheckDate()); + 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 = "run_state", nulls = Nulls.SKIP) + public Builder runState(Optional runState) { + this.runState = runState; + return this; + } + + public Builder runState(PayrollRunRunState runState) { + this.runState = Optional.ofNullable(runState); + return this; + } + + @JsonSetter(value = "run_type", nulls = Nulls.SKIP) + public Builder runType(Optional runType) { + this.runType = runType; + return this; + } + + public Builder runType(PayrollRunRunType runType) { + this.runType = Optional.ofNullable(runType); + 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 = "end_date", nulls = Nulls.SKIP) + public Builder endDate(Optional endDate) { + this.endDate = endDate; + return this; + } + + public Builder endDate(OffsetDateTime endDate) { + this.endDate = Optional.ofNullable(endDate); + return this; + } + + @JsonSetter(value = "check_date", nulls = Nulls.SKIP) + public Builder checkDate(Optional checkDate) { + this.checkDate = checkDate; + return this; + } + + public Builder checkDate(OffsetDateTime checkDate) { + this.checkDate = Optional.ofNullable(checkDate); + 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 PayrollRun build() { + return new PayrollRun( + id, + remoteId, + createdAt, + modifiedAt, + runState, + runType, + startDate, + endDate, + checkDate, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/PayrollRunRunState.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PayrollRunRunState.java new file mode 100644 index 000000000..27aa427de --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PayrollRunRunState.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/PayrollRunRunType.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PayrollRunRunType.java new file mode 100644 index 000000000..600533dd8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PayrollRunRunType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/PolicyTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/PolicyTypeEnum.java new file mode 100644 index 000000000..02df219cd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/PolicyTypeEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PolicyTypeEnum { + VACATION("VACATION"), + + SICK("SICK"), + + PERSONAL("PERSONAL"), + + JURY_DUTY("JURY_DUTY"), + + VOLUNTEER("VOLUNTEER"), + + BEREAVEMENT("BEREAVEMENT"); + + private final String value; + + PolicyTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/ReasonEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/ReasonEnum.java new file mode 100644 index 000000000..7cbfa0fb0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/ReasonEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/RelationshipEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/RelationshipEnum.java new file mode 100644 index 000000000..84066df28 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/RelationshipEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum RelationshipEnum { + CHILD("CHILD"), + + SPOUSE("SPOUSE"), + + DOMESTIC_PARTNER("DOMESTIC_PARTNER"); + + private final String value; + + RelationshipEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/RemoteData.java b/src/main/java/com/merge/legacy/api/resources/hris/types/RemoteData.java new file mode 100644 index 000000000..aadc85917 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/RemoteData.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.path, this.data); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("path") + public _FinalStage path(@NotNull String path) { + this.path = path; + return this; + } + + @Override + public _FinalStage data(JsonNode data) { + this.data = Optional.ofNullable(data); + return this; + } + + @Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(Optional data) { + this.data = data; + return this; + } + + @Override + public RemoteData build() { + return new RemoteData(path, data, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/RemoteEndpointInfo.java b/src/main/java/com/merge/legacy/api/resources/hris/types/RemoteEndpointInfo.java new file mode 100644 index 000000000..263547c2a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/RemoteEndpointInfo.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @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() {} + + @Override + public Builder from(RemoteEndpointInfo other) { + method(other.getMethod()); + urlPath(other.getUrlPath()); + fieldTraversalPath(other.getFieldTraversalPath()); + return this; + } + + @Override + @JsonSetter("method") + public UrlPathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @Override + @JsonSetter("url_path") + public _FinalStage urlPath(@NotNull String urlPath) { + this.urlPath = urlPath; + return this; + } + + @Override + public _FinalStage addAllFieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.addAll(fieldTraversalPath); + return this; + } + + @Override + public _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath) { + this.fieldTraversalPath.add(fieldTraversalPath); + return this; + } + + @Override + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) + public _FinalStage fieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.clear(); + this.fieldTraversalPath.addAll(fieldTraversalPath); + return this; + } + + @Override + public RemoteEndpointInfo build() { + return new RemoteEndpointInfo(method, urlPath, fieldTraversalPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/RemoteFieldApi.java b/src/main/java/com/merge/legacy/api/resources/hris/types/RemoteFieldApi.java new file mode 100644 index 000000000..ddb067584 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/RemoteFieldApi.java @@ -0,0 +1,264 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.schema, + this.remoteKeyName, + this.remoteEndpointInfo, + this.exampleValues, + this.advancedMetadata, + this.coverage); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("remote_key_name") + public RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @Override + public _FinalStage coverage(RemoteFieldApiCoverage coverage) { + this.coverage = Optional.ofNullable(coverage); + return this; + } + + @Override + @JsonSetter(value = "coverage", nulls = Nulls.SKIP) + public _FinalStage coverage(Optional coverage) { + this.coverage = coverage; + return this; + } + + @Override + public _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata) { + this.advancedMetadata = Optional.ofNullable(advancedMetadata); + return this; + } + + @Override + @JsonSetter(value = "advanced_metadata", nulls = Nulls.SKIP) + public _FinalStage advancedMetadata(Optional advancedMetadata) { + this.advancedMetadata = advancedMetadata; + return this; + } + + @Override + public _FinalStage exampleValues(List exampleValues) { + this.exampleValues = Optional.ofNullable(exampleValues); + return this; + } + + @Override + @JsonSetter(value = "example_values", nulls = Nulls.SKIP) + public _FinalStage exampleValues(Optional> exampleValues) { + this.exampleValues = exampleValues; + return this; + } + + @Override + public _FinalStage schema(String key, JsonNode value) { + this.schema.put(key, value); + return this; + } + + @Override + public _FinalStage putAllSchema(Map schema) { + this.schema.putAll(schema); + return this; + } + + @Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Map schema) { + this.schema.clear(); + this.schema.putAll(schema); + return this; + } + + @Override + public RemoteFieldApi build() { + return new RemoteFieldApi( + schema, + remoteKeyName, + remoteEndpointInfo, + exampleValues, + advancedMetadata, + coverage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/RemoteFieldApiCoverage.java b/src/main/java/com/merge/legacy/api/resources/hris/types/RemoteFieldApiCoverage.java new file mode 100644 index 000000000..ededfc346 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/RemoteFieldApiCoverage.java @@ -0,0 +1,91 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/RemoteFieldApiResponse.java b/src/main/java/com/merge/legacy/api/resources/hris/types/RemoteFieldApiResponse.java new file mode 100644 index 000000000..453f009c7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/RemoteFieldApiResponse.java @@ -0,0 +1,481 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/hris/types/RemoteKey.java b/src/main/java/com/merge/legacy/api/resources/hris/types/RemoteKey.java new file mode 100644 index 000000000..ee8b4ccda --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/RemoteKey.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.key); + } + + @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() {} + + @Override + public Builder from(RemoteKey other) { + name(other.getName()); + key(other.getKey()); + return this; + } + + @Override + @JsonSetter("name") + public KeyStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + @JsonSetter("key") + public _FinalStage key(@NotNull String key) { + this.key = key; + return this; + } + + @Override + public RemoteKey build() { + return new RemoteKey(name, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/RemoteResponse.java b/src/main/java/com/merge/legacy/api/resources/hris/types/RemoteResponse.java new file mode 100644 index 000000000..9f8b5b789 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/RemoteResponse.java @@ -0,0 +1,271 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.status, + this.response, + this.responseHeaders, + this.responseType, + this.headers); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("method") + public PathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @Override + @JsonSetter("path") + public StatusStage path(@NotNull String path) { + this.path = path; + return this; + } + + @Override + @JsonSetter("status") + public ResponseStage status(int status) { + this.status = status; + return this; + } + + @Override + @JsonSetter("response") + public _FinalStage response(@NotNull JsonNode response) { + this.response = response; + return this; + } + + @Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Optional> headers) { + this.headers = headers; + return this; + } + + @Override + public _FinalStage responseType(RemoteResponseResponseType responseType) { + this.responseType = Optional.ofNullable(responseType); + return this; + } + + @Override + @JsonSetter(value = "response_type", nulls = Nulls.SKIP) + public _FinalStage responseType(Optional responseType) { + this.responseType = responseType; + return this; + } + + @Override + public _FinalStage responseHeaders(Map responseHeaders) { + this.responseHeaders = Optional.ofNullable(responseHeaders); + return this; + } + + @Override + @JsonSetter(value = "response_headers", nulls = Nulls.SKIP) + public _FinalStage responseHeaders(Optional> responseHeaders) { + this.responseHeaders = responseHeaders; + return this; + } + + @Override + public RemoteResponse build() { + return new RemoteResponse( + method, path, status, response, responseHeaders, responseType, headers, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/RemoteResponseResponseType.java b/src/main/java/com/merge/legacy/api/resources/hris/types/RemoteResponseResponseType.java new file mode 100644 index 000000000..964ab8e1f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/RemoteResponseResponseType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/RequestFormatEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/RequestFormatEnum.java new file mode 100644 index 000000000..b191327bc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/RequestFormatEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/RequestTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/RequestTypeEnum.java new file mode 100644 index 000000000..6e9f5cee2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/RequestTypeEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum RequestTypeEnum { + VACATION("VACATION"), + + SICK("SICK"), + + PERSONAL("PERSONAL"), + + JURY_DUTY("JURY_DUTY"), + + VOLUNTEER("VOLUNTEER"), + + BEREAVEMENT("BEREAVEMENT"); + + private final String value; + + RequestTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/ResponseTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/ResponseTypeEnum.java new file mode 100644 index 000000000..7b921c03c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/ResponseTypeEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/RoleEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/RoleEnum.java new file mode 100644 index 000000000..7a29c3f5c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/RoleEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/RunStateEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/RunStateEnum.java new file mode 100644 index 000000000..43daee8bd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/RunStateEnum.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum RunStateEnum { + PAID("PAID"), + + DRAFT("DRAFT"), + + APPROVED("APPROVED"), + + FAILED("FAILED"), + + CLOSED("CLOSED"); + + private final String value; + + RunStateEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/RunTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/RunTypeEnum.java new file mode 100644 index 000000000..2a4176bdd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/RunTypeEnum.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum RunTypeEnum { + REGULAR("REGULAR"), + + OFF_CYCLE("OFF_CYCLE"), + + CORRECTION("CORRECTION"), + + TERMINATION("TERMINATION"), + + SIGN_ON_BONUS("SIGN_ON_BONUS"); + + private final String value; + + RunTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/SelectiveSyncConfigurationsUsageEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/SelectiveSyncConfigurationsUsageEnum.java new file mode 100644 index 000000000..40a0e2f59 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/SelectiveSyncConfigurationsUsageEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/SyncStatus.java b/src/main/java/com/merge/legacy/api/resources/hris/types/SyncStatus.java new file mode 100644 index 000000000..2d2cbc008 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/SyncStatus.java @@ -0,0 +1,283 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.modelName, + this.modelId, + this.lastSyncStart, + this.nextSyncStart, + this.status, + this.isInitialSync, + this.selectiveSyncConfigurationsUsage); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("model_name") + public ModelIdStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @Override + @JsonSetter("model_id") + public StatusStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @Override + @JsonSetter("status") + public IsInitialSyncStage status(@NotNull SyncStatusStatusEnum status) { + this.status = status; + return this; + } + + @Override + @JsonSetter("is_initial_sync") + public _FinalStage isInitialSync(boolean isInitialSync) { + this.isInitialSync = isInitialSync; + return this; + } + + @Override + public _FinalStage selectiveSyncConfigurationsUsage( + SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = Optional.ofNullable(selectiveSyncConfigurationsUsage); + return this; + } + + @Override + @JsonSetter(value = "selective_sync_configurations_usage", nulls = Nulls.SKIP) + public _FinalStage selectiveSyncConfigurationsUsage( + Optional selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; + return this; + } + + @Override + public _FinalStage nextSyncStart(OffsetDateTime nextSyncStart) { + this.nextSyncStart = Optional.ofNullable(nextSyncStart); + return this; + } + + @Override + @JsonSetter(value = "next_sync_start", nulls = Nulls.SKIP) + public _FinalStage nextSyncStart(Optional nextSyncStart) { + this.nextSyncStart = nextSyncStart; + return this; + } + + @Override + public _FinalStage lastSyncStart(OffsetDateTime lastSyncStart) { + this.lastSyncStart = Optional.ofNullable(lastSyncStart); + return this; + } + + @Override + @JsonSetter(value = "last_sync_start", nulls = Nulls.SKIP) + public _FinalStage lastSyncStart(Optional lastSyncStart) { + this.lastSyncStart = lastSyncStart; + return this; + } + + @Override + public SyncStatus build() { + return new SyncStatus( + modelName, + modelId, + lastSyncStart, + nextSyncStart, + status, + isInitialSync, + selectiveSyncConfigurationsUsage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/SyncStatusStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/SyncStatusStatusEnum.java new file mode 100644 index 000000000..e44fc9920 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/SyncStatusStatusEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/Tax.java b/src/main/java/com/merge/legacy/api/resources/hris/types/Tax.java new file mode 100644 index 000000000..a270e2e01 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/Tax.java @@ -0,0 +1,374 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Tax.Builder.class) +public final class Tax { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional employeePayrollRun; + + private final Optional name; + + private final Optional amount; + + private final Optional employerTax; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Tax( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional employeePayrollRun, + Optional name, + Optional amount, + Optional employerTax, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.employeePayrollRun = employeePayrollRun; + this.name = name; + this.amount = amount; + this.employerTax = employerTax; + 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; + } + + @JsonProperty("employee_payroll_run") + public Optional getEmployeePayrollRun() { + return employeePayrollRun; + } + + /** + * @return The tax's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The tax amount. + */ + @JsonProperty("amount") + public Optional getAmount() { + return amount; + } + + /** + * @return Whether or not the employer is responsible for paying the tax. + */ + @JsonProperty("employer_tax") + public Optional getEmployerTax() { + return employerTax; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Tax && equalTo((Tax) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Tax other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && employeePayrollRun.equals(other.employeePayrollRun) + && name.equals(other.name) + && amount.equals(other.amount) + && employerTax.equals(other.employerTax) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.employeePayrollRun, + this.name, + this.amount, + this.employerTax, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 employeePayrollRun = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional amount = Optional.empty(); + + private Optional employerTax = 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(Tax other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + employeePayrollRun(other.getEmployeePayrollRun()); + name(other.getName()); + amount(other.getAmount()); + employerTax(other.getEmployerTax()); + 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_payroll_run", nulls = Nulls.SKIP) + public Builder employeePayrollRun(Optional employeePayrollRun) { + this.employeePayrollRun = employeePayrollRun; + return this; + } + + public Builder employeePayrollRun(String employeePayrollRun) { + this.employeePayrollRun = Optional.ofNullable(employeePayrollRun); + 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 = "amount", nulls = Nulls.SKIP) + public Builder amount(Optional amount) { + this.amount = amount; + return this; + } + + public Builder amount(Double amount) { + this.amount = Optional.ofNullable(amount); + return this; + } + + @JsonSetter(value = "employer_tax", nulls = Nulls.SKIP) + public Builder employerTax(Optional employerTax) { + this.employerTax = employerTax; + return this; + } + + public Builder employerTax(Boolean employerTax) { + this.employerTax = Optional.ofNullable(employerTax); + 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 Tax build() { + return new Tax( + id, + remoteId, + createdAt, + modifiedAt, + employeePayrollRun, + name, + amount, + employerTax, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/Team.java b/src/main/java/com/merge/legacy/api/resources/hris/types/Team.java new file mode 100644 index 000000000..8bea151d2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/Team.java @@ -0,0 +1,319 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/hris/types/TeamParentTeam.java b/src/main/java/com/merge/legacy/api/resources/hris/types/TeamParentTeam.java new file mode 100644 index 000000000..828f54359 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/TeamParentTeam.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TeamParentTeam.Deserializer.class) +public final class TeamParentTeam { + private final Object value; + + private final int type; + + private TeamParentTeam(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TeamParentTeam && equalTo((TeamParentTeam) other); + } + + private boolean equalTo(TeamParentTeam other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TeamParentTeam of(String value) { + return new TeamParentTeam(value, 0); + } + + public static TeamParentTeam of(Team value) { + return new TeamParentTeam(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Team value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TeamParentTeam.class); + } + + @Override + public TeamParentTeam 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/legacy/api/resources/hris/types/TimeOff.java b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOff.java new file mode 100644 index 000000000..9a641c025 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOff.java @@ -0,0 +1,541 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TimeOff.Builder.class) +public final class TimeOff { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional employee; + + private final Optional approver; + + private final Optional status; + + private final Optional employeeNote; + + private final Optional units; + + private final Optional amount; + + private final Optional requestType; + + private final Optional startTime; + + private final Optional endTime; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private TimeOff( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional employee, + Optional approver, + Optional status, + Optional employeeNote, + Optional units, + Optional amount, + Optional requestType, + Optional startTime, + Optional endTime, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.employee = employee; + this.approver = approver; + this.status = status; + this.employeeNote = employeeNote; + this.units = units; + this.amount = amount; + this.requestType = requestType; + this.startTime = startTime; + this.endTime = endTime; + 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 requesting time off. + */ + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + /** + * @return The Merge ID of the employee with the ability to approve the time off request. + */ + @JsonProperty("approver") + public Optional getApprover() { + return approver; + } + + /** + * @return The status of this time off request. + *
    + *
  • REQUESTED - REQUESTED
  • + *
  • APPROVED - APPROVED
  • + *
  • DECLINED - DECLINED
  • + *
  • CANCELLED - CANCELLED
  • + *
  • DELETED - DELETED
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The employee note for this time off request. + */ + @JsonProperty("employee_note") + public Optional getEmployeeNote() { + return employeeNote; + } + + /** + * @return The measurement that the third-party integration uses to count time requested. + *
    + *
  • HOURS - HOURS
  • + *
  • DAYS - DAYS
  • + *
+ */ + @JsonProperty("units") + public Optional getUnits() { + return units; + } + + /** + * @return The time off quantity measured by the prescribed “units”. + */ + @JsonProperty("amount") + public Optional getAmount() { + return amount; + } + + /** + * @return The type of time off request. + *
    + *
  • VACATION - VACATION
  • + *
  • SICK - SICK
  • + *
  • PERSONAL - PERSONAL
  • + *
  • JURY_DUTY - JURY_DUTY
  • + *
  • VOLUNTEER - VOLUNTEER
  • + *
  • BEREAVEMENT - BEREAVEMENT
  • + *
+ */ + @JsonProperty("request_type") + public Optional getRequestType() { + return requestType; + } + + /** + * @return The day and time of the start of the time requested off. + */ + @JsonProperty("start_time") + public Optional getStartTime() { + return startTime; + } + + /** + * @return The day and time of the end of the time requested off. + */ + @JsonProperty("end_time") + public Optional getEndTime() { + return endTime; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TimeOff && equalTo((TimeOff) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TimeOff other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && employee.equals(other.employee) + && approver.equals(other.approver) + && status.equals(other.status) + && employeeNote.equals(other.employeeNote) + && units.equals(other.units) + && amount.equals(other.amount) + && requestType.equals(other.requestType) + && startTime.equals(other.startTime) + && endTime.equals(other.endTime) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.employee, + this.approver, + this.status, + this.employeeNote, + this.units, + this.amount, + this.requestType, + this.startTime, + this.endTime, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 employee = Optional.empty(); + + private Optional approver = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional employeeNote = Optional.empty(); + + private Optional units = Optional.empty(); + + private Optional amount = Optional.empty(); + + private Optional requestType = Optional.empty(); + + private Optional startTime = Optional.empty(); + + private Optional endTime = 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(TimeOff other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + employee(other.getEmployee()); + approver(other.getApprover()); + status(other.getStatus()); + employeeNote(other.getEmployeeNote()); + units(other.getUnits()); + amount(other.getAmount()); + requestType(other.getRequestType()); + startTime(other.getStartTime()); + endTime(other.getEndTime()); + 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", nulls = Nulls.SKIP) + public Builder employee(Optional employee) { + this.employee = employee; + return this; + } + + public Builder employee(TimeOffEmployee employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "approver", nulls = Nulls.SKIP) + public Builder approver(Optional approver) { + this.approver = approver; + return this; + } + + public Builder approver(TimeOffApprover approver) { + this.approver = Optional.ofNullable(approver); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(TimeOffStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "employee_note", nulls = Nulls.SKIP) + public Builder employeeNote(Optional employeeNote) { + this.employeeNote = employeeNote; + return this; + } + + public Builder employeeNote(String employeeNote) { + this.employeeNote = Optional.ofNullable(employeeNote); + return this; + } + + @JsonSetter(value = "units", nulls = Nulls.SKIP) + public Builder units(Optional units) { + this.units = units; + return this; + } + + public Builder units(TimeOffUnits units) { + this.units = Optional.ofNullable(units); + return this; + } + + @JsonSetter(value = "amount", nulls = Nulls.SKIP) + public Builder amount(Optional amount) { + this.amount = amount; + return this; + } + + public Builder amount(Double amount) { + this.amount = Optional.ofNullable(amount); + return this; + } + + @JsonSetter(value = "request_type", nulls = Nulls.SKIP) + public Builder requestType(Optional requestType) { + this.requestType = requestType; + return this; + } + + public Builder requestType(TimeOffRequestType requestType) { + this.requestType = Optional.ofNullable(requestType); + return this; + } + + @JsonSetter(value = "start_time", nulls = Nulls.SKIP) + public Builder startTime(Optional startTime) { + this.startTime = startTime; + return this; + } + + public Builder startTime(OffsetDateTime startTime) { + this.startTime = Optional.ofNullable(startTime); + return this; + } + + @JsonSetter(value = "end_time", nulls = Nulls.SKIP) + public Builder endTime(Optional endTime) { + this.endTime = endTime; + return this; + } + + public Builder endTime(OffsetDateTime endTime) { + this.endTime = Optional.ofNullable(endTime); + 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 TimeOff build() { + return new TimeOff( + id, + remoteId, + createdAt, + modifiedAt, + employee, + approver, + status, + employeeNote, + units, + amount, + requestType, + startTime, + endTime, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffApprover.java b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffApprover.java new file mode 100644 index 000000000..edd0727a8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffApprover.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TimeOffApprover.Deserializer.class) +public final class TimeOffApprover { + private final Object value; + + private final int type; + + private TimeOffApprover(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((Employee) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TimeOffApprover && equalTo((TimeOffApprover) other); + } + + private boolean equalTo(TimeOffApprover other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TimeOffApprover of(String value) { + return new TimeOffApprover(value, 0); + } + + public static TimeOffApprover of(Employee value) { + return new TimeOffApprover(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employee value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TimeOffApprover.class); + } + + @Override + public TimeOffApprover 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, Employee.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffBalance.java b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffBalance.java new file mode 100644 index 000000000..c483a5d10 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffBalance.java @@ -0,0 +1,385 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TimeOffBalance.Builder.class) +public final class TimeOffBalance { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional employee; + + private final Optional balance; + + private final Optional used; + + private final Optional policyType; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private TimeOffBalance( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional employee, + Optional balance, + Optional used, + Optional policyType, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.employee = employee; + this.balance = balance; + this.used = used; + this.policyType = policyType; + 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 the balance belongs to. + */ + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + /** + * @return The current remaining PTO balance, measured in hours. For integrations that return this value in days, Merge multiplies by 8 to calculate hours. + */ + @JsonProperty("balance") + public Optional getBalance() { + return balance; + } + + /** + * @return The amount of PTO used in terms of hours. For integrations that return this value in days, Merge multiplies by 8 to calculate hours. + */ + @JsonProperty("used") + public Optional getUsed() { + return used; + } + + /** + * @return The policy type of this time off balance. + *
    + *
  • VACATION - VACATION
  • + *
  • SICK - SICK
  • + *
  • PERSONAL - PERSONAL
  • + *
  • JURY_DUTY - JURY_DUTY
  • + *
  • VOLUNTEER - VOLUNTEER
  • + *
  • BEREAVEMENT - BEREAVEMENT
  • + *
+ */ + @JsonProperty("policy_type") + public Optional getPolicyType() { + return policyType; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TimeOffBalance && equalTo((TimeOffBalance) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TimeOffBalance other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && employee.equals(other.employee) + && balance.equals(other.balance) + && used.equals(other.used) + && policyType.equals(other.policyType) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.employee, + this.balance, + this.used, + this.policyType, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 employee = Optional.empty(); + + private Optional balance = Optional.empty(); + + private Optional used = Optional.empty(); + + private Optional policyType = 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(TimeOffBalance other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + employee(other.getEmployee()); + balance(other.getBalance()); + used(other.getUsed()); + policyType(other.getPolicyType()); + 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", nulls = Nulls.SKIP) + public Builder employee(Optional employee) { + this.employee = employee; + return this; + } + + public Builder employee(TimeOffBalanceEmployee employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "balance", nulls = Nulls.SKIP) + public Builder balance(Optional balance) { + this.balance = balance; + return this; + } + + public Builder balance(Double balance) { + this.balance = Optional.ofNullable(balance); + return this; + } + + @JsonSetter(value = "used", nulls = Nulls.SKIP) + public Builder used(Optional used) { + this.used = used; + return this; + } + + public Builder used(Double used) { + this.used = Optional.ofNullable(used); + return this; + } + + @JsonSetter(value = "policy_type", nulls = Nulls.SKIP) + public Builder policyType(Optional policyType) { + this.policyType = policyType; + return this; + } + + public Builder policyType(TimeOffBalancePolicyType policyType) { + this.policyType = Optional.ofNullable(policyType); + 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 TimeOffBalance build() { + return new TimeOffBalance( + id, + remoteId, + createdAt, + modifiedAt, + employee, + balance, + used, + policyType, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffBalanceEmployee.java b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffBalanceEmployee.java new file mode 100644 index 000000000..eb6dc8c10 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffBalanceEmployee.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TimeOffBalanceEmployee.Deserializer.class) +public final class TimeOffBalanceEmployee { + private final Object value; + + private final int type; + + private TimeOffBalanceEmployee(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((Employee) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TimeOffBalanceEmployee && equalTo((TimeOffBalanceEmployee) other); + } + + private boolean equalTo(TimeOffBalanceEmployee other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TimeOffBalanceEmployee of(String value) { + return new TimeOffBalanceEmployee(value, 0); + } + + public static TimeOffBalanceEmployee of(Employee value) { + return new TimeOffBalanceEmployee(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employee value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TimeOffBalanceEmployee.class); + } + + @Override + public TimeOffBalanceEmployee 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, Employee.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffBalancePolicyType.java b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffBalancePolicyType.java new file mode 100644 index 000000000..f1fdca353 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffBalancePolicyType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/TimeOffEmployee.java b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffEmployee.java new file mode 100644 index 000000000..2430c0150 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffEmployee.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TimeOffEmployee.Deserializer.class) +public final class TimeOffEmployee { + private final Object value; + + private final int type; + + private TimeOffEmployee(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((Employee) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TimeOffEmployee && equalTo((TimeOffEmployee) other); + } + + private boolean equalTo(TimeOffEmployee other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TimeOffEmployee of(String value) { + return new TimeOffEmployee(value, 0); + } + + public static TimeOffEmployee of(Employee value) { + return new TimeOffEmployee(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employee value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TimeOffEmployee.class); + } + + @Override + public TimeOffEmployee 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, Employee.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffRequest.java new file mode 100644 index 000000000..996e0a312 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffRequest.java @@ -0,0 +1,402 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = TimeOffRequest.Builder.class) +public final class TimeOffRequest { + private final Optional employee; + + private final Optional approver; + + private final Optional status; + + private final Optional employeeNote; + + private final Optional units; + + private final Optional amount; + + private final Optional requestType; + + private final Optional startTime; + + private final Optional endTime; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private TimeOffRequest( + Optional employee, + Optional approver, + Optional status, + Optional employeeNote, + Optional units, + Optional amount, + Optional requestType, + Optional startTime, + Optional endTime, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.employee = employee; + this.approver = approver; + this.status = status; + this.employeeNote = employeeNote; + this.units = units; + this.amount = amount; + this.requestType = requestType; + this.startTime = startTime; + this.endTime = endTime; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The employee requesting time off. + */ + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + /** + * @return The Merge ID of the employee with the ability to approve the time off request. + */ + @JsonProperty("approver") + public Optional getApprover() { + return approver; + } + + /** + * @return The status of this time off request. + *
    + *
  • REQUESTED - REQUESTED
  • + *
  • APPROVED - APPROVED
  • + *
  • DECLINED - DECLINED
  • + *
  • CANCELLED - CANCELLED
  • + *
  • DELETED - DELETED
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The employee note for this time off request. + */ + @JsonProperty("employee_note") + public Optional getEmployeeNote() { + return employeeNote; + } + + /** + * @return The measurement that the third-party integration uses to count time requested. + *
    + *
  • HOURS - HOURS
  • + *
  • DAYS - DAYS
  • + *
+ */ + @JsonProperty("units") + public Optional getUnits() { + return units; + } + + /** + * @return The time off quantity measured by the prescribed “units”. + */ + @JsonProperty("amount") + public Optional getAmount() { + return amount; + } + + /** + * @return The type of time off request. + *
    + *
  • VACATION - VACATION
  • + *
  • SICK - SICK
  • + *
  • PERSONAL - PERSONAL
  • + *
  • JURY_DUTY - JURY_DUTY
  • + *
  • VOLUNTEER - VOLUNTEER
  • + *
  • BEREAVEMENT - BEREAVEMENT
  • + *
+ */ + @JsonProperty("request_type") + public Optional getRequestType() { + return requestType; + } + + /** + * @return The day and time of the start of the time requested off. + */ + @JsonProperty("start_time") + public Optional getStartTime() { + return startTime; + } + + /** + * @return The day and time of the end of the time requested off. + */ + @JsonProperty("end_time") + public Optional getEndTime() { + return endTime; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TimeOffRequest && equalTo((TimeOffRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TimeOffRequest other) { + return employee.equals(other.employee) + && approver.equals(other.approver) + && status.equals(other.status) + && employeeNote.equals(other.employeeNote) + && units.equals(other.units) + && amount.equals(other.amount) + && requestType.equals(other.requestType) + && startTime.equals(other.startTime) + && endTime.equals(other.endTime) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @Override + public int hashCode() { + return Objects.hash( + this.employee, + this.approver, + this.status, + this.employeeNote, + this.units, + this.amount, + this.requestType, + this.startTime, + this.endTime, + this.integrationParams, + this.linkedAccountParams); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional employee = Optional.empty(); + + private Optional approver = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional employeeNote = Optional.empty(); + + private Optional units = Optional.empty(); + + private Optional amount = Optional.empty(); + + private Optional requestType = Optional.empty(); + + private Optional startTime = Optional.empty(); + + private Optional endTime = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TimeOffRequest other) { + employee(other.getEmployee()); + approver(other.getApprover()); + status(other.getStatus()); + employeeNote(other.getEmployeeNote()); + units(other.getUnits()); + amount(other.getAmount()); + requestType(other.getRequestType()); + startTime(other.getStartTime()); + endTime(other.getEndTime()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + return this; + } + + @JsonSetter(value = "employee", nulls = Nulls.SKIP) + public Builder employee(Optional employee) { + this.employee = employee; + return this; + } + + public Builder employee(TimeOffRequestEmployee employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "approver", nulls = Nulls.SKIP) + public Builder approver(Optional approver) { + this.approver = approver; + return this; + } + + public Builder approver(TimeOffRequestApprover approver) { + this.approver = Optional.ofNullable(approver); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(TimeOffRequestStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "employee_note", nulls = Nulls.SKIP) + public Builder employeeNote(Optional employeeNote) { + this.employeeNote = employeeNote; + return this; + } + + public Builder employeeNote(String employeeNote) { + this.employeeNote = Optional.ofNullable(employeeNote); + return this; + } + + @JsonSetter(value = "units", nulls = Nulls.SKIP) + public Builder units(Optional units) { + this.units = units; + return this; + } + + public Builder units(TimeOffRequestUnits units) { + this.units = Optional.ofNullable(units); + return this; + } + + @JsonSetter(value = "amount", nulls = Nulls.SKIP) + public Builder amount(Optional amount) { + this.amount = amount; + return this; + } + + public Builder amount(Double amount) { + this.amount = Optional.ofNullable(amount); + return this; + } + + @JsonSetter(value = "request_type", nulls = Nulls.SKIP) + public Builder requestType(Optional requestType) { + this.requestType = requestType; + return this; + } + + public Builder requestType(TimeOffRequestRequestType requestType) { + this.requestType = Optional.ofNullable(requestType); + return this; + } + + @JsonSetter(value = "start_time", nulls = Nulls.SKIP) + public Builder startTime(Optional startTime) { + this.startTime = startTime; + return this; + } + + public Builder startTime(OffsetDateTime startTime) { + this.startTime = Optional.ofNullable(startTime); + return this; + } + + @JsonSetter(value = "end_time", nulls = Nulls.SKIP) + public Builder endTime(Optional endTime) { + this.endTime = endTime; + return this; + } + + public Builder endTime(OffsetDateTime endTime) { + this.endTime = Optional.ofNullable(endTime); + 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 TimeOffRequest build() { + return new TimeOffRequest( + employee, + approver, + status, + employeeNote, + units, + amount, + requestType, + startTime, + endTime, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffRequestApprover.java b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffRequestApprover.java new file mode 100644 index 000000000..d71011470 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffRequestApprover.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TimeOffRequestApprover.Deserializer.class) +public final class TimeOffRequestApprover { + private final Object value; + + private final int type; + + private TimeOffRequestApprover(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((Employee) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TimeOffRequestApprover && equalTo((TimeOffRequestApprover) other); + } + + private boolean equalTo(TimeOffRequestApprover other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TimeOffRequestApprover of(String value) { + return new TimeOffRequestApprover(value, 0); + } + + public static TimeOffRequestApprover of(Employee value) { + return new TimeOffRequestApprover(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employee value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TimeOffRequestApprover.class); + } + + @Override + public TimeOffRequestApprover 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, Employee.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffRequestEmployee.java b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffRequestEmployee.java new file mode 100644 index 000000000..1a3fea0ad --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffRequestEmployee.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TimeOffRequestEmployee.Deserializer.class) +public final class TimeOffRequestEmployee { + private final Object value; + + private final int type; + + private TimeOffRequestEmployee(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((Employee) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TimeOffRequestEmployee && equalTo((TimeOffRequestEmployee) other); + } + + private boolean equalTo(TimeOffRequestEmployee other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TimeOffRequestEmployee of(String value) { + return new TimeOffRequestEmployee(value, 0); + } + + public static TimeOffRequestEmployee of(Employee value) { + return new TimeOffRequestEmployee(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employee value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TimeOffRequestEmployee.class); + } + + @Override + public TimeOffRequestEmployee 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, Employee.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffRequestRequestType.java b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffRequestRequestType.java new file mode 100644 index 000000000..4429de371 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffRequestRequestType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/TimeOffRequestStatus.java b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffRequestStatus.java new file mode 100644 index 000000000..ec2d43ed4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffRequestStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/TimeOffRequestType.java b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffRequestType.java new file mode 100644 index 000000000..7d7474e0f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffRequestType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/TimeOffRequestUnits.java b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffRequestUnits.java new file mode 100644 index 000000000..b257d87f4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffRequestUnits.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/TimeOffResponse.java b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffResponse.java new file mode 100644 index 000000000..5f20d662d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TimeOffResponse.Builder.class) +public final class TimeOffResponse { + private final TimeOff model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private TimeOffResponse( + TimeOff 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 TimeOff getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TimeOffResponse && equalTo((TimeOffResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TimeOffResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull TimeOff model); + + Builder from(TimeOffResponse other); + } + + public interface _FinalStage { + TimeOffResponse 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 TimeOff model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(TimeOffResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull TimeOff model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public TimeOffResponse build() { + return new TimeOffResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffStatus.java b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffStatus.java new file mode 100644 index 000000000..0bf73ca16 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/TimeOffStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffStatusEnum.java new file mode 100644 index 000000000..1f0040642 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffStatusEnum.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TimeOffStatusEnum { + REQUESTED("REQUESTED"), + + APPROVED("APPROVED"), + + DECLINED("DECLINED"), + + CANCELLED("CANCELLED"), + + DELETED("DELETED"); + + private final String value; + + TimeOffStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffUnits.java b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffUnits.java new file mode 100644 index 000000000..9a841d753 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/TimeOffUnits.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/hris/types/TimesheetEntry.java b/src/main/java/com/merge/legacy/api/resources/hris/types/TimesheetEntry.java new file mode 100644 index 000000000..99b9d0f88 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/TimesheetEntry.java @@ -0,0 +1,377 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TimesheetEntry.Builder.class) +public final class TimesheetEntry { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional employee; + + private final Optional hoursWorked; + + private final Optional startTime; + + private final Optional endTime; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private TimesheetEntry( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional employee, + Optional hoursWorked, + Optional startTime, + Optional endTime, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.employee = employee; + this.hoursWorked = hoursWorked; + this.startTime = startTime; + this.endTime = endTime; + 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 the timesheet entry is for. + */ + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + /** + * @return The number of hours logged by the employee. + */ + @JsonProperty("hours_worked") + public Optional getHoursWorked() { + return hoursWorked; + } + + /** + * @return The time at which the employee started work. + */ + @JsonProperty("start_time") + public Optional getStartTime() { + return startTime; + } + + /** + * @return The time at which the employee ended work. + */ + @JsonProperty("end_time") + public Optional getEndTime() { + return endTime; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TimesheetEntry && equalTo((TimesheetEntry) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TimesheetEntry other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && employee.equals(other.employee) + && hoursWorked.equals(other.hoursWorked) + && startTime.equals(other.startTime) + && endTime.equals(other.endTime) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.employee, + this.hoursWorked, + this.startTime, + this.endTime, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 employee = Optional.empty(); + + private Optional hoursWorked = Optional.empty(); + + private Optional startTime = Optional.empty(); + + private Optional endTime = 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(TimesheetEntry other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + employee(other.getEmployee()); + hoursWorked(other.getHoursWorked()); + startTime(other.getStartTime()); + endTime(other.getEndTime()); + 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", nulls = Nulls.SKIP) + public Builder employee(Optional employee) { + this.employee = employee; + return this; + } + + public Builder employee(TimesheetEntryEmployee employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "hours_worked", nulls = Nulls.SKIP) + public Builder hoursWorked(Optional hoursWorked) { + this.hoursWorked = hoursWorked; + return this; + } + + public Builder hoursWorked(Double hoursWorked) { + this.hoursWorked = Optional.ofNullable(hoursWorked); + return this; + } + + @JsonSetter(value = "start_time", nulls = Nulls.SKIP) + public Builder startTime(Optional startTime) { + this.startTime = startTime; + return this; + } + + public Builder startTime(OffsetDateTime startTime) { + this.startTime = Optional.ofNullable(startTime); + return this; + } + + @JsonSetter(value = "end_time", nulls = Nulls.SKIP) + public Builder endTime(Optional endTime) { + this.endTime = endTime; + return this; + } + + public Builder endTime(OffsetDateTime endTime) { + this.endTime = Optional.ofNullable(endTime); + 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 TimesheetEntry build() { + return new TimesheetEntry( + id, + remoteId, + createdAt, + modifiedAt, + employee, + hoursWorked, + startTime, + endTime, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/TimesheetEntryEmployee.java b/src/main/java/com/merge/legacy/api/resources/hris/types/TimesheetEntryEmployee.java new file mode 100644 index 000000000..c3a0515c3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/TimesheetEntryEmployee.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TimesheetEntryEmployee.Deserializer.class) +public final class TimesheetEntryEmployee { + private final Object value; + + private final int type; + + private TimesheetEntryEmployee(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((Employee) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TimesheetEntryEmployee && equalTo((TimesheetEntryEmployee) other); + } + + private boolean equalTo(TimesheetEntryEmployee other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TimesheetEntryEmployee of(String value) { + return new TimesheetEntryEmployee(value, 0); + } + + public static TimesheetEntryEmployee of(Employee value) { + return new TimesheetEntryEmployee(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employee value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TimesheetEntryEmployee.class); + } + + @Override + public TimesheetEntryEmployee 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, Employee.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/TimesheetEntryRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/types/TimesheetEntryRequest.java new file mode 100644 index 000000000..87c878d0b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/TimesheetEntryRequest.java @@ -0,0 +1,238 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = TimesheetEntryRequest.Builder.class) +public final class TimesheetEntryRequest { + private final Optional employee; + + private final Optional hoursWorked; + + private final Optional startTime; + + private final Optional endTime; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private TimesheetEntryRequest( + Optional employee, + Optional hoursWorked, + Optional startTime, + Optional endTime, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.employee = employee; + this.hoursWorked = hoursWorked; + this.startTime = startTime; + this.endTime = endTime; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The employee the timesheet entry is for. + */ + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + /** + * @return The number of hours logged by the employee. + */ + @JsonProperty("hours_worked") + public Optional getHoursWorked() { + return hoursWorked; + } + + /** + * @return The time at which the employee started work. + */ + @JsonProperty("start_time") + public Optional getStartTime() { + return startTime; + } + + /** + * @return The time at which the employee ended work. + */ + @JsonProperty("end_time") + public Optional getEndTime() { + return endTime; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TimesheetEntryRequest && equalTo((TimesheetEntryRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TimesheetEntryRequest other) { + return employee.equals(other.employee) + && hoursWorked.equals(other.hoursWorked) + && startTime.equals(other.startTime) + && endTime.equals(other.endTime) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @Override + public int hashCode() { + return Objects.hash( + this.employee, + this.hoursWorked, + this.startTime, + this.endTime, + this.integrationParams, + this.linkedAccountParams); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional employee = Optional.empty(); + + private Optional hoursWorked = Optional.empty(); + + private Optional startTime = Optional.empty(); + + private Optional endTime = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TimesheetEntryRequest other) { + employee(other.getEmployee()); + hoursWorked(other.getHoursWorked()); + startTime(other.getStartTime()); + endTime(other.getEndTime()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + return this; + } + + @JsonSetter(value = "employee", nulls = Nulls.SKIP) + public Builder employee(Optional employee) { + this.employee = employee; + return this; + } + + public Builder employee(TimesheetEntryRequestEmployee employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "hours_worked", nulls = Nulls.SKIP) + public Builder hoursWorked(Optional hoursWorked) { + this.hoursWorked = hoursWorked; + return this; + } + + public Builder hoursWorked(Double hoursWorked) { + this.hoursWorked = Optional.ofNullable(hoursWorked); + return this; + } + + @JsonSetter(value = "start_time", nulls = Nulls.SKIP) + public Builder startTime(Optional startTime) { + this.startTime = startTime; + return this; + } + + public Builder startTime(OffsetDateTime startTime) { + this.startTime = Optional.ofNullable(startTime); + return this; + } + + @JsonSetter(value = "end_time", nulls = Nulls.SKIP) + public Builder endTime(Optional endTime) { + this.endTime = endTime; + return this; + } + + public Builder endTime(OffsetDateTime endTime) { + this.endTime = Optional.ofNullable(endTime); + 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 TimesheetEntryRequest build() { + return new TimesheetEntryRequest( + employee, + hoursWorked, + startTime, + endTime, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/TimesheetEntryRequestEmployee.java b/src/main/java/com/merge/legacy/api/resources/hris/types/TimesheetEntryRequestEmployee.java new file mode 100644 index 000000000..a21758fc5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/TimesheetEntryRequestEmployee.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TimesheetEntryRequestEmployee.Deserializer.class) +public final class TimesheetEntryRequestEmployee { + private final Object value; + + private final int type; + + private TimesheetEntryRequestEmployee(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((Employee) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TimesheetEntryRequestEmployee && equalTo((TimesheetEntryRequestEmployee) other); + } + + private boolean equalTo(TimesheetEntryRequestEmployee other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TimesheetEntryRequestEmployee of(String value) { + return new TimesheetEntryRequestEmployee(value, 0); + } + + public static TimesheetEntryRequestEmployee of(Employee value) { + return new TimesheetEntryRequestEmployee(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employee value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TimesheetEntryRequestEmployee.class); + } + + @Override + public TimesheetEntryRequestEmployee 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, Employee.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/TimesheetEntryResponse.java b/src/main/java/com/merge/legacy/api/resources/hris/types/TimesheetEntryResponse.java new file mode 100644 index 000000000..f81ca9633 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/TimesheetEntryResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TimesheetEntryResponse.Builder.class) +public final class TimesheetEntryResponse { + private final TimesheetEntry model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private TimesheetEntryResponse( + TimesheetEntry 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 TimesheetEntry getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TimesheetEntryResponse && equalTo((TimesheetEntryResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TimesheetEntryResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull TimesheetEntry model); + + Builder from(TimesheetEntryResponse other); + } + + public interface _FinalStage { + TimesheetEntryResponse 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 TimesheetEntry model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(TimesheetEntryResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull TimesheetEntry model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public TimesheetEntryResponse build() { + return new TimesheetEntryResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/UnitsEnum.java b/src/main/java/com/merge/legacy/api/resources/hris/types/UnitsEnum.java new file mode 100644 index 000000000..a64a626d2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/UnitsEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum UnitsEnum { + HOURS("HOURS"), + + DAYS("DAYS"); + + private final String value; + + UnitsEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/ValidationProblemSource.java b/src/main/java/com/merge/legacy/api/resources/hris/types/ValidationProblemSource.java new file mode 100644 index 000000000..f5d1c839a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/ValidationProblemSource.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.pointer); + } + + @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() {} + + @Override + public Builder from(ValidationProblemSource other) { + pointer(other.getPointer()); + return this; + } + + @Override + @JsonSetter("pointer") + public _FinalStage pointer(@NotNull String pointer) { + this.pointer = pointer; + return this; + } + + @Override + public ValidationProblemSource build() { + return new ValidationProblemSource(pointer, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/WarningValidationProblem.java b/src/main/java/com/merge/legacy/api/resources/hris/types/WarningValidationProblem.java new file mode 100644 index 000000000..1d94a4d6b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/WarningValidationProblem.java @@ -0,0 +1,178 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.source, this.title, this.detail, this.problemType); + } + + @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() {} + + @Override + public Builder from(WarningValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + return this; + } + + @Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @Override + public WarningValidationProblem build() { + return new WarningValidationProblem(source, title, detail, problemType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/types/WebhookReceiver.java b/src/main/java/com/merge/legacy/api/resources/hris/types/WebhookReceiver.java new file mode 100644 index 000000000..d2a726ee9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/types/WebhookReceiver.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @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() {} + + @Override + public Builder from(WebhookReceiver other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @Override + public WebhookReceiver build() { + return new WebhookReceiver(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/hris/webhookreceivers/WebhookReceiversClient.java b/src/main/java/com/merge/legacy/api/resources/hris/webhookreceivers/WebhookReceiversClient.java new file mode 100644 index 000000000..fb3f2c04f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/webhookreceivers/WebhookReceiversClient.java @@ -0,0 +1,111 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.webhookreceivers; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.hris.types.WebhookReceiver; +import com.merge.legacy.api.resources.hris.webhookreceivers.requests.WebhookReceiverRequest; +import java.io.IOException; +import java.util.List; +import okhttp3.*; + +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/legacy/api/resources/hris/webhookreceivers/requests/WebhookReceiverRequest.java b/src/main/java/com/merge/legacy/api/resources/hris/webhookreceivers/requests/WebhookReceiverRequest.java new file mode 100644 index 000000000..b1917ef7e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/hris/webhookreceivers/requests/WebhookReceiverRequest.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.hris.webhookreceivers.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @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() {} + + @Override + public Builder from(WebhookReceiverRequest other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @Override + public WebhookReceiverRequest build() { + return new WebhookReceiverRequest(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/TicketingClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/TicketingClient.java new file mode 100644 index 000000000..28027b993 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/TicketingClient.java @@ -0,0 +1,240 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing; + +import com.merge.legacy.api.core.ClientOptions; +import com.merge.legacy.api.core.Suppliers; +import com.merge.legacy.api.resources.ticketing.accountdetails.AccountDetailsClient; +import com.merge.legacy.api.resources.ticketing.accounts.AccountsClient; +import com.merge.legacy.api.resources.ticketing.accounttoken.AccountTokenClient; +import com.merge.legacy.api.resources.ticketing.asyncpassthrough.AsyncPassthroughClient; +import com.merge.legacy.api.resources.ticketing.attachments.AttachmentsClient; +import com.merge.legacy.api.resources.ticketing.audittrail.AuditTrailClient; +import com.merge.legacy.api.resources.ticketing.availableactions.AvailableActionsClient; +import com.merge.legacy.api.resources.ticketing.collections.CollectionsClient; +import com.merge.legacy.api.resources.ticketing.comments.CommentsClient; +import com.merge.legacy.api.resources.ticketing.contacts.ContactsClient; +import com.merge.legacy.api.resources.ticketing.deleteaccount.DeleteAccountClient; +import com.merge.legacy.api.resources.ticketing.fieldmapping.FieldMappingClient; +import com.merge.legacy.api.resources.ticketing.forceresync.ForceResyncClient; +import com.merge.legacy.api.resources.ticketing.generatekey.GenerateKeyClient; +import com.merge.legacy.api.resources.ticketing.issues.IssuesClient; +import com.merge.legacy.api.resources.ticketing.linkedaccounts.LinkedAccountsClient; +import com.merge.legacy.api.resources.ticketing.linktoken.LinkTokenClient; +import com.merge.legacy.api.resources.ticketing.passthrough.PassthroughClient; +import com.merge.legacy.api.resources.ticketing.projects.ProjectsClient; +import com.merge.legacy.api.resources.ticketing.regeneratekey.RegenerateKeyClient; +import com.merge.legacy.api.resources.ticketing.roles.RolesClient; +import com.merge.legacy.api.resources.ticketing.scopes.ScopesClient; +import com.merge.legacy.api.resources.ticketing.syncstatus.SyncStatusClient; +import com.merge.legacy.api.resources.ticketing.tags.TagsClient; +import com.merge.legacy.api.resources.ticketing.teams.TeamsClient; +import com.merge.legacy.api.resources.ticketing.tickets.TicketsClient; +import com.merge.legacy.api.resources.ticketing.users.UsersClient; +import com.merge.legacy.api.resources.ticketing.webhookreceivers.WebhookReceiversClient; +import java.util.function.Supplier; + +public class TicketingClient { + 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 TicketingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.accountDetailsClient = Suppliers.memoize(() -> new AccountDetailsClient(clientOptions)); + this.accountTokenClient = Suppliers.memoize(() -> new AccountTokenClient(clientOptions)); + this.accountsClient = Suppliers.memoize(() -> new AccountsClient(clientOptions)); + this.asyncPassthroughClient = Suppliers.memoize(() -> new AsyncPassthroughClient(clientOptions)); + this.attachmentsClient = Suppliers.memoize(() -> new AttachmentsClient(clientOptions)); + this.auditTrailClient = Suppliers.memoize(() -> new AuditTrailClient(clientOptions)); + this.availableActionsClient = Suppliers.memoize(() -> new AvailableActionsClient(clientOptions)); + this.collectionsClient = Suppliers.memoize(() -> new CollectionsClient(clientOptions)); + this.commentsClient = Suppliers.memoize(() -> new CommentsClient(clientOptions)); + this.contactsClient = Suppliers.memoize(() -> new ContactsClient(clientOptions)); + this.scopesClient = Suppliers.memoize(() -> new ScopesClient(clientOptions)); + this.deleteAccountClient = Suppliers.memoize(() -> new DeleteAccountClient(clientOptions)); + this.fieldMappingClient = Suppliers.memoize(() -> new FieldMappingClient(clientOptions)); + this.generateKeyClient = Suppliers.memoize(() -> new GenerateKeyClient(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.projectsClient = Suppliers.memoize(() -> new ProjectsClient(clientOptions)); + this.regenerateKeyClient = Suppliers.memoize(() -> new RegenerateKeyClient(clientOptions)); + this.rolesClient = Suppliers.memoize(() -> new RolesClient(clientOptions)); + this.syncStatusClient = Suppliers.memoize(() -> new SyncStatusClient(clientOptions)); + this.forceResyncClient = Suppliers.memoize(() -> new ForceResyncClient(clientOptions)); + this.tagsClient = Suppliers.memoize(() -> new TagsClient(clientOptions)); + this.teamsClient = Suppliers.memoize(() -> new TeamsClient(clientOptions)); + this.ticketsClient = Suppliers.memoize(() -> new TicketsClient(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 AccountsClient accounts() { + return this.accountsClient.get(); + } + + public AsyncPassthroughClient asyncPassthrough() { + return this.asyncPassthroughClient.get(); + } + + public AttachmentsClient attachments() { + return this.attachmentsClient.get(); + } + + public AuditTrailClient auditTrail() { + return this.auditTrailClient.get(); + } + + public AvailableActionsClient availableActions() { + return this.availableActionsClient.get(); + } + + public CollectionsClient collections() { + return this.collectionsClient.get(); + } + + public CommentsClient comments() { + return this.commentsClient.get(); + } + + public ContactsClient contacts() { + return this.contactsClient.get(); + } + + public ScopesClient scopes() { + return this.scopesClient.get(); + } + + public DeleteAccountClient deleteAccount() { + return this.deleteAccountClient.get(); + } + + public FieldMappingClient fieldMapping() { + return this.fieldMappingClient.get(); + } + + public GenerateKeyClient generateKey() { + return this.generateKeyClient.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 ProjectsClient projects() { + return this.projectsClient.get(); + } + + public RegenerateKeyClient regenerateKey() { + return this.regenerateKeyClient.get(); + } + + public RolesClient roles() { + return this.rolesClient.get(); + } + + public SyncStatusClient syncStatus() { + return this.syncStatusClient.get(); + } + + public ForceResyncClient forceResync() { + return this.forceResyncClient.get(); + } + + public TagsClient tags() { + return this.tagsClient.get(); + } + + public TeamsClient teams() { + return this.teamsClient.get(); + } + + public TicketsClient tickets() { + return this.ticketsClient.get(); + } + + public UsersClient users() { + return this.usersClient.get(); + } + + public WebhookReceiversClient webhookReceivers() { + return this.webhookReceiversClient.get(); + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/accountdetails/AccountDetailsClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/accountdetails/AccountDetailsClient.java new file mode 100644 index 000000000..4d0ec7f33 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/accountdetails/AccountDetailsClient.java @@ -0,0 +1,58 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.accountdetails; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.types.AccountDetails; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ticketing/accounts/AccountsClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/accounts/AccountsClient.java new file mode 100644 index 000000000..c8c539733 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/accounts/AccountsClient.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.accounts; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.accounts.requests.AccountsListRequest; +import com.merge.legacy.api.resources.ticketing.accounts.requests.AccountsRetrieveRequest; +import com.merge.legacy.api.resources.ticketing.types.Account; +import com.merge.legacy.api.resources.ticketing.types.PaginatedAccountList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ticketing/accounts/requests/AccountsListRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/accounts/requests/AccountsListRequest.java new file mode 100644 index 000000000..e9848a7a3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/accounts/requests/AccountsListRequest.java @@ -0,0 +1,359 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.accounts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ticketing/accounts/requests/AccountsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/accounts/requests/AccountsRetrieveRequest.java new file mode 100644 index 000000000..f260f860c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/accounts/requests/AccountsRetrieveRequest.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.accounts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/ticketing/accounttoken/AccountTokenClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/accounttoken/AccountTokenClient.java new file mode 100644 index 000000000..db0056f0a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/accounttoken/AccountTokenClient.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.accounttoken; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.types.AccountToken; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ticketing/asyncpassthrough/AsyncPassthroughClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/asyncpassthrough/AsyncPassthroughClient.java new file mode 100644 index 000000000..22015e7a4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/asyncpassthrough/AsyncPassthroughClient.java @@ -0,0 +1,110 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.asyncpassthrough; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.asyncpassthrough.types.AsyncPassthroughRetrieveResponse; +import com.merge.legacy.api.resources.ticketing.types.AsyncPassthroughReciept; +import com.merge.legacy.api.resources.ticketing.types.DataPassthroughRequest; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ticketing/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java b/src/main/java/com/merge/legacy/api/resources/ticketing/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java new file mode 100644 index 000000000..4eb717828 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import com.merge.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ticketing/attachments/AttachmentsClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/attachments/AttachmentsClient.java new file mode 100644 index 000000000..39803e1b0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/attachments/AttachmentsClient.java @@ -0,0 +1,329 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.attachments; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.attachments.requests.AttachmentsDownloadRetrieveRequest; +import com.merge.legacy.api.resources.ticketing.attachments.requests.AttachmentsListRequest; +import com.merge.legacy.api.resources.ticketing.attachments.requests.AttachmentsRetrieveRequest; +import com.merge.legacy.api.resources.ticketing.attachments.requests.TicketingAttachmentEndpointRequest; +import com.merge.legacy.api.resources.ticketing.types.Attachment; +import com.merge.legacy.api.resources.ticketing.types.MetaResponse; +import com.merge.legacy.api.resources.ticketing.types.PaginatedAttachmentList; +import com.merge.legacy.api.resources.ticketing.types.TicketingAttachmentResponse; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/ticketing/attachments/requests/AttachmentsDownloadRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/attachments/requests/AttachmentsDownloadRetrieveRequest.java new file mode 100644 index 000000000..f0922f7d1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/attachments/requests/AttachmentsDownloadRetrieveRequest.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.attachments.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.mimeType); + } + + @Override + 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/legacy/api/resources/ticketing/attachments/requests/AttachmentsListRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/attachments/requests/AttachmentsListRequest.java new file mode 100644 index 000000000..393eeb4dc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/attachments/requests/AttachmentsListRequest.java @@ -0,0 +1,446 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.attachments.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ticketing/attachments/requests/AttachmentsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/attachments/requests/AttachmentsRetrieveRequest.java new file mode 100644 index 000000000..20e839a48 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/attachments/requests/AttachmentsRetrieveRequest.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.attachments.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/ticketing/attachments/requests/TicketingAttachmentEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/attachments/requests/TicketingAttachmentEndpointRequest.java new file mode 100644 index 000000000..533e43c59 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/attachments/requests/TicketingAttachmentEndpointRequest.java @@ -0,0 +1,174 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.attachments.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ticketing.types.AttachmentRequest; +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 = TicketingAttachmentEndpointRequest.Builder.class) +public final class TicketingAttachmentEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final AttachmentRequest model; + + private final Map additionalProperties; + + private TicketingAttachmentEndpointRequest( + Optional isDebugMode, + Optional runAsync, + AttachmentRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public AttachmentRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketingAttachmentEndpointRequest + && equalTo((TicketingAttachmentEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TicketingAttachmentEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull AttachmentRequest model); + + Builder from(TicketingAttachmentEndpointRequest other); + } + + public interface _FinalStage { + TicketingAttachmentEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private AttachmentRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(TicketingAttachmentEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull AttachmentRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public TicketingAttachmentEndpointRequest build() { + return new TicketingAttachmentEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/audittrail/AuditTrailClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/audittrail/AuditTrailClient.java new file mode 100644 index 000000000..0b43062eb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/audittrail/AuditTrailClient.java @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.audittrail; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.audittrail.requests.AuditTrailListRequest; +import com.merge.legacy.api.resources.ticketing.types.PaginatedAuditLogEventList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ticketing/audittrail/requests/AuditTrailListRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/audittrail/requests/AuditTrailListRequest.java new file mode 100644 index 000000000..b7b1f83ce --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/audittrail/requests/AuditTrailListRequest.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.audittrail.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.cursor, this.endDate, this.eventType, this.pageSize, this.startDate, this.userEmail); + } + + @Override + 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/legacy/api/resources/ticketing/availableactions/AvailableActionsClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/availableactions/AvailableActionsClient.java new file mode 100644 index 000000000..4a1f30ccc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/availableactions/AvailableActionsClient.java @@ -0,0 +1,58 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.availableactions; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.types.AvailableActions; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ticketing/collections/CollectionsClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/collections/CollectionsClient.java new file mode 100644 index 000000000..b36c7724a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/collections/CollectionsClient.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.collections; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.collections.requests.CollectionsListRequest; +import com.merge.legacy.api.resources.ticketing.collections.requests.CollectionsRetrieveRequest; +import com.merge.legacy.api.resources.ticketing.types.Collection; +import com.merge.legacy.api.resources.ticketing.types.PaginatedCollectionList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ticketing/collections/requests/CollectionsListRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/collections/requests/CollectionsListRequest.java new file mode 100644 index 000000000..40cb08b82 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/collections/requests/CollectionsListRequest.java @@ -0,0 +1,505 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.collections.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ticketing.collections.types.CollectionsListRequestExpand; +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 = CollectionsListRequest.Builder.class) +public final class CollectionsListRequest { + private final Optional collectionType; + + 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 parentCollectionId; + + private final Optional remoteFields; + + private final Optional remoteId; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private CollectionsListRequest( + Optional collectionType, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional parentCollectionId, + Optional remoteFields, + Optional remoteId, + Optional showEnumOrigins, + Map additionalProperties) { + this.collectionType = collectionType; + 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.parentCollectionId = parentCollectionId; + this.remoteFields = remoteFields; + this.remoteId = remoteId; + this.showEnumOrigins = showEnumOrigins; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return collections of the given type. + */ + @JsonProperty("collection_type") + public Optional getCollectionType() { + return collectionType; + } + + /** + * @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 collections whose parent collection matches the given id. + */ + @JsonProperty("parent_collection_id") + public Optional getParentCollectionId() { + return parentCollectionId; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CollectionsListRequest && equalTo((CollectionsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CollectionsListRequest other) { + return 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) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && parentCollectionId.equals(other.parentCollectionId) + && remoteFields.equals(other.remoteFields) + && remoteId.equals(other.remoteId) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @Override + public int hashCode() { + return Objects.hash( + this.collectionType, + this.createdAfter, + this.createdBefore, + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.parentCollectionId, + this.remoteFields, + this.remoteId, + this.showEnumOrigins); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional collectionType = 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 parentCollectionId = 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(CollectionsListRequest other) { + collectionType(other.getCollectionType()); + 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()); + parentCollectionId(other.getParentCollectionId()); + remoteFields(other.getRemoteFields()); + remoteId(other.getRemoteId()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + @JsonSetter(value = "collection_type", nulls = Nulls.SKIP) + public Builder collectionType(Optional collectionType) { + this.collectionType = collectionType; + return this; + } + + public Builder collectionType(String collectionType) { + this.collectionType = Optional.ofNullable(collectionType); + 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(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; + 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_collection_id", nulls = Nulls.SKIP) + public Builder parentCollectionId(Optional parentCollectionId) { + this.parentCollectionId = parentCollectionId; + return this; + } + + public Builder parentCollectionId(String parentCollectionId) { + this.parentCollectionId = Optional.ofNullable(parentCollectionId); + 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 CollectionsListRequest build() { + return new CollectionsListRequest( + collectionType, + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + parentCollectionId, + remoteFields, + remoteId, + showEnumOrigins, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/collections/requests/CollectionsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/collections/requests/CollectionsRetrieveRequest.java new file mode 100644 index 000000000..6eb0fdbca --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/collections/requests/CollectionsRetrieveRequest.java @@ -0,0 +1,177 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.collections.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ticketing.collections.types.CollectionsRetrieveRequestExpand; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CollectionsRetrieveRequest.Builder.class) +public final class CollectionsRetrieveRequest { + private final Optional expand; + + private final Optional includeRemoteData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private CollectionsRetrieveRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CollectionsRetrieveRequest && equalTo((CollectionsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CollectionsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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(CollectionsRetrieveRequest 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(CollectionsRetrieveRequestExpand 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 CollectionsRetrieveRequest build() { + return new CollectionsRetrieveRequest( + expand, includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/collections/types/CollectionsListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/ticketing/collections/types/CollectionsListRequestExpand.java new file mode 100644 index 000000000..77e748221 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/collections/types/CollectionsListRequestExpand.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/collections/types/CollectionsRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/ticketing/collections/types/CollectionsRetrieveRequestExpand.java new file mode 100644 index 000000000..0487c8750 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/collections/types/CollectionsRetrieveRequestExpand.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/comments/CommentsClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/comments/CommentsClient.java new file mode 100644 index 000000000..efb1f8b8d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/comments/CommentsClient.java @@ -0,0 +1,273 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.comments; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.comments.requests.CommentEndpointRequest; +import com.merge.legacy.api.resources.ticketing.comments.requests.CommentsListRequest; +import com.merge.legacy.api.resources.ticketing.comments.requests.CommentsRetrieveRequest; +import com.merge.legacy.api.resources.ticketing.types.Comment; +import com.merge.legacy.api.resources.ticketing.types.CommentResponse; +import com.merge.legacy.api.resources.ticketing.types.MetaResponse; +import com.merge.legacy.api.resources.ticketing.types.PaginatedCommentList; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/ticketing/comments/requests/CommentEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/comments/requests/CommentEndpointRequest.java new file mode 100644 index 000000000..3b505e667 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/comments/requests/CommentEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.comments.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ticketing.types.CommentRequest; +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 = CommentEndpointRequest.Builder.class) +public final class CommentEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final CommentRequest model; + + private final Map additionalProperties; + + private CommentEndpointRequest( + Optional isDebugMode, + Optional runAsync, + CommentRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public CommentRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommentEndpointRequest && equalTo((CommentEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CommentEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull CommentRequest model); + + Builder from(CommentEndpointRequest other); + } + + public interface _FinalStage { + CommentEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private CommentRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CommentEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull CommentRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public CommentEndpointRequest build() { + return new CommentEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/comments/requests/CommentsListRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/comments/requests/CommentsListRequest.java new file mode 100644 index 000000000..bd781ff50 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/comments/requests/CommentsListRequest.java @@ -0,0 +1,447 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.comments.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ticketing.comments.types.CommentsListRequestExpand; +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 = CommentsListRequest.Builder.class) +public final class CommentsListRequest { + 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 CommentsListRequest( + 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 Comments 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommentsListRequest && equalTo((CommentsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CommentsListRequest 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); + } + + @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); + } + + @Override + 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(CommentsListRequest 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(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; + 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 CommentsListRequest build() { + return new CommentsListRequest( + createdAfter, + createdBefore, + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteCreatedAfter, + remoteId, + ticketId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/comments/requests/CommentsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/comments/requests/CommentsRetrieveRequest.java new file mode 100644 index 000000000..a88c3aefe --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/comments/requests/CommentsRetrieveRequest.java @@ -0,0 +1,121 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.comments.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/ticketing/comments/types/CommentsListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/ticketing/comments/types/CommentsListRequestExpand.java new file mode 100644 index 000000000..612241172 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/comments/types/CommentsListRequestExpand.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/comments/types/CommentsRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/ticketing/comments/types/CommentsRetrieveRequestExpand.java new file mode 100644 index 000000000..26816a24f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/comments/types/CommentsRetrieveRequestExpand.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/contacts/ContactsClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/contacts/ContactsClient.java new file mode 100644 index 000000000..86f25ba31 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/contacts/ContactsClient.java @@ -0,0 +1,265 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.contacts; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.contacts.requests.ContactsListRequest; +import com.merge.legacy.api.resources.ticketing.contacts.requests.ContactsRetrieveRequest; +import com.merge.legacy.api.resources.ticketing.contacts.requests.TicketingContactEndpointRequest; +import com.merge.legacy.api.resources.ticketing.types.Contact; +import com.merge.legacy.api.resources.ticketing.types.MetaResponse; +import com.merge.legacy.api.resources.ticketing.types.PaginatedContactList; +import com.merge.legacy.api.resources.ticketing.types.TicketingContactResponse; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/ticketing/contacts/requests/ContactsListRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/contacts/requests/ContactsListRequest.java new file mode 100644 index 000000000..7c59d4f9a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/contacts/requests/ContactsListRequest.java @@ -0,0 +1,388 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.contacts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ticketing/contacts/requests/ContactsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/contacts/requests/ContactsRetrieveRequest.java new file mode 100644 index 000000000..f87db4ab5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/contacts/requests/ContactsRetrieveRequest.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.contacts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/ticketing/contacts/requests/TicketingContactEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/contacts/requests/TicketingContactEndpointRequest.java new file mode 100644 index 000000000..5011655ae --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/contacts/requests/TicketingContactEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.contacts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ticketing.types.ContactRequest; +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 = TicketingContactEndpointRequest.Builder.class) +public final class TicketingContactEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final ContactRequest model; + + private final Map additionalProperties; + + private TicketingContactEndpointRequest( + Optional isDebugMode, + Optional runAsync, + ContactRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public ContactRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketingContactEndpointRequest && equalTo((TicketingContactEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TicketingContactEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull ContactRequest model); + + Builder from(TicketingContactEndpointRequest other); + } + + public interface _FinalStage { + TicketingContactEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private ContactRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(TicketingContactEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull ContactRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public TicketingContactEndpointRequest build() { + return new TicketingContactEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/deleteaccount/DeleteAccountClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/deleteaccount/DeleteAccountClient.java new file mode 100644 index 000000000..f0021dd0d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/deleteaccount/DeleteAccountClient.java @@ -0,0 +1,55 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.deleteaccount; + +import com.merge.legacy.api.core.*; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ticketing/fieldmapping/FieldMappingClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/fieldmapping/FieldMappingClient.java new file mode 100644 index 000000000..c1bee142c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/fieldmapping/FieldMappingClient.java @@ -0,0 +1,338 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.fieldmapping; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.fieldmapping.requests.CreateFieldMappingRequest; +import com.merge.legacy.api.resources.ticketing.fieldmapping.requests.FieldMappingsRetrieveRequest; +import com.merge.legacy.api.resources.ticketing.fieldmapping.requests.PatchedEditFieldMappingRequest; +import com.merge.legacy.api.resources.ticketing.fieldmapping.requests.RemoteFieldsRetrieveRequest; +import com.merge.legacy.api.resources.ticketing.types.ExternalTargetFieldApiResponse; +import com.merge.legacy.api.resources.ticketing.types.FieldMappingApiInstanceResponse; +import com.merge.legacy.api.resources.ticketing.types.FieldMappingInstanceResponse; +import com.merge.legacy.api.resources.ticketing.types.RemoteFieldApiResponse; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/ticketing/fieldmapping/requests/CreateFieldMappingRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/fieldmapping/requests/CreateFieldMappingRequest.java new file mode 100644 index 000000000..77008f966 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/fieldmapping/requests/CreateFieldMappingRequest.java @@ -0,0 +1,337 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.fieldmapping.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.excludeRemoteFieldMetadata, + this.targetFieldName, + this.targetFieldDescription, + this.remoteFieldTraversalPath, + this.remoteMethod, + this.remoteUrlPath, + this.commonModelName); + } + + @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() {} + + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @Override + public _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.add(remoteFieldTraversalPath); + return this; + } + + @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. + */ + @Override + public _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); + return this; + } + + @Override + @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) + public _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + return this; + } + + @Override + public CreateFieldMappingRequest build() { + return new CreateFieldMappingRequest( + excludeRemoteFieldMetadata, + targetFieldName, + targetFieldDescription, + remoteFieldTraversalPath, + remoteMethod, + remoteUrlPath, + commonModelName, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/fieldmapping/requests/FieldMappingsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/fieldmapping/requests/FieldMappingsRetrieveRequest.java new file mode 100644 index 000000000..3f10715fd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/fieldmapping/requests/FieldMappingsRetrieveRequest.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.fieldmapping.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.excludeRemoteFieldMetadata); + } + + @Override + 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/legacy/api/resources/ticketing/fieldmapping/requests/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/fieldmapping/requests/PatchedEditFieldMappingRequest.java new file mode 100644 index 000000000..1fe8888b2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/fieldmapping/requests/PatchedEditFieldMappingRequest.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.fieldmapping.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath); + } + + @Override + 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/legacy/api/resources/ticketing/fieldmapping/requests/RemoteFieldsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/fieldmapping/requests/RemoteFieldsRetrieveRequest.java new file mode 100644 index 000000000..5a105c85a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/fieldmapping/requests/RemoteFieldsRetrieveRequest.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.fieldmapping.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.commonModels, this.includeExampleValues); + } + + @Override + 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/legacy/api/resources/ticketing/forceresync/ForceResyncClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/forceresync/ForceResyncClient.java new file mode 100644 index 000000000..cc0d121bd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/forceresync/ForceResyncClient.java @@ -0,0 +1,61 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.forceresync; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.types.SyncStatus; +import java.io.IOException; +import java.util.List; +import okhttp3.*; + +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/legacy/api/resources/ticketing/generatekey/GenerateKeyClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/generatekey/GenerateKeyClient.java new file mode 100644 index 000000000..6abc24508 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/generatekey/GenerateKeyClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.generatekey; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.generatekey.requests.GenerateRemoteKeyRequest; +import com.merge.legacy.api.resources.ticketing.types.RemoteKey; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ticketing/generatekey/requests/GenerateRemoteKeyRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/generatekey/requests/GenerateRemoteKeyRequest.java new file mode 100644 index 000000000..d06e87541 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/generatekey/requests/GenerateRemoteKeyRequest.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.generatekey.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + public GenerateRemoteKeyRequest build() { + return new GenerateRemoteKeyRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/issues/IssuesClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/issues/IssuesClient.java new file mode 100644 index 000000000..b748ef484 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/issues/IssuesClient.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.issues; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.issues.requests.IssuesListRequest; +import com.merge.legacy.api.resources.ticketing.types.Issue; +import com.merge.legacy.api.resources.ticketing.types.PaginatedIssueList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ticketing/issues/requests/IssuesListRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/issues/requests/IssuesListRequest.java new file mode 100644 index 000000000..1b20c1eef --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/issues/requests/IssuesListRequest.java @@ -0,0 +1,471 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.issues.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ticketing/issues/types/IssuesListRequestStatus.java b/src/main/java/com/merge/legacy/api/resources/ticketing/issues/types/IssuesListRequestStatus.java new file mode 100644 index 000000000..820ec7c57 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/issues/types/IssuesListRequestStatus.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/linkedaccounts/LinkedAccountsClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/linkedaccounts/LinkedAccountsClient.java new file mode 100644 index 000000000..844223811 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/linkedaccounts/LinkedAccountsClient.java @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.linkedaccounts; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.linkedaccounts.requests.LinkedAccountsListRequest; +import com.merge.legacy.api.resources.ticketing.types.PaginatedAccountDetailsAndActionsList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ticketing/linkedaccounts/requests/LinkedAccountsListRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/linkedaccounts/requests/LinkedAccountsListRequest.java new file mode 100644 index 000000000..1abbb322a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/linkedaccounts/requests/LinkedAccountsListRequest.java @@ -0,0 +1,452 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.linkedaccounts.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ticketing/linkedaccounts/types/LinkedAccountsListRequestCategory.java b/src/main/java/com/merge/legacy/api/resources/ticketing/linkedaccounts/types/LinkedAccountsListRequestCategory.java new file mode 100644 index 000000000..5866adc22 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/linkedaccounts/types/LinkedAccountsListRequestCategory.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/linktoken/LinkTokenClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/linktoken/LinkTokenClient.java new file mode 100644 index 000000000..a69a222c2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/linktoken/LinkTokenClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.linktoken; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.linktoken.requests.EndUserDetailsRequest; +import com.merge.legacy.api.resources.ticketing.types.LinkToken; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ticketing/linktoken/requests/EndUserDetailsRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/linktoken/requests/EndUserDetailsRequest.java new file mode 100644 index 000000000..9f27a286e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/linktoken/requests/EndUserDetailsRequest.java @@ -0,0 +1,600 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.linktoken.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ticketing.types.CategoriesEnum; +import com.merge.legacy.api.resources.ticketing.types.CommonModelScopesBodyRequest; +import com.merge.legacy.api.resources.ticketing.types.IndividualCommonModelScopeDeserializerRequest; +import com.merge.legacy.api.resources.ticketing.types.LanguageEnum; +import java.util.*; +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; + } + + @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); + } + + @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); + } + + @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() {} + + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @Override + public _FinalStage integrationSpecificConfig(Map integrationSpecificConfig) { + this.integrationSpecificConfig = Optional.ofNullable(integrationSpecificConfig); + return this; + } + + @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. + */ + @Override + public _FinalStage areSyncsDisabled(Boolean areSyncsDisabled) { + this.areSyncsDisabled = Optional.ofNullable(areSyncsDisabled); + return this; + } + + @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. + */ + @Override + public _FinalStage language(LanguageEnum language) { + this.language = Optional.ofNullable(language); + return this; + } + + @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. + */ + @Override + public _FinalStage categoryCommonModelScopes( + Map>> categoryCommonModelScopes) { + this.categoryCommonModelScopes = Optional.ofNullable(categoryCommonModelScopes); + return this; + } + + @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. + */ + @Override + public _FinalStage commonModels(List commonModels) { + this.commonModels = Optional.ofNullable(commonModels); + return this; + } + + @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. + */ + @Override + public _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink) { + this.hideAdminMagicLink = Optional.ofNullable(hideAdminMagicLink); + return this; + } + + @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. + */ + @Override + public _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl) { + this.shouldCreateMagicLinkUrl = Optional.ofNullable(shouldCreateMagicLinkUrl); + return this; + } + + @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. + */ + @Override + public _FinalStage linkExpiryMins(Integer linkExpiryMins) { + this.linkExpiryMins = Optional.ofNullable(linkExpiryMins); + return this; + } + + @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. + */ + @Override + public _FinalStage integration(String integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @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. + */ + @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. + */ + @Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + this.categories.addAll(categories); + return this; + } + + @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/legacy/api/resources/ticketing/passthrough/PassthroughClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/passthrough/PassthroughClient.java new file mode 100644 index 000000000..dd17a4043 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/passthrough/PassthroughClient.java @@ -0,0 +1,66 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.passthrough; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.types.DataPassthroughRequest; +import com.merge.legacy.api.resources.ticketing.types.RemoteResponse; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ticketing/projects/ProjectsClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/projects/ProjectsClient.java new file mode 100644 index 000000000..710583779 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/projects/ProjectsClient.java @@ -0,0 +1,231 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.projects; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.projects.requests.ProjectsListRequest; +import com.merge.legacy.api.resources.ticketing.projects.requests.ProjectsRetrieveRequest; +import com.merge.legacy.api.resources.ticketing.projects.requests.ProjectsUsersListRequest; +import com.merge.legacy.api.resources.ticketing.types.PaginatedProjectList; +import com.merge.legacy.api.resources.ticketing.types.PaginatedUserList; +import com.merge.legacy.api.resources.ticketing.types.Project; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ticketing/projects/requests/ProjectsListRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/projects/requests/ProjectsListRequest.java new file mode 100644 index 000000000..9e2413c1c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/projects/requests/ProjectsListRequest.java @@ -0,0 +1,359 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.projects.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = ProjectsListRequest.Builder.class) +public final class ProjectsListRequest { + 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 ProjectsListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ProjectsListRequest && equalTo((ProjectsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ProjectsListRequest 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); + } + + @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); + } + + @Override + 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(ProjectsListRequest 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 ProjectsListRequest build() { + return new ProjectsListRequest( + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/projects/requests/ProjectsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/projects/requests/ProjectsRetrieveRequest.java new file mode 100644 index 000000000..e55c7b7fe --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/projects/requests/ProjectsRetrieveRequest.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.projects.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/ticketing/projects/requests/ProjectsUsersListRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/projects/requests/ProjectsUsersListRequest.java new file mode 100644 index 000000000..2b85adba2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/projects/requests/ProjectsUsersListRequest.java @@ -0,0 +1,243 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.projects.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ticketing.projects.types.ProjectsUsersListRequestExpand; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@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 includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional pageSize; + + private final Map additionalProperties; + + private ProjectsUsersListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ProjectsUsersListRequest && equalTo((ProjectsUsersListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ProjectsUsersListRequest 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.pageSize); + } + + @Override + 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(ProjectsUsersListRequest 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(ProjectsUsersListRequestExpand 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 ProjectsUsersListRequest build() { + return new ProjectsUsersListRequest( + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/projects/types/ProjectsUsersListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/ticketing/projects/types/ProjectsUsersListRequestExpand.java new file mode 100644 index 000000000..a0d1a8535 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/projects/types/ProjectsUsersListRequestExpand.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/regeneratekey/RegenerateKeyClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/regeneratekey/RegenerateKeyClient.java new file mode 100644 index 000000000..ab99da195 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/regeneratekey/RegenerateKeyClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.regeneratekey; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.regeneratekey.requests.RemoteKeyForRegenerationRequest; +import com.merge.legacy.api.resources.ticketing.types.RemoteKey; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ticketing/regeneratekey/requests/RemoteKeyForRegenerationRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/regeneratekey/requests/RemoteKeyForRegenerationRequest.java new file mode 100644 index 000000000..9a91c3392 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/regeneratekey/requests/RemoteKeyForRegenerationRequest.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.regeneratekey.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + public RemoteKeyForRegenerationRequest build() { + return new RemoteKeyForRegenerationRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/roles/RolesClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/roles/RolesClient.java new file mode 100644 index 000000000..0aa06355e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/roles/RolesClient.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.roles; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.roles.requests.RolesListRequest; +import com.merge.legacy.api.resources.ticketing.roles.requests.RolesRetrieveRequest; +import com.merge.legacy.api.resources.ticketing.types.PaginatedRoleList; +import com.merge.legacy.api.resources.ticketing.types.Role; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ticketing/roles/requests/RolesListRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/roles/requests/RolesListRequest.java new file mode 100644 index 000000000..66486b4ca --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/roles/requests/RolesListRequest.java @@ -0,0 +1,359 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.roles.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = RolesListRequest.Builder.class) +public final class RolesListRequest { + 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 RolesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RolesListRequest && equalTo((RolesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RolesListRequest 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); + } + + @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); + } + + @Override + 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(RolesListRequest 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 RolesListRequest build() { + return new RolesListRequest( + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/roles/requests/RolesRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/roles/requests/RolesRetrieveRequest.java new file mode 100644 index 000000000..605b0d434 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/roles/requests/RolesRetrieveRequest.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.roles.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/ticketing/scopes/ScopesClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/scopes/ScopesClient.java new file mode 100644 index 000000000..0501e20d2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/scopes/ScopesClient.java @@ -0,0 +1,150 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.scopes; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.scopes.requests.LinkedAccountCommonModelScopeDeserializerRequest; +import com.merge.legacy.api.resources.ticketing.types.CommonModelScopeApi; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ticketing/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..3789b266f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.scopes.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ticketing.types.IndividualCommonModelScopeDeserializerRequest; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @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/legacy/api/resources/ticketing/syncstatus/SyncStatusClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/syncstatus/SyncStatusClient.java new file mode 100644 index 000000000..ac78026c4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/syncstatus/SyncStatusClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.syncstatus; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.syncstatus.requests.SyncStatusListRequest; +import com.merge.legacy.api.resources.ticketing.types.PaginatedSyncStatusList; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ticketing/syncstatus/requests/SyncStatusListRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/syncstatus/requests/SyncStatusListRequest.java new file mode 100644 index 000000000..d24a2cd79 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/syncstatus/requests/SyncStatusListRequest.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.syncstatus.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.cursor, this.pageSize); + } + + @Override + 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/legacy/api/resources/ticketing/tags/TagsClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/tags/TagsClient.java new file mode 100644 index 000000000..ff9d4c5eb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/tags/TagsClient.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.tags; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.tags.requests.TagsListRequest; +import com.merge.legacy.api.resources.ticketing.tags.requests.TagsRetrieveRequest; +import com.merge.legacy.api.resources.ticketing.types.PaginatedTagList; +import com.merge.legacy.api.resources.ticketing.types.Tag; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ticketing/tags/requests/TagsListRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/tags/requests/TagsListRequest.java new file mode 100644 index 000000000..f49e0838e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/tags/requests/TagsListRequest.java @@ -0,0 +1,359 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.tags.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ticketing/tags/requests/TagsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/tags/requests/TagsRetrieveRequest.java new file mode 100644 index 000000000..aa7c159ab --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/tags/requests/TagsRetrieveRequest.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.tags.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/ticketing/teams/TeamsClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/teams/TeamsClient.java new file mode 100644 index 000000000..735b97a5e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/teams/TeamsClient.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.teams; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.teams.requests.TeamsListRequest; +import com.merge.legacy.api.resources.ticketing.teams.requests.TeamsRetrieveRequest; +import com.merge.legacy.api.resources.ticketing.types.PaginatedTeamList; +import com.merge.legacy.api.resources.ticketing.types.Team; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ticketing/teams/requests/TeamsListRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/teams/requests/TeamsListRequest.java new file mode 100644 index 000000000..a5d209524 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/teams/requests/TeamsListRequest.java @@ -0,0 +1,359 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.teams.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ticketing/teams/requests/TeamsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/teams/requests/TeamsRetrieveRequest.java new file mode 100644 index 000000000..ebfacc558 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/teams/requests/TeamsRetrieveRequest.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.teams.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/ticketing/tickets/TicketsClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/TicketsClient.java new file mode 100644 index 000000000..28aa536ca --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/TicketsClient.java @@ -0,0 +1,597 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.tickets; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.tickets.requests.*; +import com.merge.legacy.api.resources.ticketing.types.*; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.*; + +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/legacy/api/resources/ticketing/tickets/requests/PatchedTicketEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/requests/PatchedTicketEndpointRequest.java new file mode 100644 index 000000000..5d5b2130a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/requests/PatchedTicketEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.tickets.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ticketing.types.PatchedTicketRequest; +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 = PatchedTicketEndpointRequest.Builder.class) +public final class PatchedTicketEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final PatchedTicketRequest model; + + private final Map additionalProperties; + + private PatchedTicketEndpointRequest( + Optional isDebugMode, + Optional runAsync, + PatchedTicketRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public PatchedTicketRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedTicketEndpointRequest && equalTo((PatchedTicketEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedTicketEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull PatchedTicketRequest model); + + Builder from(PatchedTicketEndpointRequest other); + } + + public interface _FinalStage { + PatchedTicketEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private PatchedTicketRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(PatchedTicketEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull PatchedTicketRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public PatchedTicketEndpointRequest build() { + return new PatchedTicketEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/requests/TicketEndpointRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/requests/TicketEndpointRequest.java new file mode 100644 index 000000000..c841167a1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/requests/TicketEndpointRequest.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.tickets.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ticketing.types.TicketRequest; +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 = TicketEndpointRequest.Builder.class) +public final class TicketEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final TicketRequest model; + + private final Map additionalProperties; + + private TicketEndpointRequest( + Optional isDebugMode, + Optional runAsync, + TicketRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public TicketRequest getModel() { + return model; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketEndpointRequest && equalTo((TicketEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TicketEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull TicketRequest model); + + Builder from(TicketEndpointRequest other); + } + + public interface _FinalStage { + TicketEndpointRequest build(); + + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private TicketRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(TicketEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull TicketRequest model) { + this.model = model; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

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

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + @Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @Override + public TicketEndpointRequest build() { + return new TicketEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/requests/TicketsListRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/requests/TicketsListRequest.java new file mode 100644 index 000000000..d2985aa31 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/requests/TicketsListRequest.java @@ -0,0 +1,1007 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.tickets.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ticketing.tickets.types.TicketsListRequestExpand; +import com.merge.legacy.api.resources.ticketing.tickets.types.TicketsListRequestPriority; +import com.merge.legacy.api.resources.ticketing.tickets.types.TicketsListRequestRemoteFields; +import com.merge.legacy.api.resources.ticketing.tickets.types.TicketsListRequestShowEnumOrigins; +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 = TicketsListRequest.Builder.class) +public final class TicketsListRequest { + private final Optional accountId; + + private final Optional assigneeIds; + + private final Optional collectionIds; + + private final Optional completedAfter; + + private final Optional completedBefore; + + private final Optional contactId; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional dueAfter; + + private final Optional dueBefore; + + 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 parentTicketId; + + private final Optional priority; + + private final Optional remoteCreatedAfter; + + private final Optional remoteCreatedBefore; + + private final Optional remoteFields; + + private final Optional remoteId; + + private final Optional remoteUpdatedAfter; + + private final Optional remoteUpdatedBefore; + + private final Optional showEnumOrigins; + + private final Optional status; + + private final Optional tags; + + private final Optional ticketType; + + private final Optional ticketUrl; + + private final Map additionalProperties; + + private TicketsListRequest( + Optional accountId, + Optional assigneeIds, + Optional collectionIds, + Optional completedAfter, + Optional completedBefore, + Optional contactId, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional dueAfter, + Optional dueBefore, + Optional expand, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional parentTicketId, + Optional priority, + Optional remoteCreatedAfter, + Optional remoteCreatedBefore, + Optional remoteFields, + Optional remoteId, + Optional remoteUpdatedAfter, + Optional remoteUpdatedBefore, + Optional showEnumOrigins, + Optional status, + Optional tags, + Optional ticketType, + Optional ticketUrl, + Map additionalProperties) { + this.accountId = accountId; + this.assigneeIds = assigneeIds; + this.collectionIds = collectionIds; + this.completedAfter = completedAfter; + this.completedBefore = completedBefore; + this.contactId = contactId; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.dueAfter = dueAfter; + this.dueBefore = dueBefore; + 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.parentTicketId = parentTicketId; + this.priority = priority; + this.remoteCreatedAfter = remoteCreatedAfter; + this.remoteCreatedBefore = remoteCreatedBefore; + this.remoteFields = remoteFields; + this.remoteId = remoteId; + this.remoteUpdatedAfter = remoteUpdatedAfter; + this.remoteUpdatedBefore = remoteUpdatedBefore; + this.showEnumOrigins = showEnumOrigins; + this.status = status; + this.tags = tags; + this.ticketType = ticketType; + this.ticketUrl = ticketUrl; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return tickets for this account. + */ + @JsonProperty("account_id") + public Optional getAccountId() { + return accountId; + } + + /** + * @return If provided, will only return tickets assigned to the assignee_ids; multiple assignee_ids can be separated by commas. + */ + @JsonProperty("assignee_ids") + public Optional getAssigneeIds() { + return assigneeIds; + } + + /** + * @return If provided, will only return tickets assigned to the collection_ids; multiple collection_ids can be separated by commas. + */ + @JsonProperty("collection_ids") + public Optional getCollectionIds() { + return collectionIds; + } + + /** + * @return If provided, will only return tickets completed after this datetime. + */ + @JsonProperty("completed_after") + public Optional getCompletedAfter() { + return completedAfter; + } + + /** + * @return If provided, will only return tickets completed before this datetime. + */ + @JsonProperty("completed_before") + public Optional getCompletedBefore() { + return completedBefore; + } + + /** + * @return If provided, will only return tickets for this contact. + */ + @JsonProperty("contact_id") + public Optional getContactId() { + return contactId; + } + + /** + * @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 tickets due after this datetime. + */ + @JsonProperty("due_after") + public Optional getDueAfter() { + return dueAfter; + } + + /** + * @return If provided, will only return tickets due before this datetime. + */ + @JsonProperty("due_before") + 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. + */ + @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 sub tickets of the parent_ticket_id. + */ + @JsonProperty("parent_ticket_id") + public Optional getParentTicketId() { + return parentTicketId; + } + + /** + * @return If provided, will only return tickets of this priority. + *
    + *
  • URGENT - URGENT
  • + *
  • HIGH - HIGH
  • + *
  • NORMAL - NORMAL
  • + *
  • LOW - LOW
  • + *
+ */ + @JsonProperty("priority") + public Optional getPriority() { + return priority; + } + + /** + * @return If provided, will only return tickets created in the third party platform after this datetime. + */ + @JsonProperty("remote_created_after") + public Optional getRemoteCreatedAfter() { + return remoteCreatedAfter; + } + + /** + * @return If provided, will only return tickets created in the third party platform before this datetime. + */ + @JsonProperty("remote_created_before") + public Optional getRemoteCreatedBefore() { + return remoteCreatedBefore; + } + + /** + * @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 If provided, will only return tickets updated in the third party platform after this datetime. + */ + @JsonProperty("remote_updated_after") + public Optional getRemoteUpdatedAfter() { + return remoteUpdatedAfter; + } + + /** + * @return If provided, will only return tickets updated in the third party platform before this datetime. + */ + @JsonProperty("remote_updated_before") + public Optional getRemoteUpdatedBefore() { + return remoteUpdatedBefore; + } + + /** + * @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 tickets of this status. + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return If provided, will only return tickets matching the tags; multiple tags can be separated by commas. + */ + @JsonProperty("tags") + public Optional getTags() { + return tags; + } + + /** + * @return If provided, will only return tickets of this type. + */ + @JsonProperty("ticket_type") + public Optional getTicketType() { + return ticketType; + } + + /** + * @return If provided, will only return tickets where the URL matches or contains the substring + */ + @JsonProperty("ticket_url") + public Optional getTicketUrl() { + return ticketUrl; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketsListRequest && equalTo((TicketsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TicketsListRequest other) { + return accountId.equals(other.accountId) + && assigneeIds.equals(other.assigneeIds) + && collectionIds.equals(other.collectionIds) + && completedAfter.equals(other.completedAfter) + && completedBefore.equals(other.completedBefore) + && contactId.equals(other.contactId) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && 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) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && parentTicketId.equals(other.parentTicketId) + && priority.equals(other.priority) + && remoteCreatedAfter.equals(other.remoteCreatedAfter) + && remoteCreatedBefore.equals(other.remoteCreatedBefore) + && remoteFields.equals(other.remoteFields) + && remoteId.equals(other.remoteId) + && remoteUpdatedAfter.equals(other.remoteUpdatedAfter) + && remoteUpdatedBefore.equals(other.remoteUpdatedBefore) + && showEnumOrigins.equals(other.showEnumOrigins) + && status.equals(other.status) + && tags.equals(other.tags) + && ticketType.equals(other.ticketType) + && ticketUrl.equals(other.ticketUrl); + } + + @Override + public int hashCode() { + return Objects.hash( + this.accountId, + this.assigneeIds, + this.collectionIds, + this.completedAfter, + this.completedBefore, + this.contactId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.dueAfter, + this.dueBefore, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.parentTicketId, + this.priority, + this.remoteCreatedAfter, + this.remoteCreatedBefore, + this.remoteFields, + this.remoteId, + this.remoteUpdatedAfter, + this.remoteUpdatedBefore, + this.showEnumOrigins, + this.status, + this.tags, + this.ticketType, + this.ticketUrl); + } + + @Override + 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 assigneeIds = Optional.empty(); + + private Optional collectionIds = Optional.empty(); + + private Optional completedAfter = Optional.empty(); + + private Optional completedBefore = Optional.empty(); + + private Optional contactId = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional dueAfter = Optional.empty(); + + private Optional dueBefore = 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 parentTicketId = Optional.empty(); + + private Optional priority = Optional.empty(); + + private Optional remoteCreatedAfter = Optional.empty(); + + private Optional remoteCreatedBefore = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional remoteUpdatedAfter = Optional.empty(); + + private Optional remoteUpdatedBefore = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional tags = Optional.empty(); + + private Optional ticketType = Optional.empty(); + + private Optional ticketUrl = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TicketsListRequest other) { + accountId(other.getAccountId()); + assigneeIds(other.getAssigneeIds()); + collectionIds(other.getCollectionIds()); + completedAfter(other.getCompletedAfter()); + completedBefore(other.getCompletedBefore()); + contactId(other.getContactId()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + dueAfter(other.getDueAfter()); + dueBefore(other.getDueBefore()); + expand(other.getExpand()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + parentTicketId(other.getParentTicketId()); + priority(other.getPriority()); + remoteCreatedAfter(other.getRemoteCreatedAfter()); + remoteCreatedBefore(other.getRemoteCreatedBefore()); + remoteFields(other.getRemoteFields()); + remoteId(other.getRemoteId()); + remoteUpdatedAfter(other.getRemoteUpdatedAfter()); + remoteUpdatedBefore(other.getRemoteUpdatedBefore()); + showEnumOrigins(other.getShowEnumOrigins()); + status(other.getStatus()); + tags(other.getTags()); + ticketType(other.getTicketType()); + ticketUrl(other.getTicketUrl()); + 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 = "assignee_ids", nulls = Nulls.SKIP) + public Builder assigneeIds(Optional assigneeIds) { + this.assigneeIds = assigneeIds; + return this; + } + + public Builder assigneeIds(String assigneeIds) { + this.assigneeIds = Optional.ofNullable(assigneeIds); + return this; + } + + @JsonSetter(value = "collection_ids", nulls = Nulls.SKIP) + public Builder collectionIds(Optional collectionIds) { + this.collectionIds = collectionIds; + return this; + } + + public Builder collectionIds(String collectionIds) { + this.collectionIds = Optional.ofNullable(collectionIds); + return this; + } + + @JsonSetter(value = "completed_after", nulls = Nulls.SKIP) + public Builder completedAfter(Optional completedAfter) { + this.completedAfter = completedAfter; + return this; + } + + public Builder completedAfter(OffsetDateTime completedAfter) { + this.completedAfter = Optional.ofNullable(completedAfter); + return this; + } + + @JsonSetter(value = "completed_before", nulls = Nulls.SKIP) + public Builder completedBefore(Optional completedBefore) { + this.completedBefore = completedBefore; + return this; + } + + public Builder completedBefore(OffsetDateTime completedBefore) { + this.completedBefore = Optional.ofNullable(completedBefore); + return this; + } + + @JsonSetter(value = "contact_id", nulls = Nulls.SKIP) + public Builder contactId(Optional contactId) { + this.contactId = contactId; + return this; + } + + public Builder contactId(String contactId) { + this.contactId = Optional.ofNullable(contactId); + 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 = "due_after", nulls = Nulls.SKIP) + public Builder dueAfter(Optional dueAfter) { + this.dueAfter = dueAfter; + return this; + } + + public Builder dueAfter(OffsetDateTime dueAfter) { + this.dueAfter = Optional.ofNullable(dueAfter); + return this; + } + + @JsonSetter(value = "due_before", nulls = Nulls.SKIP) + public Builder dueBefore(Optional dueBefore) { + this.dueBefore = dueBefore; + return this; + } + + public Builder dueBefore(OffsetDateTime dueBefore) { + this.dueBefore = Optional.ofNullable(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; + 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 = "parent_ticket_id", nulls = Nulls.SKIP) + public Builder parentTicketId(Optional parentTicketId) { + this.parentTicketId = parentTicketId; + return this; + } + + public Builder parentTicketId(String parentTicketId) { + this.parentTicketId = Optional.ofNullable(parentTicketId); + return this; + } + + @JsonSetter(value = "priority", nulls = Nulls.SKIP) + public Builder priority(Optional priority) { + this.priority = priority; + return this; + } + + public Builder priority(TicketsListRequestPriority priority) { + this.priority = Optional.ofNullable(priority); + 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_created_before", nulls = Nulls.SKIP) + public Builder remoteCreatedBefore(Optional remoteCreatedBefore) { + this.remoteCreatedBefore = remoteCreatedBefore; + return this; + } + + public Builder remoteCreatedBefore(OffsetDateTime remoteCreatedBefore) { + this.remoteCreatedBefore = Optional.ofNullable(remoteCreatedBefore); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(TicketsListRequestRemoteFields 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 = "remote_updated_after", nulls = Nulls.SKIP) + public Builder remoteUpdatedAfter(Optional remoteUpdatedAfter) { + this.remoteUpdatedAfter = remoteUpdatedAfter; + return this; + } + + public Builder remoteUpdatedAfter(OffsetDateTime remoteUpdatedAfter) { + this.remoteUpdatedAfter = Optional.ofNullable(remoteUpdatedAfter); + return this; + } + + @JsonSetter(value = "remote_updated_before", nulls = Nulls.SKIP) + public Builder remoteUpdatedBefore(Optional remoteUpdatedBefore) { + this.remoteUpdatedBefore = remoteUpdatedBefore; + return this; + } + + public Builder remoteUpdatedBefore(OffsetDateTime remoteUpdatedBefore) { + this.remoteUpdatedBefore = Optional.ofNullable(remoteUpdatedBefore); + return this; + } + + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(TicketsListRequestShowEnumOrigins 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; + } + + @JsonSetter(value = "tags", nulls = Nulls.SKIP) + public Builder tags(Optional tags) { + this.tags = tags; + return this; + } + + public Builder tags(String tags) { + this.tags = Optional.ofNullable(tags); + return this; + } + + @JsonSetter(value = "ticket_type", nulls = Nulls.SKIP) + public Builder ticketType(Optional ticketType) { + this.ticketType = ticketType; + return this; + } + + public Builder ticketType(String ticketType) { + this.ticketType = Optional.ofNullable(ticketType); + return this; + } + + @JsonSetter(value = "ticket_url", nulls = Nulls.SKIP) + public Builder ticketUrl(Optional ticketUrl) { + this.ticketUrl = ticketUrl; + return this; + } + + public Builder ticketUrl(String ticketUrl) { + this.ticketUrl = Optional.ofNullable(ticketUrl); + return this; + } + + public TicketsListRequest build() { + return new TicketsListRequest( + accountId, + assigneeIds, + collectionIds, + completedAfter, + completedBefore, + contactId, + createdAfter, + createdBefore, + cursor, + dueAfter, + dueBefore, + expand, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + parentTicketId, + priority, + remoteCreatedAfter, + remoteCreatedBefore, + remoteFields, + remoteId, + remoteUpdatedAfter, + remoteUpdatedBefore, + showEnumOrigins, + status, + tags, + ticketType, + ticketUrl, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/requests/TicketsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/requests/TicketsRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..1234fd0df --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/requests/TicketsRemoteFieldClassesListRequest.java @@ -0,0 +1,243 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.tickets.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = TicketsRemoteFieldClassesListRequest.Builder.class) +public final class TicketsRemoteFieldClassesListRequest { + 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 TicketsRemoteFieldClassesListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketsRemoteFieldClassesListRequest + && equalTo((TicketsRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TicketsRemoteFieldClassesListRequest 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @Override + 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(TicketsRemoteFieldClassesListRequest 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 TicketsRemoteFieldClassesListRequest build() { + return new TicketsRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + isCommonModelField, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/requests/TicketsRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/requests/TicketsRetrieveRequest.java new file mode 100644 index 000000000..962014d16 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/requests/TicketsRetrieveRequest.java @@ -0,0 +1,212 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.tickets.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ticketing.tickets.types.TicketsRetrieveRequestExpand; +import com.merge.legacy.api.resources.ticketing.tickets.types.TicketsRetrieveRequestRemoteFields; +import com.merge.legacy.api.resources.ticketing.tickets.types.TicketsRetrieveRequestShowEnumOrigins; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TicketsRetrieveRequest.Builder.class) +public final class TicketsRetrieveRequest { + 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 TicketsRetrieveRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketsRetrieveRequest && equalTo((TicketsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TicketsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @Override + public int hashCode() { + return Objects.hash( + this.expand, this.includeRemoteData, this.includeRemoteFields, this.remoteFields, this.showEnumOrigins); + } + + @Override + 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(TicketsRetrieveRequest 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(TicketsRetrieveRequestExpand 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(TicketsRetrieveRequestRemoteFields 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(TicketsRetrieveRequestShowEnumOrigins showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public TicketsRetrieveRequest build() { + return new TicketsRetrieveRequest( + expand, + includeRemoteData, + includeRemoteFields, + remoteFields, + showEnumOrigins, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/requests/TicketsViewersListRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/requests/TicketsViewersListRequest.java new file mode 100644 index 000000000..4e256adeb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/requests/TicketsViewersListRequest.java @@ -0,0 +1,243 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.tickets.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.api.resources.ticketing.tickets.types.TicketsViewersListRequestExpand; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@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 includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional pageSize; + + private final Map additionalProperties; + + private TicketsViewersListRequest( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketsViewersListRequest && equalTo((TicketsViewersListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TicketsViewersListRequest 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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.expand, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.pageSize); + } + + @Override + 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(TicketsViewersListRequest 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(TicketsViewersListRequestExpand 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 TicketsViewersListRequest build() { + return new TicketsViewersListRequest( + cursor, + expand, + includeDeletedData, + includeRemoteData, + includeShellData, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/types/TicketsListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/types/TicketsListRequestExpand.java new file mode 100644 index 000000000..2f826172e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/types/TicketsListRequestExpand.java @@ -0,0 +1,586 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/types/TicketsListRequestPriority.java b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/types/TicketsListRequestPriority.java new file mode 100644 index 000000000..7c2cb44da --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/types/TicketsListRequestPriority.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.tickets.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TicketsListRequestPriority { + HIGH("HIGH"), + + LOW("LOW"), + + NORMAL("NORMAL"), + + URGENT("URGENT"); + + private final String value; + + TicketsListRequestPriority(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/types/TicketsListRequestRemoteFields.java b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/types/TicketsListRequestRemoteFields.java new file mode 100644 index 000000000..1902800ab --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/types/TicketsListRequestRemoteFields.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.tickets.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TicketsListRequestRemoteFields { + PRIORITY("priority"), + + PRIORITY_STATUS("priority,status"), + + PRIORITY_STATUS_TICKET_TYPE("priority,status,ticket_type"), + + PRIORITY_TICKET_TYPE("priority,ticket_type"), + + STATUS("status"), + + STATUS_TICKET_TYPE("status,ticket_type"), + + TICKET_TYPE("ticket_type"); + + private final String value; + + TicketsListRequestRemoteFields(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/types/TicketsListRequestShowEnumOrigins.java b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/types/TicketsListRequestShowEnumOrigins.java new file mode 100644 index 000000000..1bf2fd0b3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/types/TicketsListRequestShowEnumOrigins.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.tickets.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TicketsListRequestShowEnumOrigins { + PRIORITY("priority"), + + PRIORITY_STATUS("priority,status"), + + PRIORITY_STATUS_TICKET_TYPE("priority,status,ticket_type"), + + PRIORITY_TICKET_TYPE("priority,ticket_type"), + + STATUS("status"), + + STATUS_TICKET_TYPE("status,ticket_type"), + + TICKET_TYPE("ticket_type"); + + private final String value; + + TicketsListRequestShowEnumOrigins(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/types/TicketsRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/types/TicketsRetrieveRequestExpand.java new file mode 100644 index 000000000..8d050cd05 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/types/TicketsRetrieveRequestExpand.java @@ -0,0 +1,586 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/types/TicketsRetrieveRequestRemoteFields.java b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/types/TicketsRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..3db31d7d0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/types/TicketsRetrieveRequestRemoteFields.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.tickets.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TicketsRetrieveRequestRemoteFields { + PRIORITY("priority"), + + PRIORITY_STATUS("priority,status"), + + PRIORITY_STATUS_TICKET_TYPE("priority,status,ticket_type"), + + PRIORITY_TICKET_TYPE("priority,ticket_type"), + + STATUS("status"), + + STATUS_TICKET_TYPE("status,ticket_type"), + + TICKET_TYPE("ticket_type"); + + private final String value; + + TicketsRetrieveRequestRemoteFields(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/types/TicketsRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/types/TicketsRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..4704f67fe --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/types/TicketsRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.tickets.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TicketsRetrieveRequestShowEnumOrigins { + PRIORITY("priority"), + + PRIORITY_STATUS("priority,status"), + + PRIORITY_STATUS_TICKET_TYPE("priority,status,ticket_type"), + + PRIORITY_TICKET_TYPE("priority,ticket_type"), + + STATUS("status"), + + STATUS_TICKET_TYPE("status,ticket_type"), + + TICKET_TYPE("ticket_type"); + + private final String value; + + TicketsRetrieveRequestShowEnumOrigins(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/types/TicketsViewersListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/types/TicketsViewersListRequestExpand.java new file mode 100644 index 000000000..881e0f8e2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/tickets/types/TicketsViewersListRequestExpand.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/AccessLevelEnum.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AccessLevelEnum.java new file mode 100644 index 000000000..89b57302e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AccessLevelEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AccessLevelEnum { + PRIVATE("PRIVATE"), + + COMPANY("COMPANY"), + + PUBLIC("PUBLIC"); + + private final String value; + + AccessLevelEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/Account.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/Account.java new file mode 100644 index 000000000..96b532690 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/Account.java @@ -0,0 +1,319 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ticketing/types/AccountDetails.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AccountDetails.java new file mode 100644 index 000000000..8512927fa --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AccountDetails.java @@ -0,0 +1,387 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ticketing/types/AccountDetailsAndActions.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AccountDetailsAndActions.java new file mode 100644 index 000000000..2bad252d3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AccountDetailsAndActions.java @@ -0,0 +1,474 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("id") + public StatusStage id(@NotNull String id) { + this.id = id; + return this; + } + + @Override + @JsonSetter("status") + public EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status) { + this.status = status; + return this; + } + + @Override + @JsonSetter("end_user_organization_name") + public EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + @Override + @JsonSetter("end_user_email_address") + public WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + @Override + @JsonSetter("webhook_listener_url") + public AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl) { + this.webhookListenerUrl = webhookListenerUrl; + return this; + } + + @Override + @JsonSetter("account_type") + public CompletedAtStage accountType(@NotNull String accountType) { + this.accountType = accountType; + return this; + } + + @Override + @JsonSetter("completed_at") + public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { + this.completedAt = completedAt; + return this; + } + + @Override + public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @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. + */ + @Override + public _FinalStage isDuplicate(Boolean isDuplicate) { + this.isDuplicate = Optional.ofNullable(isDuplicate); + return this; + } + + @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. + */ + @Override + public _FinalStage subdomain(String subdomain) { + this.subdomain = Optional.ofNullable(subdomain); + return this; + } + + @Override + @JsonSetter(value = "subdomain", nulls = Nulls.SKIP) + public _FinalStage subdomain(Optional subdomain) { + this.subdomain = subdomain; + return this; + } + + @Override + public _FinalStage endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @Override + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public _FinalStage endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + @Override + public _FinalStage statusDetail(String statusDetail) { + this.statusDetail = Optional.ofNullable(statusDetail); + return this; + } + + @Override + @JsonSetter(value = "status_detail", nulls = Nulls.SKIP) + public _FinalStage statusDetail(Optional statusDetail) { + this.statusDetail = statusDetail; + return this; + } + + @Override + public _FinalStage category(CategoryEnum category) { + this.category = Optional.ofNullable(category); + return this; + } + + @Override + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public _FinalStage category(Optional category) { + this.category = category; + return this; + } + + @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/legacy/api/resources/ticketing/types/AccountDetailsAndActionsIntegration.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AccountDetailsAndActionsIntegration.java new file mode 100644 index 000000000..cdf77c629 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AccountDetailsAndActionsIntegration.java @@ -0,0 +1,317 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.categories, + this.image, + this.squareImage, + this.color, + this.slug, + this.passthroughAvailable, + this.availableModelOperations); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("name") + public ColorStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + @JsonSetter("color") + public SlugStage color(@NotNull String color) { + this.color = color; + return this; + } + + @Override + @JsonSetter("slug") + public PassthroughAvailableStage slug(@NotNull String slug) { + this.slug = slug; + return this; + } + + @Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @Override + @JsonSetter(value = "square_image", nulls = Nulls.SKIP) + public _FinalStage squareImage(Optional squareImage) { + this.squareImage = squareImage; + return this; + } + + @Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @Override + @JsonSetter(value = "image", nulls = Nulls.SKIP) + public _FinalStage image(Optional image) { + this.image = image; + return this; + } + + @Override + public _FinalStage addAllCategories(List categories) { + this.categories.addAll(categories); + return this; + } + + @Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + this.categories.addAll(categories); + return this; + } + + @Override + public AccountDetailsAndActionsIntegration build() { + return new AccountDetailsAndActionsIntegration( + name, + categories, + image, + squareImage, + color, + slug, + passthroughAvailable, + availableModelOperations, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/AccountDetailsAndActionsStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AccountDetailsAndActionsStatusEnum.java new file mode 100644 index 000000000..ebc7fd663 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AccountDetailsAndActionsStatusEnum.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/AccountIntegration.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AccountIntegration.java new file mode 100644 index 000000000..909b80a6f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AccountIntegration.java @@ -0,0 +1,453 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @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); + } + + @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() {} + + @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. + */ + @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. + */ + @Override + public _FinalStage categoryBetaStatus(Map categoryBetaStatus) { + this.categoryBetaStatus = Optional.ofNullable(categoryBetaStatus); + return this; + } + + @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. + */ + @Override + public _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl) { + this.webhookSetupGuideUrl = Optional.ofNullable(webhookSetupGuideUrl); + return this; + } + + @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. + */ + @Override + public _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = Optional.ofNullable(apiEndpointsToDocumentationUrls); + return this; + } + + @Override + @JsonSetter(value = "api_endpoints_to_documentation_urls", nulls = Nulls.SKIP) + public _FinalStage apiEndpointsToDocumentationUrls( + Optional> apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; + return this; + } + + @Override + public _FinalStage slug(String slug) { + this.slug = Optional.ofNullable(slug); + return this; + } + + @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. + */ + @Override + public _FinalStage color(String color) { + this.color = Optional.ofNullable(color); + return this; + } + + @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. + */ + @Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @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. + */ + @Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @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. + */ + @Override + public _FinalStage categories(List categories) { + this.categories = Optional.ofNullable(categories); + return this; + } + + @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. + */ + @Override + public _FinalStage abbreviatedName(String abbreviatedName) { + this.abbreviatedName = Optional.ofNullable(abbreviatedName); + return this; + } + + @Override + @JsonSetter(value = "abbreviated_name", nulls = Nulls.SKIP) + public _FinalStage abbreviatedName(Optional abbreviatedName) { + this.abbreviatedName = abbreviatedName; + return this; + } + + @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/legacy/api/resources/ticketing/types/AccountToken.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AccountToken.java new file mode 100644 index 000000000..fb2337695 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AccountToken.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.accountToken, this.integration); + } + + @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() {} + + @Override + public Builder from(AccountToken other) { + accountToken(other.getAccountToken()); + integration(other.getIntegration()); + return this; + } + + @Override + @JsonSetter("account_token") + public IntegrationStage accountToken(@NotNull String accountToken) { + this.accountToken = accountToken; + return this; + } + + @Override + @JsonSetter("integration") + public _FinalStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @Override + public AccountToken build() { + return new AccountToken(accountToken, integration, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/AdvancedMetadata.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AdvancedMetadata.java new file mode 100644 index 000000000..f6c632d2d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AdvancedMetadata.java @@ -0,0 +1,250 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, this.displayName, this.description, this.isRequired, this.isCustom, this.fieldChoices); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = id; + return this; + } + + @Override + public _FinalStage fieldChoices(List fieldChoices) { + this.fieldChoices = Optional.ofNullable(fieldChoices); + return this; + } + + @Override + @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) + public _FinalStage fieldChoices(Optional> fieldChoices) { + this.fieldChoices = fieldChoices; + return this; + } + + @Override + public _FinalStage isCustom(Boolean isCustom) { + this.isCustom = Optional.ofNullable(isCustom); + return this; + } + + @Override + @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) + public _FinalStage isCustom(Optional isCustom) { + this.isCustom = isCustom; + return this; + } + + @Override + public _FinalStage isRequired(Boolean isRequired) { + this.isRequired = Optional.ofNullable(isRequired); + return this; + } + + @Override + @JsonSetter(value = "is_required", nulls = Nulls.SKIP) + public _FinalStage isRequired(Optional isRequired) { + this.isRequired = isRequired; + return this; + } + + @Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + @Override + public _FinalStage displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @Override + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public _FinalStage displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + @Override + public AdvancedMetadata build() { + return new AdvancedMetadata( + id, displayName, description, isRequired, isCustom, fieldChoices, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/AsyncPassthroughReciept.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AsyncPassthroughReciept.java new file mode 100644 index 000000000..c695c4b3a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AsyncPassthroughReciept.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.asyncPassthroughReceiptId); + } + + @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() {} + + @Override + public Builder from(AsyncPassthroughReciept other) { + asyncPassthroughReceiptId(other.getAsyncPassthroughReceiptId()); + return this; + } + + @Override + @JsonSetter("async_passthrough_receipt_id") + public _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId) { + this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; + return this; + } + + @Override + public AsyncPassthroughReciept build() { + return new AsyncPassthroughReciept(asyncPassthroughReceiptId, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/Attachment.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/Attachment.java new file mode 100644 index 000000000..463044496 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/Attachment.java @@ -0,0 +1,435 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ticketing/types/AttachmentRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AttachmentRequest.java new file mode 100644 index 000000000..045173fbd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AttachmentRequest.java @@ -0,0 +1,266 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.fileName, + this.ticket, + this.fileUrl, + this.contentType, + this.uploadedBy, + this.integrationParams, + this.linkedAccountParams); + } + + @Override + 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/legacy/api/resources/ticketing/types/AttachmentRequestTicket.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AttachmentRequestTicket.java new file mode 100644 index 000000000..431846772 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AttachmentRequestTicket.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AttachmentRequestTicket.Deserializer.class) +public final class AttachmentRequestTicket { + private final Object value; + + private final int type; + + private AttachmentRequestTicket(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((Ticket) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttachmentRequestTicket && equalTo((AttachmentRequestTicket) other); + } + + private boolean equalTo(AttachmentRequestTicket other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static AttachmentRequestTicket of(String value) { + return new AttachmentRequestTicket(value, 0); + } + + public static AttachmentRequestTicket of(Ticket value) { + return new AttachmentRequestTicket(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Ticket value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AttachmentRequestTicket.class); + } + + @Override + public AttachmentRequestTicket 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, Ticket.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/AttachmentTicket.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AttachmentTicket.java new file mode 100644 index 000000000..ca280d34e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AttachmentTicket.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AttachmentTicket.Deserializer.class) +public final class AttachmentTicket { + private final Object value; + + private final int type; + + private AttachmentTicket(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((Ticket) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttachmentTicket && equalTo((AttachmentTicket) other); + } + + private boolean equalTo(AttachmentTicket other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static AttachmentTicket of(String value) { + return new AttachmentTicket(value, 0); + } + + public static AttachmentTicket of(Ticket value) { + return new AttachmentTicket(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Ticket value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AttachmentTicket.class); + } + + @Override + public AttachmentTicket 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, Ticket.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/AuditLogEvent.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AuditLogEvent.java new file mode 100644 index 000000000..82756020d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AuditLogEvent.java @@ -0,0 +1,441 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.userName, + this.userEmail, + this.role, + this.ipAddress, + this.eventType, + this.eventDescription, + this.createdAt); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("role") + public IpAddressStage role(@NotNull AuditLogEventRole role) { + this.role = role; + return this; + } + + @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. + */ + @Override + @JsonSetter("event_type") + public EventDescriptionStage eventType(@NotNull AuditLogEventEventType eventType) { + this.eventType = eventType; + return this; + } + + @Override + @JsonSetter("event_description") + public _FinalStage eventDescription(@NotNull String eventDescription) { + this.eventDescription = eventDescription; + return this; + } + + @Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @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. + */ + @Override + public _FinalStage userEmail(String userEmail) { + this.userEmail = Optional.ofNullable(userEmail); + return this; + } + + @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. + */ + @Override + public _FinalStage userName(String userName) { + this.userName = Optional.ofNullable(userName); + return this; + } + + @Override + @JsonSetter(value = "user_name", nulls = Nulls.SKIP) + public _FinalStage userName(Optional userName) { + this.userName = userName; + return this; + } + + @Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @Override + public AuditLogEvent build() { + return new AuditLogEvent( + id, + userName, + userEmail, + role, + ipAddress, + eventType, + eventDescription, + createdAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/AuditLogEventEventType.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AuditLogEventEventType.java new file mode 100644 index 000000000..fdafb13d9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AuditLogEventEventType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ticketing/types/AuditLogEventRole.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AuditLogEventRole.java new file mode 100644 index 000000000..ac02f8d6a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AuditLogEventRole.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ticketing/types/AvailableActions.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AvailableActions.java new file mode 100644 index 000000000..25b071902 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/AvailableActions.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.integration, this.passthroughAvailable, this.availableModelOperations); + } + + @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() {} + + @Override + public Builder from(AvailableActions other) { + integration(other.getIntegration()); + passthroughAvailable(other.getPassthroughAvailable()); + availableModelOperations(other.getAvailableModelOperations()); + return this; + } + + @Override + @JsonSetter("integration") + public PassthroughAvailableStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @Override + public AvailableActions build() { + return new AvailableActions( + integration, passthroughAvailable, availableModelOperations, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/CategoriesEnum.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CategoriesEnum.java new file mode 100644 index 000000000..42f5abaa5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CategoriesEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/CategoryEnum.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CategoryEnum.java new file mode 100644 index 000000000..6b45a93a2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CategoryEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/Collection.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/Collection.java new file mode 100644 index 000000000..0da5819b0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/Collection.java @@ -0,0 +1,441 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Collection.Builder.class) +public final class Collection { + 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 collectionType; + + private final Optional parentCollection; + + private final Optional>> teams; + + private final Optional remoteWasDeleted; + + private final Optional accessLevel; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Collection( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional description, + Optional collectionType, + Optional parentCollection, + Optional>> teams, + Optional remoteWasDeleted, + Optional accessLevel, + 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.collectionType = collectionType; + this.parentCollection = parentCollection; + this.teams = teams; + this.remoteWasDeleted = remoteWasDeleted; + this.accessLevel = accessLevel; + 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 collection's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The collection's description. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The collection's type. + *
    + *
  • LIST - LIST
  • + *
  • PROJECT - PROJECT
  • + *
+ */ + @JsonProperty("collection_type") + public Optional getCollectionType() { + return collectionType; + } + + /** + * @return The parent collection for this collection. + */ + @JsonProperty("parent_collection") + 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. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + /** + * @return The level of access a User has to the Collection and its sub-objects. + *
    + *
  • PRIVATE - PRIVATE
  • + *
  • COMPANY - COMPANY
  • + *
  • PUBLIC - PUBLIC
  • + *
+ */ + @JsonProperty("access_level") + public Optional getAccessLevel() { + return accessLevel; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Collection && equalTo((Collection) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Collection 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) + && collectionType.equals(other.collectionType) + && parentCollection.equals(other.parentCollection) + && teams.equals(other.teams) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && accessLevel.equals(other.accessLevel) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.description, + this.collectionType, + this.parentCollection, + this.teams, + this.remoteWasDeleted, + this.accessLevel, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 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> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Collection other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + description(other.getDescription()); + collectionType(other.getCollectionType()); + parentCollection(other.getParentCollection()); + teams(other.getTeams()); + remoteWasDeleted(other.getRemoteWasDeleted()); + accessLevel(other.getAccessLevel()); + 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 = "collection_type", nulls = Nulls.SKIP) + public Builder collectionType(Optional collectionType) { + this.collectionType = collectionType; + return this; + } + + public Builder collectionType(CollectionCollectionType collectionType) { + this.collectionType = Optional.ofNullable(collectionType); + return this; + } + + @JsonSetter(value = "parent_collection", nulls = Nulls.SKIP) + public Builder parentCollection(Optional parentCollection) { + this.parentCollection = parentCollection; + return this; + } + + public Builder parentCollection(CollectionParentCollection parentCollection) { + this.parentCollection = Optional.ofNullable(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; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "access_level", nulls = Nulls.SKIP) + public Builder accessLevel(Optional accessLevel) { + this.accessLevel = accessLevel; + return this; + } + + public Builder accessLevel(CollectionAccessLevel accessLevel) { + this.accessLevel = Optional.ofNullable(accessLevel); + 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 Collection build() { + return new Collection( + id, + remoteId, + createdAt, + modifiedAt, + name, + description, + collectionType, + parentCollection, + teams, + remoteWasDeleted, + accessLevel, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/CollectionAccessLevel.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CollectionAccessLevel.java new file mode 100644 index 000000000..8f41229f1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CollectionAccessLevel.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ticketing/types/CollectionCollectionType.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CollectionCollectionType.java new file mode 100644 index 000000000..2a29ba865 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CollectionCollectionType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ticketing/types/CollectionParentCollection.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CollectionParentCollection.java new file mode 100644 index 000000000..ca3bc45b2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CollectionParentCollection.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CollectionParentCollection.Deserializer.class) +public final class CollectionParentCollection { + private final Object value; + + private final int type; + + private CollectionParentCollection(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((Collection) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CollectionParentCollection && equalTo((CollectionParentCollection) other); + } + + private boolean equalTo(CollectionParentCollection other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CollectionParentCollection of(String value) { + return new CollectionParentCollection(value, 0); + } + + public static CollectionParentCollection of(Collection value) { + return new CollectionParentCollection(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Collection value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CollectionParentCollection.class); + } + + @Override + public CollectionParentCollection 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, Collection.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/CollectionTeamsItem.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CollectionTeamsItem.java new file mode 100644 index 000000000..45e3da951 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CollectionTeamsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ticketing/types/CollectionTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CollectionTypeEnum.java new file mode 100644 index 000000000..05b785919 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CollectionTypeEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CollectionTypeEnum { + LIST("LIST"), + + PROJECT("PROJECT"); + + private final String value; + + CollectionTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/Comment.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/Comment.java new file mode 100644 index 000000000..bb4d80b53 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/Comment.java @@ -0,0 +1,464 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Comment.Builder.class) +public final class Comment { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional user; + + private final Optional contact; + + private final Optional body; + + private final Optional htmlBody; + + private final Optional ticket; + + private final Optional isPrivate; + + private final Optional remoteCreatedAt; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Comment( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional user, + Optional contact, + Optional body, + Optional htmlBody, + Optional ticket, + Optional isPrivate, + Optional remoteCreatedAt, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.user = user; + this.contact = contact; + this.body = body; + this.htmlBody = htmlBody; + this.ticket = ticket; + this.isPrivate = isPrivate; + 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 author of the Comment, if the author is a User. If the third party does not support specifying an author, we will append "[Posted on behalf of {name}]" to the comment. + */ + @JsonProperty("user") + public Optional getUser() { + return user; + } + + /** + * @return The author of the Comment, if the author is a Contact.If the third party does not support specifying an author, we will append "[Posted on behalf of {name}]" to the comment. + */ + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + + /** + * @return The comment's text body. + */ + @JsonProperty("body") + public Optional getBody() { + return body; + } + + /** + * @return The comment's text body formatted as html. + */ + @JsonProperty("html_body") + public Optional getHtmlBody() { + return htmlBody; + } + + /** + * @return The ticket associated with the comment. + */ + @JsonProperty("ticket") + public Optional getTicket() { + return ticket; + } + + /** + * @return Whether or not the comment is internal. + */ + @JsonProperty("is_private") + public Optional getIsPrivate() { + return isPrivate; + } + + /** + * @return When the third party's comment 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Comment && equalTo((Comment) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Comment other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && user.equals(other.user) + && contact.equals(other.contact) + && body.equals(other.body) + && htmlBody.equals(other.htmlBody) + && ticket.equals(other.ticket) + && isPrivate.equals(other.isPrivate) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.user, + this.contact, + this.body, + this.htmlBody, + this.ticket, + this.isPrivate, + this.remoteCreatedAt, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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 user = Optional.empty(); + + private Optional contact = Optional.empty(); + + private Optional body = Optional.empty(); + + private Optional htmlBody = Optional.empty(); + + private Optional ticket = Optional.empty(); + + private Optional isPrivate = 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(Comment other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + user(other.getUser()); + contact(other.getContact()); + body(other.getBody()); + htmlBody(other.getHtmlBody()); + ticket(other.getTicket()); + isPrivate(other.getIsPrivate()); + 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 = "user", nulls = Nulls.SKIP) + public Builder user(Optional user) { + this.user = user; + return this; + } + + public Builder user(CommentUser user) { + this.user = Optional.ofNullable(user); + return this; + } + + @JsonSetter(value = "contact", nulls = Nulls.SKIP) + public Builder contact(Optional contact) { + this.contact = contact; + return this; + } + + public Builder contact(CommentContact contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "body", nulls = Nulls.SKIP) + public Builder body(Optional body) { + this.body = body; + return this; + } + + public Builder body(String body) { + this.body = Optional.ofNullable(body); + return this; + } + + @JsonSetter(value = "html_body", nulls = Nulls.SKIP) + public Builder htmlBody(Optional htmlBody) { + this.htmlBody = htmlBody; + return this; + } + + public Builder htmlBody(String htmlBody) { + this.htmlBody = Optional.ofNullable(htmlBody); + return this; + } + + @JsonSetter(value = "ticket", nulls = Nulls.SKIP) + public Builder ticket(Optional ticket) { + this.ticket = ticket; + return this; + } + + public Builder ticket(CommentTicket ticket) { + this.ticket = Optional.ofNullable(ticket); + return this; + } + + @JsonSetter(value = "is_private", nulls = Nulls.SKIP) + public Builder isPrivate(Optional isPrivate) { + this.isPrivate = isPrivate; + return this; + } + + public Builder isPrivate(Boolean isPrivate) { + this.isPrivate = Optional.ofNullable(isPrivate); + 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 Comment build() { + return new Comment( + id, + remoteId, + createdAt, + modifiedAt, + user, + contact, + body, + htmlBody, + ticket, + isPrivate, + remoteCreatedAt, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommentContact.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommentContact.java new file mode 100644 index 000000000..009d2f9cb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommentContact.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CommentContact.Deserializer.class) +public final class CommentContact { + private final Object value; + + private final int type; + + private CommentContact(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommentContact && equalTo((CommentContact) other); + } + + private boolean equalTo(CommentContact other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CommentContact of(String value) { + return new CommentContact(value, 0); + } + + public static CommentContact of(Contact value) { + return new CommentContact(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CommentContact.class); + } + + @Override + public CommentContact 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommentRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommentRequest.java new file mode 100644 index 000000000..7096cc5e8 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommentRequest.java @@ -0,0 +1,295 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = CommentRequest.Builder.class) +public final class CommentRequest { + private final Optional user; + + private final Optional contact; + + private final Optional body; + + private final Optional htmlBody; + + private final Optional ticket; + + private final Optional isPrivate; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private CommentRequest( + Optional user, + Optional contact, + Optional body, + Optional htmlBody, + Optional ticket, + Optional isPrivate, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.user = user; + this.contact = contact; + this.body = body; + this.htmlBody = htmlBody; + this.ticket = ticket; + this.isPrivate = isPrivate; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The author of the Comment, if the author is a User. If the third party does not support specifying an author, we will append "[Posted on behalf of {name}]" to the comment. + */ + @JsonProperty("user") + public Optional getUser() { + return user; + } + + /** + * @return The author of the Comment, if the author is a Contact.If the third party does not support specifying an author, we will append "[Posted on behalf of {name}]" to the comment. + */ + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + + /** + * @return The comment's text body. + */ + @JsonProperty("body") + public Optional getBody() { + return body; + } + + /** + * @return The comment's text body formatted as html. + */ + @JsonProperty("html_body") + public Optional getHtmlBody() { + return htmlBody; + } + + /** + * @return The ticket associated with the comment. + */ + @JsonProperty("ticket") + public Optional getTicket() { + return ticket; + } + + /** + * @return Whether or not the comment is internal. + */ + @JsonProperty("is_private") + public Optional getIsPrivate() { + return isPrivate; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommentRequest && equalTo((CommentRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CommentRequest other) { + return user.equals(other.user) + && contact.equals(other.contact) + && body.equals(other.body) + && htmlBody.equals(other.htmlBody) + && ticket.equals(other.ticket) + && isPrivate.equals(other.isPrivate) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @Override + public int hashCode() { + return Objects.hash( + this.user, + this.contact, + this.body, + this.htmlBody, + this.ticket, + this.isPrivate, + this.integrationParams, + this.linkedAccountParams); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional user = Optional.empty(); + + private Optional contact = Optional.empty(); + + private Optional body = Optional.empty(); + + private Optional htmlBody = Optional.empty(); + + private Optional ticket = Optional.empty(); + + private Optional isPrivate = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CommentRequest other) { + user(other.getUser()); + contact(other.getContact()); + body(other.getBody()); + htmlBody(other.getHtmlBody()); + ticket(other.getTicket()); + isPrivate(other.getIsPrivate()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + return this; + } + + @JsonSetter(value = "user", nulls = Nulls.SKIP) + public Builder user(Optional user) { + this.user = user; + return this; + } + + public Builder user(CommentRequestUser user) { + this.user = Optional.ofNullable(user); + return this; + } + + @JsonSetter(value = "contact", nulls = Nulls.SKIP) + public Builder contact(Optional contact) { + this.contact = contact; + return this; + } + + public Builder contact(CommentRequestContact contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "body", nulls = Nulls.SKIP) + public Builder body(Optional body) { + this.body = body; + return this; + } + + public Builder body(String body) { + this.body = Optional.ofNullable(body); + return this; + } + + @JsonSetter(value = "html_body", nulls = Nulls.SKIP) + public Builder htmlBody(Optional htmlBody) { + this.htmlBody = htmlBody; + return this; + } + + public Builder htmlBody(String htmlBody) { + this.htmlBody = Optional.ofNullable(htmlBody); + return this; + } + + @JsonSetter(value = "ticket", nulls = Nulls.SKIP) + public Builder ticket(Optional ticket) { + this.ticket = ticket; + return this; + } + + public Builder ticket(CommentRequestTicket ticket) { + this.ticket = Optional.ofNullable(ticket); + return this; + } + + @JsonSetter(value = "is_private", nulls = Nulls.SKIP) + public Builder isPrivate(Optional isPrivate) { + this.isPrivate = isPrivate; + return this; + } + + public Builder isPrivate(Boolean isPrivate) { + this.isPrivate = Optional.ofNullable(isPrivate); + 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 CommentRequest build() { + return new CommentRequest( + user, + contact, + body, + htmlBody, + ticket, + isPrivate, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommentRequestContact.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommentRequestContact.java new file mode 100644 index 000000000..0de3e0ea0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommentRequestContact.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CommentRequestContact.Deserializer.class) +public final class CommentRequestContact { + private final Object value; + + private final int type; + + private CommentRequestContact(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommentRequestContact && equalTo((CommentRequestContact) other); + } + + private boolean equalTo(CommentRequestContact other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CommentRequestContact of(String value) { + return new CommentRequestContact(value, 0); + } + + public static CommentRequestContact of(Contact value) { + return new CommentRequestContact(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CommentRequestContact.class); + } + + @Override + public CommentRequestContact 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommentRequestTicket.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommentRequestTicket.java new file mode 100644 index 000000000..e53d5c1ae --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommentRequestTicket.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CommentRequestTicket.Deserializer.class) +public final class CommentRequestTicket { + private final Object value; + + private final int type; + + private CommentRequestTicket(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((Ticket) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommentRequestTicket && equalTo((CommentRequestTicket) other); + } + + private boolean equalTo(CommentRequestTicket other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CommentRequestTicket of(String value) { + return new CommentRequestTicket(value, 0); + } + + public static CommentRequestTicket of(Ticket value) { + return new CommentRequestTicket(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Ticket value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CommentRequestTicket.class); + } + + @Override + public CommentRequestTicket 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, Ticket.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommentRequestUser.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommentRequestUser.java new file mode 100644 index 000000000..cddf0bc65 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommentRequestUser.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CommentRequestUser.Deserializer.class) +public final class CommentRequestUser { + private final Object value; + + private final int type; + + private CommentRequestUser(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((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommentRequestUser && equalTo((CommentRequestUser) other); + } + + private boolean equalTo(CommentRequestUser other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CommentRequestUser of(String value) { + return new CommentRequestUser(value, 0); + } + + public static CommentRequestUser of(User value) { + return new CommentRequestUser(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CommentRequestUser.class); + } + + @Override + public CommentRequestUser 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, User.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommentResponse.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommentResponse.java new file mode 100644 index 000000000..658d55bef --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommentResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CommentResponse.Builder.class) +public final class CommentResponse { + private final Comment model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private CommentResponse( + Comment 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 Comment getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommentResponse && equalTo((CommentResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CommentResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull Comment model); + + Builder from(CommentResponse other); + } + + public interface _FinalStage { + CommentResponse 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 Comment model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(CommentResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull Comment model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public CommentResponse build() { + return new CommentResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommentTicket.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommentTicket.java new file mode 100644 index 000000000..0f5c275b7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommentTicket.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CommentTicket.Deserializer.class) +public final class CommentTicket { + private final Object value; + + private final int type; + + private CommentTicket(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((Ticket) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommentTicket && equalTo((CommentTicket) other); + } + + private boolean equalTo(CommentTicket other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CommentTicket of(String value) { + return new CommentTicket(value, 0); + } + + public static CommentTicket of(Ticket value) { + return new CommentTicket(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Ticket value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CommentTicket.class); + } + + @Override + public CommentTicket 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, Ticket.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommentUser.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommentUser.java new file mode 100644 index 000000000..6c4676cd9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommentUser.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CommentUser.Deserializer.class) +public final class CommentUser { + private final Object value; + + private final int type; + + private CommentUser(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((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommentUser && equalTo((CommentUser) other); + } + + private boolean equalTo(CommentUser other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static CommentUser of(String value) { + return new CommentUser(value, 0); + } + + public static CommentUser of(User value) { + return new CommentUser(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CommentUser.class); + } + + @Override + public CommentUser 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, User.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommonModelScopeApi.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommonModelScopeApi.java new file mode 100644 index 000000000..ce8b530ab --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommonModelScopeApi.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @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/legacy/api/resources/ticketing/types/CommonModelScopesBodyRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommonModelScopesBodyRequest.java new file mode 100644 index 000000000..991f08c44 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/CommonModelScopesBodyRequest.java @@ -0,0 +1,175 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.modelId, this.enabledActions, this.disabledFields); + } + + @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() {} + + @Override + public Builder from(CommonModelScopesBodyRequest other) { + modelId(other.getModelId()); + enabledActions(other.getEnabledActions()); + disabledFields(other.getDisabledFields()); + return this; + } + + @Override + @JsonSetter("model_id") + public _FinalStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @Override + public _FinalStage addAllDisabledFields(List disabledFields) { + this.disabledFields.addAll(disabledFields); + return this; + } + + @Override + public _FinalStage addDisabledFields(String disabledFields) { + this.disabledFields.add(disabledFields); + return this; + } + + @Override + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public _FinalStage disabledFields(List disabledFields) { + this.disabledFields.clear(); + this.disabledFields.addAll(disabledFields); + return this; + } + + @Override + public _FinalStage addAllEnabledActions(List enabledActions) { + this.enabledActions.addAll(enabledActions); + return this; + } + + @Override + public _FinalStage addEnabledActions(EnabledActionsEnum enabledActions) { + this.enabledActions.add(enabledActions); + return this; + } + + @Override + @JsonSetter(value = "enabled_actions", nulls = Nulls.SKIP) + public _FinalStage enabledActions(List enabledActions) { + this.enabledActions.clear(); + this.enabledActions.addAll(enabledActions); + return this; + } + + @Override + public CommonModelScopesBodyRequest build() { + return new CommonModelScopesBodyRequest(modelId, enabledActions, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/Contact.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/Contact.java new file mode 100644 index 000000000..746c46f48 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/Contact.java @@ -0,0 +1,406 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ticketing/types/ContactAccount.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ContactAccount.java new file mode 100644 index 000000000..81fb3c68b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ContactAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ticketing/types/ContactRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ContactRequest.java new file mode 100644 index 000000000..114e6f505 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ContactRequest.java @@ -0,0 +1,266 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.emailAddress, + this.phoneNumber, + this.details, + this.account, + this.integrationParams, + this.linkedAccountParams); + } + + @Override + 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/legacy/api/resources/ticketing/types/ContactRequestAccount.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ContactRequestAccount.java new file mode 100644 index 000000000..85cd9732c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ContactRequestAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ticketing/types/DataPassthroughRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/DataPassthroughRequest.java new file mode 100644 index 000000000..797e4bf81 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/DataPassthroughRequest.java @@ -0,0 +1,361 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.baseUrlOverride, + this.data, + this.multipartFormData, + this.headers, + this.requestFormat, + this.normalizeResponse); + } + + @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() {} + + @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; + } + + @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. + */ + @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. + */ + @Override + public _FinalStage normalizeResponse(Boolean normalizeResponse) { + this.normalizeResponse = Optional.ofNullable(normalizeResponse); + return this; + } + + @Override + @JsonSetter(value = "normalize_response", nulls = Nulls.SKIP) + public _FinalStage normalizeResponse(Optional normalizeResponse) { + this.normalizeResponse = normalizeResponse; + return this; + } + + @Override + public _FinalStage requestFormat(RequestFormatEnum requestFormat) { + this.requestFormat = Optional.ofNullable(requestFormat); + return this; + } + + @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. + */ + @Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @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. + */ + @Override + public _FinalStage multipartFormData(List multipartFormData) { + this.multipartFormData = Optional.ofNullable(multipartFormData); + return this; + } + + @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. + */ + @Override + public _FinalStage data(String data) { + this.data = Optional.ofNullable(data); + return this; + } + + @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. + */ + @Override + public _FinalStage baseUrlOverride(String baseUrlOverride) { + this.baseUrlOverride = Optional.ofNullable(baseUrlOverride); + return this; + } + + @Override + @JsonSetter(value = "base_url_override", nulls = Nulls.SKIP) + public _FinalStage baseUrlOverride(Optional baseUrlOverride) { + this.baseUrlOverride = baseUrlOverride; + return this; + } + + @Override + public DataPassthroughRequest build() { + return new DataPassthroughRequest( + method, + path, + baseUrlOverride, + data, + multipartFormData, + headers, + requestFormat, + normalizeResponse, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/DebugModeLog.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/DebugModeLog.java new file mode 100644 index 000000000..467b77baa --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/DebugModeLog.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.logId, this.dashboardView, this.logSummary); + } + + @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() {} + + @Override + public Builder from(DebugModeLog other) { + logId(other.getLogId()); + dashboardView(other.getDashboardView()); + logSummary(other.getLogSummary()); + return this; + } + + @Override + @JsonSetter("log_id") + public DashboardViewStage logId(@NotNull String logId) { + this.logId = logId; + return this; + } + + @Override + @JsonSetter("dashboard_view") + public LogSummaryStage dashboardView(@NotNull String dashboardView) { + this.dashboardView = dashboardView; + return this; + } + + @Override + @JsonSetter("log_summary") + public _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary) { + this.logSummary = logSummary; + return this; + } + + @Override + public DebugModeLog build() { + return new DebugModeLog(logId, dashboardView, logSummary, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/DebugModelLogSummary.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/DebugModelLogSummary.java new file mode 100644 index 000000000..06adff7d2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/DebugModelLogSummary.java @@ -0,0 +1,141 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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; + } + + @Override + public int hashCode() { + return Objects.hash(this.url, this.method, this.statusCode); + } + + @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() {} + + @Override + public Builder from(DebugModelLogSummary other) { + url(other.getUrl()); + method(other.getMethod()); + statusCode(other.getStatusCode()); + return this; + } + + @Override + @JsonSetter("url") + public MethodStage url(@NotNull String url) { + this.url = url; + return this; + } + + @Override + @JsonSetter("method") + public StatusCodeStage method(@NotNull String method) { + this.method = method; + return this; + } + + @Override + @JsonSetter("status_code") + public _FinalStage statusCode(int statusCode) { + this.statusCode = statusCode; + return this; + } + + @Override + public DebugModelLogSummary build() { + return new DebugModelLogSummary(url, method, statusCode, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/EnabledActionsEnum.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/EnabledActionsEnum.java new file mode 100644 index 000000000..e803c0469 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/EnabledActionsEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/EncodingEnum.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/EncodingEnum.java new file mode 100644 index 000000000..3b8370500 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/EncodingEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/ErrorValidationProblem.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ErrorValidationProblem.java new file mode 100644 index 000000000..14929ec95 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ErrorValidationProblem.java @@ -0,0 +1,178 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.source, this.title, this.detail, this.problemType); + } + + @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() {} + + @Override + public Builder from(ErrorValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + return this; + } + + @Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @Override + public ErrorValidationProblem build() { + return new ErrorValidationProblem(source, title, detail, problemType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/EventTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/EventTypeEnum.java new file mode 100644 index 000000000..ff60f2089 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/EventTypeEnum.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ExternalTargetFieldApi.java new file mode 100644 index 000000000..e6f7b9a20 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ExternalTargetFieldApi.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isMapped); + } + + @Override + 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/legacy/api/resources/ticketing/types/ExternalTargetFieldApiResponse.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ExternalTargetFieldApiResponse.java new file mode 100644 index 000000000..ef8b8dd66 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ExternalTargetFieldApiResponse.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ticketing/types/FieldFormatEnum.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/FieldFormatEnum.java new file mode 100644 index 000000000..3d1a62b85 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/FieldFormatEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/FieldMappingApiInstance.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/FieldMappingApiInstance.java new file mode 100644 index 000000000..ab8646df6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/FieldMappingApiInstance.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField); + } + + @Override + 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/legacy/api/resources/ticketing/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/FieldMappingApiInstanceRemoteField.java new file mode 100644 index 000000000..e31c320df --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/FieldMappingApiInstanceRemoteField.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.remoteKeyName, this.schema, this.remoteEndpointInfo); + } + + @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() {} + + @Override + public Builder from(FieldMappingApiInstanceRemoteField other) { + remoteKeyName(other.getRemoteKeyName()); + schema(other.getSchema()); + remoteEndpointInfo(other.getRemoteEndpointInfo()); + return this; + } + + @Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo( + @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @Override + public _FinalStage schema(Map schema) { + this.schema = Optional.ofNullable(schema); + return this; + } + + @Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Optional> schema) { + this.schema = schema; + return this; + } + + @Override + public _FinalStage remoteKeyName(String remoteKeyName) { + this.remoteKeyName = Optional.ofNullable(remoteKeyName); + return this; + } + + @Override + @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) + public _FinalStage remoteKeyName(Optional remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @Override + public FieldMappingApiInstanceRemoteField build() { + return new FieldMappingApiInstanceRemoteField( + remoteKeyName, schema, remoteEndpointInfo, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java new file mode 100644 index 000000000..250eae46c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java @@ -0,0 +1,138 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @Override + 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/legacy/api/resources/ticketing/types/FieldMappingApiInstanceResponse.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/FieldMappingApiInstanceResponse.java new file mode 100644 index 000000000..70f41c4ea --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/FieldMappingApiInstanceResponse.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ticketing/types/FieldMappingApiInstanceTargetField.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/FieldMappingApiInstanceTargetField.java new file mode 100644 index 000000000..a4c6009c2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/FieldMappingApiInstanceTargetField.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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; + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isOrganizationWide); + } + + @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() {} + + @Override + public Builder from(FieldMappingApiInstanceTargetField other) { + name(other.getName()); + description(other.getDescription()); + isOrganizationWide(other.getIsOrganizationWide()); + return this; + } + + @Override + @JsonSetter("name") + public DescriptionStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + @JsonSetter("description") + public IsOrganizationWideStage description(@NotNull String description) { + this.description = description; + return this; + } + + @Override + @JsonSetter("is_organization_wide") + public _FinalStage isOrganizationWide(boolean isOrganizationWide) { + this.isOrganizationWide = isOrganizationWide; + return this; + } + + @Override + public FieldMappingApiInstanceTargetField build() { + return new FieldMappingApiInstanceTargetField(name, description, isOrganizationWide, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/FieldMappingInstanceResponse.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/FieldMappingInstanceResponse.java new file mode 100644 index 000000000..981cb9915 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/FieldMappingInstanceResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @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() {} + + @Override + public Builder from(FieldMappingInstanceResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull FieldMappingApiInstance model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public FieldMappingInstanceResponse build() { + return new FieldMappingInstanceResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/FieldPermissionDeserializer.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/FieldPermissionDeserializer.java new file mode 100644 index 000000000..9a427aa85 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/FieldPermissionDeserializer.java @@ -0,0 +1,112 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @Override + 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/legacy/api/resources/ticketing/types/FieldPermissionDeserializerRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/FieldPermissionDeserializerRequest.java new file mode 100644 index 000000000..247d4ab89 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/FieldPermissionDeserializerRequest.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @Override + 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/legacy/api/resources/ticketing/types/FieldTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/FieldTypeEnum.java new file mode 100644 index 000000000..2e1cb50f6 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/FieldTypeEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/IndividualCommonModelScopeDeserializer.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/IndividualCommonModelScopeDeserializer.java new file mode 100644 index 000000000..cdb912e51 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/IndividualCommonModelScopeDeserializer.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @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() {} + + @Override + public Builder from(IndividualCommonModelScopeDeserializer other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @Override + public _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions(Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @Override + public IndividualCommonModelScopeDeserializer build() { + return new IndividualCommonModelScopeDeserializer( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/IndividualCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/IndividualCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..19b36f276 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/IndividualCommonModelScopeDeserializerRequest.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @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() {} + + @Override + public Builder from(IndividualCommonModelScopeDeserializerRequest other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @Override + public _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions( + Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @Override + public IndividualCommonModelScopeDeserializerRequest build() { + return new IndividualCommonModelScopeDeserializerRequest( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/Issue.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/Issue.java new file mode 100644 index 000000000..16284f40e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/Issue.java @@ -0,0 +1,341 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.status, + this.errorDescription, + this.endUser, + this.firstIncidentTime, + this.lastIncidentTime, + this.isMuted, + this.errorDetails); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("error_description") + public _FinalStage errorDescription(@NotNull String errorDescription) { + this.errorDescription = errorDescription; + return this; + } + + @Override + public _FinalStage errorDetails(List errorDetails) { + this.errorDetails = Optional.ofNullable(errorDetails); + return this; + } + + @Override + @JsonSetter(value = "error_details", nulls = Nulls.SKIP) + public _FinalStage errorDetails(Optional> errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + @Override + public _FinalStage isMuted(Boolean isMuted) { + this.isMuted = Optional.ofNullable(isMuted); + return this; + } + + @Override + @JsonSetter(value = "is_muted", nulls = Nulls.SKIP) + public _FinalStage isMuted(Optional isMuted) { + this.isMuted = isMuted; + return this; + } + + @Override + public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { + this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); + return this; + } + + @Override + @JsonSetter(value = "last_incident_time", nulls = Nulls.SKIP) + public _FinalStage lastIncidentTime(Optional lastIncidentTime) { + this.lastIncidentTime = lastIncidentTime; + return this; + } + + @Override + public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { + this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); + return this; + } + + @Override + @JsonSetter(value = "first_incident_time", nulls = Nulls.SKIP) + public _FinalStage firstIncidentTime(Optional firstIncidentTime) { + this.firstIncidentTime = firstIncidentTime; + return this; + } + + @Override + public _FinalStage endUser(Map endUser) { + this.endUser = Optional.ofNullable(endUser); + return this; + } + + @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. + */ + @Override + public _FinalStage status(IssueStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @Override + public Issue build() { + return new Issue( + id, + status, + errorDescription, + endUser, + firstIncidentTime, + lastIncidentTime, + isMuted, + errorDetails, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/IssueStatus.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/IssueStatus.java new file mode 100644 index 000000000..e372890ea --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/IssueStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ticketing/types/IssueStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/IssueStatusEnum.java new file mode 100644 index 000000000..a462eb502 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/IssueStatusEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/ItemFormatEnum.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ItemFormatEnum.java new file mode 100644 index 000000000..c34774f56 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ItemFormatEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/ItemSchema.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ItemSchema.java new file mode 100644 index 000000000..be30dc7ac --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ItemSchema.java @@ -0,0 +1,136 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.itemType, this.itemFormat, this.itemChoices); + } + + @Override + 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/legacy/api/resources/ticketing/types/ItemTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ItemTypeEnum.java new file mode 100644 index 000000000..8cfffa470 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ItemTypeEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/LanguageEnum.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/LanguageEnum.java new file mode 100644 index 000000000..9f3147a34 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/LanguageEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/LinkToken.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/LinkToken.java new file mode 100644 index 000000000..53651b157 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/LinkToken.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.linkToken, this.integrationName, this.magicLinkUrl); + } + + @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() {} + + @Override + public Builder from(LinkToken other) { + linkToken(other.getLinkToken()); + integrationName(other.getIntegrationName()); + magicLinkUrl(other.getMagicLinkUrl()); + return this; + } + + @Override + @JsonSetter("link_token") + public _FinalStage linkToken(@NotNull String linkToken) { + this.linkToken = linkToken; + return this; + } + + @Override + public _FinalStage magicLinkUrl(String magicLinkUrl) { + this.magicLinkUrl = Optional.ofNullable(magicLinkUrl); + return this; + } + + @Override + @JsonSetter(value = "magic_link_url", nulls = Nulls.SKIP) + public _FinalStage magicLinkUrl(Optional magicLinkUrl) { + this.magicLinkUrl = magicLinkUrl; + return this; + } + + @Override + public _FinalStage integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @Override + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public _FinalStage integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + @Override + public LinkToken build() { + return new LinkToken(linkToken, integrationName, magicLinkUrl, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/LinkedAccountStatus.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/LinkedAccountStatus.java new file mode 100644 index 000000000..819867c5f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/LinkedAccountStatus.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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; + } + + @Override + public int hashCode() { + return Objects.hash(this.linkedAccountStatus, this.canMakeRequest); + } + + @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() {} + + @Override + public Builder from(LinkedAccountStatus other) { + linkedAccountStatus(other.getLinkedAccountStatus()); + canMakeRequest(other.getCanMakeRequest()); + return this; + } + + @Override + @JsonSetter("linked_account_status") + public CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus) { + this.linkedAccountStatus = linkedAccountStatus; + return this; + } + + @Override + @JsonSetter("can_make_request") + public _FinalStage canMakeRequest(boolean canMakeRequest) { + this.canMakeRequest = canMakeRequest; + return this; + } + + @Override + public LinkedAccountStatus build() { + return new LinkedAccountStatus(linkedAccountStatus, canMakeRequest, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/MetaResponse.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/MetaResponse.java new file mode 100644 index 000000000..a26aaf13b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/MetaResponse.java @@ -0,0 +1,232 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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; + } + + @Override + public int hashCode() { + return Objects.hash( + this.requestSchema, + this.remoteFieldClasses, + this.status, + this.hasConditionalParams, + this.hasRequiredLinkedAccountParams); + } + + @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() {} + + @Override + public Builder from(MetaResponse other) { + requestSchema(other.getRequestSchema()); + remoteFieldClasses(other.getRemoteFieldClasses()); + status(other.getStatus()); + hasConditionalParams(other.getHasConditionalParams()); + hasRequiredLinkedAccountParams(other.getHasRequiredLinkedAccountParams()); + return this; + } + + @Override + @JsonSetter("has_conditional_params") + public HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams) { + this.hasConditionalParams = hasConditionalParams; + return this; + } + + @Override + @JsonSetter("has_required_linked_account_params") + public _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams) { + this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; + return this; + } + + @Override + public _FinalStage status(LinkedAccountStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @Override + public _FinalStage remoteFieldClasses(Map remoteFieldClasses) { + this.remoteFieldClasses = Optional.ofNullable(remoteFieldClasses); + return this; + } + + @Override + @JsonSetter(value = "remote_field_classes", nulls = Nulls.SKIP) + public _FinalStage remoteFieldClasses(Optional> remoteFieldClasses) { + this.remoteFieldClasses = remoteFieldClasses; + return this; + } + + @Override + public _FinalStage requestSchema(String key, JsonNode value) { + this.requestSchema.put(key, value); + return this; + } + + @Override + public _FinalStage putAllRequestSchema(Map requestSchema) { + this.requestSchema.putAll(requestSchema); + return this; + } + + @Override + @JsonSetter(value = "request_schema", nulls = Nulls.SKIP) + public _FinalStage requestSchema(Map requestSchema) { + this.requestSchema.clear(); + this.requestSchema.putAll(requestSchema); + return this; + } + + @Override + public MetaResponse build() { + return new MetaResponse( + requestSchema, + remoteFieldClasses, + status, + hasConditionalParams, + hasRequiredLinkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/MethodEnum.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/MethodEnum.java new file mode 100644 index 000000000..5729fbb58 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/MethodEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/ModelOperation.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ModelOperation.java new file mode 100644 index 000000000..fccb99471 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ModelOperation.java @@ -0,0 +1,216 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.modelName, this.availableOperations, this.requiredPostParameters, this.supportedFields); + } + + @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() {} + + @Override + public Builder from(ModelOperation other) { + modelName(other.getModelName()); + availableOperations(other.getAvailableOperations()); + requiredPostParameters(other.getRequiredPostParameters()); + supportedFields(other.getSupportedFields()); + return this; + } + + @Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @Override + public _FinalStage addAllSupportedFields(List supportedFields) { + this.supportedFields.addAll(supportedFields); + return this; + } + + @Override + public _FinalStage addSupportedFields(String supportedFields) { + this.supportedFields.add(supportedFields); + return this; + } + + @Override + @JsonSetter(value = "supported_fields", nulls = Nulls.SKIP) + public _FinalStage supportedFields(List supportedFields) { + this.supportedFields.clear(); + this.supportedFields.addAll(supportedFields); + return this; + } + + @Override + public _FinalStage addAllRequiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.addAll(requiredPostParameters); + return this; + } + + @Override + public _FinalStage addRequiredPostParameters(String requiredPostParameters) { + this.requiredPostParameters.add(requiredPostParameters); + return this; + } + + @Override + @JsonSetter(value = "required_post_parameters", nulls = Nulls.SKIP) + public _FinalStage requiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.clear(); + this.requiredPostParameters.addAll(requiredPostParameters); + return this; + } + + @Override + public _FinalStage addAllAvailableOperations(List availableOperations) { + this.availableOperations.addAll(availableOperations); + return this; + } + + @Override + public _FinalStage addAvailableOperations(String availableOperations) { + this.availableOperations.add(availableOperations); + return this; + } + + @Override + @JsonSetter(value = "available_operations", nulls = Nulls.SKIP) + public _FinalStage availableOperations(List availableOperations) { + this.availableOperations.clear(); + this.availableOperations.addAll(availableOperations); + return this; + } + + @Override + public ModelOperation build() { + return new ModelOperation( + modelName, availableOperations, requiredPostParameters, supportedFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/ModelPermissionDeserializer.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ModelPermissionDeserializer.java new file mode 100644 index 000000000..3aa4b2e46 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ModelPermissionDeserializer.java @@ -0,0 +1,89 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @Override + 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/legacy/api/resources/ticketing/types/ModelPermissionDeserializerRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ModelPermissionDeserializerRequest.java new file mode 100644 index 000000000..91e1a5525 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ModelPermissionDeserializerRequest.java @@ -0,0 +1,90 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @Override + 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/legacy/api/resources/ticketing/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/MultipartFormFieldRequest.java new file mode 100644 index 000000000..2a4387f6b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/MultipartFormFieldRequest.java @@ -0,0 +1,259 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.data, this.encoding, this.fileName, this.contentType); + } + + @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() {} + + @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. + */ + @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. + */ + @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. + */ + @Override + public _FinalStage contentType(String contentType) { + this.contentType = Optional.ofNullable(contentType); + return this; + } + + @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. + */ + @Override + public _FinalStage fileName(String fileName) { + this.fileName = Optional.ofNullable(fileName); + return this; + } + + @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. + */ + @Override + public _FinalStage encoding(MultipartFormFieldRequestEncoding encoding) { + this.encoding = Optional.ofNullable(encoding); + return this; + } + + @Override + @JsonSetter(value = "encoding", nulls = Nulls.SKIP) + public _FinalStage encoding(Optional encoding) { + this.encoding = encoding; + return this; + } + + @Override + public MultipartFormFieldRequest build() { + return new MultipartFormFieldRequest(name, data, encoding, fileName, contentType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/MultipartFormFieldRequestEncoding.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/MultipartFormFieldRequestEncoding.java new file mode 100644 index 000000000..d76be4d52 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/MultipartFormFieldRequestEncoding.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ticketing/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedAccountDetailsAndActionsList.java new file mode 100644 index 000000000..433f0a14f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedAccountDetailsAndActionsList.java @@ -0,0 +1,135 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/ticketing/types/PaginatedAccountList.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedAccountList.java new file mode 100644 index 000000000..3037bb337 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedAccountList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/ticketing/types/PaginatedAttachmentList.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedAttachmentList.java new file mode 100644 index 000000000..b42f11edd --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedAttachmentList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/ticketing/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedAuditLogEventList.java new file mode 100644 index 000000000..d20f97d39 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedAuditLogEventList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/ticketing/types/PaginatedCollectionList.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedCollectionList.java new file mode 100644 index 000000000..961ca091d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedCollectionList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedCollectionList.Builder.class) +public final class PaginatedCollectionList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedCollectionList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedCollectionList && equalTo((PaginatedCollectionList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedCollectionList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedCollectionList 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 PaginatedCollectionList build() { + return new PaginatedCollectionList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedCommentList.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedCommentList.java new file mode 100644 index 000000000..2cfb67018 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedCommentList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedCommentList.Builder.class) +public final class PaginatedCommentList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedCommentList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedCommentList && equalTo((PaginatedCommentList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedCommentList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedCommentList 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 PaginatedCommentList build() { + return new PaginatedCommentList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedContactList.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedContactList.java new file mode 100644 index 000000000..32d060f2d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedContactList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/ticketing/types/PaginatedIssueList.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedIssueList.java new file mode 100644 index 000000000..a239df8ff --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedIssueList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/ticketing/types/PaginatedProjectList.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedProjectList.java new file mode 100644 index 000000000..d07c64800 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedProjectList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedProjectList.Builder.class) +public final class PaginatedProjectList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedProjectList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedProjectList && equalTo((PaginatedProjectList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedProjectList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedProjectList 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 PaginatedProjectList build() { + return new PaginatedProjectList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedRemoteFieldClassList.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedRemoteFieldClassList.java new file mode 100644 index 000000000..3a21fbba7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedRemoteFieldClassList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/ticketing/types/PaginatedRoleList.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedRoleList.java new file mode 100644 index 000000000..f27f0d9c7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedRoleList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedRoleList.Builder.class) +public final class PaginatedRoleList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedRoleList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedRoleList && equalTo((PaginatedRoleList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedRoleList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedRoleList 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 PaginatedRoleList build() { + return new PaginatedRoleList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedSyncStatusList.java new file mode 100644 index 000000000..d1c72f714 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedSyncStatusList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/ticketing/types/PaginatedTagList.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedTagList.java new file mode 100644 index 000000000..276ce81eb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedTagList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/ticketing/types/PaginatedTeamList.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedTeamList.java new file mode 100644 index 000000000..59498288a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedTeamList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/ticketing/types/PaginatedTicketList.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedTicketList.java new file mode 100644 index 000000000..c315a05dc --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedTicketList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedTicketList.Builder.class) +public final class PaginatedTicketList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedTicketList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedTicketList && equalTo((PaginatedTicketList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedTicketList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedTicketList 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 PaginatedTicketList build() { + return new PaginatedTicketList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedUserList.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedUserList.java new file mode 100644 index 000000000..20fe6edf9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedUserList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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/legacy/api/resources/ticketing/types/PaginatedViewerList.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedViewerList.java new file mode 100644 index 000000000..2db2cb09b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PaginatedViewerList.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedViewerList.Builder.class) +public final class PaginatedViewerList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedViewerList( + 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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedViewerList && equalTo((PaginatedViewerList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedViewerList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @Override + 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(PaginatedViewerList 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 PaginatedViewerList build() { + return new PaginatedViewerList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/PatchedTicketRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PatchedTicketRequest.java new file mode 100644 index 000000000..3f7240f85 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PatchedTicketRequest.java @@ -0,0 +1,644 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PatchedTicketRequest.Builder.class) +public final class PatchedTicketRequest { + private final Optional name; + + private final Optional>> assignees; + + private final Optional>> assignedTeams; + + private final Optional creator; + + private final Optional dueDate; + + private final Optional status; + + private final Optional description; + + private final Optional>> collections; + + private final Optional ticketType; + + private final Optional account; + + private final Optional contact; + + private final Optional parentTicket; + + private final Optional>> tags; + + private final Optional>> roles; + + private final Optional completedAt; + + private final Optional ticketUrl; + + private final Optional priority; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private PatchedTicketRequest( + Optional name, + Optional>> assignees, + Optional>> assignedTeams, + Optional creator, + Optional dueDate, + Optional status, + Optional description, + Optional>> collections, + Optional ticketType, + Optional account, + Optional contact, + Optional parentTicket, + Optional>> tags, + Optional>> roles, + Optional completedAt, + Optional ticketUrl, + Optional priority, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.name = name; + this.assignees = assignees; + this.assignedTeams = assignedTeams; + this.creator = creator; + this.dueDate = dueDate; + this.status = status; + this.description = description; + this.collections = collections; + this.ticketType = ticketType; + this.account = account; + this.contact = contact; + this.parentTicket = parentTicket; + this.tags = tags; + this.roles = roles; + this.completedAt = completedAt; + this.ticketUrl = ticketUrl; + this.priority = priority; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ticket's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The individual Users who are assigned to this ticket. This does not include Users who just have view access to this ticket. + */ + @JsonProperty("assignees") + public Optional>> getAssignees() { + return assignees; + } + + /** + * @return The Teams that are assigned to this ticket. This does not include Teams who just have view access to this ticket. + */ + @JsonProperty("assigned_teams") + public Optional>> getAssignedTeams() { + return assignedTeams; + } + + /** + * @return The user who created this ticket. + */ + @JsonProperty("creator") + public Optional getCreator() { + return creator; + } + + /** + * @return The ticket's due date. + */ + @JsonProperty("due_date") + public Optional getDueDate() { + return dueDate; + } + + /** + * @return The current status of the ticket. + *
    + *
  • OPEN - OPEN
  • + *
  • CLOSED - CLOSED
  • + *
  • IN_PROGRESS - IN_PROGRESS
  • + *
  • ON_HOLD - ON_HOLD
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The ticket’s description. HTML version of description is mapped if supported by the third-party platform. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The Collections that this Ticket is included in. + */ + @JsonProperty("collections") + public Optional>> getCollections() { + return collections; + } + + /** + * @return The sub category of the ticket within the 3rd party system. Examples include incident, task, subtask or to-do. + */ + @JsonProperty("ticket_type") + public Optional getTicketType() { + return ticketType; + } + + /** + * @return The account associated with the ticket. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The contact associated with the ticket. + */ + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + + /** + * @return The ticket's parent ticket. + */ + @JsonProperty("parent_ticket") + public Optional getParentTicket() { + return parentTicket; + } + + @JsonProperty("tags") + public Optional>> getTags() { + return tags; + } + + @JsonProperty("roles") + public Optional>> getRoles() { + return roles; + } + + /** + * @return When the ticket was completed. + */ + @JsonProperty("completed_at") + public Optional getCompletedAt() { + return completedAt; + } + + /** + * @return The 3rd party url of the Ticket. + */ + @JsonProperty("ticket_url") + public Optional getTicketUrl() { + return ticketUrl; + } + + /** + * @return The priority or urgency of the Ticket. + *
    + *
  • URGENT - URGENT
  • + *
  • HIGH - HIGH
  • + *
  • NORMAL - NORMAL
  • + *
  • LOW - LOW
  • + *
+ */ + @JsonProperty("priority") + public Optional getPriority() { + return priority; + } + + @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedTicketRequest && equalTo((PatchedTicketRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedTicketRequest other) { + return name.equals(other.name) + && assignees.equals(other.assignees) + && assignedTeams.equals(other.assignedTeams) + && creator.equals(other.creator) + && dueDate.equals(other.dueDate) + && status.equals(other.status) + && description.equals(other.description) + && collections.equals(other.collections) + && ticketType.equals(other.ticketType) + && account.equals(other.account) + && contact.equals(other.contact) + && parentTicket.equals(other.parentTicket) + && tags.equals(other.tags) + && roles.equals(other.roles) + && completedAt.equals(other.completedAt) + && ticketUrl.equals(other.ticketUrl) + && priority.equals(other.priority) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.assignees, + this.assignedTeams, + this.creator, + this.dueDate, + this.status, + this.description, + this.collections, + this.ticketType, + this.account, + this.contact, + this.parentTicket, + this.tags, + this.roles, + this.completedAt, + this.ticketUrl, + this.priority, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @Override + 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>> assignees = Optional.empty(); + + private Optional>> assignedTeams = Optional.empty(); + + private Optional creator = Optional.empty(); + + private Optional dueDate = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional>> collections = Optional.empty(); + + private Optional ticketType = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional contact = Optional.empty(); + + private Optional parentTicket = Optional.empty(); + + private Optional>> tags = Optional.empty(); + + private Optional>> roles = Optional.empty(); + + private Optional completedAt = Optional.empty(); + + private Optional ticketUrl = Optional.empty(); + + private Optional priority = 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(PatchedTicketRequest other) { + name(other.getName()); + assignees(other.getAssignees()); + assignedTeams(other.getAssignedTeams()); + creator(other.getCreator()); + dueDate(other.getDueDate()); + status(other.getStatus()); + description(other.getDescription()); + collections(other.getCollections()); + ticketType(other.getTicketType()); + account(other.getAccount()); + contact(other.getContact()); + parentTicket(other.getParentTicket()); + tags(other.getTags()); + roles(other.getRoles()); + completedAt(other.getCompletedAt()); + ticketUrl(other.getTicketUrl()); + priority(other.getPriority()); + 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 = "assignees", nulls = Nulls.SKIP) + public Builder assignees(Optional>> assignees) { + this.assignees = assignees; + return this; + } + + public Builder assignees(List> assignees) { + this.assignees = Optional.ofNullable(assignees); + return this; + } + + @JsonSetter(value = "assigned_teams", nulls = Nulls.SKIP) + public Builder assignedTeams(Optional>> assignedTeams) { + this.assignedTeams = assignedTeams; + return this; + } + + public Builder assignedTeams(List> assignedTeams) { + this.assignedTeams = Optional.ofNullable(assignedTeams); + return this; + } + + @JsonSetter(value = "creator", nulls = Nulls.SKIP) + public Builder creator(Optional creator) { + this.creator = creator; + return this; + } + + public Builder creator(String creator) { + this.creator = Optional.ofNullable(creator); + return this; + } + + @JsonSetter(value = "due_date", nulls = Nulls.SKIP) + public Builder dueDate(Optional dueDate) { + this.dueDate = dueDate; + return this; + } + + public Builder dueDate(OffsetDateTime dueDate) { + this.dueDate = Optional.ofNullable(dueDate); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(PatchedTicketRequestStatus status) { + this.status = Optional.ofNullable(status); + 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 = "collections", nulls = Nulls.SKIP) + public Builder collections(Optional>> collections) { + this.collections = collections; + return this; + } + + public Builder collections(List> collections) { + this.collections = Optional.ofNullable(collections); + return this; + } + + @JsonSetter(value = "ticket_type", nulls = Nulls.SKIP) + public Builder ticketType(Optional ticketType) { + this.ticketType = ticketType; + return this; + } + + public Builder ticketType(String ticketType) { + this.ticketType = Optional.ofNullable(ticketType); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(String 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(String contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "parent_ticket", nulls = Nulls.SKIP) + public Builder parentTicket(Optional parentTicket) { + this.parentTicket = parentTicket; + return this; + } + + public Builder parentTicket(String parentTicket) { + this.parentTicket = Optional.ofNullable(parentTicket); + return this; + } + + @JsonSetter(value = "tags", nulls = Nulls.SKIP) + public Builder tags(Optional>> tags) { + this.tags = tags; + return this; + } + + public Builder tags(List> tags) { + this.tags = Optional.ofNullable(tags); + 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 = "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; + } + + @JsonSetter(value = "ticket_url", nulls = Nulls.SKIP) + public Builder ticketUrl(Optional ticketUrl) { + this.ticketUrl = ticketUrl; + return this; + } + + public Builder ticketUrl(String ticketUrl) { + this.ticketUrl = Optional.ofNullable(ticketUrl); + return this; + } + + @JsonSetter(value = "priority", nulls = Nulls.SKIP) + public Builder priority(Optional priority) { + this.priority = priority; + return this; + } + + public Builder priority(PatchedTicketRequestPriority priority) { + this.priority = Optional.ofNullable(priority); + 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 PatchedTicketRequest build() { + return new PatchedTicketRequest( + name, + assignees, + assignedTeams, + creator, + dueDate, + status, + description, + collections, + ticketType, + account, + contact, + parentTicket, + tags, + roles, + completedAt, + ticketUrl, + priority, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/PatchedTicketRequestPriority.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PatchedTicketRequestPriority.java new file mode 100644 index 000000000..4dd3f1e9f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PatchedTicketRequestPriority.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ticketing/types/PatchedTicketRequestStatus.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PatchedTicketRequestStatus.java new file mode 100644 index 000000000..8fedbf1b4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PatchedTicketRequestStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ticketing/types/PriorityEnum.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PriorityEnum.java new file mode 100644 index 000000000..b7d493e7d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/PriorityEnum.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PriorityEnum { + URGENT("URGENT"), + + HIGH("HIGH"), + + NORMAL("NORMAL"), + + LOW("LOW"); + + private final String value; + + PriorityEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/Project.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/Project.java new file mode 100644 index 000000000..dd08cde58 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/Project.java @@ -0,0 +1,319 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Project.Builder.class) +public final class Project { + 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 Project( + 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 project's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The project'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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Project && equalTo((Project) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Project 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); + } + + @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); + } + + @Override + 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(Project 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 Project build() { + return new Project( + id, + remoteId, + createdAt, + modifiedAt, + name, + description, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteData.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteData.java new file mode 100644 index 000000000..61b0a77fe --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteData.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.path, this.data); + } + + @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() {} + + @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. + */ + @Override + @JsonSetter("path") + public _FinalStage path(@NotNull String path) { + this.path = path; + return this; + } + + @Override + public _FinalStage data(JsonNode data) { + this.data = Optional.ofNullable(data); + return this; + } + + @Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(Optional data) { + this.data = data; + return this; + } + + @Override + public RemoteData build() { + return new RemoteData(path, data, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteEndpointInfo.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteEndpointInfo.java new file mode 100644 index 000000000..a1df8c0b4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteEndpointInfo.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @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() {} + + @Override + public Builder from(RemoteEndpointInfo other) { + method(other.getMethod()); + urlPath(other.getUrlPath()); + fieldTraversalPath(other.getFieldTraversalPath()); + return this; + } + + @Override + @JsonSetter("method") + public UrlPathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @Override + @JsonSetter("url_path") + public _FinalStage urlPath(@NotNull String urlPath) { + this.urlPath = urlPath; + return this; + } + + @Override + public _FinalStage addAllFieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.addAll(fieldTraversalPath); + return this; + } + + @Override + public _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath) { + this.fieldTraversalPath.add(fieldTraversalPath); + return this; + } + + @Override + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) + public _FinalStage fieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.clear(); + this.fieldTraversalPath.addAll(fieldTraversalPath); + return this; + } + + @Override + public RemoteEndpointInfo build() { + return new RemoteEndpointInfo(method, urlPath, fieldTraversalPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteField.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteField.java new file mode 100644 index 000000000..910330f6c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteField.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.remoteFieldClass, this.value); + } + + @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() {} + + @Override + public Builder from(RemoteField other) { + remoteFieldClass(other.getRemoteFieldClass()); + value(other.getValue()); + return this; + } + + @Override + @JsonSetter("remote_field_class") + public _FinalStage remoteFieldClass(@NotNull RemoteFieldRemoteFieldClass remoteFieldClass) { + this.remoteFieldClass = remoteFieldClass; + return this; + } + + @Override + public _FinalStage value(JsonNode value) { + this.value = Optional.ofNullable(value); + return this; + } + + @Override + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public _FinalStage value(Optional value) { + this.value = value; + return this; + } + + @Override + public RemoteField build() { + return new RemoteField(remoteFieldClass, value, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteFieldApi.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteFieldApi.java new file mode 100644 index 000000000..510b21dea --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteFieldApi.java @@ -0,0 +1,264 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.schema, + this.remoteKeyName, + this.remoteEndpointInfo, + this.exampleValues, + this.advancedMetadata, + this.coverage); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("remote_key_name") + public RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @Override + public _FinalStage coverage(RemoteFieldApiCoverage coverage) { + this.coverage = Optional.ofNullable(coverage); + return this; + } + + @Override + @JsonSetter(value = "coverage", nulls = Nulls.SKIP) + public _FinalStage coverage(Optional coverage) { + this.coverage = coverage; + return this; + } + + @Override + public _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata) { + this.advancedMetadata = Optional.ofNullable(advancedMetadata); + return this; + } + + @Override + @JsonSetter(value = "advanced_metadata", nulls = Nulls.SKIP) + public _FinalStage advancedMetadata(Optional advancedMetadata) { + this.advancedMetadata = advancedMetadata; + return this; + } + + @Override + public _FinalStage exampleValues(List exampleValues) { + this.exampleValues = Optional.ofNullable(exampleValues); + return this; + } + + @Override + @JsonSetter(value = "example_values", nulls = Nulls.SKIP) + public _FinalStage exampleValues(Optional> exampleValues) { + this.exampleValues = exampleValues; + return this; + } + + @Override + public _FinalStage schema(String key, JsonNode value) { + this.schema.put(key, value); + return this; + } + + @Override + public _FinalStage putAllSchema(Map schema) { + this.schema.putAll(schema); + return this; + } + + @Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Map schema) { + this.schema.clear(); + this.schema.putAll(schema); + return this; + } + + @Override + public RemoteFieldApi build() { + return new RemoteFieldApi( + schema, + remoteKeyName, + remoteEndpointInfo, + exampleValues, + advancedMetadata, + coverage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteFieldApiCoverage.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteFieldApiCoverage.java new file mode 100644 index 000000000..1acba1dab --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteFieldApiCoverage.java @@ -0,0 +1,91 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ticketing/types/RemoteFieldApiResponse.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteFieldApiResponse.java new file mode 100644 index 000000000..a394b4c2c --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteFieldApiResponse.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ticketing/types/RemoteFieldClass.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteFieldClass.java new file mode 100644 index 000000000..483f0a08b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteFieldClass.java @@ -0,0 +1,325 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ticketing/types/RemoteFieldClassFieldChoicesItem.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteFieldClassFieldChoicesItem.java new file mode 100644 index 000000000..61e2669b4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteFieldClassFieldChoicesItem.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value, this.displayName); + } + + @Override + 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/legacy/api/resources/ticketing/types/RemoteFieldClassFieldFormat.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteFieldClassFieldFormat.java new file mode 100644 index 000000000..c9cdac3c4 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteFieldClassFieldFormat.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ticketing/types/RemoteFieldClassFieldType.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteFieldClassFieldType.java new file mode 100644 index 000000000..8860330ef --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteFieldClassFieldType.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ticketing/types/RemoteFieldRemoteFieldClass.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteFieldRemoteFieldClass.java new file mode 100644 index 000000000..86857e9c9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteFieldRemoteFieldClass.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ticketing/types/RemoteFieldRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteFieldRequest.java new file mode 100644 index 000000000..e561ab7a3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteFieldRequest.java @@ -0,0 +1,129 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.remoteFieldClass, this.value); + } + + @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() {} + + @Override + public Builder from(RemoteFieldRequest other) { + remoteFieldClass(other.getRemoteFieldClass()); + value(other.getValue()); + return this; + } + + @Override + @JsonSetter("remote_field_class") + public _FinalStage remoteFieldClass(@NotNull RemoteFieldRequestRemoteFieldClass remoteFieldClass) { + this.remoteFieldClass = remoteFieldClass; + return this; + } + + @Override + public _FinalStage value(String value) { + this.value = Optional.ofNullable(value); + return this; + } + + @Override + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public _FinalStage value(Optional value) { + this.value = value; + return this; + } + + @Override + public RemoteFieldRequest build() { + return new RemoteFieldRequest(remoteFieldClass, value, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteFieldRequestRemoteFieldClass.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteFieldRequestRemoteFieldClass.java new file mode 100644 index 000000000..38b99bafb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteFieldRequestRemoteFieldClass.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ticketing/types/RemoteKey.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteKey.java new file mode 100644 index 000000000..96b2116ae --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteKey.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.key); + } + + @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() {} + + @Override + public Builder from(RemoteKey other) { + name(other.getName()); + key(other.getKey()); + return this; + } + + @Override + @JsonSetter("name") + public KeyStage name(@NotNull String name) { + this.name = name; + return this; + } + + @Override + @JsonSetter("key") + public _FinalStage key(@NotNull String key) { + this.key = key; + return this; + } + + @Override + public RemoteKey build() { + return new RemoteKey(name, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteResponse.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteResponse.java new file mode 100644 index 000000000..4d3fded55 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RemoteResponse.java @@ -0,0 +1,271 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.status, + this.response, + this.responseHeaders, + this.responseType, + this.headers); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("method") + public PathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @Override + @JsonSetter("path") + public StatusStage path(@NotNull String path) { + this.path = path; + return this; + } + + @Override + @JsonSetter("status") + public ResponseStage status(int status) { + this.status = status; + return this; + } + + @Override + @JsonSetter("response") + public _FinalStage response(@NotNull JsonNode response) { + this.response = response; + return this; + } + + @Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Optional> headers) { + this.headers = headers; + return this; + } + + @Override + public _FinalStage responseType(ResponseTypeEnum responseType) { + this.responseType = Optional.ofNullable(responseType); + return this; + } + + @Override + @JsonSetter(value = "response_type", nulls = Nulls.SKIP) + public _FinalStage responseType(Optional responseType) { + this.responseType = responseType; + return this; + } + + @Override + public _FinalStage responseHeaders(Map responseHeaders) { + this.responseHeaders = Optional.ofNullable(responseHeaders); + return this; + } + + @Override + @JsonSetter(value = "response_headers", nulls = Nulls.SKIP) + public _FinalStage responseHeaders(Optional> responseHeaders) { + this.responseHeaders = responseHeaders; + return this; + } + + @Override + public RemoteResponse build() { + return new RemoteResponse( + method, path, status, response, responseHeaders, responseType, headers, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/RequestFormatEnum.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RequestFormatEnum.java new file mode 100644 index 000000000..4cccda5ef --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RequestFormatEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/ResponseTypeEnum.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ResponseTypeEnum.java new file mode 100644 index 000000000..6ad3cf517 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ResponseTypeEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/Role.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/Role.java new file mode 100644 index 000000000..0cce88167 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/Role.java @@ -0,0 +1,353 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Role.Builder.class) +public final class Role { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional>> ticketActions; + + private final Optional ticketAccess; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Role( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional>> ticketActions, + Optional ticketAccess, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.ticketActions = ticketActions; + this.ticketAccess = ticketAccess; + 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 name of the Role. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @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() { + return ticketActions; + } + + /** + * @return The level of Ticket access that a User with this Role can perform. + *
    + *
  • ALL - ALL
  • + *
  • ASSIGNED_ONLY - ASSIGNED_ONLY
  • + *
  • TEAM_ONLY - TEAM_ONLY
  • + *
+ */ + @JsonProperty("ticket_access") + public Optional getTicketAccess() { + return ticketAccess; + } + + /** + * @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Role && equalTo((Role) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Role other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && ticketActions.equals(other.ticketActions) + && ticketAccess.equals(other.ticketAccess) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.ticketActions, + this.ticketAccess, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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>> ticketActions = Optional.empty(); + + private Optional ticketAccess = 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(Role other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + ticketActions(other.getTicketActions()); + ticketAccess(other.getTicketAccess()); + 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 = "ticket_actions", nulls = Nulls.SKIP) + public Builder ticketActions(Optional>> ticketActions) { + this.ticketActions = ticketActions; + return this; + } + + public Builder ticketActions(List> ticketActions) { + this.ticketActions = Optional.ofNullable(ticketActions); + return this; + } + + @JsonSetter(value = "ticket_access", nulls = Nulls.SKIP) + public Builder ticketAccess(Optional ticketAccess) { + this.ticketAccess = ticketAccess; + return this; + } + + public Builder ticketAccess(RoleTicketAccess ticketAccess) { + this.ticketAccess = Optional.ofNullable(ticketAccess); + 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 Role build() { + return new Role( + id, + remoteId, + createdAt, + modifiedAt, + name, + ticketActions, + ticketAccess, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/RoleEnum.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RoleEnum.java new file mode 100644 index 000000000..b988cb2b3 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RoleEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/RoleTicketAccess.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RoleTicketAccess.java new file mode 100644 index 000000000..928c5efd9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RoleTicketAccess.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ticketing/types/RoleTicketActionsItem.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RoleTicketActionsItem.java new file mode 100644 index 000000000..8dce39852 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/RoleTicketActionsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ticketing/types/SelectiveSyncConfigurationsUsageEnum.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/SelectiveSyncConfigurationsUsageEnum.java new file mode 100644 index 000000000..a96f788c1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/SelectiveSyncConfigurationsUsageEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/SyncStatus.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/SyncStatus.java new file mode 100644 index 000000000..a997e6daa --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/SyncStatus.java @@ -0,0 +1,283 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.modelName, + this.modelId, + this.lastSyncStart, + this.nextSyncStart, + this.status, + this.isInitialSync, + this.selectiveSyncConfigurationsUsage); + } + + @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() {} + + @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; + } + + @Override + @JsonSetter("model_name") + public ModelIdStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @Override + @JsonSetter("model_id") + public StatusStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @Override + @JsonSetter("status") + public IsInitialSyncStage status(@NotNull SyncStatusStatusEnum status) { + this.status = status; + return this; + } + + @Override + @JsonSetter("is_initial_sync") + public _FinalStage isInitialSync(boolean isInitialSync) { + this.isInitialSync = isInitialSync; + return this; + } + + @Override + public _FinalStage selectiveSyncConfigurationsUsage( + SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = Optional.ofNullable(selectiveSyncConfigurationsUsage); + return this; + } + + @Override + @JsonSetter(value = "selective_sync_configurations_usage", nulls = Nulls.SKIP) + public _FinalStage selectiveSyncConfigurationsUsage( + Optional selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; + return this; + } + + @Override + public _FinalStage nextSyncStart(OffsetDateTime nextSyncStart) { + this.nextSyncStart = Optional.ofNullable(nextSyncStart); + return this; + } + + @Override + @JsonSetter(value = "next_sync_start", nulls = Nulls.SKIP) + public _FinalStage nextSyncStart(Optional nextSyncStart) { + this.nextSyncStart = nextSyncStart; + return this; + } + + @Override + public _FinalStage lastSyncStart(OffsetDateTime lastSyncStart) { + this.lastSyncStart = Optional.ofNullable(lastSyncStart); + return this; + } + + @Override + @JsonSetter(value = "last_sync_start", nulls = Nulls.SKIP) + public _FinalStage lastSyncStart(Optional lastSyncStart) { + this.lastSyncStart = lastSyncStart; + return this; + } + + @Override + public SyncStatus build() { + return new SyncStatus( + modelName, + modelId, + lastSyncStart, + nextSyncStart, + status, + isInitialSync, + selectiveSyncConfigurationsUsage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/SyncStatusStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/SyncStatusStatusEnum.java new file mode 100644 index 000000000..69e9b2a32 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/SyncStatusStatusEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/Tag.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/Tag.java new file mode 100644 index 000000000..1d300b938 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/Tag.java @@ -0,0 +1,290 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash( + this.remoteId, + this.createdAt, + this.modifiedAt, + this.id, + this.name, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @Override + 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/legacy/api/resources/ticketing/types/Team.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/Team.java new file mode 100644 index 000000000..31479522d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/Team.java @@ -0,0 +1,319 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ticketing/types/Ticket.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/Ticket.java new file mode 100644 index 000000000..480a07dc2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/Ticket.java @@ -0,0 +1,870 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Ticket.Builder.class) +public final class Ticket { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional>> assignees; + + private final Optional>> assignedTeams; + + private final Optional creator; + + private final Optional dueDate; + + private final Optional status; + + private final Optional description; + + private final Optional>> collections; + + private final Optional ticketType; + + private final Optional account; + + private final Optional contact; + + private final Optional parentTicket; + + private final Optional>> attachments; + + private final Optional>> tags; + + private final Optional>> roles; + + private final Optional remoteCreatedAt; + + private final Optional remoteUpdatedAt; + + private final Optional completedAt; + + private final Optional remoteWasDeleted; + + private final Optional ticketUrl; + + private final Optional priority; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private Ticket( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional>> assignees, + Optional>> assignedTeams, + Optional creator, + Optional dueDate, + Optional status, + Optional description, + Optional>> collections, + Optional ticketType, + Optional account, + Optional contact, + Optional parentTicket, + Optional>> attachments, + Optional>> tags, + Optional>> roles, + Optional remoteCreatedAt, + Optional remoteUpdatedAt, + Optional completedAt, + Optional remoteWasDeleted, + Optional ticketUrl, + Optional priority, + Optional> fieldMappings, + Optional> remoteData, + Optional> remoteFields, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.assignees = assignees; + this.assignedTeams = assignedTeams; + this.creator = creator; + this.dueDate = dueDate; + this.status = status; + this.description = description; + this.collections = collections; + this.ticketType = ticketType; + this.account = account; + this.contact = contact; + this.parentTicket = parentTicket; + this.attachments = attachments; + this.tags = tags; + this.roles = roles; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteUpdatedAt = remoteUpdatedAt; + this.completedAt = completedAt; + this.remoteWasDeleted = remoteWasDeleted; + this.ticketUrl = ticketUrl; + this.priority = priority; + 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 ticket's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The individual Users who are assigned to this ticket. This does not include Users who just have view access to this ticket. + */ + @JsonProperty("assignees") + public Optional>> getAssignees() { + return assignees; + } + + /** + * @return The Teams that are assigned to this ticket. This does not include Teams who just have view access to this ticket. + */ + @JsonProperty("assigned_teams") + public Optional>> getAssignedTeams() { + return assignedTeams; + } + + /** + * @return The user who created this ticket. + */ + @JsonProperty("creator") + public Optional getCreator() { + return creator; + } + + /** + * @return The ticket's due date. + */ + @JsonProperty("due_date") + public Optional getDueDate() { + return dueDate; + } + + /** + * @return The current status of the ticket. + *
    + *
  • OPEN - OPEN
  • + *
  • CLOSED - CLOSED
  • + *
  • IN_PROGRESS - IN_PROGRESS
  • + *
  • ON_HOLD - ON_HOLD
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The ticket’s description. HTML version of description is mapped if supported by the third-party platform. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The Collections that this Ticket is included in. + */ + @JsonProperty("collections") + public Optional>> getCollections() { + return collections; + } + + /** + * @return The sub category of the ticket within the 3rd party system. Examples include incident, task, subtask or to-do. + */ + @JsonProperty("ticket_type") + public Optional getTicketType() { + return ticketType; + } + + /** + * @return The account associated with the ticket. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The contact associated with the ticket. + */ + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + + /** + * @return The ticket's parent ticket. + */ + @JsonProperty("parent_ticket") + public Optional getParentTicket() { + return parentTicket; + } + + @JsonProperty("attachments") + public Optional>> getAttachments() { + return attachments; + } + + @JsonProperty("tags") + public Optional>> getTags() { + return tags; + } + + @JsonProperty("roles") + public Optional>> getRoles() { + return roles; + } + + /** + * @return When the third party's ticket was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the third party's ticket was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @return When the ticket was completed. + */ + @JsonProperty("completed_at") + public Optional getCompletedAt() { + return completedAt; + } + + /** + * @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 The 3rd party url of the Ticket. + */ + @JsonProperty("ticket_url") + public Optional getTicketUrl() { + return ticketUrl; + } + + /** + * @return The priority or urgency of the Ticket. + *
    + *
  • URGENT - URGENT
  • + *
  • HIGH - HIGH
  • + *
  • NORMAL - NORMAL
  • + *
  • LOW - LOW
  • + *
+ */ + @JsonProperty("priority") + public Optional getPriority() { + return priority; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Ticket && equalTo((Ticket) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Ticket other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && assignees.equals(other.assignees) + && assignedTeams.equals(other.assignedTeams) + && creator.equals(other.creator) + && dueDate.equals(other.dueDate) + && status.equals(other.status) + && description.equals(other.description) + && collections.equals(other.collections) + && ticketType.equals(other.ticketType) + && account.equals(other.account) + && contact.equals(other.contact) + && parentTicket.equals(other.parentTicket) + && attachments.equals(other.attachments) + && tags.equals(other.tags) + && roles.equals(other.roles) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && completedAt.equals(other.completedAt) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && ticketUrl.equals(other.ticketUrl) + && priority.equals(other.priority) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.assignees, + this.assignedTeams, + this.creator, + this.dueDate, + this.status, + this.description, + this.collections, + this.ticketType, + this.account, + this.contact, + this.parentTicket, + this.attachments, + this.tags, + this.roles, + this.remoteCreatedAt, + this.remoteUpdatedAt, + this.completedAt, + this.remoteWasDeleted, + this.ticketUrl, + this.priority, + this.fieldMappings, + this.remoteData, + this.remoteFields); + } + + @Override + 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>> assignees = Optional.empty(); + + private Optional>> assignedTeams = Optional.empty(); + + private Optional creator = Optional.empty(); + + private Optional dueDate = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional>> collections = Optional.empty(); + + private Optional ticketType = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional contact = Optional.empty(); + + private Optional parentTicket = Optional.empty(); + + private Optional>> attachments = Optional.empty(); + + private Optional>> tags = Optional.empty(); + + private Optional>> roles = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional completedAt = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional ticketUrl = Optional.empty(); + + private Optional priority = 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(Ticket other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + assignees(other.getAssignees()); + assignedTeams(other.getAssignedTeams()); + creator(other.getCreator()); + dueDate(other.getDueDate()); + status(other.getStatus()); + description(other.getDescription()); + collections(other.getCollections()); + ticketType(other.getTicketType()); + account(other.getAccount()); + contact(other.getContact()); + parentTicket(other.getParentTicket()); + attachments(other.getAttachments()); + tags(other.getTags()); + roles(other.getRoles()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + completedAt(other.getCompletedAt()); + remoteWasDeleted(other.getRemoteWasDeleted()); + ticketUrl(other.getTicketUrl()); + priority(other.getPriority()); + 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 = "assignees", nulls = Nulls.SKIP) + public Builder assignees(Optional>> assignees) { + this.assignees = assignees; + return this; + } + + public Builder assignees(List> assignees) { + this.assignees = Optional.ofNullable(assignees); + return this; + } + + @JsonSetter(value = "assigned_teams", nulls = Nulls.SKIP) + public Builder assignedTeams(Optional>> assignedTeams) { + this.assignedTeams = assignedTeams; + return this; + } + + public Builder assignedTeams(List> assignedTeams) { + this.assignedTeams = Optional.ofNullable(assignedTeams); + return this; + } + + @JsonSetter(value = "creator", nulls = Nulls.SKIP) + public Builder creator(Optional creator) { + this.creator = creator; + return this; + } + + public Builder creator(TicketCreator creator) { + this.creator = Optional.ofNullable(creator); + return this; + } + + @JsonSetter(value = "due_date", nulls = Nulls.SKIP) + public Builder dueDate(Optional dueDate) { + this.dueDate = dueDate; + return this; + } + + public Builder dueDate(OffsetDateTime dueDate) { + this.dueDate = Optional.ofNullable(dueDate); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(TicketStatus status) { + this.status = Optional.ofNullable(status); + 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 = "collections", nulls = Nulls.SKIP) + public Builder collections(Optional>> collections) { + this.collections = collections; + return this; + } + + public Builder collections(List> collections) { + this.collections = Optional.ofNullable(collections); + return this; + } + + @JsonSetter(value = "ticket_type", nulls = Nulls.SKIP) + public Builder ticketType(Optional ticketType) { + this.ticketType = ticketType; + return this; + } + + public Builder ticketType(String ticketType) { + this.ticketType = Optional.ofNullable(ticketType); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(TicketAccount 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(TicketContact contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "parent_ticket", nulls = Nulls.SKIP) + public Builder parentTicket(Optional parentTicket) { + this.parentTicket = parentTicket; + return this; + } + + public Builder parentTicket(TicketParentTicket parentTicket) { + this.parentTicket = Optional.ofNullable(parentTicket); + return this; + } + + @JsonSetter(value = "attachments", nulls = Nulls.SKIP) + public Builder attachments(Optional>> attachments) { + this.attachments = attachments; + return this; + } + + public Builder attachments(List> attachments) { + this.attachments = Optional.ofNullable(attachments); + return this; + } + + @JsonSetter(value = "tags", nulls = Nulls.SKIP) + public Builder tags(Optional>> tags) { + this.tags = tags; + return this; + } + + public Builder tags(List> tags) { + this.tags = Optional.ofNullable(tags); + 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 = "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_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 = "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; + } + + @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 = "ticket_url", nulls = Nulls.SKIP) + public Builder ticketUrl(Optional ticketUrl) { + this.ticketUrl = ticketUrl; + return this; + } + + public Builder ticketUrl(String ticketUrl) { + this.ticketUrl = Optional.ofNullable(ticketUrl); + return this; + } + + @JsonSetter(value = "priority", nulls = Nulls.SKIP) + public Builder priority(Optional priority) { + this.priority = priority; + return this; + } + + public Builder priority(TicketPriority priority) { + this.priority = Optional.ofNullable(priority); + 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 Ticket build() { + return new Ticket( + id, + remoteId, + createdAt, + modifiedAt, + name, + assignees, + assignedTeams, + creator, + dueDate, + status, + description, + collections, + ticketType, + account, + contact, + parentTicket, + attachments, + tags, + roles, + remoteCreatedAt, + remoteUpdatedAt, + completedAt, + remoteWasDeleted, + ticketUrl, + priority, + fieldMappings, + remoteData, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketAccessEnum.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketAccessEnum.java new file mode 100644 index 000000000..11a780144 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketAccessEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TicketAccessEnum { + ALL("ALL"), + + ASSIGNED_ONLY("ASSIGNED_ONLY"), + + TEAM_ONLY("TEAM_ONLY"); + + private final String value; + + TicketAccessEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketAccount.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketAccount.java new file mode 100644 index 000000000..20e65e332 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TicketAccount.Deserializer.class) +public final class TicketAccount { + private final Object value; + + private final int type; + + private TicketAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketAccount && equalTo((TicketAccount) other); + } + + private boolean equalTo(TicketAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TicketAccount of(String value) { + return new TicketAccount(value, 0); + } + + public static TicketAccount of(Account value) { + return new TicketAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TicketAccount.class); + } + + @Override + public TicketAccount 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/legacy/api/resources/ticketing/types/TicketActionsEnum.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketActionsEnum.java new file mode 100644 index 000000000..f55338d75 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketActionsEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TicketActionsEnum { + VIEW("VIEW"), + + CREATE("CREATE"), + + EDIT("EDIT"), + + DELETE("DELETE"), + + CLOSE("CLOSE"), + + ASSIGN("ASSIGN"); + + private final String value; + + TicketActionsEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketAssignedTeamsItem.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketAssignedTeamsItem.java new file mode 100644 index 000000000..cfe3ceab2 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketAssignedTeamsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TicketAssignedTeamsItem.Deserializer.class) +public final class TicketAssignedTeamsItem { + private final Object value; + + private final int type; + + private TicketAssignedTeamsItem(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketAssignedTeamsItem && equalTo((TicketAssignedTeamsItem) other); + } + + private boolean equalTo(TicketAssignedTeamsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TicketAssignedTeamsItem of(String value) { + return new TicketAssignedTeamsItem(value, 0); + } + + public static TicketAssignedTeamsItem of(Team value) { + return new TicketAssignedTeamsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Team value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TicketAssignedTeamsItem.class); + } + + @Override + public TicketAssignedTeamsItem 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/legacy/api/resources/ticketing/types/TicketAssigneesItem.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketAssigneesItem.java new file mode 100644 index 000000000..3ccdce06b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketAssigneesItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TicketAssigneesItem.Deserializer.class) +public final class TicketAssigneesItem { + private final Object value; + + private final int type; + + private TicketAssigneesItem(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((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketAssigneesItem && equalTo((TicketAssigneesItem) other); + } + + private boolean equalTo(TicketAssigneesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TicketAssigneesItem of(String value) { + return new TicketAssigneesItem(value, 0); + } + + public static TicketAssigneesItem of(User value) { + return new TicketAssigneesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TicketAssigneesItem.class); + } + + @Override + public TicketAssigneesItem 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, User.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketAttachmentsItem.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketAttachmentsItem.java new file mode 100644 index 000000000..a3909de52 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketAttachmentsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TicketAttachmentsItem.Deserializer.class) +public final class TicketAttachmentsItem { + private final Object value; + + private final int type; + + private TicketAttachmentsItem(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((Attachment) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketAttachmentsItem && equalTo((TicketAttachmentsItem) other); + } + + private boolean equalTo(TicketAttachmentsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TicketAttachmentsItem of(String value) { + return new TicketAttachmentsItem(value, 0); + } + + public static TicketAttachmentsItem of(Attachment value) { + return new TicketAttachmentsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Attachment value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TicketAttachmentsItem.class); + } + + @Override + public TicketAttachmentsItem 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, Attachment.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketCollectionsItem.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketCollectionsItem.java new file mode 100644 index 000000000..36c1e939a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketCollectionsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TicketCollectionsItem.Deserializer.class) +public final class TicketCollectionsItem { + private final Object value; + + private final int type; + + private TicketCollectionsItem(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((Collection) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketCollectionsItem && equalTo((TicketCollectionsItem) other); + } + + private boolean equalTo(TicketCollectionsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TicketCollectionsItem of(String value) { + return new TicketCollectionsItem(value, 0); + } + + public static TicketCollectionsItem of(Collection value) { + return new TicketCollectionsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Collection value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TicketCollectionsItem.class); + } + + @Override + public TicketCollectionsItem 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, Collection.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketContact.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketContact.java new file mode 100644 index 000000000..b420812c9 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketContact.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TicketContact.Deserializer.class) +public final class TicketContact { + private final Object value; + + private final int type; + + private TicketContact(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketContact && equalTo((TicketContact) other); + } + + private boolean equalTo(TicketContact other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TicketContact of(String value) { + return new TicketContact(value, 0); + } + + public static TicketContact of(Contact value) { + return new TicketContact(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TicketContact.class); + } + + @Override + public TicketContact 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketCreator.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketCreator.java new file mode 100644 index 000000000..7df8f2a9a --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketCreator.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TicketCreator.Deserializer.class) +public final class TicketCreator { + private final Object value; + + private final int type; + + private TicketCreator(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((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketCreator && equalTo((TicketCreator) other); + } + + private boolean equalTo(TicketCreator other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TicketCreator of(String value) { + return new TicketCreator(value, 0); + } + + public static TicketCreator of(User value) { + return new TicketCreator(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TicketCreator.class); + } + + @Override + public TicketCreator 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, User.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketParentTicket.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketParentTicket.java new file mode 100644 index 000000000..26253b924 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketParentTicket.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TicketParentTicket.Deserializer.class) +public final class TicketParentTicket { + private final Object value; + + private final int type; + + private TicketParentTicket(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((Ticket) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketParentTicket && equalTo((TicketParentTicket) other); + } + + private boolean equalTo(TicketParentTicket other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TicketParentTicket of(String value) { + return new TicketParentTicket(value, 0); + } + + public static TicketParentTicket of(Ticket value) { + return new TicketParentTicket(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Ticket value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TicketParentTicket.class); + } + + @Override + public TicketParentTicket 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, Ticket.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketPriority.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketPriority.java new file mode 100644 index 000000000..529cb8c30 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketPriority.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ticketing/types/TicketRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequest.java new file mode 100644 index 000000000..af059208b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequest.java @@ -0,0 +1,670 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TicketRequest.Builder.class) +public final class TicketRequest { + private final Optional name; + + private final Optional>> assignees; + + private final Optional>> assignedTeams; + + private final Optional creator; + + private final Optional dueDate; + + private final Optional status; + + private final Optional description; + + private final Optional>> collections; + + private final Optional ticketType; + + private final Optional account; + + private final Optional contact; + + private final Optional parentTicket; + + private final Optional>> attachments; + + private final Optional>> tags; + + private final Optional>> roles; + + private final Optional completedAt; + + private final Optional ticketUrl; + + private final Optional priority; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private TicketRequest( + Optional name, + Optional>> assignees, + Optional>> assignedTeams, + Optional creator, + Optional dueDate, + Optional status, + Optional description, + Optional>> collections, + Optional ticketType, + Optional account, + Optional contact, + Optional parentTicket, + Optional>> attachments, + Optional>> tags, + Optional>> roles, + Optional completedAt, + Optional ticketUrl, + Optional priority, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.name = name; + this.assignees = assignees; + this.assignedTeams = assignedTeams; + this.creator = creator; + this.dueDate = dueDate; + this.status = status; + this.description = description; + this.collections = collections; + this.ticketType = ticketType; + this.account = account; + this.contact = contact; + this.parentTicket = parentTicket; + this.attachments = attachments; + this.tags = tags; + this.roles = roles; + this.completedAt = completedAt; + this.ticketUrl = ticketUrl; + this.priority = priority; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ticket's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The individual Users who are assigned to this ticket. This does not include Users who just have view access to this ticket. + */ + @JsonProperty("assignees") + public Optional>> getAssignees() { + return assignees; + } + + /** + * @return The Teams that are assigned to this ticket. This does not include Teams who just have view access to this ticket. + */ + @JsonProperty("assigned_teams") + public Optional>> getAssignedTeams() { + return assignedTeams; + } + + /** + * @return The user who created this ticket. + */ + @JsonProperty("creator") + public Optional getCreator() { + return creator; + } + + /** + * @return The ticket's due date. + */ + @JsonProperty("due_date") + public Optional getDueDate() { + return dueDate; + } + + /** + * @return The current status of the ticket. + *
    + *
  • OPEN - OPEN
  • + *
  • CLOSED - CLOSED
  • + *
  • IN_PROGRESS - IN_PROGRESS
  • + *
  • ON_HOLD - ON_HOLD
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The ticket’s description. HTML version of description is mapped if supported by the third-party platform. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The Collections that this Ticket is included in. + */ + @JsonProperty("collections") + public Optional>> getCollections() { + return collections; + } + + /** + * @return The sub category of the ticket within the 3rd party system. Examples include incident, task, subtask or to-do. + */ + @JsonProperty("ticket_type") + public Optional getTicketType() { + return ticketType; + } + + /** + * @return The account associated with the ticket. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The contact associated with the ticket. + */ + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + + /** + * @return The ticket's parent ticket. + */ + @JsonProperty("parent_ticket") + public Optional getParentTicket() { + return parentTicket; + } + + @JsonProperty("attachments") + public Optional>> getAttachments() { + return attachments; + } + + @JsonProperty("tags") + public Optional>> getTags() { + return tags; + } + + @JsonProperty("roles") + public Optional>> getRoles() { + return roles; + } + + /** + * @return When the ticket was completed. + */ + @JsonProperty("completed_at") + public Optional getCompletedAt() { + return completedAt; + } + + /** + * @return The 3rd party url of the Ticket. + */ + @JsonProperty("ticket_url") + public Optional getTicketUrl() { + return ticketUrl; + } + + /** + * @return The priority or urgency of the Ticket. + *
    + *
  • URGENT - URGENT
  • + *
  • HIGH - HIGH
  • + *
  • NORMAL - NORMAL
  • + *
  • LOW - LOW
  • + *
+ */ + @JsonProperty("priority") + public Optional getPriority() { + return priority; + } + + @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; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketRequest && equalTo((TicketRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TicketRequest other) { + return name.equals(other.name) + && assignees.equals(other.assignees) + && assignedTeams.equals(other.assignedTeams) + && creator.equals(other.creator) + && dueDate.equals(other.dueDate) + && status.equals(other.status) + && description.equals(other.description) + && collections.equals(other.collections) + && ticketType.equals(other.ticketType) + && account.equals(other.account) + && contact.equals(other.contact) + && parentTicket.equals(other.parentTicket) + && attachments.equals(other.attachments) + && tags.equals(other.tags) + && roles.equals(other.roles) + && completedAt.equals(other.completedAt) + && ticketUrl.equals(other.ticketUrl) + && priority.equals(other.priority) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @Override + public int hashCode() { + return Objects.hash( + this.name, + this.assignees, + this.assignedTeams, + this.creator, + this.dueDate, + this.status, + this.description, + this.collections, + this.ticketType, + this.account, + this.contact, + this.parentTicket, + this.attachments, + this.tags, + this.roles, + this.completedAt, + this.ticketUrl, + this.priority, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @Override + 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>> assignees = Optional.empty(); + + private Optional>> assignedTeams = Optional.empty(); + + private Optional creator = Optional.empty(); + + private Optional dueDate = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional>> collections = Optional.empty(); + + private Optional ticketType = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional contact = Optional.empty(); + + private Optional parentTicket = Optional.empty(); + + private Optional>> attachments = Optional.empty(); + + private Optional>> tags = Optional.empty(); + + private Optional>> roles = Optional.empty(); + + private Optional completedAt = Optional.empty(); + + private Optional ticketUrl = Optional.empty(); + + private Optional priority = 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(TicketRequest other) { + name(other.getName()); + assignees(other.getAssignees()); + assignedTeams(other.getAssignedTeams()); + creator(other.getCreator()); + dueDate(other.getDueDate()); + status(other.getStatus()); + description(other.getDescription()); + collections(other.getCollections()); + ticketType(other.getTicketType()); + account(other.getAccount()); + contact(other.getContact()); + parentTicket(other.getParentTicket()); + attachments(other.getAttachments()); + tags(other.getTags()); + roles(other.getRoles()); + completedAt(other.getCompletedAt()); + ticketUrl(other.getTicketUrl()); + priority(other.getPriority()); + 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 = "assignees", nulls = Nulls.SKIP) + public Builder assignees(Optional>> assignees) { + this.assignees = assignees; + return this; + } + + public Builder assignees(List> assignees) { + this.assignees = Optional.ofNullable(assignees); + return this; + } + + @JsonSetter(value = "assigned_teams", nulls = Nulls.SKIP) + public Builder assignedTeams(Optional>> assignedTeams) { + this.assignedTeams = assignedTeams; + return this; + } + + public Builder assignedTeams(List> assignedTeams) { + this.assignedTeams = Optional.ofNullable(assignedTeams); + return this; + } + + @JsonSetter(value = "creator", nulls = Nulls.SKIP) + public Builder creator(Optional creator) { + this.creator = creator; + return this; + } + + public Builder creator(TicketRequestCreator creator) { + this.creator = Optional.ofNullable(creator); + return this; + } + + @JsonSetter(value = "due_date", nulls = Nulls.SKIP) + public Builder dueDate(Optional dueDate) { + this.dueDate = dueDate; + return this; + } + + public Builder dueDate(OffsetDateTime dueDate) { + this.dueDate = Optional.ofNullable(dueDate); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(TicketRequestStatus status) { + this.status = Optional.ofNullable(status); + 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 = "collections", nulls = Nulls.SKIP) + public Builder collections(Optional>> collections) { + this.collections = collections; + return this; + } + + public Builder collections(List> collections) { + this.collections = Optional.ofNullable(collections); + return this; + } + + @JsonSetter(value = "ticket_type", nulls = Nulls.SKIP) + public Builder ticketType(Optional ticketType) { + this.ticketType = ticketType; + return this; + } + + public Builder ticketType(String ticketType) { + this.ticketType = Optional.ofNullable(ticketType); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(TicketRequestAccount 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(TicketRequestContact contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "parent_ticket", nulls = Nulls.SKIP) + public Builder parentTicket(Optional parentTicket) { + this.parentTicket = parentTicket; + return this; + } + + public Builder parentTicket(TicketRequestParentTicket parentTicket) { + this.parentTicket = Optional.ofNullable(parentTicket); + return this; + } + + @JsonSetter(value = "attachments", nulls = Nulls.SKIP) + public Builder attachments(Optional>> attachments) { + this.attachments = attachments; + return this; + } + + public Builder attachments(List> attachments) { + this.attachments = Optional.ofNullable(attachments); + return this; + } + + @JsonSetter(value = "tags", nulls = Nulls.SKIP) + public Builder tags(Optional>> tags) { + this.tags = tags; + return this; + } + + public Builder tags(List> tags) { + this.tags = Optional.ofNullable(tags); + 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 = "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; + } + + @JsonSetter(value = "ticket_url", nulls = Nulls.SKIP) + public Builder ticketUrl(Optional ticketUrl) { + this.ticketUrl = ticketUrl; + return this; + } + + public Builder ticketUrl(String ticketUrl) { + this.ticketUrl = Optional.ofNullable(ticketUrl); + return this; + } + + @JsonSetter(value = "priority", nulls = Nulls.SKIP) + public Builder priority(Optional priority) { + this.priority = priority; + return this; + } + + public Builder priority(TicketRequestPriority priority) { + this.priority = Optional.ofNullable(priority); + 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 TicketRequest build() { + return new TicketRequest( + name, + assignees, + assignedTeams, + creator, + dueDate, + status, + description, + collections, + ticketType, + account, + contact, + parentTicket, + attachments, + tags, + roles, + completedAt, + ticketUrl, + priority, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestAccount.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestAccount.java new file mode 100644 index 000000000..206c2ee2e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestAccount.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TicketRequestAccount.Deserializer.class) +public final class TicketRequestAccount { + private final Object value; + + private final int type; + + private TicketRequestAccount(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketRequestAccount && equalTo((TicketRequestAccount) other); + } + + private boolean equalTo(TicketRequestAccount other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TicketRequestAccount of(String value) { + return new TicketRequestAccount(value, 0); + } + + public static TicketRequestAccount of(Account value) { + return new TicketRequestAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TicketRequestAccount.class); + } + + @Override + public TicketRequestAccount 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/legacy/api/resources/ticketing/types/TicketRequestAssignedTeamsItem.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestAssignedTeamsItem.java new file mode 100644 index 000000000..3d10982ad --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestAssignedTeamsItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TicketRequestAssignedTeamsItem.Deserializer.class) +public final class TicketRequestAssignedTeamsItem { + private final Object value; + + private final int type; + + private TicketRequestAssignedTeamsItem(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketRequestAssignedTeamsItem && equalTo((TicketRequestAssignedTeamsItem) other); + } + + private boolean equalTo(TicketRequestAssignedTeamsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TicketRequestAssignedTeamsItem of(String value) { + return new TicketRequestAssignedTeamsItem(value, 0); + } + + public static TicketRequestAssignedTeamsItem of(Team value) { + return new TicketRequestAssignedTeamsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Team value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TicketRequestAssignedTeamsItem.class); + } + + @Override + public TicketRequestAssignedTeamsItem 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/legacy/api/resources/ticketing/types/TicketRequestAssigneesItem.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestAssigneesItem.java new file mode 100644 index 000000000..adc5b013d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestAssigneesItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TicketRequestAssigneesItem.Deserializer.class) +public final class TicketRequestAssigneesItem { + private final Object value; + + private final int type; + + private TicketRequestAssigneesItem(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((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketRequestAssigneesItem && equalTo((TicketRequestAssigneesItem) other); + } + + private boolean equalTo(TicketRequestAssigneesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TicketRequestAssigneesItem of(String value) { + return new TicketRequestAssigneesItem(value, 0); + } + + public static TicketRequestAssigneesItem of(User value) { + return new TicketRequestAssigneesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TicketRequestAssigneesItem.class); + } + + @Override + public TicketRequestAssigneesItem 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, User.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestAttachmentsItem.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestAttachmentsItem.java new file mode 100644 index 000000000..95463df51 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestAttachmentsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TicketRequestAttachmentsItem.Deserializer.class) +public final class TicketRequestAttachmentsItem { + private final Object value; + + private final int type; + + private TicketRequestAttachmentsItem(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((Attachment) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketRequestAttachmentsItem && equalTo((TicketRequestAttachmentsItem) other); + } + + private boolean equalTo(TicketRequestAttachmentsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TicketRequestAttachmentsItem of(String value) { + return new TicketRequestAttachmentsItem(value, 0); + } + + public static TicketRequestAttachmentsItem of(Attachment value) { + return new TicketRequestAttachmentsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Attachment value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TicketRequestAttachmentsItem.class); + } + + @Override + public TicketRequestAttachmentsItem 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, Attachment.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestCollectionsItem.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestCollectionsItem.java new file mode 100644 index 000000000..462a998d7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestCollectionsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TicketRequestCollectionsItem.Deserializer.class) +public final class TicketRequestCollectionsItem { + private final Object value; + + private final int type; + + private TicketRequestCollectionsItem(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((Collection) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketRequestCollectionsItem && equalTo((TicketRequestCollectionsItem) other); + } + + private boolean equalTo(TicketRequestCollectionsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TicketRequestCollectionsItem of(String value) { + return new TicketRequestCollectionsItem(value, 0); + } + + public static TicketRequestCollectionsItem of(Collection value) { + return new TicketRequestCollectionsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Collection value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TicketRequestCollectionsItem.class); + } + + @Override + public TicketRequestCollectionsItem 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, Collection.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestContact.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestContact.java new file mode 100644 index 000000000..1694d5607 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestContact.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TicketRequestContact.Deserializer.class) +public final class TicketRequestContact { + private final Object value; + + private final int type; + + private TicketRequestContact(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((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketRequestContact && equalTo((TicketRequestContact) other); + } + + private boolean equalTo(TicketRequestContact other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TicketRequestContact of(String value) { + return new TicketRequestContact(value, 0); + } + + public static TicketRequestContact of(Contact value) { + return new TicketRequestContact(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TicketRequestContact.class); + } + + @Override + public TicketRequestContact 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, Contact.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestCreator.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestCreator.java new file mode 100644 index 000000000..f5b84407b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestCreator.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TicketRequestCreator.Deserializer.class) +public final class TicketRequestCreator { + private final Object value; + + private final int type; + + private TicketRequestCreator(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((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketRequestCreator && equalTo((TicketRequestCreator) other); + } + + private boolean equalTo(TicketRequestCreator other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TicketRequestCreator of(String value) { + return new TicketRequestCreator(value, 0); + } + + public static TicketRequestCreator of(User value) { + return new TicketRequestCreator(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TicketRequestCreator.class); + } + + @Override + public TicketRequestCreator 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, User.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestParentTicket.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestParentTicket.java new file mode 100644 index 000000000..f6634ad56 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestParentTicket.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TicketRequestParentTicket.Deserializer.class) +public final class TicketRequestParentTicket { + private final Object value; + + private final int type; + + private TicketRequestParentTicket(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((Ticket) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketRequestParentTicket && equalTo((TicketRequestParentTicket) other); + } + + private boolean equalTo(TicketRequestParentTicket other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static TicketRequestParentTicket of(String value) { + return new TicketRequestParentTicket(value, 0); + } + + public static TicketRequestParentTicket of(Ticket value) { + return new TicketRequestParentTicket(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Ticket value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TicketRequestParentTicket.class); + } + + @Override + public TicketRequestParentTicket 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, Ticket.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestPriority.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestPriority.java new file mode 100644 index 000000000..96708a130 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestPriority.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ticketing/types/TicketRequestStatus.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestStatus.java new file mode 100644 index 000000000..d5df16ca7 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketRequestStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ticketing/types/TicketResponse.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketResponse.java new file mode 100644 index 000000000..cbe7ebe6b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TicketResponse.Builder.class) +public final class TicketResponse { + private final Ticket model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private TicketResponse( + Ticket 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 Ticket getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketResponse && equalTo((TicketResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TicketResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull Ticket model); + + Builder from(TicketResponse other); + } + + public interface _FinalStage { + TicketResponse 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 Ticket model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(TicketResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull Ticket model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public TicketResponse build() { + return new TicketResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketStatus.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketStatus.java new file mode 100644 index 000000000..f408b906d --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.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."); + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @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); + } + + @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/legacy/api/resources/ticketing/types/TicketStatusEnum.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketStatusEnum.java new file mode 100644 index 000000000..6d132c2fb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketStatusEnum.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TicketStatusEnum { + OPEN("OPEN"), + + CLOSED("CLOSED"), + + IN_PROGRESS("IN_PROGRESS"), + + ON_HOLD("ON_HOLD"); + + private final String value; + + TicketStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketingAttachmentResponse.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketingAttachmentResponse.java new file mode 100644 index 000000000..c700374e1 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketingAttachmentResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TicketingAttachmentResponse.Builder.class) +public final class TicketingAttachmentResponse { + private final Attachment model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private TicketingAttachmentResponse( + Attachment 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 Attachment getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketingAttachmentResponse && equalTo((TicketingAttachmentResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TicketingAttachmentResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull Attachment model); + + Builder from(TicketingAttachmentResponse other); + } + + public interface _FinalStage { + TicketingAttachmentResponse 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 Attachment model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(TicketingAttachmentResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull Attachment model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public TicketingAttachmentResponse build() { + return new TicketingAttachmentResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketingContactResponse.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketingContactResponse.java new file mode 100644 index 000000000..ab1c17f2e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/TicketingContactResponse.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.util.*; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TicketingContactResponse.Builder.class) +public final class TicketingContactResponse { + private final Contact model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private TicketingContactResponse( + Contact 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 Contact getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketingContactResponse && equalTo((TicketingContactResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TicketingContactResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull Contact model); + + Builder from(TicketingContactResponse other); + } + + public interface _FinalStage { + TicketingContactResponse 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 Contact model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @Override + public Builder from(TicketingContactResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @Override + @JsonSetter("model") + public _FinalStage model(@NotNull Contact model) { + this.model = model; + return this; + } + + @Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @Override + public TicketingContactResponse build() { + return new TicketingContactResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/User.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/User.java new file mode 100644 index 000000000..88fb6cc2e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/User.java @@ -0,0 +1,429 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.*; + +@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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ticketing/types/UserRolesItem.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/UserRolesItem.java new file mode 100644 index 000000000..5b726949f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/UserRolesItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = UserRolesItem.Deserializer.class) +public final class UserRolesItem { + private final Object value; + + private final int type; + + private UserRolesItem(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((Role) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserRolesItem && equalTo((UserRolesItem) other); + } + + private boolean equalTo(UserRolesItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static UserRolesItem of(String value) { + return new UserRolesItem(value, 0); + } + + public static UserRolesItem of(Role value) { + return new UserRolesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Role value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(UserRolesItem.class); + } + + @Override + public UserRolesItem 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, Role.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/UserTeamsItem.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/UserTeamsItem.java new file mode 100644 index 000000000..967cbbbc0 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/UserTeamsItem.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = UserTeamsItem.Deserializer.class) +public final class UserTeamsItem { + private final Object value; + + private final int type; + + private UserTeamsItem(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserTeamsItem && equalTo((UserTeamsItem) other); + } + + private boolean equalTo(UserTeamsItem other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static UserTeamsItem of(String value) { + return new UserTeamsItem(value, 0); + } + + public static UserTeamsItem of(Team value) { + return new UserTeamsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Team value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(UserTeamsItem.class); + } + + @Override + public UserTeamsItem 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/legacy/api/resources/ticketing/types/ValidationProblemSource.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ValidationProblemSource.java new file mode 100644 index 000000000..6cf199746 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ValidationProblemSource.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.pointer); + } + + @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() {} + + @Override + public Builder from(ValidationProblemSource other) { + pointer(other.getPointer()); + return this; + } + + @Override + @JsonSetter("pointer") + public _FinalStage pointer(@NotNull String pointer) { + this.pointer = pointer; + return this; + } + + @Override + public ValidationProblemSource build() { + return new ValidationProblemSource(pointer, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/Viewer.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/Viewer.java new file mode 100644 index 000000000..2a9c8f44e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/Viewer.java @@ -0,0 +1,227 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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 = Viewer.Builder.class) +public final class Viewer { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional team; + + private final Optional user; + + private final Map additionalProperties; + + private Viewer( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional team, + Optional user, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.team = team; + this.user = user; + 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 this Viewer belongs to. + */ + @JsonProperty("team") + public Optional getTeam() { + return team; + } + + /** + * @return The User this Viewer belongs to. + */ + @JsonProperty("user") + public Optional getUser() { + return user; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Viewer && equalTo((Viewer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Viewer other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && team.equals(other.team) + && user.equals(other.user); + } + + @Override + public int hashCode() { + return Objects.hash(this.id, this.remoteId, this.createdAt, this.modifiedAt, this.team, this.user); + } + + @Override + 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 team = Optional.empty(); + + private Optional user = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Viewer other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + team(other.getTeam()); + user(other.getUser()); + 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 = "team", nulls = Nulls.SKIP) + public Builder team(Optional team) { + this.team = team; + return this; + } + + public Builder team(ViewerTeam team) { + this.team = Optional.ofNullable(team); + return this; + } + + @JsonSetter(value = "user", nulls = Nulls.SKIP) + public Builder user(Optional user) { + this.user = user; + return this; + } + + public Builder user(ViewerUser user) { + this.user = Optional.ofNullable(user); + return this; + } + + public Viewer build() { + return new Viewer(id, remoteId, createdAt, modifiedAt, team, user, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/ViewerTeam.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ViewerTeam.java new file mode 100644 index 000000000..e8a5ac94f --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ViewerTeam.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ViewerTeam.Deserializer.class) +public final class ViewerTeam { + private final Object value; + + private final int type; + + private ViewerTeam(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."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ViewerTeam && equalTo((ViewerTeam) other); + } + + private boolean equalTo(ViewerTeam other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ViewerTeam of(String value) { + return new ViewerTeam(value, 0); + } + + public static ViewerTeam of(Team value) { + return new ViewerTeam(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Team value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ViewerTeam.class); + } + + @Override + public ViewerTeam 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/legacy/api/resources/ticketing/types/ViewerUser.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ViewerUser.java new file mode 100644 index 000000000..1495b185e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/ViewerUser.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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.legacy.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ViewerUser.Deserializer.class) +public final class ViewerUser { + private final Object value; + + private final int type; + + private ViewerUser(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((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ViewerUser && equalTo((ViewerUser) other); + } + + private boolean equalTo(ViewerUser other) { + return value.equals(other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return this.value.toString(); + } + + public static ViewerUser of(String value) { + return new ViewerUser(value, 0); + } + + public static ViewerUser of(User value) { + return new ViewerUser(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ViewerUser.class); + } + + @Override + public ViewerUser 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, User.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/WarningValidationProblem.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/WarningValidationProblem.java new file mode 100644 index 000000000..7f6caba42 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/WarningValidationProblem.java @@ -0,0 +1,178 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.source, this.title, this.detail, this.problemType); + } + + @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() {} + + @Override + public Builder from(WarningValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + return this; + } + + @Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @Override + public WarningValidationProblem build() { + return new WarningValidationProblem(source, title, detail, problemType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/types/WebhookReceiver.java b/src/main/java/com/merge/legacy/api/resources/ticketing/types/WebhookReceiver.java new file mode 100644 index 000000000..b19d741fb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/types/WebhookReceiver.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.types; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @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() {} + + @Override + public Builder from(WebhookReceiver other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @Override + public WebhookReceiver build() { + return new WebhookReceiver(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/users/UsersClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/users/UsersClient.java new file mode 100644 index 000000000..fc48f0e10 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/users/UsersClient.java @@ -0,0 +1,166 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.users; + +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.types.PaginatedUserList; +import com.merge.legacy.api.resources.ticketing.types.User; +import com.merge.legacy.api.resources.ticketing.users.requests.UsersListRequest; +import com.merge.legacy.api.resources.ticketing.users.requests.UsersRetrieveRequest; +import java.io.IOException; +import okhttp3.*; + +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/legacy/api/resources/ticketing/users/requests/UsersListRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/users/requests/UsersListRequest.java new file mode 100644 index 000000000..226d112fb --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/users/requests/UsersListRequest.java @@ -0,0 +1,418 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.users.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @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); + } + + @Override + 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/legacy/api/resources/ticketing/users/requests/UsersRetrieveRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/users/requests/UsersRetrieveRequest.java new file mode 100644 index 000000000..3133d82ce --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/users/requests/UsersRetrieveRequest.java @@ -0,0 +1,121 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.users.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.api.core.ObjectMappers; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData); + } + + @Override + 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/legacy/api/resources/ticketing/users/types/UsersListRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/ticketing/users/types/UsersListRequestExpand.java new file mode 100644 index 000000000..54f5e76f5 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/users/types/UsersListRequestExpand.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/users/types/UsersRetrieveRequestExpand.java b/src/main/java/com/merge/legacy/api/resources/ticketing/users/types/UsersRetrieveRequestExpand.java new file mode 100644 index 000000000..037bfbd79 --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/users/types/UsersRetrieveRequestExpand.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.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 + @Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/legacy/api/resources/ticketing/webhookreceivers/WebhookReceiversClient.java b/src/main/java/com/merge/legacy/api/resources/ticketing/webhookreceivers/WebhookReceiversClient.java new file mode 100644 index 000000000..e465f773b --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/webhookreceivers/WebhookReceiversClient.java @@ -0,0 +1,111 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.webhookreceivers; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.legacy.api.core.*; +import com.merge.legacy.api.resources.ticketing.types.WebhookReceiver; +import com.merge.legacy.api.resources.ticketing.webhookreceivers.requests.WebhookReceiverRequest; +import java.io.IOException; +import java.util.List; +import okhttp3.*; + +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/legacy/api/resources/ticketing/webhookreceivers/requests/WebhookReceiverRequest.java b/src/main/java/com/merge/legacy/api/resources/ticketing/webhookreceivers/requests/WebhookReceiverRequest.java new file mode 100644 index 000000000..329e9700e --- /dev/null +++ b/src/main/java/com/merge/legacy/api/resources/ticketing/webhookreceivers/requests/WebhookReceiverRequest.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.legacy.api.resources.ticketing.webhookreceivers.requests; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.legacy.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; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @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() {} + + @Override + public Builder from(WebhookReceiverRequest other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @Override + public WebhookReceiverRequest build() { + return new WebhookReceiverRequest(event, isActive, key, additionalProperties); + } + } +}