diff --git a/src/main/java/com/google/genai/gaos/Agents.java b/src/main/java/com/google/genai/gaos/Agents.java index b8fa56c777a..3ea28445618 100644 --- a/src/main/java/com/google/genai/gaos/Agents.java +++ b/src/main/java/com/google/genai/gaos/Agents.java @@ -66,7 +66,7 @@ public AsyncAgents async() { } /** - * Lists all Agents. + * Lists agents. * * @return The call builder */ @@ -75,7 +75,7 @@ public ListAgentsRequestBuilder list() { } /** - * Lists all Agents. + * Lists agents. * * @return The response from the API call * @throws RuntimeException subclass if the API call fails @@ -86,9 +86,9 @@ public ListAgentsResponse listDirect() { } /** - * Lists all Agents. + * Lists agents. * - * @param apiVersion Which version of the API to use. + * @param apiVersion API version for request routing. * @param pageSize * @param pageToken * @param parent @@ -109,7 +109,7 @@ public ListAgentsResponse list( } /** - * Creates a new Agent (Typed version for SDK). + * Creates or updates an agent (upsert by name). * * @return The call builder */ @@ -118,7 +118,7 @@ public CreateAgentRequestBuilder create() { } /** - * Creates a new Agent (Typed version for SDK). + * Creates or updates an agent (upsert by name). * * @param body An agent definition for the CreateAgent API. * This message is the target for annotation-parser-based JSON parsing. @@ -138,9 +138,9 @@ public CreateAgentResponse create(@Nonnull Agent body) { } /** - * Creates a new Agent (Typed version for SDK). + * Creates or updates an agent (upsert by name). * - * @param apiVersion Which version of the API to use. + * @param apiVersion API version for request routing. * @param body An agent definition for the CreateAgent API. * This message is the target for annotation-parser-based JSON parsing. * New format: @@ -165,7 +165,7 @@ public CreateAgentResponse create( } /** - * Deletes an Agent. + * Deletes an agent and all its versions. * * @return The call builder */ @@ -174,9 +174,9 @@ public DeleteAgentRequestBuilder delete() { } /** - * Deletes an Agent. + * Deletes an agent and all its versions. * - * @param id + * @param id Part of `name`. * @return The response from the API call * @throws RuntimeException subclass if the API call fails */ @@ -185,10 +185,10 @@ public DeleteAgentResponse delete(@Nonnull String id) { } /** - * Deletes an Agent. + * Deletes an agent and all its versions. * - * @param apiVersion Which version of the API to use. - * @param id + * @param apiVersion API version for request routing. + * @param id Part of `name`. * @param options additional options * @return The response from the API call * @throws RuntimeException subclass if the API call fails @@ -203,7 +203,7 @@ public DeleteAgentResponse delete( } /** - * Gets a specific Agent. + * Gets an agent (latest version). * * @return The call builder */ @@ -212,9 +212,9 @@ public GetAgentRequestBuilder get() { } /** - * Gets a specific Agent. + * Gets an agent (latest version). * - * @param id + * @param id Part of `name`. * @return The response from the API call * @throws RuntimeException subclass if the API call fails */ @@ -223,10 +223,10 @@ public GetAgentResponse get(@Nonnull String id) { } /** - * Gets a specific Agent. + * Gets an agent (latest version). * - * @param apiVersion Which version of the API to use. - * @param id + * @param apiVersion API version for request routing. + * @param id Part of `name`. * @param options additional options * @return The response from the API call * @throws RuntimeException subclass if the API call fails diff --git a/src/main/java/com/google/genai/gaos/AsyncAgents.java b/src/main/java/com/google/genai/gaos/AsyncAgents.java index ca63dcfeaa0..e3b34a7947c 100644 --- a/src/main/java/com/google/genai/gaos/AsyncAgents.java +++ b/src/main/java/com/google/genai/gaos/AsyncAgents.java @@ -69,7 +69,7 @@ public Agents sync() { /** - * Lists all Agents. + * Lists agents. * * @return The async call builder */ @@ -78,7 +78,7 @@ public ListAgentsRequestBuilder list() { } /** - * Lists all Agents. + * Lists agents. * * @return {@code CompletableFuture} - The async response */ @@ -89,9 +89,9 @@ public CompletableFuture listDirect() { } /** - * Lists all Agents. + * Lists agents. * - * @param apiVersion Which version of the API to use. + * @param apiVersion API version for request routing. * @param pageSize * @param pageToken * @param parent @@ -115,7 +115,7 @@ public CompletableFuture list( /** - * Creates a new Agent (Typed version for SDK). + * Creates or updates an agent (upsert by name). * * @return The async call builder */ @@ -124,7 +124,7 @@ public CreateAgentRequestBuilder create() { } /** - * Creates a new Agent (Typed version for SDK). + * Creates or updates an agent (upsert by name). * * @param body An agent definition for the CreateAgent API. * This message is the target for annotation-parser-based JSON parsing. @@ -143,9 +143,9 @@ public CompletableFuture create(@Nonnull Agent body) { } /** - * Creates a new Agent (Typed version for SDK). + * Creates or updates an agent (upsert by name). * - * @param apiVersion Which version of the API to use. + * @param apiVersion API version for request routing. * @param body An agent definition for the CreateAgent API. * This message is the target for annotation-parser-based JSON parsing. * New format: @@ -173,7 +173,7 @@ public CompletableFuture create( /** - * Deletes an Agent. + * Deletes an agent and all its versions. * * @return The async call builder */ @@ -182,9 +182,9 @@ public DeleteAgentRequestBuilder delete() { } /** - * Deletes an Agent. + * Deletes an agent and all its versions. * - * @param id + * @param id Part of `name`. * @return {@code CompletableFuture} - The async response */ public CompletableFuture delete(@Nonnull String id) { @@ -192,10 +192,10 @@ public CompletableFuture delete(@Nonnull String id) { } /** - * Deletes an Agent. + * Deletes an agent and all its versions. * - * @param apiVersion Which version of the API to use. - * @param id + * @param apiVersion API version for request routing. + * @param id Part of `name`. * @param options additional options * @return {@code CompletableFuture} - The async response */ @@ -213,7 +213,7 @@ public CompletableFuture delete( /** - * Gets a specific Agent. + * Gets an agent (latest version). * * @return The async call builder */ @@ -222,9 +222,9 @@ public GetAgentRequestBuilder get() { } /** - * Gets a specific Agent. + * Gets an agent (latest version). * - * @param id + * @param id Part of `name`. * @return {@code CompletableFuture} - The async response */ public CompletableFuture get(@Nonnull String id) { @@ -232,10 +232,10 @@ public CompletableFuture get(@Nonnull String id) { } /** - * Gets a specific Agent. + * Gets an agent (latest version). * - * @param apiVersion Which version of the API to use. - * @param id + * @param apiVersion API version for request routing. + * @param id Part of `name`. * @param options additional options * @return {@code CompletableFuture} - The async response */ diff --git a/src/main/java/com/google/genai/gaos/AsyncEnvironments.java b/src/main/java/com/google/genai/gaos/AsyncEnvironments.java index 250de9efe65..d0a28285a7f 100644 --- a/src/main/java/com/google/genai/gaos/AsyncEnvironments.java +++ b/src/main/java/com/google/genai/gaos/AsyncEnvironments.java @@ -74,7 +74,7 @@ public Environments sync() { /** - * Lists environments. + * Lists environments (HTTP endpoint). * * @return The async call builder */ @@ -83,7 +83,7 @@ public ListEnvironmentsRequestBuilder listEnvironments() { } /** - * Lists environments. + * Lists environments (HTTP endpoint). * * @return {@code CompletableFuture} - The async response */ @@ -94,11 +94,12 @@ public CompletableFuture listEnvironmentsDirect() { } /** - * Lists environments. + * Lists environments (HTTP endpoint). * - * @param apiVersion Which version of the API to use. - * @param pageSize Optional. Maximum number of environments to return.\nIf unspecified, defaults to 50. Maximum is 1000. - * @param pageToken Optional. Pagination token. + * @param apiVersion API version for request routing. + * @param pageSize Maximum number of environments to return. + * If unspecified, defaults to 50. Maximum is 1000. + * @param pageToken Pagination token. * @param options additional options * @return {@code CompletableFuture} - The async response */ @@ -116,7 +117,7 @@ public CompletableFuture listEnvironments( /** - * Creates an environment. + * Creates an environment (HTTP endpoint). * * @return The async call builder */ @@ -125,7 +126,7 @@ public CreateEnvironmentRequestBuilder createEnvironment() { } /** - * Creates an environment. + * Creates an environment (HTTP endpoint). * * @param body Request for `CreateEnvironment`. * @return {@code CompletableFuture} - The async response @@ -135,9 +136,9 @@ public CompletableFuture createEnvironment(@Nonnull C } /** - * Creates an environment. + * Creates an environment (HTTP endpoint). * - * @param apiVersion Which version of the API to use. + * @param apiVersion API version for request routing. * @param body Request for `CreateEnvironment`. * @param options additional options * @return {@code CompletableFuture} - The async response @@ -156,7 +157,7 @@ public CompletableFuture createEnvironment( /** - * Deletes an environment. + * Deletes an environment (HTTP endpoint). * * @return The async call builder */ @@ -165,9 +166,9 @@ public DeleteEnvironmentRequestBuilder deleteEnvironment() { } /** - * Deletes an environment. + * Deletes an environment (HTTP endpoint). * - * @param id Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. + * @param id Required. The identifier of the environment to delete. * @return {@code CompletableFuture} - The async response */ public CompletableFuture deleteEnvironment(@Nonnull String id) { @@ -175,10 +176,10 @@ public CompletableFuture deleteEnvironment(@Nonnull S } /** - * Deletes an environment. + * Deletes an environment (HTTP endpoint). * - * @param apiVersion Which version of the API to use. - * @param id Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. + * @param apiVersion API version for request routing. + * @param id Required. The identifier of the environment to delete. * @param options additional options * @return {@code CompletableFuture} - The async response */ @@ -196,7 +197,7 @@ public CompletableFuture deleteEnvironment( /** - * Gets an environment. + * Gets an environment (HTTP endpoint). * * @return The async call builder */ @@ -205,9 +206,9 @@ public GetEnvironmentRequestBuilder getEnvironment() { } /** - * Gets an environment. + * Gets an environment (HTTP endpoint). * - * @param id Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. + * @param id Required. The identifier of the environment to retrieve. * @return {@code CompletableFuture} - The async response */ public CompletableFuture getEnvironment(@Nonnull String id) { @@ -215,10 +216,10 @@ public CompletableFuture getEnvironment(@Nonnull String } /** - * Gets an environment. + * Gets an environment (HTTP endpoint). * - * @param apiVersion Which version of the API to use. - * @param id Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. + * @param apiVersion API version for request routing. + * @param id Required. The identifier of the environment to retrieve. * @param options additional options * @return {@code CompletableFuture} - The async response */ diff --git a/src/main/java/com/google/genai/gaos/AsyncFiles.java b/src/main/java/com/google/genai/gaos/AsyncFiles.java index 09b68a025ef..3f266803f0b 100644 --- a/src/main/java/com/google/genai/gaos/AsyncFiles.java +++ b/src/main/java/com/google/genai/gaos/AsyncFiles.java @@ -54,8 +54,7 @@ public Files sync() { /** - * Retrieves file metadata or directory contents from an environment's snapshot. To download file - * contents directly, pass ?alt=media or use the files.download helper. + * Retrieves a file or directory from an environment's snapshot. * * @return The async call builder */ @@ -64,8 +63,7 @@ public GetEnvironmentFilesRequestBuilder list() { } /** - * Retrieves file metadata or directory contents from an environment's snapshot. To download file - * contents directly, pass ?alt=media or use the files.download helper. + * Retrieves a file or directory from an environment's snapshot. * * @param request The request object containing all the parameters for the API call. * @return {@code CompletableFuture} - The async response @@ -75,8 +73,7 @@ public CompletableFuture list(@Nonnull GetEnvironme } /** - * Retrieves file metadata or directory contents from an environment's snapshot. To download file - * contents directly, pass ?alt=media or use the files.download helper. + * Retrieves a file or directory from an environment's snapshot. * * @param request The request object containing all the parameters for the API call. * @param options additional options diff --git a/src/main/java/com/google/genai/gaos/AsyncInteractions.java b/src/main/java/com/google/genai/gaos/AsyncInteractions.java index af28c79ac7f..40281a7be8a 100644 --- a/src/main/java/com/google/genai/gaos/AsyncInteractions.java +++ b/src/main/java/com/google/genai/gaos/AsyncInteractions.java @@ -73,9 +73,7 @@ public Interactions sync() { /** - * Creating an interaction - * - *

Creates a new interaction. + * Generates a set of responses from the model. * * @return The async call builder */ @@ -84,9 +82,7 @@ public CreateInteractionRequestBuilder create() { } /** - * Creating an interaction - * - *

Creates a new interaction. + * Generates a set of responses from the model. * * @param body The request body. * @return {@code CompletableFuture}> - The async response @@ -96,11 +92,9 @@ public CompletableFuture> create(@Nonnull } /** - * Creating an interaction - * - *

Creates a new interaction. + * Generates a set of responses from the model. * - * @param apiVersion Which version of the API to use. + * @param apiVersion API version for request routing. * @param body The request body. * @param options additional options * @return A CompletableFuture that completes with a blocking event stream once response headers are received. @@ -126,9 +120,7 @@ public CompletableFuture> create( /** - * Deleting an interaction - * - *

Deletes the interaction by id. + * Deletes an interaction. * * @return The async call builder */ @@ -137,11 +129,10 @@ public DeleteInteractionRequestBuilder delete() { } /** - * Deleting an interaction - * - *

Deletes the interaction by id. + * Deletes an interaction. * - * @param id The unique identifier of the interaction to delete. + * @param id Part of `name`. Required. The name of the interaction to delete. + * Format: interactions/{interaction} * @return {@code CompletableFuture} - The async response */ public CompletableFuture delete(@Nonnull String id) { @@ -149,12 +140,11 @@ public CompletableFuture delete(@Nonnull String id) { } /** - * Deleting an interaction - * - *

Deletes the interaction by id. + * Deletes an interaction. * - * @param apiVersion Which version of the API to use. - * @param id The unique identifier of the interaction to delete. + * @param apiVersion API version for request routing. + * @param id Part of `name`. Required. The name of the interaction to delete. + * Format: interactions/{interaction} * @param options additional options * @return {@code CompletableFuture} - The async response */ @@ -172,9 +162,7 @@ public CompletableFuture delete( /** - * Retrieving an interaction - * - *

Retrieves the full details of a single interaction based on its `Interaction.id`. + * Gets an interaction. * * @return The async call builder */ @@ -183,9 +171,7 @@ public GetInteractionByIdRequestBuilder get() { } /** - * Retrieving an interaction - * - *

Retrieves the full details of a single interaction based on its `Interaction.id`. + * Gets an interaction. * * @param request The request object containing all the parameters for the API call. * @return {@code CompletableFuture}> - The async response @@ -195,9 +181,7 @@ public CompletableFuture> get(@Nonnull Ge } /** - * Retrieving an interaction - * - *

Retrieves the full details of a single interaction based on its `Interaction.id`. + * Gets an interaction. * * @param request The request object containing all the parameters for the API call. * @param options additional options @@ -221,9 +205,7 @@ public CompletableFuture> get(@Nonnull Ge /** - * Canceling an interaction - * - *

Cancels an interaction by id. This only applies to background interactions that are still running. + * Cancels an interaction. * * @return The async call builder */ @@ -232,11 +214,10 @@ public CancelInteractionByIdRequestBuilder cancel() { } /** - * Canceling an interaction - * - *

Cancels an interaction by id. This only applies to background interactions that are still running. + * Cancels an interaction. * - * @param id The unique identifier of the interaction to cancel. + * @param id Part of `name`. Required. The name of the interaction to cancel. + * Format: `interactions/{interaction}`. * @return {@code CompletableFuture} - The async response */ public CompletableFuture cancel(@Nonnull String id) { @@ -244,12 +225,11 @@ public CompletableFuture cancel(@Nonnull String i } /** - * Canceling an interaction - * - *

Cancels an interaction by id. This only applies to background interactions that are still running. + * Cancels an interaction. * - * @param apiVersion Which version of the API to use. - * @param id The unique identifier of the interaction to cancel. + * @param apiVersion API version for request routing. + * @param id Part of `name`. Required. The name of the interaction to cancel. + * Format: `interactions/{interaction}`. * @param options additional options * @return {@code CompletableFuture} - The async response */ diff --git a/src/main/java/com/google/genai/gaos/AsyncTriggers.java b/src/main/java/com/google/genai/gaos/AsyncTriggers.java index f250511b342..0b913a0500a 100644 --- a/src/main/java/com/google/genai/gaos/AsyncTriggers.java +++ b/src/main/java/com/google/genai/gaos/AsyncTriggers.java @@ -56,7 +56,7 @@ import com.google.genai.gaos.utils.Options; import jakarta.annotation.Nonnull; import jakarta.annotation.Nullable; -import java.lang.Long; +import java.lang.Integer; import java.lang.String; import java.util.concurrent.CompletableFuture; @@ -104,16 +104,17 @@ public CompletableFuture listDirect() { /** * Lists triggers for a project. * - * @param apiVersion Which version of the API to use. - * @param filter Optional. Filter expression (e.g., by state). - * @param pageSize Optional. The maximum number of triggers to return per page. - * @param pageToken Optional. A page token from a previous ListTriggers call. + * @param apiVersion API version for request routing. + * @param filter Optional. Filter expression (e.g. `agent="agents/my-agent-id"`). Only + * equality filtering on the `agent` field is currently supported. + * @param pageSize The maximum number of triggers to return per page. + * @param pageToken A page token from a previous ListTriggers call. * @param options additional options * @return {@code CompletableFuture} - The async response */ public CompletableFuture list( @Nullable String apiVersion, @Nullable String filter, - @Nullable Long pageSize, @Nullable String pageToken, + @Nullable Integer pageSize, @Nullable String pageToken, @Nullable Options options) { ListTriggersRequest request = new ListTriggersRequest( apiVersion, filter, pageSize, @@ -128,7 +129,8 @@ public CompletableFuture list( /** - * Creates a new trigger that will invoke the specified agent on the given cron schedule. + * Creates a new trigger that will invoke the specified agent + * on the given cron schedule. * * @return The async call builder */ @@ -137,7 +139,8 @@ public CreateTriggerRequestBuilder create() { } /** - * Creates a new trigger that will invoke the specified agent on the given cron schedule. + * Creates a new trigger that will invoke the specified agent + * on the given cron schedule. * * @param body Parameters for creating a trigger. * @return {@code CompletableFuture} - The async response @@ -147,9 +150,10 @@ public CompletableFuture create(@Nonnull TriggerCreatePar } /** - * Creates a new trigger that will invoke the specified agent on the given cron schedule. + * Creates a new trigger that will invoke the specified agent + * on the given cron schedule. * - * @param apiVersion Which version of the API to use. + * @param apiVersion API version for request routing. * @param body Parameters for creating a trigger. * @param options additional options * @return {@code CompletableFuture} - The async response @@ -168,7 +172,8 @@ public CompletableFuture create( /** - * Deletes a trigger. + * Deletes a trigger. Does not delete past interaction histories + * or environments created by past executions. * * @return The async call builder */ @@ -177,9 +182,10 @@ public DeleteTriggerRequestBuilder delete() { } /** - * Deletes a trigger. + * Deletes a trigger. Does not delete past interaction histories + * or environments created by past executions. * - * @param id Resource name of the trigger. + * @param id Required. The ID of the trigger to delete. * @return {@code CompletableFuture} - The async response */ public CompletableFuture delete(@Nonnull String id) { @@ -187,10 +193,11 @@ public CompletableFuture delete(@Nonnull String id) { } /** - * Deletes a trigger. + * Deletes a trigger. Does not delete past interaction histories + * or environments created by past executions. * - * @param apiVersion Which version of the API to use. - * @param id Resource name of the trigger. + * @param apiVersion API version for request routing. + * @param id Required. The ID of the trigger to delete. * @param options additional options * @return {@code CompletableFuture} - The async response */ @@ -208,7 +215,7 @@ public CompletableFuture delete( /** - * Gets details of a single trigger. + * Gets a trigger, including recent execution history. * * @return The async call builder */ @@ -217,9 +224,9 @@ public GetTriggerRequestBuilder get() { } /** - * Gets details of a single trigger. + * Gets a trigger, including recent execution history. * - * @param id Resource name of the trigger. + * @param id Required. The ID of the trigger to retrieve. * @return {@code CompletableFuture} - The async response */ public CompletableFuture get(@Nonnull String id) { @@ -227,10 +234,10 @@ public CompletableFuture get(@Nonnull String id) { } /** - * Gets details of a single trigger. + * Gets a trigger, including recent execution history. * - * @param apiVersion Which version of the API to use. - * @param id Resource name of the trigger. + * @param apiVersion API version for request routing. + * @param id Required. The ID of the trigger to retrieve. * @param options additional options * @return {@code CompletableFuture} - The async response */ @@ -248,7 +255,7 @@ public CompletableFuture get( /** - * Updates a trigger. + * Updates a trigger. Supports partial updates via field_mask. * * @return The async call builder */ @@ -257,9 +264,9 @@ public UpdateTriggerRequestBuilder update() { } /** - * Updates a trigger. + * Updates a trigger. Supports partial updates via field_mask. * - * @param id Resource name of the trigger. + * @param id Required. The ID of the trigger to update. * @param body Represents the fields of a Trigger that can be updated. * @return {@code CompletableFuture} - The async response */ @@ -270,10 +277,10 @@ public CompletableFuture update(@Nonnull String id, @Nonn } /** - * Updates a trigger. + * Updates a trigger. Supports partial updates via field_mask. * - * @param apiVersion Which version of the API to use. - * @param id Resource name of the trigger. + * @param apiVersion API version for request routing. + * @param id Required. The ID of the trigger to update. * @param body Represents the fields of a Trigger that can be updated. * @param options additional options * @return {@code CompletableFuture} - The async response @@ -303,32 +310,32 @@ public ListTriggerExecutionsRequestBuilder listExecutions() { /** * Lists executions for a trigger. * - * @param triggerId Resource name of the trigger. + * @param triggerId Required. The trigger ID to list executions from. * @return {@code CompletableFuture} - The async response */ public CompletableFuture listExecutions(@Nonnull String triggerId) { return listExecutions( - null, triggerId, null, - null, null); + null, null, null, + triggerId, null); } /** * Lists executions for a trigger. * - * @param apiVersion Which version of the API to use. - * @param triggerId Resource name of the trigger. - * @param pageSize Optional. The maximum number of executions to return per page. - * @param pageToken Optional. A page token from a previous ListTriggerExecutions call. + * @param apiVersion API version for request routing. + * @param pageSize The maximum number of executions to return per page. + * @param pageToken A page token from a previous ListTriggerExecutions call. + * @param triggerId Required. The trigger ID to list executions from. * @param options additional options * @return {@code CompletableFuture} - The async response */ public CompletableFuture listExecutions( - @Nullable String apiVersion, @Nonnull String triggerId, - @Nullable Long pageSize, @Nullable String pageToken, + @Nullable String apiVersion, @Nullable Integer pageSize, + @Nullable String pageToken, @Nonnull String triggerId, @Nullable Options options) { ListTriggerExecutionsRequest request = new ListTriggerExecutionsRequest( - apiVersion, triggerId, pageSize, - pageToken); + apiVersion, pageSize, pageToken, + triggerId); AsyncRequestOperation operation = new ListTriggerExecutions.Async( sdkConfiguration, options, sdkConfiguration.retryScheduler(), @@ -339,7 +346,8 @@ public CompletableFuture listExecutions( /** - * Runs a trigger immediately. + * Immediately fires a trigger, bypassing the cron schedule. + * Useful for testing and manual runs. * * @return The async call builder */ @@ -348,9 +356,10 @@ public RunTriggerRequestBuilder run() { } /** - * Runs a trigger immediately. + * Immediately fires a trigger, bypassing the cron schedule. + * Useful for testing and manual runs. * - * @param triggerId Resource name of the trigger. + * @param triggerId Required. The ID of the trigger to run immediately. * @return {@code CompletableFuture} - The async response */ public CompletableFuture run(@Nonnull String triggerId) { @@ -358,10 +367,11 @@ public CompletableFuture run(@Nonnull String triggerId) { } /** - * Runs a trigger immediately. + * Immediately fires a trigger, bypassing the cron schedule. + * Useful for testing and manual runs. * - * @param apiVersion Which version of the API to use. - * @param triggerId Resource name of the trigger. + * @param apiVersion API version for request routing. + * @param triggerId Required. The ID of the trigger to run immediately. * @param options additional options * @return {@code CompletableFuture} - The async response */ diff --git a/src/main/java/com/google/genai/gaos/AsyncWebhooks.java b/src/main/java/com/google/genai/gaos/AsyncWebhooks.java index f5c298fcf30..116d2ddc507 100644 --- a/src/main/java/com/google/genai/gaos/AsyncWebhooks.java +++ b/src/main/java/com/google/genai/gaos/AsyncWebhooks.java @@ -104,11 +104,11 @@ public CompletableFuture listDirect() { /** * Lists all Webhooks. * - * @param apiVersion Which version of the API to use. - * @param pageSize Optional. The maximum number of webhooks to return. The service may return fewer than + * @param apiVersion API version for request routing. + * @param pageSize The maximum number of webhooks to return. The service may return fewer than * this value. If unspecified, at most 50 webhooks will be returned. * The maximum value is 1000. - * @param pageToken Optional. A page token, received from a previous `ListWebhooks` call. + * @param pageToken A page token, received from a previous `ListWebhooks` call. * Provide this to retrieve the subsequent page. * @param options additional options * @return {@code CompletableFuture} - The async response @@ -148,7 +148,7 @@ public CompletableFuture create(@Nonnull WebhookInput bod /** * Creates a new Webhook. * - * @param apiVersion Which version of the API to use. + * @param apiVersion API version for request routing. * @param body A Webhook resource. * @param options additional options * @return {@code CompletableFuture} - The async response @@ -189,7 +189,7 @@ public CompletableFuture delete(@Nonnull String id) { /** * Deletes a Webhook. * - * @param apiVersion Which version of the API to use. + * @param apiVersion API version for request routing. * @param id Required. The ID of the webhook to delete. * Format: `{webhook_id}` * @param options additional options @@ -230,7 +230,7 @@ public CompletableFuture get(@Nonnull String id) { /** * Gets a specific Webhook. * - * @param apiVersion Which version of the API to use. + * @param apiVersion API version for request routing. * @param id Required. The ID of the webhook to retrieve. * @param options additional options * @return {@code CompletableFuture} - The async response @@ -272,9 +272,9 @@ public CompletableFuture update(@Nonnull String id) { /** * Updates an existing Webhook. * - * @param apiVersion Which version of the API to use. + * @param apiVersion API version for request routing. * @param id Required. The ID of the webhook to update. - * @param updateMask Optional. The list of fields to update. + * @param updateMask Optional list of fields to update. * @param body * @param options additional options * @return {@code CompletableFuture} - The async response @@ -308,7 +308,6 @@ public PingWebhookRequestBuilder ping() { * Sends a ping event to a Webhook. * * @param id Required. The ID of the webhook to ping. - * Format: `{webhook_id}` * @return {@code CompletableFuture} - The async response */ public CompletableFuture ping(@Nonnull String id) { @@ -320,9 +319,8 @@ public CompletableFuture ping(@Nonnull String id) { /** * Sends a ping event to a Webhook. * - * @param apiVersion Which version of the API to use. + * @param apiVersion API version for request routing. * @param id Required. The ID of the webhook to ping. - * Format: `{webhook_id}` * @param body Request message for WebhookService.PingWebhook. * @param options additional options * @return {@code CompletableFuture} - The async response @@ -352,8 +350,7 @@ public RotateSigningSecretRequestBuilder rotateSigningSecret() { /** * Generates a new signing secret for a Webhook. * - * @param id Required. The ID of the webhook for which to generate a signing secret. - * Format: `{webhook_id}` + * @param id Required. The ID of the webhook for which to rotate the signing secret. * @return {@code CompletableFuture} - The async response */ public CompletableFuture rotateSigningSecret(@Nonnull String id) { @@ -365,9 +362,8 @@ public CompletableFuture rotateSigningSecret(@Nonnu /** * Generates a new signing secret for a Webhook. * - * @param apiVersion Which version of the API to use. - * @param id Required. The ID of the webhook for which to generate a signing secret. - * Format: `{webhook_id}` + * @param apiVersion API version for request routing. + * @param id Required. The ID of the webhook for which to rotate the signing secret. * @param body Request message for WebhookService.RotateSigningSecret. * @param options additional options * @return {@code CompletableFuture} - The async response diff --git a/src/main/java/com/google/genai/gaos/Environments.java b/src/main/java/com/google/genai/gaos/Environments.java index 26887dacadf..63a0a6ce697 100644 --- a/src/main/java/com/google/genai/gaos/Environments.java +++ b/src/main/java/com/google/genai/gaos/Environments.java @@ -71,7 +71,7 @@ public AsyncEnvironments async() { } /** - * Lists environments. + * Lists environments (HTTP endpoint). * * @return The call builder */ @@ -80,7 +80,7 @@ public ListEnvironmentsRequestBuilder listEnvironments() { } /** - * Lists environments. + * Lists environments (HTTP endpoint). * * @return The response from the API call * @throws RuntimeException subclass if the API call fails @@ -91,11 +91,12 @@ public ListEnvironmentsResponse listEnvironmentsDirect() { } /** - * Lists environments. + * Lists environments (HTTP endpoint). * - * @param apiVersion Which version of the API to use. - * @param pageSize Optional. Maximum number of environments to return.\nIf unspecified, defaults to 50. Maximum is 1000. - * @param pageToken Optional. Pagination token. + * @param apiVersion API version for request routing. + * @param pageSize Maximum number of environments to return. + * If unspecified, defaults to 50. Maximum is 1000. + * @param pageToken Pagination token. * @param options additional options * @return The response from the API call * @throws RuntimeException subclass if the API call fails @@ -110,7 +111,7 @@ public ListEnvironmentsResponse listEnvironments( } /** - * Creates an environment. + * Creates an environment (HTTP endpoint). * * @return The call builder */ @@ -119,7 +120,7 @@ public CreateEnvironmentRequestBuilder createEnvironment() { } /** - * Creates an environment. + * Creates an environment (HTTP endpoint). * * @param body Request for `CreateEnvironment`. * @return The response from the API call @@ -130,9 +131,9 @@ public CreateEnvironmentResponse createEnvironment(@Nonnull CreateEnvironmentReq } /** - * Creates an environment. + * Creates an environment (HTTP endpoint). * - * @param apiVersion Which version of the API to use. + * @param apiVersion API version for request routing. * @param body Request for `CreateEnvironment`. * @param options additional options * @return The response from the API call @@ -148,7 +149,7 @@ public CreateEnvironmentResponse createEnvironment( } /** - * Deletes an environment. + * Deletes an environment (HTTP endpoint). * * @return The call builder */ @@ -157,9 +158,9 @@ public DeleteEnvironmentRequestBuilder deleteEnvironment() { } /** - * Deletes an environment. + * Deletes an environment (HTTP endpoint). * - * @param id Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. + * @param id Required. The identifier of the environment to delete. * @return The response from the API call * @throws RuntimeException subclass if the API call fails */ @@ -168,10 +169,10 @@ public DeleteEnvironmentResponse deleteEnvironment(@Nonnull String id) { } /** - * Deletes an environment. + * Deletes an environment (HTTP endpoint). * - * @param apiVersion Which version of the API to use. - * @param id Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. + * @param apiVersion API version for request routing. + * @param id Required. The identifier of the environment to delete. * @param options additional options * @return The response from the API call * @throws RuntimeException subclass if the API call fails @@ -186,7 +187,7 @@ public DeleteEnvironmentResponse deleteEnvironment( } /** - * Gets an environment. + * Gets an environment (HTTP endpoint). * * @return The call builder */ @@ -195,9 +196,9 @@ public GetEnvironmentRequestBuilder getEnvironment() { } /** - * Gets an environment. + * Gets an environment (HTTP endpoint). * - * @param id Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. + * @param id Required. The identifier of the environment to retrieve. * @return The response from the API call * @throws RuntimeException subclass if the API call fails */ @@ -206,10 +207,10 @@ public GetEnvironmentResponse getEnvironment(@Nonnull String id) { } /** - * Gets an environment. + * Gets an environment (HTTP endpoint). * - * @param apiVersion Which version of the API to use. - * @param id Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. + * @param apiVersion API version for request routing. + * @param id Required. The identifier of the environment to retrieve. * @param options additional options * @return The response from the API call * @throws RuntimeException subclass if the API call fails diff --git a/src/main/java/com/google/genai/gaos/Files.java b/src/main/java/com/google/genai/gaos/Files.java index db7a1daae55..9de3e29f414 100644 --- a/src/main/java/com/google/genai/gaos/Files.java +++ b/src/main/java/com/google/genai/gaos/Files.java @@ -51,8 +51,7 @@ public AsyncFiles async() { } /** - * Retrieves file metadata or directory contents from an environment's snapshot. To download file - * contents directly, pass ?alt=media or use the files.download helper. + * Retrieves a file or directory from an environment's snapshot. * * @return The call builder */ @@ -61,8 +60,7 @@ public GetEnvironmentFilesRequestBuilder list() { } /** - * Retrieves file metadata or directory contents from an environment's snapshot. To download file - * contents directly, pass ?alt=media or use the files.download helper. + * Retrieves a file or directory from an environment's snapshot. * * @param request The request object containing all the parameters for the API call. * @return The response from the API call @@ -73,8 +71,7 @@ public GetEnvironmentFilesResponse list(@Nonnull GetEnvironmentFilesRequest requ } /** - * Retrieves file metadata or directory contents from an environment's snapshot. To download file - * contents directly, pass ?alt=media or use the files.download helper. + * Retrieves a file or directory from an environment's snapshot. * * @param request The request object containing all the parameters for the API call. * @param options additional options diff --git a/src/main/java/com/google/genai/gaos/GenAI.java b/src/main/java/com/google/genai/gaos/GenAI.java index aeea99a48da..05e04e282f1 100644 --- a/src/main/java/com/google/genai/gaos/GenAI.java +++ b/src/main/java/com/google/genai/gaos/GenAI.java @@ -223,6 +223,17 @@ public Builder apiVersion(String apiVersion) { return this; } + /** + * Allows setting the apiRevision parameter for all supported operations. + * + * @param apiRevision The value to set. + * @return The builder instance. + */ + public Builder apiRevision(String apiRevision) { + this.sdkConfiguration.globals.putParam("header", "Api-Revision", apiRevision); + return this; + } + /** * Allows setting the userProject parameter for all supported operations. * diff --git a/src/main/java/com/google/genai/gaos/Interactions.java b/src/main/java/com/google/genai/gaos/Interactions.java index ac38fe2197e..c3858200ccb 100644 --- a/src/main/java/com/google/genai/gaos/Interactions.java +++ b/src/main/java/com/google/genai/gaos/Interactions.java @@ -65,9 +65,7 @@ public AsyncInteractions async() { } /** - * Creating an interaction - * - *

Creates a new interaction. + * Generates a set of responses from the model. * * @return The call builder */ @@ -76,9 +74,7 @@ public CreateInteractionRequestBuilder create() { } /** - * Creating an interaction - * - *

Creates a new interaction. + * Generates a set of responses from the model. * * @param body The request body. * @return The response from the API call @@ -89,11 +85,9 @@ public CreateInteractionResponse create(@Nonnull CreateInteractionRequestBody bo } /** - * Creating an interaction - * - *

Creates a new interaction. + * Generates a set of responses from the model. * - * @param apiVersion Which version of the API to use. + * @param apiVersion API version for request routing. * @param body The request body. * @param options additional options * @return The response from the API call @@ -109,9 +103,7 @@ public CreateInteractionResponse create( } /** - * Deleting an interaction - * - *

Deletes the interaction by id. + * Deletes an interaction. * * @return The call builder */ @@ -120,11 +112,10 @@ public DeleteInteractionRequestBuilder delete() { } /** - * Deleting an interaction - * - *

Deletes the interaction by id. + * Deletes an interaction. * - * @param id The unique identifier of the interaction to delete. + * @param id Part of `name`. Required. The name of the interaction to delete. + * Format: interactions/{interaction} * @return The response from the API call * @throws RuntimeException subclass if the API call fails */ @@ -133,12 +124,11 @@ public DeleteInteractionResponse delete(@Nonnull String id) { } /** - * Deleting an interaction - * - *

Deletes the interaction by id. + * Deletes an interaction. * - * @param apiVersion Which version of the API to use. - * @param id The unique identifier of the interaction to delete. + * @param apiVersion API version for request routing. + * @param id Part of `name`. Required. The name of the interaction to delete. + * Format: interactions/{interaction} * @param options additional options * @return The response from the API call * @throws RuntimeException subclass if the API call fails @@ -153,9 +143,7 @@ public DeleteInteractionResponse delete( } /** - * Retrieving an interaction - * - *

Retrieves the full details of a single interaction based on its `Interaction.id`. + * Gets an interaction. * * @return The call builder */ @@ -164,9 +152,7 @@ public GetInteractionByIdRequestBuilder get() { } /** - * Retrieving an interaction - * - *

Retrieves the full details of a single interaction based on its `Interaction.id`. + * Gets an interaction. * * @param request The request object containing all the parameters for the API call. * @return The response from the API call @@ -177,9 +163,7 @@ public GetInteractionByIdResponse get(@Nonnull GetInteractionByIdRequest request } /** - * Retrieving an interaction - * - *

Retrieves the full details of a single interaction based on its `Interaction.id`. + * Gets an interaction. * * @param request The request object containing all the parameters for the API call. * @param options additional options @@ -193,9 +177,7 @@ public GetInteractionByIdResponse get(@Nonnull GetInteractionByIdRequest request } /** - * Canceling an interaction - * - *

Cancels an interaction by id. This only applies to background interactions that are still running. + * Cancels an interaction. * * @return The call builder */ @@ -204,11 +186,10 @@ public CancelInteractionByIdRequestBuilder cancel() { } /** - * Canceling an interaction - * - *

Cancels an interaction by id. This only applies to background interactions that are still running. + * Cancels an interaction. * - * @param id The unique identifier of the interaction to cancel. + * @param id Part of `name`. Required. The name of the interaction to cancel. + * Format: `interactions/{interaction}`. * @return The response from the API call * @throws RuntimeException subclass if the API call fails */ @@ -217,12 +198,11 @@ public CancelInteractionByIdResponse cancel(@Nonnull String id) { } /** - * Canceling an interaction - * - *

Cancels an interaction by id. This only applies to background interactions that are still running. + * Cancels an interaction. * - * @param apiVersion Which version of the API to use. - * @param id The unique identifier of the interaction to cancel. + * @param apiVersion API version for request routing. + * @param id Part of `name`. Required. The name of the interaction to cancel. + * Format: `interactions/{interaction}`. * @param options additional options * @return The response from the API call * @throws RuntimeException subclass if the API call fails diff --git a/src/main/java/com/google/genai/gaos/Triggers.java b/src/main/java/com/google/genai/gaos/Triggers.java index 788a5782e71..dcd58926b4d 100644 --- a/src/main/java/com/google/genai/gaos/Triggers.java +++ b/src/main/java/com/google/genai/gaos/Triggers.java @@ -55,7 +55,7 @@ import com.google.genai.gaos.utils.Options; import jakarta.annotation.Nonnull; import jakarta.annotation.Nullable; -import java.lang.Long; +import java.lang.Integer; import java.lang.String; @@ -101,17 +101,18 @@ public ListTriggersResponse listDirect() { /** * Lists triggers for a project. * - * @param apiVersion Which version of the API to use. - * @param filter Optional. Filter expression (e.g., by state). - * @param pageSize Optional. The maximum number of triggers to return per page. - * @param pageToken Optional. A page token from a previous ListTriggers call. + * @param apiVersion API version for request routing. + * @param filter Optional. Filter expression (e.g. `agent="agents/my-agent-id"`). Only + * equality filtering on the `agent` field is currently supported. + * @param pageSize The maximum number of triggers to return per page. + * @param pageToken A page token from a previous ListTriggers call. * @param options additional options * @return The response from the API call * @throws RuntimeException subclass if the API call fails */ public ListTriggersResponse list( @Nullable String apiVersion, @Nullable String filter, - @Nullable Long pageSize, @Nullable String pageToken, + @Nullable Integer pageSize, @Nullable String pageToken, @Nullable Options options) { ListTriggersRequest request = new ListTriggersRequest( apiVersion, filter, pageSize, @@ -122,7 +123,8 @@ public ListTriggersResponse list( } /** - * Creates a new trigger that will invoke the specified agent on the given cron schedule. + * Creates a new trigger that will invoke the specified agent + * on the given cron schedule. * * @return The call builder */ @@ -131,7 +133,8 @@ public CreateTriggerRequestBuilder create() { } /** - * Creates a new trigger that will invoke the specified agent on the given cron schedule. + * Creates a new trigger that will invoke the specified agent + * on the given cron schedule. * * @param body Parameters for creating a trigger. * @return The response from the API call @@ -142,9 +145,10 @@ public CreateTriggerResponse create(@Nonnull TriggerCreateParams body) { } /** - * Creates a new trigger that will invoke the specified agent on the given cron schedule. + * Creates a new trigger that will invoke the specified agent + * on the given cron schedule. * - * @param apiVersion Which version of the API to use. + * @param apiVersion API version for request routing. * @param body Parameters for creating a trigger. * @param options additional options * @return The response from the API call @@ -160,7 +164,8 @@ public CreateTriggerResponse create( } /** - * Deletes a trigger. + * Deletes a trigger. Does not delete past interaction histories + * or environments created by past executions. * * @return The call builder */ @@ -169,9 +174,10 @@ public DeleteTriggerRequestBuilder delete() { } /** - * Deletes a trigger. + * Deletes a trigger. Does not delete past interaction histories + * or environments created by past executions. * - * @param id Resource name of the trigger. + * @param id Required. The ID of the trigger to delete. * @return The response from the API call * @throws RuntimeException subclass if the API call fails */ @@ -180,10 +186,11 @@ public DeleteTriggerResponse delete(@Nonnull String id) { } /** - * Deletes a trigger. + * Deletes a trigger. Does not delete past interaction histories + * or environments created by past executions. * - * @param apiVersion Which version of the API to use. - * @param id Resource name of the trigger. + * @param apiVersion API version for request routing. + * @param id Required. The ID of the trigger to delete. * @param options additional options * @return The response from the API call * @throws RuntimeException subclass if the API call fails @@ -198,7 +205,7 @@ public DeleteTriggerResponse delete( } /** - * Gets details of a single trigger. + * Gets a trigger, including recent execution history. * * @return The call builder */ @@ -207,9 +214,9 @@ public GetTriggerRequestBuilder get() { } /** - * Gets details of a single trigger. + * Gets a trigger, including recent execution history. * - * @param id Resource name of the trigger. + * @param id Required. The ID of the trigger to retrieve. * @return The response from the API call * @throws RuntimeException subclass if the API call fails */ @@ -218,10 +225,10 @@ public GetTriggerResponse get(@Nonnull String id) { } /** - * Gets details of a single trigger. + * Gets a trigger, including recent execution history. * - * @param apiVersion Which version of the API to use. - * @param id Resource name of the trigger. + * @param apiVersion API version for request routing. + * @param id Required. The ID of the trigger to retrieve. * @param options additional options * @return The response from the API call * @throws RuntimeException subclass if the API call fails @@ -236,7 +243,7 @@ public GetTriggerResponse get( } /** - * Updates a trigger. + * Updates a trigger. Supports partial updates via field_mask. * * @return The call builder */ @@ -245,9 +252,9 @@ public UpdateTriggerRequestBuilder update() { } /** - * Updates a trigger. + * Updates a trigger. Supports partial updates via field_mask. * - * @param id Resource name of the trigger. + * @param id Required. The ID of the trigger to update. * @param body Represents the fields of a Trigger that can be updated. * @return The response from the API call * @throws RuntimeException subclass if the API call fails @@ -258,10 +265,10 @@ public UpdateTriggerResponse update(@Nonnull String id, @Nonnull TriggerUpdate b } /** - * Updates a trigger. + * Updates a trigger. Supports partial updates via field_mask. * - * @param apiVersion Which version of the API to use. - * @param id Resource name of the trigger. + * @param apiVersion API version for request routing. + * @param id Required. The ID of the trigger to update. * @param body Represents the fields of a Trigger that can be updated. * @param options additional options * @return The response from the API call @@ -288,40 +295,41 @@ public ListTriggerExecutionsRequestBuilder listExecutions() { /** * Lists executions for a trigger. * - * @param triggerId Resource name of the trigger. + * @param triggerId Required. The trigger ID to list executions from. * @return The response from the API call * @throws RuntimeException subclass if the API call fails */ public ListTriggerExecutionsResponse listExecutions(@Nonnull String triggerId) { - return listExecutions(null, triggerId, null, - null, null); + return listExecutions(null, null, null, + triggerId, null); } /** * Lists executions for a trigger. * - * @param apiVersion Which version of the API to use. - * @param triggerId Resource name of the trigger. - * @param pageSize Optional. The maximum number of executions to return per page. - * @param pageToken Optional. A page token from a previous ListTriggerExecutions call. + * @param apiVersion API version for request routing. + * @param pageSize The maximum number of executions to return per page. + * @param pageToken A page token from a previous ListTriggerExecutions call. + * @param triggerId Required. The trigger ID to list executions from. * @param options additional options * @return The response from the API call * @throws RuntimeException subclass if the API call fails */ public ListTriggerExecutionsResponse listExecutions( - @Nullable String apiVersion, @Nonnull String triggerId, - @Nullable Long pageSize, @Nullable String pageToken, + @Nullable String apiVersion, @Nullable Integer pageSize, + @Nullable String pageToken, @Nonnull String triggerId, @Nullable Options options) { ListTriggerExecutionsRequest request = new ListTriggerExecutionsRequest( - apiVersion, triggerId, pageSize, - pageToken); + apiVersion, pageSize, pageToken, + triggerId); RequestOperation operation = new ListTriggerExecutions.Sync(sdkConfiguration, options, _headers); return operation.handleResponse(operation.doRequest(request)); } /** - * Runs a trigger immediately. + * Immediately fires a trigger, bypassing the cron schedule. + * Useful for testing and manual runs. * * @return The call builder */ @@ -330,9 +338,10 @@ public RunTriggerRequestBuilder run() { } /** - * Runs a trigger immediately. + * Immediately fires a trigger, bypassing the cron schedule. + * Useful for testing and manual runs. * - * @param triggerId Resource name of the trigger. + * @param triggerId Required. The ID of the trigger to run immediately. * @return The response from the API call * @throws RuntimeException subclass if the API call fails */ @@ -341,10 +350,11 @@ public RunTriggerResponse run(@Nonnull String triggerId) { } /** - * Runs a trigger immediately. + * Immediately fires a trigger, bypassing the cron schedule. + * Useful for testing and manual runs. * - * @param apiVersion Which version of the API to use. - * @param triggerId Resource name of the trigger. + * @param apiVersion API version for request routing. + * @param triggerId Required. The ID of the trigger to run immediately. * @param options additional options * @return The response from the API call * @throws RuntimeException subclass if the API call fails diff --git a/src/main/java/com/google/genai/gaos/Webhooks.java b/src/main/java/com/google/genai/gaos/Webhooks.java index ab4edbf0e7c..da101311e45 100644 --- a/src/main/java/com/google/genai/gaos/Webhooks.java +++ b/src/main/java/com/google/genai/gaos/Webhooks.java @@ -101,11 +101,11 @@ public ListWebhooksResponse listDirect() { /** * Lists all Webhooks. * - * @param apiVersion Which version of the API to use. - * @param pageSize Optional. The maximum number of webhooks to return. The service may return fewer than + * @param apiVersion API version for request routing. + * @param pageSize The maximum number of webhooks to return. The service may return fewer than * this value. If unspecified, at most 50 webhooks will be returned. * The maximum value is 1000. - * @param pageToken Optional. A page token, received from a previous `ListWebhooks` call. + * @param pageToken A page token, received from a previous `ListWebhooks` call. * Provide this to retrieve the subsequent page. * @param options additional options * @return The response from the API call @@ -143,7 +143,7 @@ public CreateWebhookResponse create(@Nonnull WebhookInput body) { /** * Creates a new Webhook. * - * @param apiVersion Which version of the API to use. + * @param apiVersion API version for request routing. * @param body A Webhook resource. * @param options additional options * @return The response from the API call @@ -182,7 +182,7 @@ public DeleteWebhookResponse delete(@Nonnull String id) { /** * Deletes a Webhook. * - * @param apiVersion Which version of the API to use. + * @param apiVersion API version for request routing. * @param id Required. The ID of the webhook to delete. * Format: `{webhook_id}` * @param options additional options @@ -221,7 +221,7 @@ public GetWebhookResponse get(@Nonnull String id) { /** * Gets a specific Webhook. * - * @param apiVersion Which version of the API to use. + * @param apiVersion API version for request routing. * @param id Required. The ID of the webhook to retrieve. * @param options additional options * @return The response from the API call @@ -260,9 +260,9 @@ public UpdateWebhookResponse update(@Nonnull String id) { /** * Updates an existing Webhook. * - * @param apiVersion Which version of the API to use. + * @param apiVersion API version for request routing. * @param id Required. The ID of the webhook to update. - * @param updateMask Optional. The list of fields to update. + * @param updateMask Optional list of fields to update. * @param body * @param options additional options * @return The response from the API call @@ -293,7 +293,6 @@ public PingWebhookRequestBuilder ping() { * Sends a ping event to a Webhook. * * @param id Required. The ID of the webhook to ping. - * Format: `{webhook_id}` * @return The response from the API call * @throws RuntimeException subclass if the API call fails */ @@ -305,9 +304,8 @@ public PingWebhookResponse ping(@Nonnull String id) { /** * Sends a ping event to a Webhook. * - * @param apiVersion Which version of the API to use. + * @param apiVersion API version for request routing. * @param id Required. The ID of the webhook to ping. - * Format: `{webhook_id}` * @param body Request message for WebhookService.PingWebhook. * @param options additional options * @return The response from the API call @@ -334,8 +332,7 @@ public RotateSigningSecretRequestBuilder rotateSigningSecret() { /** * Generates a new signing secret for a Webhook. * - * @param id Required. The ID of the webhook for which to generate a signing secret. - * Format: `{webhook_id}` + * @param id Required. The ID of the webhook for which to rotate the signing secret. * @return The response from the API call * @throws RuntimeException subclass if the API call fails */ @@ -347,9 +344,8 @@ public RotateSigningSecretResponse rotateSigningSecret(@Nonnull String id) { /** * Generates a new signing secret for a Webhook. * - * @param apiVersion Which version of the API to use. - * @param id Required. The ID of the webhook for which to generate a signing secret. - * Format: `{webhook_id}` + * @param apiVersion API version for request routing. + * @param id Required. The ID of the webhook for which to rotate the signing secret. * @param body Request message for WebhookService.RotateSigningSecret. * @param options additional options * @return The response from the API call diff --git a/src/main/java/com/google/genai/gaos/models/errors/CancelInteractionByIdClientError.java b/src/main/java/com/google/genai/gaos/models/errors/CancelInteractionByIdClientError.java index 8ce93db6fb8..7e896fd3b1e 100644 --- a/src/main/java/com/google/genai/gaos/models/errors/CancelInteractionByIdClientError.java +++ b/src/main/java/com/google/genai/gaos/models/errors/CancelInteractionByIdClientError.java @@ -89,7 +89,7 @@ public Optional deserializationException() { /** * Data * - *

Error cancelling interaction + *

Client Error */ public static class Data { /** diff --git a/src/main/java/com/google/genai/gaos/models/errors/CancelInteractionByIdServerError.java b/src/main/java/com/google/genai/gaos/models/errors/CancelInteractionByIdServerError.java index 5a65b926a61..3aff4b2096c 100644 --- a/src/main/java/com/google/genai/gaos/models/errors/CancelInteractionByIdServerError.java +++ b/src/main/java/com/google/genai/gaos/models/errors/CancelInteractionByIdServerError.java @@ -89,7 +89,7 @@ public Optional deserializationException() { /** * Data * - *

Error cancelling interaction + *

Server Error */ public static class Data { /** diff --git a/src/main/java/com/google/genai/gaos/models/errors/CreateInteractionClientError.java b/src/main/java/com/google/genai/gaos/models/errors/CreateInteractionClientError.java index 5d3eebeedb0..e7b0e9d46e3 100644 --- a/src/main/java/com/google/genai/gaos/models/errors/CreateInteractionClientError.java +++ b/src/main/java/com/google/genai/gaos/models/errors/CreateInteractionClientError.java @@ -89,7 +89,7 @@ public Optional deserializationException() { /** * Data * - *

Error creating interaction + *

Client Error */ public static class Data { /** diff --git a/src/main/java/com/google/genai/gaos/models/errors/CreateInteractionServerError.java b/src/main/java/com/google/genai/gaos/models/errors/CreateInteractionServerError.java index 76d0833773a..c4b3627d6b8 100644 --- a/src/main/java/com/google/genai/gaos/models/errors/CreateInteractionServerError.java +++ b/src/main/java/com/google/genai/gaos/models/errors/CreateInteractionServerError.java @@ -89,7 +89,7 @@ public Optional deserializationException() { /** * Data * - *

Error creating interaction + *

Server Error */ public static class Data { /** diff --git a/src/main/java/com/google/genai/gaos/models/errors/DeleteInteractionClientError.java b/src/main/java/com/google/genai/gaos/models/errors/DeleteInteractionClientError.java index 2f191b6a79e..a64c085cdcf 100644 --- a/src/main/java/com/google/genai/gaos/models/errors/DeleteInteractionClientError.java +++ b/src/main/java/com/google/genai/gaos/models/errors/DeleteInteractionClientError.java @@ -89,7 +89,7 @@ public Optional deserializationException() { /** * Data * - *

Error deleting interaction + *

Client Error */ public static class Data { /** diff --git a/src/main/java/com/google/genai/gaos/models/errors/DeleteInteractionServerError.java b/src/main/java/com/google/genai/gaos/models/errors/DeleteInteractionServerError.java index db7d8d18d71..e56c550033f 100644 --- a/src/main/java/com/google/genai/gaos/models/errors/DeleteInteractionServerError.java +++ b/src/main/java/com/google/genai/gaos/models/errors/DeleteInteractionServerError.java @@ -89,7 +89,7 @@ public Optional deserializationException() { /** * Data * - *

Error deleting interaction + *

Server Error */ public static class Data { /** diff --git a/src/main/java/com/google/genai/gaos/models/errors/GetInteractionByIdClientError.java b/src/main/java/com/google/genai/gaos/models/errors/GetInteractionByIdClientError.java index 041e7f9c2c6..d5030da584a 100644 --- a/src/main/java/com/google/genai/gaos/models/errors/GetInteractionByIdClientError.java +++ b/src/main/java/com/google/genai/gaos/models/errors/GetInteractionByIdClientError.java @@ -89,7 +89,7 @@ public Optional deserializationException() { /** * Data * - *

Error getting interaction + *

Client Error */ public static class Data { /** diff --git a/src/main/java/com/google/genai/gaos/models/errors/GetInteractionByIdServerError.java b/src/main/java/com/google/genai/gaos/models/errors/GetInteractionByIdServerError.java index d13bdc6feb3..4363f3f4088 100644 --- a/src/main/java/com/google/genai/gaos/models/errors/GetInteractionByIdServerError.java +++ b/src/main/java/com/google/genai/gaos/models/errors/GetInteractionByIdServerError.java @@ -89,7 +89,7 @@ public Optional deserializationException() { /** * Data * - *

Error getting interaction + *

Server Error */ public static class Data { /** diff --git a/src/main/java/com/google/genai/gaos/models/interactions/AllowlistEntry.java b/src/main/java/com/google/genai/gaos/models/interactions/AllowlistEntry.java index 37c37b3d2b9..02591b7de1c 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/AllowlistEntry.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/AllowlistEntry.java @@ -33,13 +33,16 @@ /** * AllowlistEntry * - *

A single domain allowlist rule with optional header injection. + *

A network egress rule that controls which external domains the + * environment is allowed to reach. Each rule identifies a target domain + * and, optionally, a set of HTTP headers to inject into every matching + * outbound request. */ public class AllowlistEntry { /** - * Domain to allow outbound requests to. Supports wildcards (e.g. '*.googleapis.com'). - * - *

Use '*' to allow all domains. + * The domain pattern to match for this rule. + * Use an exact hostname (e.g., `github.com`), a wildcard prefix + * (e.g., `*.googleapis.com`), or `*` to match all domains. */ @JsonProperty("domain") private String domain; @@ -67,9 +70,9 @@ public AllowlistEntry( } /** - * Domain to allow outbound requests to. Supports wildcards (e.g. '*.googleapis.com'). - * - *

Use '*' to allow all domains. + * The domain pattern to match for this rule. + * Use an exact hostname (e.g., `github.com`), a wildcard prefix + * (e.g., `*.googleapis.com`), or `*` to match all domains. */ public Optional domain() { return Optional.ofNullable(this.domain); @@ -89,9 +92,9 @@ public static Builder builder() { /** - * Domain to allow outbound requests to. Supports wildcards (e.g. '*.googleapis.com'). - * - *

Use '*' to allow all domains. + * The domain pattern to match for this rule. + * Use an exact hostname (e.g., `github.com`), a wildcard prefix + * (e.g., `*.googleapis.com`), or `*` to match all domains. */ public AllowlistEntry withDomain(@Nonnull String domain) { this.domain = Utils.checkNotNull(domain, "domain"); @@ -148,9 +151,9 @@ private Builder() { } /** - * Domain to allow outbound requests to. Supports wildcards (e.g. '*.googleapis.com'). - * - *

Use '*' to allow all domains. + * The domain pattern to match for this rule. + * Use an exact hostname (e.g., `github.com`), a wildcard prefix + * (e.g., `*.googleapis.com`), or `*` to match all domains. */ public Builder domain(@Nonnull String domain) { this.domain = Utils.checkNotNull(domain, "domain"); diff --git a/src/main/java/com/google/genai/gaos/models/interactions/AudioContentMimeType.java b/src/main/java/com/google/genai/gaos/models/interactions/AudioContentMimeType.java index d63d9107b44..7f788b49487 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/AudioContentMimeType.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/AudioContentMimeType.java @@ -53,7 +53,6 @@ public class AudioContentMimeType { public static final AudioContentMimeType AUDIO_OPUS = new AudioContentMimeType("audio/opus"); public static final AudioContentMimeType AUDIO_ALAW = new AudioContentMimeType("audio/alaw"); public static final AudioContentMimeType AUDIO_MULAW = new AudioContentMimeType("audio/mulaw"); - public static final AudioContentMimeType AUDIO_WEBM = new AudioContentMimeType("audio/webm"); // This map will grow whenever a Color gets created with a new // unrecognized value (a potential memory leak if the user is not @@ -139,7 +138,6 @@ private static final Map createValuesMap() { map.put("audio/opus", AUDIO_OPUS); map.put("audio/alaw", AUDIO_ALAW); map.put("audio/mulaw", AUDIO_MULAW); - map.put("audio/webm", AUDIO_WEBM); return map; } @@ -157,7 +155,6 @@ private static final Map createEnumsMap() { map.put("audio/opus", AudioContentMimeTypeEnum.AUDIO_OPUS); map.put("audio/alaw", AudioContentMimeTypeEnum.AUDIO_ALAW); map.put("audio/mulaw", AudioContentMimeTypeEnum.AUDIO_MULAW); - map.put("audio/webm", AudioContentMimeTypeEnum.AUDIO_WEBM); return map; } @@ -175,8 +172,7 @@ public enum AudioContentMimeTypeEnum { AUDIO_L16("audio/l16"), AUDIO_OPUS("audio/opus"), AUDIO_ALAW("audio/alaw"), - AUDIO_MULAW("audio/mulaw"), - AUDIO_WEBM("audio/webm"),; + AUDIO_MULAW("audio/mulaw"),; private final String value; diff --git a/src/main/java/com/google/genai/gaos/models/interactions/CodeExecutionCallDelta.java b/src/main/java/com/google/genai/gaos/models/interactions/CodeExecutionCallDelta.java index e91ca3e7f2e..8884ddf2123 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/CodeExecutionCallDelta.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/CodeExecutionCallDelta.java @@ -40,6 +40,13 @@ public class CodeExecutionCallDelta implements StepDeltaData { @JsonProperty("arguments") private CodeExecutionCallArguments arguments; + /** + * Required. A unique ID for this specific tool call. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private String id; + /** * A signature hash for backend validation. */ @@ -54,16 +61,18 @@ public class CodeExecutionCallDelta implements StepDeltaData { @JsonCreator public CodeExecutionCallDelta( @JsonProperty("arguments") @Nonnull CodeExecutionCallArguments arguments, + @JsonProperty("id") @Nullable String id, @JsonProperty("signature") @Nullable String signature) { this.arguments = Optional.ofNullable(arguments) .orElseThrow(() -> new IllegalArgumentException("arguments cannot be null")); + this.id = id; this.signature = signature; this.type = Builder._SINGLETON_VALUE_Type.value(); } public CodeExecutionCallDelta( @Nonnull CodeExecutionCallArguments arguments) { - this(arguments, null); + this(arguments, null, null); } /** @@ -73,6 +82,13 @@ public Optional arguments() { return Optional.ofNullable(this.arguments); } + /** + * Required. A unique ID for this specific tool call. + */ + public Optional id() { + return Optional.ofNullable(this.id); + } + /** * A signature hash for backend validation. */ @@ -99,6 +115,15 @@ public CodeExecutionCallDelta withArguments(@Nonnull CodeExecutionCallArguments } + /** + * Required. A unique ID for this specific tool call. + */ + public CodeExecutionCallDelta withId(@Nullable String id) { + this.id = id; + return this; + } + + /** * A signature hash for backend validation. */ @@ -119,6 +144,7 @@ public boolean equals(java.lang.Object o) { CodeExecutionCallDelta other = (CodeExecutionCallDelta) o; return Utils.enhancedDeepEquals(this.arguments, other.arguments) && + Utils.enhancedDeepEquals(this.id, other.id) && Utils.enhancedDeepEquals(this.signature, other.signature) && Utils.enhancedDeepEquals(this.type, other.type); } @@ -126,13 +152,15 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { return Utils.enhancedHash( - arguments, signature, type); + arguments, id, signature, + type); } @Override public String toString() { return Utils.toString(CodeExecutionCallDelta.class, "arguments", arguments, + "id", id, "signature", signature, "type", type); } @@ -142,6 +170,8 @@ public final static class Builder { private CodeExecutionCallArguments arguments; + private String id; + private String signature; private Builder() { @@ -156,6 +186,14 @@ public Builder arguments(@Nonnull CodeExecutionCallArguments arguments) { return this; } + /** + * Required. A unique ID for this specific tool call. + */ + public Builder id(@Nullable String id) { + this.id = id; + return this; + } + /** * A signature hash for backend validation. */ @@ -166,7 +204,7 @@ public Builder signature(@Nullable String signature) { public CodeExecutionCallDelta build() { return new CodeExecutionCallDelta( - arguments, signature); + arguments, id, signature); } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/CodeExecutionResultDelta.java b/src/main/java/com/google/genai/gaos/models/interactions/CodeExecutionResultDelta.java index 0ebdf0a7447..de6ddb98a0e 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/CodeExecutionResultDelta.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/CodeExecutionResultDelta.java @@ -35,6 +35,13 @@ public class CodeExecutionResultDelta implements StepDeltaData { + /** + * Required. ID to match the ID from the function call block. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("call_id") + private String callId; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("is_error") @@ -57,9 +64,11 @@ public class CodeExecutionResultDelta implements StepDeltaData { @JsonCreator public CodeExecutionResultDelta( + @JsonProperty("call_id") @Nullable String callId, @JsonProperty("is_error") @Nullable Boolean isError, @JsonProperty("result") @Nonnull String result, @JsonProperty("signature") @Nullable String signature) { + this.callId = callId; this.isError = isError; this.result = Optional.ofNullable(result) .orElseThrow(() -> new IllegalArgumentException("result cannot be null")); @@ -69,7 +78,15 @@ public CodeExecutionResultDelta( public CodeExecutionResultDelta( @Nonnull String result) { - this(null, result, null); + this(null, null, result, + null); + } + + /** + * Required. ID to match the ID from the function call block. + */ + public Optional callId() { + return Optional.ofNullable(this.callId); } public Optional isError() { @@ -97,6 +114,15 @@ public static Builder builder() { } + /** + * Required. ID to match the ID from the function call block. + */ + public CodeExecutionResultDelta withCallId(@Nullable String callId) { + this.callId = callId; + return this; + } + + public CodeExecutionResultDelta withIsError(@Nullable Boolean isError) { this.isError = isError; return this; @@ -128,6 +154,7 @@ public boolean equals(java.lang.Object o) { } CodeExecutionResultDelta other = (CodeExecutionResultDelta) o; return + Utils.enhancedDeepEquals(this.callId, other.callId) && Utils.enhancedDeepEquals(this.isError, other.isError) && Utils.enhancedDeepEquals(this.result, other.result) && Utils.enhancedDeepEquals(this.signature, other.signature) && @@ -137,13 +164,14 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { return Utils.enhancedHash( - isError, result, signature, - type); + callId, isError, result, + signature, type); } @Override public String toString() { return Utils.toString(CodeExecutionResultDelta.class, + "callId", callId, "isError", isError, "result", result, "signature", signature, @@ -153,6 +181,8 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { + private String callId; + private Boolean isError; private String result; @@ -163,6 +193,14 @@ private Builder() { // force use of static builder() method } + /** + * Required. ID to match the ID from the function call block. + */ + public Builder callId(@Nullable String callId) { + this.callId = callId; + return this; + } + public Builder isError(@Nullable Boolean isError) { this.isError = isError; return this; @@ -183,7 +221,8 @@ public Builder signature(@Nullable String signature) { public CodeExecutionResultDelta build() { return new CodeExecutionResultDelta( - isError, result, signature); + callId, isError, result, + signature); } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/CreateAgentInteraction.java b/src/main/java/com/google/genai/gaos/models/interactions/CreateAgentInteraction.java index 3a97ffc7d59..4f097162839 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/CreateAgentInteraction.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/CreateAgentInteraction.java @@ -37,7 +37,7 @@ /** * CreateAgentInteraction * - *

Parameters for creating agent interactions + *

Interaction for generating the completion using agents. */ public class CreateAgentInteraction { /** @@ -47,7 +47,7 @@ public class CreateAgentInteraction { private AgentOption agent; /** - * Configuration parameters for the agent interaction. + * Parameters for the agent interaction. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("agent_config") @@ -61,8 +61,7 @@ public class CreateAgentInteraction { private Boolean background; /** - * The environment configuration for the interaction. Can be an object specifying remote environment - * sources or a string referencing an existing environment ID. + * The environment configuration for the interaction. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("environment") @@ -71,11 +70,18 @@ public class CreateAgentInteraction { /** * The input for the interaction. */ + @JsonInclude(Include.NON_ABSENT) @JsonProperty("input") private InteractionsInput input; /** - * The labels with user-defined metadata for the request. + * The labels with user-defined metadata for the request. It is used for + * billing and reporting only. + * + *

Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("labels") @@ -88,10 +94,7 @@ public class CreateAgentInteraction { @JsonProperty("previous_interaction_id") private String previousInteractionId; - /** - * Enforces that the generated response is a JSON object that complies with the JSON schema specified - * in this field. - */ + @JsonInclude(Include.NON_ABSENT) @JsonProperty("response_format") private CreateAgentInteractionResponseFormat responseFormat; @@ -169,7 +172,7 @@ public CreateAgentInteraction( @JsonProperty("agent_config") @Nullable CreateAgentInteractionAgentConfig agentConfig, @JsonProperty("background") @Nullable Boolean background, @JsonProperty("environment") @Nullable CreateAgentInteractionEnvironment environment, - @JsonProperty("input") @Nonnull InteractionsInput input, + @JsonProperty("input") @Nullable InteractionsInput input, @JsonProperty("labels") @Nullable Map labels, @JsonProperty("previous_interaction_id") @Nullable String previousInteractionId, @JsonProperty("response_format") @Nullable CreateAgentInteractionResponseFormat responseFormat, @@ -187,8 +190,7 @@ public CreateAgentInteraction( this.agentConfig = agentConfig; this.background = background; this.environment = environment; - this.input = Optional.ofNullable(input) - .orElseThrow(() -> new IllegalArgumentException("input cannot be null")); + this.input = input; this.labels = labels; this.previousInteractionId = previousInteractionId; this.responseFormat = responseFormat; @@ -204,10 +206,9 @@ public CreateAgentInteraction( } public CreateAgentInteraction( - @Nonnull AgentOption agent, - @Nonnull InteractionsInput input) { + @Nonnull AgentOption agent) { this(agent, null, null, - null, input, null, + null, null, null, null, null, null, null, null, null, null, null, null, @@ -222,7 +223,7 @@ public Optional agent() { } /** - * Configuration parameters for the agent interaction. + * Parameters for the agent interaction. */ public Optional agentConfig() { return Optional.ofNullable(this.agentConfig); @@ -236,8 +237,7 @@ public Optional background() { } /** - * The environment configuration for the interaction. Can be an object specifying remote environment - * sources or a string referencing an existing environment ID. + * The environment configuration for the interaction. */ public Optional environment() { return Optional.ofNullable(this.environment); @@ -251,7 +251,13 @@ public Optional input() { } /** - * The labels with user-defined metadata for the request. + * The labels with user-defined metadata for the request. It is used for + * billing and reporting only. + * + *

Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. */ public Optional> labels() { return Optional.ofNullable(this.labels); @@ -264,10 +270,6 @@ public Optional previousInteractionId() { return Optional.ofNullable(this.previousInteractionId); } - /** - * Enforces that the generated response is a JSON object that complies with the JSON schema specified - * in this field. - */ public Optional responseFormat() { return Optional.ofNullable(this.responseFormat); } @@ -353,7 +355,7 @@ public CreateAgentInteraction withAgent(@Nonnull AgentOption agent) { /** - * Configuration parameters for the agent interaction. + * Parameters for the agent interaction. */ public CreateAgentInteraction withAgentConfig(@Nullable CreateAgentInteractionAgentConfig agentConfig) { this.agentConfig = agentConfig; @@ -371,8 +373,7 @@ public CreateAgentInteraction withBackground(@Nullable Boolean background) { /** - * The environment configuration for the interaction. Can be an object specifying remote environment - * sources or a string referencing an existing environment ID. + * The environment configuration for the interaction. */ public CreateAgentInteraction withEnvironment(@Nullable CreateAgentInteractionEnvironment environment) { this.environment = environment; @@ -383,14 +384,20 @@ public CreateAgentInteraction withEnvironment(@Nullable CreateAgentInteractionEn /** * The input for the interaction. */ - public CreateAgentInteraction withInput(@Nonnull InteractionsInput input) { - this.input = Utils.checkNotNull(input, "input"); + public CreateAgentInteraction withInput(@Nullable InteractionsInput input) { + this.input = input; return this; } /** - * The labels with user-defined metadata for the request. + * The labels with user-defined metadata for the request. It is used for + * billing and reporting only. + * + *

Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. */ public CreateAgentInteraction withLabels(@Nullable Map labels) { this.labels = labels; @@ -407,10 +414,6 @@ public CreateAgentInteraction withPreviousInteractionId(@Nullable String previou } - /** - * Enforces that the generated response is a JSON object that complies with the JSON schema specified - * in this field. - */ public CreateAgentInteraction withResponseFormat(@Nullable CreateAgentInteractionResponseFormat responseFormat) { this.responseFormat = responseFormat; return this; @@ -615,7 +618,7 @@ public Builder agent(@Nonnull AgentOption agent) { } /** - * Configuration parameters for the agent interaction. + * Parameters for the agent interaction. */ public Builder agentConfig(@Nullable CreateAgentInteractionAgentConfig agentConfig) { this.agentConfig = agentConfig; @@ -631,8 +634,7 @@ public Builder background(@Nullable Boolean background) { } /** - * The environment configuration for the interaction. Can be an object specifying remote environment - * sources or a string referencing an existing environment ID. + * The environment configuration for the interaction. */ public Builder environment(@Nullable CreateAgentInteractionEnvironment environment) { this.environment = environment; @@ -642,13 +644,19 @@ public Builder environment(@Nullable CreateAgentInteractionEnvironment environme /** * The input for the interaction. */ - public Builder input(@Nonnull InteractionsInput input) { - this.input = Utils.checkNotNull(input, "input"); + public Builder input(@Nullable InteractionsInput input) { + this.input = input; return this; } /** - * The labels with user-defined metadata for the request. + * The labels with user-defined metadata for the request. It is used for + * billing and reporting only. + * + *

Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. */ public Builder labels(@Nullable Map labels) { this.labels = labels; @@ -663,10 +671,6 @@ public Builder previousInteractionId(@Nullable String previousInteractionId) { return this; } - /** - * Enforces that the generated response is a JSON object that complies with the JSON schema specified - * in this field. - */ public Builder responseFormat(@Nullable CreateAgentInteractionResponseFormat responseFormat) { this.responseFormat = responseFormat; return this; diff --git a/src/main/java/com/google/genai/gaos/models/interactions/CreateAgentInteractionAgentConfig.java b/src/main/java/com/google/genai/gaos/models/interactions/CreateAgentInteractionAgentConfig.java index f63e41039c4..8f98edfd8aa 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/CreateAgentInteractionAgentConfig.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/CreateAgentInteractionAgentConfig.java @@ -28,7 +28,7 @@ /** * CreateAgentInteractionAgentConfig * - *

Configuration parameters for the agent interaction. + *

Parameters for the agent interaction. */ @JsonTypeInfo( use = Id.CUSTOM, diff --git a/src/main/java/com/google/genai/gaos/models/interactions/CreateAgentInteractionAgentConfigTypeIdResolver.java b/src/main/java/com/google/genai/gaos/models/interactions/CreateAgentInteractionAgentConfigTypeIdResolver.java index ec4a369167c..f7e622310d3 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/CreateAgentInteractionAgentConfigTypeIdResolver.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/CreateAgentInteractionAgentConfigTypeIdResolver.java @@ -30,7 +30,7 @@ /** * CreateAgentInteractionAgentConfigTypeIdResolver * - *

Configuration parameters for the agent interaction. + *

Parameters for the agent interaction. */ public class CreateAgentInteractionAgentConfigTypeIdResolver extends GenericTypeIdResolver { diff --git a/src/main/java/com/google/genai/gaos/models/interactions/CreateAgentInteractionEnvironment.java b/src/main/java/com/google/genai/gaos/models/interactions/CreateAgentInteractionEnvironment.java index dd7abce6c51..0aad0ea20e8 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/CreateAgentInteractionEnvironment.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/CreateAgentInteractionEnvironment.java @@ -36,8 +36,7 @@ /** * CreateAgentInteractionEnvironment * - *

The environment configuration for the interaction. Can be an object specifying remote environment - * sources or a string referencing an existing environment ID. + *

The environment configuration for the interaction. */ @JsonDeserialize(using = CreateAgentInteractionEnvironment._Deserializer.class) public class CreateAgentInteractionEnvironment { @@ -54,6 +53,11 @@ public static CreateAgentInteractionEnvironment of(Environment value) { return new CreateAgentInteractionEnvironment(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); } + public static CreateAgentInteractionEnvironment of(LocalEnvironmentConfig value) { + Utils.checkNotNull(value, "value"); + return new CreateAgentInteractionEnvironment(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); + } + public static CreateAgentInteractionEnvironment of(String value) { Utils.checkNotNull(value, "value"); return new CreateAgentInteractionEnvironment(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); @@ -72,6 +76,19 @@ public Optional environment() { return Optional.empty(); } + /** + * Returns an {@link Optional} containing the value if it is of type {@code LocalEnvironmentConfig}, + * otherwise returns an empty {@link Optional}. + * + * @return an {@link Optional} containing the {@code LocalEnvironmentConfig} value, or empty if not of this type + */ + public Optional localEnvironmentConfig() { + if (value.value() instanceof LocalEnvironmentConfig) { + return Optional.of((LocalEnvironmentConfig) value.value()); + } + return Optional.empty(); + } + /** * Returns an {@link Optional} containing the value if it is of type {@code String}, * otherwise returns an empty {@link Optional}. @@ -120,6 +137,7 @@ public static final class _Deserializer extends OneOfDeserializer() {}, JsonShape.DEFAULT), + TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT), TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT)); } } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/CreateAgentInteractionResponseFormat.java b/src/main/java/com/google/genai/gaos/models/interactions/CreateAgentInteractionResponseFormat.java index 78cdad3a4af..26bdb9b2a9f 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/CreateAgentInteractionResponseFormat.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/CreateAgentInteractionResponseFormat.java @@ -34,12 +34,6 @@ import java.util.List; import java.util.Optional; -/** - * CreateAgentInteractionResponseFormat - * - *

Enforces that the generated response is a JSON object that complies with the JSON schema specified - * in this field. - */ @JsonDeserialize(using = CreateAgentInteractionResponseFormat._Deserializer.class) public class CreateAgentInteractionResponseFormat { diff --git a/src/main/java/com/google/genai/gaos/models/interactions/CreateModelInteraction.java b/src/main/java/com/google/genai/gaos/models/interactions/CreateModelInteraction.java index 71becdeaddd..75d008aa971 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/CreateModelInteraction.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/CreateModelInteraction.java @@ -37,7 +37,7 @@ /** * CreateModelInteraction * - *

Parameters for creating model interactions + *

Interaction for generating the completion using models. */ public class CreateModelInteraction { /** @@ -48,8 +48,21 @@ public class CreateModelInteraction { private Boolean background; /** - * The environment configuration for the interaction. Can be an object specifying remote environment - * sources or a string referencing an existing environment ID. + * The name of the cached content used as context to serve the prediction. Note: only used in explicit + * caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed + * cost savings. + * + *

Format: cachedContents/{cachedContent} + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("cached_content") + @Deprecated + private String cachedContent; + + /** + * The environment configuration for the interaction. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("environment") @@ -65,11 +78,18 @@ public class CreateModelInteraction { /** * The input for the interaction. */ + @JsonInclude(Include.NON_ABSENT) @JsonProperty("input") private InteractionsInput input; /** - * The labels with user-defined metadata for the request. + * The labels with user-defined metadata for the request. It is used for + * billing and reporting only. + * + *

Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("labels") @@ -89,10 +109,7 @@ public class CreateModelInteraction { @JsonProperty("previous_interaction_id") private String previousInteractionId; - /** - * Enforces that the generated response is a JSON object that complies with the JSON schema specified - * in this field. - */ + @JsonInclude(Include.NON_ABSENT) @JsonProperty("response_format") private CreateModelInteractionResponseFormat responseFormat; @@ -167,9 +184,10 @@ public class CreateModelInteraction { @JsonCreator public CreateModelInteraction( @JsonProperty("background") @Nullable Boolean background, + @JsonProperty("cached_content") @Nullable String cachedContent, @JsonProperty("environment") @Nullable CreateModelInteractionEnvironment environment, @JsonProperty("generation_config") @Nullable GenerationConfig generationConfig, - @JsonProperty("input") @Nonnull InteractionsInput input, + @JsonProperty("input") @Nullable InteractionsInput input, @JsonProperty("labels") @Nullable Map labels, @JsonProperty("model") @Nonnull Model model, @JsonProperty("previous_interaction_id") @Nullable String previousInteractionId, @@ -184,10 +202,10 @@ public CreateModelInteraction( @JsonProperty("tools") @Nullable List tools, @JsonProperty("webhook_config") @Nullable WebhookConfig webhookConfig) { this.background = background; + this.cachedContent = cachedContent; this.environment = environment; this.generationConfig = generationConfig; - this.input = Optional.ofNullable(input) - .orElseThrow(() -> new IllegalArgumentException("input cannot be null")); + this.input = input; this.labels = labels; this.model = Optional.ofNullable(model) .orElseThrow(() -> new IllegalArgumentException("model cannot be null")); @@ -205,14 +223,13 @@ public CreateModelInteraction( } public CreateModelInteraction( - @Nonnull InteractionsInput input, @Nonnull Model model) { this(null, null, null, - input, null, model, null, null, null, + model, null, null, null, null, null, null, null, null, - null, null); + null, null, null); } /** @@ -223,8 +240,21 @@ public Optional background() { } /** - * The environment configuration for the interaction. Can be an object specifying remote environment - * sources or a string referencing an existing environment ID. + * The name of the cached content used as context to serve the prediction. Note: only used in explicit + * caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed + * cost savings. + * + *

Format: cachedContents/{cachedContent} + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Optional cachedContent() { + return Optional.ofNullable(this.cachedContent); + } + + /** + * The environment configuration for the interaction. */ public Optional environment() { return Optional.ofNullable(this.environment); @@ -245,7 +275,13 @@ public Optional input() { } /** - * The labels with user-defined metadata for the request. + * The labels with user-defined metadata for the request. It is used for + * billing and reporting only. + * + *

Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. */ public Optional> labels() { return Optional.ofNullable(this.labels); @@ -266,10 +302,6 @@ public Optional previousInteractionId() { return Optional.ofNullable(this.previousInteractionId); } - /** - * Enforces that the generated response is a JSON object that complies with the JSON schema specified - * in this field. - */ public Optional responseFormat() { return Optional.ofNullable(this.responseFormat); } @@ -355,8 +387,23 @@ public CreateModelInteraction withBackground(@Nullable Boolean background) { /** - * The environment configuration for the interaction. Can be an object specifying remote environment - * sources or a string referencing an existing environment ID. + * The name of the cached content used as context to serve the prediction. Note: only used in explicit + * caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed + * cost savings. + * + *

Format: cachedContents/{cachedContent} + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public CreateModelInteraction withCachedContent(@Nullable String cachedContent) { + this.cachedContent = cachedContent; + return this; + } + + + /** + * The environment configuration for the interaction. */ public CreateModelInteraction withEnvironment(@Nullable CreateModelInteractionEnvironment environment) { this.environment = environment; @@ -376,14 +423,20 @@ public CreateModelInteraction withGenerationConfig(@Nullable GenerationConfig ge /** * The input for the interaction. */ - public CreateModelInteraction withInput(@Nonnull InteractionsInput input) { - this.input = Utils.checkNotNull(input, "input"); + public CreateModelInteraction withInput(@Nullable InteractionsInput input) { + this.input = input; return this; } /** - * The labels with user-defined metadata for the request. + * The labels with user-defined metadata for the request. It is used for + * billing and reporting only. + * + *

Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. */ public CreateModelInteraction withLabels(@Nullable Map labels) { this.labels = labels; @@ -410,10 +463,6 @@ public CreateModelInteraction withPreviousInteractionId(@Nullable String previou } - /** - * Enforces that the generated response is a JSON object that complies with the JSON schema specified - * in this field. - */ public CreateModelInteraction withResponseFormat(@Nullable CreateModelInteractionResponseFormat responseFormat) { this.responseFormat = responseFormat; return this; @@ -515,6 +564,7 @@ public boolean equals(java.lang.Object o) { CreateModelInteraction other = (CreateModelInteraction) o; return Utils.enhancedDeepEquals(this.background, other.background) && + Utils.enhancedDeepEquals(this.cachedContent, other.cachedContent) && Utils.enhancedDeepEquals(this.environment, other.environment) && Utils.enhancedDeepEquals(this.generationConfig, other.generationConfig) && Utils.enhancedDeepEquals(this.input, other.input) && @@ -536,18 +586,19 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { return Utils.enhancedHash( - background, environment, generationConfig, - input, labels, model, - previousInteractionId, responseFormat, responseMimeType, - responseModalities, safetySettings, serviceTier, - store, stream, systemInstruction, - tools, webhookConfig); + background, cachedContent, environment, + generationConfig, input, labels, + model, previousInteractionId, responseFormat, + responseMimeType, responseModalities, safetySettings, + serviceTier, store, stream, + systemInstruction, tools, webhookConfig); } @Override public String toString() { return Utils.toString(CreateModelInteraction.class, "background", background, + "cachedContent", cachedContent, "environment", environment, "generationConfig", generationConfig, "input", input, @@ -571,6 +622,9 @@ public final static class Builder { private Boolean background; + @Deprecated + private String cachedContent; + private CreateModelInteractionEnvironment environment; private GenerationConfig generationConfig; @@ -618,8 +672,22 @@ public Builder background(@Nullable Boolean background) { } /** - * The environment configuration for the interaction. Can be an object specifying remote environment - * sources or a string referencing an existing environment ID. + * The name of the cached content used as context to serve the prediction. Note: only used in explicit + * caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed + * cost savings. + * + *

Format: cachedContents/{cachedContent} + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder cachedContent(@Nullable String cachedContent) { + this.cachedContent = cachedContent; + return this; + } + + /** + * The environment configuration for the interaction. */ public Builder environment(@Nullable CreateModelInteractionEnvironment environment) { this.environment = environment; @@ -637,13 +705,19 @@ public Builder generationConfig(@Nullable GenerationConfig generationConfig) { /** * The input for the interaction. */ - public Builder input(@Nonnull InteractionsInput input) { - this.input = Utils.checkNotNull(input, "input"); + public Builder input(@Nullable InteractionsInput input) { + this.input = input; return this; } /** - * The labels with user-defined metadata for the request. + * The labels with user-defined metadata for the request. It is used for + * billing and reporting only. + * + *

Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. */ public Builder labels(@Nullable Map labels) { this.labels = labels; @@ -667,10 +741,6 @@ public Builder previousInteractionId(@Nullable String previousInteractionId) { return this; } - /** - * Enforces that the generated response is a JSON object that complies with the JSON schema specified - * in this field. - */ public Builder responseFormat(@Nullable CreateModelInteractionResponseFormat responseFormat) { this.responseFormat = responseFormat; return this; @@ -758,12 +828,12 @@ public Builder webhookConfig(@Nullable WebhookConfig webhookConfig) { public CreateModelInteraction build() { return new CreateModelInteraction( - background, environment, generationConfig, - input, labels, model, - previousInteractionId, responseFormat, responseMimeType, - responseModalities, safetySettings, serviceTier, - store, stream, systemInstruction, - tools, webhookConfig); + background, cachedContent, environment, + generationConfig, input, labels, + model, previousInteractionId, responseFormat, + responseMimeType, responseModalities, safetySettings, + serviceTier, store, stream, + systemInstruction, tools, webhookConfig); } } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/CreateModelInteractionEnvironment.java b/src/main/java/com/google/genai/gaos/models/interactions/CreateModelInteractionEnvironment.java index ecc50072323..7dacddc6108 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/CreateModelInteractionEnvironment.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/CreateModelInteractionEnvironment.java @@ -36,8 +36,7 @@ /** * CreateModelInteractionEnvironment * - *

The environment configuration for the interaction. Can be an object specifying remote environment - * sources or a string referencing an existing environment ID. + *

The environment configuration for the interaction. */ @JsonDeserialize(using = CreateModelInteractionEnvironment._Deserializer.class) public class CreateModelInteractionEnvironment { @@ -54,6 +53,11 @@ public static CreateModelInteractionEnvironment of(Environment value) { return new CreateModelInteractionEnvironment(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); } + public static CreateModelInteractionEnvironment of(LocalEnvironmentConfig value) { + Utils.checkNotNull(value, "value"); + return new CreateModelInteractionEnvironment(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); + } + public static CreateModelInteractionEnvironment of(String value) { Utils.checkNotNull(value, "value"); return new CreateModelInteractionEnvironment(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); @@ -72,6 +76,19 @@ public Optional environment() { return Optional.empty(); } + /** + * Returns an {@link Optional} containing the value if it is of type {@code LocalEnvironmentConfig}, + * otherwise returns an empty {@link Optional}. + * + * @return an {@link Optional} containing the {@code LocalEnvironmentConfig} value, or empty if not of this type + */ + public Optional localEnvironmentConfig() { + if (value.value() instanceof LocalEnvironmentConfig) { + return Optional.of((LocalEnvironmentConfig) value.value()); + } + return Optional.empty(); + } + /** * Returns an {@link Optional} containing the value if it is of type {@code String}, * otherwise returns an empty {@link Optional}. @@ -120,6 +137,7 @@ public static final class _Deserializer extends OneOfDeserializer() {}, JsonShape.DEFAULT), + TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT), TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT)); } } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/CreateModelInteractionResponseFormat.java b/src/main/java/com/google/genai/gaos/models/interactions/CreateModelInteractionResponseFormat.java index 001ef025049..f87ddae1bf2 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/CreateModelInteractionResponseFormat.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/CreateModelInteractionResponseFormat.java @@ -34,12 +34,6 @@ import java.util.List; import java.util.Optional; -/** - * CreateModelInteractionResponseFormat - * - *

Enforces that the generated response is a JSON object that complies with the JSON schema specified - * in this field. - */ @JsonDeserialize(using = CreateModelInteractionResponseFormat._Deserializer.class) public class CreateModelInteractionResponseFormat { diff --git a/src/main/java/com/google/genai/gaos/models/interactions/ErrorEvent.java b/src/main/java/com/google/genai/gaos/models/interactions/ErrorEvent.java index 705f0be28cd..cbe770ed462 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/ErrorEvent.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/ErrorEvent.java @@ -52,17 +52,26 @@ public class ErrorEvent implements InteractionSSEEvent { @JsonProperty("event_type") private String eventType; + /** + * Optional metadata accompanying ANY streamed event. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private StreamMetadata metadata; + @JsonCreator public ErrorEvent( @JsonProperty("error") @Nullable Error error, - @JsonProperty("event_id") @Nullable String eventId) { + @JsonProperty("event_id") @Nullable String eventId, + @JsonProperty("metadata") @Nullable StreamMetadata metadata) { this.error = error; this.eventId = eventId; this.eventType = Builder._SINGLETON_VALUE_EventType.value(); + this.metadata = metadata; } public ErrorEvent() { - this(null, null); + this(null, null, null); } /** @@ -85,6 +94,13 @@ public String eventType() { return Utils.discriminatorToString(eventType); } + /** + * Optional metadata accompanying ANY streamed event. + */ + public Optional metadata() { + return Optional.ofNullable(this.metadata); + } + public static Builder builder() { return new Builder(); } @@ -109,6 +125,15 @@ public ErrorEvent withEventId(@Nullable String eventId) { } + /** + * Optional metadata accompanying ANY streamed event. + */ + public ErrorEvent withMetadata(@Nullable StreamMetadata metadata) { + this.metadata = metadata; + return this; + } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -121,13 +146,15 @@ public boolean equals(java.lang.Object o) { return Utils.enhancedDeepEquals(this.error, other.error) && Utils.enhancedDeepEquals(this.eventId, other.eventId) && - Utils.enhancedDeepEquals(this.eventType, other.eventType); + Utils.enhancedDeepEquals(this.eventType, other.eventType) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { return Utils.enhancedHash( - error, eventId, eventType); + error, eventId, eventType, + metadata); } @Override @@ -135,7 +162,8 @@ public String toString() { return Utils.toString(ErrorEvent.class, "error", error, "eventId", eventId, - "eventType", eventType); + "eventType", eventType, + "metadata", metadata); } @SuppressWarnings("UnusedReturnValue") @@ -145,6 +173,8 @@ public final static class Builder { private String eventId; + private StreamMetadata metadata; + private Builder() { // force use of static builder() method } @@ -166,9 +196,17 @@ public Builder eventId(@Nullable String eventId) { return this; } + /** + * Optional metadata accompanying ANY streamed event. + */ + public Builder metadata(@Nullable StreamMetadata metadata) { + this.metadata = metadata; + return this; + } + public ErrorEvent build() { return new ErrorEvent( - error, eventId); + error, eventId, metadata); } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/FileSearchCallDelta.java b/src/main/java/com/google/genai/gaos/models/interactions/FileSearchCallDelta.java index 4c357eadf4d..2aa7b259b6b 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/FileSearchCallDelta.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/FileSearchCallDelta.java @@ -33,6 +33,13 @@ public class FileSearchCallDelta implements StepDeltaData { + /** + * Required. A unique ID for this specific tool call. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private String id; + /** * A signature hash for backend validation. */ @@ -46,13 +53,22 @@ public class FileSearchCallDelta implements StepDeltaData { @JsonCreator public FileSearchCallDelta( + @JsonProperty("id") @Nullable String id, @JsonProperty("signature") @Nullable String signature) { + this.id = id; this.signature = signature; this.type = Builder._SINGLETON_VALUE_Type.value(); } public FileSearchCallDelta() { - this(null); + this(null, null); + } + + /** + * Required. A unique ID for this specific tool call. + */ + public Optional id() { + return Optional.ofNullable(this.id); } /** @@ -72,6 +88,15 @@ public static Builder builder() { } + /** + * Required. A unique ID for this specific tool call. + */ + public FileSearchCallDelta withId(@Nullable String id) { + this.id = id; + return this; + } + + /** * A signature hash for backend validation. */ @@ -91,6 +116,7 @@ public boolean equals(java.lang.Object o) { } FileSearchCallDelta other = (FileSearchCallDelta) o; return + Utils.enhancedDeepEquals(this.id, other.id) && Utils.enhancedDeepEquals(this.signature, other.signature) && Utils.enhancedDeepEquals(this.type, other.type); } @@ -98,12 +124,13 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { return Utils.enhancedHash( - signature, type); + id, signature, type); } @Override public String toString() { return Utils.toString(FileSearchCallDelta.class, + "id", id, "signature", signature, "type", type); } @@ -111,12 +138,22 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { + private String id; + private String signature; private Builder() { // force use of static builder() method } + /** + * Required. A unique ID for this specific tool call. + */ + public Builder id(@Nullable String id) { + this.id = id; + return this; + } + /** * A signature hash for backend validation. */ @@ -127,7 +164,7 @@ public Builder signature(@Nullable String signature) { public FileSearchCallDelta build() { return new FileSearchCallDelta( - signature); + id, signature); } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/FileSearchResultDelta.java b/src/main/java/com/google/genai/gaos/models/interactions/FileSearchResultDelta.java index e06a4e2cce3..acd33c7837e 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/FileSearchResultDelta.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/FileSearchResultDelta.java @@ -35,6 +35,13 @@ public class FileSearchResultDelta implements StepDeltaData { + /** + * Required. ID to match the ID from the function call block. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("call_id") + private String callId; + @JsonProperty("result") private List result; @@ -52,8 +59,10 @@ public class FileSearchResultDelta implements StepDeltaData { @JsonCreator public FileSearchResultDelta( + @JsonProperty("call_id") @Nullable String callId, @JsonProperty("result") @Nonnull List result, @JsonProperty("signature") @Nullable String signature) { + this.callId = callId; this.result = Optional.ofNullable(result) .orElseThrow(() -> new IllegalArgumentException("result cannot be null")); this.signature = signature; @@ -62,7 +71,14 @@ public FileSearchResultDelta( public FileSearchResultDelta( @Nonnull List result) { - this(result, null); + this(null, result, null); + } + + /** + * Required. ID to match the ID from the function call block. + */ + public Optional callId() { + return Optional.ofNullable(this.callId); } public Optional> result() { @@ -86,6 +102,15 @@ public static Builder builder() { } + /** + * Required. ID to match the ID from the function call block. + */ + public FileSearchResultDelta withCallId(@Nullable String callId) { + this.callId = callId; + return this; + } + + public FileSearchResultDelta withResult(@Nonnull List result) { this.result = Utils.checkNotNull(result, "result"); return this; @@ -111,6 +136,7 @@ public boolean equals(java.lang.Object o) { } FileSearchResultDelta other = (FileSearchResultDelta) o; return + Utils.enhancedDeepEquals(this.callId, other.callId) && Utils.enhancedDeepEquals(this.result, other.result) && Utils.enhancedDeepEquals(this.signature, other.signature) && Utils.enhancedDeepEquals(this.type, other.type); @@ -119,12 +145,14 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { return Utils.enhancedHash( - result, signature, type); + callId, result, signature, + type); } @Override public String toString() { return Utils.toString(FileSearchResultDelta.class, + "callId", callId, "result", result, "signature", signature, "type", type); @@ -133,6 +161,8 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { + private String callId; + private List result; private String signature; @@ -141,6 +171,14 @@ private Builder() { // force use of static builder() method } + /** + * Required. ID to match the ID from the function call block. + */ + public Builder callId(@Nullable String callId) { + this.callId = callId; + return this; + } + public Builder result(@Nonnull List result) { this.result = Utils.checkNotNull(result, "result"); return this; @@ -156,7 +194,7 @@ public Builder signature(@Nullable String signature) { public FileSearchResultDelta build() { return new FileSearchResultDelta( - result, signature); + callId, result, signature); } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/FunctionCallStep.java b/src/main/java/com/google/genai/gaos/models/interactions/FunctionCallStep.java index 37e9f327546..d88ede958be 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/FunctionCallStep.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/FunctionCallStep.java @@ -20,11 +20,14 @@ package com.google.genai.gaos.models.interactions; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.type.TypeReference; import com.google.genai.gaos.utils.LazySingletonValue; import com.google.genai.gaos.utils.Utils; import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; @@ -55,6 +58,13 @@ public class FunctionCallStep implements Step { @JsonProperty("name") private String name; + /** + * A signature hash for backend validation. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("signature") + private String signature; + @JsonProperty("type") private String type; @@ -63,7 +73,8 @@ public class FunctionCallStep implements Step { public FunctionCallStep( @JsonProperty("arguments") @Nonnull Map arguments, @JsonProperty("id") @Nonnull String id, - @JsonProperty("name") @Nonnull String name) { + @JsonProperty("name") @Nonnull String name, + @JsonProperty("signature") @Nullable String signature) { arguments = Utils.emptyMapIfNull(arguments); this.arguments = Optional.ofNullable(arguments) .orElseThrow(() -> new IllegalArgumentException("arguments cannot be null")); @@ -71,8 +82,17 @@ public FunctionCallStep( .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.name = Optional.ofNullable(name) .orElseThrow(() -> new IllegalArgumentException("name cannot be null")); + this.signature = signature; this.type = Builder._SINGLETON_VALUE_Type.value(); } + + public FunctionCallStep( + @Nonnull Map arguments, + @Nonnull String id, + @Nonnull String name) { + this(arguments, id, name, + null); + } /** * Required. The arguments to pass to the function. @@ -95,6 +115,13 @@ public Optional name() { return Optional.ofNullable(this.name); } + /** + * A signature hash for backend validation. + */ + public Optional signature() { + return Optional.ofNullable(this.signature); + } + @Override public String type() { return Utils.discriminatorToString(type); @@ -132,6 +159,15 @@ public FunctionCallStep withName(@Nonnull String name) { } + /** + * A signature hash for backend validation. + */ + public FunctionCallStep withSignature(@Nullable String signature) { + this.signature = signature; + return this; + } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -145,6 +181,7 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.arguments, other.arguments) && Utils.enhancedDeepEquals(this.id, other.id) && Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.signature, other.signature) && Utils.enhancedDeepEquals(this.type, other.type); } @@ -152,7 +189,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Utils.enhancedHash( arguments, id, name, - type); + signature, type); } @Override @@ -161,6 +198,7 @@ public String toString() { "arguments", arguments, "id", id, "name", name, + "signature", signature, "type", type); } @@ -173,6 +211,8 @@ public final static class Builder { private String name; + private String signature; + private Builder() { // force use of static builder() method } @@ -201,9 +241,18 @@ public Builder name(@Nonnull String name) { return this; } + /** + * A signature hash for backend validation. + */ + public Builder signature(@Nullable String signature) { + this.signature = signature; + return this; + } + public FunctionCallStep build() { return new FunctionCallStep( - arguments, id, name); + arguments, id, name, + signature); } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/FunctionResultDelta.java b/src/main/java/com/google/genai/gaos/models/interactions/FunctionResultDelta.java index d81f5428903..f251167aefe 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/FunctionResultDelta.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/FunctionResultDelta.java @@ -55,6 +55,13 @@ public class FunctionResultDelta implements StepDeltaData { @JsonProperty("result") private FunctionResultDeltaResultUnion result; + /** + * A signature hash for backend validation. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("signature") + private String signature; + @JsonProperty("type") private String type; @@ -64,13 +71,15 @@ public FunctionResultDelta( @JsonProperty("call_id") @Nonnull String callId, @JsonProperty("is_error") @Nullable Boolean isError, @JsonProperty("name") @Nullable String name, - @JsonProperty("result") @Nonnull FunctionResultDeltaResultUnion result) { + @JsonProperty("result") @Nonnull FunctionResultDeltaResultUnion result, + @JsonProperty("signature") @Nullable String signature) { this.callId = Optional.ofNullable(callId) .orElseThrow(() -> new IllegalArgumentException("callId cannot be null")); this.isError = isError; this.name = name; this.result = Optional.ofNullable(result) .orElseThrow(() -> new IllegalArgumentException("result cannot be null")); + this.signature = signature; this.type = Builder._SINGLETON_VALUE_Type.value(); } @@ -78,7 +87,7 @@ public FunctionResultDelta( @Nonnull String callId, @Nonnull FunctionResultDeltaResultUnion result) { this(callId, null, null, - result); + result, null); } /** @@ -100,6 +109,13 @@ public Optional result() { return Optional.ofNullable(this.result); } + /** + * A signature hash for backend validation. + */ + public Optional signature() { + return Optional.ofNullable(this.signature); + } + @Override public String type() { return Utils.discriminatorToString(type); @@ -137,6 +153,15 @@ public FunctionResultDelta withResult(@Nonnull FunctionResultDeltaResultUnion re } + /** + * A signature hash for backend validation. + */ + public FunctionResultDelta withSignature(@Nullable String signature) { + this.signature = signature; + return this; + } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -151,6 +176,7 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.isError, other.isError) && Utils.enhancedDeepEquals(this.name, other.name) && Utils.enhancedDeepEquals(this.result, other.result) && + Utils.enhancedDeepEquals(this.signature, other.signature) && Utils.enhancedDeepEquals(this.type, other.type); } @@ -158,7 +184,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Utils.enhancedHash( callId, isError, name, - result, type); + result, signature, type); } @Override @@ -168,6 +194,7 @@ public String toString() { "isError", isError, "name", name, "result", result, + "signature", signature, "type", type); } @@ -182,6 +209,8 @@ public final static class Builder { private FunctionResultDeltaResultUnion result; + private String signature; + private Builder() { // force use of static builder() method } @@ -209,10 +238,18 @@ public Builder result(@Nonnull FunctionResultDeltaResultUnion result) { return this; } + /** + * A signature hash for backend validation. + */ + public Builder signature(@Nullable String signature) { + this.signature = signature; + return this; + } + public FunctionResultDelta build() { return new FunctionResultDelta( callId, isError, name, - result); + result, signature); } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/FunctionResultStep.java b/src/main/java/com/google/genai/gaos/models/interactions/FunctionResultStep.java index 1f8713dd83d..960e4454956 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/FunctionResultStep.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/FunctionResultStep.java @@ -65,6 +65,13 @@ public class FunctionResultStep implements Step { @JsonProperty("result") private FunctionResultStepResultUnion result; + /** + * A signature hash for backend validation. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("signature") + private String signature; + @JsonProperty("type") private String type; @@ -74,13 +81,15 @@ public FunctionResultStep( @JsonProperty("call_id") @Nonnull String callId, @JsonProperty("is_error") @Nullable Boolean isError, @JsonProperty("name") @Nullable String name, - @JsonProperty("result") @Nonnull FunctionResultStepResultUnion result) { + @JsonProperty("result") @Nonnull FunctionResultStepResultUnion result, + @JsonProperty("signature") @Nullable String signature) { this.callId = Optional.ofNullable(callId) .orElseThrow(() -> new IllegalArgumentException("callId cannot be null")); this.isError = isError; this.name = name; this.result = Optional.ofNullable(result) .orElseThrow(() -> new IllegalArgumentException("result cannot be null")); + this.signature = signature; this.type = Builder._SINGLETON_VALUE_Type.value(); } @@ -88,7 +97,7 @@ public FunctionResultStep( @Nonnull String callId, @Nonnull FunctionResultStepResultUnion result) { this(callId, null, null, - result); + result, null); } /** @@ -119,6 +128,13 @@ public Optional result() { return Optional.ofNullable(this.result); } + /** + * A signature hash for backend validation. + */ + public Optional signature() { + return Optional.ofNullable(this.signature); + } + @Override public String type() { return Utils.discriminatorToString(type); @@ -165,6 +181,15 @@ public FunctionResultStep withResult(@Nonnull FunctionResultStepResultUnion resu } + /** + * A signature hash for backend validation. + */ + public FunctionResultStep withSignature(@Nullable String signature) { + this.signature = signature; + return this; + } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -179,6 +204,7 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.isError, other.isError) && Utils.enhancedDeepEquals(this.name, other.name) && Utils.enhancedDeepEquals(this.result, other.result) && + Utils.enhancedDeepEquals(this.signature, other.signature) && Utils.enhancedDeepEquals(this.type, other.type); } @@ -186,7 +212,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Utils.enhancedHash( callId, isError, name, - result, type); + result, signature, type); } @Override @@ -196,6 +222,7 @@ public String toString() { "isError", isError, "name", name, "result", result, + "signature", signature, "type", type); } @@ -210,6 +237,8 @@ public final static class Builder { private FunctionResultStepResultUnion result; + private String signature; + private Builder() { // force use of static builder() method } @@ -246,10 +275,18 @@ public Builder result(@Nonnull FunctionResultStepResultUnion result) { return this; } + /** + * A signature hash for backend validation. + */ + public Builder signature(@Nullable String signature) { + this.signature = signature; + return this; + } + public FunctionResultStep build() { return new FunctionResultStep( callId, isError, name, - result); + result, signature); } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/GenerationConfig.java b/src/main/java/com/google/genai/gaos/models/interactions/GenerationConfig.java index f5d6bd1ec4e..c3f61caf2c0 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/GenerationConfig.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/GenerationConfig.java @@ -26,6 +26,8 @@ import com.google.genai.gaos.utils.Utils; import jakarta.annotation.Nullable; import java.lang.Deprecated; +import java.lang.Double; +import java.lang.Float; import java.lang.Integer; import java.lang.Override; import java.lang.String; @@ -39,13 +41,20 @@ */ public class GenerationConfig { /** - * The configuration for image interaction. + * Penalizes tokens based on their frequency so far. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @JsonInclude(Include.NON_ABSENT) - @JsonProperty("image_config") + @JsonProperty("frequency_penalty") @Deprecated + private Double frequencyPenalty; + + /** + * The configuration for image interaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("image_config") private ImageConfig imageConfig; /** @@ -55,6 +64,16 @@ public class GenerationConfig { @JsonProperty("max_output_tokens") private Integer maxOutputTokens; + /** + * Penalizes tokens that have already appeared. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("presence_penalty") + @Deprecated + private Double presencePenalty; + /** * Seed used in decoding for reproducibility. */ @@ -76,6 +95,13 @@ public class GenerationConfig { @JsonProperty("stop_sequences") private List stopSequences; + /** + * Controls the randomness of the output. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("temperature") + private Float temperature; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("thinking_level") @@ -93,6 +119,13 @@ public class GenerationConfig { @JsonProperty("tool_choice") private ToolChoice toolChoice; + /** + * The maximum cumulative probability of tokens to consider when sampling. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("top_p") + private Float topP; + /** * Configuration for speech recognition (transcription). */ @@ -109,24 +142,32 @@ public class GenerationConfig { @JsonCreator public GenerationConfig( + @JsonProperty("frequency_penalty") @Nullable Double frequencyPenalty, @JsonProperty("image_config") @Nullable ImageConfig imageConfig, @JsonProperty("max_output_tokens") @Nullable Integer maxOutputTokens, + @JsonProperty("presence_penalty") @Nullable Double presencePenalty, @JsonProperty("seed") @Nullable Integer seed, @JsonProperty("speech_config") @Nullable SpeechConfigUnion speechConfig, @JsonProperty("stop_sequences") @Nullable List stopSequences, + @JsonProperty("temperature") @Nullable Float temperature, @JsonProperty("thinking_level") @Nullable ThinkingLevel thinkingLevel, @JsonProperty("thinking_summaries") @Nullable ThinkingSummaries thinkingSummaries, @JsonProperty("tool_choice") @Nullable ToolChoice toolChoice, + @JsonProperty("top_p") @Nullable Float topP, @JsonProperty("transcription_config") @Nullable TranscriptionConfig transcriptionConfig, @JsonProperty("video_config") @Nullable VideoConfig videoConfig) { + this.frequencyPenalty = frequencyPenalty; this.imageConfig = imageConfig; this.maxOutputTokens = maxOutputTokens; + this.presencePenalty = presencePenalty; this.seed = seed; this.speechConfig = speechConfig; this.stopSequences = stopSequences; + this.temperature = temperature; this.thinkingLevel = thinkingLevel; this.thinkingSummaries = thinkingSummaries; this.toolChoice = toolChoice; + this.topP = topP; this.transcriptionConfig = transcriptionConfig; this.videoConfig = videoConfig; } @@ -135,15 +176,23 @@ public GenerationConfig() { this(null, null, null, null, null, null, null, null, null, - null); + null, null, null, + null, null); } /** - * The configuration for image interaction. + * Penalizes tokens based on their frequency so far. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated + public Optional frequencyPenalty() { + return Optional.ofNullable(this.frequencyPenalty); + } + + /** + * The configuration for image interaction. + */ public Optional imageConfig() { return Optional.ofNullable(this.imageConfig); } @@ -155,6 +204,16 @@ public Optional maxOutputTokens() { return Optional.ofNullable(this.maxOutputTokens); } + /** + * Penalizes tokens that have already appeared. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Optional presencePenalty() { + return Optional.ofNullable(this.presencePenalty); + } + /** * Seed used in decoding for reproducibility. */ @@ -176,6 +235,13 @@ public Optional> stopSequences() { return Optional.ofNullable(this.stopSequences); } + /** + * Controls the randomness of the output. + */ + public Optional temperature() { + return Optional.ofNullable(this.temperature); + } + public Optional thinkingLevel() { return Optional.ofNullable(this.thinkingLevel); } @@ -191,6 +257,13 @@ public Optional toolChoice() { return Optional.ofNullable(this.toolChoice); } + /** + * The maximum cumulative probability of tokens to consider when sampling. + */ + public Optional topP() { + return Optional.ofNullable(this.topP); + } + /** * Configuration for speech recognition (transcription). */ @@ -211,11 +284,20 @@ public static Builder builder() { /** - * The configuration for image interaction. + * Penalizes tokens based on their frequency so far. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated + public GenerationConfig withFrequencyPenalty(@Nullable Double frequencyPenalty) { + this.frequencyPenalty = frequencyPenalty; + return this; + } + + + /** + * The configuration for image interaction. + */ public GenerationConfig withImageConfig(@Nullable ImageConfig imageConfig) { this.imageConfig = imageConfig; return this; @@ -231,6 +313,18 @@ public GenerationConfig withMaxOutputTokens(@Nullable Integer maxOutputTokens) { } + /** + * Penalizes tokens that have already appeared. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public GenerationConfig withPresencePenalty(@Nullable Double presencePenalty) { + this.presencePenalty = presencePenalty; + return this; + } + + /** * Seed used in decoding for reproducibility. */ @@ -258,6 +352,15 @@ public GenerationConfig withStopSequences(@Nullable List stopSequences) } + /** + * Controls the randomness of the output. + */ + public GenerationConfig withTemperature(@Nullable Float temperature) { + this.temperature = temperature; + return this; + } + + public GenerationConfig withThinkingLevel(@Nullable ThinkingLevel thinkingLevel) { this.thinkingLevel = thinkingLevel; return this; @@ -279,6 +382,15 @@ public GenerationConfig withToolChoice(@Nullable ToolChoice toolChoice) { } + /** + * The maximum cumulative probability of tokens to consider when sampling. + */ + public GenerationConfig withTopP(@Nullable Float topP) { + this.topP = topP; + return this; + } + + /** * Configuration for speech recognition (transcription). */ @@ -307,14 +419,18 @@ public boolean equals(java.lang.Object o) { } GenerationConfig other = (GenerationConfig) o; return + Utils.enhancedDeepEquals(this.frequencyPenalty, other.frequencyPenalty) && Utils.enhancedDeepEquals(this.imageConfig, other.imageConfig) && Utils.enhancedDeepEquals(this.maxOutputTokens, other.maxOutputTokens) && + Utils.enhancedDeepEquals(this.presencePenalty, other.presencePenalty) && Utils.enhancedDeepEquals(this.seed, other.seed) && Utils.enhancedDeepEquals(this.speechConfig, other.speechConfig) && Utils.enhancedDeepEquals(this.stopSequences, other.stopSequences) && + Utils.enhancedDeepEquals(this.temperature, other.temperature) && Utils.enhancedDeepEquals(this.thinkingLevel, other.thinkingLevel) && Utils.enhancedDeepEquals(this.thinkingSummaries, other.thinkingSummaries) && Utils.enhancedDeepEquals(this.toolChoice, other.toolChoice) && + Utils.enhancedDeepEquals(this.topP, other.topP) && Utils.enhancedDeepEquals(this.transcriptionConfig, other.transcriptionConfig) && Utils.enhancedDeepEquals(this.videoConfig, other.videoConfig); } @@ -322,23 +438,28 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { return Utils.enhancedHash( - imageConfig, maxOutputTokens, seed, - speechConfig, stopSequences, thinkingLevel, - thinkingSummaries, toolChoice, transcriptionConfig, - videoConfig); + frequencyPenalty, imageConfig, maxOutputTokens, + presencePenalty, seed, speechConfig, + stopSequences, temperature, thinkingLevel, + thinkingSummaries, toolChoice, topP, + transcriptionConfig, videoConfig); } @Override public String toString() { return Utils.toString(GenerationConfig.class, + "frequencyPenalty", frequencyPenalty, "imageConfig", imageConfig, "maxOutputTokens", maxOutputTokens, + "presencePenalty", presencePenalty, "seed", seed, "speechConfig", speechConfig, "stopSequences", stopSequences, + "temperature", temperature, "thinkingLevel", thinkingLevel, "thinkingSummaries", thinkingSummaries, "toolChoice", toolChoice, + "topP", topP, "transcriptionConfig", transcriptionConfig, "videoConfig", videoConfig); } @@ -347,22 +468,31 @@ public String toString() { public final static class Builder { @Deprecated + private Double frequencyPenalty; + private ImageConfig imageConfig; private Integer maxOutputTokens; + @Deprecated + private Double presencePenalty; + private Integer seed; private SpeechConfigUnion speechConfig; private List stopSequences; + private Float temperature; + private ThinkingLevel thinkingLevel; private ThinkingSummaries thinkingSummaries; private ToolChoice toolChoice; + private Float topP; + private TranscriptionConfig transcriptionConfig; private VideoConfig videoConfig; @@ -372,11 +502,19 @@ private Builder() { } /** - * The configuration for image interaction. + * Penalizes tokens based on their frequency so far. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated + public Builder frequencyPenalty(@Nullable Double frequencyPenalty) { + this.frequencyPenalty = frequencyPenalty; + return this; + } + + /** + * The configuration for image interaction. + */ public Builder imageConfig(@Nullable ImageConfig imageConfig) { this.imageConfig = imageConfig; return this; @@ -390,6 +528,17 @@ public Builder maxOutputTokens(@Nullable Integer maxOutputTokens) { return this; } + /** + * Penalizes tokens that have already appeared. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder presencePenalty(@Nullable Double presencePenalty) { + this.presencePenalty = presencePenalty; + return this; + } + /** * Seed used in decoding for reproducibility. */ @@ -414,6 +563,14 @@ public Builder stopSequences(@Nullable List stopSequences) { return this; } + /** + * Controls the randomness of the output. + */ + public Builder temperature(@Nullable Float temperature) { + this.temperature = temperature; + return this; + } + public Builder thinkingLevel(@Nullable ThinkingLevel thinkingLevel) { this.thinkingLevel = thinkingLevel; return this; @@ -432,6 +589,14 @@ public Builder toolChoice(@Nullable ToolChoice toolChoice) { return this; } + /** + * The maximum cumulative probability of tokens to consider when sampling. + */ + public Builder topP(@Nullable Float topP) { + this.topP = topP; + return this; + } + /** * Configuration for speech recognition (transcription). */ @@ -450,10 +615,11 @@ public Builder videoConfig(@Nullable VideoConfig videoConfig) { public GenerationConfig build() { return new GenerationConfig( - imageConfig, maxOutputTokens, seed, - speechConfig, stopSequences, thinkingLevel, - thinkingSummaries, toolChoice, transcriptionConfig, - videoConfig); + frequencyPenalty, imageConfig, maxOutputTokens, + presencePenalty, seed, speechConfig, + stopSequences, temperature, thinkingLevel, + thinkingSummaries, toolChoice, topP, + transcriptionConfig, videoConfig); } } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/GoogleMapsCallDelta.java b/src/main/java/com/google/genai/gaos/models/interactions/GoogleMapsCallDelta.java index 867a44c9da0..9843b05f981 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/GoogleMapsCallDelta.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/GoogleMapsCallDelta.java @@ -40,6 +40,13 @@ public class GoogleMapsCallDelta implements StepDeltaData { @JsonProperty("arguments") private GoogleMapsCallArguments arguments; + /** + * Required. A unique ID for this specific tool call. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private String id; + /** * A signature hash for backend validation. */ @@ -54,14 +61,16 @@ public class GoogleMapsCallDelta implements StepDeltaData { @JsonCreator public GoogleMapsCallDelta( @JsonProperty("arguments") @Nullable GoogleMapsCallArguments arguments, + @JsonProperty("id") @Nullable String id, @JsonProperty("signature") @Nullable String signature) { this.arguments = arguments; + this.id = id; this.signature = signature; this.type = Builder._SINGLETON_VALUE_Type.value(); } public GoogleMapsCallDelta() { - this(null, null); + this(null, null, null); } /** @@ -71,6 +80,13 @@ public Optional arguments() { return Optional.ofNullable(this.arguments); } + /** + * Required. A unique ID for this specific tool call. + */ + public Optional id() { + return Optional.ofNullable(this.id); + } + /** * A signature hash for backend validation. */ @@ -97,6 +113,15 @@ public GoogleMapsCallDelta withArguments(@Nullable GoogleMapsCallArguments argum } + /** + * Required. A unique ID for this specific tool call. + */ + public GoogleMapsCallDelta withId(@Nullable String id) { + this.id = id; + return this; + } + + /** * A signature hash for backend validation. */ @@ -117,6 +142,7 @@ public boolean equals(java.lang.Object o) { GoogleMapsCallDelta other = (GoogleMapsCallDelta) o; return Utils.enhancedDeepEquals(this.arguments, other.arguments) && + Utils.enhancedDeepEquals(this.id, other.id) && Utils.enhancedDeepEquals(this.signature, other.signature) && Utils.enhancedDeepEquals(this.type, other.type); } @@ -124,13 +150,15 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { return Utils.enhancedHash( - arguments, signature, type); + arguments, id, signature, + type); } @Override public String toString() { return Utils.toString(GoogleMapsCallDelta.class, "arguments", arguments, + "id", id, "signature", signature, "type", type); } @@ -140,6 +168,8 @@ public final static class Builder { private GoogleMapsCallArguments arguments; + private String id; + private String signature; private Builder() { @@ -154,6 +184,14 @@ public Builder arguments(@Nullable GoogleMapsCallArguments arguments) { return this; } + /** + * Required. A unique ID for this specific tool call. + */ + public Builder id(@Nullable String id) { + this.id = id; + return this; + } + /** * A signature hash for backend validation. */ @@ -164,7 +202,7 @@ public Builder signature(@Nullable String signature) { public GoogleMapsCallDelta build() { return new GoogleMapsCallDelta( - arguments, signature); + arguments, id, signature); } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/GoogleMapsResultDelta.java b/src/main/java/com/google/genai/gaos/models/interactions/GoogleMapsResultDelta.java index ca9f5237b6e..caf77823769 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/GoogleMapsResultDelta.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/GoogleMapsResultDelta.java @@ -34,6 +34,13 @@ public class GoogleMapsResultDelta implements StepDeltaData { + /** + * Required. ID to match the ID from the function call block. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("call_id") + private String callId; + /** * The results of the Google Maps. */ @@ -54,15 +61,24 @@ public class GoogleMapsResultDelta implements StepDeltaData { @JsonCreator public GoogleMapsResultDelta( + @JsonProperty("call_id") @Nullable String callId, @JsonProperty("result") @Nullable List result, @JsonProperty("signature") @Nullable String signature) { + this.callId = callId; this.result = result; this.signature = signature; this.type = Builder._SINGLETON_VALUE_Type.value(); } public GoogleMapsResultDelta() { - this(null, null); + this(null, null, null); + } + + /** + * Required. ID to match the ID from the function call block. + */ + public Optional callId() { + return Optional.ofNullable(this.callId); } /** @@ -89,6 +105,15 @@ public static Builder builder() { } + /** + * Required. ID to match the ID from the function call block. + */ + public GoogleMapsResultDelta withCallId(@Nullable String callId) { + this.callId = callId; + return this; + } + + /** * The results of the Google Maps. */ @@ -117,6 +142,7 @@ public boolean equals(java.lang.Object o) { } GoogleMapsResultDelta other = (GoogleMapsResultDelta) o; return + Utils.enhancedDeepEquals(this.callId, other.callId) && Utils.enhancedDeepEquals(this.result, other.result) && Utils.enhancedDeepEquals(this.signature, other.signature) && Utils.enhancedDeepEquals(this.type, other.type); @@ -125,12 +151,14 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { return Utils.enhancedHash( - result, signature, type); + callId, result, signature, + type); } @Override public String toString() { return Utils.toString(GoogleMapsResultDelta.class, + "callId", callId, "result", result, "signature", signature, "type", type); @@ -139,6 +167,8 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { + private String callId; + private List result; private String signature; @@ -147,6 +177,14 @@ private Builder() { // force use of static builder() method } + /** + * Required. ID to match the ID from the function call block. + */ + public Builder callId(@Nullable String callId) { + this.callId = callId; + return this; + } + /** * The results of the Google Maps. */ @@ -165,7 +203,7 @@ public Builder signature(@Nullable String signature) { public GoogleMapsResultDelta build() { return new GoogleMapsResultDelta( - result, signature); + callId, result, signature); } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/GoogleSearchCallDelta.java b/src/main/java/com/google/genai/gaos/models/interactions/GoogleSearchCallDelta.java index 20ce913c8d2..27d2d0be884 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/GoogleSearchCallDelta.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/GoogleSearchCallDelta.java @@ -40,6 +40,13 @@ public class GoogleSearchCallDelta implements StepDeltaData { @JsonProperty("arguments") private GoogleSearchCallArguments arguments; + /** + * Required. A unique ID for this specific tool call. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private String id; + /** * A signature hash for backend validation. */ @@ -54,16 +61,18 @@ public class GoogleSearchCallDelta implements StepDeltaData { @JsonCreator public GoogleSearchCallDelta( @JsonProperty("arguments") @Nonnull GoogleSearchCallArguments arguments, + @JsonProperty("id") @Nullable String id, @JsonProperty("signature") @Nullable String signature) { this.arguments = Optional.ofNullable(arguments) .orElseThrow(() -> new IllegalArgumentException("arguments cannot be null")); + this.id = id; this.signature = signature; this.type = Builder._SINGLETON_VALUE_Type.value(); } public GoogleSearchCallDelta( @Nonnull GoogleSearchCallArguments arguments) { - this(arguments, null); + this(arguments, null, null); } /** @@ -73,6 +82,13 @@ public Optional arguments() { return Optional.ofNullable(this.arguments); } + /** + * Required. A unique ID for this specific tool call. + */ + public Optional id() { + return Optional.ofNullable(this.id); + } + /** * A signature hash for backend validation. */ @@ -99,6 +115,15 @@ public GoogleSearchCallDelta withArguments(@Nonnull GoogleSearchCallArguments ar } + /** + * Required. A unique ID for this specific tool call. + */ + public GoogleSearchCallDelta withId(@Nullable String id) { + this.id = id; + return this; + } + + /** * A signature hash for backend validation. */ @@ -119,6 +144,7 @@ public boolean equals(java.lang.Object o) { GoogleSearchCallDelta other = (GoogleSearchCallDelta) o; return Utils.enhancedDeepEquals(this.arguments, other.arguments) && + Utils.enhancedDeepEquals(this.id, other.id) && Utils.enhancedDeepEquals(this.signature, other.signature) && Utils.enhancedDeepEquals(this.type, other.type); } @@ -126,13 +152,15 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { return Utils.enhancedHash( - arguments, signature, type); + arguments, id, signature, + type); } @Override public String toString() { return Utils.toString(GoogleSearchCallDelta.class, "arguments", arguments, + "id", id, "signature", signature, "type", type); } @@ -142,6 +170,8 @@ public final static class Builder { private GoogleSearchCallArguments arguments; + private String id; + private String signature; private Builder() { @@ -156,6 +186,14 @@ public Builder arguments(@Nonnull GoogleSearchCallArguments arguments) { return this; } + /** + * Required. A unique ID for this specific tool call. + */ + public Builder id(@Nullable String id) { + this.id = id; + return this; + } + /** * A signature hash for backend validation. */ @@ -166,7 +204,7 @@ public Builder signature(@Nullable String signature) { public GoogleSearchCallDelta build() { return new GoogleSearchCallDelta( - arguments, signature); + arguments, id, signature); } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/GoogleSearchResultDelta.java b/src/main/java/com/google/genai/gaos/models/interactions/GoogleSearchResultDelta.java index 071e6e4e215..beaca47c070 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/GoogleSearchResultDelta.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/GoogleSearchResultDelta.java @@ -36,6 +36,13 @@ public class GoogleSearchResultDelta implements StepDeltaData { + /** + * Required. ID to match the ID from the function call block. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("call_id") + private String callId; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("is_error") @@ -58,9 +65,11 @@ public class GoogleSearchResultDelta implements StepDeltaData { @JsonCreator public GoogleSearchResultDelta( + @JsonProperty("call_id") @Nullable String callId, @JsonProperty("is_error") @Nullable Boolean isError, @JsonProperty("result") @Nonnull List result, @JsonProperty("signature") @Nullable String signature) { + this.callId = callId; this.isError = isError; this.result = Optional.ofNullable(result) .orElseThrow(() -> new IllegalArgumentException("result cannot be null")); @@ -70,7 +79,15 @@ public GoogleSearchResultDelta( public GoogleSearchResultDelta( @Nonnull List result) { - this(null, result, null); + this(null, null, result, + null); + } + + /** + * Required. ID to match the ID from the function call block. + */ + public Optional callId() { + return Optional.ofNullable(this.callId); } public Optional isError() { @@ -98,6 +115,15 @@ public static Builder builder() { } + /** + * Required. ID to match the ID from the function call block. + */ + public GoogleSearchResultDelta withCallId(@Nullable String callId) { + this.callId = callId; + return this; + } + + public GoogleSearchResultDelta withIsError(@Nullable Boolean isError) { this.isError = isError; return this; @@ -129,6 +155,7 @@ public boolean equals(java.lang.Object o) { } GoogleSearchResultDelta other = (GoogleSearchResultDelta) o; return + Utils.enhancedDeepEquals(this.callId, other.callId) && Utils.enhancedDeepEquals(this.isError, other.isError) && Utils.enhancedDeepEquals(this.result, other.result) && Utils.enhancedDeepEquals(this.signature, other.signature) && @@ -138,13 +165,14 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { return Utils.enhancedHash( - isError, result, signature, - type); + callId, isError, result, + signature, type); } @Override public String toString() { return Utils.toString(GoogleSearchResultDelta.class, + "callId", callId, "isError", isError, "result", result, "signature", signature, @@ -154,6 +182,8 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { + private String callId; + private Boolean isError; private List result; @@ -164,6 +194,14 @@ private Builder() { // force use of static builder() method } + /** + * Required. ID to match the ID from the function call block. + */ + public Builder callId(@Nullable String callId) { + this.callId = callId; + return this; + } + public Builder isError(@Nullable Boolean isError) { this.isError = isError; return this; @@ -184,7 +222,8 @@ public Builder signature(@Nullable String signature) { public GoogleSearchResultDelta build() { return new GoogleSearchResultDelta( - isError, result, signature); + callId, isError, result, + signature); } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/ImageConfig.java b/src/main/java/com/google/genai/gaos/models/interactions/ImageConfig.java index a2d42f513f5..9e3f38690d0 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/ImageConfig.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/ImageConfig.java @@ -25,7 +25,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.genai.gaos.utils.Utils; import jakarta.annotation.Nullable; -import java.lang.Deprecated; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -34,17 +33,23 @@ * ImageConfig * *

The configuration for image interaction. - * - * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. */ -@Deprecated public class ImageConfig { - + /** + * The aspect ratio of the image to generate. Supported aspect ratios: 1:1, + * 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, 21:9. + * + *

If not specified, the model will choose a default aspect ratio based on any + * reference images provided. + */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("aspect_ratio") private ImageConfigAspectRatio aspectRatio; - + /** + * Specifies the size of generated images. Supported values are `1K`, `2K`, + * `4K`. If not specified, the model will use default value `1K`. + */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("image_size") private ImageConfigImageSize imageSize; @@ -61,10 +66,21 @@ public ImageConfig() { this(null, null); } + /** + * The aspect ratio of the image to generate. Supported aspect ratios: 1:1, + * 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, 21:9. + * + *

If not specified, the model will choose a default aspect ratio based on any + * reference images provided. + */ public Optional aspectRatio() { return Optional.ofNullable(this.aspectRatio); } + /** + * Specifies the size of generated images. Supported values are `1K`, `2K`, + * `4K`. If not specified, the model will use default value `1K`. + */ public Optional imageSize() { return Optional.ofNullable(this.imageSize); } @@ -74,12 +90,23 @@ public static Builder builder() { } + /** + * The aspect ratio of the image to generate. Supported aspect ratios: 1:1, + * 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, 21:9. + * + *

If not specified, the model will choose a default aspect ratio based on any + * reference images provided. + */ public ImageConfig withAspectRatio(@Nullable ImageConfigAspectRatio aspectRatio) { this.aspectRatio = aspectRatio; return this; } + /** + * Specifies the size of generated images. Supported values are `1K`, `2K`, + * `4K`. If not specified, the model will use default value `1K`. + */ public ImageConfig withImageSize(@Nullable ImageConfigImageSize imageSize) { this.imageSize = imageSize; return this; @@ -124,11 +151,22 @@ private Builder() { // force use of static builder() method } + /** + * The aspect ratio of the image to generate. Supported aspect ratios: 1:1, + * 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, 21:9. + * + *

If not specified, the model will choose a default aspect ratio based on any + * reference images provided. + */ public Builder aspectRatio(@Nullable ImageConfigAspectRatio aspectRatio) { this.aspectRatio = aspectRatio; return this; } + /** + * Specifies the size of generated images. Supported values are `1K`, `2K`, + * `4K`. If not specified, the model will use default value `1K`. + */ public Builder imageSize(@Nullable ImageConfigImageSize imageSize) { this.imageSize = imageSize; return this; diff --git a/src/main/java/com/google/genai/gaos/models/interactions/ImageConfigAspectRatio.java b/src/main/java/com/google/genai/gaos/models/interactions/ImageConfigAspectRatio.java index 68577399b1c..29e608dcf05 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/ImageConfigAspectRatio.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/ImageConfigAspectRatio.java @@ -34,6 +34,15 @@ * without runtime errors. Instances are immutable singletons with reference equality. * Use {@code asEnum()} for switch expressions. */ +/** + * ImageConfigAspectRatio + * + *

The aspect ratio of the image to generate. Supported aspect ratios: 1:1, + * 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, 21:9. + * + *

If not specified, the model will choose a default aspect ratio based on any + * reference images provided. + */ public class ImageConfigAspectRatio { public static final ImageConfigAspectRatio ELEVEN = new ImageConfigAspectRatio("1:1"); diff --git a/src/main/java/com/google/genai/gaos/models/interactions/ImageConfigImageSize.java b/src/main/java/com/google/genai/gaos/models/interactions/ImageConfigImageSize.java index db530eae961..f59b32d55ff 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/ImageConfigImageSize.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/ImageConfigImageSize.java @@ -34,6 +34,12 @@ * without runtime errors. Instances are immutable singletons with reference equality. * Use {@code asEnum()} for switch expressions. */ +/** + * ImageConfigImageSize + * + *

Specifies the size of generated images. Supported values are `1K`, `2K`, + * `4K`. If not specified, the model will use default value `1K`. + */ public class ImageConfigImageSize { public static final ImageConfigImageSize ONE_K = new ImageConfigImageSize("1K"); diff --git a/src/main/java/com/google/genai/gaos/models/interactions/Interaction.java b/src/main/java/com/google/genai/gaos/models/interactions/Interaction.java index c9170e222df..8aa0d7555e7 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/Interaction.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/Interaction.java @@ -49,14 +49,28 @@ public class Interaction { private AgentOption agent; /** - * Configuration parameters for the agent interaction. + * Parameters for the agent interaction. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("agent_config") private InteractionAgentConfig agentConfig; /** - * Output only. The time at which the response was created in ISO 8601 format + * The name of the cached content used as context to serve the prediction. Note: only used in explicit + * caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed + * cost savings. + * + *

Format: cachedContents/{cachedContent} + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("cached_content") + @Deprecated + private String cachedContent; + + /** + * Required. Output only. The time at which the response was created in ISO 8601 format * (YYYY-MM-DDThh:mm:ssZ). */ @JsonInclude(Include.NON_ABSENT) @@ -64,8 +78,7 @@ public class Interaction { private String created; /** - * The environment configuration for the interaction. Can be an object specifying remote environment - * sources or a string referencing an existing environment ID. + * The environment configuration for the interaction. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("environment") @@ -108,7 +121,13 @@ public class Interaction { private InteractionsInput input; /** - * The labels with user-defined metadata for the request. + * The labels with user-defined metadata for the request. It is used for + * billing and reporting only. + * + *

Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("labels") @@ -159,10 +178,7 @@ public class Interaction { @JsonProperty("previous_interaction_id") private String previousInteractionId; - /** - * Enforces that the generated response is a JSON object that complies with the JSON schema specified - * in this field. - */ + @JsonInclude(Include.NON_ABSENT) @JsonProperty("response_format") private InteractionResponseFormat responseFormat; @@ -206,7 +222,7 @@ public class Interaction { private InteractionStatus status; /** - * Output only. The steps that make up the interaction, when included in the response. + * Required. Output only. The steps that make up the interaction. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("steps") @@ -227,7 +243,7 @@ public class Interaction { private List tools; /** - * Output only. The time at which the response was last updated in ISO 8601 format + * Required. Output only. The time at which the response was last updated in ISO 8601 format * (YYYY-MM-DDThh:mm:ssZ). */ @JsonInclude(Include.NON_ABSENT) @@ -252,6 +268,7 @@ public class Interaction { public Interaction( @JsonProperty("agent") @Nullable AgentOption agent, @JsonProperty("agent_config") @Nullable InteractionAgentConfig agentConfig, + @JsonProperty("cached_content") @Nullable String cachedContent, @JsonProperty("created") @Nullable String created, @JsonProperty("environment") @Nullable InteractionEnvironment environment, @JsonProperty("environment_id") @Nullable String environmentId, @@ -280,6 +297,7 @@ public Interaction( @JsonProperty("webhook_config") @Nullable WebhookConfig webhookConfig) { this.agent = agent; this.agentConfig = agentConfig; + this.cachedContent = cachedContent; this.created = created; this.environment = environment; this.environmentId = environmentId; @@ -319,9 +337,9 @@ public Interaction( null, null, null, null, null, null, null, null, null, - status, null, null, + null, status, null, null, null, null, - null); + null, null); } /** @@ -332,14 +350,28 @@ public Optional agent() { } /** - * Configuration parameters for the agent interaction. + * Parameters for the agent interaction. */ public Optional agentConfig() { return Optional.ofNullable(this.agentConfig); } /** - * Output only. The time at which the response was created in ISO 8601 format + * The name of the cached content used as context to serve the prediction. Note: only used in explicit + * caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed + * cost savings. + * + *

Format: cachedContents/{cachedContent} + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Optional cachedContent() { + return Optional.ofNullable(this.cachedContent); + } + + /** + * Required. Output only. The time at which the response was created in ISO 8601 format * (YYYY-MM-DDThh:mm:ssZ). */ public Optional created() { @@ -347,8 +379,7 @@ public Optional created() { } /** - * The environment configuration for the interaction. Can be an object specifying remote environment - * sources or a string referencing an existing environment ID. + * The environment configuration for the interaction. */ public Optional environment() { return Optional.ofNullable(this.environment); @@ -391,7 +422,13 @@ public Optional input() { } /** - * The labels with user-defined metadata for the request. + * The labels with user-defined metadata for the request. It is used for + * billing and reporting only. + * + *

Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. */ public Optional> labels() { return Optional.ofNullable(this.labels); @@ -442,10 +479,6 @@ public Optional previousInteractionId() { return Optional.ofNullable(this.previousInteractionId); } - /** - * Enforces that the generated response is a JSON object that complies with the JSON schema specified - * in this field. - */ public Optional responseFormat() { return Optional.ofNullable(this.responseFormat); } @@ -489,7 +522,7 @@ public Optional status() { } /** - * Output only. The steps that make up the interaction, when included in the response. + * Required. Output only. The steps that make up the interaction. */ public Optional> steps() { return Optional.ofNullable(this.steps); @@ -510,7 +543,7 @@ public Optional> tools() { } /** - * Output only. The time at which the response was last updated in ISO 8601 format + * Required. Output only. The time at which the response was last updated in ISO 8601 format * (YYYY-MM-DDThh:mm:ssZ). */ public Optional updated() { @@ -557,7 +590,7 @@ public Interaction withAgent(@Nullable AgentOption agent) { /** - * Configuration parameters for the agent interaction. + * Parameters for the agent interaction. */ public Interaction withAgentConfig(@Nullable InteractionAgentConfig agentConfig) { this.agentConfig = agentConfig; @@ -566,7 +599,23 @@ public Interaction withAgentConfig(@Nullable InteractionAgentConfig agentConfig) /** - * Output only. The time at which the response was created in ISO 8601 format + * The name of the cached content used as context to serve the prediction. Note: only used in explicit + * caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed + * cost savings. + * + *

Format: cachedContents/{cachedContent} + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Interaction withCachedContent(@Nullable String cachedContent) { + this.cachedContent = cachedContent; + return this; + } + + + /** + * Required. Output only. The time at which the response was created in ISO 8601 format * (YYYY-MM-DDThh:mm:ssZ). */ public Interaction withCreated(@Nullable String created) { @@ -576,8 +625,7 @@ public Interaction withCreated(@Nullable String created) { /** - * The environment configuration for the interaction. Can be an object specifying remote environment - * sources or a string referencing an existing environment ID. + * The environment configuration for the interaction. */ public Interaction withEnvironment(@Nullable InteractionEnvironment environment) { this.environment = environment; @@ -632,7 +680,13 @@ public Interaction withInput(@Nullable InteractionsInput input) { /** - * The labels with user-defined metadata for the request. + * The labels with user-defined metadata for the request. It is used for + * billing and reporting only. + * + *

Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. */ public Interaction withLabels(@Nullable Map labels) { this.labels = labels; @@ -697,10 +751,6 @@ public Interaction withPreviousInteractionId(@Nullable String previousInteractio } - /** - * Enforces that the generated response is a JSON object that complies with the JSON schema specified - * in this field. - */ public Interaction withResponseFormat(@Nullable InteractionResponseFormat responseFormat) { this.responseFormat = responseFormat; return this; @@ -756,7 +806,7 @@ public Interaction withStatus(@Nonnull InteractionStatus status) { /** - * Output only. The steps that make up the interaction, when included in the response. + * Required. Output only. The steps that make up the interaction. */ public Interaction withSteps(@Nullable List steps) { this.steps = steps; @@ -783,7 +833,7 @@ public Interaction withTools(@Nullable List tools) { /** - * Output only. The time at which the response was last updated in ISO 8601 format + * Required. Output only. The time at which the response was last updated in ISO 8601 format * (YYYY-MM-DDThh:mm:ssZ). */ public Interaction withUpdated(@Nullable String updated) { @@ -822,6 +872,7 @@ public boolean equals(java.lang.Object o) { return Utils.enhancedDeepEquals(this.agent, other.agent) && Utils.enhancedDeepEquals(this.agentConfig, other.agentConfig) && + Utils.enhancedDeepEquals(this.cachedContent, other.cachedContent) && Utils.enhancedDeepEquals(this.created, other.created) && Utils.enhancedDeepEquals(this.environment, other.environment) && Utils.enhancedDeepEquals(this.environmentId, other.environmentId) && @@ -853,16 +904,16 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { return Utils.enhancedHash( - agent, agentConfig, created, - environment, environmentId, errors, - generationConfig, id, input, - labels, model, outputAudio, - outputImage, outputText, outputVideo, - previousInteractionId, responseFormat, responseMimeType, - responseModalities, safetySettings, serviceTier, - status, steps, systemInstruction, - tools, updated, usage, - webhookConfig); + agent, agentConfig, cachedContent, + created, environment, environmentId, + errors, generationConfig, id, + input, labels, model, + outputAudio, outputImage, outputText, + outputVideo, previousInteractionId, responseFormat, + responseMimeType, responseModalities, safetySettings, + serviceTier, status, steps, + systemInstruction, tools, updated, + usage, webhookConfig); } @Override @@ -870,6 +921,7 @@ public String toString() { return Utils.toString(Interaction.class, "agent", agent, "agentConfig", agentConfig, + "cachedContent", cachedContent, "created", created, "environment", environment, "environmentId", environmentId, @@ -905,6 +957,9 @@ public final static class Builder { private InteractionAgentConfig agentConfig; + @Deprecated + private String cachedContent; + private String created; private InteractionEnvironment environment; @@ -972,7 +1027,7 @@ public Builder agent(@Nullable AgentOption agent) { } /** - * Configuration parameters for the agent interaction. + * Parameters for the agent interaction. */ public Builder agentConfig(@Nullable InteractionAgentConfig agentConfig) { this.agentConfig = agentConfig; @@ -980,7 +1035,22 @@ public Builder agentConfig(@Nullable InteractionAgentConfig agentConfig) { } /** - * Output only. The time at which the response was created in ISO 8601 format + * The name of the cached content used as context to serve the prediction. Note: only used in explicit + * caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed + * cost savings. + * + *

Format: cachedContents/{cachedContent} + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder cachedContent(@Nullable String cachedContent) { + this.cachedContent = cachedContent; + return this; + } + + /** + * Required. Output only. The time at which the response was created in ISO 8601 format * (YYYY-MM-DDThh:mm:ssZ). */ public Builder created(@Nullable String created) { @@ -989,8 +1059,7 @@ public Builder created(@Nullable String created) { } /** - * The environment configuration for the interaction. Can be an object specifying remote environment - * sources or a string referencing an existing environment ID. + * The environment configuration for the interaction. */ public Builder environment(@Nullable InteractionEnvironment environment) { this.environment = environment; @@ -1039,7 +1108,13 @@ public Builder input(@Nullable InteractionsInput input) { } /** - * The labels with user-defined metadata for the request. + * The labels with user-defined metadata for the request. It is used for + * billing and reporting only. + * + *

Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. */ public Builder labels(@Nullable Map labels) { this.labels = labels; @@ -1097,10 +1172,6 @@ public Builder previousInteractionId(@Nullable String previousInteractionId) { return this; } - /** - * Enforces that the generated response is a JSON object that complies with the JSON schema specified - * in this field. - */ public Builder responseFormat(@Nullable InteractionResponseFormat responseFormat) { this.responseFormat = responseFormat; return this; @@ -1150,7 +1221,7 @@ public Builder status(@Nonnull InteractionStatus status) { } /** - * Output only. The steps that make up the interaction, when included in the response. + * Required. Output only. The steps that make up the interaction. */ public Builder steps(@Nullable List steps) { this.steps = steps; @@ -1174,7 +1245,7 @@ public Builder tools(@Nullable List tools) { } /** - * Output only. The time at which the response was last updated in ISO 8601 format + * Required. Output only. The time at which the response was last updated in ISO 8601 format * (YYYY-MM-DDThh:mm:ssZ). */ public Builder updated(@Nullable String updated) { @@ -1200,16 +1271,16 @@ public Builder webhookConfig(@Nullable WebhookConfig webhookConfig) { public Interaction build() { return new Interaction( - agent, agentConfig, created, - environment, environmentId, errors, - generationConfig, id, input, - labels, model, outputAudio, - outputImage, outputText, outputVideo, - previousInteractionId, responseFormat, responseMimeType, - responseModalities, safetySettings, serviceTier, - status, steps, systemInstruction, - tools, updated, usage, - webhookConfig); + agent, agentConfig, cachedContent, + created, environment, environmentId, + errors, generationConfig, id, + input, labels, model, + outputAudio, outputImage, outputText, + outputVideo, previousInteractionId, responseFormat, + responseMimeType, responseModalities, safetySettings, + serviceTier, status, steps, + systemInstruction, tools, updated, + usage, webhookConfig); } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/InteractionAgentConfig.java b/src/main/java/com/google/genai/gaos/models/interactions/InteractionAgentConfig.java index d91d695d636..3bf32391961 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/InteractionAgentConfig.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/InteractionAgentConfig.java @@ -28,7 +28,7 @@ /** * InteractionAgentConfig * - *

Configuration parameters for the agent interaction. + *

Parameters for the agent interaction. */ @JsonTypeInfo( use = Id.CUSTOM, diff --git a/src/main/java/com/google/genai/gaos/models/interactions/InteractionAgentConfigTypeIdResolver.java b/src/main/java/com/google/genai/gaos/models/interactions/InteractionAgentConfigTypeIdResolver.java index 65dbe7d2c9e..0f9416f4667 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/InteractionAgentConfigTypeIdResolver.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/InteractionAgentConfigTypeIdResolver.java @@ -30,7 +30,7 @@ /** * InteractionAgentConfigTypeIdResolver * - *

Configuration parameters for the agent interaction. + *

Parameters for the agent interaction. */ public class InteractionAgentConfigTypeIdResolver extends GenericTypeIdResolver { diff --git a/src/main/java/com/google/genai/gaos/models/interactions/InteractionCompletedEvent.java b/src/main/java/com/google/genai/gaos/models/interactions/InteractionCompletedEvent.java index 09c9c990ec8..2d1e4515320 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/InteractionCompletedEvent.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/InteractionCompletedEvent.java @@ -54,19 +54,28 @@ public class InteractionCompletedEvent implements InteractionSSEEvent { @JsonProperty("interaction") private InteractionSseEventInteraction interaction; + /** + * Optional metadata accompanying ANY streamed event. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private StreamMetadata metadata; + @JsonCreator public InteractionCompletedEvent( @JsonProperty("event_id") @Nullable String eventId, - @JsonProperty("interaction") @Nonnull InteractionSseEventInteraction interaction) { + @JsonProperty("interaction") @Nonnull InteractionSseEventInteraction interaction, + @JsonProperty("metadata") @Nullable StreamMetadata metadata) { this.eventId = eventId; this.eventType = Builder._SINGLETON_VALUE_EventType.value(); this.interaction = Optional.ofNullable(interaction) .orElseThrow(() -> new IllegalArgumentException("interaction cannot be null")); + this.metadata = metadata; } public InteractionCompletedEvent( @Nonnull InteractionSseEventInteraction interaction) { - this(null, interaction); + this(null, interaction, null); } /** @@ -91,6 +100,13 @@ public Optional interaction() { return Optional.ofNullable(this.interaction); } + /** + * Optional metadata accompanying ANY streamed event. + */ + public Optional metadata() { + return Optional.ofNullable(this.metadata); + } + public static Builder builder() { return new Builder(); } @@ -117,6 +133,15 @@ public InteractionCompletedEvent withInteraction(@Nonnull InteractionSseEventInt } + /** + * Optional metadata accompanying ANY streamed event. + */ + public InteractionCompletedEvent withMetadata(@Nullable StreamMetadata metadata) { + this.metadata = metadata; + return this; + } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -129,13 +154,15 @@ public boolean equals(java.lang.Object o) { return Utils.enhancedDeepEquals(this.eventId, other.eventId) && Utils.enhancedDeepEquals(this.eventType, other.eventType) && - Utils.enhancedDeepEquals(this.interaction, other.interaction); + Utils.enhancedDeepEquals(this.interaction, other.interaction) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { return Utils.enhancedHash( - eventId, eventType, interaction); + eventId, eventType, interaction, + metadata); } @Override @@ -143,7 +170,8 @@ public String toString() { return Utils.toString(InteractionCompletedEvent.class, "eventId", eventId, "eventType", eventType, - "interaction", interaction); + "interaction", interaction, + "metadata", metadata); } @SuppressWarnings("UnusedReturnValue") @@ -153,6 +181,8 @@ public final static class Builder { private InteractionSseEventInteraction interaction; + private StreamMetadata metadata; + private Builder() { // force use of static builder() method } @@ -176,9 +206,17 @@ public Builder interaction(@Nonnull InteractionSseEventInteraction interaction) return this; } + /** + * Optional metadata accompanying ANY streamed event. + */ + public Builder metadata(@Nullable StreamMetadata metadata) { + this.metadata = metadata; + return this; + } + public InteractionCompletedEvent build() { return new InteractionCompletedEvent( - eventId, interaction); + eventId, interaction, metadata); } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/InteractionCreatedEvent.java b/src/main/java/com/google/genai/gaos/models/interactions/InteractionCreatedEvent.java index 24539b74e09..177776cdf71 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/InteractionCreatedEvent.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/InteractionCreatedEvent.java @@ -54,19 +54,28 @@ public class InteractionCreatedEvent implements InteractionSSEEvent { @JsonProperty("interaction") private InteractionSseEventInteraction interaction; + /** + * Optional metadata accompanying ANY streamed event. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private StreamMetadata metadata; + @JsonCreator public InteractionCreatedEvent( @JsonProperty("event_id") @Nullable String eventId, - @JsonProperty("interaction") @Nonnull InteractionSseEventInteraction interaction) { + @JsonProperty("interaction") @Nonnull InteractionSseEventInteraction interaction, + @JsonProperty("metadata") @Nullable StreamMetadata metadata) { this.eventId = eventId; this.eventType = Builder._SINGLETON_VALUE_EventType.value(); this.interaction = Optional.ofNullable(interaction) .orElseThrow(() -> new IllegalArgumentException("interaction cannot be null")); + this.metadata = metadata; } public InteractionCreatedEvent( @Nonnull InteractionSseEventInteraction interaction) { - this(null, interaction); + this(null, interaction, null); } /** @@ -91,6 +100,13 @@ public Optional interaction() { return Optional.ofNullable(this.interaction); } + /** + * Optional metadata accompanying ANY streamed event. + */ + public Optional metadata() { + return Optional.ofNullable(this.metadata); + } + public static Builder builder() { return new Builder(); } @@ -117,6 +133,15 @@ public InteractionCreatedEvent withInteraction(@Nonnull InteractionSseEventInter } + /** + * Optional metadata accompanying ANY streamed event. + */ + public InteractionCreatedEvent withMetadata(@Nullable StreamMetadata metadata) { + this.metadata = metadata; + return this; + } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -129,13 +154,15 @@ public boolean equals(java.lang.Object o) { return Utils.enhancedDeepEquals(this.eventId, other.eventId) && Utils.enhancedDeepEquals(this.eventType, other.eventType) && - Utils.enhancedDeepEquals(this.interaction, other.interaction); + Utils.enhancedDeepEquals(this.interaction, other.interaction) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { return Utils.enhancedHash( - eventId, eventType, interaction); + eventId, eventType, interaction, + metadata); } @Override @@ -143,7 +170,8 @@ public String toString() { return Utils.toString(InteractionCreatedEvent.class, "eventId", eventId, "eventType", eventType, - "interaction", interaction); + "interaction", interaction, + "metadata", metadata); } @SuppressWarnings("UnusedReturnValue") @@ -153,6 +181,8 @@ public final static class Builder { private InteractionSseEventInteraction interaction; + private StreamMetadata metadata; + private Builder() { // force use of static builder() method } @@ -176,9 +206,17 @@ public Builder interaction(@Nonnull InteractionSseEventInteraction interaction) return this; } + /** + * Optional metadata accompanying ANY streamed event. + */ + public Builder metadata(@Nullable StreamMetadata metadata) { + this.metadata = metadata; + return this; + } + public InteractionCreatedEvent build() { return new InteractionCreatedEvent( - eventId, interaction); + eventId, interaction, metadata); } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/InteractionEnvironment.java b/src/main/java/com/google/genai/gaos/models/interactions/InteractionEnvironment.java index c4d03459867..eb0f33d1d89 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/InteractionEnvironment.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/InteractionEnvironment.java @@ -36,8 +36,7 @@ /** * InteractionEnvironment * - *

The environment configuration for the interaction. Can be an object specifying remote environment - * sources or a string referencing an existing environment ID. + *

The environment configuration for the interaction. */ @JsonDeserialize(using = InteractionEnvironment._Deserializer.class) public class InteractionEnvironment { @@ -54,6 +53,11 @@ public static InteractionEnvironment of(Environment value) { return new InteractionEnvironment(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); } + public static InteractionEnvironment of(LocalEnvironmentConfig value) { + Utils.checkNotNull(value, "value"); + return new InteractionEnvironment(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); + } + public static InteractionEnvironment of(String value) { Utils.checkNotNull(value, "value"); return new InteractionEnvironment(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); @@ -72,6 +76,19 @@ public Optional environment() { return Optional.empty(); } + /** + * Returns an {@link Optional} containing the value if it is of type {@code LocalEnvironmentConfig}, + * otherwise returns an empty {@link Optional}. + * + * @return an {@link Optional} containing the {@code LocalEnvironmentConfig} value, or empty if not of this type + */ + public Optional localEnvironmentConfig() { + if (value.value() instanceof LocalEnvironmentConfig) { + return Optional.of((LocalEnvironmentConfig) value.value()); + } + return Optional.empty(); + } + /** * Returns an {@link Optional} containing the value if it is of type {@code String}, * otherwise returns an empty {@link Optional}. @@ -120,6 +137,7 @@ public static final class _Deserializer extends OneOfDeserializer() {}, JsonShape.DEFAULT), + TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT), TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT)); } } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/InteractionResponseFormat.java b/src/main/java/com/google/genai/gaos/models/interactions/InteractionResponseFormat.java index f629e1ff1c8..14c45150419 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/InteractionResponseFormat.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/InteractionResponseFormat.java @@ -34,12 +34,6 @@ import java.util.List; import java.util.Optional; -/** - * InteractionResponseFormat - * - *

Enforces that the generated response is a JSON object that complies with the JSON schema specified - * in this field. - */ @JsonDeserialize(using = InteractionResponseFormat._Deserializer.class) public class InteractionResponseFormat { diff --git a/src/main/java/com/google/genai/gaos/models/interactions/InteractionStatusUpdate.java b/src/main/java/com/google/genai/gaos/models/interactions/InteractionStatusUpdate.java index f4e2a19a05c..0c033e54aad 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/InteractionStatusUpdate.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/InteractionStatusUpdate.java @@ -50,6 +50,13 @@ public class InteractionStatusUpdate implements InteractionSSEEvent { @JsonProperty("interaction_id") private String interactionId; + /** + * Optional metadata accompanying ANY streamed event. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private StreamMetadata metadata; + @JsonProperty("status") private InteractionStatusUpdateStatus status; @@ -58,11 +65,13 @@ public class InteractionStatusUpdate implements InteractionSSEEvent { public InteractionStatusUpdate( @JsonProperty("event_id") @Nullable String eventId, @JsonProperty("interaction_id") @Nonnull String interactionId, + @JsonProperty("metadata") @Nullable StreamMetadata metadata, @JsonProperty("status") @Nonnull InteractionStatusUpdateStatus status) { this.eventId = eventId; this.eventType = Builder._SINGLETON_VALUE_EventType.value(); this.interactionId = Optional.ofNullable(interactionId) .orElseThrow(() -> new IllegalArgumentException("interactionId cannot be null")); + this.metadata = metadata; this.status = Optional.ofNullable(status) .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); } @@ -70,7 +79,8 @@ public InteractionStatusUpdate( public InteractionStatusUpdate( @Nonnull String interactionId, @Nonnull InteractionStatusUpdateStatus status) { - this(null, interactionId, status); + this(null, interactionId, null, + status); } /** @@ -90,6 +100,13 @@ public Optional interactionId() { return Optional.ofNullable(this.interactionId); } + /** + * Optional metadata accompanying ANY streamed event. + */ + public Optional metadata() { + return Optional.ofNullable(this.metadata); + } + public Optional status() { return Optional.ofNullable(this.status); } @@ -115,6 +132,15 @@ public InteractionStatusUpdate withInteractionId(@Nonnull String interactionId) } + /** + * Optional metadata accompanying ANY streamed event. + */ + public InteractionStatusUpdate withMetadata(@Nullable StreamMetadata metadata) { + this.metadata = metadata; + return this; + } + + public InteractionStatusUpdate withStatus(@Nonnull InteractionStatusUpdateStatus status) { this.status = Utils.checkNotNull(status, "status"); return this; @@ -134,6 +160,7 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.eventId, other.eventId) && Utils.enhancedDeepEquals(this.eventType, other.eventType) && Utils.enhancedDeepEquals(this.interactionId, other.interactionId) && + Utils.enhancedDeepEquals(this.metadata, other.metadata) && Utils.enhancedDeepEquals(this.status, other.status); } @@ -141,7 +168,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Utils.enhancedHash( eventId, eventType, interactionId, - status); + metadata, status); } @Override @@ -150,6 +177,7 @@ public String toString() { "eventId", eventId, "eventType", eventType, "interactionId", interactionId, + "metadata", metadata, "status", status); } @@ -160,6 +188,8 @@ public final static class Builder { private String interactionId; + private StreamMetadata metadata; + private InteractionStatusUpdateStatus status; private Builder() { @@ -180,6 +210,14 @@ public Builder interactionId(@Nonnull String interactionId) { return this; } + /** + * Optional metadata accompanying ANY streamed event. + */ + public Builder metadata(@Nullable StreamMetadata metadata) { + this.metadata = metadata; + return this; + } + public Builder status(@Nonnull InteractionStatusUpdateStatus status) { this.status = Utils.checkNotNull(status, "status"); return this; @@ -187,7 +225,8 @@ public Builder status(@Nonnull InteractionStatusUpdateStatus status) { public InteractionStatusUpdate build() { return new InteractionStatusUpdate( - eventId, interactionId, status); + eventId, interactionId, metadata, + status); } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/LocalEnvironmentConfig.java b/src/main/java/com/google/genai/gaos/models/interactions/LocalEnvironmentConfig.java new file mode 100644 index 00000000000..17a9a77f95b --- /dev/null +++ b/src/main/java/com/google/genai/gaos/models/interactions/LocalEnvironmentConfig.java @@ -0,0 +1,111 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.google.genai.gaos.models.interactions; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import com.google.genai.gaos.utils.LazySingletonValue; +import com.google.genai.gaos.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.util.Optional; + +/** + * LocalEnvironmentConfig + * + *

Configuration for an environment that lives on the client connection rather + * than in a server-managed sandbox. + * + *

When set (via Interaction.local_environment), the agent's filesystem and + * shell are treated as living on the client: the agent's built-in environment + * operations (e.g. reading/listing/editing files and running commands) are + * suspended on the server and yielded back to the client to execute, with their + * results returned on a subsequent turn. This is mutually exclusive with a + * server-managed `EnvironmentConfig` (remote_environment), since the + * environment is either on the client or in a server sandbox, never both. + * + *

This governs only the agent's built-in environment. Client-declared function + * tools are always executed on the client regardless of this field. + */ +public class LocalEnvironmentConfig { + + @JsonProperty("type") + private String type; + + @JsonCreator + public LocalEnvironmentConfig() { + this.type = Builder._SINGLETON_VALUE_Type.value(); + } + + public Optional type() { + return Optional.ofNullable(this.type); + } + + public static Builder builder() { + return new Builder(); + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LocalEnvironmentConfig other = (LocalEnvironmentConfig) o; + return + Utils.enhancedDeepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + type); + } + + @Override + public String toString() { + return Utils.toString(LocalEnvironmentConfig.class, + "type", type); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public LocalEnvironmentConfig build() { + return new LocalEnvironmentConfig( + ); + } + + + private static final LazySingletonValue _SINGLETON_VALUE_Type = + new LazySingletonValue<>( + "type", + "\"local\"", + new TypeReference() {}); + } +} diff --git a/src/main/java/com/google/genai/gaos/models/interactions/MCPServerToolCallDelta.java b/src/main/java/com/google/genai/gaos/models/interactions/MCPServerToolCallDelta.java index 59143a04c14..bc5269bd398 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/MCPServerToolCallDelta.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/MCPServerToolCallDelta.java @@ -20,11 +20,14 @@ package com.google.genai.gaos.models.interactions; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.type.TypeReference; import com.google.genai.gaos.utils.LazySingletonValue; import com.google.genai.gaos.utils.Utils; import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; @@ -37,6 +40,13 @@ public class MCPServerToolCallDelta implements StepDeltaData { @JsonProperty("arguments") private Map arguments; + /** + * Required. A unique ID for this specific tool call. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private String id; + @JsonProperty("name") private String name; @@ -45,6 +55,13 @@ public class MCPServerToolCallDelta implements StepDeltaData { @JsonProperty("server_name") private String serverName; + /** + * A signature hash for backend validation. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("signature") + private String signature; + @JsonProperty("type") private String type; @@ -52,22 +69,41 @@ public class MCPServerToolCallDelta implements StepDeltaData { @JsonCreator public MCPServerToolCallDelta( @JsonProperty("arguments") @Nonnull Map arguments, + @JsonProperty("id") @Nullable String id, @JsonProperty("name") @Nonnull String name, - @JsonProperty("server_name") @Nonnull String serverName) { + @JsonProperty("server_name") @Nonnull String serverName, + @JsonProperty("signature") @Nullable String signature) { arguments = Utils.emptyMapIfNull(arguments); this.arguments = Optional.ofNullable(arguments) .orElseThrow(() -> new IllegalArgumentException("arguments cannot be null")); + this.id = id; this.name = Optional.ofNullable(name) .orElseThrow(() -> new IllegalArgumentException("name cannot be null")); this.serverName = Optional.ofNullable(serverName) .orElseThrow(() -> new IllegalArgumentException("serverName cannot be null")); + this.signature = signature; this.type = Builder._SINGLETON_VALUE_Type.value(); } + + public MCPServerToolCallDelta( + @Nonnull Map arguments, + @Nonnull String name, + @Nonnull String serverName) { + this(arguments, null, name, + serverName, null); + } public Optional> arguments() { return Optional.ofNullable(this.arguments); } + /** + * Required. A unique ID for this specific tool call. + */ + public Optional id() { + return Optional.ofNullable(this.id); + } + public Optional name() { return Optional.ofNullable(this.name); } @@ -76,6 +112,13 @@ public Optional serverName() { return Optional.ofNullable(this.serverName); } + /** + * A signature hash for backend validation. + */ + public Optional signature() { + return Optional.ofNullable(this.signature); + } + @Override public String type() { return Utils.discriminatorToString(type); @@ -92,6 +135,15 @@ public MCPServerToolCallDelta withArguments(@Nonnull Map argumen } + /** + * Required. A unique ID for this specific tool call. + */ + public MCPServerToolCallDelta withId(@Nullable String id) { + this.id = id; + return this; + } + + public MCPServerToolCallDelta withName(@Nonnull String name) { this.name = Utils.checkNotNull(name, "name"); return this; @@ -104,6 +156,15 @@ public MCPServerToolCallDelta withServerName(@Nonnull String serverName) { } + /** + * A signature hash for backend validation. + */ + public MCPServerToolCallDelta withSignature(@Nullable String signature) { + this.signature = signature; + return this; + } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -115,24 +176,28 @@ public boolean equals(java.lang.Object o) { MCPServerToolCallDelta other = (MCPServerToolCallDelta) o; return Utils.enhancedDeepEquals(this.arguments, other.arguments) && + Utils.enhancedDeepEquals(this.id, other.id) && Utils.enhancedDeepEquals(this.name, other.name) && Utils.enhancedDeepEquals(this.serverName, other.serverName) && + Utils.enhancedDeepEquals(this.signature, other.signature) && Utils.enhancedDeepEquals(this.type, other.type); } @Override public int hashCode() { return Utils.enhancedHash( - arguments, name, serverName, - type); + arguments, id, name, + serverName, signature, type); } @Override public String toString() { return Utils.toString(MCPServerToolCallDelta.class, "arguments", arguments, + "id", id, "name", name, "serverName", serverName, + "signature", signature, "type", type); } @@ -141,10 +206,14 @@ public final static class Builder { private Map arguments; + private String id; + private String name; private String serverName; + private String signature; + private Builder() { // force use of static builder() method } @@ -154,6 +223,14 @@ public Builder arguments(@Nonnull Map arguments) { return this; } + /** + * Required. A unique ID for this specific tool call. + */ + public Builder id(@Nullable String id) { + this.id = id; + return this; + } + public Builder name(@Nonnull String name) { this.name = Utils.checkNotNull(name, "name"); return this; @@ -164,9 +241,18 @@ public Builder serverName(@Nonnull String serverName) { return this; } + /** + * A signature hash for backend validation. + */ + public Builder signature(@Nullable String signature) { + this.signature = signature; + return this; + } + public MCPServerToolCallDelta build() { return new MCPServerToolCallDelta( - arguments, name, serverName); + arguments, id, name, + serverName, signature); } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/MCPServerToolCallStep.java b/src/main/java/com/google/genai/gaos/models/interactions/MCPServerToolCallStep.java index 12fa10e99e8..a7ce7b87674 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/MCPServerToolCallStep.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/MCPServerToolCallStep.java @@ -20,11 +20,14 @@ package com.google.genai.gaos.models.interactions; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.type.TypeReference; import com.google.genai.gaos.utils.LazySingletonValue; import com.google.genai.gaos.utils.Utils; import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; @@ -61,6 +64,13 @@ public class MCPServerToolCallStep implements Step { @JsonProperty("server_name") private String serverName; + /** + * A signature hash for backend validation. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("signature") + private String signature; + @JsonProperty("type") private String type; @@ -70,7 +80,8 @@ public MCPServerToolCallStep( @JsonProperty("arguments") @Nonnull Map arguments, @JsonProperty("id") @Nonnull String id, @JsonProperty("name") @Nonnull String name, - @JsonProperty("server_name") @Nonnull String serverName) { + @JsonProperty("server_name") @Nonnull String serverName, + @JsonProperty("signature") @Nullable String signature) { arguments = Utils.emptyMapIfNull(arguments); this.arguments = Optional.ofNullable(arguments) .orElseThrow(() -> new IllegalArgumentException("arguments cannot be null")); @@ -80,8 +91,18 @@ public MCPServerToolCallStep( .orElseThrow(() -> new IllegalArgumentException("name cannot be null")); this.serverName = Optional.ofNullable(serverName) .orElseThrow(() -> new IllegalArgumentException("serverName cannot be null")); + this.signature = signature; this.type = Builder._SINGLETON_VALUE_Type.value(); } + + public MCPServerToolCallStep( + @Nonnull Map arguments, + @Nonnull String id, + @Nonnull String name, + @Nonnull String serverName) { + this(arguments, id, name, + serverName, null); + } /** * Required. The JSON object of arguments for the function. @@ -111,6 +132,13 @@ public Optional serverName() { return Optional.ofNullable(this.serverName); } + /** + * A signature hash for backend validation. + */ + public Optional signature() { + return Optional.ofNullable(this.signature); + } + @Override public String type() { return Utils.discriminatorToString(type); @@ -157,6 +185,15 @@ public MCPServerToolCallStep withServerName(@Nonnull String serverName) { } + /** + * A signature hash for backend validation. + */ + public MCPServerToolCallStep withSignature(@Nullable String signature) { + this.signature = signature; + return this; + } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -171,6 +208,7 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.id, other.id) && Utils.enhancedDeepEquals(this.name, other.name) && Utils.enhancedDeepEquals(this.serverName, other.serverName) && + Utils.enhancedDeepEquals(this.signature, other.signature) && Utils.enhancedDeepEquals(this.type, other.type); } @@ -178,7 +216,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Utils.enhancedHash( arguments, id, name, - serverName, type); + serverName, signature, type); } @Override @@ -188,6 +226,7 @@ public String toString() { "id", id, "name", name, "serverName", serverName, + "signature", signature, "type", type); } @@ -202,6 +241,8 @@ public final static class Builder { private String serverName; + private String signature; + private Builder() { // force use of static builder() method } @@ -238,10 +279,18 @@ public Builder serverName(@Nonnull String serverName) { return this; } + /** + * A signature hash for backend validation. + */ + public Builder signature(@Nullable String signature) { + this.signature = signature; + return this; + } + public MCPServerToolCallStep build() { return new MCPServerToolCallStep( arguments, id, name, - serverName); + serverName, signature); } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/MCPServerToolResultDelta.java b/src/main/java/com/google/genai/gaos/models/interactions/MCPServerToolResultDelta.java index 271785134a8..3194cc7ed9a 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/MCPServerToolResultDelta.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/MCPServerToolResultDelta.java @@ -34,6 +34,13 @@ public class MCPServerToolResultDelta implements StepDeltaData { + /** + * Required. ID to match the ID from the function call block. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("call_id") + private String callId; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") @@ -48,25 +55,44 @@ public class MCPServerToolResultDelta implements StepDeltaData { @JsonProperty("server_name") private String serverName; + /** + * A signature hash for backend validation. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("signature") + private String signature; + @JsonProperty("type") private String type; @JsonCreator public MCPServerToolResultDelta( + @JsonProperty("call_id") @Nullable String callId, @JsonProperty("name") @Nullable String name, @JsonProperty("result") @Nonnull MCPServerToolResultDeltaResultUnion result, - @JsonProperty("server_name") @Nullable String serverName) { + @JsonProperty("server_name") @Nullable String serverName, + @JsonProperty("signature") @Nullable String signature) { + this.callId = callId; this.name = name; this.result = Optional.ofNullable(result) .orElseThrow(() -> new IllegalArgumentException("result cannot be null")); this.serverName = serverName; + this.signature = signature; this.type = Builder._SINGLETON_VALUE_Type.value(); } public MCPServerToolResultDelta( @Nonnull MCPServerToolResultDeltaResultUnion result) { - this(null, result, null); + this(null, null, result, + null, null); + } + + /** + * Required. ID to match the ID from the function call block. + */ + public Optional callId() { + return Optional.ofNullable(this.callId); } public Optional name() { @@ -81,6 +107,13 @@ public Optional serverName() { return Optional.ofNullable(this.serverName); } + /** + * A signature hash for backend validation. + */ + public Optional signature() { + return Optional.ofNullable(this.signature); + } + @Override public String type() { return Utils.discriminatorToString(type); @@ -91,6 +124,15 @@ public static Builder builder() { } + /** + * Required. ID to match the ID from the function call block. + */ + public MCPServerToolResultDelta withCallId(@Nullable String callId) { + this.callId = callId; + return this; + } + + public MCPServerToolResultDelta withName(@Nullable String name) { this.name = name; return this; @@ -109,6 +151,15 @@ public MCPServerToolResultDelta withServerName(@Nullable String serverName) { } + /** + * A signature hash for backend validation. + */ + public MCPServerToolResultDelta withSignature(@Nullable String signature) { + this.signature = signature; + return this; + } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -119,41 +170,57 @@ public boolean equals(java.lang.Object o) { } MCPServerToolResultDelta other = (MCPServerToolResultDelta) o; return + Utils.enhancedDeepEquals(this.callId, other.callId) && Utils.enhancedDeepEquals(this.name, other.name) && Utils.enhancedDeepEquals(this.result, other.result) && Utils.enhancedDeepEquals(this.serverName, other.serverName) && + Utils.enhancedDeepEquals(this.signature, other.signature) && Utils.enhancedDeepEquals(this.type, other.type); } @Override public int hashCode() { return Utils.enhancedHash( - name, result, serverName, - type); + callId, name, result, + serverName, signature, type); } @Override public String toString() { return Utils.toString(MCPServerToolResultDelta.class, + "callId", callId, "name", name, "result", result, "serverName", serverName, + "signature", signature, "type", type); } @SuppressWarnings("UnusedReturnValue") public final static class Builder { + private String callId; + private String name; private MCPServerToolResultDeltaResultUnion result; private String serverName; + private String signature; + private Builder() { // force use of static builder() method } + /** + * Required. ID to match the ID from the function call block. + */ + public Builder callId(@Nullable String callId) { + this.callId = callId; + return this; + } + public Builder name(@Nullable String name) { this.name = name; return this; @@ -169,9 +236,18 @@ public Builder serverName(@Nullable String serverName) { return this; } + /** + * A signature hash for backend validation. + */ + public Builder signature(@Nullable String signature) { + this.signature = signature; + return this; + } + public MCPServerToolResultDelta build() { return new MCPServerToolResultDelta( - name, result, serverName); + callId, name, result, + serverName, signature); } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/MCPServerToolResultStep.java b/src/main/java/com/google/genai/gaos/models/interactions/MCPServerToolResultStep.java index c2ef033c71b..badda067b56 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/MCPServerToolResultStep.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/MCPServerToolResultStep.java @@ -64,6 +64,13 @@ public class MCPServerToolResultStep implements Step { @JsonProperty("server_name") private String serverName; + /** + * A signature hash for backend validation. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("signature") + private String signature; + @JsonProperty("type") private String type; @@ -73,13 +80,15 @@ public MCPServerToolResultStep( @JsonProperty("call_id") @Nonnull String callId, @JsonProperty("name") @Nullable String name, @JsonProperty("result") @Nonnull MCPServerToolResultStepResultUnion result, - @JsonProperty("server_name") @Nullable String serverName) { + @JsonProperty("server_name") @Nullable String serverName, + @JsonProperty("signature") @Nullable String signature) { this.callId = Optional.ofNullable(callId) .orElseThrow(() -> new IllegalArgumentException("callId cannot be null")); this.name = name; this.result = Optional.ofNullable(result) .orElseThrow(() -> new IllegalArgumentException("result cannot be null")); this.serverName = serverName; + this.signature = signature; this.type = Builder._SINGLETON_VALUE_Type.value(); } @@ -87,7 +96,7 @@ public MCPServerToolResultStep( @Nonnull String callId, @Nonnull MCPServerToolResultStepResultUnion result) { this(callId, null, result, - null); + null, null); } /** @@ -118,6 +127,13 @@ public Optional serverName() { return Optional.ofNullable(this.serverName); } + /** + * A signature hash for backend validation. + */ + public Optional signature() { + return Optional.ofNullable(this.signature); + } + @Override public String type() { return Utils.discriminatorToString(type); @@ -164,6 +180,15 @@ public MCPServerToolResultStep withServerName(@Nullable String serverName) { } + /** + * A signature hash for backend validation. + */ + public MCPServerToolResultStep withSignature(@Nullable String signature) { + this.signature = signature; + return this; + } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -178,6 +203,7 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.name, other.name) && Utils.enhancedDeepEquals(this.result, other.result) && Utils.enhancedDeepEquals(this.serverName, other.serverName) && + Utils.enhancedDeepEquals(this.signature, other.signature) && Utils.enhancedDeepEquals(this.type, other.type); } @@ -185,7 +211,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Utils.enhancedHash( callId, name, result, - serverName, type); + serverName, signature, type); } @Override @@ -195,6 +221,7 @@ public String toString() { "name", name, "result", result, "serverName", serverName, + "signature", signature, "type", type); } @@ -209,6 +236,8 @@ public final static class Builder { private String serverName; + private String signature; + private Builder() { // force use of static builder() method } @@ -245,10 +274,18 @@ public Builder serverName(@Nullable String serverName) { return this; } + /** + * A signature hash for backend validation. + */ + public Builder signature(@Nullable String signature) { + this.signature = signature; + return this; + } + public MCPServerToolResultStep build() { return new MCPServerToolResultStep( callId, name, result, - serverName); + serverName, signature); } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/Model.java b/src/main/java/com/google/genai/gaos/models/interactions/Model.java index 2c7972dd1e8..0784802b9f7 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/Model.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/Model.java @@ -58,10 +58,10 @@ public class Model { public static final Model GEMINI3_PRO_IMAGE = new Model("gemini-3-pro-image"); public static final Model NANO_BANANA_PRO_PREVIEW = new Model("nano-banana-pro-preview"); public static final Model GEMINI31_FLASH_IMAGE = new Model("gemini-3.1-flash-image"); + public static final Model GEMINI31_FLASH_TTS_PREVIEW = new Model("gemini-3.1-flash-tts-preview"); public static final Model GEMINI35_FLASH = new Model("gemini-3.5-flash"); public static final Model GEMINI36_FLASH = new Model("gemini-3.6-flash"); public static final Model GEMINI37_FLASH = new Model("gemini-3.7-flash"); - public static final Model GEMINI38_FLASH = new Model("gemini-3.8-flash"); public static final Model LYRIA3_CLIP_PREVIEW = new Model("lyria-3-clip-preview"); public static final Model LYRIA3_PRO_PREVIEW = new Model("lyria-3-pro-preview"); public static final Model GEMINI_ROBOTICS_ER16_PREVIEW = new Model("gemini-robotics-er-1.6-preview"); @@ -155,10 +155,10 @@ private static final Map createValuesMap() { map.put("gemini-3-pro-image", GEMINI3_PRO_IMAGE); map.put("nano-banana-pro-preview", NANO_BANANA_PRO_PREVIEW); map.put("gemini-3.1-flash-image", GEMINI31_FLASH_IMAGE); + map.put("gemini-3.1-flash-tts-preview", GEMINI31_FLASH_TTS_PREVIEW); map.put("gemini-3.5-flash", GEMINI35_FLASH); map.put("gemini-3.6-flash", GEMINI36_FLASH); map.put("gemini-3.7-flash", GEMINI37_FLASH); - map.put("gemini-3.8-flash", GEMINI38_FLASH); map.put("lyria-3-clip-preview", LYRIA3_CLIP_PREVIEW); map.put("lyria-3-pro-preview", LYRIA3_PRO_PREVIEW); map.put("gemini-robotics-er-1.6-preview", GEMINI_ROBOTICS_ER16_PREVIEW); @@ -184,10 +184,10 @@ private static final Map createEnumsMap() { map.put("gemini-3-pro-image", ModelEnum.GEMINI3_PRO_IMAGE); map.put("nano-banana-pro-preview", ModelEnum.NANO_BANANA_PRO_PREVIEW); map.put("gemini-3.1-flash-image", ModelEnum.GEMINI31_FLASH_IMAGE); + map.put("gemini-3.1-flash-tts-preview", ModelEnum.GEMINI31_FLASH_TTS_PREVIEW); map.put("gemini-3.5-flash", ModelEnum.GEMINI35_FLASH); map.put("gemini-3.6-flash", ModelEnum.GEMINI36_FLASH); map.put("gemini-3.7-flash", ModelEnum.GEMINI37_FLASH); - map.put("gemini-3.8-flash", ModelEnum.GEMINI38_FLASH); map.put("lyria-3-clip-preview", ModelEnum.LYRIA3_CLIP_PREVIEW); map.put("lyria-3-pro-preview", ModelEnum.LYRIA3_PRO_PREVIEW); map.put("gemini-robotics-er-1.6-preview", ModelEnum.GEMINI_ROBOTICS_ER16_PREVIEW); @@ -214,10 +214,10 @@ public enum ModelEnum { GEMINI3_PRO_IMAGE("gemini-3-pro-image"), NANO_BANANA_PRO_PREVIEW("nano-banana-pro-preview"), GEMINI31_FLASH_IMAGE("gemini-3.1-flash-image"), + GEMINI31_FLASH_TTS_PREVIEW("gemini-3.1-flash-tts-preview"), GEMINI35_FLASH("gemini-3.5-flash"), GEMINI36_FLASH("gemini-3.6-flash"), GEMINI37_FLASH("gemini-3.7-flash"), - GEMINI38_FLASH("gemini-3.8-flash"), LYRIA3_CLIP_PREVIEW("lyria-3-clip-preview"), LYRIA3_PRO_PREVIEW("lyria-3-pro-preview"), GEMINI_ROBOTICS_ER16_PREVIEW("gemini-robotics-er-1.6-preview"), diff --git a/src/main/java/com/google/genai/gaos/models/interactions/ProcessingCallStep.java b/src/main/java/com/google/genai/gaos/models/interactions/ProcessingCallStep.java index c2dfa3e1eb8..9b5828573a8 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/ProcessingCallStep.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/ProcessingCallStep.java @@ -26,7 +26,6 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.google.genai.gaos.utils.LazySingletonValue; import com.google.genai.gaos.utils.Utils; -import jakarta.annotation.Nonnull; import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; @@ -42,6 +41,7 @@ public class ProcessingCallStep implements Step { /** * Required. A unique ID for this specific tool call. */ + @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private String id; @@ -58,17 +58,15 @@ public class ProcessingCallStep implements Step { @JsonCreator public ProcessingCallStep( - @JsonProperty("id") @Nonnull String id, + @JsonProperty("id") @Nullable String id, @JsonProperty("signature") @Nullable String signature) { - this.id = Optional.ofNullable(id) - .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.id = id; this.signature = signature; this.type = Builder._SINGLETON_VALUE_Type.value(); } - public ProcessingCallStep( - @Nonnull String id) { - this(id, null); + public ProcessingCallStep() { + this(null, null); } /** @@ -98,8 +96,8 @@ public static Builder builder() { /** * Required. A unique ID for this specific tool call. */ - public ProcessingCallStep withId(@Nonnull String id) { - this.id = Utils.checkNotNull(id, "id"); + public ProcessingCallStep withId(@Nullable String id) { + this.id = id; return this; } @@ -156,8 +154,8 @@ private Builder() { /** * Required. A unique ID for this specific tool call. */ - public Builder id(@Nonnull String id) { - this.id = Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { + this.id = id; return this; } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/ProcessingResultStep.java b/src/main/java/com/google/genai/gaos/models/interactions/ProcessingResultStep.java index e6313bb29b7..5ac2fc904c8 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/ProcessingResultStep.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/ProcessingResultStep.java @@ -26,7 +26,6 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.google.genai.gaos.utils.LazySingletonValue; import com.google.genai.gaos.utils.Utils; -import jakarta.annotation.Nonnull; import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; @@ -41,6 +40,7 @@ public class ProcessingResultStep implements Step { /** * Required. ID to match the ID from the function call block. */ + @JsonInclude(Include.NON_ABSENT) @JsonProperty("call_id") private String callId; @@ -57,17 +57,15 @@ public class ProcessingResultStep implements Step { @JsonCreator public ProcessingResultStep( - @JsonProperty("call_id") @Nonnull String callId, + @JsonProperty("call_id") @Nullable String callId, @JsonProperty("signature") @Nullable String signature) { - this.callId = Optional.ofNullable(callId) - .orElseThrow(() -> new IllegalArgumentException("callId cannot be null")); + this.callId = callId; this.signature = signature; this.type = Builder._SINGLETON_VALUE_Type.value(); } - public ProcessingResultStep( - @Nonnull String callId) { - this(callId, null); + public ProcessingResultStep() { + this(null, null); } /** @@ -97,8 +95,8 @@ public static Builder builder() { /** * Required. ID to match the ID from the function call block. */ - public ProcessingResultStep withCallId(@Nonnull String callId) { - this.callId = Utils.checkNotNull(callId, "callId"); + public ProcessingResultStep withCallId(@Nullable String callId) { + this.callId = callId; return this; } @@ -155,8 +153,8 @@ private Builder() { /** * Required. ID to match the ID from the function call block. */ - public Builder callId(@Nonnull String callId) { - this.callId = Utils.checkNotNull(callId, "callId"); + public Builder callId(@Nullable String callId) { + this.callId = callId; return this; } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/RagRetrievalConfig.java b/src/main/java/com/google/genai/gaos/models/interactions/RagRetrievalConfig.java index ab4de40f770..0ea5763b2f9 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/RagRetrievalConfig.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/RagRetrievalConfig.java @@ -51,7 +51,7 @@ public class RagRetrievalConfig { private HybridSearch hybridSearch; /** - * Config for Rank Service. + * Config for ranking and reranking. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("ranking") @@ -96,7 +96,7 @@ public Optional hybridSearch() { } /** - * Config for Rank Service. + * Config for ranking and reranking. */ public Optional ranking() { return Optional.ofNullable(this.ranking); @@ -133,7 +133,7 @@ public RagRetrievalConfig withHybridSearch(@Nullable HybridSearch hybridSearch) /** - * Config for Rank Service. + * Config for ranking and reranking. */ public RagRetrievalConfig withRanking(@Nullable Ranking ranking) { this.ranking = ranking; @@ -214,7 +214,7 @@ public Builder hybridSearch(@Nullable HybridSearch hybridSearch) { } /** - * Config for Rank Service. + * Config for ranking and reranking. */ public Builder ranking(@Nullable Ranking ranking) { this.ranking = ranking; diff --git a/src/main/java/com/google/genai/gaos/models/interactions/Ranking.java b/src/main/java/com/google/genai/gaos/models/interactions/Ranking.java index cc2042f6e8a..558cd065617 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/Ranking.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/Ranking.java @@ -34,7 +34,7 @@ /** * Ranking * - *

Config for Rank Service. + *

Config for ranking and reranking. */ public class Ranking { /** diff --git a/src/main/java/com/google/genai/gaos/models/interactions/RetrievalCallStep.java b/src/main/java/com/google/genai/gaos/models/interactions/RetrievalCallStep.java new file mode 100644 index 00000000000..486f928e036 --- /dev/null +++ b/src/main/java/com/google/genai/gaos/models/interactions/RetrievalCallStep.java @@ -0,0 +1,263 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.google.genai.gaos.models.interactions; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import com.google.genai.gaos.utils.LazySingletonValue; +import com.google.genai.gaos.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; +import java.lang.Override; +import java.lang.String; +import java.util.Optional; + +/** + * RetrievalCallStep + * + *

Retrieval call step. + * Used by Vertex Retrieval tools such as Parallel AI, Exa AI, Vertex AI Search, + * etc. RetrievalType decides which tool is used. + */ +public class RetrievalCallStep implements Step { + /** + * The arguments to pass to Retrieval tools. + */ + @JsonProperty("arguments") + private RetrievalCallArguments arguments; + + /** + * Required. A unique ID for this specific tool call. + */ + @JsonProperty("id") + private String id; + + /** + * The type of retrieval tools. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("retrieval_type") + private RetrievalCallStepRetrievalType retrievalType; + + /** + * A signature hash for backend validation. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("signature") + private String signature; + + + @JsonProperty("type") + private String type; + + @JsonCreator + public RetrievalCallStep( + @JsonProperty("arguments") @Nonnull RetrievalCallArguments arguments, + @JsonProperty("id") @Nonnull String id, + @JsonProperty("retrieval_type") @Nullable RetrievalCallStepRetrievalType retrievalType, + @JsonProperty("signature") @Nullable String signature) { + this.arguments = Optional.ofNullable(arguments) + .orElseThrow(() -> new IllegalArgumentException("arguments cannot be null")); + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.retrievalType = retrievalType; + this.signature = signature; + this.type = Builder._SINGLETON_VALUE_Type.value(); + } + + public RetrievalCallStep( + @Nonnull RetrievalCallArguments arguments, + @Nonnull String id) { + this(arguments, id, null, + null); + } + + /** + * The arguments to pass to Retrieval tools. + */ + public Optional arguments() { + return Optional.ofNullable(this.arguments); + } + + /** + * Required. A unique ID for this specific tool call. + */ + public Optional id() { + return Optional.ofNullable(this.id); + } + + /** + * The type of retrieval tools. + */ + public Optional retrievalType() { + return Optional.ofNullable(this.retrievalType); + } + + /** + * A signature hash for backend validation. + */ + public Optional signature() { + return Optional.ofNullable(this.signature); + } + + @Override + public String type() { + return Utils.discriminatorToString(type); + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * The arguments to pass to Retrieval tools. + */ + public RetrievalCallStep withArguments(@Nonnull RetrievalCallArguments arguments) { + this.arguments = Utils.checkNotNull(arguments, "arguments"); + return this; + } + + + /** + * Required. A unique ID for this specific tool call. + */ + public RetrievalCallStep withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); + return this; + } + + + /** + * The type of retrieval tools. + */ + public RetrievalCallStep withRetrievalType(@Nullable RetrievalCallStepRetrievalType retrievalType) { + this.retrievalType = retrievalType; + return this; + } + + + /** + * A signature hash for backend validation. + */ + public RetrievalCallStep withSignature(@Nullable String signature) { + this.signature = signature; + return this; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RetrievalCallStep other = (RetrievalCallStep) o; + return + Utils.enhancedDeepEquals(this.arguments, other.arguments) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.retrievalType, other.retrievalType) && + Utils.enhancedDeepEquals(this.signature, other.signature) && + Utils.enhancedDeepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + arguments, id, retrievalType, + signature, type); + } + + @Override + public String toString() { + return Utils.toString(RetrievalCallStep.class, + "arguments", arguments, + "id", id, + "retrievalType", retrievalType, + "signature", signature, + "type", type); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private RetrievalCallArguments arguments; + + private String id; + + private RetrievalCallStepRetrievalType retrievalType; + + private String signature; + + private Builder() { + // force use of static builder() method + } + + /** + * The arguments to pass to Retrieval tools. + */ + public Builder arguments(@Nonnull RetrievalCallArguments arguments) { + this.arguments = Utils.checkNotNull(arguments, "arguments"); + return this; + } + + /** + * Required. A unique ID for this specific tool call. + */ + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); + return this; + } + + /** + * The type of retrieval tools. + */ + public Builder retrievalType(@Nullable RetrievalCallStepRetrievalType retrievalType) { + this.retrievalType = retrievalType; + return this; + } + + /** + * A signature hash for backend validation. + */ + public Builder signature(@Nullable String signature) { + this.signature = signature; + return this; + } + + public RetrievalCallStep build() { + return new RetrievalCallStep( + arguments, id, retrievalType, + signature); + } + + + private static final LazySingletonValue _SINGLETON_VALUE_Type = + new LazySingletonValue<>( + "type", + "\"retrieval_call\"", + new TypeReference() {}); + } +} diff --git a/src/main/java/com/google/genai/gaos/models/interactions/RetrievalCallStepRetrievalType.java b/src/main/java/com/google/genai/gaos/models/interactions/RetrievalCallStepRetrievalType.java new file mode 100644 index 00000000000..79800e08cca --- /dev/null +++ b/src/main/java/com/google/genai/gaos/models/interactions/RetrievalCallStepRetrievalType.java @@ -0,0 +1,156 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.google.genai.gaos.models.interactions; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.lang.Override; +import java.lang.String; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +/** + * Wrapper for an "open" enum that can handle unknown values from API responses + * without runtime errors. Instances are immutable singletons with reference equality. + * Use {@code asEnum()} for switch expressions. + */ +/** + * RetrievalCallStepRetrievalType + * + *

The type of retrieval tools. + */ +public class RetrievalCallStepRetrievalType { + + public static final RetrievalCallStepRetrievalType VERTEX_AI_SEARCH = new RetrievalCallStepRetrievalType("vertex_ai_search"); + public static final RetrievalCallStepRetrievalType RAG_STORE = new RetrievalCallStepRetrievalType("rag_store"); + public static final RetrievalCallStepRetrievalType EXA_AI_SEARCH = new RetrievalCallStepRetrievalType("exa_ai_search"); + public static final RetrievalCallStepRetrievalType PARALLEL_AI_SEARCH = new RetrievalCallStepRetrievalType("parallel_ai_search"); + + // This map will grow whenever a Color gets created with a new + // unrecognized value (a potential memory leak if the user is not + // careful). Keep this field lower case to avoid clashing with + // generated member names which will always be upper cased (Java + // convention) + private static final Map values = createValuesMap(); + private static final Map enums = createEnumsMap(); + + private final String value; + + private RetrievalCallStepRetrievalType(String value) { + this.value = value; + } + + /** + * Returns a RetrievalCallStepRetrievalType with the given value. For a specific value the + * returned object will always be a singleton so reference equality + * is satisfied when the values are the same. + * + * @param value value to be wrapped as RetrievalCallStepRetrievalType + */ + @JsonCreator + public static RetrievalCallStepRetrievalType of(String value) { + synchronized (RetrievalCallStepRetrievalType.class) { + return values.computeIfAbsent(value, v -> new RetrievalCallStepRetrievalType(v)); + } + } + + @JsonValue + public String value() { + return value; + } + + public Optional asEnum() { + return Optional.ofNullable(enums.getOrDefault(value, null)); + } + + public boolean isKnown() { + return asEnum().isPresent(); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public boolean equals(java.lang.Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + RetrievalCallStepRetrievalType other = (RetrievalCallStepRetrievalType) obj; + return Objects.equals(value, other.value); + } + + @Override + public String toString() { + return "RetrievalCallStepRetrievalType [value=" + value + "]"; + } + + // return an array just like an enum + public static RetrievalCallStepRetrievalType[] values() { + synchronized (RetrievalCallStepRetrievalType.class) { + return values.values().toArray(new RetrievalCallStepRetrievalType[] {}); + } + } + + private static final Map createValuesMap() { + Map map = new LinkedHashMap<>(); + map.put("vertex_ai_search", VERTEX_AI_SEARCH); + map.put("rag_store", RAG_STORE); + map.put("exa_ai_search", EXA_AI_SEARCH); + map.put("parallel_ai_search", PARALLEL_AI_SEARCH); + return map; + } + + private static final Map createEnumsMap() { + Map map = new HashMap<>(); + map.put("vertex_ai_search", RetrievalCallStepRetrievalTypeEnum.VERTEX_AI_SEARCH); + map.put("rag_store", RetrievalCallStepRetrievalTypeEnum.RAG_STORE); + map.put("exa_ai_search", RetrievalCallStepRetrievalTypeEnum.EXA_AI_SEARCH); + map.put("parallel_ai_search", RetrievalCallStepRetrievalTypeEnum.PARALLEL_AI_SEARCH); + return map; + } + + + public enum RetrievalCallStepRetrievalTypeEnum { + + VERTEX_AI_SEARCH("vertex_ai_search"), + RAG_STORE("rag_store"), + EXA_AI_SEARCH("exa_ai_search"), + PARALLEL_AI_SEARCH("parallel_ai_search"),; + + private final String value; + + private RetrievalCallStepRetrievalTypeEnum(String value) { + this.value = value; + } + + public String value() { + return value; + } + } +} + diff --git a/src/main/java/com/google/genai/gaos/models/interactions/RetrievalResultStep.java b/src/main/java/com/google/genai/gaos/models/interactions/RetrievalResultStep.java new file mode 100644 index 00000000000..a735bf7c5aa --- /dev/null +++ b/src/main/java/com/google/genai/gaos/models/interactions/RetrievalResultStep.java @@ -0,0 +1,224 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.google.genai.gaos.models.interactions; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import com.google.genai.gaos.utils.LazySingletonValue; +import com.google.genai.gaos.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; +import java.lang.Boolean; +import java.lang.Override; +import java.lang.String; +import java.util.Optional; + +/** + * RetrievalResultStep + * + *

Vertex Retrieval result step. + * Used by Vertex Retrieval tools such as Parallel AI, Exa AI, Vertex AI Search, + * etc. + */ +public class RetrievalResultStep implements Step { + /** + * Required. ID to match the ID from the function call block. + */ + @JsonProperty("call_id") + private String callId; + + /** + * Whether the retrieval resulted in an error. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("is_error") + private Boolean isError; + + /** + * A signature hash for backend validation. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("signature") + private String signature; + + + @JsonProperty("type") + private String type; + + @JsonCreator + public RetrievalResultStep( + @JsonProperty("call_id") @Nonnull String callId, + @JsonProperty("is_error") @Nullable Boolean isError, + @JsonProperty("signature") @Nullable String signature) { + this.callId = Optional.ofNullable(callId) + .orElseThrow(() -> new IllegalArgumentException("callId cannot be null")); + this.isError = isError; + this.signature = signature; + this.type = Builder._SINGLETON_VALUE_Type.value(); + } + + public RetrievalResultStep( + @Nonnull String callId) { + this(callId, null, null); + } + + /** + * Required. ID to match the ID from the function call block. + */ + public Optional callId() { + return Optional.ofNullable(this.callId); + } + + /** + * Whether the retrieval resulted in an error. + */ + public Optional isError() { + return Optional.ofNullable(this.isError); + } + + /** + * A signature hash for backend validation. + */ + public Optional signature() { + return Optional.ofNullable(this.signature); + } + + @Override + public String type() { + return Utils.discriminatorToString(type); + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Required. ID to match the ID from the function call block. + */ + public RetrievalResultStep withCallId(@Nonnull String callId) { + this.callId = Utils.checkNotNull(callId, "callId"); + return this; + } + + + /** + * Whether the retrieval resulted in an error. + */ + public RetrievalResultStep withIsError(@Nullable Boolean isError) { + this.isError = isError; + return this; + } + + + /** + * A signature hash for backend validation. + */ + public RetrievalResultStep withSignature(@Nullable String signature) { + this.signature = signature; + return this; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RetrievalResultStep other = (RetrievalResultStep) o; + return + Utils.enhancedDeepEquals(this.callId, other.callId) && + Utils.enhancedDeepEquals(this.isError, other.isError) && + Utils.enhancedDeepEquals(this.signature, other.signature) && + Utils.enhancedDeepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + callId, isError, signature, + type); + } + + @Override + public String toString() { + return Utils.toString(RetrievalResultStep.class, + "callId", callId, + "isError", isError, + "signature", signature, + "type", type); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String callId; + + private Boolean isError; + + private String signature; + + private Builder() { + // force use of static builder() method + } + + /** + * Required. ID to match the ID from the function call block. + */ + public Builder callId(@Nonnull String callId) { + this.callId = Utils.checkNotNull(callId, "callId"); + return this; + } + + /** + * Whether the retrieval resulted in an error. + */ + public Builder isError(@Nullable Boolean isError) { + this.isError = isError; + return this; + } + + /** + * A signature hash for backend validation. + */ + public Builder signature(@Nullable String signature) { + this.signature = signature; + return this; + } + + public RetrievalResultStep build() { + return new RetrievalResultStep( + callId, isError, signature); + } + + + private static final LazySingletonValue _SINGLETON_VALUE_Type = + new LazySingletonValue<>( + "type", + "\"retrieval_result\"", + new TypeReference() {}); + } +} diff --git a/src/main/java/com/google/genai/gaos/models/interactions/StepStart.java b/src/main/java/com/google/genai/gaos/models/interactions/StepStart.java index c5edd26e50a..bdfcd6647e3 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/StepStart.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/StepStart.java @@ -51,6 +51,13 @@ public class StepStart implements InteractionSSEEvent { @JsonProperty("index") private int index; + /** + * Optional metadata accompanying ANY streamed event. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private StreamMetadata metadata; + /** * A step in the interaction. */ @@ -61,10 +68,12 @@ public class StepStart implements InteractionSSEEvent { public StepStart( @JsonProperty("event_id") @Nullable String eventId, @JsonProperty("index") int index, + @JsonProperty("metadata") @Nullable StreamMetadata metadata, @JsonProperty("step") @Nonnull Step step) { this.eventId = eventId; this.eventType = Builder._SINGLETON_VALUE_EventType.value(); this.index = index; + this.metadata = metadata; this.step = Optional.ofNullable(step) .orElseThrow(() -> new IllegalArgumentException("step cannot be null")); } @@ -72,7 +81,8 @@ public StepStart( public StepStart( int index, @Nonnull Step step) { - this(null, index, step); + this(null, index, null, + step); } /** @@ -92,6 +102,13 @@ public Optional index() { return Optional.ofNullable(this.index); } + /** + * Optional metadata accompanying ANY streamed event. + */ + public Optional metadata() { + return Optional.ofNullable(this.metadata); + } + /** * A step in the interaction. */ @@ -120,6 +137,15 @@ public StepStart withIndex(int index) { } + /** + * Optional metadata accompanying ANY streamed event. + */ + public StepStart withMetadata(@Nullable StreamMetadata metadata) { + this.metadata = metadata; + return this; + } + + /** * A step in the interaction. */ @@ -142,6 +168,7 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.eventId, other.eventId) && Utils.enhancedDeepEquals(this.eventType, other.eventType) && Utils.enhancedDeepEquals(this.index, other.index) && + Utils.enhancedDeepEquals(this.metadata, other.metadata) && Utils.enhancedDeepEquals(this.step, other.step); } @@ -149,7 +176,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Utils.enhancedHash( eventId, eventType, index, - step); + metadata, step); } @Override @@ -158,6 +185,7 @@ public String toString() { "eventId", eventId, "eventType", eventType, "index", index, + "metadata", metadata, "step", step); } @@ -168,6 +196,8 @@ public final static class Builder { private int index; + private StreamMetadata metadata; + private Step step; private Builder() { @@ -188,6 +218,14 @@ public Builder index(int index) { return this; } + /** + * Optional metadata accompanying ANY streamed event. + */ + public Builder metadata(@Nullable StreamMetadata metadata) { + this.metadata = metadata; + return this; + } + /** * A step in the interaction. */ @@ -198,7 +236,8 @@ public Builder step(@Nonnull Step step) { public StepStart build() { return new StepStart( - eventId, index, step); + eventId, index, metadata, + step); } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/StepStop.java b/src/main/java/com/google/genai/gaos/models/interactions/StepStop.java index ce5888633b3..a71df14de72 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/StepStop.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/StepStop.java @@ -50,6 +50,13 @@ public class StepStop implements InteractionSSEEvent { @JsonProperty("index") private int index; + /** + * Optional metadata accompanying ANY streamed event. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private StreamMetadata metadata; + /** * Statistics on the interaction request's token usage. */ @@ -68,11 +75,13 @@ public class StepStop implements InteractionSSEEvent { public StepStop( @JsonProperty("event_id") @Nullable String eventId, @JsonProperty("index") int index, + @JsonProperty("metadata") @Nullable StreamMetadata metadata, @JsonProperty("step_usage") @Nullable Usage stepUsage, @JsonProperty("usage") @Nullable Usage usage) { this.eventId = eventId; this.eventType = Builder._SINGLETON_VALUE_EventType.value(); this.index = index; + this.metadata = metadata; this.stepUsage = stepUsage; this.usage = usage; } @@ -80,7 +89,7 @@ public StepStop( public StepStop( int index) { this(null, index, null, - null); + null, null); } /** @@ -100,6 +109,13 @@ public Optional index() { return Optional.ofNullable(this.index); } + /** + * Optional metadata accompanying ANY streamed event. + */ + public Optional metadata() { + return Optional.ofNullable(this.metadata); + } + /** * Statistics on the interaction request's token usage. */ @@ -135,6 +151,15 @@ public StepStop withIndex(int index) { } + /** + * Optional metadata accompanying ANY streamed event. + */ + public StepStop withMetadata(@Nullable StreamMetadata metadata) { + this.metadata = metadata; + return this; + } + + /** * Statistics on the interaction request's token usage. */ @@ -166,6 +191,7 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.eventId, other.eventId) && Utils.enhancedDeepEquals(this.eventType, other.eventType) && Utils.enhancedDeepEquals(this.index, other.index) && + Utils.enhancedDeepEquals(this.metadata, other.metadata) && Utils.enhancedDeepEquals(this.stepUsage, other.stepUsage) && Utils.enhancedDeepEquals(this.usage, other.usage); } @@ -174,7 +200,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Utils.enhancedHash( eventId, eventType, index, - stepUsage, usage); + metadata, stepUsage, usage); } @Override @@ -183,6 +209,7 @@ public String toString() { "eventId", eventId, "eventType", eventType, "index", index, + "metadata", metadata, "stepUsage", stepUsage, "usage", usage); } @@ -194,6 +221,8 @@ public final static class Builder { private int index; + private StreamMetadata metadata; + private Usage stepUsage; private Usage usage; @@ -216,6 +245,14 @@ public Builder index(int index) { return this; } + /** + * Optional metadata accompanying ANY streamed event. + */ + public Builder metadata(@Nullable StreamMetadata metadata) { + this.metadata = metadata; + return this; + } + /** * Statistics on the interaction request's token usage. */ @@ -234,8 +271,8 @@ public Builder usage(@Nullable Usage usage) { public StepStop build() { return new StepStop( - eventId, index, stepUsage, - usage); + eventId, index, metadata, + stepUsage, usage); } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/StepTypeIdResolver.java b/src/main/java/com/google/genai/gaos/models/interactions/StepTypeIdResolver.java index 5907cd4b630..148a83eabb7 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/StepTypeIdResolver.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/StepTypeIdResolver.java @@ -55,6 +55,8 @@ private void initializeTypeMap() { registerType("model_output", ModelOutputStep.class); registerType("processing_call", ProcessingCallStep.class); registerType("processing_result", ProcessingResultStep.class); + registerType("retrieval_call", RetrievalCallStep.class); + registerType("retrieval_result", RetrievalResultStep.class); registerType("thought", ThoughtStep.class); registerType("url_context_call", URLContextCallStep.class); registerType("url_context_result", URLContextResultStep.class); diff --git a/src/main/java/com/google/genai/gaos/models/interactions/StreamMetadata.java b/src/main/java/com/google/genai/gaos/models/interactions/StreamMetadata.java new file mode 100644 index 00000000000..7ac1796e756 --- /dev/null +++ b/src/main/java/com/google/genai/gaos/models/interactions/StreamMetadata.java @@ -0,0 +1,124 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.google.genai.gaos.models.interactions; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.genai.gaos.utils.Utils; +import jakarta.annotation.Nullable; +import java.lang.Override; +import java.lang.String; +import java.util.Optional; + +/** + * StreamMetadata + * + *

Optional metadata accompanying ANY streamed event. + */ +public class StreamMetadata { + /** + * Statistics on the interaction request's token usage. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("total_usage") + private Usage totalUsage; + + @JsonCreator + public StreamMetadata( + @JsonProperty("total_usage") @Nullable Usage totalUsage) { + this.totalUsage = totalUsage; + } + + public StreamMetadata() { + this(null); + } + + /** + * Statistics on the interaction request's token usage. + */ + public Optional totalUsage() { + return Optional.ofNullable(this.totalUsage); + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Statistics on the interaction request's token usage. + */ + public StreamMetadata withTotalUsage(@Nullable Usage totalUsage) { + this.totalUsage = totalUsage; + return this; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StreamMetadata other = (StreamMetadata) o; + return + Utils.enhancedDeepEquals(this.totalUsage, other.totalUsage); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + totalUsage); + } + + @Override + public String toString() { + return Utils.toString(StreamMetadata.class, + "totalUsage", totalUsage); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Usage totalUsage; + + private Builder() { + // force use of static builder() method + } + + /** + * Statistics on the interaction request's token usage. + */ + public Builder totalUsage(@Nullable Usage totalUsage) { + this.totalUsage = totalUsage; + return this; + } + + public StreamMetadata build() { + return new StreamMetadata( + totalUsage); + } + + } +} diff --git a/src/main/java/com/google/genai/gaos/models/interactions/TranscriptionConfig.java b/src/main/java/com/google/genai/gaos/models/interactions/TranscriptionConfig.java index 4175d93d034..763b1d59c48 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/TranscriptionConfig.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/TranscriptionConfig.java @@ -73,6 +73,17 @@ public class TranscriptionConfig { @JsonProperty("language_codes") private List languageCodes; + /** + * Deprecated: use language_codes. BCP-47 language codes providing hints about the languages present in + * the audio. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("language_hints") + @Deprecated + private List languageHints; + /** * Discriminated transcription mode options or enum. */ @@ -97,19 +108,22 @@ public TranscriptionConfig( @JsonProperty("custom_vocabulary") @Nullable List customVocabulary, @JsonProperty("diarization_mode") @Nullable String diarizationMode, @JsonProperty("language_codes") @Nullable List languageCodes, + @JsonProperty("language_hints") @Nullable List languageHints, @JsonProperty("mode") @Nullable TranscriptionConfigMode mode, @JsonProperty("timestamp_granularities") @Nullable List timestampGranularities) { this.adaptationPhrases = adaptationPhrases; this.customVocabulary = customVocabulary; this.diarizationMode = diarizationMode; this.languageCodes = languageCodes; + this.languageHints = languageHints; this.mode = mode; this.timestampGranularities = timestampGranularities; } public TranscriptionConfig() { this(null, null, null, - null, null, null); + null, null, null, + null); } /** @@ -148,6 +162,17 @@ public Optional> languageCodes() { return Optional.ofNullable(this.languageCodes); } + /** + * Deprecated: use language_codes. BCP-47 language codes providing hints about the languages present in + * the audio. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Optional> languageHints() { + return Optional.ofNullable(this.languageHints); + } + /** * Discriminated transcription mode options or enum. */ @@ -215,6 +240,19 @@ public TranscriptionConfig withLanguageCodes(@Nullable List languageCode } + /** + * Deprecated: use language_codes. BCP-47 language codes providing hints about the languages present in + * the audio. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public TranscriptionConfig withLanguageHints(@Nullable List languageHints) { + this.languageHints = languageHints; + return this; + } + + /** * Discriminated transcription mode options or enum. */ @@ -251,6 +289,7 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.customVocabulary, other.customVocabulary) && Utils.enhancedDeepEquals(this.diarizationMode, other.diarizationMode) && Utils.enhancedDeepEquals(this.languageCodes, other.languageCodes) && + Utils.enhancedDeepEquals(this.languageHints, other.languageHints) && Utils.enhancedDeepEquals(this.mode, other.mode) && Utils.enhancedDeepEquals(this.timestampGranularities, other.timestampGranularities); } @@ -259,7 +298,8 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Utils.enhancedHash( adaptationPhrases, customVocabulary, diarizationMode, - languageCodes, mode, timestampGranularities); + languageCodes, languageHints, mode, + timestampGranularities); } @Override @@ -269,6 +309,7 @@ public String toString() { "customVocabulary", customVocabulary, "diarizationMode", diarizationMode, "languageCodes", languageCodes, + "languageHints", languageHints, "mode", mode, "timestampGranularities", timestampGranularities); } @@ -286,6 +327,9 @@ public final static class Builder { private List languageCodes; + @Deprecated + private List languageHints; + private TranscriptionConfigMode mode; @Deprecated @@ -335,6 +379,18 @@ public Builder languageCodes(@Nullable List languageCodes) { return this; } + /** + * Deprecated: use language_codes. BCP-47 language codes providing hints about the languages present in + * the audio. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder languageHints(@Nullable List languageHints) { + this.languageHints = languageHints; + return this; + } + /** * Discriminated transcription mode options or enum. */ @@ -358,7 +414,8 @@ public Builder timestampGranularities(@Nullable List timestampGranularit public TranscriptionConfig build() { return new TranscriptionConfig( adaptationPhrases, customVocabulary, diarizationMode, - languageCodes, mode, timestampGranularities); + languageCodes, languageHints, mode, + timestampGranularities); } } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/URLContextCallDelta.java b/src/main/java/com/google/genai/gaos/models/interactions/URLContextCallDelta.java index 5ef0265b5ee..c7d9e10eb10 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/URLContextCallDelta.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/URLContextCallDelta.java @@ -40,6 +40,13 @@ public class URLContextCallDelta implements StepDeltaData { @JsonProperty("arguments") private URLContextCallArguments arguments; + /** + * Required. A unique ID for this specific tool call. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private String id; + /** * A signature hash for backend validation. */ @@ -54,16 +61,18 @@ public class URLContextCallDelta implements StepDeltaData { @JsonCreator public URLContextCallDelta( @JsonProperty("arguments") @Nonnull URLContextCallArguments arguments, + @JsonProperty("id") @Nullable String id, @JsonProperty("signature") @Nullable String signature) { this.arguments = Optional.ofNullable(arguments) .orElseThrow(() -> new IllegalArgumentException("arguments cannot be null")); + this.id = id; this.signature = signature; this.type = Builder._SINGLETON_VALUE_Type.value(); } public URLContextCallDelta( @Nonnull URLContextCallArguments arguments) { - this(arguments, null); + this(arguments, null, null); } /** @@ -73,6 +82,13 @@ public Optional arguments() { return Optional.ofNullable(this.arguments); } + /** + * Required. A unique ID for this specific tool call. + */ + public Optional id() { + return Optional.ofNullable(this.id); + } + /** * A signature hash for backend validation. */ @@ -99,6 +115,15 @@ public URLContextCallDelta withArguments(@Nonnull URLContextCallArguments argume } + /** + * Required. A unique ID for this specific tool call. + */ + public URLContextCallDelta withId(@Nullable String id) { + this.id = id; + return this; + } + + /** * A signature hash for backend validation. */ @@ -119,6 +144,7 @@ public boolean equals(java.lang.Object o) { URLContextCallDelta other = (URLContextCallDelta) o; return Utils.enhancedDeepEquals(this.arguments, other.arguments) && + Utils.enhancedDeepEquals(this.id, other.id) && Utils.enhancedDeepEquals(this.signature, other.signature) && Utils.enhancedDeepEquals(this.type, other.type); } @@ -126,13 +152,15 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { return Utils.enhancedHash( - arguments, signature, type); + arguments, id, signature, + type); } @Override public String toString() { return Utils.toString(URLContextCallDelta.class, "arguments", arguments, + "id", id, "signature", signature, "type", type); } @@ -142,6 +170,8 @@ public final static class Builder { private URLContextCallArguments arguments; + private String id; + private String signature; private Builder() { @@ -156,6 +186,14 @@ public Builder arguments(@Nonnull URLContextCallArguments arguments) { return this; } + /** + * Required. A unique ID for this specific tool call. + */ + public Builder id(@Nullable String id) { + this.id = id; + return this; + } + /** * A signature hash for backend validation. */ @@ -166,7 +204,7 @@ public Builder signature(@Nullable String signature) { public URLContextCallDelta build() { return new URLContextCallDelta( - arguments, signature); + arguments, id, signature); } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/URLContextResultDelta.java b/src/main/java/com/google/genai/gaos/models/interactions/URLContextResultDelta.java index 385a8c5e103..2734da84ed8 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/URLContextResultDelta.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/URLContextResultDelta.java @@ -36,6 +36,13 @@ public class URLContextResultDelta implements StepDeltaData { + /** + * Required. ID to match the ID from the function call block. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("call_id") + private String callId; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("is_error") @@ -58,9 +65,11 @@ public class URLContextResultDelta implements StepDeltaData { @JsonCreator public URLContextResultDelta( + @JsonProperty("call_id") @Nullable String callId, @JsonProperty("is_error") @Nullable Boolean isError, @JsonProperty("result") @Nonnull List result, @JsonProperty("signature") @Nullable String signature) { + this.callId = callId; this.isError = isError; this.result = Optional.ofNullable(result) .orElseThrow(() -> new IllegalArgumentException("result cannot be null")); @@ -70,7 +79,15 @@ public URLContextResultDelta( public URLContextResultDelta( @Nonnull List result) { - this(null, result, null); + this(null, null, result, + null); + } + + /** + * Required. ID to match the ID from the function call block. + */ + public Optional callId() { + return Optional.ofNullable(this.callId); } public Optional isError() { @@ -98,6 +115,15 @@ public static Builder builder() { } + /** + * Required. ID to match the ID from the function call block. + */ + public URLContextResultDelta withCallId(@Nullable String callId) { + this.callId = callId; + return this; + } + + public URLContextResultDelta withIsError(@Nullable Boolean isError) { this.isError = isError; return this; @@ -129,6 +155,7 @@ public boolean equals(java.lang.Object o) { } URLContextResultDelta other = (URLContextResultDelta) o; return + Utils.enhancedDeepEquals(this.callId, other.callId) && Utils.enhancedDeepEquals(this.isError, other.isError) && Utils.enhancedDeepEquals(this.result, other.result) && Utils.enhancedDeepEquals(this.signature, other.signature) && @@ -138,13 +165,14 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { return Utils.enhancedHash( - isError, result, signature, - type); + callId, isError, result, + signature, type); } @Override public String toString() { return Utils.toString(URLContextResultDelta.class, + "callId", callId, "isError", isError, "result", result, "signature", signature, @@ -154,6 +182,8 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { + private String callId; + private Boolean isError; private List result; @@ -164,6 +194,14 @@ private Builder() { // force use of static builder() method } + /** + * Required. ID to match the ID from the function call block. + */ + public Builder callId(@Nullable String callId) { + this.callId = callId; + return this; + } + public Builder isError(@Nullable Boolean isError) { this.isError = isError; return this; @@ -184,7 +222,8 @@ public Builder signature(@Nullable String signature) { public URLContextResultDelta build() { return new URLContextResultDelta( - isError, result, signature); + callId, isError, result, + signature); } diff --git a/src/main/java/com/google/genai/gaos/models/interactions/UnknownCreateAgentInteractionAgentConfig.java b/src/main/java/com/google/genai/gaos/models/interactions/UnknownCreateAgentInteractionAgentConfig.java index 71d4734f508..0fc759972bc 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/UnknownCreateAgentInteractionAgentConfig.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/UnknownCreateAgentInteractionAgentConfig.java @@ -30,7 +30,7 @@ /** * UnknownCreateAgentInteractionAgentConfig * - *

Configuration parameters for the agent interaction. + *

Parameters for the agent interaction. */ public class UnknownCreateAgentInteractionAgentConfig extends UnknownType implements CreateAgentInteractionAgentConfig { diff --git a/src/main/java/com/google/genai/gaos/models/interactions/UnknownInteractionAgentConfig.java b/src/main/java/com/google/genai/gaos/models/interactions/UnknownInteractionAgentConfig.java index 8447a6fd56d..fc113d15e03 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/UnknownInteractionAgentConfig.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/UnknownInteractionAgentConfig.java @@ -30,7 +30,7 @@ /** * UnknownInteractionAgentConfig * - *

Configuration parameters for the agent interaction. + *

Parameters for the agent interaction. */ public class UnknownInteractionAgentConfig extends UnknownType implements InteractionAgentConfig { diff --git a/src/main/java/com/google/genai/gaos/models/operations/CancelInteractionByIdRequest.java b/src/main/java/com/google/genai/gaos/models/operations/CancelInteractionByIdRequest.java index 323a3632231..eadd4216f0b 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/CancelInteractionByIdRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/CancelInteractionByIdRequest.java @@ -31,15 +31,16 @@ public class CancelInteractionByIdRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; /** - * The unique identifier of the interaction to cancel. + * Part of `name`. Required. The name of the interaction to cancel. + * Format: `interactions/{interaction}`. */ - @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=id") + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=interactionsId") private String id; @JsonCreator @@ -57,14 +58,15 @@ public CancelInteractionByIdRequest( } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); } /** - * The unique identifier of the interaction to cancel. + * Part of `name`. Required. The name of the interaction to cancel. + * Format: `interactions/{interaction}`. */ public Optional id() { return Optional.ofNullable(this.id); @@ -76,7 +78,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public CancelInteractionByIdRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -85,7 +87,8 @@ public CancelInteractionByIdRequest withApiVersion(@Nullable String apiVersion) /** - * The unique identifier of the interaction to cancel. + * Part of `name`. Required. The name of the interaction to cancel. + * Format: `interactions/{interaction}`. */ public CancelInteractionByIdRequest withId(@Nonnull String id) { this.id = Utils.checkNotNull(id, "id"); @@ -132,7 +135,7 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -140,7 +143,8 @@ public Builder apiVersion(@Nullable String apiVersion) { } /** - * The unique identifier of the interaction to cancel. + * Part of `name`. Required. The name of the interaction to cancel. + * Format: `interactions/{interaction}`. */ public Builder id(@Nonnull String id) { this.id = Utils.checkNotNull(id, "id"); diff --git a/src/main/java/com/google/genai/gaos/models/operations/CancelInteractionByIdResponse.java b/src/main/java/com/google/genai/gaos/models/operations/CancelInteractionByIdResponse.java index f1c3ef3f8e6..71e1e53b9d9 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/CancelInteractionByIdResponse.java +++ b/src/main/java/com/google/genai/gaos/models/operations/CancelInteractionByIdResponse.java @@ -49,7 +49,7 @@ public class CancelInteractionByIdResponse implements Response { private HttpResponse rawResponse; /** - * Successful cancellation of the interaction. + * Successful operation */ private Interaction interaction; @@ -100,7 +100,7 @@ public HttpResponse rawResponse() { } /** - * Successful cancellation of the interaction. + * Successful operation */ public Optional interaction() { return Optional.ofNullable(this.interaction); @@ -139,7 +139,7 @@ public CancelInteractionByIdResponse withRawResponse(@Nonnull HttpResponse rawResponse) { } /** - * Successful cancellation of the interaction. + * Successful operation */ public Builder interaction(@Nullable Interaction interaction) { this.interaction = interaction; diff --git a/src/main/java/com/google/genai/gaos/models/operations/CreateAgentRequest.java b/src/main/java/com/google/genai/gaos/models/operations/CreateAgentRequest.java index ceb8926f228..beee728f0a9 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/CreateAgentRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/CreateAgentRequest.java @@ -32,14 +32,12 @@ public class CreateAgentRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; - /** - * The request body. - */ + @SpeakeasyMetadata("request:mediaType=application/json") private Agent body; @@ -58,15 +56,12 @@ public CreateAgentRequest( } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); } - /** - * The request body. - */ public Optional body() { return Optional.ofNullable(this.body); } @@ -77,7 +72,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public CreateAgentRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -85,9 +80,6 @@ public CreateAgentRequest withApiVersion(@Nullable String apiVersion) { } - /** - * The request body. - */ public CreateAgentRequest withBody(@Nonnull Agent body) { this.body = Utils.checkNotNull(body, "body"); return this; @@ -133,16 +125,13 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; return this; } - /** - * The request body. - */ public Builder body(@Nonnull Agent body) { this.body = Utils.checkNotNull(body, "body"); return this; diff --git a/src/main/java/com/google/genai/gaos/models/operations/CreateEnvironmentRequest.java b/src/main/java/com/google/genai/gaos/models/operations/CreateEnvironmentRequest.java index f9385861d07..2ae91816ff2 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/CreateEnvironmentRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/CreateEnvironmentRequest.java @@ -31,13 +31,13 @@ public class CreateEnvironmentRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; /** - * Required. The environment to create. + * Required. The environment to create (HTTP request body). */ @SpeakeasyMetadata("request:mediaType=application/json") private com.google.genai.gaos.models.environments.CreateEnvironmentRequest body; @@ -57,14 +57,14 @@ public CreateEnvironmentRequest( } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); } /** - * Required. The environment to create. + * Required. The environment to create (HTTP request body). */ public Optional body() { return Optional.ofNullable(this.body); @@ -76,7 +76,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public CreateEnvironmentRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -85,7 +85,7 @@ public CreateEnvironmentRequest withApiVersion(@Nullable String apiVersion) { /** - * Required. The environment to create. + * Required. The environment to create (HTTP request body). */ public CreateEnvironmentRequest withBody(@Nonnull com.google.genai.gaos.models.environments.CreateEnvironmentRequest body) { this.body = Utils.checkNotNull(body, "body"); @@ -132,7 +132,7 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -140,7 +140,7 @@ public Builder apiVersion(@Nullable String apiVersion) { } /** - * Required. The environment to create. + * Required. The environment to create (HTTP request body). */ public Builder body(@Nonnull com.google.genai.gaos.models.environments.CreateEnvironmentRequest body) { this.body = Utils.checkNotNull(body, "body"); diff --git a/src/main/java/com/google/genai/gaos/models/operations/CreateInteractionRequest.java b/src/main/java/com/google/genai/gaos/models/operations/CreateInteractionRequest.java index 6ee0bd750fd..be8d84521b7 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/CreateInteractionRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/CreateInteractionRequest.java @@ -31,7 +31,7 @@ public class CreateInteractionRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; @@ -57,7 +57,7 @@ public CreateInteractionRequest( } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); @@ -76,7 +76,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public CreateInteractionRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -132,7 +132,7 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; diff --git a/src/main/java/com/google/genai/gaos/models/operations/CreateTriggerRequest.java b/src/main/java/com/google/genai/gaos/models/operations/CreateTriggerRequest.java index 8508387e89d..0bfbdde54c6 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/CreateTriggerRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/CreateTriggerRequest.java @@ -32,12 +32,14 @@ public class CreateTriggerRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; - + /** + * Required. The trigger configuration to create. + */ @SpeakeasyMetadata("request:mediaType=application/json") private TriggerCreateParams body; @@ -56,12 +58,15 @@ public CreateTriggerRequest( } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); } + /** + * Required. The trigger configuration to create. + */ public Optional body() { return Optional.ofNullable(this.body); } @@ -72,7 +77,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public CreateTriggerRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -80,6 +85,9 @@ public CreateTriggerRequest withApiVersion(@Nullable String apiVersion) { } + /** + * Required. The trigger configuration to create. + */ public CreateTriggerRequest withBody(@Nonnull TriggerCreateParams body) { this.body = Utils.checkNotNull(body, "body"); return this; @@ -125,13 +133,16 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; return this; } + /** + * Required. The trigger configuration to create. + */ public Builder body(@Nonnull TriggerCreateParams body) { this.body = Utils.checkNotNull(body, "body"); return this; diff --git a/src/main/java/com/google/genai/gaos/models/operations/CreateWebhookRequest.java b/src/main/java/com/google/genai/gaos/models/operations/CreateWebhookRequest.java index 6c9c3c33922..2ad76c0d649 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/CreateWebhookRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/CreateWebhookRequest.java @@ -32,13 +32,13 @@ public class CreateWebhookRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; /** - * Required. The webhook to create. + * Required. The HTTP body of the payload. */ @SpeakeasyMetadata("request:mediaType=application/json") private WebhookInput body; @@ -58,14 +58,14 @@ public CreateWebhookRequest( } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); } /** - * Required. The webhook to create. + * Required. The HTTP body of the payload. */ public Optional body() { return Optional.ofNullable(this.body); @@ -77,7 +77,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public CreateWebhookRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -86,7 +86,7 @@ public CreateWebhookRequest withApiVersion(@Nullable String apiVersion) { /** - * Required. The webhook to create. + * Required. The HTTP body of the payload. */ public CreateWebhookRequest withBody(@Nonnull WebhookInput body) { this.body = Utils.checkNotNull(body, "body"); @@ -133,7 +133,7 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -141,7 +141,7 @@ public Builder apiVersion(@Nullable String apiVersion) { } /** - * Required. The webhook to create. + * Required. The HTTP body of the payload. */ public Builder body(@Nonnull WebhookInput body) { this.body = Utils.checkNotNull(body, "body"); diff --git a/src/main/java/com/google/genai/gaos/models/operations/DeleteAgentRequest.java b/src/main/java/com/google/genai/gaos/models/operations/DeleteAgentRequest.java index a3e16c96615..08567050793 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/DeleteAgentRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/DeleteAgentRequest.java @@ -31,13 +31,15 @@ public class DeleteAgentRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; - - @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=id") + /** + * Part of `name`. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=agentsId") private String id; @JsonCreator @@ -55,12 +57,15 @@ public DeleteAgentRequest( } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); } + /** + * Part of `name`. + */ public Optional id() { return Optional.ofNullable(this.id); } @@ -71,7 +76,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public DeleteAgentRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -79,6 +84,9 @@ public DeleteAgentRequest withApiVersion(@Nullable String apiVersion) { } + /** + * Part of `name`. + */ public DeleteAgentRequest withId(@Nonnull String id) { this.id = Utils.checkNotNull(id, "id"); return this; @@ -124,13 +132,16 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; return this; } + /** + * Part of `name`. + */ public Builder id(@Nonnull String id) { this.id = Utils.checkNotNull(id, "id"); return this; diff --git a/src/main/java/com/google/genai/gaos/models/operations/DeleteEnvironmentRequest.java b/src/main/java/com/google/genai/gaos/models/operations/DeleteEnvironmentRequest.java index 099e11557f3..e2c2715aa70 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/DeleteEnvironmentRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/DeleteEnvironmentRequest.java @@ -31,14 +31,13 @@ public class DeleteEnvironmentRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; /** - * Resource ID segment making up resource `name`. It identifies the resource within its parent - * collection as described in https://google.aip.dev/122. + * Required. The identifier of the environment to delete. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=id") private String id; @@ -58,15 +57,14 @@ public DeleteEnvironmentRequest( } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); } /** - * Resource ID segment making up resource `name`. It identifies the resource within its parent - * collection as described in https://google.aip.dev/122. + * Required. The identifier of the environment to delete. */ public Optional id() { return Optional.ofNullable(this.id); @@ -78,7 +76,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public DeleteEnvironmentRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -87,8 +85,7 @@ public DeleteEnvironmentRequest withApiVersion(@Nullable String apiVersion) { /** - * Resource ID segment making up resource `name`. It identifies the resource within its parent - * collection as described in https://google.aip.dev/122. + * Required. The identifier of the environment to delete. */ public DeleteEnvironmentRequest withId(@Nonnull String id) { this.id = Utils.checkNotNull(id, "id"); @@ -135,7 +132,7 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -143,8 +140,7 @@ public Builder apiVersion(@Nullable String apiVersion) { } /** - * Resource ID segment making up resource `name`. It identifies the resource within its parent - * collection as described in https://google.aip.dev/122. + * Required. The identifier of the environment to delete. */ public Builder id(@Nonnull String id) { this.id = Utils.checkNotNull(id, "id"); diff --git a/src/main/java/com/google/genai/gaos/models/operations/DeleteInteractionRequest.java b/src/main/java/com/google/genai/gaos/models/operations/DeleteInteractionRequest.java index 55e2ebb26e1..e2ff75c55d3 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/DeleteInteractionRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/DeleteInteractionRequest.java @@ -31,15 +31,16 @@ public class DeleteInteractionRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; /** - * The unique identifier of the interaction to delete. + * Part of `name`. Required. The name of the interaction to delete. + * Format: interactions/{interaction} */ - @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=id") + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=interactionsId") private String id; @JsonCreator @@ -57,14 +58,15 @@ public DeleteInteractionRequest( } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); } /** - * The unique identifier of the interaction to delete. + * Part of `name`. Required. The name of the interaction to delete. + * Format: interactions/{interaction} */ public Optional id() { return Optional.ofNullable(this.id); @@ -76,7 +78,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public DeleteInteractionRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -85,7 +87,8 @@ public DeleteInteractionRequest withApiVersion(@Nullable String apiVersion) { /** - * The unique identifier of the interaction to delete. + * Part of `name`. Required. The name of the interaction to delete. + * Format: interactions/{interaction} */ public DeleteInteractionRequest withId(@Nonnull String id) { this.id = Utils.checkNotNull(id, "id"); @@ -132,7 +135,7 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -140,7 +143,8 @@ public Builder apiVersion(@Nullable String apiVersion) { } /** - * The unique identifier of the interaction to delete. + * Part of `name`. Required. The name of the interaction to delete. + * Format: interactions/{interaction} */ public Builder id(@Nonnull String id) { this.id = Utils.checkNotNull(id, "id"); diff --git a/src/main/java/com/google/genai/gaos/models/operations/DeleteTriggerRequest.java b/src/main/java/com/google/genai/gaos/models/operations/DeleteTriggerRequest.java index 8c296762e35..f3ee5885a0c 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/DeleteTriggerRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/DeleteTriggerRequest.java @@ -31,13 +31,13 @@ public class DeleteTriggerRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; /** - * Resource name of the trigger. + * Required. The ID of the trigger to delete. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=id") private String id; @@ -57,14 +57,14 @@ public DeleteTriggerRequest( } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); } /** - * Resource name of the trigger. + * Required. The ID of the trigger to delete. */ public Optional id() { return Optional.ofNullable(this.id); @@ -76,7 +76,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public DeleteTriggerRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -85,7 +85,7 @@ public DeleteTriggerRequest withApiVersion(@Nullable String apiVersion) { /** - * Resource name of the trigger. + * Required. The ID of the trigger to delete. */ public DeleteTriggerRequest withId(@Nonnull String id) { this.id = Utils.checkNotNull(id, "id"); @@ -132,7 +132,7 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -140,7 +140,7 @@ public Builder apiVersion(@Nullable String apiVersion) { } /** - * Resource name of the trigger. + * Required. The ID of the trigger to delete. */ public Builder id(@Nonnull String id) { this.id = Utils.checkNotNull(id, "id"); diff --git a/src/main/java/com/google/genai/gaos/models/operations/DeleteWebhookRequest.java b/src/main/java/com/google/genai/gaos/models/operations/DeleteWebhookRequest.java index b2eb606b85f..0d1fd1e3051 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/DeleteWebhookRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/DeleteWebhookRequest.java @@ -31,7 +31,7 @@ public class DeleteWebhookRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; @@ -58,7 +58,7 @@ public DeleteWebhookRequest( } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); @@ -78,7 +78,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public DeleteWebhookRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -135,7 +135,7 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; diff --git a/src/main/java/com/google/genai/gaos/models/operations/GetAgentRequest.java b/src/main/java/com/google/genai/gaos/models/operations/GetAgentRequest.java index 2c68e715612..2bef91bd1a9 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/GetAgentRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/GetAgentRequest.java @@ -31,13 +31,15 @@ public class GetAgentRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; - - @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=id") + /** + * Part of `name`. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=agentsId") private String id; @JsonCreator @@ -55,12 +57,15 @@ public GetAgentRequest( } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); } + /** + * Part of `name`. + */ public Optional id() { return Optional.ofNullable(this.id); } @@ -71,7 +76,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public GetAgentRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -79,6 +84,9 @@ public GetAgentRequest withApiVersion(@Nullable String apiVersion) { } + /** + * Part of `name`. + */ public GetAgentRequest withId(@Nonnull String id) { this.id = Utils.checkNotNull(id, "id"); return this; @@ -124,13 +132,16 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; return this; } + /** + * Part of `name`. + */ public Builder id(@Nonnull String id) { this.id = Utils.checkNotNull(id, "id"); return this; diff --git a/src/main/java/com/google/genai/gaos/models/operations/GetEnvironmentFilesRequest.java b/src/main/java/com/google/genai/gaos/models/operations/GetEnvironmentFilesRequest.java index 747e08b8bde..a35587b08c1 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/GetEnvironmentFilesRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/GetEnvironmentFilesRequest.java @@ -33,7 +33,7 @@ public class GetEnvironmentFilesRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; @@ -90,7 +90,7 @@ public GetEnvironmentFilesRequest( } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); @@ -131,7 +131,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public GetEnvironmentFilesRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -234,7 +234,7 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; diff --git a/src/main/java/com/google/genai/gaos/models/operations/GetEnvironmentRequest.java b/src/main/java/com/google/genai/gaos/models/operations/GetEnvironmentRequest.java index 803330eadbb..51a4e599992 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/GetEnvironmentRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/GetEnvironmentRequest.java @@ -31,14 +31,13 @@ public class GetEnvironmentRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; /** - * Resource ID segment making up resource `name`. It identifies the resource within its parent - * collection as described in https://google.aip.dev/122. + * Required. The identifier of the environment to retrieve. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=id") private String id; @@ -58,15 +57,14 @@ public GetEnvironmentRequest( } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); } /** - * Resource ID segment making up resource `name`. It identifies the resource within its parent - * collection as described in https://google.aip.dev/122. + * Required. The identifier of the environment to retrieve. */ public Optional id() { return Optional.ofNullable(this.id); @@ -78,7 +76,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public GetEnvironmentRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -87,8 +85,7 @@ public GetEnvironmentRequest withApiVersion(@Nullable String apiVersion) { /** - * Resource ID segment making up resource `name`. It identifies the resource within its parent - * collection as described in https://google.aip.dev/122. + * Required. The identifier of the environment to retrieve. */ public GetEnvironmentRequest withId(@Nonnull String id) { this.id = Utils.checkNotNull(id, "id"); @@ -135,7 +132,7 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -143,8 +140,7 @@ public Builder apiVersion(@Nullable String apiVersion) { } /** - * Resource ID segment making up resource `name`. It identifies the resource within its parent - * collection as described in https://google.aip.dev/122. + * Required. The identifier of the environment to retrieve. */ public Builder id(@Nonnull String id) { this.id = Utils.checkNotNull(id, "id"); diff --git a/src/main/java/com/google/genai/gaos/models/operations/GetInteractionByIdRequest.java b/src/main/java/com/google/genai/gaos/models/operations/GetInteractionByIdRequest.java index 6e96565803f..b225da54d39 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/GetInteractionByIdRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/GetInteractionByIdRequest.java @@ -20,14 +20,11 @@ package com.google.genai.gaos.models.operations; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.core.type.TypeReference; -import com.google.genai.gaos.utils.LazySingletonValue; import com.google.genai.gaos.utils.SpeakeasyMetadata; import com.google.genai.gaos.utils.Utils; import jakarta.annotation.Nonnull; import jakarta.annotation.Nullable; import java.lang.Boolean; -import java.lang.Deprecated; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -35,35 +32,33 @@ public class GetInteractionByIdRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; /** - * The unique identifier of the interaction to retrieve. + * If true, includes the input in the response. */ - @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=id") - private String id; + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=include_input") + private Boolean includeInput; /** - * If set to true, includes the input in the response. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + * Part of `name`. Required. The name of the interaction to retrieve. + * Format: interactions/{interaction} */ - @SpeakeasyMetadata("queryParam:style=form,explode=true,name=include_input") - @Deprecated - private Boolean includeInput; + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=interactionsId") + private String id; /** - * Optional. If set, resumes the interaction stream from the next chunk after the event marked by the - * event id. Can only be used if `stream` is true. + * If set, resumes the interaction stream from the chunk after the event + * marked by the event id. Can only be used if `stream` is true. */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=last_event_id") private String lastEventId; /** - * If set to true, the generated content will be streamed incrementally. + * If true, streams the interaction events as Server-Sent Events. */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=stream") private Boolean stream; @@ -71,60 +66,56 @@ public class GetInteractionByIdRequest { @JsonCreator public GetInteractionByIdRequest( @Nullable String apiVersion, - @Nonnull String id, @Nullable Boolean includeInput, + @Nonnull String id, @Nullable String lastEventId, @Nullable Boolean stream) { this.apiVersion = apiVersion; + this.includeInput = includeInput; this.id = Optional.ofNullable(id) .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); - this.includeInput = Optional.ofNullable(includeInput) - .orElse(Builder._SINGLETON_VALUE_IncludeInput.value()); this.lastEventId = lastEventId; - this.stream = Optional.ofNullable(stream) - .orElse(Builder._SINGLETON_VALUE_Stream.value()); + this.stream = stream; } public GetInteractionByIdRequest( @Nonnull String id) { - this(null, id, null, + this(null, null, id, null, null); } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); } /** - * The unique identifier of the interaction to retrieve. + * If true, includes the input in the response. */ - public Optional id() { - return Optional.ofNullable(this.id); + public Optional includeInput() { + return Optional.ofNullable(this.includeInput); } /** - * If set to true, includes the input in the response. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + * Part of `name`. Required. The name of the interaction to retrieve. + * Format: interactions/{interaction} */ - @Deprecated - public Optional includeInput() { - return Optional.ofNullable(this.includeInput); + public Optional id() { + return Optional.ofNullable(this.id); } /** - * Optional. If set, resumes the interaction stream from the next chunk after the event marked by the - * event id. Can only be used if `stream` is true. + * If set, resumes the interaction stream from the chunk after the event + * marked by the event id. Can only be used if `stream` is true. */ public Optional lastEventId() { return Optional.ofNullable(this.lastEventId); } /** - * If set to true, the generated content will be streamed incrementally. + * If true, streams the interaction events as Server-Sent Events. */ public Optional stream() { return Optional.ofNullable(this.stream); @@ -136,7 +127,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public GetInteractionByIdRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -145,29 +136,27 @@ public GetInteractionByIdRequest withApiVersion(@Nullable String apiVersion) { /** - * The unique identifier of the interaction to retrieve. + * If true, includes the input in the response. */ - public GetInteractionByIdRequest withId(@Nonnull String id) { - this.id = Utils.checkNotNull(id, "id"); + public GetInteractionByIdRequest withIncludeInput(@Nullable Boolean includeInput) { + this.includeInput = includeInput; return this; } /** - * If set to true, includes the input in the response. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + * Part of `name`. Required. The name of the interaction to retrieve. + * Format: interactions/{interaction} */ - @Deprecated - public GetInteractionByIdRequest withIncludeInput(@Nullable Boolean includeInput) { - this.includeInput = includeInput; + public GetInteractionByIdRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** - * Optional. If set, resumes the interaction stream from the next chunk after the event marked by the - * event id. Can only be used if `stream` is true. + * If set, resumes the interaction stream from the chunk after the event + * marked by the event id. Can only be used if `stream` is true. */ public GetInteractionByIdRequest withLastEventId(@Nullable String lastEventId) { this.lastEventId = lastEventId; @@ -176,7 +165,7 @@ public GetInteractionByIdRequest withLastEventId(@Nullable String lastEventId) { /** - * If set to true, the generated content will be streamed incrementally. + * If true, streams the interaction events as Server-Sent Events. */ public GetInteractionByIdRequest withStream(@Nullable Boolean stream) { this.stream = stream; @@ -195,8 +184,8 @@ public boolean equals(java.lang.Object o) { GetInteractionByIdRequest other = (GetInteractionByIdRequest) o; return Utils.enhancedDeepEquals(this.apiVersion, other.apiVersion) && - Utils.enhancedDeepEquals(this.id, other.id) && Utils.enhancedDeepEquals(this.includeInput, other.includeInput) && + Utils.enhancedDeepEquals(this.id, other.id) && Utils.enhancedDeepEquals(this.lastEventId, other.lastEventId) && Utils.enhancedDeepEquals(this.stream, other.stream); } @@ -204,7 +193,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { return Utils.enhancedHash( - apiVersion, id, includeInput, + apiVersion, includeInput, id, lastEventId, stream); } @@ -212,8 +201,8 @@ public int hashCode() { public String toString() { return Utils.toString(GetInteractionByIdRequest.class, "apiVersion", apiVersion, - "id", id, "includeInput", includeInput, + "id", id, "lastEventId", lastEventId, "stream", stream); } @@ -223,11 +212,10 @@ public final static class Builder { private String apiVersion; - private String id; - - @Deprecated private Boolean includeInput; + private String id; + private String lastEventId; private Boolean stream; @@ -237,7 +225,7 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -245,27 +233,25 @@ public Builder apiVersion(@Nullable String apiVersion) { } /** - * The unique identifier of the interaction to retrieve. + * If true, includes the input in the response. */ - public Builder id(@Nonnull String id) { - this.id = Utils.checkNotNull(id, "id"); + public Builder includeInput(@Nullable Boolean includeInput) { + this.includeInput = includeInput; return this; } /** - * If set to true, includes the input in the response. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + * Part of `name`. Required. The name of the interaction to retrieve. + * Format: interactions/{interaction} */ - @Deprecated - public Builder includeInput(@Nullable Boolean includeInput) { - this.includeInput = includeInput; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** - * Optional. If set, resumes the interaction stream from the next chunk after the event marked by the - * event id. Can only be used if `stream` is true. + * If set, resumes the interaction stream from the chunk after the event + * marked by the event id. Can only be used if `stream` is true. */ public Builder lastEventId(@Nullable String lastEventId) { this.lastEventId = lastEventId; @@ -273,7 +259,7 @@ public Builder lastEventId(@Nullable String lastEventId) { } /** - * If set to true, the generated content will be streamed incrementally. + * If true, streams the interaction events as Server-Sent Events. */ public Builder stream(@Nullable Boolean stream) { this.stream = stream; @@ -282,21 +268,9 @@ public Builder stream(@Nullable Boolean stream) { public GetInteractionByIdRequest build() { return new GetInteractionByIdRequest( - apiVersion, id, includeInput, + apiVersion, includeInput, id, lastEventId, stream); } - - private static final LazySingletonValue _SINGLETON_VALUE_IncludeInput = - new LazySingletonValue<>( - "include_input", - "false", - new TypeReference() {}); - - private static final LazySingletonValue _SINGLETON_VALUE_Stream = - new LazySingletonValue<>( - "stream", - "false", - new TypeReference() {}); } } diff --git a/src/main/java/com/google/genai/gaos/models/operations/GetTriggerRequest.java b/src/main/java/com/google/genai/gaos/models/operations/GetTriggerRequest.java index 94b6ab7971c..a4009936348 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/GetTriggerRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/GetTriggerRequest.java @@ -31,13 +31,13 @@ public class GetTriggerRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; /** - * Resource name of the trigger. + * Required. The ID of the trigger to retrieve. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=id") private String id; @@ -57,14 +57,14 @@ public GetTriggerRequest( } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); } /** - * Resource name of the trigger. + * Required. The ID of the trigger to retrieve. */ public Optional id() { return Optional.ofNullable(this.id); @@ -76,7 +76,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public GetTriggerRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -85,7 +85,7 @@ public GetTriggerRequest withApiVersion(@Nullable String apiVersion) { /** - * Resource name of the trigger. + * Required. The ID of the trigger to retrieve. */ public GetTriggerRequest withId(@Nonnull String id) { this.id = Utils.checkNotNull(id, "id"); @@ -132,7 +132,7 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -140,7 +140,7 @@ public Builder apiVersion(@Nullable String apiVersion) { } /** - * Resource name of the trigger. + * Required. The ID of the trigger to retrieve. */ public Builder id(@Nonnull String id) { this.id = Utils.checkNotNull(id, "id"); diff --git a/src/main/java/com/google/genai/gaos/models/operations/GetWebhookRequest.java b/src/main/java/com/google/genai/gaos/models/operations/GetWebhookRequest.java index a001eb4067c..93076278ff3 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/GetWebhookRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/GetWebhookRequest.java @@ -31,7 +31,7 @@ public class GetWebhookRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; @@ -57,7 +57,7 @@ public GetWebhookRequest( } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); @@ -76,7 +76,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public GetWebhookRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -132,7 +132,7 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; diff --git a/src/main/java/com/google/genai/gaos/models/operations/ListAgentsRequest.java b/src/main/java/com/google/genai/gaos/models/operations/ListAgentsRequest.java index d4e91f65625..dc4701c81ae 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/ListAgentsRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/ListAgentsRequest.java @@ -31,7 +31,7 @@ public class ListAgentsRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; @@ -66,7 +66,7 @@ public ListAgentsRequest() { } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); @@ -90,7 +90,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public ListAgentsRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -164,7 +164,7 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; diff --git a/src/main/java/com/google/genai/gaos/models/operations/ListEnvironmentsRequest.java b/src/main/java/com/google/genai/gaos/models/operations/ListEnvironmentsRequest.java index 71ddf84b78d..ef8710e5199 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/ListEnvironmentsRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/ListEnvironmentsRequest.java @@ -31,20 +31,20 @@ public class ListEnvironmentsRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; /** - * Optional. Maximum number of environments to return.\nIf unspecified, defaults to 50. Maximum is - * 1000. + * Maximum number of environments to return. + * If unspecified, defaults to 50. Maximum is 1000. */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page_size") private Integer pageSize; /** - * Optional. Pagination token. + * Pagination token. */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page_token") private String pageToken; @@ -64,22 +64,22 @@ public ListEnvironmentsRequest() { } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); } /** - * Optional. Maximum number of environments to return.\nIf unspecified, defaults to 50. Maximum is - * 1000. + * Maximum number of environments to return. + * If unspecified, defaults to 50. Maximum is 1000. */ public Optional pageSize() { return Optional.ofNullable(this.pageSize); } /** - * Optional. Pagination token. + * Pagination token. */ public Optional pageToken() { return Optional.ofNullable(this.pageToken); @@ -91,7 +91,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public ListEnvironmentsRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -100,8 +100,8 @@ public ListEnvironmentsRequest withApiVersion(@Nullable String apiVersion) { /** - * Optional. Maximum number of environments to return.\nIf unspecified, defaults to 50. Maximum is - * 1000. + * Maximum number of environments to return. + * If unspecified, defaults to 50. Maximum is 1000. */ public ListEnvironmentsRequest withPageSize(@Nullable Integer pageSize) { this.pageSize = pageSize; @@ -110,7 +110,7 @@ public ListEnvironmentsRequest withPageSize(@Nullable Integer pageSize) { /** - * Optional. Pagination token. + * Pagination token. */ public ListEnvironmentsRequest withPageToken(@Nullable String pageToken) { this.pageToken = pageToken; @@ -161,7 +161,7 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -169,8 +169,8 @@ public Builder apiVersion(@Nullable String apiVersion) { } /** - * Optional. Maximum number of environments to return.\nIf unspecified, defaults to 50. Maximum is - * 1000. + * Maximum number of environments to return. + * If unspecified, defaults to 50. Maximum is 1000. */ public Builder pageSize(@Nullable Integer pageSize) { this.pageSize = pageSize; @@ -178,7 +178,7 @@ public Builder pageSize(@Nullable Integer pageSize) { } /** - * Optional. Pagination token. + * Pagination token. */ public Builder pageToken(@Nullable String pageToken) { this.pageToken = pageToken; diff --git a/src/main/java/com/google/genai/gaos/models/operations/ListTriggerExecutionsRequest.java b/src/main/java/com/google/genai/gaos/models/operations/ListTriggerExecutionsRequest.java index e184e7aa760..e8fe972699c 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/ListTriggerExecutionsRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/ListTriggerExecutionsRequest.java @@ -24,7 +24,7 @@ import com.google.genai.gaos.utils.Utils; import jakarta.annotation.Nonnull; import jakarta.annotation.Nullable; -import java.lang.Long; +import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -32,74 +32,74 @@ public class ListTriggerExecutionsRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; /** - * Resource name of the trigger. - */ - @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=trigger_id") - private String triggerId; - - /** - * Optional. The maximum number of executions to return per page. + * The maximum number of executions to return per page. */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page_size") - private Long pageSize; + private Integer pageSize; /** - * Optional. A page token from a previous ListTriggerExecutions call. + * A page token from a previous ListTriggerExecutions call. */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page_token") private String pageToken; + /** + * Required. The trigger ID to list executions from. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=triggerId") + private String triggerId; + @JsonCreator public ListTriggerExecutionsRequest( @Nullable String apiVersion, - @Nonnull String triggerId, - @Nullable Long pageSize, - @Nullable String pageToken) { + @Nullable Integer pageSize, + @Nullable String pageToken, + @Nonnull String triggerId) { this.apiVersion = apiVersion; - this.triggerId = Optional.ofNullable(triggerId) - .orElseThrow(() -> new IllegalArgumentException("triggerId cannot be null")); this.pageSize = pageSize; this.pageToken = pageToken; + this.triggerId = Optional.ofNullable(triggerId) + .orElseThrow(() -> new IllegalArgumentException("triggerId cannot be null")); } public ListTriggerExecutionsRequest( @Nonnull String triggerId) { - this(null, triggerId, null, - null); + this(null, null, null, + triggerId); } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); } /** - * Resource name of the trigger. + * The maximum number of executions to return per page. */ - public Optional triggerId() { - return Optional.ofNullable(this.triggerId); + public Optional pageSize() { + return Optional.ofNullable(this.pageSize); } /** - * Optional. The maximum number of executions to return per page. + * A page token from a previous ListTriggerExecutions call. */ - public Optional pageSize() { - return Optional.ofNullable(this.pageSize); + public Optional pageToken() { + return Optional.ofNullable(this.pageToken); } /** - * Optional. A page token from a previous ListTriggerExecutions call. + * Required. The trigger ID to list executions from. */ - public Optional pageToken() { - return Optional.ofNullable(this.pageToken); + public Optional triggerId() { + return Optional.ofNullable(this.triggerId); } public static Builder builder() { @@ -108,7 +108,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public ListTriggerExecutionsRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -117,28 +117,28 @@ public ListTriggerExecutionsRequest withApiVersion(@Nullable String apiVersion) /** - * Resource name of the trigger. + * The maximum number of executions to return per page. */ - public ListTriggerExecutionsRequest withTriggerId(@Nonnull String triggerId) { - this.triggerId = Utils.checkNotNull(triggerId, "triggerId"); + public ListTriggerExecutionsRequest withPageSize(@Nullable Integer pageSize) { + this.pageSize = pageSize; return this; } /** - * Optional. The maximum number of executions to return per page. + * A page token from a previous ListTriggerExecutions call. */ - public ListTriggerExecutionsRequest withPageSize(@Nullable Long pageSize) { - this.pageSize = pageSize; + public ListTriggerExecutionsRequest withPageToken(@Nullable String pageToken) { + this.pageToken = pageToken; return this; } /** - * Optional. A page token from a previous ListTriggerExecutions call. + * Required. The trigger ID to list executions from. */ - public ListTriggerExecutionsRequest withPageToken(@Nullable String pageToken) { - this.pageToken = pageToken; + public ListTriggerExecutionsRequest withTriggerId(@Nonnull String triggerId) { + this.triggerId = Utils.checkNotNull(triggerId, "triggerId"); return this; } @@ -154,25 +154,25 @@ public boolean equals(java.lang.Object o) { ListTriggerExecutionsRequest other = (ListTriggerExecutionsRequest) o; return Utils.enhancedDeepEquals(this.apiVersion, other.apiVersion) && - Utils.enhancedDeepEquals(this.triggerId, other.triggerId) && Utils.enhancedDeepEquals(this.pageSize, other.pageSize) && - Utils.enhancedDeepEquals(this.pageToken, other.pageToken); + Utils.enhancedDeepEquals(this.pageToken, other.pageToken) && + Utils.enhancedDeepEquals(this.triggerId, other.triggerId); } @Override public int hashCode() { return Utils.enhancedHash( - apiVersion, triggerId, pageSize, - pageToken); + apiVersion, pageSize, pageToken, + triggerId); } @Override public String toString() { return Utils.toString(ListTriggerExecutionsRequest.class, "apiVersion", apiVersion, - "triggerId", triggerId, "pageSize", pageSize, - "pageToken", pageToken); + "pageToken", pageToken, + "triggerId", triggerId); } @SuppressWarnings("UnusedReturnValue") @@ -180,18 +180,18 @@ public final static class Builder { private String apiVersion; - private String triggerId; - - private Long pageSize; + private Integer pageSize; private String pageToken; + private String triggerId; + private Builder() { // force use of static builder() method } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -199,33 +199,33 @@ public Builder apiVersion(@Nullable String apiVersion) { } /** - * Resource name of the trigger. + * The maximum number of executions to return per page. */ - public Builder triggerId(@Nonnull String triggerId) { - this.triggerId = Utils.checkNotNull(triggerId, "triggerId"); + public Builder pageSize(@Nullable Integer pageSize) { + this.pageSize = pageSize; return this; } /** - * Optional. The maximum number of executions to return per page. + * A page token from a previous ListTriggerExecutions call. */ - public Builder pageSize(@Nullable Long pageSize) { - this.pageSize = pageSize; + public Builder pageToken(@Nullable String pageToken) { + this.pageToken = pageToken; return this; } /** - * Optional. A page token from a previous ListTriggerExecutions call. + * Required. The trigger ID to list executions from. */ - public Builder pageToken(@Nullable String pageToken) { - this.pageToken = pageToken; + public Builder triggerId(@Nonnull String triggerId) { + this.triggerId = Utils.checkNotNull(triggerId, "triggerId"); return this; } public ListTriggerExecutionsRequest build() { return new ListTriggerExecutionsRequest( - apiVersion, triggerId, pageSize, - pageToken); + apiVersion, pageSize, pageToken, + triggerId); } } diff --git a/src/main/java/com/google/genai/gaos/models/operations/ListTriggerExecutionsRequestBuilder.java b/src/main/java/com/google/genai/gaos/models/operations/ListTriggerExecutionsRequestBuilder.java index aeb51dff101..c0a60783533 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/ListTriggerExecutionsRequestBuilder.java +++ b/src/main/java/com/google/genai/gaos/models/operations/ListTriggerExecutionsRequestBuilder.java @@ -29,7 +29,7 @@ import com.google.genai.gaos.utils.Utils; import jakarta.annotation.Nonnull; import jakarta.annotation.Nullable; -import java.lang.Long; +import java.lang.Integer; import java.lang.String; public class ListTriggerExecutionsRequestBuilder { @@ -52,20 +52,20 @@ public ListTriggerExecutionsRequestBuilder apiVersion(@Nullable String apiVersio return this; } - public ListTriggerExecutionsRequestBuilder triggerId(@Nonnull String triggerId) { - this.pojoBuilder.triggerId(triggerId); + public ListTriggerExecutionsRequestBuilder pageSize(@Nullable Integer pageSize) { + this.pojoBuilder.pageSize(pageSize); this._setterCalled = true; return this; } - public ListTriggerExecutionsRequestBuilder pageSize(@Nullable Long pageSize) { - this.pojoBuilder.pageSize(pageSize); + public ListTriggerExecutionsRequestBuilder pageToken(@Nullable String pageToken) { + this.pojoBuilder.pageToken(pageToken); this._setterCalled = true; return this; } - public ListTriggerExecutionsRequestBuilder pageToken(@Nullable String pageToken) { - this.pojoBuilder.pageToken(pageToken); + public ListTriggerExecutionsRequestBuilder triggerId(@Nonnull String triggerId) { + this.pojoBuilder.triggerId(triggerId); this._setterCalled = true; return this; } diff --git a/src/main/java/com/google/genai/gaos/models/operations/ListTriggersRequest.java b/src/main/java/com/google/genai/gaos/models/operations/ListTriggersRequest.java index d62e48e8499..e087f03a01a 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/ListTriggersRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/ListTriggersRequest.java @@ -23,7 +23,7 @@ import com.google.genai.gaos.utils.SpeakeasyMetadata; import com.google.genai.gaos.utils.Utils; import jakarta.annotation.Nullable; -import java.lang.Long; +import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -31,25 +31,28 @@ public class ListTriggersRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; /** - * Optional. Filter expression (e.g., by state). + * Optional. Filter expression (e.g. `agent="agents/my-agent-id"`). + * + *

Only + * equality filtering on the `agent` field is currently supported. */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=filter") private String filter; /** - * Optional. The maximum number of triggers to return per page. + * The maximum number of triggers to return per page. */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page_size") - private Long pageSize; + private Integer pageSize; /** - * Optional. A page token from a previous ListTriggers call. + * A page token from a previous ListTriggers call. */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page_token") private String pageToken; @@ -58,7 +61,7 @@ public class ListTriggersRequest { public ListTriggersRequest( @Nullable String apiVersion, @Nullable String filter, - @Nullable Long pageSize, + @Nullable Integer pageSize, @Nullable String pageToken) { this.apiVersion = apiVersion; this.filter = filter; @@ -72,28 +75,31 @@ public ListTriggersRequest() { } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); } /** - * Optional. Filter expression (e.g., by state). + * Optional. Filter expression (e.g. `agent="agents/my-agent-id"`). + * + *

Only + * equality filtering on the `agent` field is currently supported. */ public Optional filter() { return Optional.ofNullable(this.filter); } /** - * Optional. The maximum number of triggers to return per page. + * The maximum number of triggers to return per page. */ - public Optional pageSize() { + public Optional pageSize() { return Optional.ofNullable(this.pageSize); } /** - * Optional. A page token from a previous ListTriggers call. + * A page token from a previous ListTriggers call. */ public Optional pageToken() { return Optional.ofNullable(this.pageToken); @@ -105,7 +111,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public ListTriggersRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -114,7 +120,10 @@ public ListTriggersRequest withApiVersion(@Nullable String apiVersion) { /** - * Optional. Filter expression (e.g., by state). + * Optional. Filter expression (e.g. `agent="agents/my-agent-id"`). + * + *

Only + * equality filtering on the `agent` field is currently supported. */ public ListTriggersRequest withFilter(@Nullable String filter) { this.filter = filter; @@ -123,16 +132,16 @@ public ListTriggersRequest withFilter(@Nullable String filter) { /** - * Optional. The maximum number of triggers to return per page. + * The maximum number of triggers to return per page. */ - public ListTriggersRequest withPageSize(@Nullable Long pageSize) { + public ListTriggersRequest withPageSize(@Nullable Integer pageSize) { this.pageSize = pageSize; return this; } /** - * Optional. A page token from a previous ListTriggers call. + * A page token from a previous ListTriggers call. */ public ListTriggersRequest withPageToken(@Nullable String pageToken) { this.pageToken = pageToken; @@ -179,7 +188,7 @@ public final static class Builder { private String filter; - private Long pageSize; + private Integer pageSize; private String pageToken; @@ -188,7 +197,7 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -196,7 +205,10 @@ public Builder apiVersion(@Nullable String apiVersion) { } /** - * Optional. Filter expression (e.g., by state). + * Optional. Filter expression (e.g. `agent="agents/my-agent-id"`). + * + *

Only + * equality filtering on the `agent` field is currently supported. */ public Builder filter(@Nullable String filter) { this.filter = filter; @@ -204,15 +216,15 @@ public Builder filter(@Nullable String filter) { } /** - * Optional. The maximum number of triggers to return per page. + * The maximum number of triggers to return per page. */ - public Builder pageSize(@Nullable Long pageSize) { + public Builder pageSize(@Nullable Integer pageSize) { this.pageSize = pageSize; return this; } /** - * Optional. A page token from a previous ListTriggers call. + * A page token from a previous ListTriggers call. */ public Builder pageToken(@Nullable String pageToken) { this.pageToken = pageToken; diff --git a/src/main/java/com/google/genai/gaos/models/operations/ListTriggersRequestBuilder.java b/src/main/java/com/google/genai/gaos/models/operations/ListTriggersRequestBuilder.java index 3ae6fd12dec..1e37f12fd90 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/ListTriggersRequestBuilder.java +++ b/src/main/java/com/google/genai/gaos/models/operations/ListTriggersRequestBuilder.java @@ -28,7 +28,7 @@ import com.google.genai.gaos.utils.RetryConfig; import com.google.genai.gaos.utils.Utils; import jakarta.annotation.Nullable; -import java.lang.Long; +import java.lang.Integer; import java.lang.String; public class ListTriggersRequestBuilder { @@ -57,7 +57,7 @@ public ListTriggersRequestBuilder filter(@Nullable String filter) { return this; } - public ListTriggersRequestBuilder pageSize(@Nullable Long pageSize) { + public ListTriggersRequestBuilder pageSize(@Nullable Integer pageSize) { this.pojoBuilder.pageSize(pageSize); this._setterCalled = true; return this; diff --git a/src/main/java/com/google/genai/gaos/models/operations/ListWebhooksRequest.java b/src/main/java/com/google/genai/gaos/models/operations/ListWebhooksRequest.java index 72ef8c744da..d0b38224627 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/ListWebhooksRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/ListWebhooksRequest.java @@ -31,13 +31,13 @@ public class ListWebhooksRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; /** - * Optional. The maximum number of webhooks to return. The service may return fewer than + * The maximum number of webhooks to return. The service may return fewer than * this value. If unspecified, at most 50 webhooks will be returned. * The maximum value is 1000. */ @@ -45,7 +45,7 @@ public class ListWebhooksRequest { private Integer pageSize; /** - * Optional. A page token, received from a previous `ListWebhooks` call. + * A page token, received from a previous `ListWebhooks` call. * Provide this to retrieve the subsequent page. */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page_token") @@ -66,14 +66,14 @@ public ListWebhooksRequest() { } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); } /** - * Optional. The maximum number of webhooks to return. The service may return fewer than + * The maximum number of webhooks to return. The service may return fewer than * this value. If unspecified, at most 50 webhooks will be returned. * The maximum value is 1000. */ @@ -82,7 +82,7 @@ public Optional pageSize() { } /** - * Optional. A page token, received from a previous `ListWebhooks` call. + * A page token, received from a previous `ListWebhooks` call. * Provide this to retrieve the subsequent page. */ public Optional pageToken() { @@ -95,7 +95,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public ListWebhooksRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -104,7 +104,7 @@ public ListWebhooksRequest withApiVersion(@Nullable String apiVersion) { /** - * Optional. The maximum number of webhooks to return. The service may return fewer than + * The maximum number of webhooks to return. The service may return fewer than * this value. If unspecified, at most 50 webhooks will be returned. * The maximum value is 1000. */ @@ -115,7 +115,7 @@ public ListWebhooksRequest withPageSize(@Nullable Integer pageSize) { /** - * Optional. A page token, received from a previous `ListWebhooks` call. + * A page token, received from a previous `ListWebhooks` call. * Provide this to retrieve the subsequent page. */ public ListWebhooksRequest withPageToken(@Nullable String pageToken) { @@ -167,7 +167,7 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -175,7 +175,7 @@ public Builder apiVersion(@Nullable String apiVersion) { } /** - * Optional. The maximum number of webhooks to return. The service may return fewer than + * The maximum number of webhooks to return. The service may return fewer than * this value. If unspecified, at most 50 webhooks will be returned. * The maximum value is 1000. */ @@ -185,7 +185,7 @@ public Builder pageSize(@Nullable Integer pageSize) { } /** - * Optional. A page token, received from a previous `ListWebhooks` call. + * A page token, received from a previous `ListWebhooks` call. * Provide this to retrieve the subsequent page. */ public Builder pageToken(@Nullable String pageToken) { diff --git a/src/main/java/com/google/genai/gaos/models/operations/PingWebhookRequest.java b/src/main/java/com/google/genai/gaos/models/operations/PingWebhookRequest.java index 9b116e0a8da..9746a6350d0 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/PingWebhookRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/PingWebhookRequest.java @@ -31,20 +31,19 @@ public class PingWebhookRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; /** * Required. The ID of the webhook to ping. - * Format: `{webhook_id}` */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=id") private String id; /** - * The request body. + * Required. The HTTP body of the payload. */ @SpeakeasyMetadata("request:mediaType=application/json") private com.google.genai.gaos.models.webhooks.PingWebhookRequest body; @@ -66,7 +65,7 @@ public PingWebhookRequest( } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); @@ -74,14 +73,13 @@ public Optional apiVersion() { /** * Required. The ID of the webhook to ping. - * Format: `{webhook_id}` */ public Optional id() { return Optional.ofNullable(this.id); } /** - * The request body. + * Required. The HTTP body of the payload. */ public Optional body() { return Optional.ofNullable(this.body); @@ -93,7 +91,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public PingWebhookRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -103,7 +101,6 @@ public PingWebhookRequest withApiVersion(@Nullable String apiVersion) { /** * Required. The ID of the webhook to ping. - * Format: `{webhook_id}` */ public PingWebhookRequest withId(@Nonnull String id) { this.id = Utils.checkNotNull(id, "id"); @@ -112,7 +109,7 @@ public PingWebhookRequest withId(@Nonnull String id) { /** - * The request body. + * Required. The HTTP body of the payload. */ public PingWebhookRequest withBody(@Nullable com.google.genai.gaos.models.webhooks.PingWebhookRequest body) { this.body = body; @@ -163,7 +160,7 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -172,7 +169,6 @@ public Builder apiVersion(@Nullable String apiVersion) { /** * Required. The ID of the webhook to ping. - * Format: `{webhook_id}` */ public Builder id(@Nonnull String id) { this.id = Utils.checkNotNull(id, "id"); @@ -180,7 +176,7 @@ public Builder id(@Nonnull String id) { } /** - * The request body. + * Required. The HTTP body of the payload. */ public Builder body(@Nullable com.google.genai.gaos.models.webhooks.PingWebhookRequest body) { this.body = body; diff --git a/src/main/java/com/google/genai/gaos/models/operations/RotateSigningSecretRequest.java b/src/main/java/com/google/genai/gaos/models/operations/RotateSigningSecretRequest.java index 75ba1f650a9..1fcf585bbad 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/RotateSigningSecretRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/RotateSigningSecretRequest.java @@ -31,20 +31,19 @@ public class RotateSigningSecretRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; /** - * Required. The ID of the webhook for which to generate a signing secret. - * Format: `{webhook_id}` + * Required. The ID of the webhook for which to rotate the signing secret. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=id") private String id; /** - * The request body. + * Required. The HTTP body of the payload mapping to `revocation_behavior`. */ @SpeakeasyMetadata("request:mediaType=application/json") private com.google.genai.gaos.models.webhooks.RotateSigningSecretRequest body; @@ -66,22 +65,21 @@ public RotateSigningSecretRequest( } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); } /** - * Required. The ID of the webhook for which to generate a signing secret. - * Format: `{webhook_id}` + * Required. The ID of the webhook for which to rotate the signing secret. */ public Optional id() { return Optional.ofNullable(this.id); } /** - * The request body. + * Required. The HTTP body of the payload mapping to `revocation_behavior`. */ public Optional body() { return Optional.ofNullable(this.body); @@ -93,7 +91,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public RotateSigningSecretRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -102,8 +100,7 @@ public RotateSigningSecretRequest withApiVersion(@Nullable String apiVersion) { /** - * Required. The ID of the webhook for which to generate a signing secret. - * Format: `{webhook_id}` + * Required. The ID of the webhook for which to rotate the signing secret. */ public RotateSigningSecretRequest withId(@Nonnull String id) { this.id = Utils.checkNotNull(id, "id"); @@ -112,7 +109,7 @@ public RotateSigningSecretRequest withId(@Nonnull String id) { /** - * The request body. + * Required. The HTTP body of the payload mapping to `revocation_behavior`. */ public RotateSigningSecretRequest withBody(@Nullable com.google.genai.gaos.models.webhooks.RotateSigningSecretRequest body) { this.body = body; @@ -163,7 +160,7 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -171,8 +168,7 @@ public Builder apiVersion(@Nullable String apiVersion) { } /** - * Required. The ID of the webhook for which to generate a signing secret. - * Format: `{webhook_id}` + * Required. The ID of the webhook for which to rotate the signing secret. */ public Builder id(@Nonnull String id) { this.id = Utils.checkNotNull(id, "id"); @@ -180,7 +176,7 @@ public Builder id(@Nonnull String id) { } /** - * The request body. + * Required. The HTTP body of the payload mapping to `revocation_behavior`. */ public Builder body(@Nullable com.google.genai.gaos.models.webhooks.RotateSigningSecretRequest body) { this.body = body; diff --git a/src/main/java/com/google/genai/gaos/models/operations/RunTriggerRequest.java b/src/main/java/com/google/genai/gaos/models/operations/RunTriggerRequest.java index 5fe41bb34b8..cab7a4014d5 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/RunTriggerRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/RunTriggerRequest.java @@ -31,15 +31,15 @@ public class RunTriggerRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; /** - * Resource name of the trigger. + * Required. The ID of the trigger to run immediately. */ - @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=trigger_id") + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=triggerId") private String triggerId; @JsonCreator @@ -57,14 +57,14 @@ public RunTriggerRequest( } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); } /** - * Resource name of the trigger. + * Required. The ID of the trigger to run immediately. */ public Optional triggerId() { return Optional.ofNullable(this.triggerId); @@ -76,7 +76,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public RunTriggerRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -85,7 +85,7 @@ public RunTriggerRequest withApiVersion(@Nullable String apiVersion) { /** - * Resource name of the trigger. + * Required. The ID of the trigger to run immediately. */ public RunTriggerRequest withTriggerId(@Nonnull String triggerId) { this.triggerId = Utils.checkNotNull(triggerId, "triggerId"); @@ -132,7 +132,7 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -140,7 +140,7 @@ public Builder apiVersion(@Nullable String apiVersion) { } /** - * Resource name of the trigger. + * Required. The ID of the trigger to run immediately. */ public Builder triggerId(@Nonnull String triggerId) { this.triggerId = Utils.checkNotNull(triggerId, "triggerId"); diff --git a/src/main/java/com/google/genai/gaos/models/operations/UpdateTriggerRequest.java b/src/main/java/com/google/genai/gaos/models/operations/UpdateTriggerRequest.java index 867287ba675..d76217e7c4e 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/UpdateTriggerRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/UpdateTriggerRequest.java @@ -32,18 +32,20 @@ public class UpdateTriggerRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; /** - * Resource name of the trigger. + * Required. The ID of the trigger to update. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=id") private String id; - + /** + * Required. The trigger with updated fields. + */ @SpeakeasyMetadata("request:mediaType=application/json") private TriggerUpdate body; @@ -66,19 +68,22 @@ public UpdateTriggerRequest( } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); } /** - * Resource name of the trigger. + * Required. The ID of the trigger to update. */ public Optional id() { return Optional.ofNullable(this.id); } + /** + * Required. The trigger with updated fields. + */ public Optional body() { return Optional.ofNullable(this.body); } @@ -89,7 +94,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public UpdateTriggerRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -98,7 +103,7 @@ public UpdateTriggerRequest withApiVersion(@Nullable String apiVersion) { /** - * Resource name of the trigger. + * Required. The ID of the trigger to update. */ public UpdateTriggerRequest withId(@Nonnull String id) { this.id = Utils.checkNotNull(id, "id"); @@ -106,6 +111,9 @@ public UpdateTriggerRequest withId(@Nonnull String id) { } + /** + * Required. The trigger with updated fields. + */ public UpdateTriggerRequest withBody(@Nonnull TriggerUpdate body) { this.body = Utils.checkNotNull(body, "body"); return this; @@ -155,7 +163,7 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -163,13 +171,16 @@ public Builder apiVersion(@Nullable String apiVersion) { } /** - * Resource name of the trigger. + * Required. The ID of the trigger to update. */ public Builder id(@Nonnull String id) { this.id = Utils.checkNotNull(id, "id"); return this; } + /** + * Required. The trigger with updated fields. + */ public Builder body(@Nonnull TriggerUpdate body) { this.body = Utils.checkNotNull(body, "body"); return this; diff --git a/src/main/java/com/google/genai/gaos/models/operations/UpdateWebhookRequest.java b/src/main/java/com/google/genai/gaos/models/operations/UpdateWebhookRequest.java index 616918d30b4..541859f3d85 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/UpdateWebhookRequest.java +++ b/src/main/java/com/google/genai/gaos/models/operations/UpdateWebhookRequest.java @@ -32,7 +32,7 @@ public class UpdateWebhookRequest { /** - * Which version of the API to use. + * API version for request routing. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=api_version") private String apiVersion; @@ -44,13 +44,13 @@ public class UpdateWebhookRequest { private String id; /** - * Optional. The list of fields to update. + * Optional list of fields to update. */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=update_mask") private String updateMask; /** - * Required. The webhook to update. + * Required. The HTTP body of the payload. */ @SpeakeasyMetadata("request:mediaType=application/json") private WebhookUpdate body; @@ -75,7 +75,7 @@ public UpdateWebhookRequest( } /** - * Which version of the API to use. + * API version for request routing. */ public Optional apiVersion() { return Optional.ofNullable(this.apiVersion); @@ -89,14 +89,14 @@ public Optional id() { } /** - * Optional. The list of fields to update. + * Optional list of fields to update. */ public Optional updateMask() { return Optional.ofNullable(this.updateMask); } /** - * Required. The webhook to update. + * Required. The HTTP body of the payload. */ public Optional body() { return Optional.ofNullable(this.body); @@ -108,7 +108,7 @@ public static Builder builder() { /** - * Which version of the API to use. + * API version for request routing. */ public UpdateWebhookRequest withApiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -126,7 +126,7 @@ public UpdateWebhookRequest withId(@Nonnull String id) { /** - * Optional. The list of fields to update. + * Optional list of fields to update. */ public UpdateWebhookRequest withUpdateMask(@Nullable String updateMask) { this.updateMask = updateMask; @@ -135,7 +135,7 @@ public UpdateWebhookRequest withUpdateMask(@Nullable String updateMask) { /** - * Required. The webhook to update. + * Required. The HTTP body of the payload. */ public UpdateWebhookRequest withBody(@Nullable WebhookUpdate body) { this.body = body; @@ -191,7 +191,7 @@ private Builder() { } /** - * Which version of the API to use. + * API version for request routing. */ public Builder apiVersion(@Nullable String apiVersion) { this.apiVersion = apiVersion; @@ -207,7 +207,7 @@ public Builder id(@Nonnull String id) { } /** - * Optional. The list of fields to update. + * Optional list of fields to update. */ public Builder updateMask(@Nullable String updateMask) { this.updateMask = updateMask; @@ -215,7 +215,7 @@ public Builder updateMask(@Nullable String updateMask) { } /** - * Required. The webhook to update. + * Required. The HTTP body of the payload. */ public Builder body(@Nullable WebhookUpdate body) { this.body = body; diff --git a/src/main/java/com/google/genai/gaos/models/operations/async/CancelInteractionByIdResponse.java b/src/main/java/com/google/genai/gaos/models/operations/async/CancelInteractionByIdResponse.java index f6fd493541d..98e0d1a9773 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/async/CancelInteractionByIdResponse.java +++ b/src/main/java/com/google/genai/gaos/models/operations/async/CancelInteractionByIdResponse.java @@ -49,7 +49,7 @@ public class CancelInteractionByIdResponse implements AsyncResponse { private HttpResponse rawResponse; /** - * Successful cancellation of the interaction. + * Successful operation */ private Interaction interaction; @@ -100,7 +100,7 @@ public HttpResponse rawResponse() { } /** - * Successful cancellation of the interaction. + * Successful operation */ public Optional interaction() { return Optional.ofNullable(this.interaction); @@ -139,7 +139,7 @@ public CancelInteractionByIdResponse withRawResponse(@Nonnull HttpResponse rawResponse) { } /** - * Successful cancellation of the interaction. + * Successful operation */ public Builder interaction(@Nullable Interaction interaction) { this.interaction = interaction; diff --git a/src/main/java/com/google/genai/gaos/models/operations/async/ListTriggerExecutionsRequestBuilder.java b/src/main/java/com/google/genai/gaos/models/operations/async/ListTriggerExecutionsRequestBuilder.java index 875897a0ec2..0cbb2152966 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/async/ListTriggerExecutionsRequestBuilder.java +++ b/src/main/java/com/google/genai/gaos/models/operations/async/ListTriggerExecutionsRequestBuilder.java @@ -31,7 +31,7 @@ import com.google.genai.gaos.utils.Utils; import jakarta.annotation.Nonnull; import jakarta.annotation.Nullable; -import java.lang.Long; +import java.lang.Integer; import java.lang.String; import java.util.concurrent.CompletableFuture; @@ -55,20 +55,20 @@ public ListTriggerExecutionsRequestBuilder apiVersion(@Nullable String apiVersio return this; } - public ListTriggerExecutionsRequestBuilder triggerId(@Nonnull String triggerId) { - this.pojoBuilder.triggerId(triggerId); + public ListTriggerExecutionsRequestBuilder pageSize(@Nullable Integer pageSize) { + this.pojoBuilder.pageSize(pageSize); this._setterCalled = true; return this; } - public ListTriggerExecutionsRequestBuilder pageSize(@Nullable Long pageSize) { - this.pojoBuilder.pageSize(pageSize); + public ListTriggerExecutionsRequestBuilder pageToken(@Nullable String pageToken) { + this.pojoBuilder.pageToken(pageToken); this._setterCalled = true; return this; } - public ListTriggerExecutionsRequestBuilder pageToken(@Nullable String pageToken) { - this.pojoBuilder.pageToken(pageToken); + public ListTriggerExecutionsRequestBuilder triggerId(@Nonnull String triggerId) { + this.pojoBuilder.triggerId(triggerId); this._setterCalled = true; return this; } diff --git a/src/main/java/com/google/genai/gaos/models/operations/async/ListTriggersRequestBuilder.java b/src/main/java/com/google/genai/gaos/models/operations/async/ListTriggersRequestBuilder.java index 0efd2410085..cb79cc3badd 100644 --- a/src/main/java/com/google/genai/gaos/models/operations/async/ListTriggersRequestBuilder.java +++ b/src/main/java/com/google/genai/gaos/models/operations/async/ListTriggersRequestBuilder.java @@ -30,7 +30,7 @@ import com.google.genai.gaos.utils.RetryConfig; import com.google.genai.gaos.utils.Utils; import jakarta.annotation.Nullable; -import java.lang.Long; +import java.lang.Integer; import java.lang.String; import java.util.concurrent.CompletableFuture; @@ -60,7 +60,7 @@ public ListTriggersRequestBuilder filter(@Nullable String filter) { return this; } - public ListTriggersRequestBuilder pageSize(@Nullable Long pageSize) { + public ListTriggersRequestBuilder pageSize(@Nullable Integer pageSize) { this.pojoBuilder.pageSize(pageSize); this._setterCalled = true; return this; diff --git a/src/main/java/com/google/genai/gaos/models/triggers/TriggerCreateParams.java b/src/main/java/com/google/genai/gaos/models/triggers/TriggerCreateParams.java index 64365bb08cd..32a0204efa1 100644 --- a/src/main/java/com/google/genai/gaos/models/triggers/TriggerCreateParams.java +++ b/src/main/java/com/google/genai/gaos/models/triggers/TriggerCreateParams.java @@ -65,15 +65,16 @@ public class TriggerCreateParams { private Interaction interaction; /** - * Optional. The maximum number of consecutive failures allowed before the trigger is automatically - * paused (status becomes ERROR). + * Optional. The maximum number of consecutive failures allowed before + * the trigger is automatically paused (status becomes ERROR). */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("max_consecutive_failures") private Integer maxConsecutiveFailures; /** - * Required. The cron schedule on which the trigger should run. Standard cron format. + * Required. The cron schedule on which the trigger should run. + * Standard cron format. */ @JsonProperty("schedule") private String schedule; @@ -143,15 +144,16 @@ public Optional interaction() { } /** - * Optional. The maximum number of consecutive failures allowed before the trigger is automatically - * paused (status becomes ERROR). + * Optional. The maximum number of consecutive failures allowed before + * the trigger is automatically paused (status becomes ERROR). */ public Optional maxConsecutiveFailures() { return Optional.ofNullable(this.maxConsecutiveFailures); } /** - * Required. The cron schedule on which the trigger should run. Standard cron format. + * Required. The cron schedule on which the trigger should run. + * Standard cron format. */ public Optional schedule() { return Optional.ofNullable(this.schedule); @@ -206,8 +208,8 @@ public TriggerCreateParams withInteraction(@Nonnull Interaction interaction) { /** - * Optional. The maximum number of consecutive failures allowed before the trigger is automatically - * paused (status becomes ERROR). + * Optional. The maximum number of consecutive failures allowed before + * the trigger is automatically paused (status becomes ERROR). */ public TriggerCreateParams withMaxConsecutiveFailures(@Nullable Integer maxConsecutiveFailures) { this.maxConsecutiveFailures = maxConsecutiveFailures; @@ -216,7 +218,8 @@ public TriggerCreateParams withMaxConsecutiveFailures(@Nullable Integer maxConse /** - * Required. The cron schedule on which the trigger should run. Standard cron format. + * Required. The cron schedule on which the trigger should run. + * Standard cron format. */ public TriggerCreateParams withSchedule(@Nonnull String schedule) { this.schedule = Utils.checkNotNull(schedule, "schedule"); @@ -326,8 +329,8 @@ public Builder interaction(@Nonnull Interaction interaction) { } /** - * Optional. The maximum number of consecutive failures allowed before the trigger is automatically - * paused (status becomes ERROR). + * Optional. The maximum number of consecutive failures allowed before + * the trigger is automatically paused (status becomes ERROR). */ public Builder maxConsecutiveFailures(@Nullable Integer maxConsecutiveFailures) { this.maxConsecutiveFailures = maxConsecutiveFailures; @@ -335,7 +338,8 @@ public Builder maxConsecutiveFailures(@Nullable Integer maxConsecutiveFailures) } /** - * Required. The cron schedule on which the trigger should run. Standard cron format. + * Required. The cron schedule on which the trigger should run. + * Standard cron format. */ public Builder schedule(@Nonnull String schedule) { this.schedule = Utils.checkNotNull(schedule, "schedule"); diff --git a/src/main/java/com/google/genai/gaos/operations/CancelInteractionById.java b/src/main/java/com/google/genai/gaos/operations/CancelInteractionById.java index 66368d664de..99cd6dcc3a5 100644 --- a/src/main/java/com/google/genai/gaos/operations/CancelInteractionById.java +++ b/src/main/java/com/google/genai/gaos/operations/CancelInteractionById.java @@ -135,7 +135,7 @@ HttpRequest buildRequest(T request, Class klass) throws Exception { String url = Utils.generateURL( klass, this.baseUrl, - "/{api_version}/interactions/{id}/cancel", + "/{api_version}/interactions/{interactionsId}/cancel", request, this.operationGlobals); HTTPRequest req = new HTTPRequest(url, "POST"); req.addHeader("Accept", "application/json") diff --git a/src/main/java/com/google/genai/gaos/operations/CreateTrigger.java b/src/main/java/com/google/genai/gaos/operations/CreateTrigger.java index c15b423883a..483153044cc 100644 --- a/src/main/java/com/google/genai/gaos/operations/CreateTrigger.java +++ b/src/main/java/com/google/genai/gaos/operations/CreateTrigger.java @@ -229,13 +229,6 @@ public CreateTriggerResponse handleResponse(HttpResponse response) CreateTriggerResponse res = resBuilder.build(); - if (Utils.statusCodeMatches(response.statusCode(), "200")) { - if (Utils.contentTypeMatches(contentType, "application/json")) { - return res.withTrigger(Utils.unmarshal(response, new TypeReference() {})); - } else { - throw GaosApiException.from("Unexpected content-type received: " + contentType, response); - } - } if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { // no content throw GaosApiException.from("API error occurred", response); @@ -244,6 +237,13 @@ public CreateTriggerResponse handleResponse(HttpResponse response) // no content throw GaosApiException.from("API error occurred", response); } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withTrigger(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw GaosApiException.from("Unexpected content-type received: " + contentType, response); + } + } throw GaosApiException.from("Unexpected status code received: " + response.statusCode(), response); } } @@ -316,13 +316,6 @@ public com.google.genai.gaos.models.operations.async.CreateTriggerResponse handl com.google.genai.gaos.models.operations.async.CreateTriggerResponse res = resBuilder.build(); - if (Utils.statusCodeMatches(response.statusCode(), "200")) { - if (Utils.contentTypeMatches(contentType, "application/json")) { - return res.withTrigger(Utils.unmarshal(response, new TypeReference() {})); - } else { - throw GaosApiException.from("Unexpected content-type received: " + contentType, response); - } - } if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { // no content throw GaosApiException.from("API error occurred", response); @@ -331,6 +324,13 @@ public com.google.genai.gaos.models.operations.async.CreateTriggerResponse handl // no content throw GaosApiException.from("API error occurred", response); } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withTrigger(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw GaosApiException.from("Unexpected content-type received: " + contentType, response); + } + } throw GaosApiException.from("Unexpected status code received: " + response.statusCode(), response); } } diff --git a/src/main/java/com/google/genai/gaos/operations/DeleteAgent.java b/src/main/java/com/google/genai/gaos/operations/DeleteAgent.java index 24ee00de123..8b957ec0cc1 100644 --- a/src/main/java/com/google/genai/gaos/operations/DeleteAgent.java +++ b/src/main/java/com/google/genai/gaos/operations/DeleteAgent.java @@ -133,7 +133,7 @@ HttpRequest buildRequest(T request, Class klass) throws Exception { String url = Utils.generateURL( klass, this.baseUrl, - "/{api_version}/agents/{id}", + "/{api_version}/agents/{agentsId}", request, this.operationGlobals); HTTPRequest req = new HTTPRequest(url, "DELETE"); req.addHeader("Accept", "application/json") diff --git a/src/main/java/com/google/genai/gaos/operations/DeleteInteraction.java b/src/main/java/com/google/genai/gaos/operations/DeleteInteraction.java index 213b9ce1e34..0588274154d 100644 --- a/src/main/java/com/google/genai/gaos/operations/DeleteInteraction.java +++ b/src/main/java/com/google/genai/gaos/operations/DeleteInteraction.java @@ -133,7 +133,7 @@ HttpRequest buildRequest(T request, Class klass) throws Exception { String url = Utils.generateURL( klass, this.baseUrl, - "/{api_version}/interactions/{id}", + "/{api_version}/interactions/{interactionsId}", request, this.operationGlobals); HTTPRequest req = new HTTPRequest(url, "DELETE"); req.addHeader("Accept", "application/json") diff --git a/src/main/java/com/google/genai/gaos/operations/DeleteTrigger.java b/src/main/java/com/google/genai/gaos/operations/DeleteTrigger.java index adf5cd9179c..8e30c3065dd 100644 --- a/src/main/java/com/google/genai/gaos/operations/DeleteTrigger.java +++ b/src/main/java/com/google/genai/gaos/operations/DeleteTrigger.java @@ -212,13 +212,6 @@ public DeleteTriggerResponse handleResponse(HttpResponse response) DeleteTriggerResponse res = resBuilder.build(); - if (Utils.statusCodeMatches(response.statusCode(), "200")) { - if (Utils.contentTypeMatches(contentType, "application/json")) { - return res.withEmpty(Utils.unmarshal(response, new TypeReference() {})); - } else { - throw GaosApiException.from("Unexpected content-type received: " + contentType, response); - } - } if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { // no content throw GaosApiException.from("API error occurred", response); @@ -227,6 +220,13 @@ public DeleteTriggerResponse handleResponse(HttpResponse response) // no content throw GaosApiException.from("API error occurred", response); } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withEmpty(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw GaosApiException.from("Unexpected content-type received: " + contentType, response); + } + } throw GaosApiException.from("Unexpected status code received: " + response.statusCode(), response); } } @@ -299,13 +299,6 @@ public com.google.genai.gaos.models.operations.async.DeleteTriggerResponse handl com.google.genai.gaos.models.operations.async.DeleteTriggerResponse res = resBuilder.build(); - if (Utils.statusCodeMatches(response.statusCode(), "200")) { - if (Utils.contentTypeMatches(contentType, "application/json")) { - return res.withEmpty(Utils.unmarshal(response, new TypeReference() {})); - } else { - throw GaosApiException.from("Unexpected content-type received: " + contentType, response); - } - } if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { // no content throw GaosApiException.from("API error occurred", response); @@ -314,6 +307,13 @@ public com.google.genai.gaos.models.operations.async.DeleteTriggerResponse handl // no content throw GaosApiException.from("API error occurred", response); } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withEmpty(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw GaosApiException.from("Unexpected content-type received: " + contentType, response); + } + } throw GaosApiException.from("Unexpected status code received: " + response.statusCode(), response); } } diff --git a/src/main/java/com/google/genai/gaos/operations/GetAgent.java b/src/main/java/com/google/genai/gaos/operations/GetAgent.java index 6dcc96835be..7d10ca96f87 100644 --- a/src/main/java/com/google/genai/gaos/operations/GetAgent.java +++ b/src/main/java/com/google/genai/gaos/operations/GetAgent.java @@ -133,7 +133,7 @@ HttpRequest buildRequest(T request, Class klass) throws Exception { String url = Utils.generateURL( klass, this.baseUrl, - "/{api_version}/agents/{id}", + "/{api_version}/agents/{agentsId}", request, this.operationGlobals); HTTPRequest req = new HTTPRequest(url, "GET"); req.addHeader("Accept", "application/json") diff --git a/src/main/java/com/google/genai/gaos/operations/GetInteractionById.java b/src/main/java/com/google/genai/gaos/operations/GetInteractionById.java index 6f0726ce246..820de9821ac 100644 --- a/src/main/java/com/google/genai/gaos/operations/GetInteractionById.java +++ b/src/main/java/com/google/genai/gaos/operations/GetInteractionById.java @@ -135,7 +135,7 @@ HttpRequest buildRequest(T request, Class klass) throws Exception { String url = Utils.generateURL( klass, this.baseUrl, - "/{api_version}/interactions/{id}", + "/{api_version}/interactions/{interactionsId}", request, this.operationGlobals); HTTPRequest req = new HTTPRequest(url, "GET"); req.addHeader("Accept", "application/json;q=1, text/event-stream;q=0") diff --git a/src/main/java/com/google/genai/gaos/operations/GetTrigger.java b/src/main/java/com/google/genai/gaos/operations/GetTrigger.java index 4f7a0c9b46a..38cb28c8ee0 100644 --- a/src/main/java/com/google/genai/gaos/operations/GetTrigger.java +++ b/src/main/java/com/google/genai/gaos/operations/GetTrigger.java @@ -212,13 +212,6 @@ public GetTriggerResponse handleResponse(HttpResponse response) { GetTriggerResponse res = resBuilder.build(); - if (Utils.statusCodeMatches(response.statusCode(), "200")) { - if (Utils.contentTypeMatches(contentType, "application/json")) { - return res.withTrigger(Utils.unmarshal(response, new TypeReference() {})); - } else { - throw GaosApiException.from("Unexpected content-type received: " + contentType, response); - } - } if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { // no content throw GaosApiException.from("API error occurred", response); @@ -227,6 +220,13 @@ public GetTriggerResponse handleResponse(HttpResponse response) { // no content throw GaosApiException.from("API error occurred", response); } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withTrigger(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw GaosApiException.from("Unexpected content-type received: " + contentType, response); + } + } throw GaosApiException.from("Unexpected status code received: " + response.statusCode(), response); } } @@ -299,13 +299,6 @@ public com.google.genai.gaos.models.operations.async.GetTriggerResponse handleRe com.google.genai.gaos.models.operations.async.GetTriggerResponse res = resBuilder.build(); - if (Utils.statusCodeMatches(response.statusCode(), "200")) { - if (Utils.contentTypeMatches(contentType, "application/json")) { - return res.withTrigger(Utils.unmarshal(response, new TypeReference() {})); - } else { - throw GaosApiException.from("Unexpected content-type received: " + contentType, response); - } - } if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { // no content throw GaosApiException.from("API error occurred", response); @@ -314,6 +307,13 @@ public com.google.genai.gaos.models.operations.async.GetTriggerResponse handleRe // no content throw GaosApiException.from("API error occurred", response); } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withTrigger(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw GaosApiException.from("Unexpected content-type received: " + contentType, response); + } + } throw GaosApiException.from("Unexpected status code received: " + response.statusCode(), response); } } diff --git a/src/main/java/com/google/genai/gaos/operations/ListTriggerExecutions.java b/src/main/java/com/google/genai/gaos/operations/ListTriggerExecutions.java index 52017d98fc4..3c51eb361d3 100644 --- a/src/main/java/com/google/genai/gaos/operations/ListTriggerExecutions.java +++ b/src/main/java/com/google/genai/gaos/operations/ListTriggerExecutions.java @@ -132,7 +132,7 @@ HttpRequest buildRequest(T request, Class klass) throws Exception { String url = Utils.generateURL( klass, this.baseUrl, - "/{api_version}/triggers/{trigger_id}/executions", + "/{api_version}/triggers/{triggerId}/executions", request, this.operationGlobals); HTTPRequest req = new HTTPRequest(url, "GET"); req.addHeader("Accept", "application/json") @@ -216,13 +216,6 @@ public ListTriggerExecutionsResponse handleResponse(HttpResponse re ListTriggerExecutionsResponse res = resBuilder.build(); - if (Utils.statusCodeMatches(response.statusCode(), "200")) { - if (Utils.contentTypeMatches(contentType, "application/json")) { - return res.withListTriggerExecutionsResponse(Utils.unmarshal(response, new TypeReference() {})); - } else { - throw GaosApiException.from("Unexpected content-type received: " + contentType, response); - } - } if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { // no content throw GaosApiException.from("API error occurred", response); @@ -231,6 +224,13 @@ public ListTriggerExecutionsResponse handleResponse(HttpResponse re // no content throw GaosApiException.from("API error occurred", response); } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withListTriggerExecutionsResponse(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw GaosApiException.from("Unexpected content-type received: " + contentType, response); + } + } throw GaosApiException.from("Unexpected status code received: " + response.statusCode(), response); } } @@ -303,13 +303,6 @@ public com.google.genai.gaos.models.operations.async.ListTriggerExecutionsRespon com.google.genai.gaos.models.operations.async.ListTriggerExecutionsResponse res = resBuilder.build(); - if (Utils.statusCodeMatches(response.statusCode(), "200")) { - if (Utils.contentTypeMatches(contentType, "application/json")) { - return res.withListTriggerExecutionsResponse(Utils.unmarshal(response, new TypeReference() {})); - } else { - throw GaosApiException.from("Unexpected content-type received: " + contentType, response); - } - } if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { // no content throw GaosApiException.from("API error occurred", response); @@ -318,6 +311,13 @@ public com.google.genai.gaos.models.operations.async.ListTriggerExecutionsRespon // no content throw GaosApiException.from("API error occurred", response); } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withListTriggerExecutionsResponse(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw GaosApiException.from("Unexpected content-type received: " + contentType, response); + } + } throw GaosApiException.from("Unexpected status code received: " + response.statusCode(), response); } } diff --git a/src/main/java/com/google/genai/gaos/operations/ListTriggers.java b/src/main/java/com/google/genai/gaos/operations/ListTriggers.java index b8e69c3bcb8..478922d3c85 100644 --- a/src/main/java/com/google/genai/gaos/operations/ListTriggers.java +++ b/src/main/java/com/google/genai/gaos/operations/ListTriggers.java @@ -216,13 +216,6 @@ public ListTriggersResponse handleResponse(HttpResponse response) { ListTriggersResponse res = resBuilder.build(); - if (Utils.statusCodeMatches(response.statusCode(), "200")) { - if (Utils.contentTypeMatches(contentType, "application/json")) { - return res.withListTriggersResponse(Utils.unmarshal(response, new TypeReference() {})); - } else { - throw GaosApiException.from("Unexpected content-type received: " + contentType, response); - } - } if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { // no content throw GaosApiException.from("API error occurred", response); @@ -231,6 +224,13 @@ public ListTriggersResponse handleResponse(HttpResponse response) { // no content throw GaosApiException.from("API error occurred", response); } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withListTriggersResponse(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw GaosApiException.from("Unexpected content-type received: " + contentType, response); + } + } throw GaosApiException.from("Unexpected status code received: " + response.statusCode(), response); } } @@ -303,13 +303,6 @@ public com.google.genai.gaos.models.operations.async.ListTriggersResponse handle com.google.genai.gaos.models.operations.async.ListTriggersResponse res = resBuilder.build(); - if (Utils.statusCodeMatches(response.statusCode(), "200")) { - if (Utils.contentTypeMatches(contentType, "application/json")) { - return res.withListTriggersResponse(Utils.unmarshal(response, new TypeReference() {})); - } else { - throw GaosApiException.from("Unexpected content-type received: " + contentType, response); - } - } if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { // no content throw GaosApiException.from("API error occurred", response); @@ -318,6 +311,13 @@ public com.google.genai.gaos.models.operations.async.ListTriggersResponse handle // no content throw GaosApiException.from("API error occurred", response); } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withListTriggersResponse(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw GaosApiException.from("Unexpected content-type received: " + contentType, response); + } + } throw GaosApiException.from("Unexpected status code received: " + response.statusCode(), response); } } diff --git a/src/main/java/com/google/genai/gaos/operations/RunTrigger.java b/src/main/java/com/google/genai/gaos/operations/RunTrigger.java index d4cd3df22ea..6cc54730c7e 100644 --- a/src/main/java/com/google/genai/gaos/operations/RunTrigger.java +++ b/src/main/java/com/google/genai/gaos/operations/RunTrigger.java @@ -133,7 +133,7 @@ HttpRequest buildRequest(T request, Class klass) throws Exception { String url = Utils.generateURL( klass, this.baseUrl, - "/{api_version}/triggers/{trigger_id}/executions", + "/{api_version}/triggers/{triggerId}/executions", request, this.operationGlobals); HTTPRequest req = new HTTPRequest(url, "POST"); req.addHeader("Accept", "application/json") @@ -212,13 +212,6 @@ public RunTriggerResponse handleResponse(HttpResponse response) { RunTriggerResponse res = resBuilder.build(); - if (Utils.statusCodeMatches(response.statusCode(), "200")) { - if (Utils.contentTypeMatches(contentType, "application/json")) { - return res.withTriggerExecution(Utils.unmarshal(response, new TypeReference() {})); - } else { - throw GaosApiException.from("Unexpected content-type received: " + contentType, response); - } - } if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { // no content throw GaosApiException.from("API error occurred", response); @@ -227,6 +220,13 @@ public RunTriggerResponse handleResponse(HttpResponse response) { // no content throw GaosApiException.from("API error occurred", response); } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withTriggerExecution(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw GaosApiException.from("Unexpected content-type received: " + contentType, response); + } + } throw GaosApiException.from("Unexpected status code received: " + response.statusCode(), response); } } @@ -299,13 +299,6 @@ public com.google.genai.gaos.models.operations.async.RunTriggerResponse handleRe com.google.genai.gaos.models.operations.async.RunTriggerResponse res = resBuilder.build(); - if (Utils.statusCodeMatches(response.statusCode(), "200")) { - if (Utils.contentTypeMatches(contentType, "application/json")) { - return res.withTriggerExecution(Utils.unmarshal(response, new TypeReference() {})); - } else { - throw GaosApiException.from("Unexpected content-type received: " + contentType, response); - } - } if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { // no content throw GaosApiException.from("API error occurred", response); @@ -314,6 +307,13 @@ public com.google.genai.gaos.models.operations.async.RunTriggerResponse handleRe // no content throw GaosApiException.from("API error occurred", response); } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withTriggerExecution(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw GaosApiException.from("Unexpected content-type received: " + contentType, response); + } + } throw GaosApiException.from("Unexpected status code received: " + response.statusCode(), response); } } diff --git a/src/main/java/com/google/genai/gaos/operations/UpdateTrigger.java b/src/main/java/com/google/genai/gaos/operations/UpdateTrigger.java index 3b9af99c533..d59a209c54a 100644 --- a/src/main/java/com/google/genai/gaos/operations/UpdateTrigger.java +++ b/src/main/java/com/google/genai/gaos/operations/UpdateTrigger.java @@ -229,13 +229,6 @@ public UpdateTriggerResponse handleResponse(HttpResponse response) UpdateTriggerResponse res = resBuilder.build(); - if (Utils.statusCodeMatches(response.statusCode(), "200")) { - if (Utils.contentTypeMatches(contentType, "application/json")) { - return res.withTrigger(Utils.unmarshal(response, new TypeReference() {})); - } else { - throw GaosApiException.from("Unexpected content-type received: " + contentType, response); - } - } if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { // no content throw GaosApiException.from("API error occurred", response); @@ -244,6 +237,13 @@ public UpdateTriggerResponse handleResponse(HttpResponse response) // no content throw GaosApiException.from("API error occurred", response); } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withTrigger(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw GaosApiException.from("Unexpected content-type received: " + contentType, response); + } + } throw GaosApiException.from("Unexpected status code received: " + response.statusCode(), response); } } @@ -316,13 +316,6 @@ public com.google.genai.gaos.models.operations.async.UpdateTriggerResponse handl com.google.genai.gaos.models.operations.async.UpdateTriggerResponse res = resBuilder.build(); - if (Utils.statusCodeMatches(response.statusCode(), "200")) { - if (Utils.contentTypeMatches(contentType, "application/json")) { - return res.withTrigger(Utils.unmarshal(response, new TypeReference() {})); - } else { - throw GaosApiException.from("Unexpected content-type received: " + contentType, response); - } - } if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { // no content throw GaosApiException.from("API error occurred", response); @@ -331,6 +324,13 @@ public com.google.genai.gaos.models.operations.async.UpdateTriggerResponse handl // no content throw GaosApiException.from("API error occurred", response); } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withTrigger(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw GaosApiException.from("Unexpected content-type received: " + contentType, response); + } + } throw GaosApiException.from("Unexpected status code received: " + response.statusCode(), response); } } diff --git a/src/test/java/com/google/genai/GaosClientTest.java b/src/test/java/com/google/genai/GaosClientTest.java index 6906ef0d883..a3747b79d48 100644 --- a/src/test/java/com/google/genai/GaosClientTest.java +++ b/src/test/java/com/google/genai/GaosClientTest.java @@ -284,11 +284,7 @@ public CompletableFuture> sendAsync(HttpRequest reques assertNotNull(req); assertEquals("GET", req.method()); assertEquals( - URI.create( - expectedUrlPrefix - + "/interactions/" - + interactionId - + "?include_input=false&stream=false"), + URI.create(expectedUrlPrefix + "/interactions/" + interactionId), req.uri()); // 2. Test Cancel