From 4e852b8dbf372efbca129fd9d58c5070996d64a9 Mon Sep 17 00:00:00 2001 From: Google Team Member Date: Mon, 20 Jul 2026 17:50:08 -0700 Subject: [PATCH] feat: Add sandbox templates and snapshots submodules to the Vertex AI GenAI SDK for Java. Adds the Agent Engine sandbox `templates` and `snapshots` submodules to the Java SDK, exposed as `agentEngines.sandboxes.templates` and `agentEngines.sandboxes.snapshots`, matching the Python SDK surface. FUTURE_COPYBARA_INTEGRATE_REVIEW=https://github.com/googleapis/java-vertexai/pull/125 from googleapis:release-please--branches--main 6e2097c7356cd055a732e7a5171d4a2f7729af87 PiperOrigin-RevId: 951151577 --- .../agentplatform/AsyncSandboxSnapshots.java | 118 ++++ .../agentplatform/AsyncSandboxTemplates.java | 121 ++++ .../cloud/agentplatform/AsyncSandboxes.java | 5 + .../cloud/agentplatform/SandboxSnapshots.java | 576 +++++++++++++++++ .../cloud/agentplatform/SandboxTemplates.java | 585 ++++++++++++++++++ .../google/cloud/agentplatform/Sandboxes.java | 4 + .../AgentEngineSandboxSnapshotOperation.java | 201 ++++++ ...reateAgentEngineSandboxSnapshotConfig.java | 175 ++++++ ...xEnvironmentSnapshotRequestParameters.java | 119 ++++ ...reateSandboxEnvironmentTemplateConfig.java | 218 +++++++ ...xEnvironmentTemplateRequestParameters.java | 141 +++++ .../types/DefaultContainerCategory.java | 108 ++++ ...eleteSandboxEnvironmentSnapshotConfig.java | 86 +++ ...teSandboxEnvironmentSnapshotOperation.java | 170 +++++ ...xEnvironmentSnapshotRequestParameters.java | 119 ++++ ...eleteSandboxEnvironmentTemplateConfig.java | 86 +++ ...teSandboxEnvironmentTemplateOperation.java | 170 +++++ ...xEnvironmentTemplateRequestParameters.java | 119 ++++ ...ineSandboxSnapshotOperationParameters.java | 119 ++++ .../GetSandboxEnvironmentSnapshotConfig.java | 85 +++ ...xEnvironmentSnapshotRequestParameters.java | 119 ++++ .../GetSandboxEnvironmentTemplateConfig.java | 85 +++ ...nvironmentTemplateOperationParameters.java | 119 ++++ ...xEnvironmentTemplateRequestParameters.java | 119 ++++ ...ListSandboxEnvironmentSnapshotsConfig.java | 151 +++++ ...EnvironmentSnapshotsRequestParameters.java | 119 ++++ ...stSandboxEnvironmentSnapshotsResponse.java | 161 +++++ ...ListSandboxEnvironmentTemplatesConfig.java | 151 +++++ ...EnvironmentTemplatesRequestParameters.java | 119 ++++ ...stSandboxEnvironmentTemplatesResponse.java | 161 +++++ .../types/PostSnapshotAction.java | 115 ++++ .../cloud/agentplatform/types/Protocol.java | 111 ++++ .../types/SandboxEnvironmentSnapshot.java | 354 +++++++++++ .../types/SandboxEnvironmentTemplate.java | 305 +++++++++ ...entTemplateCustomContainerEnvironment.java | 183 ++++++ ...nvironmentTemplateCustomContainerSpec.java | 91 +++ ...ntTemplateDefaultContainerEnvironment.java | 143 +++++ ...nvironmentTemplateEgressControlConfig.java | 85 +++ ...SandboxEnvironmentTemplateNetworkPort.java | 127 ++++ .../SandboxEnvironmentTemplateOperation.java | 201 ++++++ ...vironmentTemplateResourceRequirements.java | 119 ++++ .../AgentEnginesSandboxSnapshotsTest.java | 96 +++ .../AgentEnginesSandboxTemplatesTest.java | 121 ++++ 43 files changed, 6680 insertions(+) create mode 100644 src/main/java/com/google/cloud/agentplatform/AsyncSandboxSnapshots.java create mode 100644 src/main/java/com/google/cloud/agentplatform/AsyncSandboxTemplates.java create mode 100644 src/main/java/com/google/cloud/agentplatform/SandboxSnapshots.java create mode 100644 src/main/java/com/google/cloud/agentplatform/SandboxTemplates.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/AgentEngineSandboxSnapshotOperation.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/CreateAgentEngineSandboxSnapshotConfig.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/CreateSandboxEnvironmentSnapshotRequestParameters.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/CreateSandboxEnvironmentTemplateConfig.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/CreateSandboxEnvironmentTemplateRequestParameters.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/DefaultContainerCategory.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/DeleteSandboxEnvironmentSnapshotConfig.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/DeleteSandboxEnvironmentSnapshotOperation.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/DeleteSandboxEnvironmentSnapshotRequestParameters.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/DeleteSandboxEnvironmentTemplateConfig.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/DeleteSandboxEnvironmentTemplateOperation.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/DeleteSandboxEnvironmentTemplateRequestParameters.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/GetAgentEngineSandboxSnapshotOperationParameters.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/GetSandboxEnvironmentSnapshotConfig.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/GetSandboxEnvironmentSnapshotRequestParameters.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/GetSandboxEnvironmentTemplateConfig.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/GetSandboxEnvironmentTemplateOperationParameters.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/GetSandboxEnvironmentTemplateRequestParameters.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/ListSandboxEnvironmentSnapshotsConfig.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/ListSandboxEnvironmentSnapshotsRequestParameters.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/ListSandboxEnvironmentSnapshotsResponse.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/ListSandboxEnvironmentTemplatesConfig.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/ListSandboxEnvironmentTemplatesRequestParameters.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/ListSandboxEnvironmentTemplatesResponse.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/PostSnapshotAction.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/Protocol.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentSnapshot.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplate.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateCustomContainerEnvironment.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateCustomContainerSpec.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateDefaultContainerEnvironment.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateEgressControlConfig.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateNetworkPort.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateOperation.java create mode 100644 src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateResourceRequirements.java create mode 100644 src/test/java/com/google/cloud/agentplatform/AgentEnginesSandboxSnapshotsTest.java create mode 100644 src/test/java/com/google/cloud/agentplatform/AgentEnginesSandboxTemplatesTest.java diff --git a/src/main/java/com/google/cloud/agentplatform/AsyncSandboxSnapshots.java b/src/main/java/com/google/cloud/agentplatform/AsyncSandboxSnapshots.java new file mode 100644 index 0000000..1636bc8 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/AsyncSandboxSnapshots.java @@ -0,0 +1,118 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform; + +import com.google.cloud.agentplatform.types.AgentEngineSandboxSnapshotOperation; +import com.google.cloud.agentplatform.types.CreateAgentEngineSandboxSnapshotConfig; +import com.google.cloud.agentplatform.types.DeleteSandboxEnvironmentSnapshotConfig; +import com.google.cloud.agentplatform.types.DeleteSandboxEnvironmentSnapshotOperation; +import com.google.cloud.agentplatform.types.GetAgentEngineOperationConfig; +import com.google.cloud.agentplatform.types.GetSandboxEnvironmentSnapshotConfig; +import com.google.cloud.agentplatform.types.ListSandboxEnvironmentSnapshotsConfig; +import com.google.cloud.agentplatform.types.ListSandboxEnvironmentSnapshotsResponse; +import com.google.cloud.agentplatform.types.SandboxEnvironmentSnapshot; +import com.google.genai.ApiClient; +import com.google.genai.ApiResponse; +import com.google.genai.Common.BuiltRequest; +import java.util.concurrent.CompletableFuture; + +/** Async module of {@link SandboxSnapshots} */ +public final class AsyncSandboxSnapshots { + + SandboxSnapshots sandboxSnapshots; + ApiClient apiClient; + + public AsyncSandboxSnapshots(ApiClient apiClient) { + this.apiClient = apiClient; + this.sandboxSnapshots = new SandboxSnapshots(apiClient); + } + + CompletableFuture privateCreate( + String sourceSandboxEnvironmentName, CreateAgentEngineSandboxSnapshotConfig config) { + + BuiltRequest builtRequest = + sandboxSnapshots.buildRequestForPrivateCreate(sourceSandboxEnvironmentName, config); + return this.apiClient + .asyncRequest("post", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions()) + .thenApplyAsync( + response -> { + try (ApiResponse res = response) { + return sandboxSnapshots.processResponseForPrivateCreate(res, config); + } + }); + } + + CompletableFuture privateDelete( + String name, DeleteSandboxEnvironmentSnapshotConfig config) { + + BuiltRequest builtRequest = sandboxSnapshots.buildRequestForPrivateDelete(name, config); + return this.apiClient + .asyncRequest( + "delete", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions()) + .thenApplyAsync( + response -> { + try (ApiResponse res = response) { + return sandboxSnapshots.processResponseForPrivateDelete(res, config); + } + }); + } + + CompletableFuture privateGet( + String name, GetSandboxEnvironmentSnapshotConfig config) { + + BuiltRequest builtRequest = sandboxSnapshots.buildRequestForPrivateGet(name, config); + return this.apiClient + .asyncRequest("get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions()) + .thenApplyAsync( + response -> { + try (ApiResponse res = response) { + return sandboxSnapshots.processResponseForPrivateGet(res, config); + } + }); + } + + CompletableFuture privateList( + String name, ListSandboxEnvironmentSnapshotsConfig config) { + + BuiltRequest builtRequest = sandboxSnapshots.buildRequestForPrivateList(name, config); + return this.apiClient + .asyncRequest("get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions()) + .thenApplyAsync( + response -> { + try (ApiResponse res = response) { + return sandboxSnapshots.processResponseForPrivateList(res, config); + } + }); + } + + public CompletableFuture getSandboxSnapshotOperation( + String operationName, GetAgentEngineOperationConfig config) { + + BuiltRequest builtRequest = + sandboxSnapshots.buildRequestForGetSandboxSnapshotOperation(operationName, config); + return this.apiClient + .asyncRequest("get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions()) + .thenApplyAsync( + response -> { + try (ApiResponse res = response) { + return sandboxSnapshots.processResponseForGetSandboxSnapshotOperation(res, config); + } + }); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/AsyncSandboxTemplates.java b/src/main/java/com/google/cloud/agentplatform/AsyncSandboxTemplates.java new file mode 100644 index 0000000..a62eb50 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/AsyncSandboxTemplates.java @@ -0,0 +1,121 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform; + +import com.google.cloud.agentplatform.types.CreateSandboxEnvironmentTemplateConfig; +import com.google.cloud.agentplatform.types.DeleteSandboxEnvironmentTemplateConfig; +import com.google.cloud.agentplatform.types.DeleteSandboxEnvironmentTemplateOperation; +import com.google.cloud.agentplatform.types.GetAgentEngineOperationConfig; +import com.google.cloud.agentplatform.types.GetSandboxEnvironmentTemplateConfig; +import com.google.cloud.agentplatform.types.ListSandboxEnvironmentTemplatesConfig; +import com.google.cloud.agentplatform.types.ListSandboxEnvironmentTemplatesResponse; +import com.google.cloud.agentplatform.types.SandboxEnvironmentTemplate; +import com.google.cloud.agentplatform.types.SandboxEnvironmentTemplateOperation; +import com.google.genai.ApiClient; +import com.google.genai.ApiResponse; +import com.google.genai.Common.BuiltRequest; +import java.util.concurrent.CompletableFuture; + +/** Async module of {@link SandboxTemplates} */ +public final class AsyncSandboxTemplates { + + SandboxTemplates sandboxTemplates; + ApiClient apiClient; + + public AsyncSandboxTemplates(ApiClient apiClient) { + this.apiClient = apiClient; + this.sandboxTemplates = new SandboxTemplates(apiClient); + } + + CompletableFuture privateCreate( + String name, String displayName, CreateSandboxEnvironmentTemplateConfig config) { + + BuiltRequest builtRequest = + sandboxTemplates.buildRequestForPrivateCreate(name, displayName, config); + return this.apiClient + .asyncRequest("post", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions()) + .thenApplyAsync( + response -> { + try (ApiResponse res = response) { + return sandboxTemplates.processResponseForPrivateCreate(res, config); + } + }); + } + + CompletableFuture privateDelete( + String name, DeleteSandboxEnvironmentTemplateConfig config) { + + BuiltRequest builtRequest = sandboxTemplates.buildRequestForPrivateDelete(name, config); + return this.apiClient + .asyncRequest( + "delete", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions()) + .thenApplyAsync( + response -> { + try (ApiResponse res = response) { + return sandboxTemplates.processResponseForPrivateDelete(res, config); + } + }); + } + + CompletableFuture privateGet( + String name, GetSandboxEnvironmentTemplateConfig config) { + + BuiltRequest builtRequest = sandboxTemplates.buildRequestForPrivateGet(name, config); + return this.apiClient + .asyncRequest("get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions()) + .thenApplyAsync( + response -> { + try (ApiResponse res = response) { + return sandboxTemplates.processResponseForPrivateGet(res, config); + } + }); + } + + CompletableFuture privateList( + String name, ListSandboxEnvironmentTemplatesConfig config) { + + BuiltRequest builtRequest = sandboxTemplates.buildRequestForPrivateList(name, config); + return this.apiClient + .asyncRequest("get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions()) + .thenApplyAsync( + response -> { + try (ApiResponse res = response) { + return sandboxTemplates.processResponseForPrivateList(res, config); + } + }); + } + + public CompletableFuture + getSandboxEnvironmentTemplateOperation( + String operationName, GetAgentEngineOperationConfig config) { + + BuiltRequest builtRequest = + sandboxTemplates.buildRequestForGetSandboxEnvironmentTemplateOperation( + operationName, config); + return this.apiClient + .asyncRequest("get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions()) + .thenApplyAsync( + response -> { + try (ApiResponse res = response) { + return sandboxTemplates.processResponseForGetSandboxEnvironmentTemplateOperation( + res, config); + } + }); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/AsyncSandboxes.java b/src/main/java/com/google/cloud/agentplatform/AsyncSandboxes.java index 0b51029..4777717 100644 --- a/src/main/java/com/google/cloud/agentplatform/AsyncSandboxes.java +++ b/src/main/java/com/google/cloud/agentplatform/AsyncSandboxes.java @@ -39,6 +39,8 @@ /** Async module of {@link Sandboxes} */ public final class AsyncSandboxes { + public final AsyncSandboxTemplates templates; + public final AsyncSandboxSnapshots snapshots; Sandboxes sandboxes; ApiClient apiClient; @@ -46,6 +48,9 @@ public final class AsyncSandboxes { public AsyncSandboxes(ApiClient apiClient) { this.apiClient = apiClient; this.sandboxes = new Sandboxes(apiClient); + + this.templates = new AsyncSandboxTemplates(apiClient); + this.snapshots = new AsyncSandboxSnapshots(apiClient); } CompletableFuture privateCreate( diff --git a/src/main/java/com/google/cloud/agentplatform/SandboxSnapshots.java b/src/main/java/com/google/cloud/agentplatform/SandboxSnapshots.java new file mode 100644 index 0000000..b138f9d --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/SandboxSnapshots.java @@ -0,0 +1,576 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.google.cloud.agentplatform.types.AgentEngineSandboxSnapshotOperation; +import com.google.cloud.agentplatform.types.CreateAgentEngineSandboxSnapshotConfig; +import com.google.cloud.agentplatform.types.CreateSandboxEnvironmentSnapshotRequestParameters; +import com.google.cloud.agentplatform.types.DeleteSandboxEnvironmentSnapshotConfig; +import com.google.cloud.agentplatform.types.DeleteSandboxEnvironmentSnapshotOperation; +import com.google.cloud.agentplatform.types.DeleteSandboxEnvironmentSnapshotRequestParameters; +import com.google.cloud.agentplatform.types.GetAgentEngineOperationConfig; +import com.google.cloud.agentplatform.types.GetAgentEngineSandboxSnapshotOperationParameters; +import com.google.cloud.agentplatform.types.GetSandboxEnvironmentSnapshotConfig; +import com.google.cloud.agentplatform.types.GetSandboxEnvironmentSnapshotRequestParameters; +import com.google.cloud.agentplatform.types.ListSandboxEnvironmentSnapshotsConfig; +import com.google.cloud.agentplatform.types.ListSandboxEnvironmentSnapshotsRequestParameters; +import com.google.cloud.agentplatform.types.ListSandboxEnvironmentSnapshotsResponse; +import com.google.cloud.agentplatform.types.SandboxEnvironmentSnapshot; +import com.google.genai.ApiClient; +import com.google.genai.ApiResponse; +import com.google.genai.Common; +import com.google.genai.Common.BuiltRequest; +import com.google.genai.JsonSerializable; +import com.google.genai.errors.GenAiIOException; +import com.google.genai.types.HttpOptions; +import java.io.IOException; +import java.util.Optional; +import okhttp3.ResponseBody; + +public final class SandboxSnapshots { + + final ApiClient apiClient; + + public SandboxSnapshots(ApiClient apiClient) { + this.apiClient = apiClient; + } + + @ExcludeFromGeneratedCoverageReport + ObjectNode createAgentEngineSandboxSnapshotConfigToVertex( + JsonNode fromObject, ObjectNode parentObject) { + ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + + if (Common.getValueByPath(fromObject, new String[] {"displayName"}) != null) { + Common.setValueByPath( + parentObject, + new String[] {"displayName"}, + Common.getValueByPath(fromObject, new String[] {"displayName"})); + } + + if (Common.getValueByPath(fromObject, new String[] {"owner"}) != null) { + Common.setValueByPath( + parentObject, + new String[] {"owner"}, + Common.getValueByPath(fromObject, new String[] {"owner"})); + } + + if (Common.getValueByPath(fromObject, new String[] {"ttl"}) != null) { + Common.setValueByPath( + parentObject, + new String[] {"ttl"}, + Common.getValueByPath(fromObject, new String[] {"ttl"})); + } + + return toObject; + } + + @ExcludeFromGeneratedCoverageReport + ObjectNode createSandboxEnvironmentSnapshotRequestParametersToVertex( + JsonNode fromObject, ObjectNode parentObject) { + ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + if (Common.getValueByPath(fromObject, new String[] {"sourceSandboxEnvironmentName"}) != null) { + Common.setValueByPath( + toObject, + new String[] {"_url", "name"}, + Common.getValueByPath(fromObject, new String[] {"sourceSandboxEnvironmentName"})); + } + + if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { + Common.setValueByPath( + toObject, + new String[] {"config"}, + createAgentEngineSandboxSnapshotConfigToVertex( + JsonSerializable.toJsonNode( + Common.getValueByPath(fromObject, new String[] {"config"})), + toObject)); + } + + return toObject; + } + + @ExcludeFromGeneratedCoverageReport + ObjectNode deleteSandboxEnvironmentSnapshotRequestParametersToVertex( + JsonNode fromObject, ObjectNode parentObject) { + ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { + Common.setValueByPath( + toObject, + new String[] {"_url", "name"}, + Common.getValueByPath(fromObject, new String[] {"name"})); + } + + return toObject; + } + + @ExcludeFromGeneratedCoverageReport + ObjectNode getAgentEngineSandboxSnapshotOperationParametersToVertex( + JsonNode fromObject, ObjectNode parentObject) { + ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + if (Common.getValueByPath(fromObject, new String[] {"operationName"}) != null) { + Common.setValueByPath( + toObject, + new String[] {"_url", "operationName"}, + Common.getValueByPath(fromObject, new String[] {"operationName"})); + } + + return toObject; + } + + @ExcludeFromGeneratedCoverageReport + ObjectNode getSandboxEnvironmentSnapshotRequestParametersToVertex( + JsonNode fromObject, ObjectNode parentObject) { + ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { + Common.setValueByPath( + toObject, + new String[] {"_url", "name"}, + Common.getValueByPath(fromObject, new String[] {"name"})); + } + + return toObject; + } + + @ExcludeFromGeneratedCoverageReport + ObjectNode listSandboxEnvironmentSnapshotsConfigToVertex( + JsonNode fromObject, ObjectNode parentObject) { + ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + + if (Common.getValueByPath(fromObject, new String[] {"pageSize"}) != null) { + Common.setValueByPath( + parentObject, + new String[] {"_query", "pageSize"}, + Common.getValueByPath(fromObject, new String[] {"pageSize"})); + } + + if (Common.getValueByPath(fromObject, new String[] {"pageToken"}) != null) { + Common.setValueByPath( + parentObject, + new String[] {"_query", "pageToken"}, + Common.getValueByPath(fromObject, new String[] {"pageToken"})); + } + + if (Common.getValueByPath(fromObject, new String[] {"filter"}) != null) { + Common.setValueByPath( + parentObject, + new String[] {"_query", "filter"}, + Common.getValueByPath(fromObject, new String[] {"filter"})); + } + + return toObject; + } + + @ExcludeFromGeneratedCoverageReport + ObjectNode listSandboxEnvironmentSnapshotsRequestParametersToVertex( + JsonNode fromObject, ObjectNode parentObject) { + ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { + Common.setValueByPath( + toObject, + new String[] {"_url", "name"}, + Common.getValueByPath(fromObject, new String[] {"name"})); + } + + if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { + JsonNode unused = + listSandboxEnvironmentSnapshotsConfigToVertex( + JsonSerializable.toJsonNode( + Common.getValueByPath(fromObject, new String[] {"config"})), + toObject); + } + + return toObject; + } + + /** A shared buildRequest method for both sync and async methods. */ + BuiltRequest buildRequestForPrivateCreate( + String sourceSandboxEnvironmentName, CreateAgentEngineSandboxSnapshotConfig config) { + + CreateSandboxEnvironmentSnapshotRequestParameters.Builder parameterBuilder = + CreateSandboxEnvironmentSnapshotRequestParameters.builder(); + + if (!Common.isZero(sourceSandboxEnvironmentName)) { + parameterBuilder.sourceSandboxEnvironmentName(sourceSandboxEnvironmentName); + } + if (!Common.isZero(config)) { + parameterBuilder.config(config); + } + JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + + ObjectNode body; + String path; + if (this.apiClient.vertexAI()) { + body = createSandboxEnvironmentSnapshotRequestParametersToVertex(parameterNode, null); + path = Common.formatMap("{name}:snapshot", body.get("_url")); + } else { + throw new UnsupportedOperationException( + "This method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini" + + " Developer API mode."); + } + body.remove("_url"); + + JsonNode queryParams = body.get("_query"); + if (queryParams != null) { + body.remove("_query"); + path = String.format("%s?%s", path, Common.urlEncode((ObjectNode) queryParams)); + } + + // TODO: Remove the hack that removes config. + Optional requestHttpOptions = Optional.empty(); + if (config != null) { + requestHttpOptions = config.httpOptions(); + } + + return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + } + + /** A shared processResponse function for both sync and async methods. */ + AgentEngineSandboxSnapshotOperation processResponseForPrivateCreate( + ApiResponse response, CreateAgentEngineSandboxSnapshotConfig config) { + ResponseBody responseBody = response.getBody(); + String responseString; + try { + responseString = responseBody.string(); + } catch (IOException e) { + throw new GenAiIOException("Failed to read HTTP response.", e); + } + + JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + + if (!this.apiClient.vertexAI()) { + throw new UnsupportedOperationException( + "This method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini" + + " Developer API mode."); + } + + return JsonSerializable.fromJsonNode(responseNode, AgentEngineSandboxSnapshotOperation.class); + } + + AgentEngineSandboxSnapshotOperation privateCreate( + String sourceSandboxEnvironmentName, CreateAgentEngineSandboxSnapshotConfig config) { + BuiltRequest builtRequest = buildRequestForPrivateCreate(sourceSandboxEnvironmentName, config); + + try (ApiResponse response = + this.apiClient.request( + "post", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())) { + return processResponseForPrivateCreate(response, config); + } + } + + /** A shared buildRequest method for both sync and async methods. */ + BuiltRequest buildRequestForPrivateDelete( + String name, DeleteSandboxEnvironmentSnapshotConfig config) { + + DeleteSandboxEnvironmentSnapshotRequestParameters.Builder parameterBuilder = + DeleteSandboxEnvironmentSnapshotRequestParameters.builder(); + + if (!Common.isZero(name)) { + parameterBuilder.name(name); + } + if (!Common.isZero(config)) { + parameterBuilder.config(config); + } + JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + + ObjectNode body; + String path; + if (this.apiClient.vertexAI()) { + body = deleteSandboxEnvironmentSnapshotRequestParametersToVertex(parameterNode, null); + path = Common.formatMap("{name}", body.get("_url")); + } else { + throw new UnsupportedOperationException( + "This method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini" + + " Developer API mode."); + } + body.remove("_url"); + + JsonNode queryParams = body.get("_query"); + if (queryParams != null) { + body.remove("_query"); + path = String.format("%s?%s", path, Common.urlEncode((ObjectNode) queryParams)); + } + + // TODO: Remove the hack that removes config. + Optional requestHttpOptions = Optional.empty(); + if (config != null) { + requestHttpOptions = config.httpOptions(); + } + + return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + } + + /** A shared processResponse function for both sync and async methods. */ + DeleteSandboxEnvironmentSnapshotOperation processResponseForPrivateDelete( + ApiResponse response, DeleteSandboxEnvironmentSnapshotConfig config) { + ResponseBody responseBody = response.getBody(); + String responseString; + try { + responseString = responseBody.string(); + } catch (IOException e) { + throw new GenAiIOException("Failed to read HTTP response.", e); + } + + JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + + if (!this.apiClient.vertexAI()) { + throw new UnsupportedOperationException( + "This method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini" + + " Developer API mode."); + } + + return JsonSerializable.fromJsonNode( + responseNode, DeleteSandboxEnvironmentSnapshotOperation.class); + } + + DeleteSandboxEnvironmentSnapshotOperation privateDelete( + String name, DeleteSandboxEnvironmentSnapshotConfig config) { + BuiltRequest builtRequest = buildRequestForPrivateDelete(name, config); + + try (ApiResponse response = + this.apiClient.request( + "delete", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())) { + return processResponseForPrivateDelete(response, config); + } + } + + /** A shared buildRequest method for both sync and async methods. */ + BuiltRequest buildRequestForPrivateGet(String name, GetSandboxEnvironmentSnapshotConfig config) { + + GetSandboxEnvironmentSnapshotRequestParameters.Builder parameterBuilder = + GetSandboxEnvironmentSnapshotRequestParameters.builder(); + + if (!Common.isZero(name)) { + parameterBuilder.name(name); + } + if (!Common.isZero(config)) { + parameterBuilder.config(config); + } + JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + + ObjectNode body; + String path; + if (this.apiClient.vertexAI()) { + body = getSandboxEnvironmentSnapshotRequestParametersToVertex(parameterNode, null); + path = Common.formatMap("{name}", body.get("_url")); + } else { + throw new UnsupportedOperationException( + "This method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini" + + " Developer API mode."); + } + body.remove("_url"); + + JsonNode queryParams = body.get("_query"); + if (queryParams != null) { + body.remove("_query"); + path = String.format("%s?%s", path, Common.urlEncode((ObjectNode) queryParams)); + } + + // TODO: Remove the hack that removes config. + Optional requestHttpOptions = Optional.empty(); + if (config != null) { + requestHttpOptions = config.httpOptions(); + } + + return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + } + + /** A shared processResponse function for both sync and async methods. */ + SandboxEnvironmentSnapshot processResponseForPrivateGet( + ApiResponse response, GetSandboxEnvironmentSnapshotConfig config) { + ResponseBody responseBody = response.getBody(); + String responseString; + try { + responseString = responseBody.string(); + } catch (IOException e) { + throw new GenAiIOException("Failed to read HTTP response.", e); + } + + JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + + if (!this.apiClient.vertexAI()) { + throw new UnsupportedOperationException( + "This method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini" + + " Developer API mode."); + } + + return JsonSerializable.fromJsonNode(responseNode, SandboxEnvironmentSnapshot.class); + } + + SandboxEnvironmentSnapshot privateGet(String name, GetSandboxEnvironmentSnapshotConfig config) { + BuiltRequest builtRequest = buildRequestForPrivateGet(name, config); + + try (ApiResponse response = + this.apiClient.request( + "get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())) { + return processResponseForPrivateGet(response, config); + } + } + + /** A shared buildRequest method for both sync and async methods. */ + BuiltRequest buildRequestForPrivateList( + String name, ListSandboxEnvironmentSnapshotsConfig config) { + + ListSandboxEnvironmentSnapshotsRequestParameters.Builder parameterBuilder = + ListSandboxEnvironmentSnapshotsRequestParameters.builder(); + + if (!Common.isZero(name)) { + parameterBuilder.name(name); + } + if (!Common.isZero(config)) { + parameterBuilder.config(config); + } + JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + + ObjectNode body; + String path; + if (this.apiClient.vertexAI()) { + body = listSandboxEnvironmentSnapshotsRequestParametersToVertex(parameterNode, null); + path = Common.formatMap("{name}/sandboxEnvironmentSnapshots", body.get("_url")); + } else { + throw new UnsupportedOperationException( + "This method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini" + + " Developer API mode."); + } + body.remove("_url"); + + JsonNode queryParams = body.get("_query"); + if (queryParams != null) { + body.remove("_query"); + path = String.format("%s?%s", path, Common.urlEncode((ObjectNode) queryParams)); + } + + // TODO: Remove the hack that removes config. + Optional requestHttpOptions = Optional.empty(); + if (config != null) { + requestHttpOptions = config.httpOptions(); + } + + return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + } + + /** A shared processResponse function for both sync and async methods. */ + ListSandboxEnvironmentSnapshotsResponse processResponseForPrivateList( + ApiResponse response, ListSandboxEnvironmentSnapshotsConfig config) { + ResponseBody responseBody = response.getBody(); + String responseString; + try { + responseString = responseBody.string(); + } catch (IOException e) { + throw new GenAiIOException("Failed to read HTTP response.", e); + } + + JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + + if (!this.apiClient.vertexAI()) { + throw new UnsupportedOperationException( + "This method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini" + + " Developer API mode."); + } + + return JsonSerializable.fromJsonNode( + responseNode, ListSandboxEnvironmentSnapshotsResponse.class); + } + + ListSandboxEnvironmentSnapshotsResponse privateList( + String name, ListSandboxEnvironmentSnapshotsConfig config) { + BuiltRequest builtRequest = buildRequestForPrivateList(name, config); + + try (ApiResponse response = + this.apiClient.request( + "get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())) { + return processResponseForPrivateList(response, config); + } + } + + /** A shared buildRequest method for both sync and async methods. */ + BuiltRequest buildRequestForGetSandboxSnapshotOperation( + String operationName, GetAgentEngineOperationConfig config) { + + GetAgentEngineSandboxSnapshotOperationParameters.Builder parameterBuilder = + GetAgentEngineSandboxSnapshotOperationParameters.builder(); + + if (!Common.isZero(operationName)) { + parameterBuilder.operationName(operationName); + } + if (!Common.isZero(config)) { + parameterBuilder.config(config); + } + JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + + ObjectNode body; + String path; + if (this.apiClient.vertexAI()) { + body = getAgentEngineSandboxSnapshotOperationParametersToVertex(parameterNode, null); + path = Common.formatMap("{operationName}", body.get("_url")); + } else { + throw new UnsupportedOperationException( + "This method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini" + + " Developer API mode."); + } + body.remove("_url"); + + JsonNode queryParams = body.get("_query"); + if (queryParams != null) { + body.remove("_query"); + path = String.format("%s?%s", path, Common.urlEncode((ObjectNode) queryParams)); + } + + // TODO: Remove the hack that removes config. + Optional requestHttpOptions = Optional.empty(); + if (config != null) { + requestHttpOptions = config.httpOptions(); + } + + return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + } + + /** A shared processResponse function for both sync and async methods. */ + AgentEngineSandboxSnapshotOperation processResponseForGetSandboxSnapshotOperation( + ApiResponse response, GetAgentEngineOperationConfig config) { + ResponseBody responseBody = response.getBody(); + String responseString; + try { + responseString = responseBody.string(); + } catch (IOException e) { + throw new GenAiIOException("Failed to read HTTP response.", e); + } + + JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + + if (!this.apiClient.vertexAI()) { + throw new UnsupportedOperationException( + "This method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini" + + " Developer API mode."); + } + + return JsonSerializable.fromJsonNode(responseNode, AgentEngineSandboxSnapshotOperation.class); + } + + public AgentEngineSandboxSnapshotOperation getSandboxSnapshotOperation( + String operationName, GetAgentEngineOperationConfig config) { + BuiltRequest builtRequest = buildRequestForGetSandboxSnapshotOperation(operationName, config); + + try (ApiResponse response = + this.apiClient.request( + "get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())) { + return processResponseForGetSandboxSnapshotOperation(response, config); + } + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/SandboxTemplates.java b/src/main/java/com/google/cloud/agentplatform/SandboxTemplates.java new file mode 100644 index 0000000..c05031d --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/SandboxTemplates.java @@ -0,0 +1,585 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.google.cloud.agentplatform.types.CreateSandboxEnvironmentTemplateConfig; +import com.google.cloud.agentplatform.types.CreateSandboxEnvironmentTemplateRequestParameters; +import com.google.cloud.agentplatform.types.DeleteSandboxEnvironmentTemplateConfig; +import com.google.cloud.agentplatform.types.DeleteSandboxEnvironmentTemplateOperation; +import com.google.cloud.agentplatform.types.DeleteSandboxEnvironmentTemplateRequestParameters; +import com.google.cloud.agentplatform.types.GetAgentEngineOperationConfig; +import com.google.cloud.agentplatform.types.GetSandboxEnvironmentTemplateConfig; +import com.google.cloud.agentplatform.types.GetSandboxEnvironmentTemplateOperationParameters; +import com.google.cloud.agentplatform.types.GetSandboxEnvironmentTemplateRequestParameters; +import com.google.cloud.agentplatform.types.ListSandboxEnvironmentTemplatesConfig; +import com.google.cloud.agentplatform.types.ListSandboxEnvironmentTemplatesRequestParameters; +import com.google.cloud.agentplatform.types.ListSandboxEnvironmentTemplatesResponse; +import com.google.cloud.agentplatform.types.SandboxEnvironmentTemplate; +import com.google.cloud.agentplatform.types.SandboxEnvironmentTemplateOperation; +import com.google.genai.ApiClient; +import com.google.genai.ApiResponse; +import com.google.genai.Common; +import com.google.genai.Common.BuiltRequest; +import com.google.genai.JsonSerializable; +import com.google.genai.errors.GenAiIOException; +import com.google.genai.types.HttpOptions; +import java.io.IOException; +import java.util.Optional; +import okhttp3.ResponseBody; + +public final class SandboxTemplates { + + final ApiClient apiClient; + + public SandboxTemplates(ApiClient apiClient) { + this.apiClient = apiClient; + } + + @ExcludeFromGeneratedCoverageReport + ObjectNode createSandboxEnvironmentTemplateConfigToVertex( + JsonNode fromObject, ObjectNode parentObject) { + ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + + if (Common.getValueByPath(fromObject, new String[] {"customContainerEnvironment"}) != null) { + Common.setValueByPath( + parentObject, + new String[] {"customContainerEnvironment"}, + Common.getValueByPath(fromObject, new String[] {"customContainerEnvironment"})); + } + + if (Common.getValueByPath(fromObject, new String[] {"defaultContainerEnvironment"}) != null) { + Common.setValueByPath( + parentObject, + new String[] {"defaultContainerEnvironment"}, + Common.getValueByPath(fromObject, new String[] {"defaultContainerEnvironment"})); + } + + if (Common.getValueByPath(fromObject, new String[] {"egressControlConfig"}) != null) { + Common.setValueByPath( + parentObject, + new String[] {"egressControlConfig"}, + Common.getValueByPath(fromObject, new String[] {"egressControlConfig"})); + } + + return toObject; + } + + @ExcludeFromGeneratedCoverageReport + ObjectNode createSandboxEnvironmentTemplateRequestParametersToVertex( + JsonNode fromObject, ObjectNode parentObject) { + ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { + Common.setValueByPath( + toObject, + new String[] {"_url", "name"}, + Common.getValueByPath(fromObject, new String[] {"name"})); + } + + if (Common.getValueByPath(fromObject, new String[] {"displayName"}) != null) { + Common.setValueByPath( + parentObject, + new String[] {"displayName"}, + Common.getValueByPath(fromObject, new String[] {"displayName"})); + } + + if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { + JsonNode unused = + createSandboxEnvironmentTemplateConfigToVertex( + JsonSerializable.toJsonNode( + Common.getValueByPath(fromObject, new String[] {"config"})), + toObject); + } + + return toObject; + } + + @ExcludeFromGeneratedCoverageReport + ObjectNode deleteSandboxEnvironmentTemplateRequestParametersToVertex( + JsonNode fromObject, ObjectNode parentObject) { + ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { + Common.setValueByPath( + toObject, + new String[] {"_url", "name"}, + Common.getValueByPath(fromObject, new String[] {"name"})); + } + + return toObject; + } + + @ExcludeFromGeneratedCoverageReport + ObjectNode getSandboxEnvironmentTemplateOperationParametersToVertex( + JsonNode fromObject, ObjectNode parentObject) { + ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + if (Common.getValueByPath(fromObject, new String[] {"operationName"}) != null) { + Common.setValueByPath( + toObject, + new String[] {"_url", "operationName"}, + Common.getValueByPath(fromObject, new String[] {"operationName"})); + } + + return toObject; + } + + @ExcludeFromGeneratedCoverageReport + ObjectNode getSandboxEnvironmentTemplateRequestParametersToVertex( + JsonNode fromObject, ObjectNode parentObject) { + ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { + Common.setValueByPath( + toObject, + new String[] {"_url", "name"}, + Common.getValueByPath(fromObject, new String[] {"name"})); + } + + return toObject; + } + + @ExcludeFromGeneratedCoverageReport + ObjectNode listSandboxEnvironmentTemplatesConfigToVertex( + JsonNode fromObject, ObjectNode parentObject) { + ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + + if (Common.getValueByPath(fromObject, new String[] {"pageSize"}) != null) { + Common.setValueByPath( + parentObject, + new String[] {"_query", "pageSize"}, + Common.getValueByPath(fromObject, new String[] {"pageSize"})); + } + + if (Common.getValueByPath(fromObject, new String[] {"pageToken"}) != null) { + Common.setValueByPath( + parentObject, + new String[] {"_query", "pageToken"}, + Common.getValueByPath(fromObject, new String[] {"pageToken"})); + } + + if (Common.getValueByPath(fromObject, new String[] {"filter"}) != null) { + Common.setValueByPath( + parentObject, + new String[] {"_query", "filter"}, + Common.getValueByPath(fromObject, new String[] {"filter"})); + } + + return toObject; + } + + @ExcludeFromGeneratedCoverageReport + ObjectNode listSandboxEnvironmentTemplatesRequestParametersToVertex( + JsonNode fromObject, ObjectNode parentObject) { + ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { + Common.setValueByPath( + toObject, + new String[] {"_url", "name"}, + Common.getValueByPath(fromObject, new String[] {"name"})); + } + + if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { + JsonNode unused = + listSandboxEnvironmentTemplatesConfigToVertex( + JsonSerializable.toJsonNode( + Common.getValueByPath(fromObject, new String[] {"config"})), + toObject); + } + + return toObject; + } + + /** A shared buildRequest method for both sync and async methods. */ + BuiltRequest buildRequestForPrivateCreate( + String name, String displayName, CreateSandboxEnvironmentTemplateConfig config) { + + CreateSandboxEnvironmentTemplateRequestParameters.Builder parameterBuilder = + CreateSandboxEnvironmentTemplateRequestParameters.builder(); + + if (!Common.isZero(name)) { + parameterBuilder.name(name); + } + if (!Common.isZero(displayName)) { + parameterBuilder.displayName(displayName); + } + if (!Common.isZero(config)) { + parameterBuilder.config(config); + } + JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + + ObjectNode body; + String path; + if (this.apiClient.vertexAI()) { + body = createSandboxEnvironmentTemplateRequestParametersToVertex(parameterNode, null); + path = Common.formatMap("{name}/sandboxEnvironmentTemplates", body.get("_url")); + } else { + throw new UnsupportedOperationException( + "This method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini" + + " Developer API mode."); + } + body.remove("_url"); + + JsonNode queryParams = body.get("_query"); + if (queryParams != null) { + body.remove("_query"); + path = String.format("%s?%s", path, Common.urlEncode((ObjectNode) queryParams)); + } + + // TODO: Remove the hack that removes config. + Optional requestHttpOptions = Optional.empty(); + if (config != null) { + requestHttpOptions = config.httpOptions(); + } + + return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + } + + /** A shared processResponse function for both sync and async methods. */ + SandboxEnvironmentTemplateOperation processResponseForPrivateCreate( + ApiResponse response, CreateSandboxEnvironmentTemplateConfig config) { + ResponseBody responseBody = response.getBody(); + String responseString; + try { + responseString = responseBody.string(); + } catch (IOException e) { + throw new GenAiIOException("Failed to read HTTP response.", e); + } + + JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + + if (!this.apiClient.vertexAI()) { + throw new UnsupportedOperationException( + "This method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini" + + " Developer API mode."); + } + + return JsonSerializable.fromJsonNode(responseNode, SandboxEnvironmentTemplateOperation.class); + } + + SandboxEnvironmentTemplateOperation privateCreate( + String name, String displayName, CreateSandboxEnvironmentTemplateConfig config) { + BuiltRequest builtRequest = buildRequestForPrivateCreate(name, displayName, config); + + try (ApiResponse response = + this.apiClient.request( + "post", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())) { + return processResponseForPrivateCreate(response, config); + } + } + + /** A shared buildRequest method for both sync and async methods. */ + BuiltRequest buildRequestForPrivateDelete( + String name, DeleteSandboxEnvironmentTemplateConfig config) { + + DeleteSandboxEnvironmentTemplateRequestParameters.Builder parameterBuilder = + DeleteSandboxEnvironmentTemplateRequestParameters.builder(); + + if (!Common.isZero(name)) { + parameterBuilder.name(name); + } + if (!Common.isZero(config)) { + parameterBuilder.config(config); + } + JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + + ObjectNode body; + String path; + if (this.apiClient.vertexAI()) { + body = deleteSandboxEnvironmentTemplateRequestParametersToVertex(parameterNode, null); + path = Common.formatMap("{name}", body.get("_url")); + } else { + throw new UnsupportedOperationException( + "This method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini" + + " Developer API mode."); + } + body.remove("_url"); + + JsonNode queryParams = body.get("_query"); + if (queryParams != null) { + body.remove("_query"); + path = String.format("%s?%s", path, Common.urlEncode((ObjectNode) queryParams)); + } + + // TODO: Remove the hack that removes config. + Optional requestHttpOptions = Optional.empty(); + if (config != null) { + requestHttpOptions = config.httpOptions(); + } + + return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + } + + /** A shared processResponse function for both sync and async methods. */ + DeleteSandboxEnvironmentTemplateOperation processResponseForPrivateDelete( + ApiResponse response, DeleteSandboxEnvironmentTemplateConfig config) { + ResponseBody responseBody = response.getBody(); + String responseString; + try { + responseString = responseBody.string(); + } catch (IOException e) { + throw new GenAiIOException("Failed to read HTTP response.", e); + } + + JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + + if (!this.apiClient.vertexAI()) { + throw new UnsupportedOperationException( + "This method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini" + + " Developer API mode."); + } + + return JsonSerializable.fromJsonNode( + responseNode, DeleteSandboxEnvironmentTemplateOperation.class); + } + + DeleteSandboxEnvironmentTemplateOperation privateDelete( + String name, DeleteSandboxEnvironmentTemplateConfig config) { + BuiltRequest builtRequest = buildRequestForPrivateDelete(name, config); + + try (ApiResponse response = + this.apiClient.request( + "delete", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())) { + return processResponseForPrivateDelete(response, config); + } + } + + /** A shared buildRequest method for both sync and async methods. */ + BuiltRequest buildRequestForPrivateGet(String name, GetSandboxEnvironmentTemplateConfig config) { + + GetSandboxEnvironmentTemplateRequestParameters.Builder parameterBuilder = + GetSandboxEnvironmentTemplateRequestParameters.builder(); + + if (!Common.isZero(name)) { + parameterBuilder.name(name); + } + if (!Common.isZero(config)) { + parameterBuilder.config(config); + } + JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + + ObjectNode body; + String path; + if (this.apiClient.vertexAI()) { + body = getSandboxEnvironmentTemplateRequestParametersToVertex(parameterNode, null); + path = Common.formatMap("{name}", body.get("_url")); + } else { + throw new UnsupportedOperationException( + "This method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini" + + " Developer API mode."); + } + body.remove("_url"); + + JsonNode queryParams = body.get("_query"); + if (queryParams != null) { + body.remove("_query"); + path = String.format("%s?%s", path, Common.urlEncode((ObjectNode) queryParams)); + } + + // TODO: Remove the hack that removes config. + Optional requestHttpOptions = Optional.empty(); + if (config != null) { + requestHttpOptions = config.httpOptions(); + } + + return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + } + + /** A shared processResponse function for both sync and async methods. */ + SandboxEnvironmentTemplate processResponseForPrivateGet( + ApiResponse response, GetSandboxEnvironmentTemplateConfig config) { + ResponseBody responseBody = response.getBody(); + String responseString; + try { + responseString = responseBody.string(); + } catch (IOException e) { + throw new GenAiIOException("Failed to read HTTP response.", e); + } + + JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + + if (!this.apiClient.vertexAI()) { + throw new UnsupportedOperationException( + "This method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini" + + " Developer API mode."); + } + + return JsonSerializable.fromJsonNode(responseNode, SandboxEnvironmentTemplate.class); + } + + SandboxEnvironmentTemplate privateGet(String name, GetSandboxEnvironmentTemplateConfig config) { + BuiltRequest builtRequest = buildRequestForPrivateGet(name, config); + + try (ApiResponse response = + this.apiClient.request( + "get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())) { + return processResponseForPrivateGet(response, config); + } + } + + /** A shared buildRequest method for both sync and async methods. */ + BuiltRequest buildRequestForPrivateList( + String name, ListSandboxEnvironmentTemplatesConfig config) { + + ListSandboxEnvironmentTemplatesRequestParameters.Builder parameterBuilder = + ListSandboxEnvironmentTemplatesRequestParameters.builder(); + + if (!Common.isZero(name)) { + parameterBuilder.name(name); + } + if (!Common.isZero(config)) { + parameterBuilder.config(config); + } + JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + + ObjectNode body; + String path; + if (this.apiClient.vertexAI()) { + body = listSandboxEnvironmentTemplatesRequestParametersToVertex(parameterNode, null); + path = Common.formatMap("{name}/sandboxEnvironmentTemplates", body.get("_url")); + } else { + throw new UnsupportedOperationException( + "This method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini" + + " Developer API mode."); + } + body.remove("_url"); + + JsonNode queryParams = body.get("_query"); + if (queryParams != null) { + body.remove("_query"); + path = String.format("%s?%s", path, Common.urlEncode((ObjectNode) queryParams)); + } + + // TODO: Remove the hack that removes config. + Optional requestHttpOptions = Optional.empty(); + if (config != null) { + requestHttpOptions = config.httpOptions(); + } + + return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + } + + /** A shared processResponse function for both sync and async methods. */ + ListSandboxEnvironmentTemplatesResponse processResponseForPrivateList( + ApiResponse response, ListSandboxEnvironmentTemplatesConfig config) { + ResponseBody responseBody = response.getBody(); + String responseString; + try { + responseString = responseBody.string(); + } catch (IOException e) { + throw new GenAiIOException("Failed to read HTTP response.", e); + } + + JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + + if (!this.apiClient.vertexAI()) { + throw new UnsupportedOperationException( + "This method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini" + + " Developer API mode."); + } + + return JsonSerializable.fromJsonNode( + responseNode, ListSandboxEnvironmentTemplatesResponse.class); + } + + ListSandboxEnvironmentTemplatesResponse privateList( + String name, ListSandboxEnvironmentTemplatesConfig config) { + BuiltRequest builtRequest = buildRequestForPrivateList(name, config); + + try (ApiResponse response = + this.apiClient.request( + "get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())) { + return processResponseForPrivateList(response, config); + } + } + + /** A shared buildRequest method for both sync and async methods. */ + BuiltRequest buildRequestForGetSandboxEnvironmentTemplateOperation( + String operationName, GetAgentEngineOperationConfig config) { + + GetSandboxEnvironmentTemplateOperationParameters.Builder parameterBuilder = + GetSandboxEnvironmentTemplateOperationParameters.builder(); + + if (!Common.isZero(operationName)) { + parameterBuilder.operationName(operationName); + } + if (!Common.isZero(config)) { + parameterBuilder.config(config); + } + JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + + ObjectNode body; + String path; + if (this.apiClient.vertexAI()) { + body = getSandboxEnvironmentTemplateOperationParametersToVertex(parameterNode, null); + path = Common.formatMap("{operationName}", body.get("_url")); + } else { + throw new UnsupportedOperationException( + "This method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini" + + " Developer API mode."); + } + body.remove("_url"); + + JsonNode queryParams = body.get("_query"); + if (queryParams != null) { + body.remove("_query"); + path = String.format("%s?%s", path, Common.urlEncode((ObjectNode) queryParams)); + } + + // TODO: Remove the hack that removes config. + Optional requestHttpOptions = Optional.empty(); + if (config != null) { + requestHttpOptions = config.httpOptions(); + } + + return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + } + + /** A shared processResponse function for both sync and async methods. */ + SandboxEnvironmentTemplateOperation processResponseForGetSandboxEnvironmentTemplateOperation( + ApiResponse response, GetAgentEngineOperationConfig config) { + ResponseBody responseBody = response.getBody(); + String responseString; + try { + responseString = responseBody.string(); + } catch (IOException e) { + throw new GenAiIOException("Failed to read HTTP response.", e); + } + + JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + + if (!this.apiClient.vertexAI()) { + throw new UnsupportedOperationException( + "This method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini" + + " Developer API mode."); + } + + return JsonSerializable.fromJsonNode(responseNode, SandboxEnvironmentTemplateOperation.class); + } + + public SandboxEnvironmentTemplateOperation getSandboxEnvironmentTemplateOperation( + String operationName, GetAgentEngineOperationConfig config) { + BuiltRequest builtRequest = + buildRequestForGetSandboxEnvironmentTemplateOperation(operationName, config); + + try (ApiResponse response = + this.apiClient.request( + "get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())) { + return processResponseForGetSandboxEnvironmentTemplateOperation(response, config); + } + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/Sandboxes.java b/src/main/java/com/google/cloud/agentplatform/Sandboxes.java index ae0d9e1..d49c0af 100644 --- a/src/main/java/com/google/cloud/agentplatform/Sandboxes.java +++ b/src/main/java/com/google/cloud/agentplatform/Sandboxes.java @@ -52,11 +52,15 @@ import okhttp3.ResponseBody; public final class Sandboxes { + public final SandboxTemplates templates; + public final SandboxSnapshots snapshots; final ApiClient apiClient; public Sandboxes(ApiClient apiClient) { this.apiClient = apiClient; + this.templates = new SandboxTemplates(apiClient); + this.snapshots = new SandboxSnapshots(apiClient); } @ExcludeFromGeneratedCoverageReport diff --git a/src/main/java/com/google/cloud/agentplatform/types/AgentEngineSandboxSnapshotOperation.java b/src/main/java/com/google/cloud/agentplatform/types/AgentEngineSandboxSnapshotOperation.java new file mode 100644 index 0000000..d9cc607 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/AgentEngineSandboxSnapshotOperation.java @@ -0,0 +1,201 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Map; +import java.util.Optional; + +/** Operation that has an agent engine sandbox snapshot as a response. */ +@AutoValue +@JsonDeserialize(builder = AgentEngineSandboxSnapshotOperation.Builder.class) +public abstract class AgentEngineSandboxSnapshotOperation extends JsonSerializable { + /** + * The server-assigned name, which is only unique within the same service that originally returns + * it. If you use the default HTTP mapping, the `name` should be a resource name ending with + * `operations/{unique_id}`. + */ + @JsonProperty("name") + public abstract Optional name(); + + /** + * Service-specific metadata associated with the operation. It typically contains progress + * information and common metadata such as create time. Some services might not provide such + * metadata. Any method that returns a long-running operation should document the metadata type, + * if any. + */ + @JsonProperty("metadata") + public abstract Optional> metadata(); + + /** + * If the value is `false`, it means the operation is still in progress. If `true`, the operation + * is completed, and either `error` or `response` is available. + */ + @JsonProperty("done") + public abstract Optional done(); + + /** The error result of the operation in case of failure or cancellation. */ + @JsonProperty("error") + public abstract Optional> error(); + + /** The Agent Engine Sandbox Snapshot. */ + @JsonProperty("response") + public abstract Optional response(); + + /** Instantiates a builder for AgentEngineSandboxSnapshotOperation. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_AgentEngineSandboxSnapshotOperation.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for AgentEngineSandboxSnapshotOperation. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `AgentEngineSandboxSnapshotOperation.builder()` for + * instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_AgentEngineSandboxSnapshotOperation.Builder(); + } + + /** + * Setter for name. + * + *

