> headers() {
+ return headers;
+ }
+}
diff --git a/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/seed/javaOauthStagedBuilder/core/Stream.java b/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/seed/javaOauthStagedBuilder/core/Stream.java
new file mode 100644
index 000000000000..51e30873f2b7
--- /dev/null
+++ b/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/seed/javaOauthStagedBuilder/core/Stream.java
@@ -0,0 +1,302 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.seed.javaOauthStagedBuilder.core;
+
+import java.io.Closeable;
+import java.io.IOException;
+import java.io.Reader;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+import java.util.Scanner;
+
+/**
+ * The {@code Stream} class implements {@link Iterable} to provide a simple mechanism for reading and parsing
+ * objects of a given type from data streamed via a {@link Reader} using a specified delimiter.
+ *
+ * {@code Stream} assumes that data is being pushed to the provided {@link Reader} asynchronously and utilizes a
+ * {@code Scanner} to block during iteration if the next object is not available.
+ * Iterable stream for parsing JSON and Server-Sent Events (SSE) data.
+ * Supports both newline-delimited JSON and SSE with optional stream termination.
+ *
+ * @param The type of objects in the stream.
+ */
+public final class Stream implements Iterable, Closeable {
+
+ private static final String NEWLINE = "\n";
+ private static final String DATA_PREFIX = "data:";
+
+ public enum StreamType {
+ JSON,
+ SSE
+ }
+
+ private final Class valueType;
+ private final Scanner scanner;
+ private final StreamType streamType;
+ private final String messageTerminator;
+ private final String streamTerminator;
+ private final Reader sseReader;
+ private boolean isClosed = false;
+
+ /**
+ * 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.valueType = valueType;
+ this.scanner = new Scanner(reader).useDelimiter(delimiter);
+ this.streamType = StreamType.JSON;
+ this.messageTerminator = delimiter;
+ this.streamTerminator = null;
+ this.sseReader = null;
+ }
+
+ private Stream(Class valueType, StreamType type, Reader reader, String terminator) {
+ this.valueType = valueType;
+ this.streamType = type;
+ if (type == StreamType.JSON) {
+ this.scanner = new Scanner(reader).useDelimiter(terminator);
+ this.messageTerminator = terminator;
+ this.streamTerminator = null;
+ this.sseReader = null;
+ } else {
+ this.scanner = null;
+ this.messageTerminator = NEWLINE;
+ this.streamTerminator = terminator;
+ this.sseReader = reader;
+ }
+ }
+
+ public static Stream fromJson(Class valueType, Reader reader, String delimiter) {
+ return new Stream<>(valueType, reader, delimiter);
+ }
+
+ public static Stream fromJson(Class valueType, Reader reader) {
+ return new Stream<>(valueType, reader, NEWLINE);
+ }
+
+ public static Stream fromSse(Class valueType, Reader sseReader) {
+ return new Stream<>(valueType, StreamType.SSE, sseReader, null);
+ }
+
+ public static Stream fromSse(Class valueType, Reader sseReader, String streamTerminator) {
+ return new Stream<>(valueType, StreamType.SSE, sseReader, streamTerminator);
+ }
+
+ @Override
+ public void close() throws IOException {
+ if (!isClosed) {
+ isClosed = true;
+ if (scanner != null) {
+ scanner.close();
+ }
+ if (sseReader != null) {
+ sseReader.close();
+ }
+ }
+ }
+
+ private boolean isStreamClosed() {
+ return isClosed;
+ }
+
+ /**
+ * 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() {
+ if (streamType == StreamType.SSE) {
+ return new SSEIterator();
+ } else {
+ return new JsonIterator();
+ }
+ }
+
+ private final class JsonIterator implements 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() {
+ if (isStreamClosed()) {
+ return false;
+ }
+ 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 (isStreamClosed()) {
+ throw new NoSuchElementException("Stream is closed");
+ }
+
+ 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);
+ }
+ }
+ }
+
+ @Override
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+ }
+
+ private final class SSEIterator implements Iterator {
+ private Scanner sseScanner;
+ private T nextItem;
+ private boolean hasNextItem = false;
+ private boolean endOfStream = false;
+ private StringBuilder eventDataBuffer = new StringBuilder();
+ private String currentEventType = null;
+
+ private SSEIterator() {
+ if (sseReader != null && !isStreamClosed()) {
+ this.sseScanner = new Scanner(sseReader);
+ } else {
+ this.endOfStream = true;
+ }
+ }
+
+ @Override
+ public boolean hasNext() {
+ if (isStreamClosed() || endOfStream) {
+ return false;
+ }
+
+ if (hasNextItem) {
+ return true;
+ }
+
+ return readNextMessage();
+ }
+
+ @Override
+ public T next() {
+ if (!hasNext()) {
+ throw new NoSuchElementException("No more elements in stream");
+ }
+
+ T result = nextItem;
+ nextItem = null;
+ hasNextItem = false;
+ return result;
+ }
+
+ @Override
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+
+ private boolean readNextMessage() {
+ if (sseScanner == null || isStreamClosed()) {
+ endOfStream = true;
+ return false;
+ }
+
+ try {
+ while (sseScanner.hasNextLine()) {
+ String line = sseScanner.nextLine();
+
+ if (line.trim().isEmpty()) {
+ if (eventDataBuffer.length() > 0) {
+ try {
+ nextItem = ObjectMappers.JSON_MAPPER.readValue(eventDataBuffer.toString(), valueType);
+ hasNextItem = true;
+ eventDataBuffer.setLength(0);
+ currentEventType = null;
+ return true;
+ } catch (Exception parseEx) {
+ System.err.println("Failed to parse SSE event: " + parseEx.getMessage());
+ eventDataBuffer.setLength(0);
+ currentEventType = null;
+ continue;
+ }
+ }
+ continue;
+ }
+
+ if (line.startsWith(DATA_PREFIX)) {
+ String dataContent = line.substring(DATA_PREFIX.length());
+ if (dataContent.startsWith(" ")) {
+ dataContent = dataContent.substring(1);
+ }
+
+ if (eventDataBuffer.length() == 0
+ && streamTerminator != null
+ && dataContent.trim().equals(streamTerminator)) {
+ endOfStream = true;
+ return false;
+ }
+
+ if (eventDataBuffer.length() > 0) {
+ eventDataBuffer.append('\n');
+ }
+ eventDataBuffer.append(dataContent);
+ } else if (line.startsWith("event:")) {
+ String eventValue = line.length() > 6 ? line.substring(6) : "";
+ if (eventValue.startsWith(" ")) {
+ eventValue = eventValue.substring(1);
+ }
+ currentEventType = eventValue;
+ } else if (line.startsWith("id:")) {
+ // Event ID field (ignored)
+ } else if (line.startsWith("retry:")) {
+ // Retry field (ignored)
+ } else if (line.startsWith(":")) {
+ // Comment line (ignored)
+ }
+ }
+
+ if (eventDataBuffer.length() > 0) {
+ try {
+ nextItem = ObjectMappers.JSON_MAPPER.readValue(eventDataBuffer.toString(), valueType);
+ hasNextItem = true;
+ eventDataBuffer.setLength(0);
+ currentEventType = null;
+ return true;
+ } catch (Exception parseEx) {
+ System.err.println("Failed to parse final SSE event: " + parseEx.getMessage());
+ eventDataBuffer.setLength(0);
+ currentEventType = null;
+ }
+ }
+
+ endOfStream = true;
+ return false;
+
+ } catch (Exception e) {
+ System.err.println("Failed to parse SSE stream: " + e.getMessage());
+ endOfStream = true;
+ return false;
+ }
+ }
+ }
+}
diff --git a/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/seed/javaOauthStagedBuilder/core/Suppliers.java b/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/seed/javaOauthStagedBuilder/core/Suppliers.java
new file mode 100644
index 000000000000..037185993465
--- /dev/null
+++ b/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/seed/javaOauthStagedBuilder/core/Suppliers.java
@@ -0,0 +1,23 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.seed.javaOauthStagedBuilder.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/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/seed/javaOauthStagedBuilder/resources/auth/AsyncAuthClient.java b/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/seed/javaOauthStagedBuilder/resources/auth/AsyncAuthClient.java
new file mode 100644
index 000000000000..1c90b2f73393
--- /dev/null
+++ b/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/seed/javaOauthStagedBuilder/resources/auth/AsyncAuthClient.java
@@ -0,0 +1,36 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.seed.javaOauthStagedBuilder.resources.auth;
+
+import com.seed.javaOauthStagedBuilder.core.ClientOptions;
+import com.seed.javaOauthStagedBuilder.core.RequestOptions;
+import com.seed.javaOauthStagedBuilder.resources.auth.requests.GetTokenRequest;
+import com.seed.javaOauthStagedBuilder.resources.auth.types.TokenResponse;
+import java.util.concurrent.CompletableFuture;
+
+public class AsyncAuthClient {
+ protected final ClientOptions clientOptions;
+
+ private final AsyncRawAuthClient rawClient;
+
+ public AsyncAuthClient(ClientOptions clientOptions) {
+ this.clientOptions = clientOptions;
+ this.rawClient = new AsyncRawAuthClient(clientOptions);
+ }
+
+ /**
+ * Get responses with HTTP metadata like headers
+ */
+ public AsyncRawAuthClient withRawResponse() {
+ return this.rawClient;
+ }
+
+ public CompletableFuture getToken(GetTokenRequest request) {
+ return this.rawClient.getToken(request).thenApply(response -> response.body());
+ }
+
+ public CompletableFuture getToken(GetTokenRequest request, RequestOptions requestOptions) {
+ return this.rawClient.getToken(request, requestOptions).thenApply(response -> response.body());
+ }
+}
diff --git a/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/seed/javaOauthStagedBuilder/resources/auth/AsyncRawAuthClient.java b/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/seed/javaOauthStagedBuilder/resources/auth/AsyncRawAuthClient.java
new file mode 100644
index 000000000000..01ada961fc85
--- /dev/null
+++ b/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/seed/javaOauthStagedBuilder/resources/auth/AsyncRawAuthClient.java
@@ -0,0 +1,94 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.seed.javaOauthStagedBuilder.resources.auth;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.seed.javaOauthStagedBuilder.core.ClientOptions;
+import com.seed.javaOauthStagedBuilder.core.MediaTypes;
+import com.seed.javaOauthStagedBuilder.core.ObjectMappers;
+import com.seed.javaOauthStagedBuilder.core.RequestOptions;
+import com.seed.javaOauthStagedBuilder.core.SeedJavaOauthStagedBuilderApiException;
+import com.seed.javaOauthStagedBuilder.core.SeedJavaOauthStagedBuilderException;
+import com.seed.javaOauthStagedBuilder.core.SeedJavaOauthStagedBuilderHttpResponse;
+import com.seed.javaOauthStagedBuilder.resources.auth.requests.GetTokenRequest;
+import com.seed.javaOauthStagedBuilder.resources.auth.types.TokenResponse;
+import java.io.IOException;
+import java.util.concurrent.CompletableFuture;
+import okhttp3.Call;
+import okhttp3.Callback;
+import okhttp3.Headers;
+import okhttp3.HttpUrl;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import okhttp3.Response;
+import okhttp3.ResponseBody;
+import org.jetbrains.annotations.NotNull;
+
+public class AsyncRawAuthClient {
+ protected final ClientOptions clientOptions;
+
+ public AsyncRawAuthClient(ClientOptions clientOptions) {
+ this.clientOptions = clientOptions;
+ }
+
+ public CompletableFuture> getToken(GetTokenRequest request) {
+ return getToken(request, null);
+ }
+
+ public CompletableFuture> getToken(
+ GetTokenRequest request, RequestOptions requestOptions) {
+ HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("token")
+ .build();
+ RequestBody body;
+ try {
+ body = RequestBody.create(
+ ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON);
+ } catch (JsonProcessingException e) {
+ throw new SeedJavaOauthStagedBuilderException("Failed to serialize request", e);
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl)
+ .method("POST", body)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Content-Type", "application/json")
+ .addHeader("Accept", "application/json")
+ .build();
+ OkHttpClient client = clientOptions.httpClient();
+ if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
+ client = clientOptions.httpClientWithTimeout(requestOptions);
+ }
+ CompletableFuture> future = new CompletableFuture<>();
+ client.newCall(okhttpRequest).enqueue(new Callback() {
+ @Override
+ public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
+ try (ResponseBody responseBody = response.body()) {
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ if (response.isSuccessful()) {
+ future.complete(new SeedJavaOauthStagedBuilderHttpResponse<>(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TokenResponse.class),
+ response));
+ return;
+ }
+ Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
+ future.completeExceptionally(new SeedJavaOauthStagedBuilderApiException(
+ "Error with status code " + response.code(), response.code(), errorBody, response));
+ return;
+ } catch (IOException e) {
+ future.completeExceptionally(
+ new SeedJavaOauthStagedBuilderException("Network error executing HTTP request", e));
+ }
+ }
+
+ @Override
+ public void onFailure(@NotNull Call call, @NotNull IOException e) {
+ future.completeExceptionally(
+ new SeedJavaOauthStagedBuilderException("Network error executing HTTP request", e));
+ }
+ });
+ return future;
+ }
+}
diff --git a/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/seed/javaOauthStagedBuilder/resources/auth/AuthClient.java b/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/seed/javaOauthStagedBuilder/resources/auth/AuthClient.java
new file mode 100644
index 000000000000..e8768e37f3dc
--- /dev/null
+++ b/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/seed/javaOauthStagedBuilder/resources/auth/AuthClient.java
@@ -0,0 +1,35 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.seed.javaOauthStagedBuilder.resources.auth;
+
+import com.seed.javaOauthStagedBuilder.core.ClientOptions;
+import com.seed.javaOauthStagedBuilder.core.RequestOptions;
+import com.seed.javaOauthStagedBuilder.resources.auth.requests.GetTokenRequest;
+import com.seed.javaOauthStagedBuilder.resources.auth.types.TokenResponse;
+
+public class AuthClient {
+ protected final ClientOptions clientOptions;
+
+ private final RawAuthClient rawClient;
+
+ public AuthClient(ClientOptions clientOptions) {
+ this.clientOptions = clientOptions;
+ this.rawClient = new RawAuthClient(clientOptions);
+ }
+
+ /**
+ * Get responses with HTTP metadata like headers
+ */
+ public RawAuthClient withRawResponse() {
+ return this.rawClient;
+ }
+
+ public TokenResponse getToken(GetTokenRequest request) {
+ return this.rawClient.getToken(request).body();
+ }
+
+ public TokenResponse getToken(GetTokenRequest request, RequestOptions requestOptions) {
+ return this.rawClient.getToken(request, requestOptions).body();
+ }
+}
diff --git a/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/seed/javaOauthStagedBuilder/resources/auth/RawAuthClient.java b/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/seed/javaOauthStagedBuilder/resources/auth/RawAuthClient.java
new file mode 100644
index 000000000000..e001ceca9f88
--- /dev/null
+++ b/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/seed/javaOauthStagedBuilder/resources/auth/RawAuthClient.java
@@ -0,0 +1,74 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.seed.javaOauthStagedBuilder.resources.auth;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.seed.javaOauthStagedBuilder.core.ClientOptions;
+import com.seed.javaOauthStagedBuilder.core.MediaTypes;
+import com.seed.javaOauthStagedBuilder.core.ObjectMappers;
+import com.seed.javaOauthStagedBuilder.core.RequestOptions;
+import com.seed.javaOauthStagedBuilder.core.SeedJavaOauthStagedBuilderApiException;
+import com.seed.javaOauthStagedBuilder.core.SeedJavaOauthStagedBuilderException;
+import com.seed.javaOauthStagedBuilder.core.SeedJavaOauthStagedBuilderHttpResponse;
+import com.seed.javaOauthStagedBuilder.resources.auth.requests.GetTokenRequest;
+import com.seed.javaOauthStagedBuilder.resources.auth.types.TokenResponse;
+import java.io.IOException;
+import okhttp3.Headers;
+import okhttp3.HttpUrl;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import okhttp3.Response;
+import okhttp3.ResponseBody;
+
+public class RawAuthClient {
+ protected final ClientOptions clientOptions;
+
+ public RawAuthClient(ClientOptions clientOptions) {
+ this.clientOptions = clientOptions;
+ }
+
+ public SeedJavaOauthStagedBuilderHttpResponse getToken(GetTokenRequest request) {
+ return getToken(request, null);
+ }
+
+ public SeedJavaOauthStagedBuilderHttpResponse getToken(
+ GetTokenRequest request, RequestOptions requestOptions) {
+ HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("token")
+ .build();
+ RequestBody body;
+ try {
+ body = RequestBody.create(
+ ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON);
+ } catch (JsonProcessingException e) {
+ throw new SeedJavaOauthStagedBuilderException("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();
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ if (response.isSuccessful()) {
+ return new SeedJavaOauthStagedBuilderHttpResponse<>(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TokenResponse.class), response);
+ }
+ Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
+ throw new SeedJavaOauthStagedBuilderApiException(
+ "Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (IOException e) {
+ throw new SeedJavaOauthStagedBuilderException("Network error executing HTTP request", e);
+ }
+ }
+}
diff --git a/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/seed/javaOauthStagedBuilder/resources/auth/requests/GetTokenRequest.java b/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/seed/javaOauthStagedBuilder/resources/auth/requests/GetTokenRequest.java
new file mode 100644
index 000000000000..ffd32b8da4f7
--- /dev/null
+++ b/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/seed/javaOauthStagedBuilder/resources/auth/requests/GetTokenRequest.java
@@ -0,0 +1,189 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.seed.javaOauthStagedBuilder.resources.auth.requests;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonSetter;
+import com.fasterxml.jackson.annotation.Nulls;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.seed.javaOauthStagedBuilder.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 = GetTokenRequest.Builder.class)
+public final class GetTokenRequest {
+ private final String apiKey;
+
+ private final String clientId;
+
+ private final String clientSecret;
+
+ private final Optional scope;
+
+ private final Map additionalProperties;
+
+ private GetTokenRequest(
+ String apiKey,
+ String clientId,
+ String clientSecret,
+ Optional scope,
+ Map additionalProperties) {
+ this.apiKey = apiKey;
+ this.clientId = clientId;
+ this.clientSecret = clientSecret;
+ this.scope = scope;
+ this.additionalProperties = additionalProperties;
+ }
+
+ @JsonProperty("apiKey")
+ public String getApiKey() {
+ return apiKey;
+ }
+
+ @JsonProperty("clientId")
+ public String getClientId() {
+ return clientId;
+ }
+
+ @JsonProperty("clientSecret")
+ public String getClientSecret() {
+ return clientSecret;
+ }
+
+ @JsonProperty("grantType")
+ public String getGrantType() {
+ return "client_credentials";
+ }
+
+ @JsonProperty("scope")
+ public Optional getScope() {
+ return scope;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof GetTokenRequest && equalTo((GetTokenRequest) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(GetTokenRequest other) {
+ return apiKey.equals(other.apiKey)
+ && clientId.equals(other.clientId)
+ && clientSecret.equals(other.clientSecret)
+ && scope.equals(other.scope);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.apiKey, this.clientId, this.clientSecret, this.scope);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return ObjectMappers.stringify(this);
+ }
+
+ public static ApiKeyStage builder() {
+ return new Builder();
+ }
+
+ public interface ApiKeyStage {
+ ClientIdStage apiKey(@NotNull String apiKey);
+
+ Builder from(GetTokenRequest other);
+ }
+
+ public interface ClientIdStage {
+ ClientSecretStage clientId(@NotNull String clientId);
+ }
+
+ public interface ClientSecretStage {
+ _FinalStage clientSecret(@NotNull String clientSecret);
+ }
+
+ public interface _FinalStage {
+ GetTokenRequest build();
+
+ _FinalStage scope(Optional scope);
+
+ _FinalStage scope(String scope);
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder implements ApiKeyStage, ClientIdStage, ClientSecretStage, _FinalStage {
+ private String apiKey;
+
+ private String clientId;
+
+ private String clientSecret;
+
+ private Optional scope = Optional.empty();
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ @java.lang.Override
+ public Builder from(GetTokenRequest other) {
+ apiKey(other.getApiKey());
+ clientId(other.getClientId());
+ clientSecret(other.getClientSecret());
+ scope(other.getScope());
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("apiKey")
+ public ClientIdStage apiKey(@NotNull String apiKey) {
+ this.apiKey = Objects.requireNonNull(apiKey, "apiKey must not be null");
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("clientId")
+ public ClientSecretStage clientId(@NotNull String clientId) {
+ this.clientId = Objects.requireNonNull(clientId, "clientId must not be null");
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("clientSecret")
+ public _FinalStage clientSecret(@NotNull String clientSecret) {
+ this.clientSecret = Objects.requireNonNull(clientSecret, "clientSecret must not be null");
+ return this;
+ }
+
+ @java.lang.Override
+ public _FinalStage scope(String scope) {
+ this.scope = Optional.ofNullable(scope);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "scope", nulls = Nulls.SKIP)
+ public _FinalStage scope(Optional scope) {
+ this.scope = scope;
+ return this;
+ }
+
+ @java.lang.Override
+ public GetTokenRequest build() {
+ return new GetTokenRequest(apiKey, clientId, clientSecret, scope, additionalProperties);
+ }
+ }
+}
diff --git a/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/seed/javaOauthStagedBuilder/resources/auth/types/TokenResponse.java b/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/seed/javaOauthStagedBuilder/resources/auth/types/TokenResponse.java
new file mode 100644
index 000000000000..863488bd0a7c
--- /dev/null
+++ b/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/seed/javaOauthStagedBuilder/resources/auth/types/TokenResponse.java
@@ -0,0 +1,124 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.seed.javaOauthStagedBuilder.resources.auth.types;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonSetter;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.seed.javaOauthStagedBuilder.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 = TokenResponse.Builder.class)
+public final class TokenResponse {
+ private final String accessToken;
+
+ private final int expiresIn;
+
+ private final Map additionalProperties;
+
+ private TokenResponse(String accessToken, int expiresIn, Map additionalProperties) {
+ this.accessToken = accessToken;
+ this.expiresIn = expiresIn;
+ this.additionalProperties = additionalProperties;
+ }
+
+ @JsonProperty("accessToken")
+ public String getAccessToken() {
+ return accessToken;
+ }
+
+ @JsonProperty("expiresIn")
+ public int getExpiresIn() {
+ return expiresIn;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof TokenResponse && equalTo((TokenResponse) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(TokenResponse other) {
+ return accessToken.equals(other.accessToken) && expiresIn == other.expiresIn;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.accessToken, this.expiresIn);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return ObjectMappers.stringify(this);
+ }
+
+ public static AccessTokenStage builder() {
+ return new Builder();
+ }
+
+ public interface AccessTokenStage {
+ ExpiresInStage accessToken(@NotNull String accessToken);
+
+ Builder from(TokenResponse other);
+ }
+
+ public interface ExpiresInStage {
+ _FinalStage expiresIn(int expiresIn);
+ }
+
+ public interface _FinalStage {
+ TokenResponse build();
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder implements AccessTokenStage, ExpiresInStage, _FinalStage {
+ private String accessToken;
+
+ private int expiresIn;
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ @java.lang.Override
+ public Builder from(TokenResponse other) {
+ accessToken(other.getAccessToken());
+ expiresIn(other.getExpiresIn());
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("accessToken")
+ public ExpiresInStage accessToken(@NotNull String accessToken) {
+ this.accessToken = Objects.requireNonNull(accessToken, "accessToken must not be null");
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("expiresIn")
+ public _FinalStage expiresIn(int expiresIn) {
+ this.expiresIn = expiresIn;
+ return this;
+ }
+
+ @java.lang.Override
+ public TokenResponse build() {
+ return new TokenResponse(accessToken, expiresIn, additionalProperties);
+ }
+ }
+}
diff --git a/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/snippets/Example0.java b/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/snippets/Example0.java
new file mode 100644
index 000000000000..5ff6d07d5b0e
--- /dev/null
+++ b/seed/java-sdk/java-oauth-staged-builder/default/src/main/java/com/snippets/Example0.java
@@ -0,0 +1,22 @@
+package com.snippets;
+
+import com.seed.javaOauthStagedBuilder.SeedJavaOauthStagedBuilderClient;
+import com.seed.javaOauthStagedBuilder.resources.auth.requests.GetTokenRequest;
+
+public class Example0 {
+ public static void main(String[] args) {
+ SeedJavaOauthStagedBuilderClient client = SeedJavaOauthStagedBuilderClient.builder()
+ .clientId("")
+ .clientSecret("")
+ .url("https://api.fern.com")
+ .build();
+
+ client.auth()
+ .getToken(GetTokenRequest.builder()
+ .apiKey("apiKey")
+ .clientId("clientId")
+ .clientSecret("clientSecret")
+ .scope("scope")
+ .build());
+ }
+}
diff --git a/seed/java-sdk/java-oauth-staged-builder/default/src/test/java/com/seed/javaOauthStagedBuilder/StreamTest.java b/seed/java-sdk/java-oauth-staged-builder/default/src/test/java/com/seed/javaOauthStagedBuilder/StreamTest.java
new file mode 100644
index 000000000000..36f07d7990a3
--- /dev/null
+++ b/seed/java-sdk/java-oauth-staged-builder/default/src/test/java/com/seed/javaOauthStagedBuilder/StreamTest.java
@@ -0,0 +1,97 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.seed.javaOauthStagedBuilder;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+import com.seed.javaOauthStagedBuilder.core.ObjectMappers;
+import com.seed.javaOauthStagedBuilder.core.Stream;
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import org.junit.jupiter.api.Test;
+
+public final class StreamTest {
+ @Test
+ public void testJsonStream() {
+ List