name: The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the `name` should be a resource + * name ending with `operations/{unique_id}`. + */ + @JsonProperty("name") + public abstract Builder name(String name); + + @ExcludeFromGeneratedCoverageReport + abstract Builder name(Optional name); + + /** Clears the value of name field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearName() { + return name(Optional.empty()); + } + + /** + * Setter for metadata. + * + *

metadata: Service-specific metadata associated with the operation. It typically contains + * progress information and common metadata such as create time. Some services might not provide + * such metadata. Any method that returns a long-running operation should document the metadata + * type, if any. + */ + @JsonProperty("metadata") + public abstract Builder metadata(Map metadata); + + @ExcludeFromGeneratedCoverageReport + abstract Builder metadata(Optional> metadata); + + /** Clears the value of metadata field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearMetadata() { + return metadata(Optional.empty()); + } + + /** + * Setter for done. + * + *

done: If the value is `false`, it means the operation is still in progress. If `true`, the + * operation is completed, and either `error` or `response` is available. + */ + @JsonProperty("done") + public abstract Builder done(boolean done); + + @ExcludeFromGeneratedCoverageReport + abstract Builder done(Optional done); + + /** Clears the value of done field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearDone() { + return done(Optional.empty()); + } + + /** + * Setter for error. + * + *

error: The error result of the operation in case of failure or cancellation. + */ + @JsonProperty("error") + public abstract Builder error(Map error); + + @ExcludeFromGeneratedCoverageReport + abstract Builder error(Optional> error); + + /** Clears the value of error field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearError() { + return error(Optional.empty()); + } + + /** + * Setter for response. + * + *

response: The Agent Engine Sandbox Snapshot. + */ + @JsonProperty("response") + public abstract Builder response(SandboxEnvironmentSnapshot response); + + /** + * Setter for response builder. + * + *

response: The Agent Engine Sandbox Snapshot. + */ + @CanIgnoreReturnValue + public Builder response(SandboxEnvironmentSnapshot.Builder responseBuilder) { + return response(responseBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder response(Optional response); + + /** Clears the value of response field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearResponse() { + return response(Optional.empty()); + } + + public abstract AgentEngineSandboxSnapshotOperation build(); + } + + /** Deserializes a JSON string to a AgentEngineSandboxSnapshotOperation object. */ + @ExcludeFromGeneratedCoverageReport + public static AgentEngineSandboxSnapshotOperation fromJson(String jsonString) { + return JsonSerializable.fromJsonString(jsonString, AgentEngineSandboxSnapshotOperation.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/CreateAgentEngineSandboxSnapshotConfig.java b/src/main/java/com/google/cloud/agentplatform/types/CreateAgentEngineSandboxSnapshotConfig.java new file mode 100644 index 0000000..9900bd3 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/CreateAgentEngineSandboxSnapshotConfig.java @@ -0,0 +1,175 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import com.google.genai.types.HttpOptions; +import java.time.Duration; +import java.util.Optional; + +/** Config for creating a Sandbox Environment Snapshot. */ +@AutoValue +@JsonDeserialize(builder = CreateAgentEngineSandboxSnapshotConfig.Builder.class) +public abstract class CreateAgentEngineSandboxSnapshotConfig extends JsonSerializable { + /** Used to override HTTP request options. */ + @JsonProperty("httpOptions") + public abstract Optional httpOptions(); + + /** The display name of the sandbox snapshot. */ + @JsonProperty("displayName") + public abstract Optional displayName(); + + /** The owner of the sandbox snapshot. */ + @JsonProperty("owner") + public abstract Optional owner(); + + /** The TTL for this resource. The expiration time is computed: now + TTL. */ + @JsonProperty("ttl") + public abstract Optional ttl(); + + /** Waits for the operation to complete before returning. */ + @JsonProperty("waitForCompletion") + public abstract Optional waitForCompletion(); + + /** Instantiates a builder for CreateAgentEngineSandboxSnapshotConfig. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_CreateAgentEngineSandboxSnapshotConfig.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for CreateAgentEngineSandboxSnapshotConfig. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `CreateAgentEngineSandboxSnapshotConfig.builder()` for + * instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_CreateAgentEngineSandboxSnapshotConfig.Builder(); + } + + /** + * Setter for httpOptions. + * + *

httpOptions: Used to override HTTP request options. + */ + @JsonProperty("httpOptions") + public abstract Builder httpOptions(HttpOptions httpOptions); + + @ExcludeFromGeneratedCoverageReport + abstract Builder httpOptions(Optional httpOptions); + + /** Clears the value of httpOptions field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearHttpOptions() { + return httpOptions(Optional.empty()); + } + + /** + * Setter for displayName. + * + *

displayName: The display name of the sandbox snapshot. + */ + @JsonProperty("displayName") + public abstract Builder displayName(String displayName); + + @ExcludeFromGeneratedCoverageReport + abstract Builder displayName(Optional displayName); + + /** Clears the value of displayName field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearDisplayName() { + return displayName(Optional.empty()); + } + + /** + * Setter for owner. + * + *

owner: The owner of the sandbox snapshot. + */ + @JsonProperty("owner") + public abstract Builder owner(String owner); + + @ExcludeFromGeneratedCoverageReport + abstract Builder owner(Optional owner); + + /** Clears the value of owner field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearOwner() { + return owner(Optional.empty()); + } + + /** + * Setter for ttl. + * + *

ttl: The TTL for this resource. The expiration time is computed: now + TTL. + */ + @JsonProperty("ttl") + public abstract Builder ttl(Duration ttl); + + @ExcludeFromGeneratedCoverageReport + abstract Builder ttl(Optional ttl); + + /** Clears the value of ttl field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearTtl() { + return ttl(Optional.empty()); + } + + /** + * Setter for waitForCompletion. + * + *

waitForCompletion: Waits for the operation to complete before returning. + */ + @JsonProperty("waitForCompletion") + public abstract Builder waitForCompletion(boolean waitForCompletion); + + @ExcludeFromGeneratedCoverageReport + abstract Builder waitForCompletion(Optional waitForCompletion); + + /** Clears the value of waitForCompletion field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearWaitForCompletion() { + return waitForCompletion(Optional.empty()); + } + + public abstract CreateAgentEngineSandboxSnapshotConfig build(); + } + + /** Deserializes a JSON string to a CreateAgentEngineSandboxSnapshotConfig object. */ + @ExcludeFromGeneratedCoverageReport + public static CreateAgentEngineSandboxSnapshotConfig fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, CreateAgentEngineSandboxSnapshotConfig.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/CreateSandboxEnvironmentSnapshotRequestParameters.java b/src/main/java/com/google/cloud/agentplatform/types/CreateSandboxEnvironmentSnapshotRequestParameters.java new file mode 100644 index 0000000..14be74e --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/CreateSandboxEnvironmentSnapshotRequestParameters.java @@ -0,0 +1,119 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Optional; + +/** Parameters for creating a sandbox environment snapshot. */ +@AutoValue +@InternalApi +@JsonDeserialize(builder = CreateSandboxEnvironmentSnapshotRequestParameters.Builder.class) +public abstract class CreateSandboxEnvironmentSnapshotRequestParameters extends JsonSerializable { + /** Name of the sandbox environment to snapshot. */ + @JsonProperty("sourceSandboxEnvironmentName") + public abstract Optional sourceSandboxEnvironmentName(); + + /** */ + @JsonProperty("config") + public abstract Optional config(); + + /** Instantiates a builder for CreateSandboxEnvironmentSnapshotRequestParameters. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_CreateSandboxEnvironmentSnapshotRequestParameters.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for CreateSandboxEnvironmentSnapshotRequestParameters. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `CreateSandboxEnvironmentSnapshotRequestParameters.builder()` + * for instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_CreateSandboxEnvironmentSnapshotRequestParameters.Builder(); + } + + /** + * Setter for sourceSandboxEnvironmentName. + * + *

sourceSandboxEnvironmentName: Name of the sandbox environment to snapshot. + */ + @JsonProperty("sourceSandboxEnvironmentName") + public abstract Builder sourceSandboxEnvironmentName(String sourceSandboxEnvironmentName); + + @ExcludeFromGeneratedCoverageReport + abstract Builder sourceSandboxEnvironmentName(Optional sourceSandboxEnvironmentName); + + /** Clears the value of sourceSandboxEnvironmentName field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearSourceSandboxEnvironmentName() { + return sourceSandboxEnvironmentName(Optional.empty()); + } + + /** + * Setter for config. + * + *

config: + */ + @JsonProperty("config") + public abstract Builder config(CreateAgentEngineSandboxSnapshotConfig config); + + /** + * Setter for config builder. + * + *

config: + */ + @CanIgnoreReturnValue + public Builder config(CreateAgentEngineSandboxSnapshotConfig.Builder configBuilder) { + return config(configBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder config(Optional config); + + /** Clears the value of config field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearConfig() { + return config(Optional.empty()); + } + + public abstract CreateSandboxEnvironmentSnapshotRequestParameters build(); + } + + /** Deserializes a JSON string to a CreateSandboxEnvironmentSnapshotRequestParameters object. */ + @ExcludeFromGeneratedCoverageReport + public static CreateSandboxEnvironmentSnapshotRequestParameters fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, CreateSandboxEnvironmentSnapshotRequestParameters.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/CreateSandboxEnvironmentTemplateConfig.java b/src/main/java/com/google/cloud/agentplatform/types/CreateSandboxEnvironmentTemplateConfig.java new file mode 100644 index 0000000..a048510 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/CreateSandboxEnvironmentTemplateConfig.java @@ -0,0 +1,218 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import com.google.genai.types.HttpOptions; +import java.util.Optional; + +/** Config for creating a Sandbox Template. */ +@AutoValue +@JsonDeserialize(builder = CreateSandboxEnvironmentTemplateConfig.Builder.class) +public abstract class CreateSandboxEnvironmentTemplateConfig extends JsonSerializable { + /** Used to override HTTP request options. */ + @JsonProperty("httpOptions") + public abstract Optional httpOptions(); + + /** The custom container environment for the sandbox template. */ + @JsonProperty("customContainerEnvironment") + public abstract Optional + customContainerEnvironment(); + + /** The default container environment for the sandbox template. */ + @JsonProperty("defaultContainerEnvironment") + public abstract Optional + defaultContainerEnvironment(); + + /** The egress control config for the sandbox template. */ + @JsonProperty("egressControlConfig") + public abstract Optional egressControlConfig(); + + /** Waits for the operation to complete before returning. */ + @JsonProperty("waitForCompletion") + public abstract Optional waitForCompletion(); + + /** Instantiates a builder for CreateSandboxEnvironmentTemplateConfig. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_CreateSandboxEnvironmentTemplateConfig.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for CreateSandboxEnvironmentTemplateConfig. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `CreateSandboxEnvironmentTemplateConfig.builder()` for + * instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_CreateSandboxEnvironmentTemplateConfig.Builder(); + } + + /** + * Setter for httpOptions. + * + *

httpOptions: Used to override HTTP request options. + */ + @JsonProperty("httpOptions") + public abstract Builder httpOptions(HttpOptions httpOptions); + + @ExcludeFromGeneratedCoverageReport + abstract Builder httpOptions(Optional httpOptions); + + /** Clears the value of httpOptions field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearHttpOptions() { + return httpOptions(Optional.empty()); + } + + /** + * Setter for customContainerEnvironment. + * + *

customContainerEnvironment: The custom container environment for the sandbox template. + */ + @JsonProperty("customContainerEnvironment") + public abstract Builder customContainerEnvironment( + SandboxEnvironmentTemplateCustomContainerEnvironment customContainerEnvironment); + + /** + * Setter for customContainerEnvironment builder. + * + *

customContainerEnvironment: The custom container environment for the sandbox template. + */ + @CanIgnoreReturnValue + public Builder customContainerEnvironment( + SandboxEnvironmentTemplateCustomContainerEnvironment.Builder + customContainerEnvironmentBuilder) { + return customContainerEnvironment(customContainerEnvironmentBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder customContainerEnvironment( + Optional customContainerEnvironment); + + /** Clears the value of customContainerEnvironment field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearCustomContainerEnvironment() { + return customContainerEnvironment(Optional.empty()); + } + + /** + * Setter for defaultContainerEnvironment. + * + *

defaultContainerEnvironment: The default container environment for the sandbox template. + */ + @JsonProperty("defaultContainerEnvironment") + public abstract Builder defaultContainerEnvironment( + SandboxEnvironmentTemplateDefaultContainerEnvironment defaultContainerEnvironment); + + /** + * Setter for defaultContainerEnvironment builder. + * + *

defaultContainerEnvironment: The default container environment for the sandbox template. + */ + @CanIgnoreReturnValue + public Builder defaultContainerEnvironment( + SandboxEnvironmentTemplateDefaultContainerEnvironment.Builder + defaultContainerEnvironmentBuilder) { + return defaultContainerEnvironment(defaultContainerEnvironmentBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder defaultContainerEnvironment( + Optional + defaultContainerEnvironment); + + /** Clears the value of defaultContainerEnvironment field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearDefaultContainerEnvironment() { + return defaultContainerEnvironment(Optional.empty()); + } + + /** + * Setter for egressControlConfig. + * + *

egressControlConfig: The egress control config for the sandbox template. + */ + @JsonProperty("egressControlConfig") + public abstract Builder egressControlConfig( + SandboxEnvironmentTemplateEgressControlConfig egressControlConfig); + + /** + * Setter for egressControlConfig builder. + * + *

egressControlConfig: The egress control config for the sandbox template. + */ + @CanIgnoreReturnValue + public Builder egressControlConfig( + SandboxEnvironmentTemplateEgressControlConfig.Builder egressControlConfigBuilder) { + return egressControlConfig(egressControlConfigBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder egressControlConfig( + Optional egressControlConfig); + + /** Clears the value of egressControlConfig field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearEgressControlConfig() { + return egressControlConfig(Optional.empty()); + } + + /** + * Setter for waitForCompletion. + * + *

waitForCompletion: Waits for the operation to complete before returning. + */ + @JsonProperty("waitForCompletion") + public abstract Builder waitForCompletion(boolean waitForCompletion); + + @ExcludeFromGeneratedCoverageReport + abstract Builder waitForCompletion(Optional waitForCompletion); + + /** Clears the value of waitForCompletion field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearWaitForCompletion() { + return waitForCompletion(Optional.empty()); + } + + public abstract CreateSandboxEnvironmentTemplateConfig build(); + } + + /** Deserializes a JSON string to a CreateSandboxEnvironmentTemplateConfig object. */ + @ExcludeFromGeneratedCoverageReport + public static CreateSandboxEnvironmentTemplateConfig fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, CreateSandboxEnvironmentTemplateConfig.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/CreateSandboxEnvironmentTemplateRequestParameters.java b/src/main/java/com/google/cloud/agentplatform/types/CreateSandboxEnvironmentTemplateRequestParameters.java new file mode 100644 index 0000000..d94f568 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/CreateSandboxEnvironmentTemplateRequestParameters.java @@ -0,0 +1,141 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Optional; + +/** Parameters for creating Sandbox Environment Templates. */ +@AutoValue +@InternalApi +@JsonDeserialize(builder = CreateSandboxEnvironmentTemplateRequestParameters.Builder.class) +public abstract class CreateSandboxEnvironmentTemplateRequestParameters extends JsonSerializable { + /** Name of the agent engine to create the template under. */ + @JsonProperty("name") + public abstract Optional name(); + + /** The display name of the sandbox template. */ + @JsonProperty("displayName") + public abstract Optional displayName(); + + /** */ + @JsonProperty("config") + public abstract Optional config(); + + /** Instantiates a builder for CreateSandboxEnvironmentTemplateRequestParameters. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_CreateSandboxEnvironmentTemplateRequestParameters.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for CreateSandboxEnvironmentTemplateRequestParameters. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `CreateSandboxEnvironmentTemplateRequestParameters.builder()` + * for instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_CreateSandboxEnvironmentTemplateRequestParameters.Builder(); + } + + /** + * Setter for name. + * + *

name: Name of the agent engine to create the template under. + */ + @JsonProperty("name") + public abstract Builder name(String name); + + @ExcludeFromGeneratedCoverageReport + abstract Builder name(Optional name); + + /** Clears the value of name field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearName() { + return name(Optional.empty()); + } + + /** + * Setter for displayName. + * + *

displayName: The display name of the sandbox template. + */ + @JsonProperty("displayName") + public abstract Builder displayName(String displayName); + + @ExcludeFromGeneratedCoverageReport + abstract Builder displayName(Optional displayName); + + /** Clears the value of displayName field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearDisplayName() { + return displayName(Optional.empty()); + } + + /** + * Setter for config. + * + *

config: + */ + @JsonProperty("config") + public abstract Builder config(CreateSandboxEnvironmentTemplateConfig config); + + /** + * Setter for config builder. + * + *

config: + */ + @CanIgnoreReturnValue + public Builder config(CreateSandboxEnvironmentTemplateConfig.Builder configBuilder) { + return config(configBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder config(Optional config); + + /** Clears the value of config field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearConfig() { + return config(Optional.empty()); + } + + public abstract CreateSandboxEnvironmentTemplateRequestParameters build(); + } + + /** Deserializes a JSON string to a CreateSandboxEnvironmentTemplateRequestParameters object. */ + @ExcludeFromGeneratedCoverageReport + public static CreateSandboxEnvironmentTemplateRequestParameters fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, CreateSandboxEnvironmentTemplateRequestParameters.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/DefaultContainerCategory.java b/src/main/java/com/google/cloud/agentplatform/types/DefaultContainerCategory.java new file mode 100644 index 0000000..250497b --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/DefaultContainerCategory.java @@ -0,0 +1,108 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.base.Ascii; +import java.util.Objects; + +/** The category of the default container image. */ +public class DefaultContainerCategory { + + /** Enum representing the known values for DefaultContainerCategory. */ + public enum Known { + /** The default value. This value is unused. */ + DEFAULT_CONTAINER_CATEGORY_UNSPECIFIED, + + /** The default container image for Computer Use. */ + DEFAULT_CONTAINER_CATEGORY_COMPUTER_USE + } + + private Known defaultContainerCategoryEnum; + private final String value; + + @JsonCreator + public DefaultContainerCategory(String value) { + this.value = value; + for (Known defaultContainerCategoryEnum : Known.values()) { + if (Ascii.equalsIgnoreCase(defaultContainerCategoryEnum.toString(), value)) { + this.defaultContainerCategoryEnum = defaultContainerCategoryEnum; + break; + } + } + if (this.defaultContainerCategoryEnum == null) { + this.defaultContainerCategoryEnum = Known.DEFAULT_CONTAINER_CATEGORY_UNSPECIFIED; + } + } + + public DefaultContainerCategory(Known knownValue) { + this.defaultContainerCategoryEnum = knownValue; + this.value = knownValue.toString(); + } + + @ExcludeFromGeneratedCoverageReport + @Override + @JsonValue + public String toString() { + return this.value; + } + + @ExcludeFromGeneratedCoverageReport + @SuppressWarnings("PatternMatchingInstanceof") + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null) { + return false; + } + + if (!(o instanceof DefaultContainerCategory)) { + return false; + } + + DefaultContainerCategory other = (DefaultContainerCategory) o; + + if (this.defaultContainerCategoryEnum != Known.DEFAULT_CONTAINER_CATEGORY_UNSPECIFIED + && other.defaultContainerCategoryEnum != Known.DEFAULT_CONTAINER_CATEGORY_UNSPECIFIED) { + return this.defaultContainerCategoryEnum == other.defaultContainerCategoryEnum; + } else if (this.defaultContainerCategoryEnum == Known.DEFAULT_CONTAINER_CATEGORY_UNSPECIFIED + && other.defaultContainerCategoryEnum == Known.DEFAULT_CONTAINER_CATEGORY_UNSPECIFIED) { + return this.value.equals(other.value); + } + return false; + } + + @ExcludeFromGeneratedCoverageReport + @Override + public int hashCode() { + if (this.defaultContainerCategoryEnum != Known.DEFAULT_CONTAINER_CATEGORY_UNSPECIFIED) { + return this.defaultContainerCategoryEnum.hashCode(); + } else { + return Objects.hashCode(this.value); + } + } + + @ExcludeFromGeneratedCoverageReport + public Known knownEnum() { + return this.defaultContainerCategoryEnum; + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/DeleteSandboxEnvironmentSnapshotConfig.java b/src/main/java/com/google/cloud/agentplatform/types/DeleteSandboxEnvironmentSnapshotConfig.java new file mode 100644 index 0000000..da874f0 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/DeleteSandboxEnvironmentSnapshotConfig.java @@ -0,0 +1,86 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import com.google.genai.types.HttpOptions; +import java.util.Optional; + +/** Config for deleting a Sandbox Environment Snapshot. */ +@AutoValue +@JsonDeserialize(builder = DeleteSandboxEnvironmentSnapshotConfig.Builder.class) +public abstract class DeleteSandboxEnvironmentSnapshotConfig extends JsonSerializable { + /** Used to override HTTP request options. */ + @JsonProperty("httpOptions") + public abstract Optional httpOptions(); + + /** Instantiates a builder for DeleteSandboxEnvironmentSnapshotConfig. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_DeleteSandboxEnvironmentSnapshotConfig.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for DeleteSandboxEnvironmentSnapshotConfig. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `DeleteSandboxEnvironmentSnapshotConfig.builder()` for + * instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_DeleteSandboxEnvironmentSnapshotConfig.Builder(); + } + + /** + * Setter for httpOptions. + * + *

httpOptions: Used to override HTTP request options. + */ + @JsonProperty("httpOptions") + public abstract Builder httpOptions(HttpOptions httpOptions); + + @ExcludeFromGeneratedCoverageReport + abstract Builder httpOptions(Optional httpOptions); + + /** Clears the value of httpOptions field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearHttpOptions() { + return httpOptions(Optional.empty()); + } + + public abstract DeleteSandboxEnvironmentSnapshotConfig build(); + } + + /** Deserializes a JSON string to a DeleteSandboxEnvironmentSnapshotConfig object. */ + @ExcludeFromGeneratedCoverageReport + public static DeleteSandboxEnvironmentSnapshotConfig fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, DeleteSandboxEnvironmentSnapshotConfig.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/DeleteSandboxEnvironmentSnapshotOperation.java b/src/main/java/com/google/cloud/agentplatform/types/DeleteSandboxEnvironmentSnapshotOperation.java new file mode 100644 index 0000000..7f751c6 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/DeleteSandboxEnvironmentSnapshotOperation.java @@ -0,0 +1,170 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Map; +import java.util.Optional; + +/** Operation for deleting sandbox environment snapshots. */ +@AutoValue +@JsonDeserialize(builder = DeleteSandboxEnvironmentSnapshotOperation.Builder.class) +public abstract class DeleteSandboxEnvironmentSnapshotOperation extends JsonSerializable { + /** + * The server-assigned name, which is only unique within the same service that originally returns + * it. If you use the default HTTP mapping, the `name` should be a resource name ending with + * `operations/{unique_id}`. + */ + @JsonProperty("name") + public abstract Optional name(); + + /** + * Service-specific metadata associated with the operation. It typically contains progress + * information and common metadata such as create time. Some services might not provide such + * metadata. Any method that returns a long-running operation should document the metadata type, + * if any. + */ + @JsonProperty("metadata") + public abstract Optional> metadata(); + + /** + * If the value is `false`, it means the operation is still in progress. If `true`, the operation + * is completed, and either `error` or `response` is available. + */ + @JsonProperty("done") + public abstract Optional done(); + + /** The error result of the operation in case of failure or cancellation. */ + @JsonProperty("error") + public abstract Optional> error(); + + /** Instantiates a builder for DeleteSandboxEnvironmentSnapshotOperation. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_DeleteSandboxEnvironmentSnapshotOperation.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for DeleteSandboxEnvironmentSnapshotOperation. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `DeleteSandboxEnvironmentSnapshotOperation.builder()` for + * instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_DeleteSandboxEnvironmentSnapshotOperation.Builder(); + } + + /** + * Setter for name. + * + *

name: The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the `name` should be a resource + * name ending with `operations/{unique_id}`. + */ + @JsonProperty("name") + public abstract Builder name(String name); + + @ExcludeFromGeneratedCoverageReport + abstract Builder name(Optional name); + + /** Clears the value of name field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearName() { + return name(Optional.empty()); + } + + /** + * Setter for metadata. + * + *

metadata: Service-specific metadata associated with the operation. It typically contains + * progress information and common metadata such as create time. Some services might not provide + * such metadata. Any method that returns a long-running operation should document the metadata + * type, if any. + */ + @JsonProperty("metadata") + public abstract Builder metadata(Map metadata); + + @ExcludeFromGeneratedCoverageReport + abstract Builder metadata(Optional> metadata); + + /** Clears the value of metadata field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearMetadata() { + return metadata(Optional.empty()); + } + + /** + * Setter for done. + * + *

done: If the value is `false`, it means the operation is still in progress. If `true`, the + * operation is completed, and either `error` or `response` is available. + */ + @JsonProperty("done") + public abstract Builder done(boolean done); + + @ExcludeFromGeneratedCoverageReport + abstract Builder done(Optional done); + + /** Clears the value of done field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearDone() { + return done(Optional.empty()); + } + + /** + * Setter for error. + * + *

error: The error result of the operation in case of failure or cancellation. + */ + @JsonProperty("error") + public abstract Builder error(Map error); + + @ExcludeFromGeneratedCoverageReport + abstract Builder error(Optional> error); + + /** Clears the value of error field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearError() { + return error(Optional.empty()); + } + + public abstract DeleteSandboxEnvironmentSnapshotOperation build(); + } + + /** Deserializes a JSON string to a DeleteSandboxEnvironmentSnapshotOperation object. */ + @ExcludeFromGeneratedCoverageReport + public static DeleteSandboxEnvironmentSnapshotOperation fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, DeleteSandboxEnvironmentSnapshotOperation.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/DeleteSandboxEnvironmentSnapshotRequestParameters.java b/src/main/java/com/google/cloud/agentplatform/types/DeleteSandboxEnvironmentSnapshotRequestParameters.java new file mode 100644 index 0000000..c2f1985 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/DeleteSandboxEnvironmentSnapshotRequestParameters.java @@ -0,0 +1,119 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Optional; + +/** Parameters for deleting sandbox environment snapshots. */ +@AutoValue +@InternalApi +@JsonDeserialize(builder = DeleteSandboxEnvironmentSnapshotRequestParameters.Builder.class) +public abstract class DeleteSandboxEnvironmentSnapshotRequestParameters extends JsonSerializable { + /** Name of the sandbox environment snapshot to delete. */ + @JsonProperty("name") + public abstract Optional name(); + + /** */ + @JsonProperty("config") + public abstract Optional config(); + + /** Instantiates a builder for DeleteSandboxEnvironmentSnapshotRequestParameters. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_DeleteSandboxEnvironmentSnapshotRequestParameters.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for DeleteSandboxEnvironmentSnapshotRequestParameters. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `DeleteSandboxEnvironmentSnapshotRequestParameters.builder()` + * for instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_DeleteSandboxEnvironmentSnapshotRequestParameters.Builder(); + } + + /** + * Setter for name. + * + *

name: Name of the sandbox environment snapshot to delete. + */ + @JsonProperty("name") + public abstract Builder name(String name); + + @ExcludeFromGeneratedCoverageReport + abstract Builder name(Optional name); + + /** Clears the value of name field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearName() { + return name(Optional.empty()); + } + + /** + * Setter for config. + * + *

config: + */ + @JsonProperty("config") + public abstract Builder config(DeleteSandboxEnvironmentSnapshotConfig config); + + /** + * Setter for config builder. + * + *

config: + */ + @CanIgnoreReturnValue + public Builder config(DeleteSandboxEnvironmentSnapshotConfig.Builder configBuilder) { + return config(configBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder config(Optional config); + + /** Clears the value of config field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearConfig() { + return config(Optional.empty()); + } + + public abstract DeleteSandboxEnvironmentSnapshotRequestParameters build(); + } + + /** Deserializes a JSON string to a DeleteSandboxEnvironmentSnapshotRequestParameters object. */ + @ExcludeFromGeneratedCoverageReport + public static DeleteSandboxEnvironmentSnapshotRequestParameters fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, DeleteSandboxEnvironmentSnapshotRequestParameters.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/DeleteSandboxEnvironmentTemplateConfig.java b/src/main/java/com/google/cloud/agentplatform/types/DeleteSandboxEnvironmentTemplateConfig.java new file mode 100644 index 0000000..149160d --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/DeleteSandboxEnvironmentTemplateConfig.java @@ -0,0 +1,86 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import com.google.genai.types.HttpOptions; +import java.util.Optional; + +/** Config for deleting a Sandbox Template. */ +@AutoValue +@JsonDeserialize(builder = DeleteSandboxEnvironmentTemplateConfig.Builder.class) +public abstract class DeleteSandboxEnvironmentTemplateConfig extends JsonSerializable { + /** Used to override HTTP request options. */ + @JsonProperty("httpOptions") + public abstract Optional httpOptions(); + + /** Instantiates a builder for DeleteSandboxEnvironmentTemplateConfig. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_DeleteSandboxEnvironmentTemplateConfig.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for DeleteSandboxEnvironmentTemplateConfig. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `DeleteSandboxEnvironmentTemplateConfig.builder()` for + * instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_DeleteSandboxEnvironmentTemplateConfig.Builder(); + } + + /** + * Setter for httpOptions. + * + *

httpOptions: Used to override HTTP request options. + */ + @JsonProperty("httpOptions") + public abstract Builder httpOptions(HttpOptions httpOptions); + + @ExcludeFromGeneratedCoverageReport + abstract Builder httpOptions(Optional httpOptions); + + /** Clears the value of httpOptions field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearHttpOptions() { + return httpOptions(Optional.empty()); + } + + public abstract DeleteSandboxEnvironmentTemplateConfig build(); + } + + /** Deserializes a JSON string to a DeleteSandboxEnvironmentTemplateConfig object. */ + @ExcludeFromGeneratedCoverageReport + public static DeleteSandboxEnvironmentTemplateConfig fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, DeleteSandboxEnvironmentTemplateConfig.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/DeleteSandboxEnvironmentTemplateOperation.java b/src/main/java/com/google/cloud/agentplatform/types/DeleteSandboxEnvironmentTemplateOperation.java new file mode 100644 index 0000000..5bd72ad --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/DeleteSandboxEnvironmentTemplateOperation.java @@ -0,0 +1,170 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Map; +import java.util.Optional; + +/** Operation for deleting sandbox templates. */ +@AutoValue +@JsonDeserialize(builder = DeleteSandboxEnvironmentTemplateOperation.Builder.class) +public abstract class DeleteSandboxEnvironmentTemplateOperation extends JsonSerializable { + /** + * The server-assigned name, which is only unique within the same service that originally returns + * it. If you use the default HTTP mapping, the `name` should be a resource name ending with + * `operations/{unique_id}`. + */ + @JsonProperty("name") + public abstract Optional name(); + + /** + * Service-specific metadata associated with the operation. It typically contains progress + * information and common metadata such as create time. Some services might not provide such + * metadata. Any method that returns a long-running operation should document the metadata type, + * if any. + */ + @JsonProperty("metadata") + public abstract Optional> metadata(); + + /** + * If the value is `false`, it means the operation is still in progress. If `true`, the operation + * is completed, and either `error` or `response` is available. + */ + @JsonProperty("done") + public abstract Optional done(); + + /** The error result of the operation in case of failure or cancellation. */ + @JsonProperty("error") + public abstract Optional> error(); + + /** Instantiates a builder for DeleteSandboxEnvironmentTemplateOperation. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_DeleteSandboxEnvironmentTemplateOperation.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for DeleteSandboxEnvironmentTemplateOperation. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `DeleteSandboxEnvironmentTemplateOperation.builder()` for + * instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_DeleteSandboxEnvironmentTemplateOperation.Builder(); + } + + /** + * Setter for name. + * + *

name: The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the `name` should be a resource + * name ending with `operations/{unique_id}`. + */ + @JsonProperty("name") + public abstract Builder name(String name); + + @ExcludeFromGeneratedCoverageReport + abstract Builder name(Optional name); + + /** Clears the value of name field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearName() { + return name(Optional.empty()); + } + + /** + * Setter for metadata. + * + *

metadata: Service-specific metadata associated with the operation. It typically contains + * progress information and common metadata such as create time. Some services might not provide + * such metadata. Any method that returns a long-running operation should document the metadata + * type, if any. + */ + @JsonProperty("metadata") + public abstract Builder metadata(Map metadata); + + @ExcludeFromGeneratedCoverageReport + abstract Builder metadata(Optional> metadata); + + /** Clears the value of metadata field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearMetadata() { + return metadata(Optional.empty()); + } + + /** + * Setter for done. + * + *

done: If the value is `false`, it means the operation is still in progress. If `true`, the + * operation is completed, and either `error` or `response` is available. + */ + @JsonProperty("done") + public abstract Builder done(boolean done); + + @ExcludeFromGeneratedCoverageReport + abstract Builder done(Optional done); + + /** Clears the value of done field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearDone() { + return done(Optional.empty()); + } + + /** + * Setter for error. + * + *

error: The error result of the operation in case of failure or cancellation. + */ + @JsonProperty("error") + public abstract Builder error(Map error); + + @ExcludeFromGeneratedCoverageReport + abstract Builder error(Optional> error); + + /** Clears the value of error field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearError() { + return error(Optional.empty()); + } + + public abstract DeleteSandboxEnvironmentTemplateOperation build(); + } + + /** Deserializes a JSON string to a DeleteSandboxEnvironmentTemplateOperation object. */ + @ExcludeFromGeneratedCoverageReport + public static DeleteSandboxEnvironmentTemplateOperation fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, DeleteSandboxEnvironmentTemplateOperation.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/DeleteSandboxEnvironmentTemplateRequestParameters.java b/src/main/java/com/google/cloud/agentplatform/types/DeleteSandboxEnvironmentTemplateRequestParameters.java new file mode 100644 index 0000000..6e788c2 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/DeleteSandboxEnvironmentTemplateRequestParameters.java @@ -0,0 +1,119 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Optional; + +/** Parameters for deleting sandbox templates. */ +@AutoValue +@InternalApi +@JsonDeserialize(builder = DeleteSandboxEnvironmentTemplateRequestParameters.Builder.class) +public abstract class DeleteSandboxEnvironmentTemplateRequestParameters extends JsonSerializable { + /** Name of the sandbox template to delete. */ + @JsonProperty("name") + public abstract Optional name(); + + /** */ + @JsonProperty("config") + public abstract Optional config(); + + /** Instantiates a builder for DeleteSandboxEnvironmentTemplateRequestParameters. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_DeleteSandboxEnvironmentTemplateRequestParameters.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for DeleteSandboxEnvironmentTemplateRequestParameters. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `DeleteSandboxEnvironmentTemplateRequestParameters.builder()` + * for instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_DeleteSandboxEnvironmentTemplateRequestParameters.Builder(); + } + + /** + * Setter for name. + * + *

name: Name of the sandbox template to delete. + */ + @JsonProperty("name") + public abstract Builder name(String name); + + @ExcludeFromGeneratedCoverageReport + abstract Builder name(Optional name); + + /** Clears the value of name field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearName() { + return name(Optional.empty()); + } + + /** + * Setter for config. + * + *

config: + */ + @JsonProperty("config") + public abstract Builder config(DeleteSandboxEnvironmentTemplateConfig config); + + /** + * Setter for config builder. + * + *

config: + */ + @CanIgnoreReturnValue + public Builder config(DeleteSandboxEnvironmentTemplateConfig.Builder configBuilder) { + return config(configBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder config(Optional config); + + /** Clears the value of config field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearConfig() { + return config(Optional.empty()); + } + + public abstract DeleteSandboxEnvironmentTemplateRequestParameters build(); + } + + /** Deserializes a JSON string to a DeleteSandboxEnvironmentTemplateRequestParameters object. */ + @ExcludeFromGeneratedCoverageReport + public static DeleteSandboxEnvironmentTemplateRequestParameters fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, DeleteSandboxEnvironmentTemplateRequestParameters.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/GetAgentEngineSandboxSnapshotOperationParameters.java b/src/main/java/com/google/cloud/agentplatform/types/GetAgentEngineSandboxSnapshotOperationParameters.java new file mode 100644 index 0000000..03a1643 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/GetAgentEngineSandboxSnapshotOperationParameters.java @@ -0,0 +1,119 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Optional; + +/** Parameters for getting an operation with a sandbox snapshot as a response. */ +@AutoValue +@InternalApi +@JsonDeserialize(builder = GetAgentEngineSandboxSnapshotOperationParameters.Builder.class) +public abstract class GetAgentEngineSandboxSnapshotOperationParameters extends JsonSerializable { + /** The server-assigned name for the operation. */ + @JsonProperty("operationName") + public abstract Optional operationName(); + + /** Used to override the default configuration. */ + @JsonProperty("config") + public abstract Optional config(); + + /** Instantiates a builder for GetAgentEngineSandboxSnapshotOperationParameters. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_GetAgentEngineSandboxSnapshotOperationParameters.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for GetAgentEngineSandboxSnapshotOperationParameters. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `GetAgentEngineSandboxSnapshotOperationParameters.builder()` + * for instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_GetAgentEngineSandboxSnapshotOperationParameters.Builder(); + } + + /** + * Setter for operationName. + * + *

operationName: The server-assigned name for the operation. + */ + @JsonProperty("operationName") + public abstract Builder operationName(String operationName); + + @ExcludeFromGeneratedCoverageReport + abstract Builder operationName(Optional operationName); + + /** Clears the value of operationName field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearOperationName() { + return operationName(Optional.empty()); + } + + /** + * Setter for config. + * + *

config: Used to override the default configuration. + */ + @JsonProperty("config") + public abstract Builder config(GetAgentEngineOperationConfig config); + + /** + * Setter for config builder. + * + *

config: Used to override the default configuration. + */ + @CanIgnoreReturnValue + public Builder config(GetAgentEngineOperationConfig.Builder configBuilder) { + return config(configBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder config(Optional config); + + /** Clears the value of config field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearConfig() { + return config(Optional.empty()); + } + + public abstract GetAgentEngineSandboxSnapshotOperationParameters build(); + } + + /** Deserializes a JSON string to a GetAgentEngineSandboxSnapshotOperationParameters object. */ + @ExcludeFromGeneratedCoverageReport + public static GetAgentEngineSandboxSnapshotOperationParameters fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, GetAgentEngineSandboxSnapshotOperationParameters.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/GetSandboxEnvironmentSnapshotConfig.java b/src/main/java/com/google/cloud/agentplatform/types/GetSandboxEnvironmentSnapshotConfig.java new file mode 100644 index 0000000..1a390c8 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/GetSandboxEnvironmentSnapshotConfig.java @@ -0,0 +1,85 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import com.google.genai.types.HttpOptions; +import java.util.Optional; + +/** Config for getting a Sandbox Environment Snapshot. */ +@AutoValue +@JsonDeserialize(builder = GetSandboxEnvironmentSnapshotConfig.Builder.class) +public abstract class GetSandboxEnvironmentSnapshotConfig extends JsonSerializable { + /** Used to override HTTP request options. */ + @JsonProperty("httpOptions") + public abstract Optional httpOptions(); + + /** Instantiates a builder for GetSandboxEnvironmentSnapshotConfig. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_GetSandboxEnvironmentSnapshotConfig.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for GetSandboxEnvironmentSnapshotConfig. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `GetSandboxEnvironmentSnapshotConfig.builder()` for + * instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_GetSandboxEnvironmentSnapshotConfig.Builder(); + } + + /** + * Setter for httpOptions. + * + *

httpOptions: Used to override HTTP request options. + */ + @JsonProperty("httpOptions") + public abstract Builder httpOptions(HttpOptions httpOptions); + + @ExcludeFromGeneratedCoverageReport + abstract Builder httpOptions(Optional httpOptions); + + /** Clears the value of httpOptions field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearHttpOptions() { + return httpOptions(Optional.empty()); + } + + public abstract GetSandboxEnvironmentSnapshotConfig build(); + } + + /** Deserializes a JSON string to a GetSandboxEnvironmentSnapshotConfig object. */ + @ExcludeFromGeneratedCoverageReport + public static GetSandboxEnvironmentSnapshotConfig fromJson(String jsonString) { + return JsonSerializable.fromJsonString(jsonString, GetSandboxEnvironmentSnapshotConfig.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/GetSandboxEnvironmentSnapshotRequestParameters.java b/src/main/java/com/google/cloud/agentplatform/types/GetSandboxEnvironmentSnapshotRequestParameters.java new file mode 100644 index 0000000..b0790f5 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/GetSandboxEnvironmentSnapshotRequestParameters.java @@ -0,0 +1,119 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Optional; + +/** Parameters for getting a sandbox environment snapshot. */ +@AutoValue +@InternalApi +@JsonDeserialize(builder = GetSandboxEnvironmentSnapshotRequestParameters.Builder.class) +public abstract class GetSandboxEnvironmentSnapshotRequestParameters extends JsonSerializable { + /** Name of the sandbox environment snapshot. */ + @JsonProperty("name") + public abstract Optional name(); + + /** */ + @JsonProperty("config") + public abstract Optional config(); + + /** Instantiates a builder for GetSandboxEnvironmentSnapshotRequestParameters. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_GetSandboxEnvironmentSnapshotRequestParameters.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for GetSandboxEnvironmentSnapshotRequestParameters. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `GetSandboxEnvironmentSnapshotRequestParameters.builder()` for + * instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_GetSandboxEnvironmentSnapshotRequestParameters.Builder(); + } + + /** + * Setter for name. + * + *

name: Name of the sandbox environment snapshot. + */ + @JsonProperty("name") + public abstract Builder name(String name); + + @ExcludeFromGeneratedCoverageReport + abstract Builder name(Optional name); + + /** Clears the value of name field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearName() { + return name(Optional.empty()); + } + + /** + * Setter for config. + * + *

config: + */ + @JsonProperty("config") + public abstract Builder config(GetSandboxEnvironmentSnapshotConfig config); + + /** + * Setter for config builder. + * + *

config: + */ + @CanIgnoreReturnValue + public Builder config(GetSandboxEnvironmentSnapshotConfig.Builder configBuilder) { + return config(configBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder config(Optional config); + + /** Clears the value of config field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearConfig() { + return config(Optional.empty()); + } + + public abstract GetSandboxEnvironmentSnapshotRequestParameters build(); + } + + /** Deserializes a JSON string to a GetSandboxEnvironmentSnapshotRequestParameters object. */ + @ExcludeFromGeneratedCoverageReport + public static GetSandboxEnvironmentSnapshotRequestParameters fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, GetSandboxEnvironmentSnapshotRequestParameters.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/GetSandboxEnvironmentTemplateConfig.java b/src/main/java/com/google/cloud/agentplatform/types/GetSandboxEnvironmentTemplateConfig.java new file mode 100644 index 0000000..0c4efbe --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/GetSandboxEnvironmentTemplateConfig.java @@ -0,0 +1,85 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import com.google.genai.types.HttpOptions; +import java.util.Optional; + +/** Config for getting a Sandbox Template. */ +@AutoValue +@JsonDeserialize(builder = GetSandboxEnvironmentTemplateConfig.Builder.class) +public abstract class GetSandboxEnvironmentTemplateConfig extends JsonSerializable { + /** Used to override HTTP request options. */ + @JsonProperty("httpOptions") + public abstract Optional httpOptions(); + + /** Instantiates a builder for GetSandboxEnvironmentTemplateConfig. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_GetSandboxEnvironmentTemplateConfig.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for GetSandboxEnvironmentTemplateConfig. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `GetSandboxEnvironmentTemplateConfig.builder()` for + * instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_GetSandboxEnvironmentTemplateConfig.Builder(); + } + + /** + * Setter for httpOptions. + * + *

httpOptions: Used to override HTTP request options. + */ + @JsonProperty("httpOptions") + public abstract Builder httpOptions(HttpOptions httpOptions); + + @ExcludeFromGeneratedCoverageReport + abstract Builder httpOptions(Optional httpOptions); + + /** Clears the value of httpOptions field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearHttpOptions() { + return httpOptions(Optional.empty()); + } + + public abstract GetSandboxEnvironmentTemplateConfig build(); + } + + /** Deserializes a JSON string to a GetSandboxEnvironmentTemplateConfig object. */ + @ExcludeFromGeneratedCoverageReport + public static GetSandboxEnvironmentTemplateConfig fromJson(String jsonString) { + return JsonSerializable.fromJsonString(jsonString, GetSandboxEnvironmentTemplateConfig.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/GetSandboxEnvironmentTemplateOperationParameters.java b/src/main/java/com/google/cloud/agentplatform/types/GetSandboxEnvironmentTemplateOperationParameters.java new file mode 100644 index 0000000..0201311 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/GetSandboxEnvironmentTemplateOperationParameters.java @@ -0,0 +1,119 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Optional; + +/** Parameters for getting an operation with a sandbox template as a response. */ +@AutoValue +@InternalApi +@JsonDeserialize(builder = GetSandboxEnvironmentTemplateOperationParameters.Builder.class) +public abstract class GetSandboxEnvironmentTemplateOperationParameters extends JsonSerializable { + /** The server-assigned name for the operation. */ + @JsonProperty("operationName") + public abstract Optional operationName(); + + /** Used to override the default configuration. */ + @JsonProperty("config") + public abstract Optional config(); + + /** Instantiates a builder for GetSandboxEnvironmentTemplateOperationParameters. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_GetSandboxEnvironmentTemplateOperationParameters.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for GetSandboxEnvironmentTemplateOperationParameters. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `GetSandboxEnvironmentTemplateOperationParameters.builder()` + * for instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_GetSandboxEnvironmentTemplateOperationParameters.Builder(); + } + + /** + * Setter for operationName. + * + *

operationName: The server-assigned name for the operation. + */ + @JsonProperty("operationName") + public abstract Builder operationName(String operationName); + + @ExcludeFromGeneratedCoverageReport + abstract Builder operationName(Optional operationName); + + /** Clears the value of operationName field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearOperationName() { + return operationName(Optional.empty()); + } + + /** + * Setter for config. + * + *

config: Used to override the default configuration. + */ + @JsonProperty("config") + public abstract Builder config(GetAgentEngineOperationConfig config); + + /** + * Setter for config builder. + * + *

config: Used to override the default configuration. + */ + @CanIgnoreReturnValue + public Builder config(GetAgentEngineOperationConfig.Builder configBuilder) { + return config(configBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder config(Optional config); + + /** Clears the value of config field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearConfig() { + return config(Optional.empty()); + } + + public abstract GetSandboxEnvironmentTemplateOperationParameters build(); + } + + /** Deserializes a JSON string to a GetSandboxEnvironmentTemplateOperationParameters object. */ + @ExcludeFromGeneratedCoverageReport + public static GetSandboxEnvironmentTemplateOperationParameters fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, GetSandboxEnvironmentTemplateOperationParameters.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/GetSandboxEnvironmentTemplateRequestParameters.java b/src/main/java/com/google/cloud/agentplatform/types/GetSandboxEnvironmentTemplateRequestParameters.java new file mode 100644 index 0000000..ba45917 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/GetSandboxEnvironmentTemplateRequestParameters.java @@ -0,0 +1,119 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Optional; + +/** Parameters for getting a sandbox template. */ +@AutoValue +@InternalApi +@JsonDeserialize(builder = GetSandboxEnvironmentTemplateRequestParameters.Builder.class) +public abstract class GetSandboxEnvironmentTemplateRequestParameters extends JsonSerializable { + /** Name of the sandbox template. */ + @JsonProperty("name") + public abstract Optional name(); + + /** */ + @JsonProperty("config") + public abstract Optional config(); + + /** Instantiates a builder for GetSandboxEnvironmentTemplateRequestParameters. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_GetSandboxEnvironmentTemplateRequestParameters.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for GetSandboxEnvironmentTemplateRequestParameters. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `GetSandboxEnvironmentTemplateRequestParameters.builder()` for + * instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_GetSandboxEnvironmentTemplateRequestParameters.Builder(); + } + + /** + * Setter for name. + * + *

name: Name of the sandbox template. + */ + @JsonProperty("name") + public abstract Builder name(String name); + + @ExcludeFromGeneratedCoverageReport + abstract Builder name(Optional name); + + /** Clears the value of name field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearName() { + return name(Optional.empty()); + } + + /** + * Setter for config. + * + *

config: + */ + @JsonProperty("config") + public abstract Builder config(GetSandboxEnvironmentTemplateConfig config); + + /** + * Setter for config builder. + * + *

config: + */ + @CanIgnoreReturnValue + public Builder config(GetSandboxEnvironmentTemplateConfig.Builder configBuilder) { + return config(configBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder config(Optional config); + + /** Clears the value of config field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearConfig() { + return config(Optional.empty()); + } + + public abstract GetSandboxEnvironmentTemplateRequestParameters build(); + } + + /** Deserializes a JSON string to a GetSandboxEnvironmentTemplateRequestParameters object. */ + @ExcludeFromGeneratedCoverageReport + public static GetSandboxEnvironmentTemplateRequestParameters fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, GetSandboxEnvironmentTemplateRequestParameters.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/ListSandboxEnvironmentSnapshotsConfig.java b/src/main/java/com/google/cloud/agentplatform/types/ListSandboxEnvironmentSnapshotsConfig.java new file mode 100644 index 0000000..268f389 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/ListSandboxEnvironmentSnapshotsConfig.java @@ -0,0 +1,151 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import com.google.genai.types.HttpOptions; +import java.util.Optional; + +/** Config for listing sandbox environment snapshots. */ +@AutoValue +@JsonDeserialize(builder = ListSandboxEnvironmentSnapshotsConfig.Builder.class) +public abstract class ListSandboxEnvironmentSnapshotsConfig extends JsonSerializable { + /** Used to override HTTP request options. */ + @JsonProperty("httpOptions") + public abstract Optional httpOptions(); + + /** */ + @JsonProperty("pageSize") + public abstract Optional pageSize(); + + /** */ + @JsonProperty("pageToken") + public abstract Optional pageToken(); + + /** An expression for filtering the results of the request. */ + @JsonProperty("filter") + public abstract Optional filter(); + + /** Instantiates a builder for ListSandboxEnvironmentSnapshotsConfig. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_ListSandboxEnvironmentSnapshotsConfig.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for ListSandboxEnvironmentSnapshotsConfig. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `ListSandboxEnvironmentSnapshotsConfig.builder()` for + * instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_ListSandboxEnvironmentSnapshotsConfig.Builder(); + } + + /** + * Setter for httpOptions. + * + *

httpOptions: Used to override HTTP request options. + */ + @JsonProperty("httpOptions") + public abstract Builder httpOptions(HttpOptions httpOptions); + + @ExcludeFromGeneratedCoverageReport + abstract Builder httpOptions(Optional httpOptions); + + /** Clears the value of httpOptions field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearHttpOptions() { + return httpOptions(Optional.empty()); + } + + /** + * Setter for pageSize. + * + *

pageSize: + */ + @JsonProperty("pageSize") + public abstract Builder pageSize(Integer pageSize); + + @ExcludeFromGeneratedCoverageReport + abstract Builder pageSize(Optional pageSize); + + /** Clears the value of pageSize field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearPageSize() { + return pageSize(Optional.empty()); + } + + /** + * Setter for pageToken. + * + *

pageToken: + */ + @JsonProperty("pageToken") + public abstract Builder pageToken(String pageToken); + + @ExcludeFromGeneratedCoverageReport + abstract Builder pageToken(Optional pageToken); + + /** Clears the value of pageToken field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearPageToken() { + return pageToken(Optional.empty()); + } + + /** + * Setter for filter. + * + *

filter: An expression for filtering the results of the request. + */ + @JsonProperty("filter") + public abstract Builder filter(String filter); + + @ExcludeFromGeneratedCoverageReport + abstract Builder filter(Optional filter); + + /** Clears the value of filter field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearFilter() { + return filter(Optional.empty()); + } + + public abstract ListSandboxEnvironmentSnapshotsConfig build(); + } + + /** Deserializes a JSON string to a ListSandboxEnvironmentSnapshotsConfig object. */ + @ExcludeFromGeneratedCoverageReport + public static ListSandboxEnvironmentSnapshotsConfig fromJson(String jsonString) { + return JsonSerializable.fromJsonString(jsonString, ListSandboxEnvironmentSnapshotsConfig.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/ListSandboxEnvironmentSnapshotsRequestParameters.java b/src/main/java/com/google/cloud/agentplatform/types/ListSandboxEnvironmentSnapshotsRequestParameters.java new file mode 100644 index 0000000..05ea415 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/ListSandboxEnvironmentSnapshotsRequestParameters.java @@ -0,0 +1,119 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Optional; + +/** Parameters for listing sandbox environment snapshots. */ +@AutoValue +@InternalApi +@JsonDeserialize(builder = ListSandboxEnvironmentSnapshotsRequestParameters.Builder.class) +public abstract class ListSandboxEnvironmentSnapshotsRequestParameters extends JsonSerializable { + /** Name of the reasoning engine to list snapshots from. */ + @JsonProperty("name") + public abstract Optional name(); + + /** */ + @JsonProperty("config") + public abstract Optional config(); + + /** Instantiates a builder for ListSandboxEnvironmentSnapshotsRequestParameters. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_ListSandboxEnvironmentSnapshotsRequestParameters.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for ListSandboxEnvironmentSnapshotsRequestParameters. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `ListSandboxEnvironmentSnapshotsRequestParameters.builder()` + * for instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_ListSandboxEnvironmentSnapshotsRequestParameters.Builder(); + } + + /** + * Setter for name. + * + *

name: Name of the reasoning engine to list snapshots from. + */ + @JsonProperty("name") + public abstract Builder name(String name); + + @ExcludeFromGeneratedCoverageReport + abstract Builder name(Optional name); + + /** Clears the value of name field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearName() { + return name(Optional.empty()); + } + + /** + * Setter for config. + * + *

config: + */ + @JsonProperty("config") + public abstract Builder config(ListSandboxEnvironmentSnapshotsConfig config); + + /** + * Setter for config builder. + * + *

config: + */ + @CanIgnoreReturnValue + public Builder config(ListSandboxEnvironmentSnapshotsConfig.Builder configBuilder) { + return config(configBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder config(Optional config); + + /** Clears the value of config field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearConfig() { + return config(Optional.empty()); + } + + public abstract ListSandboxEnvironmentSnapshotsRequestParameters build(); + } + + /** Deserializes a JSON string to a ListSandboxEnvironmentSnapshotsRequestParameters object. */ + @ExcludeFromGeneratedCoverageReport + public static ListSandboxEnvironmentSnapshotsRequestParameters fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, ListSandboxEnvironmentSnapshotsRequestParameters.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/ListSandboxEnvironmentSnapshotsResponse.java b/src/main/java/com/google/cloud/agentplatform/types/ListSandboxEnvironmentSnapshotsResponse.java new file mode 100644 index 0000000..48fc831 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/ListSandboxEnvironmentSnapshotsResponse.java @@ -0,0 +1,161 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import static com.google.common.collect.ImmutableList.toImmutableList; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import com.google.genai.types.HttpResponse; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; + +/** Response for listing sandbox environment snapshots. */ +@AutoValue +@JsonDeserialize(builder = ListSandboxEnvironmentSnapshotsResponse.Builder.class) +public abstract class ListSandboxEnvironmentSnapshotsResponse extends JsonSerializable { + /** Used to retain the full HTTP response. */ + @JsonProperty("sdkHttpResponse") + public abstract Optional sdkHttpResponse(); + + /** */ + @JsonProperty("nextPageToken") + public abstract Optional nextPageToken(); + + /** List of sandbox environment snapshots. */ + @JsonProperty("sandboxEnvironmentSnapshots") + public abstract Optional> sandboxEnvironmentSnapshots(); + + /** Instantiates a builder for ListSandboxEnvironmentSnapshotsResponse. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_ListSandboxEnvironmentSnapshotsResponse.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for ListSandboxEnvironmentSnapshotsResponse. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `ListSandboxEnvironmentSnapshotsResponse.builder()` for + * instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_ListSandboxEnvironmentSnapshotsResponse.Builder(); + } + + /** + * Setter for sdkHttpResponse. + * + *

sdkHttpResponse: Used to retain the full HTTP response. + */ + @JsonProperty("sdkHttpResponse") + public abstract Builder sdkHttpResponse(HttpResponse sdkHttpResponse); + + @ExcludeFromGeneratedCoverageReport + abstract Builder sdkHttpResponse(Optional sdkHttpResponse); + + /** Clears the value of sdkHttpResponse field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearSdkHttpResponse() { + return sdkHttpResponse(Optional.empty()); + } + + /** + * Setter for nextPageToken. + * + *

nextPageToken: + */ + @JsonProperty("nextPageToken") + public abstract Builder nextPageToken(String nextPageToken); + + @ExcludeFromGeneratedCoverageReport + abstract Builder nextPageToken(Optional nextPageToken); + + /** Clears the value of nextPageToken field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearNextPageToken() { + return nextPageToken(Optional.empty()); + } + + /** + * Setter for sandboxEnvironmentSnapshots. + * + *

sandboxEnvironmentSnapshots: List of sandbox environment snapshots. + */ + @JsonProperty("sandboxEnvironmentSnapshots") + public abstract Builder sandboxEnvironmentSnapshots( + List sandboxEnvironmentSnapshots); + + /** + * Setter for sandboxEnvironmentSnapshots. + * + *

sandboxEnvironmentSnapshots: List of sandbox environment snapshots. + */ + @CanIgnoreReturnValue + public Builder sandboxEnvironmentSnapshots( + SandboxEnvironmentSnapshot... sandboxEnvironmentSnapshots) { + return sandboxEnvironmentSnapshots(Arrays.asList(sandboxEnvironmentSnapshots)); + } + + /** + * Setter for sandboxEnvironmentSnapshots builder. + * + *

sandboxEnvironmentSnapshots: List of sandbox environment snapshots. + */ + @CanIgnoreReturnValue + public Builder sandboxEnvironmentSnapshots( + SandboxEnvironmentSnapshot.Builder... sandboxEnvironmentSnapshotsBuilders) { + return sandboxEnvironmentSnapshots( + Arrays.asList(sandboxEnvironmentSnapshotsBuilders).stream() + .map(SandboxEnvironmentSnapshot.Builder::build) + .collect(toImmutableList())); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder sandboxEnvironmentSnapshots( + Optional> sandboxEnvironmentSnapshots); + + /** Clears the value of sandboxEnvironmentSnapshots field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearSandboxEnvironmentSnapshots() { + return sandboxEnvironmentSnapshots(Optional.empty()); + } + + public abstract ListSandboxEnvironmentSnapshotsResponse build(); + } + + /** Deserializes a JSON string to a ListSandboxEnvironmentSnapshotsResponse object. */ + @ExcludeFromGeneratedCoverageReport + public static ListSandboxEnvironmentSnapshotsResponse fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, ListSandboxEnvironmentSnapshotsResponse.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/ListSandboxEnvironmentTemplatesConfig.java b/src/main/java/com/google/cloud/agentplatform/types/ListSandboxEnvironmentTemplatesConfig.java new file mode 100644 index 0000000..7b9a6d5 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/ListSandboxEnvironmentTemplatesConfig.java @@ -0,0 +1,151 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import com.google.genai.types.HttpOptions; +import java.util.Optional; + +/** Config for listing sandbox templates. */ +@AutoValue +@JsonDeserialize(builder = ListSandboxEnvironmentTemplatesConfig.Builder.class) +public abstract class ListSandboxEnvironmentTemplatesConfig extends JsonSerializable { + /** Used to override HTTP request options. */ + @JsonProperty("httpOptions") + public abstract Optional httpOptions(); + + /** */ + @JsonProperty("pageSize") + public abstract Optional pageSize(); + + /** */ + @JsonProperty("pageToken") + public abstract Optional pageToken(); + + /** An expression for filtering the results of the request. */ + @JsonProperty("filter") + public abstract Optional filter(); + + /** Instantiates a builder for ListSandboxEnvironmentTemplatesConfig. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_ListSandboxEnvironmentTemplatesConfig.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for ListSandboxEnvironmentTemplatesConfig. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `ListSandboxEnvironmentTemplatesConfig.builder()` for + * instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_ListSandboxEnvironmentTemplatesConfig.Builder(); + } + + /** + * Setter for httpOptions. + * + *

httpOptions: Used to override HTTP request options. + */ + @JsonProperty("httpOptions") + public abstract Builder httpOptions(HttpOptions httpOptions); + + @ExcludeFromGeneratedCoverageReport + abstract Builder httpOptions(Optional httpOptions); + + /** Clears the value of httpOptions field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearHttpOptions() { + return httpOptions(Optional.empty()); + } + + /** + * Setter for pageSize. + * + *

pageSize: + */ + @JsonProperty("pageSize") + public abstract Builder pageSize(Integer pageSize); + + @ExcludeFromGeneratedCoverageReport + abstract Builder pageSize(Optional pageSize); + + /** Clears the value of pageSize field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearPageSize() { + return pageSize(Optional.empty()); + } + + /** + * Setter for pageToken. + * + *

pageToken: + */ + @JsonProperty("pageToken") + public abstract Builder pageToken(String pageToken); + + @ExcludeFromGeneratedCoverageReport + abstract Builder pageToken(Optional pageToken); + + /** Clears the value of pageToken field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearPageToken() { + return pageToken(Optional.empty()); + } + + /** + * Setter for filter. + * + *

filter: An expression for filtering the results of the request. + */ + @JsonProperty("filter") + public abstract Builder filter(String filter); + + @ExcludeFromGeneratedCoverageReport + abstract Builder filter(Optional filter); + + /** Clears the value of filter field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearFilter() { + return filter(Optional.empty()); + } + + public abstract ListSandboxEnvironmentTemplatesConfig build(); + } + + /** Deserializes a JSON string to a ListSandboxEnvironmentTemplatesConfig object. */ + @ExcludeFromGeneratedCoverageReport + public static ListSandboxEnvironmentTemplatesConfig fromJson(String jsonString) { + return JsonSerializable.fromJsonString(jsonString, ListSandboxEnvironmentTemplatesConfig.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/ListSandboxEnvironmentTemplatesRequestParameters.java b/src/main/java/com/google/cloud/agentplatform/types/ListSandboxEnvironmentTemplatesRequestParameters.java new file mode 100644 index 0000000..173f85d --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/ListSandboxEnvironmentTemplatesRequestParameters.java @@ -0,0 +1,119 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Optional; + +/** Parameters for listing sandbox templates. */ +@AutoValue +@InternalApi +@JsonDeserialize(builder = ListSandboxEnvironmentTemplatesRequestParameters.Builder.class) +public abstract class ListSandboxEnvironmentTemplatesRequestParameters extends JsonSerializable { + /** Name of the agent engine. */ + @JsonProperty("name") + public abstract Optional name(); + + /** */ + @JsonProperty("config") + public abstract Optional config(); + + /** Instantiates a builder for ListSandboxEnvironmentTemplatesRequestParameters. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_ListSandboxEnvironmentTemplatesRequestParameters.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for ListSandboxEnvironmentTemplatesRequestParameters. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `ListSandboxEnvironmentTemplatesRequestParameters.builder()` + * for instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_ListSandboxEnvironmentTemplatesRequestParameters.Builder(); + } + + /** + * Setter for name. + * + *

name: Name of the agent engine. + */ + @JsonProperty("name") + public abstract Builder name(String name); + + @ExcludeFromGeneratedCoverageReport + abstract Builder name(Optional name); + + /** Clears the value of name field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearName() { + return name(Optional.empty()); + } + + /** + * Setter for config. + * + *

config: + */ + @JsonProperty("config") + public abstract Builder config(ListSandboxEnvironmentTemplatesConfig config); + + /** + * Setter for config builder. + * + *

config: + */ + @CanIgnoreReturnValue + public Builder config(ListSandboxEnvironmentTemplatesConfig.Builder configBuilder) { + return config(configBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder config(Optional config); + + /** Clears the value of config field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearConfig() { + return config(Optional.empty()); + } + + public abstract ListSandboxEnvironmentTemplatesRequestParameters build(); + } + + /** Deserializes a JSON string to a ListSandboxEnvironmentTemplatesRequestParameters object. */ + @ExcludeFromGeneratedCoverageReport + public static ListSandboxEnvironmentTemplatesRequestParameters fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, ListSandboxEnvironmentTemplatesRequestParameters.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/ListSandboxEnvironmentTemplatesResponse.java b/src/main/java/com/google/cloud/agentplatform/types/ListSandboxEnvironmentTemplatesResponse.java new file mode 100644 index 0000000..fd12ffd --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/ListSandboxEnvironmentTemplatesResponse.java @@ -0,0 +1,161 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import static com.google.common.collect.ImmutableList.toImmutableList; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import com.google.genai.types.HttpResponse; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; + +/** Response for listing sandbox templates. */ +@AutoValue +@JsonDeserialize(builder = ListSandboxEnvironmentTemplatesResponse.Builder.class) +public abstract class ListSandboxEnvironmentTemplatesResponse extends JsonSerializable { + /** Used to retain the full HTTP response. */ + @JsonProperty("sdkHttpResponse") + public abstract Optional sdkHttpResponse(); + + /** */ + @JsonProperty("nextPageToken") + public abstract Optional nextPageToken(); + + /** List of sandbox templates. */ + @JsonProperty("sandboxEnvironmentTemplates") + public abstract Optional> sandboxEnvironmentTemplates(); + + /** Instantiates a builder for ListSandboxEnvironmentTemplatesResponse. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_ListSandboxEnvironmentTemplatesResponse.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for ListSandboxEnvironmentTemplatesResponse. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `ListSandboxEnvironmentTemplatesResponse.builder()` for + * instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_ListSandboxEnvironmentTemplatesResponse.Builder(); + } + + /** + * Setter for sdkHttpResponse. + * + *

sdkHttpResponse: Used to retain the full HTTP response. + */ + @JsonProperty("sdkHttpResponse") + public abstract Builder sdkHttpResponse(HttpResponse sdkHttpResponse); + + @ExcludeFromGeneratedCoverageReport + abstract Builder sdkHttpResponse(Optional sdkHttpResponse); + + /** Clears the value of sdkHttpResponse field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearSdkHttpResponse() { + return sdkHttpResponse(Optional.empty()); + } + + /** + * Setter for nextPageToken. + * + *

nextPageToken: + */ + @JsonProperty("nextPageToken") + public abstract Builder nextPageToken(String nextPageToken); + + @ExcludeFromGeneratedCoverageReport + abstract Builder nextPageToken(Optional nextPageToken); + + /** Clears the value of nextPageToken field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearNextPageToken() { + return nextPageToken(Optional.empty()); + } + + /** + * Setter for sandboxEnvironmentTemplates. + * + *

sandboxEnvironmentTemplates: List of sandbox templates. + */ + @JsonProperty("sandboxEnvironmentTemplates") + public abstract Builder sandboxEnvironmentTemplates( + List sandboxEnvironmentTemplates); + + /** + * Setter for sandboxEnvironmentTemplates. + * + *

sandboxEnvironmentTemplates: List of sandbox templates. + */ + @CanIgnoreReturnValue + public Builder sandboxEnvironmentTemplates( + SandboxEnvironmentTemplate... sandboxEnvironmentTemplates) { + return sandboxEnvironmentTemplates(Arrays.asList(sandboxEnvironmentTemplates)); + } + + /** + * Setter for sandboxEnvironmentTemplates builder. + * + *

sandboxEnvironmentTemplates: List of sandbox templates. + */ + @CanIgnoreReturnValue + public Builder sandboxEnvironmentTemplates( + SandboxEnvironmentTemplate.Builder... sandboxEnvironmentTemplatesBuilders) { + return sandboxEnvironmentTemplates( + Arrays.asList(sandboxEnvironmentTemplatesBuilders).stream() + .map(SandboxEnvironmentTemplate.Builder::build) + .collect(toImmutableList())); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder sandboxEnvironmentTemplates( + Optional> sandboxEnvironmentTemplates); + + /** Clears the value of sandboxEnvironmentTemplates field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearSandboxEnvironmentTemplates() { + return sandboxEnvironmentTemplates(Optional.empty()); + } + + public abstract ListSandboxEnvironmentTemplatesResponse build(); + } + + /** Deserializes a JSON string to a ListSandboxEnvironmentTemplatesResponse object. */ + @ExcludeFromGeneratedCoverageReport + public static ListSandboxEnvironmentTemplatesResponse fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, ListSandboxEnvironmentTemplatesResponse.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/PostSnapshotAction.java b/src/main/java/com/google/cloud/agentplatform/types/PostSnapshotAction.java new file mode 100644 index 0000000..8153c51 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/PostSnapshotAction.java @@ -0,0 +1,115 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.base.Ascii; +import java.util.Objects; + +/** + * Input only. Action to take on the source SandboxEnvironment after the snapshot is taken. This + * field is only used in CreateSandboxEnvironmentSnapshotRequest and it is not stored in the + * resource. + */ +public class PostSnapshotAction { + + /** Enum representing the known values for PostSnapshotAction. */ + public enum Known { + /** The default value. This value is unused. */ + POST_SNAPSHOT_ACTION_UNSPECIFIED, + + /** Sandbox environment will continue to run after snapshot is taken. */ + RUNNING, + + /** Sandbox environment will be paused after snapshot is taken. */ + PAUSE + } + + private Known postSnapshotActionEnum; + private final String value; + + @JsonCreator + public PostSnapshotAction(String value) { + this.value = value; + for (Known postSnapshotActionEnum : Known.values()) { + if (Ascii.equalsIgnoreCase(postSnapshotActionEnum.toString(), value)) { + this.postSnapshotActionEnum = postSnapshotActionEnum; + break; + } + } + if (this.postSnapshotActionEnum == null) { + this.postSnapshotActionEnum = Known.POST_SNAPSHOT_ACTION_UNSPECIFIED; + } + } + + public PostSnapshotAction(Known knownValue) { + this.postSnapshotActionEnum = knownValue; + this.value = knownValue.toString(); + } + + @ExcludeFromGeneratedCoverageReport + @Override + @JsonValue + public String toString() { + return this.value; + } + + @ExcludeFromGeneratedCoverageReport + @SuppressWarnings("PatternMatchingInstanceof") + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null) { + return false; + } + + if (!(o instanceof PostSnapshotAction)) { + return false; + } + + PostSnapshotAction other = (PostSnapshotAction) o; + + if (this.postSnapshotActionEnum != Known.POST_SNAPSHOT_ACTION_UNSPECIFIED + && other.postSnapshotActionEnum != Known.POST_SNAPSHOT_ACTION_UNSPECIFIED) { + return this.postSnapshotActionEnum == other.postSnapshotActionEnum; + } else if (this.postSnapshotActionEnum == Known.POST_SNAPSHOT_ACTION_UNSPECIFIED + && other.postSnapshotActionEnum == Known.POST_SNAPSHOT_ACTION_UNSPECIFIED) { + return this.value.equals(other.value); + } + return false; + } + + @ExcludeFromGeneratedCoverageReport + @Override + public int hashCode() { + if (this.postSnapshotActionEnum != Known.POST_SNAPSHOT_ACTION_UNSPECIFIED) { + return this.postSnapshotActionEnum.hashCode(); + } else { + return Objects.hashCode(this.value); + } + } + + @ExcludeFromGeneratedCoverageReport + public Known knownEnum() { + return this.postSnapshotActionEnum; + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/Protocol.java b/src/main/java/com/google/cloud/agentplatform/types/Protocol.java new file mode 100644 index 0000000..901721c --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/Protocol.java @@ -0,0 +1,111 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.base.Ascii; +import java.util.Objects; + +/** Protocol for port. Defaults to TCP if not specified. */ +public class Protocol { + + /** Enum representing the known values for Protocol. */ + public enum Known { + /** Unspecified protocol. Defaults to TCP. */ + PROTOCOL_UNSPECIFIED, + + /** TCP protocol. */ + TCP, + + /** UDP protocol. */ + UDP + } + + private Known protocolEnum; + private final String value; + + @JsonCreator + public Protocol(String value) { + this.value = value; + for (Known protocolEnum : Known.values()) { + if (Ascii.equalsIgnoreCase(protocolEnum.toString(), value)) { + this.protocolEnum = protocolEnum; + break; + } + } + if (this.protocolEnum == null) { + this.protocolEnum = Known.PROTOCOL_UNSPECIFIED; + } + } + + public Protocol(Known knownValue) { + this.protocolEnum = knownValue; + this.value = knownValue.toString(); + } + + @ExcludeFromGeneratedCoverageReport + @Override + @JsonValue + public String toString() { + return this.value; + } + + @ExcludeFromGeneratedCoverageReport + @SuppressWarnings("PatternMatchingInstanceof") + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null) { + return false; + } + + if (!(o instanceof Protocol)) { + return false; + } + + Protocol other = (Protocol) o; + + if (this.protocolEnum != Known.PROTOCOL_UNSPECIFIED + && other.protocolEnum != Known.PROTOCOL_UNSPECIFIED) { + return this.protocolEnum == other.protocolEnum; + } else if (this.protocolEnum == Known.PROTOCOL_UNSPECIFIED + && other.protocolEnum == Known.PROTOCOL_UNSPECIFIED) { + return this.value.equals(other.value); + } + return false; + } + + @ExcludeFromGeneratedCoverageReport + @Override + public int hashCode() { + if (this.protocolEnum != Known.PROTOCOL_UNSPECIFIED) { + return this.protocolEnum.hashCode(); + } else { + return Objects.hashCode(this.value); + } + } + + @ExcludeFromGeneratedCoverageReport + public Known knownEnum() { + return this.protocolEnum; + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentSnapshot.java b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentSnapshot.java new file mode 100644 index 0000000..d4dfb0a --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentSnapshot.java @@ -0,0 +1,354 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.time.Duration; +import java.time.Instant; +import java.util.Optional; + +/** A sandbox environment snapshot. */ +@AutoValue +@JsonDeserialize(builder = SandboxEnvironmentSnapshot.Builder.class) +public abstract class SandboxEnvironmentSnapshot extends JsonSerializable { + /** The display name of the sandbox environment snapshot. */ + @JsonProperty("displayName") + public abstract Optional displayName(); + + /** Expiration time of the sandbox environment snapshot. */ + @JsonProperty("expireTime") + public abstract Optional expireTime(); + + /** Output only. The timestamp when this SandboxEnvironmentSnapshot was created. */ + @JsonProperty("createTime") + public abstract Optional createTime(); + + /** + * Identifier. The resource name of the SandboxEnvironmentSnapshot. Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sandboxEnvironmentSnapshots/{sandbox_environment_snapshot}` + */ + @JsonProperty("name") + public abstract Optional name(); + + /** + * Optional. Owner information for this sandbox snapshot. Different owners will have isolations on + * snapshot storage and identity. If not set, snapshot will be created as the default owner. + */ + @JsonProperty("owner") + public abstract Optional owner(); + + /** + * Output only. The resource name of the parent SandboxEnvironmentSnapshot. Empty if this is a + * root Snapshot (the first snapshot from a newly created sandbox). Can be used to reconstruct the + * whole ancestry tree of snapshots. + */ + @JsonProperty("parentSnapshot") + public abstract Optional parentSnapshot(); + + /** + * Optional. Input only. Action to take on the source SandboxEnvironment after the snapshot is + * taken. This field is only used in CreateSandboxEnvironmentSnapshotRequest and it is not stored + * in the resource. + */ + @JsonProperty("postSnapshotAction") + public abstract Optional postSnapshotAction(); + + /** Optional. Output only. Size of the snapshot data in bytes. */ + @JsonProperty("sizeBytes") + public abstract Optional sizeBytes(); + + /** Required. The resource name of the source SandboxEnvironment this snapshot was taken from. */ + @JsonProperty("sourceSandboxEnvironment") + public abstract Optional sourceSandboxEnvironment(); + + /** + * Optional. Input only. The TTL for the sandbox environment snapshot. The expiration time is + * computed: now + TTL. + */ + @JsonProperty("ttl") + public abstract Optional ttl(); + + /** Output only. The timestamp when this SandboxEnvironment was most recently updated. */ + @JsonProperty("updateTime") + public abstract Optional updateTime(); + + /** Instantiates a builder for SandboxEnvironmentSnapshot. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_SandboxEnvironmentSnapshot.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for SandboxEnvironmentSnapshot. */ + @AutoValue.Builder + public abstract static class Builder { + /** For internal usage. Please use `SandboxEnvironmentSnapshot.builder()` for instantiation. */ + @JsonCreator + private static Builder create() { + return new AutoValue_SandboxEnvironmentSnapshot.Builder(); + } + + /** + * Setter for displayName. + * + *

displayName: The display name of the sandbox environment snapshot. + */ + @JsonProperty("displayName") + public abstract Builder displayName(String displayName); + + @ExcludeFromGeneratedCoverageReport + abstract Builder displayName(Optional displayName); + + /** Clears the value of displayName field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearDisplayName() { + return displayName(Optional.empty()); + } + + /** + * Setter for expireTime. + * + *

expireTime: Expiration time of the sandbox environment snapshot. + */ + @JsonProperty("expireTime") + public abstract Builder expireTime(Instant expireTime); + + @ExcludeFromGeneratedCoverageReport + abstract Builder expireTime(Optional expireTime); + + /** Clears the value of expireTime field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearExpireTime() { + return expireTime(Optional.empty()); + } + + /** + * Setter for createTime. + * + *

createTime: Output only. The timestamp when this SandboxEnvironmentSnapshot was created. + */ + @JsonProperty("createTime") + public abstract Builder createTime(Instant createTime); + + @ExcludeFromGeneratedCoverageReport + abstract Builder createTime(Optional createTime); + + /** Clears the value of createTime field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearCreateTime() { + return createTime(Optional.empty()); + } + + /** + * Setter for name. + * + *

name: Identifier. The resource name of the SandboxEnvironmentSnapshot. Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sandboxEnvironmentSnapshots/{sandbox_environment_snapshot}` + */ + @JsonProperty("name") + public abstract Builder name(String name); + + @ExcludeFromGeneratedCoverageReport + abstract Builder name(Optional name); + + /** Clears the value of name field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearName() { + return name(Optional.empty()); + } + + /** + * Setter for owner. + * + *

owner: Optional. Owner information for this sandbox snapshot. Different owners will have + * isolations on snapshot storage and identity. If not set, snapshot will be created as the + * default owner. + */ + @JsonProperty("owner") + public abstract Builder owner(String owner); + + @ExcludeFromGeneratedCoverageReport + abstract Builder owner(Optional owner); + + /** Clears the value of owner field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearOwner() { + return owner(Optional.empty()); + } + + /** + * Setter for parentSnapshot. + * + *

parentSnapshot: Output only. The resource name of the parent SandboxEnvironmentSnapshot. + * Empty if this is a root Snapshot (the first snapshot from a newly created sandbox). Can be + * used to reconstruct the whole ancestry tree of snapshots. + */ + @JsonProperty("parentSnapshot") + public abstract Builder parentSnapshot(String parentSnapshot); + + @ExcludeFromGeneratedCoverageReport + abstract Builder parentSnapshot(Optional parentSnapshot); + + /** Clears the value of parentSnapshot field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearParentSnapshot() { + return parentSnapshot(Optional.empty()); + } + + /** + * Setter for postSnapshotAction. + * + *

postSnapshotAction: Optional. Input only. Action to take on the source SandboxEnvironment + * after the snapshot is taken. This field is only used in + * CreateSandboxEnvironmentSnapshotRequest and it is not stored in the resource. + */ + @JsonProperty("postSnapshotAction") + public abstract Builder postSnapshotAction(PostSnapshotAction postSnapshotAction); + + @ExcludeFromGeneratedCoverageReport + abstract Builder postSnapshotAction(Optional postSnapshotAction); + + /** Clears the value of postSnapshotAction field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearPostSnapshotAction() { + return postSnapshotAction(Optional.empty()); + } + + /** + * Setter for postSnapshotAction given a known enum. + * + *

postSnapshotAction: Optional. Input only. Action to take on the source SandboxEnvironment + * after the snapshot is taken. This field is only used in + * CreateSandboxEnvironmentSnapshotRequest and it is not stored in the resource. + */ + @CanIgnoreReturnValue + public Builder postSnapshotAction(PostSnapshotAction.Known knownType) { + return postSnapshotAction(new PostSnapshotAction(knownType)); + } + + /** + * Setter for postSnapshotAction given a string. + * + *

postSnapshotAction: Optional. Input only. Action to take on the source SandboxEnvironment + * after the snapshot is taken. This field is only used in + * CreateSandboxEnvironmentSnapshotRequest and it is not stored in the resource. + */ + @CanIgnoreReturnValue + public Builder postSnapshotAction(String postSnapshotAction) { + return postSnapshotAction(new PostSnapshotAction(postSnapshotAction)); + } + + /** + * Setter for sizeBytes. + * + *

sizeBytes: Optional. Output only. Size of the snapshot data in bytes. + */ + @JsonProperty("sizeBytes") + public abstract Builder sizeBytes(Long sizeBytes); + + @ExcludeFromGeneratedCoverageReport + abstract Builder sizeBytes(Optional sizeBytes); + + /** Clears the value of sizeBytes field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearSizeBytes() { + return sizeBytes(Optional.empty()); + } + + /** + * Setter for sourceSandboxEnvironment. + * + *

sourceSandboxEnvironment: Required. The resource name of the source SandboxEnvironment + * this snapshot was taken from. + */ + @JsonProperty("sourceSandboxEnvironment") + public abstract Builder sourceSandboxEnvironment(String sourceSandboxEnvironment); + + @ExcludeFromGeneratedCoverageReport + abstract Builder sourceSandboxEnvironment(Optional sourceSandboxEnvironment); + + /** Clears the value of sourceSandboxEnvironment field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearSourceSandboxEnvironment() { + return sourceSandboxEnvironment(Optional.empty()); + } + + /** + * Setter for ttl. + * + *

ttl: Optional. Input only. The TTL for the sandbox environment snapshot. The expiration + * time is computed: now + TTL. + */ + @JsonProperty("ttl") + public abstract Builder ttl(Duration ttl); + + @ExcludeFromGeneratedCoverageReport + abstract Builder ttl(Optional ttl); + + /** Clears the value of ttl field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearTtl() { + return ttl(Optional.empty()); + } + + /** + * Setter for updateTime. + * + *

updateTime: Output only. The timestamp when this SandboxEnvironment was most recently + * updated. + */ + @JsonProperty("updateTime") + public abstract Builder updateTime(Instant updateTime); + + @ExcludeFromGeneratedCoverageReport + abstract Builder updateTime(Optional updateTime); + + /** Clears the value of updateTime field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearUpdateTime() { + return updateTime(Optional.empty()); + } + + public abstract SandboxEnvironmentSnapshot build(); + } + + /** Deserializes a JSON string to a SandboxEnvironmentSnapshot object. */ + @ExcludeFromGeneratedCoverageReport + public static SandboxEnvironmentSnapshot fromJson(String jsonString) { + return JsonSerializable.fromJsonString(jsonString, SandboxEnvironmentSnapshot.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplate.java b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplate.java new file mode 100644 index 0000000..bb66a0d --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplate.java @@ -0,0 +1,305 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.time.Instant; +import java.util.Optional; + +/** A sandbox environment template. */ +@AutoValue +@JsonDeserialize(builder = SandboxEnvironmentTemplate.Builder.class) +public abstract class SandboxEnvironmentTemplate extends JsonSerializable { + /** Output only. The timestamp when this SandboxEnvironmentTemplate was created. */ + @JsonProperty("createTime") + public abstract Optional createTime(); + + /** The sandbox environment for custom container workloads. */ + @JsonProperty("customContainerEnvironment") + public abstract Optional + customContainerEnvironment(); + + /** The sandbox environment for default container workloads. */ + @JsonProperty("defaultContainerEnvironment") + public abstract Optional + defaultContainerEnvironment(); + + /** Required. The display name of the SandboxEnvironmentTemplate. */ + @JsonProperty("displayName") + public abstract Optional displayName(); + + /** Optional. The configuration for egress control of this template. */ + @JsonProperty("egressControlConfig") + public abstract Optional egressControlConfig(); + + /** + * Identifier. The resource name of the SandboxEnvironmentTemplate. Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sandboxEnvironmentTemplates/{sandbox_environment_template}` + */ + @JsonProperty("name") + public abstract Optional name(); + + /** Output only. The state of the sandbox environment template. */ + @JsonProperty("state") + public abstract Optional state(); + + /** Output only. The timestamp when this SandboxEnvironmentTemplate was most recently updated. */ + @JsonProperty("updateTime") + public abstract Optional updateTime(); + + /** Instantiates a builder for SandboxEnvironmentTemplate. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_SandboxEnvironmentTemplate.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for SandboxEnvironmentTemplate. */ + @AutoValue.Builder + public abstract static class Builder { + /** For internal usage. Please use `SandboxEnvironmentTemplate.builder()` for instantiation. */ + @JsonCreator + private static Builder create() { + return new AutoValue_SandboxEnvironmentTemplate.Builder(); + } + + /** + * Setter for createTime. + * + *

createTime: Output only. The timestamp when this SandboxEnvironmentTemplate was created. + */ + @JsonProperty("createTime") + public abstract Builder createTime(Instant createTime); + + @ExcludeFromGeneratedCoverageReport + abstract Builder createTime(Optional createTime); + + /** Clears the value of createTime field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearCreateTime() { + return createTime(Optional.empty()); + } + + /** + * Setter for customContainerEnvironment. + * + *

customContainerEnvironment: The sandbox environment for custom container workloads. + */ + @JsonProperty("customContainerEnvironment") + public abstract Builder customContainerEnvironment( + SandboxEnvironmentTemplateCustomContainerEnvironment customContainerEnvironment); + + /** + * Setter for customContainerEnvironment builder. + * + *

customContainerEnvironment: The sandbox environment for custom container workloads. + */ + @CanIgnoreReturnValue + public Builder customContainerEnvironment( + SandboxEnvironmentTemplateCustomContainerEnvironment.Builder + customContainerEnvironmentBuilder) { + return customContainerEnvironment(customContainerEnvironmentBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder customContainerEnvironment( + Optional customContainerEnvironment); + + /** Clears the value of customContainerEnvironment field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearCustomContainerEnvironment() { + return customContainerEnvironment(Optional.empty()); + } + + /** + * Setter for defaultContainerEnvironment. + * + *

defaultContainerEnvironment: The sandbox environment for default container workloads. + */ + @JsonProperty("defaultContainerEnvironment") + public abstract Builder defaultContainerEnvironment( + SandboxEnvironmentTemplateDefaultContainerEnvironment defaultContainerEnvironment); + + /** + * Setter for defaultContainerEnvironment builder. + * + *

defaultContainerEnvironment: The sandbox environment for default container workloads. + */ + @CanIgnoreReturnValue + public Builder defaultContainerEnvironment( + SandboxEnvironmentTemplateDefaultContainerEnvironment.Builder + defaultContainerEnvironmentBuilder) { + return defaultContainerEnvironment(defaultContainerEnvironmentBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder defaultContainerEnvironment( + Optional + defaultContainerEnvironment); + + /** Clears the value of defaultContainerEnvironment field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearDefaultContainerEnvironment() { + return defaultContainerEnvironment(Optional.empty()); + } + + /** + * Setter for displayName. + * + *

displayName: Required. The display name of the SandboxEnvironmentTemplate. + */ + @JsonProperty("displayName") + public abstract Builder displayName(String displayName); + + @ExcludeFromGeneratedCoverageReport + abstract Builder displayName(Optional displayName); + + /** Clears the value of displayName field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearDisplayName() { + return displayName(Optional.empty()); + } + + /** + * Setter for egressControlConfig. + * + *

egressControlConfig: Optional. The configuration for egress control of this template. + */ + @JsonProperty("egressControlConfig") + public abstract Builder egressControlConfig( + SandboxEnvironmentTemplateEgressControlConfig egressControlConfig); + + /** + * Setter for egressControlConfig builder. + * + *

egressControlConfig: Optional. The configuration for egress control of this template. + */ + @CanIgnoreReturnValue + public Builder egressControlConfig( + SandboxEnvironmentTemplateEgressControlConfig.Builder egressControlConfigBuilder) { + return egressControlConfig(egressControlConfigBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder egressControlConfig( + Optional egressControlConfig); + + /** Clears the value of egressControlConfig field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearEgressControlConfig() { + return egressControlConfig(Optional.empty()); + } + + /** + * Setter for name. + * + *

name: Identifier. The resource name of the SandboxEnvironmentTemplate. Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sandboxEnvironmentTemplates/{sandbox_environment_template}` + */ + @JsonProperty("name") + public abstract Builder name(String name); + + @ExcludeFromGeneratedCoverageReport + abstract Builder name(Optional name); + + /** Clears the value of name field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearName() { + return name(Optional.empty()); + } + + /** + * Setter for state. + * + *

state: Output only. The state of the sandbox environment template. + */ + @JsonProperty("state") + public abstract Builder state(State state); + + @ExcludeFromGeneratedCoverageReport + abstract Builder state(Optional state); + + /** Clears the value of state field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearState() { + return state(Optional.empty()); + } + + /** + * Setter for state given a known enum. + * + *

state: Output only. The state of the sandbox environment template. + */ + @CanIgnoreReturnValue + public Builder state(State.Known knownType) { + return state(new State(knownType)); + } + + /** + * Setter for state given a string. + * + *

state: Output only. The state of the sandbox environment template. + */ + @CanIgnoreReturnValue + public Builder state(String state) { + return state(new State(state)); + } + + /** + * Setter for updateTime. + * + *

updateTime: Output only. The timestamp when this SandboxEnvironmentTemplate was most + * recently updated. + */ + @JsonProperty("updateTime") + public abstract Builder updateTime(Instant updateTime); + + @ExcludeFromGeneratedCoverageReport + abstract Builder updateTime(Optional updateTime); + + /** Clears the value of updateTime field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearUpdateTime() { + return updateTime(Optional.empty()); + } + + public abstract SandboxEnvironmentTemplate build(); + } + + /** Deserializes a JSON string to a SandboxEnvironmentTemplate object. */ + @ExcludeFromGeneratedCoverageReport + public static SandboxEnvironmentTemplate fromJson(String jsonString) { + return JsonSerializable.fromJsonString(jsonString, SandboxEnvironmentTemplate.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateCustomContainerEnvironment.java b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateCustomContainerEnvironment.java new file mode 100644 index 0000000..43d1fee --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateCustomContainerEnvironment.java @@ -0,0 +1,183 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import static com.google.common.collect.ImmutableList.toImmutableList; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; + +/** The customized sandbox runtime environment for BYOC. */ +@AutoValue +@JsonDeserialize(builder = SandboxEnvironmentTemplateCustomContainerEnvironment.Builder.class) +public abstract class SandboxEnvironmentTemplateCustomContainerEnvironment + extends JsonSerializable { + /** The specification of the custom container environment. */ + @JsonProperty("customContainerSpec") + public abstract Optional customContainerSpec(); + + /** Ports to expose from the container. */ + @JsonProperty("ports") + public abstract Optional> ports(); + + /** Resource requests and limits for the container. */ + @JsonProperty("resources") + public abstract Optional resources(); + + /** Instantiates a builder for SandboxEnvironmentTemplateCustomContainerEnvironment. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_SandboxEnvironmentTemplateCustomContainerEnvironment.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for SandboxEnvironmentTemplateCustomContainerEnvironment. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use + * `SandboxEnvironmentTemplateCustomContainerEnvironment.builder()` for instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_SandboxEnvironmentTemplateCustomContainerEnvironment.Builder(); + } + + /** + * Setter for customContainerSpec. + * + *

customContainerSpec: The specification of the custom container environment. + */ + @JsonProperty("customContainerSpec") + public abstract Builder customContainerSpec( + SandboxEnvironmentTemplateCustomContainerSpec customContainerSpec); + + /** + * Setter for customContainerSpec builder. + * + *

customContainerSpec: The specification of the custom container environment. + */ + @CanIgnoreReturnValue + public Builder customContainerSpec( + SandboxEnvironmentTemplateCustomContainerSpec.Builder customContainerSpecBuilder) { + return customContainerSpec(customContainerSpecBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder customContainerSpec( + Optional customContainerSpec); + + /** Clears the value of customContainerSpec field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearCustomContainerSpec() { + return customContainerSpec(Optional.empty()); + } + + /** + * Setter for ports. + * + *

ports: Ports to expose from the container. + */ + @JsonProperty("ports") + public abstract Builder ports(List ports); + + /** + * Setter for ports. + * + *

ports: Ports to expose from the container. + */ + @CanIgnoreReturnValue + public Builder ports(SandboxEnvironmentTemplateNetworkPort... ports) { + return ports(Arrays.asList(ports)); + } + + /** + * Setter for ports builder. + * + *

ports: Ports to expose from the container. + */ + @CanIgnoreReturnValue + public Builder ports(SandboxEnvironmentTemplateNetworkPort.Builder... portsBuilders) { + return ports( + Arrays.asList(portsBuilders).stream() + .map(SandboxEnvironmentTemplateNetworkPort.Builder::build) + .collect(toImmutableList())); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder ports(Optional> ports); + + /** Clears the value of ports field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearPorts() { + return ports(Optional.empty()); + } + + /** + * Setter for resources. + * + *

resources: Resource requests and limits for the container. + */ + @JsonProperty("resources") + public abstract Builder resources(SandboxEnvironmentTemplateResourceRequirements resources); + + /** + * Setter for resources builder. + * + *

resources: Resource requests and limits for the container. + */ + @CanIgnoreReturnValue + public Builder resources( + SandboxEnvironmentTemplateResourceRequirements.Builder resourcesBuilder) { + return resources(resourcesBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder resources(Optional resources); + + /** Clears the value of resources field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearResources() { + return resources(Optional.empty()); + } + + public abstract SandboxEnvironmentTemplateCustomContainerEnvironment build(); + } + + /** + * Deserializes a JSON string to a SandboxEnvironmentTemplateCustomContainerEnvironment object. + */ + @ExcludeFromGeneratedCoverageReport + public static SandboxEnvironmentTemplateCustomContainerEnvironment fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, SandboxEnvironmentTemplateCustomContainerEnvironment.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateCustomContainerSpec.java b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateCustomContainerSpec.java new file mode 100644 index 0000000..40e3431 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateCustomContainerSpec.java @@ -0,0 +1,91 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Optional; + +/** Specification for deploying from a custom container image. */ +@AutoValue +@JsonDeserialize(builder = SandboxEnvironmentTemplateCustomContainerSpec.Builder.class) +public abstract class SandboxEnvironmentTemplateCustomContainerSpec extends JsonSerializable { + /** + * Required. The Artifact Registry Docker image URI (e.g., + * us-central1-docker.pkg.dev/my-project/my-repo/my-image:tag) of the container image that is to + * be run on each worker replica. + */ + @JsonProperty("imageUri") + public abstract Optional imageUri(); + + /** Instantiates a builder for SandboxEnvironmentTemplateCustomContainerSpec. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_SandboxEnvironmentTemplateCustomContainerSpec.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for SandboxEnvironmentTemplateCustomContainerSpec. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `SandboxEnvironmentTemplateCustomContainerSpec.builder()` for + * instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_SandboxEnvironmentTemplateCustomContainerSpec.Builder(); + } + + /** + * Setter for imageUri. + * + *

imageUri: Required. The Artifact Registry Docker image URI (e.g., + * us-central1-docker.pkg.dev/my-project/my-repo/my-image:tag) of the container image that is to + * be run on each worker replica. + */ + @JsonProperty("imageUri") + public abstract Builder imageUri(String imageUri); + + @ExcludeFromGeneratedCoverageReport + abstract Builder imageUri(Optional imageUri); + + /** Clears the value of imageUri field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearImageUri() { + return imageUri(Optional.empty()); + } + + public abstract SandboxEnvironmentTemplateCustomContainerSpec build(); + } + + /** Deserializes a JSON string to a SandboxEnvironmentTemplateCustomContainerSpec object. */ + @ExcludeFromGeneratedCoverageReport + public static SandboxEnvironmentTemplateCustomContainerSpec fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, SandboxEnvironmentTemplateCustomContainerSpec.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateDefaultContainerEnvironment.java b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateDefaultContainerEnvironment.java new file mode 100644 index 0000000..f443f3f --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateDefaultContainerEnvironment.java @@ -0,0 +1,143 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Optional; + +/** The default sandbox runtime environment for default container workloads. */ +@AutoValue +@JsonDeserialize(builder = SandboxEnvironmentTemplateDefaultContainerEnvironment.Builder.class) +public abstract class SandboxEnvironmentTemplateDefaultContainerEnvironment + extends JsonSerializable { + /** Required. The category of the default container image. */ + @JsonProperty("defaultContainerCategory") + public abstract Optional defaultContainerCategory(); + + /** Optional. Resource requests and limits for the default container. */ + @JsonProperty("resources") + public abstract Optional resources(); + + /** Instantiates a builder for SandboxEnvironmentTemplateDefaultContainerEnvironment. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_SandboxEnvironmentTemplateDefaultContainerEnvironment.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for SandboxEnvironmentTemplateDefaultContainerEnvironment. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use + * `SandboxEnvironmentTemplateDefaultContainerEnvironment.builder()` for instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_SandboxEnvironmentTemplateDefaultContainerEnvironment.Builder(); + } + + /** + * Setter for defaultContainerCategory. + * + *

defaultContainerCategory: Required. The category of the default container image. + */ + @JsonProperty("defaultContainerCategory") + public abstract Builder defaultContainerCategory( + DefaultContainerCategory defaultContainerCategory); + + @ExcludeFromGeneratedCoverageReport + abstract Builder defaultContainerCategory( + Optional defaultContainerCategory); + + /** Clears the value of defaultContainerCategory field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearDefaultContainerCategory() { + return defaultContainerCategory(Optional.empty()); + } + + /** + * Setter for defaultContainerCategory given a known enum. + * + *

defaultContainerCategory: Required. The category of the default container image. + */ + @CanIgnoreReturnValue + public Builder defaultContainerCategory(DefaultContainerCategory.Known knownType) { + return defaultContainerCategory(new DefaultContainerCategory(knownType)); + } + + /** + * Setter for defaultContainerCategory given a string. + * + *

defaultContainerCategory: Required. The category of the default container image. + */ + @CanIgnoreReturnValue + public Builder defaultContainerCategory(String defaultContainerCategory) { + return defaultContainerCategory(new DefaultContainerCategory(defaultContainerCategory)); + } + + /** + * Setter for resources. + * + *

resources: Optional. Resource requests and limits for the default container. + */ + @JsonProperty("resources") + public abstract Builder resources(SandboxEnvironmentTemplateResourceRequirements resources); + + /** + * Setter for resources builder. + * + *

resources: Optional. Resource requests and limits for the default container. + */ + @CanIgnoreReturnValue + public Builder resources( + SandboxEnvironmentTemplateResourceRequirements.Builder resourcesBuilder) { + return resources(resourcesBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder resources(Optional resources); + + /** Clears the value of resources field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearResources() { + return resources(Optional.empty()); + } + + public abstract SandboxEnvironmentTemplateDefaultContainerEnvironment build(); + } + + /** + * Deserializes a JSON string to a SandboxEnvironmentTemplateDefaultContainerEnvironment object. + */ + @ExcludeFromGeneratedCoverageReport + public static SandboxEnvironmentTemplateDefaultContainerEnvironment fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, SandboxEnvironmentTemplateDefaultContainerEnvironment.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateEgressControlConfig.java b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateEgressControlConfig.java new file mode 100644 index 0000000..100d802 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateEgressControlConfig.java @@ -0,0 +1,85 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Optional; + +/** Configuration for egress control of sandbox instances. */ +@AutoValue +@JsonDeserialize(builder = SandboxEnvironmentTemplateEgressControlConfig.Builder.class) +public abstract class SandboxEnvironmentTemplateEgressControlConfig extends JsonSerializable { + /** Optional. Whether to allow internet access. */ + @JsonProperty("internetAccess") + public abstract Optional internetAccess(); + + /** Instantiates a builder for SandboxEnvironmentTemplateEgressControlConfig. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_SandboxEnvironmentTemplateEgressControlConfig.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for SandboxEnvironmentTemplateEgressControlConfig. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `SandboxEnvironmentTemplateEgressControlConfig.builder()` for + * instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_SandboxEnvironmentTemplateEgressControlConfig.Builder(); + } + + /** + * Setter for internetAccess. + * + *

internetAccess: Optional. Whether to allow internet access. + */ + @JsonProperty("internetAccess") + public abstract Builder internetAccess(boolean internetAccess); + + @ExcludeFromGeneratedCoverageReport + abstract Builder internetAccess(Optional internetAccess); + + /** Clears the value of internetAccess field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearInternetAccess() { + return internetAccess(Optional.empty()); + } + + public abstract SandboxEnvironmentTemplateEgressControlConfig build(); + } + + /** Deserializes a JSON string to a SandboxEnvironmentTemplateEgressControlConfig object. */ + @ExcludeFromGeneratedCoverageReport + public static SandboxEnvironmentTemplateEgressControlConfig fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, SandboxEnvironmentTemplateEgressControlConfig.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateNetworkPort.java b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateNetworkPort.java new file mode 100644 index 0000000..401029c --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateNetworkPort.java @@ -0,0 +1,127 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Optional; + +/** Represents a network port in a container. */ +@AutoValue +@JsonDeserialize(builder = SandboxEnvironmentTemplateNetworkPort.Builder.class) +public abstract class SandboxEnvironmentTemplateNetworkPort extends JsonSerializable { + /** Optional. Port number to expose. This must be a valid port number, between 1 and 65535. */ + @JsonProperty("port") + public abstract Optional port(); + + /** Optional. Protocol for port. Defaults to TCP if not specified. */ + @JsonProperty("protocol") + public abstract Optional protocol(); + + /** Instantiates a builder for SandboxEnvironmentTemplateNetworkPort. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_SandboxEnvironmentTemplateNetworkPort.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for SandboxEnvironmentTemplateNetworkPort. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `SandboxEnvironmentTemplateNetworkPort.builder()` for + * instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_SandboxEnvironmentTemplateNetworkPort.Builder(); + } + + /** + * Setter for port. + * + *

port: Optional. Port number to expose. This must be a valid port number, between 1 and + * 65535. + */ + @JsonProperty("port") + public abstract Builder port(Integer port); + + @ExcludeFromGeneratedCoverageReport + abstract Builder port(Optional port); + + /** Clears the value of port field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearPort() { + return port(Optional.empty()); + } + + /** + * Setter for protocol. + * + *

protocol: Optional. Protocol for port. Defaults to TCP if not specified. + */ + @JsonProperty("protocol") + public abstract Builder protocol(Protocol protocol); + + @ExcludeFromGeneratedCoverageReport + abstract Builder protocol(Optional protocol); + + /** Clears the value of protocol field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearProtocol() { + return protocol(Optional.empty()); + } + + /** + * Setter for protocol given a known enum. + * + *

protocol: Optional. Protocol for port. Defaults to TCP if not specified. + */ + @CanIgnoreReturnValue + public Builder protocol(Protocol.Known knownType) { + return protocol(new Protocol(knownType)); + } + + /** + * Setter for protocol given a string. + * + *

protocol: Optional. Protocol for port. Defaults to TCP if not specified. + */ + @CanIgnoreReturnValue + public Builder protocol(String protocol) { + return protocol(new Protocol(protocol)); + } + + public abstract SandboxEnvironmentTemplateNetworkPort build(); + } + + /** Deserializes a JSON string to a SandboxEnvironmentTemplateNetworkPort object. */ + @ExcludeFromGeneratedCoverageReport + public static SandboxEnvironmentTemplateNetworkPort fromJson(String jsonString) { + return JsonSerializable.fromJsonString(jsonString, SandboxEnvironmentTemplateNetworkPort.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateOperation.java b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateOperation.java new file mode 100644 index 0000000..2475015 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateOperation.java @@ -0,0 +1,201 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Map; +import java.util.Optional; + +/** Operation that has an agent engine sandbox as a response. */ +@AutoValue +@JsonDeserialize(builder = SandboxEnvironmentTemplateOperation.Builder.class) +public abstract class SandboxEnvironmentTemplateOperation extends JsonSerializable { + /** + * The server-assigned name, which is only unique within the same service that originally returns + * it. If you use the default HTTP mapping, the `name` should be a resource name ending with + * `operations/{unique_id}`. + */ + @JsonProperty("name") + public abstract Optional name(); + + /** + * Service-specific metadata associated with the operation. It typically contains progress + * information and common metadata such as create time. Some services might not provide such + * metadata. Any method that returns a long-running operation should document the metadata type, + * if any. + */ + @JsonProperty("metadata") + public abstract Optional> metadata(); + + /** + * If the value is `false`, it means the operation is still in progress. If `true`, the operation + * is completed, and either `error` or `response` is available. + */ + @JsonProperty("done") + public abstract Optional done(); + + /** The error result of the operation in case of failure or cancellation. */ + @JsonProperty("error") + public abstract Optional> error(); + + /** The Agent Engine Sandbox Template. */ + @JsonProperty("response") + public abstract Optional response(); + + /** Instantiates a builder for SandboxEnvironmentTemplateOperation. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_SandboxEnvironmentTemplateOperation.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for SandboxEnvironmentTemplateOperation. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `SandboxEnvironmentTemplateOperation.builder()` for + * instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_SandboxEnvironmentTemplateOperation.Builder(); + } + + /** + * Setter for name. + * + *

name: The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the `name` should be a resource + * name ending with `operations/{unique_id}`. + */ + @JsonProperty("name") + public abstract Builder name(String name); + + @ExcludeFromGeneratedCoverageReport + abstract Builder name(Optional name); + + /** Clears the value of name field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearName() { + return name(Optional.empty()); + } + + /** + * Setter for metadata. + * + *

metadata: Service-specific metadata associated with the operation. It typically contains + * progress information and common metadata such as create time. Some services might not provide + * such metadata. Any method that returns a long-running operation should document the metadata + * type, if any. + */ + @JsonProperty("metadata") + public abstract Builder metadata(Map metadata); + + @ExcludeFromGeneratedCoverageReport + abstract Builder metadata(Optional> metadata); + + /** Clears the value of metadata field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearMetadata() { + return metadata(Optional.empty()); + } + + /** + * Setter for done. + * + *

done: If the value is `false`, it means the operation is still in progress. If `true`, the + * operation is completed, and either `error` or `response` is available. + */ + @JsonProperty("done") + public abstract Builder done(boolean done); + + @ExcludeFromGeneratedCoverageReport + abstract Builder done(Optional done); + + /** Clears the value of done field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearDone() { + return done(Optional.empty()); + } + + /** + * Setter for error. + * + *

error: The error result of the operation in case of failure or cancellation. + */ + @JsonProperty("error") + public abstract Builder error(Map error); + + @ExcludeFromGeneratedCoverageReport + abstract Builder error(Optional> error); + + /** Clears the value of error field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearError() { + return error(Optional.empty()); + } + + /** + * Setter for response. + * + *

response: The Agent Engine Sandbox Template. + */ + @JsonProperty("response") + public abstract Builder response(SandboxEnvironmentTemplate response); + + /** + * Setter for response builder. + * + *

response: The Agent Engine Sandbox Template. + */ + @CanIgnoreReturnValue + public Builder response(SandboxEnvironmentTemplate.Builder responseBuilder) { + return response(responseBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder response(Optional response); + + /** Clears the value of response field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearResponse() { + return response(Optional.empty()); + } + + public abstract SandboxEnvironmentTemplateOperation build(); + } + + /** Deserializes a JSON string to a SandboxEnvironmentTemplateOperation object. */ + @ExcludeFromGeneratedCoverageReport + public static SandboxEnvironmentTemplateOperation fromJson(String jsonString) { + return JsonSerializable.fromJsonString(jsonString, SandboxEnvironmentTemplateOperation.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateResourceRequirements.java b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateResourceRequirements.java new file mode 100644 index 0000000..57828f5 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplateResourceRequirements.java @@ -0,0 +1,119 @@ +/* + * Copyright 2025 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 + * + * https://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. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Map; +import java.util.Optional; + +/** + * Message to define resource requests and limits (mirroring Kubernetes) for each sandbox instance + * created from this template. + */ +@AutoValue +@JsonDeserialize(builder = SandboxEnvironmentTemplateResourceRequirements.Builder.class) +public abstract class SandboxEnvironmentTemplateResourceRequirements extends JsonSerializable { + /** + * Optional. The maximum amounts of compute resources allowed. Keys are resource names (e.g., + * "cpu", "memory"). Values are quantities (e.g., "500m", "1Gi"). + */ + @JsonProperty("limits") + public abstract Optional> limits(); + + /** + * Optional. The requested amounts of compute resources. Keys are resource names (e.g., "cpu", + * "memory"). Values are quantities (e.g., "250m", "512Mi"). + */ + @JsonProperty("requests") + public abstract Optional> requests(); + + /** Instantiates a builder for SandboxEnvironmentTemplateResourceRequirements. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_SandboxEnvironmentTemplateResourceRequirements.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for SandboxEnvironmentTemplateResourceRequirements. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `SandboxEnvironmentTemplateResourceRequirements.builder()` for + * instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_SandboxEnvironmentTemplateResourceRequirements.Builder(); + } + + /** + * Setter for limits. + * + *

limits: Optional. The maximum amounts of compute resources allowed. Keys are resource + * names (e.g., "cpu", "memory"). Values are quantities (e.g., "500m", "1Gi"). + */ + @JsonProperty("limits") + public abstract Builder limits(Map limits); + + @ExcludeFromGeneratedCoverageReport + abstract Builder limits(Optional> limits); + + /** Clears the value of limits field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearLimits() { + return limits(Optional.empty()); + } + + /** + * Setter for requests. + * + *

requests: Optional. The requested amounts of compute resources. Keys are resource names + * (e.g., "cpu", "memory"). Values are quantities (e.g., "250m", "512Mi"). + */ + @JsonProperty("requests") + public abstract Builder requests(Map requests); + + @ExcludeFromGeneratedCoverageReport + abstract Builder requests(Optional> requests); + + /** Clears the value of requests field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearRequests() { + return requests(Optional.empty()); + } + + public abstract SandboxEnvironmentTemplateResourceRequirements build(); + } + + /** Deserializes a JSON string to a SandboxEnvironmentTemplateResourceRequirements object. */ + @ExcludeFromGeneratedCoverageReport + public static SandboxEnvironmentTemplateResourceRequirements fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, SandboxEnvironmentTemplateResourceRequirements.class); + } +} diff --git a/src/test/java/com/google/cloud/agentplatform/AgentEnginesSandboxSnapshotsTest.java b/src/test/java/com/google/cloud/agentplatform/AgentEnginesSandboxSnapshotsTest.java new file mode 100644 index 0000000..51d8370 --- /dev/null +++ b/src/test/java/com/google/cloud/agentplatform/AgentEnginesSandboxSnapshotsTest.java @@ -0,0 +1,96 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.agentplatform; + +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import com.google.cloud.agentplatform.types.AgentEngineSandboxSnapshotOperation; +import com.google.cloud.agentplatform.types.CreateAgentEngineSandboxSnapshotConfig; +import com.google.cloud.agentplatform.types.DeleteSandboxEnvironmentSnapshotOperation; +import com.google.cloud.agentplatform.types.ListSandboxEnvironmentSnapshotsResponse; +import com.google.cloud.agentplatform.types.SandboxEnvironmentSnapshot; +import java.time.Duration; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; +import org.junit.jupiter.api.extension.ExtendWith; + +@EnabledIfEnvironmentVariable( + named = "GOOGLE_GENAI_REPLAYS_DIRECTORY", + matches = ".*genai/replays.*") +@ExtendWith(EnvironmentVariablesMockingExtension.class) +public class AgentEnginesSandboxSnapshotsTest { + + @Test + public void testCreateSandboxSnapshot() throws Exception { + Client client = + TestUtils.createClient( + true, "ae_sandbox_snapshots_create/test_create_sandbox_snapshot.vertex.json"); + + AgentEngineSandboxSnapshotOperation operation = + client.agentEngines.sandboxes.snapshots.privateCreate( + "projects/802583348448/locations/us-central1/reasoningEngines/6130241318758121472/sandboxEnvironments/525190525100228608", + CreateAgentEngineSandboxSnapshotConfig.builder() + .displayName("test_snapshot") + .ttl(Duration.ofSeconds(3600)) + .owner("test_owner") + .build()); + + assertNotNull(operation.name()); + } + + @Test + public void testGetSandboxSnapshot() throws Exception { + Client client = + TestUtils.createClient( + true, "ae_sandbox_snapshots_get/test_get_sandbox_snapshot.vertex.json"); + + String snapshotName = + "projects/802583348448/locations/us-central1/reasoningEngines/6130241318758121472/sandboxEnvironmentSnapshots/2433069698686910464"; + SandboxEnvironmentSnapshot snapshot = + client.agentEngines.sandboxes.snapshots.privateGet(snapshotName, null); + + assertNotNull(snapshot.name()); + } + + @Test + public void testListSandboxSnapshots() throws Exception { + Client client = + TestUtils.createClient( + true, "ae_sandbox_snapshots_list/test_list_sandbox_snapshots.vertex.json"); + + ListSandboxEnvironmentSnapshotsResponse response = + client.agentEngines.sandboxes.snapshots.privateList( + "projects/802583348448/locations/us-central1/reasoningEngines/6130241318758121472", + null); + + assertNotNull(response.sandboxEnvironmentSnapshots()); + } + + @Test + public void testDeleteSandboxSnapshot() throws Exception { + Client client = + TestUtils.createClient( + true, "ae_sandbox_snapshots_delete/test_delete_sandbox_snapshot.vertex.json"); + + DeleteSandboxEnvironmentSnapshotOperation operation = + client.agentEngines.sandboxes.snapshots.privateDelete( + "projects/802583348448/locations/us-central1/reasoningEngines/6130241318758121472/sandboxEnvironmentSnapshots/421086565159141376", + null); + + assertNotNull(operation); + } +} diff --git a/src/test/java/com/google/cloud/agentplatform/AgentEnginesSandboxTemplatesTest.java b/src/test/java/com/google/cloud/agentplatform/AgentEnginesSandboxTemplatesTest.java new file mode 100644 index 0000000..bec3dfa --- /dev/null +++ b/src/test/java/com/google/cloud/agentplatform/AgentEnginesSandboxTemplatesTest.java @@ -0,0 +1,121 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.agentplatform; + +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import com.google.cloud.agentplatform.types.CreateSandboxEnvironmentTemplateConfig; +import com.google.cloud.agentplatform.types.DeleteSandboxEnvironmentTemplateOperation; +import com.google.cloud.agentplatform.types.ListSandboxEnvironmentTemplatesResponse; +import com.google.cloud.agentplatform.types.SandboxEnvironmentTemplate; +import com.google.cloud.agentplatform.types.SandboxEnvironmentTemplateDefaultContainerEnvironment; +import com.google.cloud.agentplatform.types.SandboxEnvironmentTemplateEgressControlConfig; +import com.google.cloud.agentplatform.types.SandboxEnvironmentTemplateOperation; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; +import org.junit.jupiter.api.extension.ExtendWith; + +@EnabledIfEnvironmentVariable( + named = "GOOGLE_GENAI_REPLAYS_DIRECTORY", + matches = ".*genai/replays.*") +@ExtendWith(EnvironmentVariablesMockingExtension.class) +public class AgentEnginesSandboxTemplatesTest { + + @Test + public void testCreateSandboxTemplate() throws Exception { + Client client = + TestUtils.createClient( + true, + "ae_sandbox_templates_default_create/test_sandbox_templates_default_create.vertex.json"); + + SandboxEnvironmentTemplateOperation operation = + client.agentEngines.sandboxes.templates.privateCreate( + "projects/802583348448/locations/us-central1/reasoningEngines/6130241318758121472", + "Test Sandbox Template 1", + CreateSandboxEnvironmentTemplateConfig.builder() + .defaultContainerEnvironment( + SandboxEnvironmentTemplateDefaultContainerEnvironment.builder() + .defaultContainerCategory( + "DEFAULT_CONTAINER_CATEGORY_COMPUTER_USE") + .build()) + .egressControlConfig( + SandboxEnvironmentTemplateEgressControlConfig.builder() + .internetAccess(true) + .build()) + .build()); + + assertNotNull(operation.name()); + } + + @Test + public void testGetSandboxTemplate() throws Exception { + Client client = + TestUtils.createClient( + true, "ae_sandbox_templates_get/test_sandbox_templates_get.vertex.json"); + + String templateName = + "projects/254005681254/locations/us-central1/reasoningEngines/208148546254274560/sandboxEnvironmentTemplates/4632233691727265792"; + SandboxEnvironmentTemplate template = + client.agentEngines.sandboxes.templates.privateGet(templateName, null); + + assertNotNull(template.name()); + } + + @Test + public void testListSandboxTemplates() throws Exception { + Client client = + TestUtils.createClient( + true, "ae_sandbox_templates_list/test_sandbox_templates_list.vertex.json"); + + ListSandboxEnvironmentTemplatesResponse response = + client.agentEngines.sandboxes.templates.privateList( + "projects/254005681254/locations/us-central1/reasoningEngines/208148546254274560", + null); + + assertNotNull(response.sandboxEnvironmentTemplates()); + } + + @Test + public void testDeleteSandboxTemplate() throws Exception { + Client client = + TestUtils.createClient( + true, "ae_sandbox_templates_delete/test_sandbox_templates_delete.vertex.json"); + + DeleteSandboxEnvironmentTemplateOperation operation = + client.agentEngines.sandboxes.templates.privateDelete( + "projects/254005681254/locations/us-central1/reasoningEngines/208148546254274560/sandboxEnvironmentTemplates/4632233691727265792", + null); + + assertNotNull(operation); + } + + @Test + public void testGetSandboxTemplateOperation() throws Exception { + Client client = + TestUtils.createClient( + true, + "ae_sandbox_templates_get_sandbox_template_operation/test_get_sandbox_template_operation.vertex.json"); + + String operationName = + "projects/254005681254/locations/us-central1/operations/7252775414349692928"; + SandboxEnvironmentTemplateOperation operation = + client.agentEngines.sandboxes.templates.getSandboxEnvironmentTemplateOperation( + operationName, null); + + assertNotNull(operation.name()); + } +}