diff --git a/src/main/java/com/google/cloud/agentplatform/AgentEngines.java b/src/main/java/com/google/cloud/agentplatform/AgentEngines.java index bd1a171..43ce3e4 100644 --- a/src/main/java/com/google/cloud/agentplatform/AgentEngines.java +++ b/src/main/java/com/google/cloud/agentplatform/AgentEngines.java @@ -55,7 +55,6 @@ public final class AgentEngines { public final Sessions sessions; public final Sandboxes sandboxes; - public final Memories memories; final ApiClient apiClient; @@ -63,7 +62,6 @@ public AgentEngines(ApiClient apiClient) { this.apiClient = apiClient; this.sessions = new Sessions(apiClient); this.sandboxes = new Sandboxes(apiClient); - this.memories = new Memories(apiClient); } @ExcludeFromGeneratedCoverageReport diff --git a/src/main/java/com/google/cloud/agentplatform/AsyncAgentEngines.java b/src/main/java/com/google/cloud/agentplatform/AsyncAgentEngines.java index 7444dae..950ecd0 100644 --- a/src/main/java/com/google/cloud/agentplatform/AsyncAgentEngines.java +++ b/src/main/java/com/google/cloud/agentplatform/AsyncAgentEngines.java @@ -39,7 +39,6 @@ public final class AsyncAgentEngines { public final AsyncSessions sessions; public final AsyncSandboxes sandboxes; - public final AsyncMemories memories; AgentEngines agentEngines; ApiClient apiClient; @@ -50,7 +49,6 @@ public AsyncAgentEngines(ApiClient apiClient) { this.sessions = new AsyncSessions(apiClient); this.sandboxes = new AsyncSandboxes(apiClient); - this.memories = new AsyncMemories(apiClient); } CompletableFuture privateCreate(CreateAgentEngineConfig config) { diff --git a/src/main/java/com/google/cloud/agentplatform/Memories.java b/src/main/java/com/google/cloud/agentplatform/Memories.java deleted file mode 100644 index 49b0add..0000000 --- a/src/main/java/com/google/cloud/agentplatform/Memories.java +++ /dev/null @@ -1,1876 +0,0 @@ -/* - * 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.AgentEngineGenerateMemoriesOperation; -import com.google.cloud.agentplatform.types.AgentEngineMemoryConfig; -import com.google.cloud.agentplatform.types.AgentEngineMemoryOperation; -import com.google.cloud.agentplatform.types.AgentEnginePurgeMemoriesOperation; -import com.google.cloud.agentplatform.types.AgentEngineRollbackMemoryOperation; -import com.google.cloud.agentplatform.types.CreateAgentEngineMemoryRequestParameters; -import com.google.cloud.agentplatform.types.DeleteAgentEngineMemoryConfig; -import com.google.cloud.agentplatform.types.DeleteAgentEngineMemoryOperation; -import com.google.cloud.agentplatform.types.DeleteAgentEngineMemoryRequestParameters; -import com.google.cloud.agentplatform.types.GenerateAgentEngineMemoriesConfig; -import com.google.cloud.agentplatform.types.GenerateAgentEngineMemoriesRequestParameters; -import com.google.cloud.agentplatform.types.GenerateMemoriesRequestDirectContentsSource; -import com.google.cloud.agentplatform.types.GenerateMemoriesRequestDirectMemoriesSource; -import com.google.cloud.agentplatform.types.GenerateMemoriesRequestVertexSessionSource; -import com.google.cloud.agentplatform.types.GetAgentEngineGenerateMemoriesOperationParameters; -import com.google.cloud.agentplatform.types.GetAgentEngineMemoryConfig; -import com.google.cloud.agentplatform.types.GetAgentEngineMemoryOperationParameters; -import com.google.cloud.agentplatform.types.GetAgentEngineMemoryRequestParameters; -import com.google.cloud.agentplatform.types.GetAgentEngineOperationConfig; -import com.google.cloud.agentplatform.types.IngestEventsConfig; -import com.google.cloud.agentplatform.types.IngestEventsRequestParameters; -import com.google.cloud.agentplatform.types.IngestionDirectContentsSource; -import com.google.cloud.agentplatform.types.ListAgentEngineMemoryConfig; -import com.google.cloud.agentplatform.types.ListAgentEngineMemoryRequestParameters; -import com.google.cloud.agentplatform.types.ListReasoningEnginesMemoriesResponse; -import com.google.cloud.agentplatform.types.Memory; -import com.google.cloud.agentplatform.types.MemoryBankIngestEventsOperation; -import com.google.cloud.agentplatform.types.MemoryConjunctionFilter; -import com.google.cloud.agentplatform.types.MemoryGenerationTriggerConfig; -import com.google.cloud.agentplatform.types.PurgeAgentEngineMemoriesConfig; -import com.google.cloud.agentplatform.types.PurgeAgentEngineMemoriesRequestParameters; -import com.google.cloud.agentplatform.types.RetrieveAgentEngineMemoriesConfig; -import com.google.cloud.agentplatform.types.RetrieveAgentEngineMemoriesRequestParameters; -import com.google.cloud.agentplatform.types.RetrieveMemoriesRequestSimilaritySearchParams; -import com.google.cloud.agentplatform.types.RetrieveMemoriesRequestSimpleRetrievalParams; -import com.google.cloud.agentplatform.types.RetrieveMemoriesResponse; -import com.google.cloud.agentplatform.types.RetrieveMemoryProfilesConfig; -import com.google.cloud.agentplatform.types.RetrieveMemoryProfilesRequestParameters; -import com.google.cloud.agentplatform.types.RetrieveProfilesResponse; -import com.google.cloud.agentplatform.types.RollbackAgentEngineMemoryConfig; -import com.google.cloud.agentplatform.types.RollbackAgentEngineMemoryRequestParameters; -import com.google.cloud.agentplatform.types.UpdateAgentEngineMemoryConfig; -import com.google.cloud.agentplatform.types.UpdateAgentEngineMemoryRequestParameters; -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.List; -import java.util.Map; -import java.util.Optional; -import okhttp3.ResponseBody; - -public final class Memories { - public final MemoryRevisions revisions; - - final ApiClient apiClient; - - public Memories(ApiClient apiClient) { - this.apiClient = apiClient; - this.revisions = new MemoryRevisions(apiClient); - } - - @ExcludeFromGeneratedCoverageReport - ObjectNode agentEngineMemoryConfigToVertex(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[] {"description"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"description"}, - Common.getValueByPath(fromObject, new String[] {"description"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"ttl"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"ttl"}, - Common.getValueByPath(fromObject, new String[] {"ttl"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"expireTime"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"expireTime"}, - Common.getValueByPath(fromObject, new String[] {"expireTime"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"revisionExpireTime"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"revisionExpireTime"}, - Common.getValueByPath(fromObject, new String[] {"revisionExpireTime"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"revisionTtl"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"revisionTtl"}, - Common.getValueByPath(fromObject, new String[] {"revisionTtl"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"disableMemoryRevisions"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"disableMemoryRevisions"}, - Common.getValueByPath(fromObject, new String[] {"disableMemoryRevisions"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"topics"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"topics"}, - Common.getValueByPath(fromObject, new String[] {"topics"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"metadata"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"metadata"}, - Common.getValueByPath(fromObject, new String[] {"metadata"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"memoryId"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"_query", "memoryId"}, - Common.getValueByPath(fromObject, new String[] {"memoryId"})); - } - - return toObject; - } - - @ExcludeFromGeneratedCoverageReport - ObjectNode createAgentEngineMemoryRequestParametersToVertex( - 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[] {"fact"}) != null) { - Common.setValueByPath( - toObject, - new String[] {"fact"}, - Common.getValueByPath(fromObject, new String[] {"fact"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"scope"}) != null) { - Common.setValueByPath( - toObject, - new String[] {"scope"}, - Common.getValueByPath(fromObject, new String[] {"scope"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { - JsonNode unused = - agentEngineMemoryConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), - toObject); - } - - return toObject; - } - - @ExcludeFromGeneratedCoverageReport - ObjectNode deleteAgentEngineMemoryRequestParametersToVertex( - 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 generateAgentEngineMemoriesConfigToVertex( - JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); - - if (Common.getValueByPath(fromObject, new String[] {"disableConsolidation"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"disableConsolidation"}, - Common.getValueByPath(fromObject, new String[] {"disableConsolidation"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"revisionLabels"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"revisionLabels"}, - Common.getValueByPath(fromObject, new String[] {"revisionLabels"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"revisionExpireTime"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"revisionExpireTime"}, - Common.getValueByPath(fromObject, new String[] {"revisionExpireTime"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"revisionTtl"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"revisionTtl"}, - Common.getValueByPath(fromObject, new String[] {"revisionTtl"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"disableMemoryRevisions"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"disableMemoryRevisions"}, - Common.getValueByPath(fromObject, new String[] {"disableMemoryRevisions"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"metadata"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"metadata"}, - Common.getValueByPath(fromObject, new String[] {"metadata"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"metadataMergeStrategy"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"metadataMergeStrategy"}, - Common.getValueByPath(fromObject, new String[] {"metadataMergeStrategy"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"allowedTopics"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"allowedTopics"}, - Common.getValueByPath(fromObject, new String[] {"allowedTopics"})); - } - - return toObject; - } - - @ExcludeFromGeneratedCoverageReport - ObjectNode generateAgentEngineMemoriesRequestParametersToVertex( - 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[] {"vertexSessionSource"}) != null) { - Common.setValueByPath( - toObject, - new String[] {"vertexSessionSource"}, - Common.getValueByPath(fromObject, new String[] {"vertexSessionSource"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"directContentsSource"}) != null) { - Common.setValueByPath( - toObject, - new String[] {"directContentsSource"}, - Common.getValueByPath(fromObject, new String[] {"directContentsSource"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"directMemoriesSource"}) != null) { - Common.setValueByPath( - toObject, - new String[] {"directMemoriesSource"}, - Common.getValueByPath(fromObject, new String[] {"directMemoriesSource"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"scope"}) != null) { - Common.setValueByPath( - toObject, - new String[] {"scope"}, - Common.getValueByPath(fromObject, new String[] {"scope"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { - JsonNode unused = - generateAgentEngineMemoriesConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), - toObject); - } - - return toObject; - } - - @ExcludeFromGeneratedCoverageReport - ObjectNode getAgentEngineGenerateMemoriesOperationParametersToVertex( - 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 getAgentEngineMemoryOperationParametersToVertex( - 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 getAgentEngineMemoryRequestParametersToVertex( - 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 ingestEventsConfigToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); - - if (Common.getValueByPath(fromObject, new String[] {"forceFlush"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"forceFlush"}, - Common.getValueByPath(fromObject, new String[] {"forceFlush"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"revisionLabels"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"revisionLabels"}, - Common.getValueByPath(fromObject, new String[] {"revisionLabels"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"revisionExpireTime"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"revisionExpireTime"}, - Common.getValueByPath(fromObject, new String[] {"revisionExpireTime"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"revisionTtl"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"revisionTtl"}, - Common.getValueByPath(fromObject, new String[] {"revisionTtl"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"disableMemoryRevisions"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"disableMemoryRevisions"}, - Common.getValueByPath(fromObject, new String[] {"disableMemoryRevisions"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"metadata"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"metadata"}, - Common.getValueByPath(fromObject, new String[] {"metadata"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"metadataMergeStrategy"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"metadataMergeStrategy"}, - Common.getValueByPath(fromObject, new String[] {"metadataMergeStrategy"})); - } - - return toObject; - } - - @ExcludeFromGeneratedCoverageReport - ObjectNode ingestEventsRequestParametersToVertex(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[] {"streamId"}) != null) { - Common.setValueByPath( - toObject, - new String[] {"streamId"}, - Common.getValueByPath(fromObject, new String[] {"streamId"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"directContentsSource"}) != null) { - Common.setValueByPath( - toObject, - new String[] {"directContentsSource"}, - Common.getValueByPath(fromObject, new String[] {"directContentsSource"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"scope"}) != null) { - Common.setValueByPath( - toObject, - new String[] {"scope"}, - Common.getValueByPath(fromObject, new String[] {"scope"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"generationTriggerConfig"}) != null) { - Common.setValueByPath( - toObject, - new String[] {"generationTriggerConfig"}, - Common.getValueByPath(fromObject, new String[] {"generationTriggerConfig"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { - JsonNode unused = - ingestEventsConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), - toObject); - } - - return toObject; - } - - @ExcludeFromGeneratedCoverageReport - ObjectNode listAgentEngineMemoryConfigToVertex(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"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"orderBy"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"_query", "orderBy"}, - Common.getValueByPath(fromObject, new String[] {"orderBy"})); - } - - return toObject; - } - - @ExcludeFromGeneratedCoverageReport - ObjectNode listAgentEngineMemoryRequestParametersToVertex( - 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 = - listAgentEngineMemoryConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), - toObject); - } - - return toObject; - } - - @ExcludeFromGeneratedCoverageReport - ObjectNode purgeAgentEngineMemoriesRequestParametersToVertex( - 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[] {"filter"}) != null) { - Common.setValueByPath( - toObject, - new String[] {"filter"}, - Common.getValueByPath(fromObject, new String[] {"filter"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"filterGroups"}) != null) { - Common.setValueByPath( - toObject, - new String[] {"filterGroups"}, - Common.getValueByPath(fromObject, new String[] {"filterGroups"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"force"}) != null) { - Common.setValueByPath( - toObject, - new String[] {"force"}, - Common.getValueByPath(fromObject, new String[] {"force"})); - } - - return toObject; - } - - @ExcludeFromGeneratedCoverageReport - ObjectNode retrieveAgentEngineMemoriesConfigToVertex( - JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); - - if (Common.getValueByPath(fromObject, new String[] {"filter"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"filter"}, - Common.getValueByPath(fromObject, new String[] {"filter"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"filterGroups"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"filterGroups"}, - Common.getValueByPath(fromObject, new String[] {"filterGroups"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"memoryTypes"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"memoryTypes"}, - Common.getValueByPath(fromObject, new String[] {"memoryTypes"})); - } - - return toObject; - } - - @ExcludeFromGeneratedCoverageReport - ObjectNode retrieveAgentEngineMemoriesRequestParametersToVertex( - 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[] {"scope"}) != null) { - Common.setValueByPath( - toObject, - new String[] {"scope"}, - Common.getValueByPath(fromObject, new String[] {"scope"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"similaritySearchParams"}) != null) { - Common.setValueByPath( - toObject, - new String[] {"similaritySearchParams"}, - Common.getValueByPath(fromObject, new String[] {"similaritySearchParams"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"simpleRetrievalParams"}) != null) { - Common.setValueByPath( - toObject, - new String[] {"simpleRetrievalParams"}, - Common.getValueByPath(fromObject, new String[] {"simpleRetrievalParams"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { - JsonNode unused = - retrieveAgentEngineMemoriesConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), - toObject); - } - - return toObject; - } - - @ExcludeFromGeneratedCoverageReport - ObjectNode retrieveMemoryProfilesRequestParametersToVertex( - 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[] {"scope"}) != null) { - Common.setValueByPath( - toObject, - new String[] {"scope"}, - Common.getValueByPath(fromObject, new String[] {"scope"})); - } - - return toObject; - } - - @ExcludeFromGeneratedCoverageReport - ObjectNode rollbackAgentEngineMemoryRequestParametersToVertex( - 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[] {"targetRevisionId"}) != null) { - Common.setValueByPath( - toObject, - new String[] {"targetRevisionId"}, - Common.getValueByPath(fromObject, new String[] {"targetRevisionId"})); - } - - return toObject; - } - - @ExcludeFromGeneratedCoverageReport - ObjectNode updateAgentEngineMemoryConfigToVertex(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[] {"description"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"description"}, - Common.getValueByPath(fromObject, new String[] {"description"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"ttl"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"ttl"}, - Common.getValueByPath(fromObject, new String[] {"ttl"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"expireTime"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"expireTime"}, - Common.getValueByPath(fromObject, new String[] {"expireTime"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"revisionExpireTime"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"revisionExpireTime"}, - Common.getValueByPath(fromObject, new String[] {"revisionExpireTime"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"revisionTtl"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"revisionTtl"}, - Common.getValueByPath(fromObject, new String[] {"revisionTtl"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"disableMemoryRevisions"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"disableMemoryRevisions"}, - Common.getValueByPath(fromObject, new String[] {"disableMemoryRevisions"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"topics"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"topics"}, - Common.getValueByPath(fromObject, new String[] {"topics"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"metadata"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"metadata"}, - Common.getValueByPath(fromObject, new String[] {"metadata"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"memoryId"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"_query", "memoryId"}, - Common.getValueByPath(fromObject, new String[] {"memoryId"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"updateMask"}) != null) { - Common.setValueByPath( - parentObject, - new String[] {"_query", "updateMask"}, - Common.getValueByPath(fromObject, new String[] {"updateMask"})); - } - - return toObject; - } - - @ExcludeFromGeneratedCoverageReport - ObjectNode updateAgentEngineMemoryRequestParametersToVertex( - 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[] {"fact"}) != null) { - Common.setValueByPath( - toObject, - new String[] {"fact"}, - Common.getValueByPath(fromObject, new String[] {"fact"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"scope"}) != null) { - Common.setValueByPath( - toObject, - new String[] {"scope"}, - Common.getValueByPath(fromObject, new String[] {"scope"})); - } - - if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { - JsonNode unused = - updateAgentEngineMemoryConfigToVertex( - 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 fact, Map scope, AgentEngineMemoryConfig config) { - - CreateAgentEngineMemoryRequestParameters.Builder parameterBuilder = - CreateAgentEngineMemoryRequestParameters.builder(); - - if (!Common.isZero(name)) { - parameterBuilder.name(name); - } - if (!Common.isZero(fact)) { - parameterBuilder.fact(fact); - } - if (!Common.isZero(scope)) { - parameterBuilder.scope(scope); - } - if (!Common.isZero(config)) { - parameterBuilder.config(config); - } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); - - ObjectNode body; - String path; - if (this.apiClient.vertexAI()) { - body = createAgentEngineMemoryRequestParametersToVertex(parameterNode, null); - path = Common.formatMap("{name}/memories", 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. */ - AgentEngineMemoryOperation processResponseForPrivateCreate( - ApiResponse response, AgentEngineMemoryConfig 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, AgentEngineMemoryOperation.class); - } - - public AgentEngineMemoryOperation privateCreate( - String name, String fact, Map scope, AgentEngineMemoryConfig config) { - BuiltRequest builtRequest = buildRequestForPrivateCreate(name, fact, scope, 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 buildRequestForDelete(String name, DeleteAgentEngineMemoryConfig config) { - - DeleteAgentEngineMemoryRequestParameters.Builder parameterBuilder = - DeleteAgentEngineMemoryRequestParameters.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 = deleteAgentEngineMemoryRequestParametersToVertex(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. */ - DeleteAgentEngineMemoryOperation processResponseForDelete( - ApiResponse response, DeleteAgentEngineMemoryConfig 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, DeleteAgentEngineMemoryOperation.class); - } - - public DeleteAgentEngineMemoryOperation delete( - String name, DeleteAgentEngineMemoryConfig config) { - BuiltRequest builtRequest = buildRequestForDelete(name, config); - - try (ApiResponse response = - this.apiClient.request( - "delete", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())) { - return processResponseForDelete(response, config); - } - } - - /** A shared buildRequest method for both sync and async methods. */ - BuiltRequest buildRequestForPrivateGenerate( - String name, - GenerateMemoriesRequestVertexSessionSource vertexSessionSource, - GenerateMemoriesRequestDirectContentsSource directContentsSource, - GenerateMemoriesRequestDirectMemoriesSource directMemoriesSource, - Map scope, - GenerateAgentEngineMemoriesConfig config) { - - GenerateAgentEngineMemoriesRequestParameters.Builder parameterBuilder = - GenerateAgentEngineMemoriesRequestParameters.builder(); - - if (!Common.isZero(name)) { - parameterBuilder.name(name); - } - if (!Common.isZero(vertexSessionSource)) { - parameterBuilder.vertexSessionSource(vertexSessionSource); - } - if (!Common.isZero(directContentsSource)) { - parameterBuilder.directContentsSource(directContentsSource); - } - if (!Common.isZero(directMemoriesSource)) { - parameterBuilder.directMemoriesSource(directMemoriesSource); - } - if (!Common.isZero(scope)) { - parameterBuilder.scope(scope); - } - if (!Common.isZero(config)) { - parameterBuilder.config(config); - } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); - - ObjectNode body; - String path; - if (this.apiClient.vertexAI()) { - body = generateAgentEngineMemoriesRequestParametersToVertex(parameterNode, null); - path = Common.formatMap("{name}/memories:generate", 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. */ - AgentEngineGenerateMemoriesOperation processResponseForPrivateGenerate( - ApiResponse response, GenerateAgentEngineMemoriesConfig 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, AgentEngineGenerateMemoriesOperation.class); - } - - public AgentEngineGenerateMemoriesOperation privateGenerate( - String name, - GenerateMemoriesRequestVertexSessionSource vertexSessionSource, - GenerateMemoriesRequestDirectContentsSource directContentsSource, - GenerateMemoriesRequestDirectMemoriesSource directMemoriesSource, - Map scope, - GenerateAgentEngineMemoriesConfig config) { - BuiltRequest builtRequest = - buildRequestForPrivateGenerate( - name, vertexSessionSource, directContentsSource, directMemoriesSource, scope, config); - - try (ApiResponse response = - this.apiClient.request( - "post", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())) { - return processResponseForPrivateGenerate(response, config); - } - } - - /** A shared buildRequest method for both sync and async methods. */ - BuiltRequest buildRequestForGet(String name, GetAgentEngineMemoryConfig config) { - - GetAgentEngineMemoryRequestParameters.Builder parameterBuilder = - GetAgentEngineMemoryRequestParameters.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 = getAgentEngineMemoryRequestParametersToVertex(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. */ - Memory processResponseForGet(ApiResponse response, GetAgentEngineMemoryConfig 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, Memory.class); - } - - public Memory get(String name, GetAgentEngineMemoryConfig config) { - BuiltRequest builtRequest = buildRequestForGet(name, config); - - try (ApiResponse response = - this.apiClient.request( - "get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())) { - return processResponseForGet(response, config); - } - } - - /** A shared buildRequest method for both sync and async methods. */ - BuiltRequest buildRequestForPrivateIngestEvents( - String name, - String streamId, - IngestionDirectContentsSource directContentsSource, - Map scope, - MemoryGenerationTriggerConfig generationTriggerConfig, - IngestEventsConfig config) { - - IngestEventsRequestParameters.Builder parameterBuilder = - IngestEventsRequestParameters.builder(); - - if (!Common.isZero(name)) { - parameterBuilder.name(name); - } - if (!Common.isZero(streamId)) { - parameterBuilder.streamId(streamId); - } - if (!Common.isZero(directContentsSource)) { - parameterBuilder.directContentsSource(directContentsSource); - } - if (!Common.isZero(scope)) { - parameterBuilder.scope(scope); - } - if (!Common.isZero(generationTriggerConfig)) { - parameterBuilder.generationTriggerConfig(generationTriggerConfig); - } - if (!Common.isZero(config)) { - parameterBuilder.config(config); - } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); - - ObjectNode body; - String path; - if (this.apiClient.vertexAI()) { - body = ingestEventsRequestParametersToVertex(parameterNode, null); - path = Common.formatMap("{name}/memories:ingestEvents", 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. */ - MemoryBankIngestEventsOperation processResponseForPrivateIngestEvents( - ApiResponse response, IngestEventsConfig 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, MemoryBankIngestEventsOperation.class); - } - - public MemoryBankIngestEventsOperation privateIngestEvents( - String name, - String streamId, - IngestionDirectContentsSource directContentsSource, - Map scope, - MemoryGenerationTriggerConfig generationTriggerConfig, - IngestEventsConfig config) { - BuiltRequest builtRequest = - buildRequestForPrivateIngestEvents( - name, streamId, directContentsSource, scope, generationTriggerConfig, config); - - try (ApiResponse response = - this.apiClient.request( - "post", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())) { - return processResponseForPrivateIngestEvents(response, config); - } - } - - /** A shared buildRequest method for both sync and async methods. */ - BuiltRequest buildRequestForPrivateList(String name, ListAgentEngineMemoryConfig config) { - - ListAgentEngineMemoryRequestParameters.Builder parameterBuilder = - ListAgentEngineMemoryRequestParameters.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 = listAgentEngineMemoryRequestParametersToVertex(parameterNode, null); - path = Common.formatMap("{name}/memories", 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. */ - ListReasoningEnginesMemoriesResponse processResponseForPrivateList( - ApiResponse response, ListAgentEngineMemoryConfig 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, ListReasoningEnginesMemoriesResponse.class); - } - - public ListReasoningEnginesMemoriesResponse privateList( - String name, ListAgentEngineMemoryConfig 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 buildRequestForPrivateGetMemoryOperation( - String operationName, GetAgentEngineOperationConfig config) { - - GetAgentEngineMemoryOperationParameters.Builder parameterBuilder = - GetAgentEngineMemoryOperationParameters.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 = getAgentEngineMemoryOperationParametersToVertex(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. */ - AgentEngineMemoryOperation processResponseForPrivateGetMemoryOperation( - 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, AgentEngineMemoryOperation.class); - } - - public AgentEngineMemoryOperation privateGetMemoryOperation( - String operationName, GetAgentEngineOperationConfig config) { - BuiltRequest builtRequest = buildRequestForPrivateGetMemoryOperation(operationName, config); - - try (ApiResponse response = - this.apiClient.request( - "get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())) { - return processResponseForPrivateGetMemoryOperation(response, config); - } - } - - /** A shared buildRequest method for both sync and async methods. */ - BuiltRequest buildRequestForPrivateGetGenerateMemoriesOperation( - String operationName, GetAgentEngineOperationConfig config) { - - GetAgentEngineGenerateMemoriesOperationParameters.Builder parameterBuilder = - GetAgentEngineGenerateMemoriesOperationParameters.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 = getAgentEngineGenerateMemoriesOperationParametersToVertex(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. */ - AgentEngineGenerateMemoriesOperation processResponseForPrivateGetGenerateMemoriesOperation( - 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, AgentEngineGenerateMemoriesOperation.class); - } - - public AgentEngineGenerateMemoriesOperation privateGetGenerateMemoriesOperation( - String operationName, GetAgentEngineOperationConfig config) { - BuiltRequest builtRequest = - buildRequestForPrivateGetGenerateMemoriesOperation(operationName, config); - - try (ApiResponse response = - this.apiClient.request( - "get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())) { - return processResponseForPrivateGetGenerateMemoriesOperation(response, config); - } - } - - /** A shared buildRequest method for both sync and async methods. */ - BuiltRequest buildRequestForPrivateRetrieve( - String name, - Map scope, - RetrieveMemoriesRequestSimilaritySearchParams similaritySearchParams, - RetrieveMemoriesRequestSimpleRetrievalParams simpleRetrievalParams, - RetrieveAgentEngineMemoriesConfig config) { - - RetrieveAgentEngineMemoriesRequestParameters.Builder parameterBuilder = - RetrieveAgentEngineMemoriesRequestParameters.builder(); - - if (!Common.isZero(name)) { - parameterBuilder.name(name); - } - if (!Common.isZero(scope)) { - parameterBuilder.scope(scope); - } - if (!Common.isZero(similaritySearchParams)) { - parameterBuilder.similaritySearchParams(similaritySearchParams); - } - if (!Common.isZero(simpleRetrievalParams)) { - parameterBuilder.simpleRetrievalParams(simpleRetrievalParams); - } - if (!Common.isZero(config)) { - parameterBuilder.config(config); - } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); - - ObjectNode body; - String path; - if (this.apiClient.vertexAI()) { - body = retrieveAgentEngineMemoriesRequestParametersToVertex(parameterNode, null); - path = Common.formatMap("{name}/memories:retrieve", 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. */ - RetrieveMemoriesResponse processResponseForPrivateRetrieve( - ApiResponse response, RetrieveAgentEngineMemoriesConfig 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, RetrieveMemoriesResponse.class); - } - - public RetrieveMemoriesResponse privateRetrieve( - String name, - Map scope, - RetrieveMemoriesRequestSimilaritySearchParams similaritySearchParams, - RetrieveMemoriesRequestSimpleRetrievalParams simpleRetrievalParams, - RetrieveAgentEngineMemoriesConfig config) { - BuiltRequest builtRequest = - buildRequestForPrivateRetrieve( - name, scope, similaritySearchParams, simpleRetrievalParams, config); - - try (ApiResponse response = - this.apiClient.request( - "post", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())) { - return processResponseForPrivateRetrieve(response, config); - } - } - - /** A shared buildRequest method for both sync and async methods. */ - BuiltRequest buildRequestForRetrieveProfiles( - String name, Map scope, RetrieveMemoryProfilesConfig config) { - - RetrieveMemoryProfilesRequestParameters.Builder parameterBuilder = - RetrieveMemoryProfilesRequestParameters.builder(); - - if (!Common.isZero(name)) { - parameterBuilder.name(name); - } - if (!Common.isZero(scope)) { - parameterBuilder.scope(scope); - } - if (!Common.isZero(config)) { - parameterBuilder.config(config); - } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); - - ObjectNode body; - String path; - if (this.apiClient.vertexAI()) { - body = retrieveMemoryProfilesRequestParametersToVertex(parameterNode, null); - path = Common.formatMap("{name}/memories:retrieveProfiles", 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. */ - RetrieveProfilesResponse processResponseForRetrieveProfiles( - ApiResponse response, RetrieveMemoryProfilesConfig 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, RetrieveProfilesResponse.class); - } - - public RetrieveProfilesResponse retrieveProfiles( - String name, Map scope, RetrieveMemoryProfilesConfig config) { - BuiltRequest builtRequest = buildRequestForRetrieveProfiles(name, scope, config); - - try (ApiResponse response = - this.apiClient.request( - "post", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())) { - return processResponseForRetrieveProfiles(response, config); - } - } - - /** A shared buildRequest method for both sync and async methods. */ - BuiltRequest buildRequestForPrivateRollback( - String name, String targetRevisionId, RollbackAgentEngineMemoryConfig config) { - - RollbackAgentEngineMemoryRequestParameters.Builder parameterBuilder = - RollbackAgentEngineMemoryRequestParameters.builder(); - - if (!Common.isZero(name)) { - parameterBuilder.name(name); - } - if (!Common.isZero(targetRevisionId)) { - parameterBuilder.targetRevisionId(targetRevisionId); - } - if (!Common.isZero(config)) { - parameterBuilder.config(config); - } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); - - ObjectNode body; - String path; - if (this.apiClient.vertexAI()) { - body = rollbackAgentEngineMemoryRequestParametersToVertex(parameterNode, null); - path = Common.formatMap("{name}:rollback", 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. */ - AgentEngineRollbackMemoryOperation processResponseForPrivateRollback( - ApiResponse response, RollbackAgentEngineMemoryConfig 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, AgentEngineRollbackMemoryOperation.class); - } - - public AgentEngineRollbackMemoryOperation privateRollback( - String name, String targetRevisionId, RollbackAgentEngineMemoryConfig config) { - BuiltRequest builtRequest = buildRequestForPrivateRollback(name, targetRevisionId, config); - - try (ApiResponse response = - this.apiClient.request( - "post", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())) { - return processResponseForPrivateRollback(response, config); - } - } - - /** A shared buildRequest method for both sync and async methods. */ - BuiltRequest buildRequestForPrivateUpdate( - String name, String fact, Map scope, UpdateAgentEngineMemoryConfig config) { - - UpdateAgentEngineMemoryRequestParameters.Builder parameterBuilder = - UpdateAgentEngineMemoryRequestParameters.builder(); - - if (!Common.isZero(name)) { - parameterBuilder.name(name); - } - if (!Common.isZero(fact)) { - parameterBuilder.fact(fact); - } - if (!Common.isZero(scope)) { - parameterBuilder.scope(scope); - } - if (!Common.isZero(config)) { - parameterBuilder.config(config); - } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); - - ObjectNode body; - String path; - if (this.apiClient.vertexAI()) { - body = updateAgentEngineMemoryRequestParametersToVertex(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. */ - AgentEngineMemoryOperation processResponseForPrivateUpdate( - ApiResponse response, UpdateAgentEngineMemoryConfig 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, AgentEngineMemoryOperation.class); - } - - public AgentEngineMemoryOperation privateUpdate( - String name, String fact, Map scope, UpdateAgentEngineMemoryConfig config) { - BuiltRequest builtRequest = buildRequestForPrivateUpdate(name, fact, scope, config); - - try (ApiResponse response = - this.apiClient.request( - "patch", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())) { - return processResponseForPrivateUpdate(response, config); - } - } - - /** A shared buildRequest method for both sync and async methods. */ - BuiltRequest buildRequestForPrivatePurge( - String name, - String filter, - List filterGroups, - boolean force, - PurgeAgentEngineMemoriesConfig config) { - - PurgeAgentEngineMemoriesRequestParameters.Builder parameterBuilder = - PurgeAgentEngineMemoriesRequestParameters.builder(); - - if (!Common.isZero(name)) { - parameterBuilder.name(name); - } - if (!Common.isZero(filter)) { - parameterBuilder.filter(filter); - } - if (!Common.isZero(filterGroups)) { - parameterBuilder.filterGroups(filterGroups); - } - if (!Common.isZero(force)) { - parameterBuilder.force(force); - } - if (!Common.isZero(config)) { - parameterBuilder.config(config); - } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); - - ObjectNode body; - String path; - if (this.apiClient.vertexAI()) { - body = purgeAgentEngineMemoriesRequestParametersToVertex(parameterNode, null); - path = Common.formatMap("{name}/memories:purge", 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. */ - AgentEnginePurgeMemoriesOperation processResponseForPrivatePurge( - ApiResponse response, PurgeAgentEngineMemoriesConfig 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, AgentEnginePurgeMemoriesOperation.class); - } - - public AgentEnginePurgeMemoriesOperation privatePurge( - String name, - String filter, - List filterGroups, - boolean force, - PurgeAgentEngineMemoriesConfig config) { - BuiltRequest builtRequest = - buildRequestForPrivatePurge(name, filter, filterGroups, force, config); - - try (ApiResponse response = - this.apiClient.request( - "post", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())) { - return processResponseForPrivatePurge(response, config); - } - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/MemoryRevisions.java b/src/main/java/com/google/cloud/agentplatform/MemoryRevisions.java deleted file mode 100644 index 243f499..0000000 --- a/src/main/java/com/google/cloud/agentplatform/MemoryRevisions.java +++ /dev/null @@ -1,261 +0,0 @@ -/* - * 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.GetAgentEngineMemoryRevisionConfig; -import com.google.cloud.agentplatform.types.GetAgentEngineMemoryRevisionRequestParameters; -import com.google.cloud.agentplatform.types.ListAgentEngineMemoryRevisionsConfig; -import com.google.cloud.agentplatform.types.ListAgentEngineMemoryRevisionsRequestParameters; -import com.google.cloud.agentplatform.types.ListAgentEngineMemoryRevisionsResponse; -import com.google.cloud.agentplatform.types.MemoryRevision; -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 MemoryRevisions { - - final ApiClient apiClient; - - public MemoryRevisions(ApiClient apiClient) { - this.apiClient = apiClient; - } - - @ExcludeFromGeneratedCoverageReport - ObjectNode getAgentEngineMemoryRevisionRequestParametersToVertex( - 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 listAgentEngineMemoryRevisionsConfigToVertex( - 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 listAgentEngineMemoryRevisionsRequestParametersToVertex( - 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 = - listAgentEngineMemoryRevisionsConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), - toObject); - } - - return toObject; - } - - /** A shared buildRequest method for both sync and async methods. */ - BuiltRequest buildRequestForGet(String name, GetAgentEngineMemoryRevisionConfig config) { - - GetAgentEngineMemoryRevisionRequestParameters.Builder parameterBuilder = - GetAgentEngineMemoryRevisionRequestParameters.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 = getAgentEngineMemoryRevisionRequestParametersToVertex(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. */ - MemoryRevision processResponseForGet( - ApiResponse response, GetAgentEngineMemoryRevisionConfig 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, MemoryRevision.class); - } - - public MemoryRevision get(String name, GetAgentEngineMemoryRevisionConfig config) { - BuiltRequest builtRequest = buildRequestForGet(name, config); - - try (ApiResponse response = - this.apiClient.request( - "get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())) { - return processResponseForGet(response, config); - } - } - - /** A shared buildRequest method for both sync and async methods. */ - BuiltRequest buildRequestForPrivateList( - String name, ListAgentEngineMemoryRevisionsConfig config) { - - ListAgentEngineMemoryRevisionsRequestParameters.Builder parameterBuilder = - ListAgentEngineMemoryRevisionsRequestParameters.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 = listAgentEngineMemoryRevisionsRequestParametersToVertex(parameterNode, null); - path = Common.formatMap("{name}/revisions", 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. */ - ListAgentEngineMemoryRevisionsResponse processResponseForPrivateList( - ApiResponse response, ListAgentEngineMemoryRevisionsConfig 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, ListAgentEngineMemoryRevisionsResponse.class); - } - - public ListAgentEngineMemoryRevisionsResponse privateList( - String name, ListAgentEngineMemoryRevisionsConfig config) { - BuiltRequest builtRequest = buildRequestForPrivateList(name, config); - - try (ApiResponse response = - this.apiClient.request( - "get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())) { - return processResponseForPrivateList(response, config); - } - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/AgentEngineGenerateMemoriesOperation.java b/src/main/java/com/google/cloud/agentplatform/types/AgentEngineGenerateMemoriesOperation.java deleted file mode 100644 index be21ec1..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/AgentEngineGenerateMemoriesOperation.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * 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 generates memories for an agent engine. */ -@AutoValue -@JsonDeserialize(builder = AgentEngineGenerateMemoriesOperation.Builder.class) -public abstract class AgentEngineGenerateMemoriesOperation 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 response for generating memories. */ - @JsonProperty("response") - public abstract Optional response(); - - /** Instantiates a builder for AgentEngineGenerateMemoriesOperation. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_AgentEngineGenerateMemoriesOperation.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for AgentEngineGenerateMemoriesOperation. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `AgentEngineGenerateMemoriesOperation.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_AgentEngineGenerateMemoriesOperation.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 response for generating memories. - */ - @JsonProperty("response") - public abstract Builder response(GenerateMemoriesResponse response); - - /** - * Setter for response builder. - * - *

response: The response for generating memories. - */ - @CanIgnoreReturnValue - public Builder response(GenerateMemoriesResponse.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 AgentEngineGenerateMemoriesOperation build(); - } - - /** Deserializes a JSON string to a AgentEngineGenerateMemoriesOperation object. */ - @ExcludeFromGeneratedCoverageReport - public static AgentEngineGenerateMemoriesOperation fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, AgentEngineGenerateMemoriesOperation.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/AgentEngineMemoryConfig.java b/src/main/java/com/google/cloud/agentplatform/types/AgentEngineMemoryConfig.java deleted file mode 100644 index 1cf1d15..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/AgentEngineMemoryConfig.java +++ /dev/null @@ -1,382 +0,0 @@ -/* - * 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.HttpOptions; -import java.time.Duration; -import java.time.Instant; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.Optional; - -/** Config for creating a Memory. */ -@AutoValue -@JsonDeserialize(builder = AgentEngineMemoryConfig.Builder.class) -public abstract class AgentEngineMemoryConfig extends JsonSerializable { - /** Used to override HTTP request options. */ - @JsonProperty("httpOptions") - public abstract Optional httpOptions(); - - /** The display name of the memory. */ - @JsonProperty("displayName") - public abstract Optional displayName(); - - /** The description of the memory. */ - @JsonProperty("description") - public abstract Optional description(); - - /** Waits for the operation to complete before returning. */ - @JsonProperty("waitForCompletion") - public abstract Optional waitForCompletion(); - - /** - * Optional. Input only. The TTL for this resource. - * - *

The expiration time is computed: now + TTL. - */ - @JsonProperty("ttl") - public abstract Optional ttl(); - - /** - * Optional. Timestamp of when this resource is considered expired. This is *always* provided on - * output, regardless of what `expiration` was sent on input. - */ - @JsonProperty("expireTime") - public abstract Optional expireTime(); - - /** - * Optional. Input only. Timestamp of when the revision is considered expired. If not set, the - * memory revision will be kept until manually deleted. - */ - @JsonProperty("revisionExpireTime") - public abstract Optional revisionExpireTime(); - - /** Optional. Input only. The TTL for the revision. The expiration time is computed: now + TTL. */ - @JsonProperty("revisionTtl") - public abstract Optional revisionTtl(); - - /** Optional. Input only. If true, no revision will be created for this request. */ - @JsonProperty("disableMemoryRevisions") - public abstract Optional disableMemoryRevisions(); - - /** Optional. The topics of the memory. */ - @JsonProperty("topics") - public abstract Optional> topics(); - - /** - * Optional. User-provided metadata for the Memory. This information was provided when creating, - * updating, or generating the Memory. It was not generated by Memory Bank. - */ - @JsonProperty("metadata") - public abstract Optional> metadata(); - - /** - * Optional. The user defined ID to use for memory, which will become the final component of the - * memory resource name. If not provided, Vertex AI will generate a value for this ID. This value - * may be up to 63 characters, and valid characters are `[a-z0-9-]`. The first character must be a - * letter, and the last character must be a letter or number. - */ - @JsonProperty("memoryId") - public abstract Optional memoryId(); - - /** Instantiates a builder for AgentEngineMemoryConfig. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_AgentEngineMemoryConfig.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for AgentEngineMemoryConfig. */ - @AutoValue.Builder - public abstract static class Builder { - /** For internal usage. Please use `AgentEngineMemoryConfig.builder()` for instantiation. */ - @JsonCreator - private static Builder create() { - return new AutoValue_AgentEngineMemoryConfig.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 memory. - */ - @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 description. - * - *

description: The description of the memory. - */ - @JsonProperty("description") - public abstract Builder description(String description); - - @ExcludeFromGeneratedCoverageReport - abstract Builder description(Optional description); - - /** Clears the value of description field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearDescription() { - return description(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()); - } - - /** - * Setter for ttl. - * - *

ttl: Optional. Input only. 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 expireTime. - * - *

expireTime: Optional. Timestamp of when this resource is considered expired. This is - * *always* provided on output, regardless of what `expiration` was sent on input. - */ - @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 revisionExpireTime. - * - *

revisionExpireTime: Optional. Input only. Timestamp of when the revision is considered - * expired. If not set, the memory revision will be kept until manually deleted. - */ - @JsonProperty("revisionExpireTime") - public abstract Builder revisionExpireTime(Instant revisionExpireTime); - - @ExcludeFromGeneratedCoverageReport - abstract Builder revisionExpireTime(Optional revisionExpireTime); - - /** Clears the value of revisionExpireTime field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearRevisionExpireTime() { - return revisionExpireTime(Optional.empty()); - } - - /** - * Setter for revisionTtl. - * - *

revisionTtl: Optional. Input only. The TTL for the revision. The expiration time is - * computed: now + TTL. - */ - @JsonProperty("revisionTtl") - public abstract Builder revisionTtl(Duration revisionTtl); - - @ExcludeFromGeneratedCoverageReport - abstract Builder revisionTtl(Optional revisionTtl); - - /** Clears the value of revisionTtl field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearRevisionTtl() { - return revisionTtl(Optional.empty()); - } - - /** - * Setter for disableMemoryRevisions. - * - *

disableMemoryRevisions: Optional. Input only. If true, no revision will be created for - * this request. - */ - @JsonProperty("disableMemoryRevisions") - public abstract Builder disableMemoryRevisions(boolean disableMemoryRevisions); - - @ExcludeFromGeneratedCoverageReport - abstract Builder disableMemoryRevisions(Optional disableMemoryRevisions); - - /** Clears the value of disableMemoryRevisions field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearDisableMemoryRevisions() { - return disableMemoryRevisions(Optional.empty()); - } - - /** - * Setter for topics. - * - *

topics: Optional. The topics of the memory. - */ - @JsonProperty("topics") - public abstract Builder topics(List topics); - - /** - * Setter for topics. - * - *

topics: Optional. The topics of the memory. - */ - @CanIgnoreReturnValue - public Builder topics(MemoryTopicId... topics) { - return topics(Arrays.asList(topics)); - } - - /** - * Setter for topics builder. - * - *

topics: Optional. The topics of the memory. - */ - @CanIgnoreReturnValue - public Builder topics(MemoryTopicId.Builder... topicsBuilders) { - return topics( - Arrays.asList(topicsBuilders).stream() - .map(MemoryTopicId.Builder::build) - .collect(toImmutableList())); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder topics(Optional> topics); - - /** Clears the value of topics field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearTopics() { - return topics(Optional.empty()); - } - - /** - * Setter for metadata. - * - *

metadata: Optional. User-provided metadata for the Memory. This information was provided - * when creating, updating, or generating the Memory. It was not generated by Memory Bank. - */ - @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 memoryId. - * - *

memoryId: Optional. The user defined ID to use for memory, which will become the final - * component of the memory resource name. If not provided, Vertex AI will generate a value for - * this ID. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`. The - * first character must be a letter, and the last character must be a letter or number. - */ - @JsonProperty("memoryId") - public abstract Builder memoryId(String memoryId); - - @ExcludeFromGeneratedCoverageReport - abstract Builder memoryId(Optional memoryId); - - /** Clears the value of memoryId field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearMemoryId() { - return memoryId(Optional.empty()); - } - - public abstract AgentEngineMemoryConfig build(); - } - - /** Deserializes a JSON string to a AgentEngineMemoryConfig object. */ - @ExcludeFromGeneratedCoverageReport - public static AgentEngineMemoryConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, AgentEngineMemoryConfig.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/AgentEngineMemoryOperation.java b/src/main/java/com/google/cloud/agentplatform/types/AgentEngineMemoryOperation.java deleted file mode 100644 index d2860bb..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/AgentEngineMemoryOperation.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - * 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 memory as a response. */ -@AutoValue -@JsonDeserialize(builder = AgentEngineMemoryOperation.Builder.class) -public abstract class AgentEngineMemoryOperation 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 Memory. */ - @JsonProperty("response") - public abstract Optional response(); - - /** Instantiates a builder for AgentEngineMemoryOperation. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_AgentEngineMemoryOperation.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for AgentEngineMemoryOperation. */ - @AutoValue.Builder - public abstract static class Builder { - /** For internal usage. Please use `AgentEngineMemoryOperation.builder()` for instantiation. */ - @JsonCreator - private static Builder create() { - return new AutoValue_AgentEngineMemoryOperation.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 Memory. - */ - @JsonProperty("response") - public abstract Builder response(Memory response); - - /** - * Setter for response builder. - * - *

response: The Agent Engine Memory. - */ - @CanIgnoreReturnValue - public Builder response(Memory.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 AgentEngineMemoryOperation build(); - } - - /** Deserializes a JSON string to a AgentEngineMemoryOperation object. */ - @ExcludeFromGeneratedCoverageReport - public static AgentEngineMemoryOperation fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, AgentEngineMemoryOperation.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/AgentEnginePurgeMemoriesOperation.java b/src/main/java/com/google/cloud/agentplatform/types/AgentEnginePurgeMemoriesOperation.java deleted file mode 100644 index a0a9324..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/AgentEnginePurgeMemoriesOperation.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * 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 purges memories from an agent engine. */ -@AutoValue -@JsonDeserialize(builder = AgentEnginePurgeMemoriesOperation.Builder.class) -public abstract class AgentEnginePurgeMemoriesOperation 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 response for purging memories. */ - @JsonProperty("response") - public abstract Optional response(); - - /** Instantiates a builder for AgentEnginePurgeMemoriesOperation. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_AgentEnginePurgeMemoriesOperation.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for AgentEnginePurgeMemoriesOperation. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `AgentEnginePurgeMemoriesOperation.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_AgentEnginePurgeMemoriesOperation.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 response for purging memories. - */ - @JsonProperty("response") - public abstract Builder response(PurgeMemoriesResponse response); - - /** - * Setter for response builder. - * - *

response: The response for purging memories. - */ - @CanIgnoreReturnValue - public Builder response(PurgeMemoriesResponse.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 AgentEnginePurgeMemoriesOperation build(); - } - - /** Deserializes a JSON string to a AgentEnginePurgeMemoriesOperation object. */ - @ExcludeFromGeneratedCoverageReport - public static AgentEnginePurgeMemoriesOperation fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, AgentEnginePurgeMemoriesOperation.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/AgentEngineRollbackMemoryOperation.java b/src/main/java/com/google/cloud/agentplatform/types/AgentEngineRollbackMemoryOperation.java deleted file mode 100644 index d776e16..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/AgentEngineRollbackMemoryOperation.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * 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 rolls back a memory. */ -@AutoValue -@JsonDeserialize(builder = AgentEngineRollbackMemoryOperation.Builder.class) -public abstract class AgentEngineRollbackMemoryOperation 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 AgentEngineRollbackMemoryOperation. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_AgentEngineRollbackMemoryOperation.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for AgentEngineRollbackMemoryOperation. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `AgentEngineRollbackMemoryOperation.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_AgentEngineRollbackMemoryOperation.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 AgentEngineRollbackMemoryOperation build(); - } - - /** Deserializes a JSON string to a AgentEngineRollbackMemoryOperation object. */ - @ExcludeFromGeneratedCoverageReport - public static AgentEngineRollbackMemoryOperation fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, AgentEngineRollbackMemoryOperation.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/CreateAgentEngineMemoryRequestParameters.java b/src/main/java/com/google/cloud/agentplatform/types/CreateAgentEngineMemoryRequestParameters.java deleted file mode 100644 index 9e21daf..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/CreateAgentEngineMemoryRequestParameters.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * 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.Map; -import java.util.Optional; - -/** Parameters for creating Agent Engine Memories. */ -@AutoValue -@InternalApi -@JsonDeserialize(builder = CreateAgentEngineMemoryRequestParameters.Builder.class) -public abstract class CreateAgentEngineMemoryRequestParameters extends JsonSerializable { - /** Name of the agent engine to create the memory under. */ - @JsonProperty("name") - public abstract Optional name(); - - /** - * The fact of the memory. - * - *

This is the semantic knowledge extracted from the source content). - */ - @JsonProperty("fact") - public abstract Optional fact(); - - /** - * The scope of the memory. - * - *

Memories are isolated within their scope. The scope is defined when creating or generating - * memories. Up to 5 key-value pairs are accepted, and scope values cannot contain the wildcard - * character '*'. - */ - @JsonProperty("scope") - public abstract Optional> scope(); - - /** */ - @JsonProperty("config") - public abstract Optional config(); - - /** Instantiates a builder for CreateAgentEngineMemoryRequestParameters. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_CreateAgentEngineMemoryRequestParameters.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for CreateAgentEngineMemoryRequestParameters. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `CreateAgentEngineMemoryRequestParameters.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_CreateAgentEngineMemoryRequestParameters.Builder(); - } - - /** - * Setter for name. - * - *

name: Name of the agent engine to create the memory 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 fact. - * - *

fact: The fact of the memory. - * - *

This is the semantic knowledge extracted from the source content). - */ - @JsonProperty("fact") - public abstract Builder fact(String fact); - - @ExcludeFromGeneratedCoverageReport - abstract Builder fact(Optional fact); - - /** Clears the value of fact field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearFact() { - return fact(Optional.empty()); - } - - /** - * Setter for scope. - * - *

scope: The scope of the memory. - * - *

Memories are isolated within their scope. The scope is defined when creating or generating - * memories. Up to 5 key-value pairs are accepted, and scope values cannot contain the wildcard - * character '*'. - */ - @JsonProperty("scope") - public abstract Builder scope(Map scope); - - @ExcludeFromGeneratedCoverageReport - abstract Builder scope(Optional> scope); - - /** Clears the value of scope field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearScope() { - return scope(Optional.empty()); - } - - /** - * Setter for config. - * - *

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

config: - */ - @CanIgnoreReturnValue - public Builder config(AgentEngineMemoryConfig.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 CreateAgentEngineMemoryRequestParameters build(); - } - - /** Deserializes a JSON string to a CreateAgentEngineMemoryRequestParameters object. */ - @ExcludeFromGeneratedCoverageReport - public static CreateAgentEngineMemoryRequestParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, CreateAgentEngineMemoryRequestParameters.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/DeleteAgentEngineMemoryConfig.java b/src/main/java/com/google/cloud/agentplatform/types/DeleteAgentEngineMemoryConfig.java deleted file mode 100644 index 07ae6d3..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/DeleteAgentEngineMemoryConfig.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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 an Agent Engine Memory. */ -@AutoValue -@JsonDeserialize(builder = DeleteAgentEngineMemoryConfig.Builder.class) -public abstract class DeleteAgentEngineMemoryConfig extends JsonSerializable { - /** Used to override HTTP request options. */ - @JsonProperty("httpOptions") - public abstract Optional httpOptions(); - - /** Instantiates a builder for DeleteAgentEngineMemoryConfig. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_DeleteAgentEngineMemoryConfig.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for DeleteAgentEngineMemoryConfig. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `DeleteAgentEngineMemoryConfig.builder()` for instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_DeleteAgentEngineMemoryConfig.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 DeleteAgentEngineMemoryConfig build(); - } - - /** Deserializes a JSON string to a DeleteAgentEngineMemoryConfig object. */ - @ExcludeFromGeneratedCoverageReport - public static DeleteAgentEngineMemoryConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DeleteAgentEngineMemoryConfig.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/DeleteAgentEngineMemoryOperation.java b/src/main/java/com/google/cloud/agentplatform/types/DeleteAgentEngineMemoryOperation.java deleted file mode 100644 index f256ae9..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/DeleteAgentEngineMemoryOperation.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * 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 agent engines. */ -@AutoValue -@JsonDeserialize(builder = DeleteAgentEngineMemoryOperation.Builder.class) -public abstract class DeleteAgentEngineMemoryOperation 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 DeleteAgentEngineMemoryOperation. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_DeleteAgentEngineMemoryOperation.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for DeleteAgentEngineMemoryOperation. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `DeleteAgentEngineMemoryOperation.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_DeleteAgentEngineMemoryOperation.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 DeleteAgentEngineMemoryOperation build(); - } - - /** Deserializes a JSON string to a DeleteAgentEngineMemoryOperation object. */ - @ExcludeFromGeneratedCoverageReport - public static DeleteAgentEngineMemoryOperation fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DeleteAgentEngineMemoryOperation.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/DeleteAgentEngineMemoryRequestParameters.java b/src/main/java/com/google/cloud/agentplatform/types/DeleteAgentEngineMemoryRequestParameters.java deleted file mode 100644 index 6866246..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/DeleteAgentEngineMemoryRequestParameters.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * 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 agent engines. */ -@AutoValue -@InternalApi -@JsonDeserialize(builder = DeleteAgentEngineMemoryRequestParameters.Builder.class) -public abstract class DeleteAgentEngineMemoryRequestParameters extends JsonSerializable { - /** Name of the agent engine memory to delete. */ - @JsonProperty("name") - public abstract Optional name(); - - /** */ - @JsonProperty("config") - public abstract Optional config(); - - /** Instantiates a builder for DeleteAgentEngineMemoryRequestParameters. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_DeleteAgentEngineMemoryRequestParameters.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for DeleteAgentEngineMemoryRequestParameters. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `DeleteAgentEngineMemoryRequestParameters.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_DeleteAgentEngineMemoryRequestParameters.Builder(); - } - - /** - * Setter for name. - * - *

name: Name of the agent engine memory 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(DeleteAgentEngineMemoryConfig config); - - /** - * Setter for config builder. - * - *

config: - */ - @CanIgnoreReturnValue - public Builder config(DeleteAgentEngineMemoryConfig.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 DeleteAgentEngineMemoryRequestParameters build(); - } - - /** Deserializes a JSON string to a DeleteAgentEngineMemoryRequestParameters object. */ - @ExcludeFromGeneratedCoverageReport - public static DeleteAgentEngineMemoryRequestParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, DeleteAgentEngineMemoryRequestParameters.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/GenerateAgentEngineMemoriesConfig.java b/src/main/java/com/google/cloud/agentplatform/types/GenerateAgentEngineMemoriesConfig.java deleted file mode 100644 index dc2624b..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/GenerateAgentEngineMemoriesConfig.java +++ /dev/null @@ -1,362 +0,0 @@ -/* - * 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.HttpOptions; -import java.time.Duration; -import java.time.Instant; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.Optional; - -/** Config for generating memories. */ -@AutoValue -@JsonDeserialize(builder = GenerateAgentEngineMemoriesConfig.Builder.class) -public abstract class GenerateAgentEngineMemoriesConfig extends JsonSerializable { - /** Used to override HTTP request options. */ - @JsonProperty("httpOptions") - public abstract Optional httpOptions(); - - /** - * Whether to disable consolidation of memories. - * - *

If true, generated memories will not be consolidated with existing memories; all generated - * memories will be added as new memories regardless of whether they are duplicates of or - * contradictory to existing memories. By default, memory consolidation is enabled. - */ - @JsonProperty("disableConsolidation") - public abstract Optional disableConsolidation(); - - /** Waits for the operation to complete before returning. */ - @JsonProperty("waitForCompletion") - public abstract Optional waitForCompletion(); - - /** - * Labels to apply to the memory revision. For example, you can use this to label a revision with - * its data source. - */ - @JsonProperty("revisionLabels") - public abstract Optional> revisionLabels(); - - /** - * Optional. Input only. Timestamp of when the revision is considered expired. If not set, the - * memory revision will be kept until manually deleted. - */ - @JsonProperty("revisionExpireTime") - public abstract Optional revisionExpireTime(); - - /** Optional. Input only. The TTL for the revision. The expiration time is computed: now + TTL. */ - @JsonProperty("revisionTtl") - public abstract Optional revisionTtl(); - - /** Optional. Input only. If true, no revisions will be created for this request. */ - @JsonProperty("disableMemoryRevisions") - public abstract Optional disableMemoryRevisions(); - - /** - * Optional. User-provided metadata for the generated memories. This is not generated by Memory - * Bank. - */ - @JsonProperty("metadata") - public abstract Optional> metadata(); - - /** Optional. The strategy to use when applying metadata to existing memories. */ - @JsonProperty("metadataMergeStrategy") - public abstract Optional metadataMergeStrategy(); - - /** Optional. Restricts memory generation to a subset of memory topics. */ - @JsonProperty("allowedTopics") - public abstract Optional> allowedTopics(); - - /** Instantiates a builder for GenerateAgentEngineMemoriesConfig. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_GenerateAgentEngineMemoriesConfig.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for GenerateAgentEngineMemoriesConfig. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `GenerateAgentEngineMemoriesConfig.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_GenerateAgentEngineMemoriesConfig.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 disableConsolidation. - * - *

disableConsolidation: Whether to disable consolidation of memories. - * - *

If true, generated memories will not be consolidated with existing memories; all generated - * memories will be added as new memories regardless of whether they are duplicates of or - * contradictory to existing memories. By default, memory consolidation is enabled. - */ - @JsonProperty("disableConsolidation") - public abstract Builder disableConsolidation(boolean disableConsolidation); - - @ExcludeFromGeneratedCoverageReport - abstract Builder disableConsolidation(Optional disableConsolidation); - - /** Clears the value of disableConsolidation field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearDisableConsolidation() { - return disableConsolidation(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()); - } - - /** - * Setter for revisionLabels. - * - *

revisionLabels: Labels to apply to the memory revision. For example, you can use this to - * label a revision with its data source. - */ - @JsonProperty("revisionLabels") - public abstract Builder revisionLabels(Map revisionLabels); - - @ExcludeFromGeneratedCoverageReport - abstract Builder revisionLabels(Optional> revisionLabels); - - /** Clears the value of revisionLabels field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearRevisionLabels() { - return revisionLabels(Optional.empty()); - } - - /** - * Setter for revisionExpireTime. - * - *

revisionExpireTime: Optional. Input only. Timestamp of when the revision is considered - * expired. If not set, the memory revision will be kept until manually deleted. - */ - @JsonProperty("revisionExpireTime") - public abstract Builder revisionExpireTime(Instant revisionExpireTime); - - @ExcludeFromGeneratedCoverageReport - abstract Builder revisionExpireTime(Optional revisionExpireTime); - - /** Clears the value of revisionExpireTime field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearRevisionExpireTime() { - return revisionExpireTime(Optional.empty()); - } - - /** - * Setter for revisionTtl. - * - *

revisionTtl: Optional. Input only. The TTL for the revision. The expiration time is - * computed: now + TTL. - */ - @JsonProperty("revisionTtl") - public abstract Builder revisionTtl(Duration revisionTtl); - - @ExcludeFromGeneratedCoverageReport - abstract Builder revisionTtl(Optional revisionTtl); - - /** Clears the value of revisionTtl field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearRevisionTtl() { - return revisionTtl(Optional.empty()); - } - - /** - * Setter for disableMemoryRevisions. - * - *

disableMemoryRevisions: Optional. Input only. If true, no revisions will be created for - * this request. - */ - @JsonProperty("disableMemoryRevisions") - public abstract Builder disableMemoryRevisions(boolean disableMemoryRevisions); - - @ExcludeFromGeneratedCoverageReport - abstract Builder disableMemoryRevisions(Optional disableMemoryRevisions); - - /** Clears the value of disableMemoryRevisions field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearDisableMemoryRevisions() { - return disableMemoryRevisions(Optional.empty()); - } - - /** - * Setter for metadata. - * - *

metadata: Optional. User-provided metadata for the generated memories. This is not - * generated by Memory Bank. - */ - @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 metadataMergeStrategy. - * - *

metadataMergeStrategy: Optional. The strategy to use when applying metadata to existing - * memories. - */ - @JsonProperty("metadataMergeStrategy") - public abstract Builder metadataMergeStrategy( - MemoryMetadataMergeStrategy metadataMergeStrategy); - - @ExcludeFromGeneratedCoverageReport - abstract Builder metadataMergeStrategy( - Optional metadataMergeStrategy); - - /** Clears the value of metadataMergeStrategy field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearMetadataMergeStrategy() { - return metadataMergeStrategy(Optional.empty()); - } - - /** - * Setter for metadataMergeStrategy given a known enum. - * - *

metadataMergeStrategy: Optional. The strategy to use when applying metadata to existing - * memories. - */ - @CanIgnoreReturnValue - public Builder metadataMergeStrategy(MemoryMetadataMergeStrategy.Known knownType) { - return metadataMergeStrategy(new MemoryMetadataMergeStrategy(knownType)); - } - - /** - * Setter for metadataMergeStrategy given a string. - * - *

metadataMergeStrategy: Optional. The strategy to use when applying metadata to existing - * memories. - */ - @CanIgnoreReturnValue - public Builder metadataMergeStrategy(String metadataMergeStrategy) { - return metadataMergeStrategy(new MemoryMetadataMergeStrategy(metadataMergeStrategy)); - } - - /** - * Setter for allowedTopics. - * - *

allowedTopics: Optional. Restricts memory generation to a subset of memory topics. - */ - @JsonProperty("allowedTopics") - public abstract Builder allowedTopics(List allowedTopics); - - /** - * Setter for allowedTopics. - * - *

allowedTopics: Optional. Restricts memory generation to a subset of memory topics. - */ - @CanIgnoreReturnValue - public Builder allowedTopics(MemoryTopicId... allowedTopics) { - return allowedTopics(Arrays.asList(allowedTopics)); - } - - /** - * Setter for allowedTopics builder. - * - *

allowedTopics: Optional. Restricts memory generation to a subset of memory topics. - */ - @CanIgnoreReturnValue - public Builder allowedTopics(MemoryTopicId.Builder... allowedTopicsBuilders) { - return allowedTopics( - Arrays.asList(allowedTopicsBuilders).stream() - .map(MemoryTopicId.Builder::build) - .collect(toImmutableList())); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder allowedTopics(Optional> allowedTopics); - - /** Clears the value of allowedTopics field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearAllowedTopics() { - return allowedTopics(Optional.empty()); - } - - public abstract GenerateAgentEngineMemoriesConfig build(); - } - - /** Deserializes a JSON string to a GenerateAgentEngineMemoriesConfig object. */ - @ExcludeFromGeneratedCoverageReport - public static GenerateAgentEngineMemoriesConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GenerateAgentEngineMemoriesConfig.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/GenerateAgentEngineMemoriesRequestParameters.java b/src/main/java/com/google/cloud/agentplatform/types/GenerateAgentEngineMemoriesRequestParameters.java deleted file mode 100644 index f32c4de..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/GenerateAgentEngineMemoriesRequestParameters.java +++ /dev/null @@ -1,257 +0,0 @@ -/* - * 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.Map; -import java.util.Optional; - -/** Parameters for generating agent engine memories. */ -@AutoValue -@InternalApi -@JsonDeserialize(builder = GenerateAgentEngineMemoriesRequestParameters.Builder.class) -public abstract class GenerateAgentEngineMemoriesRequestParameters extends JsonSerializable { - /** Name of the agent engine to generate memories for. */ - @JsonProperty("name") - public abstract Optional name(); - - /** The vertex session source of the memories that should be generated. */ - @JsonProperty("vertexSessionSource") - public abstract Optional vertexSessionSource(); - - /** The direct contents source of the memories that should be generated. */ - @JsonProperty("directContentsSource") - public abstract Optional directContentsSource(); - - /** The direct memories source of the memories that should be generated. */ - @JsonProperty("directMemoriesSource") - public abstract Optional directMemoriesSource(); - - /** - * The scope of the memories that should be generated. - * - *

Memories will be consolidated across memories with the same scope. Must be provided unless - * the scope is defined in the source content. If `scope` is provided, it will override the scope - * defined in the source content. Scope values cannot contain the wildcard character '*'. - */ - @JsonProperty("scope") - public abstract Optional> scope(); - - /** */ - @JsonProperty("config") - public abstract Optional config(); - - /** Instantiates a builder for GenerateAgentEngineMemoriesRequestParameters. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_GenerateAgentEngineMemoriesRequestParameters.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for GenerateAgentEngineMemoriesRequestParameters. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `GenerateAgentEngineMemoriesRequestParameters.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_GenerateAgentEngineMemoriesRequestParameters.Builder(); - } - - /** - * Setter for name. - * - *

name: Name of the agent engine to generate memories for. - */ - @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 vertexSessionSource. - * - *

vertexSessionSource: The vertex session source of the memories that should be generated. - */ - @JsonProperty("vertexSessionSource") - public abstract Builder vertexSessionSource( - GenerateMemoriesRequestVertexSessionSource vertexSessionSource); - - /** - * Setter for vertexSessionSource builder. - * - *

vertexSessionSource: The vertex session source of the memories that should be generated. - */ - @CanIgnoreReturnValue - public Builder vertexSessionSource( - GenerateMemoriesRequestVertexSessionSource.Builder vertexSessionSourceBuilder) { - return vertexSessionSource(vertexSessionSourceBuilder.build()); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder vertexSessionSource( - Optional vertexSessionSource); - - /** Clears the value of vertexSessionSource field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearVertexSessionSource() { - return vertexSessionSource(Optional.empty()); - } - - /** - * Setter for directContentsSource. - * - *

directContentsSource: The direct contents source of the memories that should be generated. - */ - @JsonProperty("directContentsSource") - public abstract Builder directContentsSource( - GenerateMemoriesRequestDirectContentsSource directContentsSource); - - /** - * Setter for directContentsSource builder. - * - *

directContentsSource: The direct contents source of the memories that should be generated. - */ - @CanIgnoreReturnValue - public Builder directContentsSource( - GenerateMemoriesRequestDirectContentsSource.Builder directContentsSourceBuilder) { - return directContentsSource(directContentsSourceBuilder.build()); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder directContentsSource( - Optional directContentsSource); - - /** Clears the value of directContentsSource field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearDirectContentsSource() { - return directContentsSource(Optional.empty()); - } - - /** - * Setter for directMemoriesSource. - * - *

directMemoriesSource: The direct memories source of the memories that should be generated. - */ - @JsonProperty("directMemoriesSource") - public abstract Builder directMemoriesSource( - GenerateMemoriesRequestDirectMemoriesSource directMemoriesSource); - - /** - * Setter for directMemoriesSource builder. - * - *

directMemoriesSource: The direct memories source of the memories that should be generated. - */ - @CanIgnoreReturnValue - public Builder directMemoriesSource( - GenerateMemoriesRequestDirectMemoriesSource.Builder directMemoriesSourceBuilder) { - return directMemoriesSource(directMemoriesSourceBuilder.build()); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder directMemoriesSource( - Optional directMemoriesSource); - - /** Clears the value of directMemoriesSource field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearDirectMemoriesSource() { - return directMemoriesSource(Optional.empty()); - } - - /** - * Setter for scope. - * - *

scope: The scope of the memories that should be generated. - * - *

Memories will be consolidated across memories with the same scope. Must be provided unless - * the scope is defined in the source content. If `scope` is provided, it will override the - * scope defined in the source content. Scope values cannot contain the wildcard character '*'. - */ - @JsonProperty("scope") - public abstract Builder scope(Map scope); - - @ExcludeFromGeneratedCoverageReport - abstract Builder scope(Optional> scope); - - /** Clears the value of scope field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearScope() { - return scope(Optional.empty()); - } - - /** - * Setter for config. - * - *

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

config: - */ - @CanIgnoreReturnValue - public Builder config(GenerateAgentEngineMemoriesConfig.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 GenerateAgentEngineMemoriesRequestParameters build(); - } - - /** Deserializes a JSON string to a GenerateAgentEngineMemoriesRequestParameters object. */ - @ExcludeFromGeneratedCoverageReport - public static GenerateAgentEngineMemoriesRequestParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, GenerateAgentEngineMemoriesRequestParameters.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesRequestDirectContentsSource.java b/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesRequestDirectContentsSource.java deleted file mode 100644 index aca6b21..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesRequestDirectContentsSource.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * 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 direct contents source for generating memories. */ -@AutoValue -@JsonDeserialize(builder = GenerateMemoriesRequestDirectContentsSource.Builder.class) -public abstract class GenerateMemoriesRequestDirectContentsSource extends JsonSerializable { - /** Required. The source content (i.e. chat history) to generate memories from. */ - @JsonProperty("events") - public abstract Optional> events(); - - /** Instantiates a builder for GenerateMemoriesRequestDirectContentsSource. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_GenerateMemoriesRequestDirectContentsSource.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for GenerateMemoriesRequestDirectContentsSource. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `GenerateMemoriesRequestDirectContentsSource.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_GenerateMemoriesRequestDirectContentsSource.Builder(); - } - - /** - * Setter for events. - * - *

events: Required. The source content (i.e. chat history) to generate memories from. - */ - @JsonProperty("events") - public abstract Builder events(List events); - - /** - * Setter for events. - * - *

events: Required. The source content (i.e. chat history) to generate memories from. - */ - @CanIgnoreReturnValue - public Builder events(GenerateMemoriesRequestDirectContentsSourceEvent... events) { - return events(Arrays.asList(events)); - } - - /** - * Setter for events builder. - * - *

events: Required. The source content (i.e. chat history) to generate memories from. - */ - @CanIgnoreReturnValue - public Builder events( - GenerateMemoriesRequestDirectContentsSourceEvent.Builder... eventsBuilders) { - return events( - Arrays.asList(eventsBuilders).stream() - .map(GenerateMemoriesRequestDirectContentsSourceEvent.Builder::build) - .collect(toImmutableList())); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder events( - Optional> events); - - /** Clears the value of events field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearEvents() { - return events(Optional.empty()); - } - - public abstract GenerateMemoriesRequestDirectContentsSource build(); - } - - /** Deserializes a JSON string to a GenerateMemoriesRequestDirectContentsSource object. */ - @ExcludeFromGeneratedCoverageReport - public static GenerateMemoriesRequestDirectContentsSource fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, GenerateMemoriesRequestDirectContentsSource.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesRequestDirectContentsSourceEvent.java b/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesRequestDirectContentsSourceEvent.java deleted file mode 100644 index b388b3d..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesRequestDirectContentsSourceEvent.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * 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.Content; -import java.util.Optional; - -/** */ -@AutoValue -@JsonDeserialize(builder = GenerateMemoriesRequestDirectContentsSourceEvent.Builder.class) -public abstract class GenerateMemoriesRequestDirectContentsSourceEvent extends JsonSerializable { - /** Required. A single piece of content from which to generate memories. */ - @JsonProperty("content") - public abstract Optional content(); - - /** Instantiates a builder for GenerateMemoriesRequestDirectContentsSourceEvent. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_GenerateMemoriesRequestDirectContentsSourceEvent.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for GenerateMemoriesRequestDirectContentsSourceEvent. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `GenerateMemoriesRequestDirectContentsSourceEvent.builder()` - * for instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_GenerateMemoriesRequestDirectContentsSourceEvent.Builder(); - } - - /** - * Setter for content. - * - *

content: Required. A single piece of content from which to generate memories. - */ - @JsonProperty("content") - public abstract Builder content(Content content); - - @ExcludeFromGeneratedCoverageReport - abstract Builder content(Optional content); - - /** Clears the value of content field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearContent() { - return content(Optional.empty()); - } - - public abstract GenerateMemoriesRequestDirectContentsSourceEvent build(); - } - - /** Deserializes a JSON string to a GenerateMemoriesRequestDirectContentsSourceEvent object. */ - @ExcludeFromGeneratedCoverageReport - public static GenerateMemoriesRequestDirectContentsSourceEvent fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, GenerateMemoriesRequestDirectContentsSourceEvent.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesRequestDirectMemoriesSource.java b/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesRequestDirectMemoriesSource.java deleted file mode 100644 index 72ea4ed..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesRequestDirectMemoriesSource.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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 direct memories source for generating memories. */ -@AutoValue -@JsonDeserialize(builder = GenerateMemoriesRequestDirectMemoriesSource.Builder.class) -public abstract class GenerateMemoriesRequestDirectMemoriesSource extends JsonSerializable { - /** - * Required. The direct memories to upload to Memory Bank. At most 5 direct memories are allowed - * per request. - */ - @JsonProperty("directMemories") - public abstract Optional> - directMemories(); - - /** Instantiates a builder for GenerateMemoriesRequestDirectMemoriesSource. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_GenerateMemoriesRequestDirectMemoriesSource.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for GenerateMemoriesRequestDirectMemoriesSource. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `GenerateMemoriesRequestDirectMemoriesSource.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_GenerateMemoriesRequestDirectMemoriesSource.Builder(); - } - - /** - * Setter for directMemories. - * - *

directMemories: Required. The direct memories to upload to Memory Bank. At most 5 direct - * memories are allowed per request. - */ - @JsonProperty("directMemories") - public abstract Builder directMemories( - List directMemories); - - /** - * Setter for directMemories. - * - *

directMemories: Required. The direct memories to upload to Memory Bank. At most 5 direct - * memories are allowed per request. - */ - @CanIgnoreReturnValue - public Builder directMemories( - GenerateMemoriesRequestDirectMemoriesSourceDirectMemory... directMemories) { - return directMemories(Arrays.asList(directMemories)); - } - - /** - * Setter for directMemories builder. - * - *

directMemories: Required. The direct memories to upload to Memory Bank. At most 5 direct - * memories are allowed per request. - */ - @CanIgnoreReturnValue - public Builder directMemories( - GenerateMemoriesRequestDirectMemoriesSourceDirectMemory.Builder... directMemoriesBuilders) { - return directMemories( - Arrays.asList(directMemoriesBuilders).stream() - .map(GenerateMemoriesRequestDirectMemoriesSourceDirectMemory.Builder::build) - .collect(toImmutableList())); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder directMemories( - Optional> directMemories); - - /** Clears the value of directMemories field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearDirectMemories() { - return directMemories(Optional.empty()); - } - - public abstract GenerateMemoriesRequestDirectMemoriesSource build(); - } - - /** Deserializes a JSON string to a GenerateMemoriesRequestDirectMemoriesSource object. */ - @ExcludeFromGeneratedCoverageReport - public static GenerateMemoriesRequestDirectMemoriesSource fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, GenerateMemoriesRequestDirectMemoriesSource.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesRequestDirectMemoriesSourceDirectMemory.java b/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesRequestDirectMemoriesSourceDirectMemory.java deleted file mode 100644 index 216e212..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesRequestDirectMemoriesSourceDirectMemory.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * 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; - -/** A direct memory to upload to Memory Bank. */ -@AutoValue -@JsonDeserialize(builder = GenerateMemoriesRequestDirectMemoriesSourceDirectMemory.Builder.class) -public abstract class GenerateMemoriesRequestDirectMemoriesSourceDirectMemory - extends JsonSerializable { - /** Required. The fact to consolidate with existing memories. */ - @JsonProperty("fact") - public abstract Optional fact(); - - /** Optional. The topics that the consolidated memories should be associated with. */ - @JsonProperty("topics") - public abstract Optional> topics(); - - /** Instantiates a builder for GenerateMemoriesRequestDirectMemoriesSourceDirectMemory. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_GenerateMemoriesRequestDirectMemoriesSourceDirectMemory.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for GenerateMemoriesRequestDirectMemoriesSourceDirectMemory. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use - * `GenerateMemoriesRequestDirectMemoriesSourceDirectMemory.builder()` for instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_GenerateMemoriesRequestDirectMemoriesSourceDirectMemory.Builder(); - } - - /** - * Setter for fact. - * - *

fact: Required. The fact to consolidate with existing memories. - */ - @JsonProperty("fact") - public abstract Builder fact(String fact); - - @ExcludeFromGeneratedCoverageReport - abstract Builder fact(Optional fact); - - /** Clears the value of fact field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearFact() { - return fact(Optional.empty()); - } - - /** - * Setter for topics. - * - *

topics: Optional. The topics that the consolidated memories should be associated with. - */ - @JsonProperty("topics") - public abstract Builder topics(List topics); - - /** - * Setter for topics. - * - *

topics: Optional. The topics that the consolidated memories should be associated with. - */ - @CanIgnoreReturnValue - public Builder topics(MemoryTopicId... topics) { - return topics(Arrays.asList(topics)); - } - - /** - * Setter for topics builder. - * - *

topics: Optional. The topics that the consolidated memories should be associated with. - */ - @CanIgnoreReturnValue - public Builder topics(MemoryTopicId.Builder... topicsBuilders) { - return topics( - Arrays.asList(topicsBuilders).stream() - .map(MemoryTopicId.Builder::build) - .collect(toImmutableList())); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder topics(Optional> topics); - - /** Clears the value of topics field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearTopics() { - return topics(Optional.empty()); - } - - public abstract GenerateMemoriesRequestDirectMemoriesSourceDirectMemory build(); - } - - /** - * Deserializes a JSON string to a GenerateMemoriesRequestDirectMemoriesSourceDirectMemory object. - */ - @ExcludeFromGeneratedCoverageReport - public static GenerateMemoriesRequestDirectMemoriesSourceDirectMemory fromJson( - String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, GenerateMemoriesRequestDirectMemoriesSourceDirectMemory.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesRequestVertexSessionSource.java b/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesRequestVertexSessionSource.java deleted file mode 100644 index 08ce666..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesRequestVertexSessionSource.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * 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; - -/** The vertex session source for generating memories. */ -@AutoValue -@JsonDeserialize(builder = GenerateMemoriesRequestVertexSessionSource.Builder.class) -public abstract class GenerateMemoriesRequestVertexSessionSource extends JsonSerializable { - /** Optional. End time (exclusive) of the time range. If not set, the end time is unbounded. */ - @JsonProperty("endTime") - public abstract Optional endTime(); - - /** - * Required. The resource name of the Session to generate memories for. Format: - * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` - */ - @JsonProperty("session") - public abstract Optional session(); - - /** - * Optional. Time range to define which session events should be used to generate memories. Start - * time (inclusive) of the time range. If not set, the start time is unbounded. - */ - @JsonProperty("startTime") - public abstract Optional startTime(); - - /** Instantiates a builder for GenerateMemoriesRequestVertexSessionSource. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_GenerateMemoriesRequestVertexSessionSource.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for GenerateMemoriesRequestVertexSessionSource. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `GenerateMemoriesRequestVertexSessionSource.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_GenerateMemoriesRequestVertexSessionSource.Builder(); - } - - /** - * Setter for endTime. - * - *

endTime: Optional. End time (exclusive) of the time range. If not set, the end time is - * unbounded. - */ - @JsonProperty("endTime") - public abstract Builder endTime(Instant endTime); - - @ExcludeFromGeneratedCoverageReport - abstract Builder endTime(Optional endTime); - - /** Clears the value of endTime field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearEndTime() { - return endTime(Optional.empty()); - } - - /** - * Setter for session. - * - *

session: Required. The resource name of the Session to generate memories for. Format: - * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` - */ - @JsonProperty("session") - public abstract Builder session(String session); - - @ExcludeFromGeneratedCoverageReport - abstract Builder session(Optional session); - - /** Clears the value of session field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearSession() { - return session(Optional.empty()); - } - - /** - * Setter for startTime. - * - *

startTime: Optional. Time range to define which session events should be used to generate - * memories. Start time (inclusive) of the time range. If not set, the start time is unbounded. - */ - @JsonProperty("startTime") - public abstract Builder startTime(Instant startTime); - - @ExcludeFromGeneratedCoverageReport - abstract Builder startTime(Optional startTime); - - /** Clears the value of startTime field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearStartTime() { - return startTime(Optional.empty()); - } - - public abstract GenerateMemoriesRequestVertexSessionSource build(); - } - - /** Deserializes a JSON string to a GenerateMemoriesRequestVertexSessionSource object. */ - @ExcludeFromGeneratedCoverageReport - public static GenerateMemoriesRequestVertexSessionSource fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, GenerateMemoriesRequestVertexSessionSource.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesResponse.java b/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesResponse.java deleted file mode 100644 index 59892a5..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesResponse.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * 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 response for generating memories. */ -@AutoValue -@JsonDeserialize(builder = GenerateMemoriesResponse.Builder.class) -public abstract class GenerateMemoriesResponse extends JsonSerializable { - /** The generated memories. */ - @JsonProperty("generatedMemories") - public abstract Optional> generatedMemories(); - - /** Instantiates a builder for GenerateMemoriesResponse. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_GenerateMemoriesResponse.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for GenerateMemoriesResponse. */ - @AutoValue.Builder - public abstract static class Builder { - /** For internal usage. Please use `GenerateMemoriesResponse.builder()` for instantiation. */ - @JsonCreator - private static Builder create() { - return new AutoValue_GenerateMemoriesResponse.Builder(); - } - - /** - * Setter for generatedMemories. - * - *

generatedMemories: The generated memories. - */ - @JsonProperty("generatedMemories") - public abstract Builder generatedMemories( - List generatedMemories); - - /** - * Setter for generatedMemories. - * - *

generatedMemories: The generated memories. - */ - @CanIgnoreReturnValue - public Builder generatedMemories(GenerateMemoriesResponseGeneratedMemory... generatedMemories) { - return generatedMemories(Arrays.asList(generatedMemories)); - } - - /** - * Setter for generatedMemories builder. - * - *

generatedMemories: The generated memories. - */ - @CanIgnoreReturnValue - public Builder generatedMemories( - GenerateMemoriesResponseGeneratedMemory.Builder... generatedMemoriesBuilders) { - return generatedMemories( - Arrays.asList(generatedMemoriesBuilders).stream() - .map(GenerateMemoriesResponseGeneratedMemory.Builder::build) - .collect(toImmutableList())); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder generatedMemories( - Optional> generatedMemories); - - /** Clears the value of generatedMemories field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearGeneratedMemories() { - return generatedMemories(Optional.empty()); - } - - public abstract GenerateMemoriesResponse build(); - } - - /** Deserializes a JSON string to a GenerateMemoriesResponse object. */ - @ExcludeFromGeneratedCoverageReport - public static GenerateMemoriesResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GenerateMemoriesResponse.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesResponseGeneratedMemory.java b/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesResponseGeneratedMemory.java deleted file mode 100644 index c717350..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesResponseGeneratedMemory.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * 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; - -/** A memory that was generated. */ -@AutoValue -@JsonDeserialize(builder = GenerateMemoriesResponseGeneratedMemory.Builder.class) -public abstract class GenerateMemoriesResponseGeneratedMemory extends JsonSerializable { - /** The generated memory. */ - @JsonProperty("memory") - public abstract Optional memory(); - - /** The action to take. */ - @JsonProperty("action") - public abstract Optional action(); - - /** - * The previous revision of the Memory before the action was performed. This field is only set if - * the action is `UPDATED` or `DELETED`. You can use this to rollback the Memory to the previous - * revision, undoing the action. Format: - * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/memories/{memory}/revisions/{revision}` - */ - @JsonProperty("previousRevision") - public abstract Optional previousRevision(); - - /** Instantiates a builder for GenerateMemoriesResponseGeneratedMemory. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_GenerateMemoriesResponseGeneratedMemory.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for GenerateMemoriesResponseGeneratedMemory. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `GenerateMemoriesResponseGeneratedMemory.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_GenerateMemoriesResponseGeneratedMemory.Builder(); - } - - /** - * Setter for memory. - * - *

memory: The generated memory. - */ - @JsonProperty("memory") - public abstract Builder memory(Memory memory); - - /** - * Setter for memory builder. - * - *

memory: The generated memory. - */ - @CanIgnoreReturnValue - public Builder memory(Memory.Builder memoryBuilder) { - return memory(memoryBuilder.build()); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder memory(Optional memory); - - /** Clears the value of memory field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearMemory() { - return memory(Optional.empty()); - } - - /** - * Setter for action. - * - *

action: The action to take. - */ - @JsonProperty("action") - public abstract Builder action(GenerateMemoriesResponseGeneratedMemoryAction action); - - @ExcludeFromGeneratedCoverageReport - abstract Builder action(Optional action); - - /** Clears the value of action field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearAction() { - return action(Optional.empty()); - } - - /** - * Setter for action given a known enum. - * - *

action: The action to take. - */ - @CanIgnoreReturnValue - public Builder action(GenerateMemoriesResponseGeneratedMemoryAction.Known knownType) { - return action(new GenerateMemoriesResponseGeneratedMemoryAction(knownType)); - } - - /** - * Setter for action given a string. - * - *

action: The action to take. - */ - @CanIgnoreReturnValue - public Builder action(String action) { - return action(new GenerateMemoriesResponseGeneratedMemoryAction(action)); - } - - /** - * Setter for previousRevision. - * - *

previousRevision: The previous revision of the Memory before the action was performed. - * This field is only set if the action is `UPDATED` or `DELETED`. You can use this to rollback - * the Memory to the previous revision, undoing the action. Format: - * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/memories/{memory}/revisions/{revision}` - */ - @JsonProperty("previousRevision") - public abstract Builder previousRevision(String previousRevision); - - @ExcludeFromGeneratedCoverageReport - abstract Builder previousRevision(Optional previousRevision); - - /** Clears the value of previousRevision field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearPreviousRevision() { - return previousRevision(Optional.empty()); - } - - public abstract GenerateMemoriesResponseGeneratedMemory build(); - } - - /** Deserializes a JSON string to a GenerateMemoriesResponseGeneratedMemory object. */ - @ExcludeFromGeneratedCoverageReport - public static GenerateMemoriesResponseGeneratedMemory fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, GenerateMemoriesResponseGeneratedMemory.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesResponseGeneratedMemoryAction.java b/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesResponseGeneratedMemoryAction.java deleted file mode 100644 index f8da039..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesResponseGeneratedMemoryAction.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * 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 action to take. */ -public class GenerateMemoriesResponseGeneratedMemoryAction { - - /** Enum representing the known values for GenerateMemoriesResponseGeneratedMemoryAction. */ - public enum Known { - /** The action is unspecified. */ - ACTION_UNSPECIFIED, - - /** The memory was created. */ - CREATED, - - /** - * The memory was updated. The `fact` field may not be updated if the existing fact is still - * accurate. - */ - UPDATED, - - /** The memory was deleted. */ - DELETED, - - GENERATE_MEMORIES_RESPONSE_GENERATED_MEMORY_ACTION_UNSPECIFIED - } - - private Known generateMemoriesResponseGeneratedMemoryActionEnum; - private final String value; - - @JsonCreator - public GenerateMemoriesResponseGeneratedMemoryAction(String value) { - this.value = value; - for (Known generateMemoriesResponseGeneratedMemoryActionEnum : Known.values()) { - if (Ascii.equalsIgnoreCase( - generateMemoriesResponseGeneratedMemoryActionEnum.toString(), value)) { - this.generateMemoriesResponseGeneratedMemoryActionEnum = - generateMemoriesResponseGeneratedMemoryActionEnum; - break; - } - } - if (this.generateMemoriesResponseGeneratedMemoryActionEnum == null) { - this.generateMemoriesResponseGeneratedMemoryActionEnum = - Known.GENERATE_MEMORIES_RESPONSE_GENERATED_MEMORY_ACTION_UNSPECIFIED; - } - } - - public GenerateMemoriesResponseGeneratedMemoryAction(Known knownValue) { - this.generateMemoriesResponseGeneratedMemoryActionEnum = 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 GenerateMemoriesResponseGeneratedMemoryAction)) { - return false; - } - - GenerateMemoriesResponseGeneratedMemoryAction other = - (GenerateMemoriesResponseGeneratedMemoryAction) o; - - if (this.generateMemoriesResponseGeneratedMemoryActionEnum - != Known.GENERATE_MEMORIES_RESPONSE_GENERATED_MEMORY_ACTION_UNSPECIFIED - && other.generateMemoriesResponseGeneratedMemoryActionEnum - != Known.GENERATE_MEMORIES_RESPONSE_GENERATED_MEMORY_ACTION_UNSPECIFIED) { - return this.generateMemoriesResponseGeneratedMemoryActionEnum - == other.generateMemoriesResponseGeneratedMemoryActionEnum; - } else if (this.generateMemoriesResponseGeneratedMemoryActionEnum - == Known.GENERATE_MEMORIES_RESPONSE_GENERATED_MEMORY_ACTION_UNSPECIFIED - && other.generateMemoriesResponseGeneratedMemoryActionEnum - == Known.GENERATE_MEMORIES_RESPONSE_GENERATED_MEMORY_ACTION_UNSPECIFIED) { - return this.value.equals(other.value); - } - return false; - } - - @ExcludeFromGeneratedCoverageReport - @Override - public int hashCode() { - if (this.generateMemoriesResponseGeneratedMemoryActionEnum - != Known.GENERATE_MEMORIES_RESPONSE_GENERATED_MEMORY_ACTION_UNSPECIFIED) { - return this.generateMemoriesResponseGeneratedMemoryActionEnum.hashCode(); - } else { - return Objects.hashCode(this.value); - } - } - - @ExcludeFromGeneratedCoverageReport - public Known knownEnum() { - return this.generateMemoriesResponseGeneratedMemoryActionEnum; - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/GetAgentEngineGenerateMemoriesOperationParameters.java b/src/main/java/com/google/cloud/agentplatform/types/GetAgentEngineGenerateMemoriesOperationParameters.java deleted file mode 100644 index ccfa312..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/GetAgentEngineGenerateMemoriesOperationParameters.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * 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 generated memories as a response. */ -@AutoValue -@InternalApi -@JsonDeserialize(builder = GetAgentEngineGenerateMemoriesOperationParameters.Builder.class) -public abstract class GetAgentEngineGenerateMemoriesOperationParameters 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 GetAgentEngineGenerateMemoriesOperationParameters. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_GetAgentEngineGenerateMemoriesOperationParameters.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for GetAgentEngineGenerateMemoriesOperationParameters. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `GetAgentEngineGenerateMemoriesOperationParameters.builder()` - * for instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_GetAgentEngineGenerateMemoriesOperationParameters.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 GetAgentEngineGenerateMemoriesOperationParameters build(); - } - - /** Deserializes a JSON string to a GetAgentEngineGenerateMemoriesOperationParameters object. */ - @ExcludeFromGeneratedCoverageReport - public static GetAgentEngineGenerateMemoriesOperationParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, GetAgentEngineGenerateMemoriesOperationParameters.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/GetAgentEngineMemoryConfig.java b/src/main/java/com/google/cloud/agentplatform/types/GetAgentEngineMemoryConfig.java deleted file mode 100644 index 6176b77..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/GetAgentEngineMemoryConfig.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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 an Agent Engine Memory. */ -@AutoValue -@JsonDeserialize(builder = GetAgentEngineMemoryConfig.Builder.class) -public abstract class GetAgentEngineMemoryConfig extends JsonSerializable { - /** Used to override HTTP request options. */ - @JsonProperty("httpOptions") - public abstract Optional httpOptions(); - - /** Instantiates a builder for GetAgentEngineMemoryConfig. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_GetAgentEngineMemoryConfig.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for GetAgentEngineMemoryConfig. */ - @AutoValue.Builder - public abstract static class Builder { - /** For internal usage. Please use `GetAgentEngineMemoryConfig.builder()` for instantiation. */ - @JsonCreator - private static Builder create() { - return new AutoValue_GetAgentEngineMemoryConfig.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 GetAgentEngineMemoryConfig build(); - } - - /** Deserializes a JSON string to a GetAgentEngineMemoryConfig object. */ - @ExcludeFromGeneratedCoverageReport - public static GetAgentEngineMemoryConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GetAgentEngineMemoryConfig.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/GetAgentEngineMemoryOperationParameters.java b/src/main/java/com/google/cloud/agentplatform/types/GetAgentEngineMemoryOperationParameters.java deleted file mode 100644 index e2b15ba..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/GetAgentEngineMemoryOperationParameters.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * 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 memory as a response. */ -@AutoValue -@InternalApi -@JsonDeserialize(builder = GetAgentEngineMemoryOperationParameters.Builder.class) -public abstract class GetAgentEngineMemoryOperationParameters 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 GetAgentEngineMemoryOperationParameters. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_GetAgentEngineMemoryOperationParameters.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for GetAgentEngineMemoryOperationParameters. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `GetAgentEngineMemoryOperationParameters.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_GetAgentEngineMemoryOperationParameters.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 GetAgentEngineMemoryOperationParameters build(); - } - - /** Deserializes a JSON string to a GetAgentEngineMemoryOperationParameters object. */ - @ExcludeFromGeneratedCoverageReport - public static GetAgentEngineMemoryOperationParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, GetAgentEngineMemoryOperationParameters.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/GetAgentEngineMemoryRequestParameters.java b/src/main/java/com/google/cloud/agentplatform/types/GetAgentEngineMemoryRequestParameters.java deleted file mode 100644 index 30a4f1b..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/GetAgentEngineMemoryRequestParameters.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * 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 agent engine. */ -@AutoValue -@InternalApi -@JsonDeserialize(builder = GetAgentEngineMemoryRequestParameters.Builder.class) -public abstract class GetAgentEngineMemoryRequestParameters extends JsonSerializable { - /** Name of the agent engine. */ - @JsonProperty("name") - public abstract Optional name(); - - /** */ - @JsonProperty("config") - public abstract Optional config(); - - /** Instantiates a builder for GetAgentEngineMemoryRequestParameters. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_GetAgentEngineMemoryRequestParameters.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for GetAgentEngineMemoryRequestParameters. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `GetAgentEngineMemoryRequestParameters.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_GetAgentEngineMemoryRequestParameters.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(GetAgentEngineMemoryConfig config); - - /** - * Setter for config builder. - * - *

config: - */ - @CanIgnoreReturnValue - public Builder config(GetAgentEngineMemoryConfig.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 GetAgentEngineMemoryRequestParameters build(); - } - - /** Deserializes a JSON string to a GetAgentEngineMemoryRequestParameters object. */ - @ExcludeFromGeneratedCoverageReport - public static GetAgentEngineMemoryRequestParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GetAgentEngineMemoryRequestParameters.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/GetAgentEngineMemoryRevisionConfig.java b/src/main/java/com/google/cloud/agentplatform/types/GetAgentEngineMemoryRevisionConfig.java deleted file mode 100644 index 3bcf577..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/GetAgentEngineMemoryRevisionConfig.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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 an Agent Engine Memory Revision. */ -@AutoValue -@JsonDeserialize(builder = GetAgentEngineMemoryRevisionConfig.Builder.class) -public abstract class GetAgentEngineMemoryRevisionConfig extends JsonSerializable { - /** Used to override HTTP request options. */ - @JsonProperty("httpOptions") - public abstract Optional httpOptions(); - - /** Instantiates a builder for GetAgentEngineMemoryRevisionConfig. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_GetAgentEngineMemoryRevisionConfig.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for GetAgentEngineMemoryRevisionConfig. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `GetAgentEngineMemoryRevisionConfig.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_GetAgentEngineMemoryRevisionConfig.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 GetAgentEngineMemoryRevisionConfig build(); - } - - /** Deserializes a JSON string to a GetAgentEngineMemoryRevisionConfig object. */ - @ExcludeFromGeneratedCoverageReport - public static GetAgentEngineMemoryRevisionConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GetAgentEngineMemoryRevisionConfig.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/GetAgentEngineMemoryRevisionRequestParameters.java b/src/main/java/com/google/cloud/agentplatform/types/GetAgentEngineMemoryRevisionRequestParameters.java deleted file mode 100644 index 3535d68..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/GetAgentEngineMemoryRevisionRequestParameters.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * 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 Agent Engine memory revision. */ -@AutoValue -@InternalApi -@JsonDeserialize(builder = GetAgentEngineMemoryRevisionRequestParameters.Builder.class) -public abstract class GetAgentEngineMemoryRevisionRequestParameters extends JsonSerializable { - /** Name of the agent engine. */ - @JsonProperty("name") - public abstract Optional name(); - - /** */ - @JsonProperty("config") - public abstract Optional config(); - - /** Instantiates a builder for GetAgentEngineMemoryRevisionRequestParameters. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_GetAgentEngineMemoryRevisionRequestParameters.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for GetAgentEngineMemoryRevisionRequestParameters. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `GetAgentEngineMemoryRevisionRequestParameters.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_GetAgentEngineMemoryRevisionRequestParameters.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(GetAgentEngineMemoryRevisionConfig config); - - /** - * Setter for config builder. - * - *

config: - */ - @CanIgnoreReturnValue - public Builder config(GetAgentEngineMemoryRevisionConfig.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 GetAgentEngineMemoryRevisionRequestParameters build(); - } - - /** Deserializes a JSON string to a GetAgentEngineMemoryRevisionRequestParameters object. */ - @ExcludeFromGeneratedCoverageReport - public static GetAgentEngineMemoryRevisionRequestParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, GetAgentEngineMemoryRevisionRequestParameters.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/IngestEventsConfig.java b/src/main/java/com/google/cloud/agentplatform/types/IngestEventsConfig.java deleted file mode 100644 index 1ec8529..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/IngestEventsConfig.java +++ /dev/null @@ -1,309 +0,0 @@ -/* - * 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.time.Instant; -import java.util.Map; -import java.util.Optional; - -/** Config for ingesting events. */ -@AutoValue -@JsonDeserialize(builder = IngestEventsConfig.Builder.class) -public abstract class IngestEventsConfig extends JsonSerializable { - /** Used to override HTTP request options. */ - @JsonProperty("httpOptions") - public abstract Optional httpOptions(); - - /** - * Waits for the underlying memory generation operation to complete before returning. Defaults to - * false. - */ - @JsonProperty("waitForCompletion") - public abstract Optional waitForCompletion(); - - /** - * Optional. Forces a flush of all pending events in the stream and triggers memory generation - * immediately bypassing any conditions configured in the `generation_trigger_config`. - */ - @JsonProperty("forceFlush") - public abstract Optional forceFlush(); - - /** - * Labels to apply to the memory revision. For example, you can use this to label a revision with - * its data source. - */ - @JsonProperty("revisionLabels") - public abstract Optional> revisionLabels(); - - /** - * Optional. Input only. Timestamp of when the revision is considered expired. If not set, the - * memory revision will be kept until manually deleted. - */ - @JsonProperty("revisionExpireTime") - public abstract Optional revisionExpireTime(); - - /** Optional. Input only. The TTL for the revision. The expiration time is computed: now + TTL. */ - @JsonProperty("revisionTtl") - public abstract Optional revisionTtl(); - - /** Optional. Input only. If true, no revisions will be created for this request. */ - @JsonProperty("disableMemoryRevisions") - public abstract Optional disableMemoryRevisions(); - - /** - * Optional. User-provided metadata for the generated memories. This is not generated by Memory - * Bank. - */ - @JsonProperty("metadata") - public abstract Optional> metadata(); - - /** Optional. The strategy to use when applying metadata to existing memories. */ - @JsonProperty("metadataMergeStrategy") - public abstract Optional metadataMergeStrategy(); - - /** Instantiates a builder for IngestEventsConfig. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_IngestEventsConfig.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for IngestEventsConfig. */ - @AutoValue.Builder - public abstract static class Builder { - /** For internal usage. Please use `IngestEventsConfig.builder()` for instantiation. */ - @JsonCreator - private static Builder create() { - return new AutoValue_IngestEventsConfig.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 waitForCompletion. - * - *

waitForCompletion: Waits for the underlying memory generation operation to complete before - * returning. Defaults to false. - */ - @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()); - } - - /** - * Setter for forceFlush. - * - *

forceFlush: Optional. Forces a flush of all pending events in the stream and triggers - * memory generation immediately bypassing any conditions configured in the - * `generation_trigger_config`. - */ - @JsonProperty("forceFlush") - public abstract Builder forceFlush(boolean forceFlush); - - @ExcludeFromGeneratedCoverageReport - abstract Builder forceFlush(Optional forceFlush); - - /** Clears the value of forceFlush field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearForceFlush() { - return forceFlush(Optional.empty()); - } - - /** - * Setter for revisionLabels. - * - *

revisionLabels: Labels to apply to the memory revision. For example, you can use this to - * label a revision with its data source. - */ - @JsonProperty("revisionLabels") - public abstract Builder revisionLabels(Map revisionLabels); - - @ExcludeFromGeneratedCoverageReport - abstract Builder revisionLabels(Optional> revisionLabels); - - /** Clears the value of revisionLabels field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearRevisionLabels() { - return revisionLabels(Optional.empty()); - } - - /** - * Setter for revisionExpireTime. - * - *

revisionExpireTime: Optional. Input only. Timestamp of when the revision is considered - * expired. If not set, the memory revision will be kept until manually deleted. - */ - @JsonProperty("revisionExpireTime") - public abstract Builder revisionExpireTime(Instant revisionExpireTime); - - @ExcludeFromGeneratedCoverageReport - abstract Builder revisionExpireTime(Optional revisionExpireTime); - - /** Clears the value of revisionExpireTime field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearRevisionExpireTime() { - return revisionExpireTime(Optional.empty()); - } - - /** - * Setter for revisionTtl. - * - *

revisionTtl: Optional. Input only. The TTL for the revision. The expiration time is - * computed: now + TTL. - */ - @JsonProperty("revisionTtl") - public abstract Builder revisionTtl(Duration revisionTtl); - - @ExcludeFromGeneratedCoverageReport - abstract Builder revisionTtl(Optional revisionTtl); - - /** Clears the value of revisionTtl field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearRevisionTtl() { - return revisionTtl(Optional.empty()); - } - - /** - * Setter for disableMemoryRevisions. - * - *

disableMemoryRevisions: Optional. Input only. If true, no revisions will be created for - * this request. - */ - @JsonProperty("disableMemoryRevisions") - public abstract Builder disableMemoryRevisions(boolean disableMemoryRevisions); - - @ExcludeFromGeneratedCoverageReport - abstract Builder disableMemoryRevisions(Optional disableMemoryRevisions); - - /** Clears the value of disableMemoryRevisions field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearDisableMemoryRevisions() { - return disableMemoryRevisions(Optional.empty()); - } - - /** - * Setter for metadata. - * - *

metadata: Optional. User-provided metadata for the generated memories. This is not - * generated by Memory Bank. - */ - @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 metadataMergeStrategy. - * - *

metadataMergeStrategy: Optional. The strategy to use when applying metadata to existing - * memories. - */ - @JsonProperty("metadataMergeStrategy") - public abstract Builder metadataMergeStrategy( - MemoryMetadataMergeStrategy metadataMergeStrategy); - - @ExcludeFromGeneratedCoverageReport - abstract Builder metadataMergeStrategy( - Optional metadataMergeStrategy); - - /** Clears the value of metadataMergeStrategy field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearMetadataMergeStrategy() { - return metadataMergeStrategy(Optional.empty()); - } - - /** - * Setter for metadataMergeStrategy given a known enum. - * - *

metadataMergeStrategy: Optional. The strategy to use when applying metadata to existing - * memories. - */ - @CanIgnoreReturnValue - public Builder metadataMergeStrategy(MemoryMetadataMergeStrategy.Known knownType) { - return metadataMergeStrategy(new MemoryMetadataMergeStrategy(knownType)); - } - - /** - * Setter for metadataMergeStrategy given a string. - * - *

metadataMergeStrategy: Optional. The strategy to use when applying metadata to existing - * memories. - */ - @CanIgnoreReturnValue - public Builder metadataMergeStrategy(String metadataMergeStrategy) { - return metadataMergeStrategy(new MemoryMetadataMergeStrategy(metadataMergeStrategy)); - } - - public abstract IngestEventsConfig build(); - } - - /** Deserializes a JSON string to a IngestEventsConfig object. */ - @ExcludeFromGeneratedCoverageReport - public static IngestEventsConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, IngestEventsConfig.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/IngestEventsRequestParameters.java b/src/main/java/com/google/cloud/agentplatform/types/IngestEventsRequestParameters.java deleted file mode 100644 index 9a7582d..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/IngestEventsRequestParameters.java +++ /dev/null @@ -1,240 +0,0 @@ -/* - * 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.Map; -import java.util.Optional; - -/** Parameters for purging agent engine memories. */ -@AutoValue -@InternalApi -@JsonDeserialize(builder = IngestEventsRequestParameters.Builder.class) -public abstract class IngestEventsRequestParameters extends JsonSerializable { - /** Name of the Agent Engine to ingest events into. */ - @JsonProperty("name") - public abstract Optional name(); - - /** The ID of the stream to ingest events into. */ - @JsonProperty("streamId") - public abstract Optional streamId(); - - /** The direct memories source of the events that should be ingested. */ - @JsonProperty("directContentsSource") - public abstract Optional directContentsSource(); - - /** - * The scope of the memories that should be generated from the stream. - * - *

Memories will be consolidated across memories with the same scope. Scope values cannot - * contain the wildcard character '*'. - */ - @JsonProperty("scope") - public abstract Optional> scope(); - - /** The configuration for the memory generation trigger. */ - @JsonProperty("generationTriggerConfig") - public abstract Optional generationTriggerConfig(); - - /** */ - @JsonProperty("config") - public abstract Optional config(); - - /** Instantiates a builder for IngestEventsRequestParameters. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_IngestEventsRequestParameters.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for IngestEventsRequestParameters. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `IngestEventsRequestParameters.builder()` for instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_IngestEventsRequestParameters.Builder(); - } - - /** - * Setter for name. - * - *

name: Name of the Agent Engine to ingest events into. - */ - @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 streamId. - * - *

streamId: The ID of the stream to ingest events into. - */ - @JsonProperty("streamId") - public abstract Builder streamId(String streamId); - - @ExcludeFromGeneratedCoverageReport - abstract Builder streamId(Optional streamId); - - /** Clears the value of streamId field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearStreamId() { - return streamId(Optional.empty()); - } - - /** - * Setter for directContentsSource. - * - *

directContentsSource: The direct memories source of the events that should be ingested. - */ - @JsonProperty("directContentsSource") - public abstract Builder directContentsSource( - IngestionDirectContentsSource directContentsSource); - - /** - * Setter for directContentsSource builder. - * - *

directContentsSource: The direct memories source of the events that should be ingested. - */ - @CanIgnoreReturnValue - public Builder directContentsSource( - IngestionDirectContentsSource.Builder directContentsSourceBuilder) { - return directContentsSource(directContentsSourceBuilder.build()); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder directContentsSource( - Optional directContentsSource); - - /** Clears the value of directContentsSource field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearDirectContentsSource() { - return directContentsSource(Optional.empty()); - } - - /** - * Setter for scope. - * - *

scope: The scope of the memories that should be generated from the stream. - * - *

Memories will be consolidated across memories with the same scope. Scope values cannot - * contain the wildcard character '*'. - */ - @JsonProperty("scope") - public abstract Builder scope(Map scope); - - @ExcludeFromGeneratedCoverageReport - abstract Builder scope(Optional> scope); - - /** Clears the value of scope field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearScope() { - return scope(Optional.empty()); - } - - /** - * Setter for generationTriggerConfig. - * - *

generationTriggerConfig: The configuration for the memory generation trigger. - */ - @JsonProperty("generationTriggerConfig") - public abstract Builder generationTriggerConfig( - MemoryGenerationTriggerConfig generationTriggerConfig); - - /** - * Setter for generationTriggerConfig builder. - * - *

generationTriggerConfig: The configuration for the memory generation trigger. - */ - @CanIgnoreReturnValue - public Builder generationTriggerConfig( - MemoryGenerationTriggerConfig.Builder generationTriggerConfigBuilder) { - return generationTriggerConfig(generationTriggerConfigBuilder.build()); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder generationTriggerConfig( - Optional generationTriggerConfig); - - /** Clears the value of generationTriggerConfig field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearGenerationTriggerConfig() { - return generationTriggerConfig(Optional.empty()); - } - - /** - * Setter for config. - * - *

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

config: - */ - @CanIgnoreReturnValue - public Builder config(IngestEventsConfig.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 IngestEventsRequestParameters build(); - } - - /** Deserializes a JSON string to a IngestEventsRequestParameters object. */ - @ExcludeFromGeneratedCoverageReport - public static IngestEventsRequestParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, IngestEventsRequestParameters.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/IngestionDirectContentsSource.java b/src/main/java/com/google/cloud/agentplatform/types/IngestionDirectContentsSource.java deleted file mode 100644 index 5ae6888..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/IngestionDirectContentsSource.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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 direct contents source for ingesting events. */ -@AutoValue -@JsonDeserialize(builder = IngestionDirectContentsSource.Builder.class) -public abstract class IngestionDirectContentsSource extends JsonSerializable { - /** Required. The events to ingest. */ - @JsonProperty("events") - public abstract Optional> events(); - - /** Instantiates a builder for IngestionDirectContentsSource. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_IngestionDirectContentsSource.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for IngestionDirectContentsSource. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `IngestionDirectContentsSource.builder()` for instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_IngestionDirectContentsSource.Builder(); - } - - /** - * Setter for events. - * - *

events: Required. The events to ingest. - */ - @JsonProperty("events") - public abstract Builder events(List events); - - /** - * Setter for events. - * - *

events: Required. The events to ingest. - */ - @CanIgnoreReturnValue - public Builder events(IngestionDirectContentsSourceEvent... events) { - return events(Arrays.asList(events)); - } - - /** - * Setter for events builder. - * - *

events: Required. The events to ingest. - */ - @CanIgnoreReturnValue - public Builder events(IngestionDirectContentsSourceEvent.Builder... eventsBuilders) { - return events( - Arrays.asList(eventsBuilders).stream() - .map(IngestionDirectContentsSourceEvent.Builder::build) - .collect(toImmutableList())); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder events(Optional> events); - - /** Clears the value of events field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearEvents() { - return events(Optional.empty()); - } - - public abstract IngestionDirectContentsSource build(); - } - - /** Deserializes a JSON string to a IngestionDirectContentsSource object. */ - @ExcludeFromGeneratedCoverageReport - public static IngestionDirectContentsSource fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, IngestionDirectContentsSource.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/IngestionDirectContentsSourceEvent.java b/src/main/java/com/google/cloud/agentplatform/types/IngestionDirectContentsSourceEvent.java deleted file mode 100644 index 0d1e75e..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/IngestionDirectContentsSourceEvent.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * 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.Content; -import java.time.Instant; -import java.util.Optional; - -/** The direct contents source event for ingesting events. */ -@AutoValue -@JsonDeserialize(builder = IngestionDirectContentsSourceEvent.Builder.class) -public abstract class IngestionDirectContentsSourceEvent extends JsonSerializable { - /** Required. The content of the event. */ - @JsonProperty("content") - public abstract Optional content(); - - /** - * Optional. A unique identifier for the event. If an event with the same event_id is ingested - * multiple times, it will be de-duplicated. - */ - @JsonProperty("eventId") - public abstract Optional eventId(); - - /** - * Optional. The time at which the event occurred. If provided, this timestamp will be used for - * ordering events within a stream. If not provided, the server-side ingestion time will be used. - */ - @JsonProperty("eventTime") - public abstract Optional eventTime(); - - /** Instantiates a builder for IngestionDirectContentsSourceEvent. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_IngestionDirectContentsSourceEvent.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for IngestionDirectContentsSourceEvent. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `IngestionDirectContentsSourceEvent.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_IngestionDirectContentsSourceEvent.Builder(); - } - - /** - * Setter for content. - * - *

content: Required. The content of the event. - */ - @JsonProperty("content") - public abstract Builder content(Content content); - - @ExcludeFromGeneratedCoverageReport - abstract Builder content(Optional content); - - /** Clears the value of content field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearContent() { - return content(Optional.empty()); - } - - /** - * Setter for eventId. - * - *

eventId: Optional. A unique identifier for the event. If an event with the same event_id - * is ingested multiple times, it will be de-duplicated. - */ - @JsonProperty("eventId") - public abstract Builder eventId(String eventId); - - @ExcludeFromGeneratedCoverageReport - abstract Builder eventId(Optional eventId); - - /** Clears the value of eventId field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearEventId() { - return eventId(Optional.empty()); - } - - /** - * Setter for eventTime. - * - *

eventTime: Optional. The time at which the event occurred. If provided, this timestamp - * will be used for ordering events within a stream. If not provided, the server-side ingestion - * time will be used. - */ - @JsonProperty("eventTime") - public abstract Builder eventTime(Instant eventTime); - - @ExcludeFromGeneratedCoverageReport - abstract Builder eventTime(Optional eventTime); - - /** Clears the value of eventTime field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearEventTime() { - return eventTime(Optional.empty()); - } - - public abstract IngestionDirectContentsSourceEvent build(); - } - - /** Deserializes a JSON string to a IngestionDirectContentsSourceEvent object. */ - @ExcludeFromGeneratedCoverageReport - public static IngestionDirectContentsSourceEvent fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, IngestionDirectContentsSourceEvent.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/IntermediateExtractedMemory.java b/src/main/java/com/google/cloud/agentplatform/types/IntermediateExtractedMemory.java deleted file mode 100644 index 70cd875..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/IntermediateExtractedMemory.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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; - -/** An extracted memory that is the intermediate result before consolidation. */ -@AutoValue -@JsonDeserialize(builder = IntermediateExtractedMemory.Builder.class) -public abstract class IntermediateExtractedMemory extends JsonSerializable { - /** Output only. Represents the fact of the extracted memory. */ - @JsonProperty("fact") - public abstract Optional fact(); - - /** Output only. Represents the structured value of the extracted memory. */ - @JsonProperty("structuredData") - public abstract Optional> structuredData(); - - /** - * Output only. Represents the explanation of why the information was extracted from the source - * content. - */ - @JsonProperty("context") - public abstract Optional context(); - - /** Instantiates a builder for IntermediateExtractedMemory. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_IntermediateExtractedMemory.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for IntermediateExtractedMemory. */ - @AutoValue.Builder - public abstract static class Builder { - /** For internal usage. Please use `IntermediateExtractedMemory.builder()` for instantiation. */ - @JsonCreator - private static Builder create() { - return new AutoValue_IntermediateExtractedMemory.Builder(); - } - - /** - * Setter for fact. - * - *

fact: Output only. Represents the fact of the extracted memory. - */ - @JsonProperty("fact") - public abstract Builder fact(String fact); - - @ExcludeFromGeneratedCoverageReport - abstract Builder fact(Optional fact); - - /** Clears the value of fact field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearFact() { - return fact(Optional.empty()); - } - - /** - * Setter for structuredData. - * - *

structuredData: Output only. Represents the structured value of the extracted memory. - */ - @JsonProperty("structuredData") - public abstract Builder structuredData(Map structuredData); - - @ExcludeFromGeneratedCoverageReport - abstract Builder structuredData(Optional> structuredData); - - /** Clears the value of structuredData field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearStructuredData() { - return structuredData(Optional.empty()); - } - - /** - * Setter for context. - * - *

context: Output only. Represents the explanation of why the information was extracted from - * the source content. - */ - @JsonProperty("context") - public abstract Builder context(String context); - - @ExcludeFromGeneratedCoverageReport - abstract Builder context(Optional context); - - /** Clears the value of context field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearContext() { - return context(Optional.empty()); - } - - public abstract IntermediateExtractedMemory build(); - } - - /** Deserializes a JSON string to a IntermediateExtractedMemory object. */ - @ExcludeFromGeneratedCoverageReport - public static IntermediateExtractedMemory fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, IntermediateExtractedMemory.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/ListAgentEngineMemoryConfig.java b/src/main/java/com/google/cloud/agentplatform/types/ListAgentEngineMemoryConfig.java deleted file mode 100644 index 59c6c2e..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/ListAgentEngineMemoryConfig.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * 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 agent engine memories. */ -@AutoValue -@JsonDeserialize(builder = ListAgentEngineMemoryConfig.Builder.class) -public abstract class ListAgentEngineMemoryConfig 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. For field names both snake_case and - * camelCase are supported. - */ - @JsonProperty("filter") - public abstract Optional filter(); - - /** - * The standard list order by string. If not specified, the default order is `create_time desc`. - * If specified, the default sorting order of provided fields is ascending. More detail in - * [AIP-132](https://google.aip.dev/132). - * - *

Supported fields: `create_time` `update_time` - */ - @JsonProperty("orderBy") - public abstract Optional orderBy(); - - /** Instantiates a builder for ListAgentEngineMemoryConfig. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_ListAgentEngineMemoryConfig.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for ListAgentEngineMemoryConfig. */ - @AutoValue.Builder - public abstract static class Builder { - /** For internal usage. Please use `ListAgentEngineMemoryConfig.builder()` for instantiation. */ - @JsonCreator - private static Builder create() { - return new AutoValue_ListAgentEngineMemoryConfig.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. For field names both - * snake_case and camelCase are supported. - */ - @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()); - } - - /** - * Setter for orderBy. - * - *

orderBy: The standard list order by string. If not specified, the default order is - * `create_time desc`. If specified, the default sorting order of provided fields is ascending. - * More detail in [AIP-132](https://google.aip.dev/132). - * - *

Supported fields: `create_time` `update_time` - */ - @JsonProperty("orderBy") - public abstract Builder orderBy(String orderBy); - - @ExcludeFromGeneratedCoverageReport - abstract Builder orderBy(Optional orderBy); - - /** Clears the value of orderBy field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearOrderBy() { - return orderBy(Optional.empty()); - } - - public abstract ListAgentEngineMemoryConfig build(); - } - - /** Deserializes a JSON string to a ListAgentEngineMemoryConfig object. */ - @ExcludeFromGeneratedCoverageReport - public static ListAgentEngineMemoryConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ListAgentEngineMemoryConfig.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/ListAgentEngineMemoryRequestParameters.java b/src/main/java/com/google/cloud/agentplatform/types/ListAgentEngineMemoryRequestParameters.java deleted file mode 100644 index a39fd01..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/ListAgentEngineMemoryRequestParameters.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * 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 agent engines. */ -@AutoValue -@InternalApi -@JsonDeserialize(builder = ListAgentEngineMemoryRequestParameters.Builder.class) -public abstract class ListAgentEngineMemoryRequestParameters extends JsonSerializable { - /** Name of the agent engine. */ - @JsonProperty("name") - public abstract Optional name(); - - /** */ - @JsonProperty("config") - public abstract Optional config(); - - /** Instantiates a builder for ListAgentEngineMemoryRequestParameters. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_ListAgentEngineMemoryRequestParameters.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for ListAgentEngineMemoryRequestParameters. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `ListAgentEngineMemoryRequestParameters.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_ListAgentEngineMemoryRequestParameters.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(ListAgentEngineMemoryConfig config); - - /** - * Setter for config builder. - * - *

config: - */ - @CanIgnoreReturnValue - public Builder config(ListAgentEngineMemoryConfig.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 ListAgentEngineMemoryRequestParameters build(); - } - - /** Deserializes a JSON string to a ListAgentEngineMemoryRequestParameters object. */ - @ExcludeFromGeneratedCoverageReport - public static ListAgentEngineMemoryRequestParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, ListAgentEngineMemoryRequestParameters.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/ListAgentEngineMemoryRevisionsConfig.java b/src/main/java/com/google/cloud/agentplatform/types/ListAgentEngineMemoryRevisionsConfig.java deleted file mode 100644 index a853c00..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/ListAgentEngineMemoryRevisionsConfig.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * 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 Agent Engine memory revisions. */ -@AutoValue -@JsonDeserialize(builder = ListAgentEngineMemoryRevisionsConfig.Builder.class) -public abstract class ListAgentEngineMemoryRevisionsConfig 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. For field names both snake_case and - * camelCase are supported. - */ - @JsonProperty("filter") - public abstract Optional filter(); - - /** Instantiates a builder for ListAgentEngineMemoryRevisionsConfig. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_ListAgentEngineMemoryRevisionsConfig.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for ListAgentEngineMemoryRevisionsConfig. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `ListAgentEngineMemoryRevisionsConfig.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_ListAgentEngineMemoryRevisionsConfig.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. For field names both - * snake_case and camelCase are supported. - */ - @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 ListAgentEngineMemoryRevisionsConfig build(); - } - - /** Deserializes a JSON string to a ListAgentEngineMemoryRevisionsConfig object. */ - @ExcludeFromGeneratedCoverageReport - public static ListAgentEngineMemoryRevisionsConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ListAgentEngineMemoryRevisionsConfig.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/ListAgentEngineMemoryRevisionsRequestParameters.java b/src/main/java/com/google/cloud/agentplatform/types/ListAgentEngineMemoryRevisionsRequestParameters.java deleted file mode 100644 index e0772bf..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/ListAgentEngineMemoryRevisionsRequestParameters.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * 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 Agent Engine memory revisions. */ -@AutoValue -@InternalApi -@JsonDeserialize(builder = ListAgentEngineMemoryRevisionsRequestParameters.Builder.class) -public abstract class ListAgentEngineMemoryRevisionsRequestParameters extends JsonSerializable { - /** Name of the Agent Engine memory */ - @JsonProperty("name") - public abstract Optional name(); - - /** */ - @JsonProperty("config") - public abstract Optional config(); - - /** Instantiates a builder for ListAgentEngineMemoryRevisionsRequestParameters. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_ListAgentEngineMemoryRevisionsRequestParameters.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for ListAgentEngineMemoryRevisionsRequestParameters. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `ListAgentEngineMemoryRevisionsRequestParameters.builder()` - * for instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_ListAgentEngineMemoryRevisionsRequestParameters.Builder(); - } - - /** - * Setter for name. - * - *

name: Name of the Agent Engine memory - */ - @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(ListAgentEngineMemoryRevisionsConfig config); - - /** - * Setter for config builder. - * - *

config: - */ - @CanIgnoreReturnValue - public Builder config(ListAgentEngineMemoryRevisionsConfig.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 ListAgentEngineMemoryRevisionsRequestParameters build(); - } - - /** Deserializes a JSON string to a ListAgentEngineMemoryRevisionsRequestParameters object. */ - @ExcludeFromGeneratedCoverageReport - public static ListAgentEngineMemoryRevisionsRequestParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, ListAgentEngineMemoryRevisionsRequestParameters.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/ListAgentEngineMemoryRevisionsResponse.java b/src/main/java/com/google/cloud/agentplatform/types/ListAgentEngineMemoryRevisionsResponse.java deleted file mode 100644 index 3b824e4..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/ListAgentEngineMemoryRevisionsResponse.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * 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 agent engine memory revisions. */ -@AutoValue -@JsonDeserialize(builder = ListAgentEngineMemoryRevisionsResponse.Builder.class) -public abstract class ListAgentEngineMemoryRevisionsResponse extends JsonSerializable { - /** Used to retain the full HTTP response. */ - @JsonProperty("sdkHttpResponse") - public abstract Optional sdkHttpResponse(); - - /** */ - @JsonProperty("nextPageToken") - public abstract Optional nextPageToken(); - - /** List of memory revisions. */ - @JsonProperty("memoryRevisions") - public abstract Optional> memoryRevisions(); - - /** Instantiates a builder for ListAgentEngineMemoryRevisionsResponse. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_ListAgentEngineMemoryRevisionsResponse.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for ListAgentEngineMemoryRevisionsResponse. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `ListAgentEngineMemoryRevisionsResponse.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_ListAgentEngineMemoryRevisionsResponse.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 memoryRevisions. - * - *

memoryRevisions: List of memory revisions. - */ - @JsonProperty("memoryRevisions") - public abstract Builder memoryRevisions(List memoryRevisions); - - /** - * Setter for memoryRevisions. - * - *

memoryRevisions: List of memory revisions. - */ - @CanIgnoreReturnValue - public Builder memoryRevisions(MemoryRevision... memoryRevisions) { - return memoryRevisions(Arrays.asList(memoryRevisions)); - } - - /** - * Setter for memoryRevisions builder. - * - *

memoryRevisions: List of memory revisions. - */ - @CanIgnoreReturnValue - public Builder memoryRevisions(MemoryRevision.Builder... memoryRevisionsBuilders) { - return memoryRevisions( - Arrays.asList(memoryRevisionsBuilders).stream() - .map(MemoryRevision.Builder::build) - .collect(toImmutableList())); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder memoryRevisions(Optional> memoryRevisions); - - /** Clears the value of memoryRevisions field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearMemoryRevisions() { - return memoryRevisions(Optional.empty()); - } - - public abstract ListAgentEngineMemoryRevisionsResponse build(); - } - - /** Deserializes a JSON string to a ListAgentEngineMemoryRevisionsResponse object. */ - @ExcludeFromGeneratedCoverageReport - public static ListAgentEngineMemoryRevisionsResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, ListAgentEngineMemoryRevisionsResponse.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/ListReasoningEnginesMemoriesResponse.java b/src/main/java/com/google/cloud/agentplatform/types/ListReasoningEnginesMemoriesResponse.java deleted file mode 100644 index 3b7a026..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/ListReasoningEnginesMemoriesResponse.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * 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 agent engine memories. */ -@AutoValue -@JsonDeserialize(builder = ListReasoningEnginesMemoriesResponse.Builder.class) -public abstract class ListReasoningEnginesMemoriesResponse extends JsonSerializable { - /** Used to retain the full HTTP response. */ - @JsonProperty("sdkHttpResponse") - public abstract Optional sdkHttpResponse(); - - /** */ - @JsonProperty("nextPageToken") - public abstract Optional nextPageToken(); - - /** List of agent engine memories. */ - @JsonProperty("memories") - public abstract Optional> memories(); - - /** Instantiates a builder for ListReasoningEnginesMemoriesResponse. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_ListReasoningEnginesMemoriesResponse.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for ListReasoningEnginesMemoriesResponse. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `ListReasoningEnginesMemoriesResponse.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_ListReasoningEnginesMemoriesResponse.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 memories. - * - *

memories: List of agent engine memories. - */ - @JsonProperty("memories") - public abstract Builder memories(List memories); - - /** - * Setter for memories. - * - *

memories: List of agent engine memories. - */ - @CanIgnoreReturnValue - public Builder memories(Memory... memories) { - return memories(Arrays.asList(memories)); - } - - /** - * Setter for memories builder. - * - *

memories: List of agent engine memories. - */ - @CanIgnoreReturnValue - public Builder memories(Memory.Builder... memoriesBuilders) { - return memories( - Arrays.asList(memoriesBuilders).stream() - .map(Memory.Builder::build) - .collect(toImmutableList())); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder memories(Optional> memories); - - /** Clears the value of memories field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearMemories() { - return memories(Optional.empty()); - } - - public abstract ListReasoningEnginesMemoriesResponse build(); - } - - /** Deserializes a JSON string to a ListReasoningEnginesMemoriesResponse object. */ - @ExcludeFromGeneratedCoverageReport - public static ListReasoningEnginesMemoriesResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ListReasoningEnginesMemoriesResponse.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/Memory.java b/src/main/java/com/google/cloud/agentplatform/types/Memory.java deleted file mode 100644 index 20a713e..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/Memory.java +++ /dev/null @@ -1,542 +0,0 @@ -/* - * 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.time.Duration; -import java.time.Instant; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.Optional; - -/** A memory. */ -@AutoValue -@JsonDeserialize(builder = Memory.Builder.class) -public abstract class Memory extends JsonSerializable { - /** Output only. Represents the timestamp when this Memory was created. */ - @JsonProperty("createTime") - public abstract Optional createTime(); - - /** Optional. Represents the description of the Memory. */ - @JsonProperty("description") - public abstract Optional description(); - - /** Optional. Input only. Indicates whether no revision will be created for this request. */ - @JsonProperty("disableMemoryRevisions") - public abstract Optional disableMemoryRevisions(); - - /** Optional. Represents the display name of the Memory. */ - @JsonProperty("displayName") - public abstract Optional displayName(); - - /** - * Optional. Represents the timestamp of when this resource is considered expired. This is - * *always* provided on output when `expiration` is set on input, regardless of whether - * `expire_time` or `ttl` was provided. - */ - @JsonProperty("expireTime") - public abstract Optional expireTime(); - - /** Optional. Represents semantic knowledge extracted from the source content. */ - @JsonProperty("fact") - public abstract Optional fact(); - - /** - * Optional. Represents user-provided metadata for the Memory. This information was provided when - * creating, updating, or generating the Memory. It was not generated by Memory Bank. - */ - @JsonProperty("metadata") - public abstract Optional> metadata(); - - /** - * Identifier. Represents the resource name of the Memory. Format: - * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/memories/{memory}` - */ - @JsonProperty("name") - public abstract Optional name(); - - /** - * Optional. Input only. Represents the timestamp of when the revision is considered expired. If - * not set, the memory revision will be kept until manually deleted. - */ - @JsonProperty("revisionExpireTime") - public abstract Optional revisionExpireTime(); - - /** - * Optional. Input only. Represents the labels to apply to the Memory Revision created as a result - * of this request. - */ - @JsonProperty("revisionLabels") - public abstract Optional> revisionLabels(); - - /** - * Optional. Input only. Represents the TTL for the revision. The expiration time is computed: now - * + TTL. - */ - @JsonProperty("revisionTtl") - public abstract Optional revisionTtl(); - - /** - * Required. Immutable. Represents the scope of the Memory. Memories are isolated within their - * scope. The scope is defined when creating or generating memories. Scope values cannot contain - * the wildcard character '*'. - */ - @JsonProperty("scope") - public abstract Optional> scope(); - - /** Optional. Represents the Topics of the Memory. */ - @JsonProperty("topics") - public abstract Optional> topics(); - - /** - * Optional. Input only. Represents the TTL for this resource. The expiration time is computed: - * now + TTL. - */ - @JsonProperty("ttl") - public abstract Optional ttl(); - - /** Output only. Represents the timestamp when this Memory was most recently updated. */ - @JsonProperty("updateTime") - public abstract Optional updateTime(); - - /** - * Optional. Represents the type of the memory. If not set, the `NATURAL_LANGUAGE_COLLECTION` type - * is used. If `STRUCTURED_COLLECTION` or `STRUCTURED_PROFILE` is used, then `structured_data` - * must be provided. - */ - @JsonProperty("memoryType") - public abstract Optional memoryType(); - - /** Optional. Represents the structured content of the memory. */ - @JsonProperty("structuredContent") - public abstract Optional structuredContent(); - - /** Instantiates a builder for Memory. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_Memory.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for Memory. */ - @AutoValue.Builder - public abstract static class Builder { - /** For internal usage. Please use `Memory.builder()` for instantiation. */ - @JsonCreator - private static Builder create() { - return new AutoValue_Memory.Builder(); - } - - /** - * Setter for createTime. - * - *

createTime: Output only. Represents the timestamp when this Memory 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 description. - * - *

description: Optional. Represents the description of the Memory. - */ - @JsonProperty("description") - public abstract Builder description(String description); - - @ExcludeFromGeneratedCoverageReport - abstract Builder description(Optional description); - - /** Clears the value of description field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearDescription() { - return description(Optional.empty()); - } - - /** - * Setter for disableMemoryRevisions. - * - *

disableMemoryRevisions: Optional. Input only. Indicates whether no revision will be - * created for this request. - */ - @JsonProperty("disableMemoryRevisions") - public abstract Builder disableMemoryRevisions(boolean disableMemoryRevisions); - - @ExcludeFromGeneratedCoverageReport - abstract Builder disableMemoryRevisions(Optional disableMemoryRevisions); - - /** Clears the value of disableMemoryRevisions field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearDisableMemoryRevisions() { - return disableMemoryRevisions(Optional.empty()); - } - - /** - * Setter for displayName. - * - *

displayName: Optional. Represents the display name of the Memory. - */ - @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: Optional. Represents the timestamp of when this resource is considered - * expired. This is *always* provided on output when `expiration` is set on input, regardless of - * whether `expire_time` or `ttl` was provided. - */ - @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 fact. - * - *

fact: Optional. Represents semantic knowledge extracted from the source content. - */ - @JsonProperty("fact") - public abstract Builder fact(String fact); - - @ExcludeFromGeneratedCoverageReport - abstract Builder fact(Optional fact); - - /** Clears the value of fact field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearFact() { - return fact(Optional.empty()); - } - - /** - * Setter for metadata. - * - *

metadata: Optional. Represents user-provided metadata for the Memory. This information was - * provided when creating, updating, or generating the Memory. It was not generated by Memory - * Bank. - */ - @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 name. - * - *

name: Identifier. Represents the resource name of the Memory. Format: - * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/memories/{memory}` - */ - @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 revisionExpireTime. - * - *

revisionExpireTime: Optional. Input only. Represents the timestamp of when the revision is - * considered expired. If not set, the memory revision will be kept until manually deleted. - */ - @JsonProperty("revisionExpireTime") - public abstract Builder revisionExpireTime(Instant revisionExpireTime); - - @ExcludeFromGeneratedCoverageReport - abstract Builder revisionExpireTime(Optional revisionExpireTime); - - /** Clears the value of revisionExpireTime field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearRevisionExpireTime() { - return revisionExpireTime(Optional.empty()); - } - - /** - * Setter for revisionLabels. - * - *

revisionLabels: Optional. Input only. Represents the labels to apply to the Memory - * Revision created as a result of this request. - */ - @JsonProperty("revisionLabels") - public abstract Builder revisionLabels(Map revisionLabels); - - @ExcludeFromGeneratedCoverageReport - abstract Builder revisionLabels(Optional> revisionLabels); - - /** Clears the value of revisionLabels field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearRevisionLabels() { - return revisionLabels(Optional.empty()); - } - - /** - * Setter for revisionTtl. - * - *

revisionTtl: Optional. Input only. Represents the TTL for the revision. The expiration - * time is computed: now + TTL. - */ - @JsonProperty("revisionTtl") - public abstract Builder revisionTtl(Duration revisionTtl); - - @ExcludeFromGeneratedCoverageReport - abstract Builder revisionTtl(Optional revisionTtl); - - /** Clears the value of revisionTtl field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearRevisionTtl() { - return revisionTtl(Optional.empty()); - } - - /** - * Setter for scope. - * - *

scope: Required. Immutable. Represents the scope of the Memory. Memories are isolated - * within their scope. The scope is defined when creating or generating memories. Scope values - * cannot contain the wildcard character '*'. - */ - @JsonProperty("scope") - public abstract Builder scope(Map scope); - - @ExcludeFromGeneratedCoverageReport - abstract Builder scope(Optional> scope); - - /** Clears the value of scope field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearScope() { - return scope(Optional.empty()); - } - - /** - * Setter for topics. - * - *

topics: Optional. Represents the Topics of the Memory. - */ - @JsonProperty("topics") - public abstract Builder topics(List topics); - - /** - * Setter for topics. - * - *

topics: Optional. Represents the Topics of the Memory. - */ - @CanIgnoreReturnValue - public Builder topics(MemoryTopicId... topics) { - return topics(Arrays.asList(topics)); - } - - /** - * Setter for topics builder. - * - *

topics: Optional. Represents the Topics of the Memory. - */ - @CanIgnoreReturnValue - public Builder topics(MemoryTopicId.Builder... topicsBuilders) { - return topics( - Arrays.asList(topicsBuilders).stream() - .map(MemoryTopicId.Builder::build) - .collect(toImmutableList())); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder topics(Optional> topics); - - /** Clears the value of topics field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearTopics() { - return topics(Optional.empty()); - } - - /** - * Setter for ttl. - * - *

ttl: Optional. Input only. Represents 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 updateTime. - * - *

updateTime: Output only. Represents the timestamp when this Memory 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()); - } - - /** - * Setter for memoryType. - * - *

memoryType: Optional. Represents the type of the memory. If not set, the - * `NATURAL_LANGUAGE_COLLECTION` type is used. If `STRUCTURED_COLLECTION` or - * `STRUCTURED_PROFILE` is used, then `structured_data` must be provided. - */ - @JsonProperty("memoryType") - public abstract Builder memoryType(MemoryType memoryType); - - @ExcludeFromGeneratedCoverageReport - abstract Builder memoryType(Optional memoryType); - - /** Clears the value of memoryType field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearMemoryType() { - return memoryType(Optional.empty()); - } - - /** - * Setter for memoryType given a known enum. - * - *

memoryType: Optional. Represents the type of the memory. If not set, the - * `NATURAL_LANGUAGE_COLLECTION` type is used. If `STRUCTURED_COLLECTION` or - * `STRUCTURED_PROFILE` is used, then `structured_data` must be provided. - */ - @CanIgnoreReturnValue - public Builder memoryType(MemoryType.Known knownType) { - return memoryType(new MemoryType(knownType)); - } - - /** - * Setter for memoryType given a string. - * - *

memoryType: Optional. Represents the type of the memory. If not set, the - * `NATURAL_LANGUAGE_COLLECTION` type is used. If `STRUCTURED_COLLECTION` or - * `STRUCTURED_PROFILE` is used, then `structured_data` must be provided. - */ - @CanIgnoreReturnValue - public Builder memoryType(String memoryType) { - return memoryType(new MemoryType(memoryType)); - } - - /** - * Setter for structuredContent. - * - *

structuredContent: Optional. Represents the structured content of the memory. - */ - @JsonProperty("structuredContent") - public abstract Builder structuredContent(MemoryStructuredContent structuredContent); - - /** - * Setter for structuredContent builder. - * - *

structuredContent: Optional. Represents the structured content of the memory. - */ - @CanIgnoreReturnValue - public Builder structuredContent(MemoryStructuredContent.Builder structuredContentBuilder) { - return structuredContent(structuredContentBuilder.build()); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder structuredContent(Optional structuredContent); - - /** Clears the value of structuredContent field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearStructuredContent() { - return structuredContent(Optional.empty()); - } - - public abstract Memory build(); - } - - /** Deserializes a JSON string to a Memory object. */ - @ExcludeFromGeneratedCoverageReport - public static Memory fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, Memory.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/MemoryBankIngestEventsOperation.java b/src/main/java/com/google/cloud/agentplatform/types/MemoryBankIngestEventsOperation.java deleted file mode 100644 index 825229f..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/MemoryBankIngestEventsOperation.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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 ingests events into a memory bank. */ -@AutoValue -@JsonDeserialize(builder = MemoryBankIngestEventsOperation.Builder.class) -public abstract class MemoryBankIngestEventsOperation 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 MemoryBankIngestEventsOperation. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_MemoryBankIngestEventsOperation.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for MemoryBankIngestEventsOperation. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `MemoryBankIngestEventsOperation.builder()` for instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_MemoryBankIngestEventsOperation.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 MemoryBankIngestEventsOperation build(); - } - - /** Deserializes a JSON string to a MemoryBankIngestEventsOperation object. */ - @ExcludeFromGeneratedCoverageReport - public static MemoryBankIngestEventsOperation fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, MemoryBankIngestEventsOperation.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/MemoryConjunctionFilter.java b/src/main/java/com/google/cloud/agentplatform/types/MemoryConjunctionFilter.java deleted file mode 100644 index 8e438ae..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/MemoryConjunctionFilter.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * 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 conjunction filter for memories. */ -@AutoValue -@JsonDeserialize(builder = MemoryConjunctionFilter.Builder.class) -public abstract class MemoryConjunctionFilter extends JsonSerializable { - /** Represents filters that will be combined using AND logic. */ - @JsonProperty("filters") - public abstract Optional> filters(); - - /** Instantiates a builder for MemoryConjunctionFilter. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_MemoryConjunctionFilter.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for MemoryConjunctionFilter. */ - @AutoValue.Builder - public abstract static class Builder { - /** For internal usage. Please use `MemoryConjunctionFilter.builder()` for instantiation. */ - @JsonCreator - private static Builder create() { - return new AutoValue_MemoryConjunctionFilter.Builder(); - } - - /** - * Setter for filters. - * - *

filters: Represents filters that will be combined using AND logic. - */ - @JsonProperty("filters") - public abstract Builder filters(List filters); - - /** - * Setter for filters. - * - *

filters: Represents filters that will be combined using AND logic. - */ - @CanIgnoreReturnValue - public Builder filters(MemoryFilter... filters) { - return filters(Arrays.asList(filters)); - } - - /** - * Setter for filters builder. - * - *

filters: Represents filters that will be combined using AND logic. - */ - @CanIgnoreReturnValue - public Builder filters(MemoryFilter.Builder... filtersBuilders) { - return filters( - Arrays.asList(filtersBuilders).stream() - .map(MemoryFilter.Builder::build) - .collect(toImmutableList())); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder filters(Optional> filters); - - /** Clears the value of filters field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearFilters() { - return filters(Optional.empty()); - } - - public abstract MemoryConjunctionFilter build(); - } - - /** Deserializes a JSON string to a MemoryConjunctionFilter object. */ - @ExcludeFromGeneratedCoverageReport - public static MemoryConjunctionFilter fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, MemoryConjunctionFilter.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/MemoryFilter.java b/src/main/java/com/google/cloud/agentplatform/types/MemoryFilter.java deleted file mode 100644 index 78187fd..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/MemoryFilter.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * 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; - -/** Filter to apply when retrieving memories. */ -@AutoValue -@JsonDeserialize(builder = MemoryFilter.Builder.class) -public abstract class MemoryFilter extends JsonSerializable { - /** - * Represents the key of the filter. For example, "author" would apply to `metadata` entries with - * the key "author". - */ - @JsonProperty("key") - public abstract Optional key(); - - /** Indicates whether the filter will be negated. */ - @JsonProperty("negate") - public abstract Optional negate(); - - /** Represents the operator to apply to the filter. If not set, then EQUAL will be used. */ - @JsonProperty("op") - public abstract Optional op(); - - /** Represents the value to compare to. */ - @JsonProperty("value") - public abstract Optional value(); - - /** Instantiates a builder for MemoryFilter. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_MemoryFilter.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for MemoryFilter. */ - @AutoValue.Builder - public abstract static class Builder { - /** For internal usage. Please use `MemoryFilter.builder()` for instantiation. */ - @JsonCreator - private static Builder create() { - return new AutoValue_MemoryFilter.Builder(); - } - - /** - * Setter for key. - * - *

key: Represents the key of the filter. For example, "author" would apply to `metadata` - * entries with the key "author". - */ - @JsonProperty("key") - public abstract Builder key(String key); - - @ExcludeFromGeneratedCoverageReport - abstract Builder key(Optional key); - - /** Clears the value of key field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearKey() { - return key(Optional.empty()); - } - - /** - * Setter for negate. - * - *

negate: Indicates whether the filter will be negated. - */ - @JsonProperty("negate") - public abstract Builder negate(boolean negate); - - @ExcludeFromGeneratedCoverageReport - abstract Builder negate(Optional negate); - - /** Clears the value of negate field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearNegate() { - return negate(Optional.empty()); - } - - /** - * Setter for op. - * - *

op: Represents the operator to apply to the filter. If not set, then EQUAL will be used. - */ - @JsonProperty("op") - public abstract Builder op(Operator op); - - @ExcludeFromGeneratedCoverageReport - abstract Builder op(Optional op); - - /** Clears the value of op field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearOp() { - return op(Optional.empty()); - } - - /** - * Setter for op given a known enum. - * - *

op: Represents the operator to apply to the filter. If not set, then EQUAL will be used. - */ - @CanIgnoreReturnValue - public Builder op(Operator.Known knownType) { - return op(new Operator(knownType)); - } - - /** - * Setter for op given a string. - * - *

op: Represents the operator to apply to the filter. If not set, then EQUAL will be used. - */ - @CanIgnoreReturnValue - public Builder op(String op) { - return op(new Operator(op)); - } - - /** - * Setter for value. - * - *

value: Represents the value to compare to. - */ - @JsonProperty("value") - public abstract Builder value(MemoryMetadataValue value); - - /** - * Setter for value builder. - * - *

value: Represents the value to compare to. - */ - @CanIgnoreReturnValue - public Builder value(MemoryMetadataValue.Builder valueBuilder) { - return value(valueBuilder.build()); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder value(Optional value); - - /** Clears the value of value field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearValue() { - return value(Optional.empty()); - } - - public abstract MemoryFilter build(); - } - - /** Deserializes a JSON string to a MemoryFilter object. */ - @ExcludeFromGeneratedCoverageReport - public static MemoryFilter fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, MemoryFilter.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/MemoryGenerationTriggerConfig.java b/src/main/java/com/google/cloud/agentplatform/types/MemoryGenerationTriggerConfig.java index bd3bd50..84a55c1 100644 --- a/src/main/java/com/google/cloud/agentplatform/types/MemoryGenerationTriggerConfig.java +++ b/src/main/java/com/google/cloud/agentplatform/types/MemoryGenerationTriggerConfig.java @@ -26,7 +26,7 @@ import com.google.genai.JsonSerializable; import java.util.Optional; -/** The configuration for triggering memory generation for ingested events. */ +/** Represents configuration for triggering generation. */ @AutoValue @JsonDeserialize(builder = MemoryGenerationTriggerConfig.Builder.class) public abstract class MemoryGenerationTriggerConfig extends JsonSerializable { diff --git a/src/main/java/com/google/cloud/agentplatform/types/MemoryMetadataMergeStrategy.java b/src/main/java/com/google/cloud/agentplatform/types/MemoryMetadataMergeStrategy.java deleted file mode 100644 index 0f8aa60..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/MemoryMetadataMergeStrategy.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * 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 strategy to use when applying metadata to existing memories during consolidation. */ -public class MemoryMetadataMergeStrategy { - - /** Enum representing the known values for MemoryMetadataMergeStrategy. */ - public enum Known { - /** The metadata merge strategy is unspecified. */ - METADATA_MERGE_STRATEGY_UNSPECIFIED, - - /** Replace the metadata of the updated memories with the new metadata. */ - OVERWRITE, - - /** - * Append new metadata to the existing metadata. If there are duplicate keys, the existing - * values will be overwritten. - */ - MERGE, - - /** - * Restrict consolidation to memories that have exactly the same metadata as the request. If a - * memory doesn't have the same metadata, it is not eligible for consolidation. - */ - REQUIRE_EXACT_MATCH, - - MEMORY_METADATA_MERGE_STRATEGY_UNSPECIFIED - } - - private Known memoryMetadataMergeStrategyEnum; - private final String value; - - @JsonCreator - public MemoryMetadataMergeStrategy(String value) { - this.value = value; - for (Known memoryMetadataMergeStrategyEnum : Known.values()) { - if (Ascii.equalsIgnoreCase(memoryMetadataMergeStrategyEnum.toString(), value)) { - this.memoryMetadataMergeStrategyEnum = memoryMetadataMergeStrategyEnum; - break; - } - } - if (this.memoryMetadataMergeStrategyEnum == null) { - this.memoryMetadataMergeStrategyEnum = Known.MEMORY_METADATA_MERGE_STRATEGY_UNSPECIFIED; - } - } - - public MemoryMetadataMergeStrategy(Known knownValue) { - this.memoryMetadataMergeStrategyEnum = 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 MemoryMetadataMergeStrategy)) { - return false; - } - - MemoryMetadataMergeStrategy other = (MemoryMetadataMergeStrategy) o; - - if (this.memoryMetadataMergeStrategyEnum != Known.MEMORY_METADATA_MERGE_STRATEGY_UNSPECIFIED - && other.memoryMetadataMergeStrategyEnum - != Known.MEMORY_METADATA_MERGE_STRATEGY_UNSPECIFIED) { - return this.memoryMetadataMergeStrategyEnum == other.memoryMetadataMergeStrategyEnum; - } else if (this.memoryMetadataMergeStrategyEnum - == Known.MEMORY_METADATA_MERGE_STRATEGY_UNSPECIFIED - && other.memoryMetadataMergeStrategyEnum - == Known.MEMORY_METADATA_MERGE_STRATEGY_UNSPECIFIED) { - return this.value.equals(other.value); - } - return false; - } - - @ExcludeFromGeneratedCoverageReport - @Override - public int hashCode() { - if (this.memoryMetadataMergeStrategyEnum != Known.MEMORY_METADATA_MERGE_STRATEGY_UNSPECIFIED) { - return this.memoryMetadataMergeStrategyEnum.hashCode(); - } else { - return Objects.hashCode(this.value); - } - } - - @ExcludeFromGeneratedCoverageReport - public Known knownEnum() { - return this.memoryMetadataMergeStrategyEnum; - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/MemoryMetadataValue.java b/src/main/java/com/google/cloud/agentplatform/types/MemoryMetadataValue.java deleted file mode 100644 index bf97123..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/MemoryMetadataValue.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * 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; - -/** The metadata values for memories. */ -@AutoValue -@JsonDeserialize(builder = MemoryMetadataValue.Builder.class) -public abstract class MemoryMetadataValue extends JsonSerializable { - /** Represents a boolean value. */ - @JsonProperty("boolValue") - public abstract Optional boolValue(); - - /** Represents a double value. */ - @JsonProperty("doubleValue") - public abstract Optional doubleValue(); - - /** Represents a string value. */ - @JsonProperty("stringValue") - public abstract Optional stringValue(); - - /** - * Represents a timestamp value. When filtering on timestamp values, only the seconds field will - * be compared. - */ - @JsonProperty("timestampValue") - public abstract Optional timestampValue(); - - /** Instantiates a builder for MemoryMetadataValue. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_MemoryMetadataValue.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for MemoryMetadataValue. */ - @AutoValue.Builder - public abstract static class Builder { - /** For internal usage. Please use `MemoryMetadataValue.builder()` for instantiation. */ - @JsonCreator - private static Builder create() { - return new AutoValue_MemoryMetadataValue.Builder(); - } - - /** - * Setter for boolValue. - * - *

boolValue: Represents a boolean value. - */ - @JsonProperty("boolValue") - public abstract Builder boolValue(boolean boolValue); - - @ExcludeFromGeneratedCoverageReport - abstract Builder boolValue(Optional boolValue); - - /** Clears the value of boolValue field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearBoolValue() { - return boolValue(Optional.empty()); - } - - /** - * Setter for doubleValue. - * - *

doubleValue: Represents a double value. - */ - @JsonProperty("doubleValue") - public abstract Builder doubleValue(Double doubleValue); - - @ExcludeFromGeneratedCoverageReport - abstract Builder doubleValue(Optional doubleValue); - - /** Clears the value of doubleValue field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearDoubleValue() { - return doubleValue(Optional.empty()); - } - - /** - * Setter for stringValue. - * - *

stringValue: Represents a string value. - */ - @JsonProperty("stringValue") - public abstract Builder stringValue(String stringValue); - - @ExcludeFromGeneratedCoverageReport - abstract Builder stringValue(Optional stringValue); - - /** Clears the value of stringValue field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearStringValue() { - return stringValue(Optional.empty()); - } - - /** - * Setter for timestampValue. - * - *

timestampValue: Represents a timestamp value. When filtering on timestamp values, only the - * seconds field will be compared. - */ - @JsonProperty("timestampValue") - public abstract Builder timestampValue(Instant timestampValue); - - @ExcludeFromGeneratedCoverageReport - abstract Builder timestampValue(Optional timestampValue); - - /** Clears the value of timestampValue field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearTimestampValue() { - return timestampValue(Optional.empty()); - } - - public abstract MemoryMetadataValue build(); - } - - /** Deserializes a JSON string to a MemoryMetadataValue object. */ - @ExcludeFromGeneratedCoverageReport - public static MemoryMetadataValue fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, MemoryMetadataValue.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/MemoryProfile.java b/src/main/java/com/google/cloud/agentplatform/types/MemoryProfile.java deleted file mode 100644 index d9a2f9a..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/MemoryProfile.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * 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; - -/** A memory profile. */ -@AutoValue -@JsonDeserialize(builder = MemoryProfile.Builder.class) -public abstract class MemoryProfile extends JsonSerializable { - /** - * Represents the ID of the schema. This ID corresponds to the `schema_id` defined inside the - * SchemaConfig, under StructuredMemoryCustomizationConfig. - */ - @JsonProperty("schemaId") - public abstract Optional schemaId(); - - /** Represents the profile data. */ - @JsonProperty("profile") - public abstract Optional> profile(); - - /** Instantiates a builder for MemoryProfile. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_MemoryProfile.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for MemoryProfile. */ - @AutoValue.Builder - public abstract static class Builder { - /** For internal usage. Please use `MemoryProfile.builder()` for instantiation. */ - @JsonCreator - private static Builder create() { - return new AutoValue_MemoryProfile.Builder(); - } - - /** - * Setter for schemaId. - * - *

schemaId: Represents the ID of the schema. This ID corresponds to the `schema_id` defined - * inside the SchemaConfig, under StructuredMemoryCustomizationConfig. - */ - @JsonProperty("schemaId") - public abstract Builder schemaId(String schemaId); - - @ExcludeFromGeneratedCoverageReport - abstract Builder schemaId(Optional schemaId); - - /** Clears the value of schemaId field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearSchemaId() { - return schemaId(Optional.empty()); - } - - /** - * Setter for profile. - * - *

profile: Represents the profile data. - */ - @JsonProperty("profile") - public abstract Builder profile(Map profile); - - @ExcludeFromGeneratedCoverageReport - abstract Builder profile(Optional> profile); - - /** Clears the value of profile field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearProfile() { - return profile(Optional.empty()); - } - - public abstract MemoryProfile build(); - } - - /** Deserializes a JSON string to a MemoryProfile object. */ - @ExcludeFromGeneratedCoverageReport - public static MemoryProfile fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, MemoryProfile.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/MemoryRevision.java b/src/main/java/com/google/cloud/agentplatform/types/MemoryRevision.java deleted file mode 100644 index bc59566..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/MemoryRevision.java +++ /dev/null @@ -1,271 +0,0 @@ -/* - * 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.time.Instant; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.Optional; - -/** A memory revision. */ -@AutoValue -@JsonDeserialize(builder = MemoryRevision.Builder.class) -public abstract class MemoryRevision extends JsonSerializable { - /** Output only. Represents the timestamp when this Memory Revision was created. */ - @JsonProperty("createTime") - public abstract Optional createTime(); - - /** Output only. Represents the timestamp of when this resource is considered expired. */ - @JsonProperty("expireTime") - public abstract Optional expireTime(); - - /** - * Output only. Represents the extracted memories from the source content before consolidation - * when the memory was updated via GenerateMemories. This information was used to modify an - * existing Memory via Consolidation. - */ - @JsonProperty("extractedMemories") - public abstract Optional> extractedMemories(); - - /** - * Output only. Represents the fact of the Memory Revision. This corresponds to the `fact` field - * of the parent Memory at the time of revision creation. - */ - @JsonProperty("fact") - public abstract Optional fact(); - - /** - * Output only. Represents the labels of the Memory Revision. These labels are applied to the - * MemoryRevision when it is created based on `GenerateMemoriesRequest.revision_labels`. - */ - @JsonProperty("labels") - public abstract Optional> labels(); - - /** - * Identifier. Represents the resource name of the Memory Revision. Format: - * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/memories/{memory}/revisions/{memory_revision}` - */ - @JsonProperty("name") - public abstract Optional name(); - - /** - * Output only. Represents the structured value of the memory at the time of revision creation. - */ - @JsonProperty("structuredData") - public abstract Optional> structuredData(); - - /** Instantiates a builder for MemoryRevision. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_MemoryRevision.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for MemoryRevision. */ - @AutoValue.Builder - public abstract static class Builder { - /** For internal usage. Please use `MemoryRevision.builder()` for instantiation. */ - @JsonCreator - private static Builder create() { - return new AutoValue_MemoryRevision.Builder(); - } - - /** - * Setter for createTime. - * - *

createTime: Output only. Represents the timestamp when this Memory Revision 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 expireTime. - * - *

expireTime: Output only. Represents the timestamp of when this resource is considered - * expired. - */ - @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 extractedMemories. - * - *

extractedMemories: Output only. Represents the extracted memories from the source content - * before consolidation when the memory was updated via GenerateMemories. This information was - * used to modify an existing Memory via Consolidation. - */ - @JsonProperty("extractedMemories") - public abstract Builder extractedMemories(List extractedMemories); - - /** - * Setter for extractedMemories. - * - *

extractedMemories: Output only. Represents the extracted memories from the source content - * before consolidation when the memory was updated via GenerateMemories. This information was - * used to modify an existing Memory via Consolidation. - */ - @CanIgnoreReturnValue - public Builder extractedMemories(IntermediateExtractedMemory... extractedMemories) { - return extractedMemories(Arrays.asList(extractedMemories)); - } - - /** - * Setter for extractedMemories builder. - * - *

extractedMemories: Output only. Represents the extracted memories from the source content - * before consolidation when the memory was updated via GenerateMemories. This information was - * used to modify an existing Memory via Consolidation. - */ - @CanIgnoreReturnValue - public Builder extractedMemories( - IntermediateExtractedMemory.Builder... extractedMemoriesBuilders) { - return extractedMemories( - Arrays.asList(extractedMemoriesBuilders).stream() - .map(IntermediateExtractedMemory.Builder::build) - .collect(toImmutableList())); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder extractedMemories( - Optional> extractedMemories); - - /** Clears the value of extractedMemories field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearExtractedMemories() { - return extractedMemories(Optional.empty()); - } - - /** - * Setter for fact. - * - *

fact: Output only. Represents the fact of the Memory Revision. This corresponds to the - * `fact` field of the parent Memory at the time of revision creation. - */ - @JsonProperty("fact") - public abstract Builder fact(String fact); - - @ExcludeFromGeneratedCoverageReport - abstract Builder fact(Optional fact); - - /** Clears the value of fact field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearFact() { - return fact(Optional.empty()); - } - - /** - * Setter for labels. - * - *

labels: Output only. Represents the labels of the Memory Revision. These labels are - * applied to the MemoryRevision when it is created based on - * `GenerateMemoriesRequest.revision_labels`. - */ - @JsonProperty("labels") - public abstract Builder labels(Map labels); - - @ExcludeFromGeneratedCoverageReport - abstract Builder labels(Optional> labels); - - /** Clears the value of labels field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearLabels() { - return labels(Optional.empty()); - } - - /** - * Setter for name. - * - *

name: Identifier. Represents the resource name of the Memory Revision. Format: - * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/memories/{memory}/revisions/{memory_revision}` - */ - @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 structuredData. - * - *

structuredData: Output only. Represents the structured value of the memory at the time of - * revision creation. - */ - @JsonProperty("structuredData") - public abstract Builder structuredData(Map structuredData); - - @ExcludeFromGeneratedCoverageReport - abstract Builder structuredData(Optional> structuredData); - - /** Clears the value of structuredData field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearStructuredData() { - return structuredData(Optional.empty()); - } - - public abstract MemoryRevision build(); - } - - /** Deserializes a JSON string to a MemoryRevision object. */ - @ExcludeFromGeneratedCoverageReport - public static MemoryRevision fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, MemoryRevision.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/MemoryStructuredContent.java b/src/main/java/com/google/cloud/agentplatform/types/MemoryStructuredContent.java deleted file mode 100644 index a19996d..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/MemoryStructuredContent.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * 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; - -/** Represents the structured value of the memory. */ -@AutoValue -@JsonDeserialize(builder = MemoryStructuredContent.Builder.class) -public abstract class MemoryStructuredContent extends JsonSerializable { - /** Required. Represents the structured value of the memory. */ - @JsonProperty("data") - public abstract Optional> data(); - - /** Required. Represents the schema ID for which this structured memory belongs to. */ - @JsonProperty("schemaId") - public abstract Optional schemaId(); - - /** Instantiates a builder for MemoryStructuredContent. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_MemoryStructuredContent.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for MemoryStructuredContent. */ - @AutoValue.Builder - public abstract static class Builder { - /** For internal usage. Please use `MemoryStructuredContent.builder()` for instantiation. */ - @JsonCreator - private static Builder create() { - return new AutoValue_MemoryStructuredContent.Builder(); - } - - /** - * Setter for data. - * - *

data: Required. Represents the structured value of the memory. - */ - @JsonProperty("data") - public abstract Builder data(Map data); - - @ExcludeFromGeneratedCoverageReport - abstract Builder data(Optional> data); - - /** Clears the value of data field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearData() { - return data(Optional.empty()); - } - - /** - * Setter for schemaId. - * - *

schemaId: Required. Represents the schema ID for which this structured memory belongs to. - */ - @JsonProperty("schemaId") - public abstract Builder schemaId(String schemaId); - - @ExcludeFromGeneratedCoverageReport - abstract Builder schemaId(Optional schemaId); - - /** Clears the value of schemaId field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearSchemaId() { - return schemaId(Optional.empty()); - } - - public abstract MemoryStructuredContent build(); - } - - /** Deserializes a JSON string to a MemoryStructuredContent object. */ - @ExcludeFromGeneratedCoverageReport - public static MemoryStructuredContent fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, MemoryStructuredContent.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/MemoryTopicId.java b/src/main/java/com/google/cloud/agentplatform/types/MemoryTopicId.java index 58bc383..81f47ac 100644 --- a/src/main/java/com/google/cloud/agentplatform/types/MemoryTopicId.java +++ b/src/main/java/com/google/cloud/agentplatform/types/MemoryTopicId.java @@ -26,7 +26,10 @@ import com.google.genai.JsonSerializable; import java.util.Optional; -/** The topic ID for a memory. */ +/** + * A memory topic identifier. This will be used to label a Memory and to restrict which topics are + * eligible for generation or retrieval. + */ @AutoValue @JsonDeserialize(builder = MemoryTopicId.Builder.class) public abstract class MemoryTopicId extends JsonSerializable { diff --git a/src/main/java/com/google/cloud/agentplatform/types/Operator.java b/src/main/java/com/google/cloud/agentplatform/types/Operator.java deleted file mode 100644 index 3aaedb4..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/Operator.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * 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; - -/** Represents the operator to apply to the filter. If not set, then EQUAL will be used. */ -public class Operator { - - /** Enum representing the known values for Operator. */ - public enum Known { - /** Represents an unspecified operator. Defaults to EQUAL. */ - OPERATOR_UNSPECIFIED, - - /** Equal to. */ - EQUAL, - - /** Greater than. */ - GREATER_THAN, - - /** Less than. */ - LESS_THAN - } - - private Known operatorEnum; - private final String value; - - @JsonCreator - public Operator(String value) { - this.value = value; - for (Known operatorEnum : Known.values()) { - if (Ascii.equalsIgnoreCase(operatorEnum.toString(), value)) { - this.operatorEnum = operatorEnum; - break; - } - } - if (this.operatorEnum == null) { - this.operatorEnum = Known.OPERATOR_UNSPECIFIED; - } - } - - public Operator(Known knownValue) { - this.operatorEnum = 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 Operator)) { - return false; - } - - Operator other = (Operator) o; - - if (this.operatorEnum != Known.OPERATOR_UNSPECIFIED - && other.operatorEnum != Known.OPERATOR_UNSPECIFIED) { - return this.operatorEnum == other.operatorEnum; - } else if (this.operatorEnum == Known.OPERATOR_UNSPECIFIED - && other.operatorEnum == Known.OPERATOR_UNSPECIFIED) { - return this.value.equals(other.value); - } - return false; - } - - @ExcludeFromGeneratedCoverageReport - @Override - public int hashCode() { - if (this.operatorEnum != Known.OPERATOR_UNSPECIFIED) { - return this.operatorEnum.hashCode(); - } else { - return Objects.hashCode(this.value); - } - } - - @ExcludeFromGeneratedCoverageReport - public Known knownEnum() { - return this.operatorEnum; - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/PurgeAgentEngineMemoriesConfig.java b/src/main/java/com/google/cloud/agentplatform/types/PurgeAgentEngineMemoriesConfig.java deleted file mode 100644 index 8b88b39..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/PurgeAgentEngineMemoriesConfig.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * 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 purging memories. */ -@AutoValue -@JsonDeserialize(builder = PurgeAgentEngineMemoriesConfig.Builder.class) -public abstract class PurgeAgentEngineMemoriesConfig extends JsonSerializable { - /** Used to override HTTP request options. */ - @JsonProperty("httpOptions") - public abstract Optional httpOptions(); - - /** Waits for the operation to complete before returning. */ - @JsonProperty("waitForCompletion") - public abstract Optional waitForCompletion(); - - /** Instantiates a builder for PurgeAgentEngineMemoriesConfig. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_PurgeAgentEngineMemoriesConfig.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for PurgeAgentEngineMemoriesConfig. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `PurgeAgentEngineMemoriesConfig.builder()` for instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_PurgeAgentEngineMemoriesConfig.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 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 PurgeAgentEngineMemoriesConfig build(); - } - - /** Deserializes a JSON string to a PurgeAgentEngineMemoriesConfig object. */ - @ExcludeFromGeneratedCoverageReport - public static PurgeAgentEngineMemoriesConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, PurgeAgentEngineMemoriesConfig.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/PurgeAgentEngineMemoriesRequestParameters.java b/src/main/java/com/google/cloud/agentplatform/types/PurgeAgentEngineMemoriesRequestParameters.java deleted file mode 100644 index 8ec52da..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/PurgeAgentEngineMemoriesRequestParameters.java +++ /dev/null @@ -1,254 +0,0 @@ -/* - * 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.api.core.InternalApi; -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; - -/** Parameters for purging agent engine memories. */ -@AutoValue -@InternalApi -@JsonDeserialize(builder = PurgeAgentEngineMemoriesRequestParameters.Builder.class) -public abstract class PurgeAgentEngineMemoriesRequestParameters extends JsonSerializable { - /** Name of the Agent Engine to purge memories from. */ - @JsonProperty("name") - public abstract Optional name(); - - /** - * The standard list filter to determine which memories to purge. More detail in - * [AIP-160](https://google.aip.dev/160). - */ - @JsonProperty("filter") - public abstract Optional filter(); - - /** - * Metadata filters that will be applied to the memories' `metadata` using OR logic. Filters are - * defined using disjunctive normal form (OR of ANDs). - * - *

For example: `filter_groups: [{filters: [{key: "author", value: {string_value: "agent - * `123"}, op: EQUAL}]}, {filters: [{key: "label", value: {string_value: "travel"}, op: EQUAL}, - * {key: "author", value: {string_value: "agent 321"}, op: EQUAL}]}]` - * - *

would be equivalent to the logical expression: `(metadata.author = "agent 123" OR - * (metadata.label = "travel" AND metadata.author = "agent 321"))`. - */ - @JsonProperty("filterGroups") - public abstract Optional> filterGroups(); - - /** - * If true, the memories will actually be purged. If false, the purge request will be validated - * but not executed. - */ - @JsonProperty("force") - public abstract Optional force(); - - /** */ - @JsonProperty("config") - public abstract Optional config(); - - /** Instantiates a builder for PurgeAgentEngineMemoriesRequestParameters. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_PurgeAgentEngineMemoriesRequestParameters.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for PurgeAgentEngineMemoriesRequestParameters. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `PurgeAgentEngineMemoriesRequestParameters.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_PurgeAgentEngineMemoriesRequestParameters.Builder(); - } - - /** - * Setter for name. - * - *

name: Name of the Agent Engine to purge memories 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 filter. - * - *

filter: The standard list filter to determine which memories to purge. More detail in - * [AIP-160](https://google.aip.dev/160). - */ - @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()); - } - - /** - * Setter for filterGroups. - * - *

filterGroups: Metadata filters that will be applied to the memories' `metadata` using OR - * logic. Filters are defined using disjunctive normal form (OR of ANDs). - * - *

For example: `filter_groups: [{filters: [{key: "author", value: {string_value: "agent - * `123"}, op: EQUAL}]}, {filters: [{key: "label", value: {string_value: "travel"}, op: EQUAL}, - * {key: "author", value: {string_value: "agent 321"}, op: EQUAL}]}]` - * - *

would be equivalent to the logical expression: `(metadata.author = "agent 123" OR - * (metadata.label = "travel" AND metadata.author = "agent 321"))`. - */ - @JsonProperty("filterGroups") - public abstract Builder filterGroups(List filterGroups); - - /** - * Setter for filterGroups. - * - *

filterGroups: Metadata filters that will be applied to the memories' `metadata` using OR - * logic. Filters are defined using disjunctive normal form (OR of ANDs). - * - *

For example: `filter_groups: [{filters: [{key: "author", value: {string_value: "agent - * `123"}, op: EQUAL}]}, {filters: [{key: "label", value: {string_value: "travel"}, op: EQUAL}, - * {key: "author", value: {string_value: "agent 321"}, op: EQUAL}]}]` - * - *

would be equivalent to the logical expression: `(metadata.author = "agent 123" OR - * (metadata.label = "travel" AND metadata.author = "agent 321"))`. - */ - @CanIgnoreReturnValue - public Builder filterGroups(MemoryConjunctionFilter... filterGroups) { - return filterGroups(Arrays.asList(filterGroups)); - } - - /** - * Setter for filterGroups builder. - * - *

filterGroups: Metadata filters that will be applied to the memories' `metadata` using OR - * logic. Filters are defined using disjunctive normal form (OR of ANDs). - * - *

For example: `filter_groups: [{filters: [{key: "author", value: {string_value: "agent - * `123"}, op: EQUAL}]}, {filters: [{key: "label", value: {string_value: "travel"}, op: EQUAL}, - * {key: "author", value: {string_value: "agent 321"}, op: EQUAL}]}]` - * - *

would be equivalent to the logical expression: `(metadata.author = "agent 123" OR - * (metadata.label = "travel" AND metadata.author = "agent 321"))`. - */ - @CanIgnoreReturnValue - public Builder filterGroups(MemoryConjunctionFilter.Builder... filterGroupsBuilders) { - return filterGroups( - Arrays.asList(filterGroupsBuilders).stream() - .map(MemoryConjunctionFilter.Builder::build) - .collect(toImmutableList())); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder filterGroups(Optional> filterGroups); - - /** Clears the value of filterGroups field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearFilterGroups() { - return filterGroups(Optional.empty()); - } - - /** - * Setter for force. - * - *

force: If true, the memories will actually be purged. If false, the purge request will be - * validated but not executed. - */ - @JsonProperty("force") - public abstract Builder force(boolean force); - - @ExcludeFromGeneratedCoverageReport - abstract Builder force(Optional force); - - /** Clears the value of force field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearForce() { - return force(Optional.empty()); - } - - /** - * Setter for config. - * - *

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

config: - */ - @CanIgnoreReturnValue - public Builder config(PurgeAgentEngineMemoriesConfig.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 PurgeAgentEngineMemoriesRequestParameters build(); - } - - /** Deserializes a JSON string to a PurgeAgentEngineMemoriesRequestParameters object. */ - @ExcludeFromGeneratedCoverageReport - public static PurgeAgentEngineMemoriesRequestParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, PurgeAgentEngineMemoriesRequestParameters.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/PurgeMemoriesResponse.java b/src/main/java/com/google/cloud/agentplatform/types/PurgeMemoriesResponse.java deleted file mode 100644 index 4314b19..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/PurgeMemoriesResponse.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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 response for purging memories. */ -@AutoValue -@JsonDeserialize(builder = PurgeMemoriesResponse.Builder.class) -public abstract class PurgeMemoriesResponse extends JsonSerializable { - /** The number of memories that were purged. */ - @JsonProperty("purgeCount") - public abstract Optional purgeCount(); - - /** Instantiates a builder for PurgeMemoriesResponse. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_PurgeMemoriesResponse.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for PurgeMemoriesResponse. */ - @AutoValue.Builder - public abstract static class Builder { - /** For internal usage. Please use `PurgeMemoriesResponse.builder()` for instantiation. */ - @JsonCreator - private static Builder create() { - return new AutoValue_PurgeMemoriesResponse.Builder(); - } - - /** - * Setter for purgeCount. - * - *

purgeCount: The number of memories that were purged. - */ - @JsonProperty("purgeCount") - public abstract Builder purgeCount(Integer purgeCount); - - @ExcludeFromGeneratedCoverageReport - abstract Builder purgeCount(Optional purgeCount); - - /** Clears the value of purgeCount field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearPurgeCount() { - return purgeCount(Optional.empty()); - } - - public abstract PurgeMemoriesResponse build(); - } - - /** Deserializes a JSON string to a PurgeMemoriesResponse object. */ - @ExcludeFromGeneratedCoverageReport - public static PurgeMemoriesResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, PurgeMemoriesResponse.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/RetrieveAgentEngineMemoriesConfig.java b/src/main/java/com/google/cloud/agentplatform/types/RetrieveAgentEngineMemoriesConfig.java deleted file mode 100644 index 0e690d7..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/RetrieveAgentEngineMemoriesConfig.java +++ /dev/null @@ -1,298 +0,0 @@ -/* - * 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.common.collect.ImmutableList; -import com.google.errorprone.annotations.CanIgnoreReturnValue; -import com.google.genai.JsonSerializable; -import com.google.genai.types.HttpOptions; -import java.util.Arrays; -import java.util.List; -import java.util.Optional; - -/** Config for retrieving memories. */ -@AutoValue -@JsonDeserialize(builder = RetrieveAgentEngineMemoriesConfig.Builder.class) -public abstract class RetrieveAgentEngineMemoriesConfig extends JsonSerializable { - /** Used to override HTTP request options. */ - @JsonProperty("httpOptions") - public abstract Optional httpOptions(); - - /** - * The standard list filter that will be applied to the retrieved memories. More detail in - * [AIP-160](https://google.aip.dev/160). - * - *

Supported fields: `fact` `create_time` `update_time` - */ - @JsonProperty("filter") - public abstract Optional filter(); - - /** - * Metadata filters that will be applied to the retrieved memories' `metadata` using OR logic. - * Filters are defined using disjunctive normal form (OR of ANDs). - * - *

For example: `filter_groups: [{filters: [{key: "author", value: {string_value: "agent - * `123"}, op: EQUAL}]}, {filters: [{key: "label", value: {string_value: "travel"}, op: EQUAL}, - * {key: "author", value: {string_value: "agent 321"}, op: EQUAL}]}]` - * - *

would be equivalent to the logical expression: `(metadata.author = "agent 123" OR - * (metadata.label = "travel" AND metadata.author = "agent 321"))`. - */ - @JsonProperty("filterGroups") - public abstract Optional> filterGroups(); - - /** - * Specifies the types of memories to retrieve. If this field is empty or not provided, the - * request will default to retrieving only memories of type `NATURAL_LANGUAGE_COLLECTION`. If - * populated, the request will retrieve memories matching any of the specified `MemoryType` - * values. - */ - @JsonProperty("memoryTypes") - public abstract Optional> memoryTypes(); - - /** Instantiates a builder for RetrieveAgentEngineMemoriesConfig. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_RetrieveAgentEngineMemoriesConfig.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for RetrieveAgentEngineMemoriesConfig. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `RetrieveAgentEngineMemoriesConfig.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_RetrieveAgentEngineMemoriesConfig.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 filter. - * - *

filter: The standard list filter that will be applied to the retrieved memories. More - * detail in [AIP-160](https://google.aip.dev/160). - * - *

Supported fields: `fact` `create_time` `update_time` - */ - @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()); - } - - /** - * Setter for filterGroups. - * - *

filterGroups: Metadata filters that will be applied to the retrieved memories' `metadata` - * using OR logic. Filters are defined using disjunctive normal form (OR of ANDs). - * - *

For example: `filter_groups: [{filters: [{key: "author", value: {string_value: "agent - * `123"}, op: EQUAL}]}, {filters: [{key: "label", value: {string_value: "travel"}, op: EQUAL}, - * {key: "author", value: {string_value: "agent 321"}, op: EQUAL}]}]` - * - *

would be equivalent to the logical expression: `(metadata.author = "agent 123" OR - * (metadata.label = "travel" AND metadata.author = "agent 321"))`. - */ - @JsonProperty("filterGroups") - public abstract Builder filterGroups(List filterGroups); - - /** - * Setter for filterGroups. - * - *

filterGroups: Metadata filters that will be applied to the retrieved memories' `metadata` - * using OR logic. Filters are defined using disjunctive normal form (OR of ANDs). - * - *

For example: `filter_groups: [{filters: [{key: "author", value: {string_value: "agent - * `123"}, op: EQUAL}]}, {filters: [{key: "label", value: {string_value: "travel"}, op: EQUAL}, - * {key: "author", value: {string_value: "agent 321"}, op: EQUAL}]}]` - * - *

would be equivalent to the logical expression: `(metadata.author = "agent 123" OR - * (metadata.label = "travel" AND metadata.author = "agent 321"))`. - */ - @CanIgnoreReturnValue - public Builder filterGroups(MemoryConjunctionFilter... filterGroups) { - return filterGroups(Arrays.asList(filterGroups)); - } - - /** - * Setter for filterGroups builder. - * - *

filterGroups: Metadata filters that will be applied to the retrieved memories' `metadata` - * using OR logic. Filters are defined using disjunctive normal form (OR of ANDs). - * - *

For example: `filter_groups: [{filters: [{key: "author", value: {string_value: "agent - * `123"}, op: EQUAL}]}, {filters: [{key: "label", value: {string_value: "travel"}, op: EQUAL}, - * {key: "author", value: {string_value: "agent 321"}, op: EQUAL}]}]` - * - *

would be equivalent to the logical expression: `(metadata.author = "agent 123" OR - * (metadata.label = "travel" AND metadata.author = "agent 321"))`. - */ - @CanIgnoreReturnValue - public Builder filterGroups(MemoryConjunctionFilter.Builder... filterGroupsBuilders) { - return filterGroups( - Arrays.asList(filterGroupsBuilders).stream() - .map(MemoryConjunctionFilter.Builder::build) - .collect(toImmutableList())); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder filterGroups(Optional> filterGroups); - - /** Clears the value of filterGroups field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearFilterGroups() { - return filterGroups(Optional.empty()); - } - - /** - * Setter for memoryTypes. - * - *

memoryTypes: Specifies the types of memories to retrieve. If this field is empty or not - * provided, the request will default to retrieving only memories of type - * `NATURAL_LANGUAGE_COLLECTION`. If populated, the request will retrieve memories matching any - * of the specified `MemoryType` values. - */ - @JsonProperty("memoryTypes") - public abstract Builder memoryTypes(List memoryTypes); - - /** - * Setter for memoryTypes. - * - *

memoryTypes: Specifies the types of memories to retrieve. If this field is empty or not - * provided, the request will default to retrieving only memories of type - * `NATURAL_LANGUAGE_COLLECTION`. If populated, the request will retrieve memories matching any - * of the specified `MemoryType` values. - */ - @CanIgnoreReturnValue - public Builder memoryTypes(MemoryType... memoryTypes) { - return memoryTypes(Arrays.asList(memoryTypes)); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder memoryTypes(Optional> memoryTypes); - - /** Clears the value of memoryTypes field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearMemoryTypes() { - return memoryTypes(Optional.empty()); - } - - /** - * Setter for memoryTypes given a varargs of strings. - * - *

memoryTypes: Specifies the types of memories to retrieve. If this field is empty or not - * provided, the request will default to retrieving only memories of type - * `NATURAL_LANGUAGE_COLLECTION`. If populated, the request will retrieve memories matching any - * of the specified `MemoryType` values. - */ - @CanIgnoreReturnValue - public Builder memoryTypes(String... memoryTypes) { - return memoryTypesFromString(Arrays.asList(memoryTypes)); - } - - /** - * Setter for memoryTypes given a varargs of known enums. - * - *

memoryTypes: Specifies the types of memories to retrieve. If this field is empty or not - * provided, the request will default to retrieving only memories of type - * `NATURAL_LANGUAGE_COLLECTION`. If populated, the request will retrieve memories matching any - * of the specified `MemoryType` values. - */ - @CanIgnoreReturnValue - public Builder memoryTypes(MemoryType.Known... knownTypes) { - return memoryTypesFromKnown(Arrays.asList(knownTypes)); - } - - /** - * Setter for memoryTypes given a list of known enums. - * - *

memoryTypes: Specifies the types of memories to retrieve. If this field is empty or not - * provided, the request will default to retrieving only memories of type - * `NATURAL_LANGUAGE_COLLECTION`. If populated, the request will retrieve memories matching any - * of the specified `MemoryType` values. - */ - @CanIgnoreReturnValue - public Builder memoryTypesFromKnown(List knownTypes) { - ImmutableList listItems = - knownTypes.stream().map(MemoryType::new).collect(toImmutableList()); - return memoryTypes(listItems); - } - - /** - * Setter for memoryTypes given a list of strings. - * - *

memoryTypes: Specifies the types of memories to retrieve. If this field is empty or not - * provided, the request will default to retrieving only memories of type - * `NATURAL_LANGUAGE_COLLECTION`. If populated, the request will retrieve memories matching any - * of the specified `MemoryType` values. - */ - @CanIgnoreReturnValue - public Builder memoryTypesFromString(List memoryTypes) { - ImmutableList listItems = - memoryTypes.stream().map(MemoryType::new).collect(toImmutableList()); - return memoryTypes(listItems); - } - - public abstract RetrieveAgentEngineMemoriesConfig build(); - } - - /** Deserializes a JSON string to a RetrieveAgentEngineMemoriesConfig object. */ - @ExcludeFromGeneratedCoverageReport - public static RetrieveAgentEngineMemoriesConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RetrieveAgentEngineMemoriesConfig.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/RetrieveAgentEngineMemoriesRequestParameters.java b/src/main/java/com/google/cloud/agentplatform/types/RetrieveAgentEngineMemoriesRequestParameters.java deleted file mode 100644 index abb7b54..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/RetrieveAgentEngineMemoriesRequestParameters.java +++ /dev/null @@ -1,220 +0,0 @@ -/* - * 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.Map; -import java.util.Optional; - -/** Parameters for retrieving agent engine memories. */ -@AutoValue -@InternalApi -@JsonDeserialize(builder = RetrieveAgentEngineMemoriesRequestParameters.Builder.class) -public abstract class RetrieveAgentEngineMemoriesRequestParameters extends JsonSerializable { - /** Name of the agent engine to retrieve memories from. */ - @JsonProperty("name") - public abstract Optional name(); - - /** - * The scope of the memories to retrieve. - * - *

A memory must have exactly the same scope as the scope provided here to be retrieved (i.e. - * same keys and values). Order does not matter, but it is case-sensitive. - */ - @JsonProperty("scope") - public abstract Optional> scope(); - - /** Parameters for semantic similarity search based retrieval. */ - @JsonProperty("similaritySearchParams") - public abstract Optional similaritySearchParams(); - - /** Parameters for simple (non-similarity search) retrieval. */ - @JsonProperty("simpleRetrievalParams") - public abstract Optional simpleRetrievalParams(); - - /** */ - @JsonProperty("config") - public abstract Optional config(); - - /** Instantiates a builder for RetrieveAgentEngineMemoriesRequestParameters. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_RetrieveAgentEngineMemoriesRequestParameters.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for RetrieveAgentEngineMemoriesRequestParameters. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `RetrieveAgentEngineMemoriesRequestParameters.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_RetrieveAgentEngineMemoriesRequestParameters.Builder(); - } - - /** - * Setter for name. - * - *

name: Name of the agent engine to retrieve memories 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 scope. - * - *

scope: The scope of the memories to retrieve. - * - *

A memory must have exactly the same scope as the scope provided here to be retrieved (i.e. - * same keys and values). Order does not matter, but it is case-sensitive. - */ - @JsonProperty("scope") - public abstract Builder scope(Map scope); - - @ExcludeFromGeneratedCoverageReport - abstract Builder scope(Optional> scope); - - /** Clears the value of scope field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearScope() { - return scope(Optional.empty()); - } - - /** - * Setter for similaritySearchParams. - * - *

similaritySearchParams: Parameters for semantic similarity search based retrieval. - */ - @JsonProperty("similaritySearchParams") - public abstract Builder similaritySearchParams( - RetrieveMemoriesRequestSimilaritySearchParams similaritySearchParams); - - /** - * Setter for similaritySearchParams builder. - * - *

similaritySearchParams: Parameters for semantic similarity search based retrieval. - */ - @CanIgnoreReturnValue - public Builder similaritySearchParams( - RetrieveMemoriesRequestSimilaritySearchParams.Builder similaritySearchParamsBuilder) { - return similaritySearchParams(similaritySearchParamsBuilder.build()); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder similaritySearchParams( - Optional similaritySearchParams); - - /** Clears the value of similaritySearchParams field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearSimilaritySearchParams() { - return similaritySearchParams(Optional.empty()); - } - - /** - * Setter for simpleRetrievalParams. - * - *

simpleRetrievalParams: Parameters for simple (non-similarity search) retrieval. - */ - @JsonProperty("simpleRetrievalParams") - public abstract Builder simpleRetrievalParams( - RetrieveMemoriesRequestSimpleRetrievalParams simpleRetrievalParams); - - /** - * Setter for simpleRetrievalParams builder. - * - *

simpleRetrievalParams: Parameters for simple (non-similarity search) retrieval. - */ - @CanIgnoreReturnValue - public Builder simpleRetrievalParams( - RetrieveMemoriesRequestSimpleRetrievalParams.Builder simpleRetrievalParamsBuilder) { - return simpleRetrievalParams(simpleRetrievalParamsBuilder.build()); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder simpleRetrievalParams( - Optional simpleRetrievalParams); - - /** Clears the value of simpleRetrievalParams field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearSimpleRetrievalParams() { - return simpleRetrievalParams(Optional.empty()); - } - - /** - * Setter for config. - * - *

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

config: - */ - @CanIgnoreReturnValue - public Builder config(RetrieveAgentEngineMemoriesConfig.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 RetrieveAgentEngineMemoriesRequestParameters build(); - } - - /** Deserializes a JSON string to a RetrieveAgentEngineMemoriesRequestParameters object. */ - @ExcludeFromGeneratedCoverageReport - public static RetrieveAgentEngineMemoriesRequestParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, RetrieveAgentEngineMemoriesRequestParameters.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/RetrieveMemoriesRequestSimilaritySearchParams.java b/src/main/java/com/google/cloud/agentplatform/types/RetrieveMemoriesRequestSimilaritySearchParams.java deleted file mode 100644 index a41bb5b..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/RetrieveMemoriesRequestSimilaritySearchParams.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * 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 parameters for semantic similarity search based retrieval. */ -@AutoValue -@JsonDeserialize(builder = RetrieveMemoriesRequestSimilaritySearchParams.Builder.class) -public abstract class RetrieveMemoriesRequestSimilaritySearchParams extends JsonSerializable { - /** - * Required. Query to use for similarity search retrieval. If provided, then the parent - * ReasoningEngine must have ReasoningEngineContextSpec.MemoryBankConfig.SimilaritySearchConfig - * set. - */ - @JsonProperty("searchQuery") - public abstract Optional searchQuery(); - - /** - * Optional. The maximum number of memories to return. The service may return fewer than this - * value. If unspecified, at most 3 memories will be returned. The maximum value is 100; values - * above 100 will be coerced to 100. - */ - @JsonProperty("topK") - public abstract Optional topK(); - - /** Instantiates a builder for RetrieveMemoriesRequestSimilaritySearchParams. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_RetrieveMemoriesRequestSimilaritySearchParams.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for RetrieveMemoriesRequestSimilaritySearchParams. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `RetrieveMemoriesRequestSimilaritySearchParams.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_RetrieveMemoriesRequestSimilaritySearchParams.Builder(); - } - - /** - * Setter for searchQuery. - * - *

searchQuery: Required. Query to use for similarity search retrieval. If provided, then the - * parent ReasoningEngine must have - * ReasoningEngineContextSpec.MemoryBankConfig.SimilaritySearchConfig set. - */ - @JsonProperty("searchQuery") - public abstract Builder searchQuery(String searchQuery); - - @ExcludeFromGeneratedCoverageReport - abstract Builder searchQuery(Optional searchQuery); - - /** Clears the value of searchQuery field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearSearchQuery() { - return searchQuery(Optional.empty()); - } - - /** - * Setter for topK. - * - *

topK: Optional. The maximum number of memories to return. The service may return fewer - * than this value. If unspecified, at most 3 memories will be returned. The maximum value is - * 100; values above 100 will be coerced to 100. - */ - @JsonProperty("topK") - public abstract Builder topK(Integer topK); - - @ExcludeFromGeneratedCoverageReport - abstract Builder topK(Optional topK); - - /** Clears the value of topK field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearTopK() { - return topK(Optional.empty()); - } - - public abstract RetrieveMemoriesRequestSimilaritySearchParams build(); - } - - /** Deserializes a JSON string to a RetrieveMemoriesRequestSimilaritySearchParams object. */ - @ExcludeFromGeneratedCoverageReport - public static RetrieveMemoriesRequestSimilaritySearchParams fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, RetrieveMemoriesRequestSimilaritySearchParams.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/RetrieveMemoriesRequestSimpleRetrievalParams.java b/src/main/java/com/google/cloud/agentplatform/types/RetrieveMemoriesRequestSimpleRetrievalParams.java deleted file mode 100644 index 0623998..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/RetrieveMemoriesRequestSimpleRetrievalParams.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * 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 parameters for simple (non-similarity search) retrieval. */ -@AutoValue -@JsonDeserialize(builder = RetrieveMemoriesRequestSimpleRetrievalParams.Builder.class) -public abstract class RetrieveMemoriesRequestSimpleRetrievalParams extends JsonSerializable { - /** - * Optional. The maximum number of memories to return. The service may return fewer than this - * value. If unspecified, at most 3 memories will be returned. The maximum value is 100; values - * above 100 will be coerced to 100. - */ - @JsonProperty("pageSize") - public abstract Optional pageSize(); - - /** - * Optional. A page token, received from a previous `RetrieveMemories` call. Provide this to - * retrieve the subsequent page. - */ - @JsonProperty("pageToken") - public abstract Optional pageToken(); - - /** Instantiates a builder for RetrieveMemoriesRequestSimpleRetrievalParams. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_RetrieveMemoriesRequestSimpleRetrievalParams.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for RetrieveMemoriesRequestSimpleRetrievalParams. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `RetrieveMemoriesRequestSimpleRetrievalParams.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_RetrieveMemoriesRequestSimpleRetrievalParams.Builder(); - } - - /** - * Setter for pageSize. - * - *

pageSize: Optional. The maximum number of memories to return. The service may return fewer - * than this value. If unspecified, at most 3 memories will be returned. The maximum value is - * 100; values above 100 will be coerced to 100. - */ - @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: Optional. A page token, received from a previous `RetrieveMemories` call. - * Provide this to retrieve the subsequent page. - */ - @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()); - } - - public abstract RetrieveMemoriesRequestSimpleRetrievalParams build(); - } - - /** Deserializes a JSON string to a RetrieveMemoriesRequestSimpleRetrievalParams object. */ - @ExcludeFromGeneratedCoverageReport - public static RetrieveMemoriesRequestSimpleRetrievalParams fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, RetrieveMemoriesRequestSimpleRetrievalParams.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/RetrieveMemoriesResponse.java b/src/main/java/com/google/cloud/agentplatform/types/RetrieveMemoriesResponse.java deleted file mode 100644 index 06e2f30..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/RetrieveMemoriesResponse.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * 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 response for retrieving memories. */ -@AutoValue -@JsonDeserialize(builder = RetrieveMemoriesResponse.Builder.class) -public abstract class RetrieveMemoriesResponse extends JsonSerializable { - /** - * A token that can be sent as `page_token` to retrieve the next page. If this field is omitted, - * there are no subsequent pages. This token is not set if similarity search was used for - * retrieval. - */ - @JsonProperty("nextPageToken") - public abstract Optional nextPageToken(); - - /** The retrieved memories. */ - @JsonProperty("retrievedMemories") - public abstract Optional> retrievedMemories(); - - /** Instantiates a builder for RetrieveMemoriesResponse. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_RetrieveMemoriesResponse.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for RetrieveMemoriesResponse. */ - @AutoValue.Builder - public abstract static class Builder { - /** For internal usage. Please use `RetrieveMemoriesResponse.builder()` for instantiation. */ - @JsonCreator - private static Builder create() { - return new AutoValue_RetrieveMemoriesResponse.Builder(); - } - - /** - * Setter for nextPageToken. - * - *

nextPageToken: A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. This token is not set if similarity search - * was used for retrieval. - */ - @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 retrievedMemories. - * - *

retrievedMemories: The retrieved memories. - */ - @JsonProperty("retrievedMemories") - public abstract Builder retrievedMemories( - List retrievedMemories); - - /** - * Setter for retrievedMemories. - * - *

retrievedMemories: The retrieved memories. - */ - @CanIgnoreReturnValue - public Builder retrievedMemories(RetrieveMemoriesResponseRetrievedMemory... retrievedMemories) { - return retrievedMemories(Arrays.asList(retrievedMemories)); - } - - /** - * Setter for retrievedMemories builder. - * - *

retrievedMemories: The retrieved memories. - */ - @CanIgnoreReturnValue - public Builder retrievedMemories( - RetrieveMemoriesResponseRetrievedMemory.Builder... retrievedMemoriesBuilders) { - return retrievedMemories( - Arrays.asList(retrievedMemoriesBuilders).stream() - .map(RetrieveMemoriesResponseRetrievedMemory.Builder::build) - .collect(toImmutableList())); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder retrievedMemories( - Optional> retrievedMemories); - - /** Clears the value of retrievedMemories field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearRetrievedMemories() { - return retrievedMemories(Optional.empty()); - } - - public abstract RetrieveMemoriesResponse build(); - } - - /** Deserializes a JSON string to a RetrieveMemoriesResponse object. */ - @ExcludeFromGeneratedCoverageReport - public static RetrieveMemoriesResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RetrieveMemoriesResponse.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/RetrieveMemoriesResponseRetrievedMemory.java b/src/main/java/com/google/cloud/agentplatform/types/RetrieveMemoriesResponseRetrievedMemory.java deleted file mode 100644 index 943b5e3..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/RetrieveMemoriesResponseRetrievedMemory.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * 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; - -/** A retrieved memory. */ -@AutoValue -@JsonDeserialize(builder = RetrieveMemoriesResponseRetrievedMemory.Builder.class) -public abstract class RetrieveMemoriesResponseRetrievedMemory extends JsonSerializable { - /** - * The distance between the query and the retrieved Memory. Smaller values indicate more similar - * memories. This is only set if similarity search was used for retrieval. - */ - @JsonProperty("distance") - public abstract Optional distance(); - - /** The retrieved Memory. */ - @JsonProperty("memory") - public abstract Optional memory(); - - /** Instantiates a builder for RetrieveMemoriesResponseRetrievedMemory. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_RetrieveMemoriesResponseRetrievedMemory.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for RetrieveMemoriesResponseRetrievedMemory. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `RetrieveMemoriesResponseRetrievedMemory.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_RetrieveMemoriesResponseRetrievedMemory.Builder(); - } - - /** - * Setter for distance. - * - *

distance: The distance between the query and the retrieved Memory. Smaller values indicate - * more similar memories. This is only set if similarity search was used for retrieval. - */ - @JsonProperty("distance") - public abstract Builder distance(Double distance); - - @ExcludeFromGeneratedCoverageReport - abstract Builder distance(Optional distance); - - /** Clears the value of distance field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearDistance() { - return distance(Optional.empty()); - } - - /** - * Setter for memory. - * - *

memory: The retrieved Memory. - */ - @JsonProperty("memory") - public abstract Builder memory(Memory memory); - - /** - * Setter for memory builder. - * - *

memory: The retrieved Memory. - */ - @CanIgnoreReturnValue - public Builder memory(Memory.Builder memoryBuilder) { - return memory(memoryBuilder.build()); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder memory(Optional memory); - - /** Clears the value of memory field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearMemory() { - return memory(Optional.empty()); - } - - public abstract RetrieveMemoriesResponseRetrievedMemory build(); - } - - /** Deserializes a JSON string to a RetrieveMemoriesResponseRetrievedMemory object. */ - @ExcludeFromGeneratedCoverageReport - public static RetrieveMemoriesResponseRetrievedMemory fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, RetrieveMemoriesResponseRetrievedMemory.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/RetrieveMemoryProfilesConfig.java b/src/main/java/com/google/cloud/agentplatform/types/RetrieveMemoryProfilesConfig.java deleted file mode 100644 index e036681..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/RetrieveMemoryProfilesConfig.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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 retrieving memory profiles. */ -@AutoValue -@JsonDeserialize(builder = RetrieveMemoryProfilesConfig.Builder.class) -public abstract class RetrieveMemoryProfilesConfig extends JsonSerializable { - /** Used to override HTTP request options. */ - @JsonProperty("httpOptions") - public abstract Optional httpOptions(); - - /** Instantiates a builder for RetrieveMemoryProfilesConfig. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_RetrieveMemoryProfilesConfig.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for RetrieveMemoryProfilesConfig. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `RetrieveMemoryProfilesConfig.builder()` for instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_RetrieveMemoryProfilesConfig.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 RetrieveMemoryProfilesConfig build(); - } - - /** Deserializes a JSON string to a RetrieveMemoryProfilesConfig object. */ - @ExcludeFromGeneratedCoverageReport - public static RetrieveMemoryProfilesConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RetrieveMemoryProfilesConfig.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/RetrieveMemoryProfilesRequestParameters.java b/src/main/java/com/google/cloud/agentplatform/types/RetrieveMemoryProfilesRequestParameters.java deleted file mode 100644 index 94e72b9..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/RetrieveMemoryProfilesRequestParameters.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * 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.Map; -import java.util.Optional; - -/** Parameters for retrieving agent engine memory profiles. */ -@AutoValue -@InternalApi -@JsonDeserialize(builder = RetrieveMemoryProfilesRequestParameters.Builder.class) -public abstract class RetrieveMemoryProfilesRequestParameters extends JsonSerializable { - /** Name of the agent engine to retrieve memory profiles from. */ - @JsonProperty("name") - public abstract Optional name(); - - /** - * The scope of the memories to retrieve. - * - *

A memory must have exactly the same scope as the scope provided here to be retrieved (i.e. - * same keys and values). Order does not matter, but it is case-sensitive. - */ - @JsonProperty("scope") - public abstract Optional> scope(); - - /** */ - @JsonProperty("config") - public abstract Optional config(); - - /** Instantiates a builder for RetrieveMemoryProfilesRequestParameters. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_RetrieveMemoryProfilesRequestParameters.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for RetrieveMemoryProfilesRequestParameters. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `RetrieveMemoryProfilesRequestParameters.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_RetrieveMemoryProfilesRequestParameters.Builder(); - } - - /** - * Setter for name. - * - *

name: Name of the agent engine to retrieve memory profiles 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 scope. - * - *

scope: The scope of the memories to retrieve. - * - *

A memory must have exactly the same scope as the scope provided here to be retrieved (i.e. - * same keys and values). Order does not matter, but it is case-sensitive. - */ - @JsonProperty("scope") - public abstract Builder scope(Map scope); - - @ExcludeFromGeneratedCoverageReport - abstract Builder scope(Optional> scope); - - /** Clears the value of scope field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearScope() { - return scope(Optional.empty()); - } - - /** - * Setter for config. - * - *

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

config: - */ - @CanIgnoreReturnValue - public Builder config(RetrieveMemoryProfilesConfig.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 RetrieveMemoryProfilesRequestParameters build(); - } - - /** Deserializes a JSON string to a RetrieveMemoryProfilesRequestParameters object. */ - @ExcludeFromGeneratedCoverageReport - public static RetrieveMemoryProfilesRequestParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, RetrieveMemoryProfilesRequestParameters.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/RetrieveProfilesResponse.java b/src/main/java/com/google/cloud/agentplatform/types/RetrieveProfilesResponse.java deleted file mode 100644 index f672f05..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/RetrieveProfilesResponse.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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; - -/** The response for retrieving memory profiles. */ -@AutoValue -@JsonDeserialize(builder = RetrieveProfilesResponse.Builder.class) -public abstract class RetrieveProfilesResponse extends JsonSerializable { - /** - * The retrieved structured profiles, which match the schemas under the requested scope. The key - * is the ID of the schema that the profile is linked with, which corresponds to the `schema_id` - * defined inside the `SchemaConfig`, under `StructuredMemoryCustomizationConfig`. - */ - @JsonProperty("profiles") - public abstract Optional> profiles(); - - /** Instantiates a builder for RetrieveProfilesResponse. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_RetrieveProfilesResponse.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for RetrieveProfilesResponse. */ - @AutoValue.Builder - public abstract static class Builder { - /** For internal usage. Please use `RetrieveProfilesResponse.builder()` for instantiation. */ - @JsonCreator - private static Builder create() { - return new AutoValue_RetrieveProfilesResponse.Builder(); - } - - /** - * Setter for profiles. - * - *

profiles: The retrieved structured profiles, which match the schemas under the requested - * scope. The key is the ID of the schema that the profile is linked with, which corresponds to - * the `schema_id` defined inside the `SchemaConfig`, under - * `StructuredMemoryCustomizationConfig`. - */ - @JsonProperty("profiles") - public abstract Builder profiles(Map profiles); - - @ExcludeFromGeneratedCoverageReport - abstract Builder profiles(Optional> profiles); - - /** Clears the value of profiles field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearProfiles() { - return profiles(Optional.empty()); - } - - public abstract RetrieveProfilesResponse build(); - } - - /** Deserializes a JSON string to a RetrieveProfilesResponse object. */ - @ExcludeFromGeneratedCoverageReport - public static RetrieveProfilesResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RetrieveProfilesResponse.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/RollbackAgentEngineMemoryConfig.java b/src/main/java/com/google/cloud/agentplatform/types/RollbackAgentEngineMemoryConfig.java deleted file mode 100644 index d8156fe..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/RollbackAgentEngineMemoryConfig.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * 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 rolling back a memory. */ -@AutoValue -@JsonDeserialize(builder = RollbackAgentEngineMemoryConfig.Builder.class) -public abstract class RollbackAgentEngineMemoryConfig extends JsonSerializable { - /** Used to override HTTP request options. */ - @JsonProperty("httpOptions") - public abstract Optional httpOptions(); - - /** Waits for the operation to complete before returning. */ - @JsonProperty("waitForCompletion") - public abstract Optional waitForCompletion(); - - /** Instantiates a builder for RollbackAgentEngineMemoryConfig. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_RollbackAgentEngineMemoryConfig.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for RollbackAgentEngineMemoryConfig. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `RollbackAgentEngineMemoryConfig.builder()` for instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_RollbackAgentEngineMemoryConfig.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 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 RollbackAgentEngineMemoryConfig build(); - } - - /** Deserializes a JSON string to a RollbackAgentEngineMemoryConfig object. */ - @ExcludeFromGeneratedCoverageReport - public static RollbackAgentEngineMemoryConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RollbackAgentEngineMemoryConfig.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/RollbackAgentEngineMemoryRequestParameters.java b/src/main/java/com/google/cloud/agentplatform/types/RollbackAgentEngineMemoryRequestParameters.java deleted file mode 100644 index a0d973e..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/RollbackAgentEngineMemoryRequestParameters.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * 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 generating agent engine memories. */ -@AutoValue -@InternalApi -@JsonDeserialize(builder = RollbackAgentEngineMemoryRequestParameters.Builder.class) -public abstract class RollbackAgentEngineMemoryRequestParameters extends JsonSerializable { - /** Name of the agent engine memory to rollback. */ - @JsonProperty("name") - public abstract Optional name(); - - /** The ID of the revision to rollback to. */ - @JsonProperty("targetRevisionId") - public abstract Optional targetRevisionId(); - - /** */ - @JsonProperty("config") - public abstract Optional config(); - - /** Instantiates a builder for RollbackAgentEngineMemoryRequestParameters. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_RollbackAgentEngineMemoryRequestParameters.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for RollbackAgentEngineMemoryRequestParameters. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `RollbackAgentEngineMemoryRequestParameters.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_RollbackAgentEngineMemoryRequestParameters.Builder(); - } - - /** - * Setter for name. - * - *

name: Name of the agent engine memory to rollback. - */ - @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 targetRevisionId. - * - *

targetRevisionId: The ID of the revision to rollback to. - */ - @JsonProperty("targetRevisionId") - public abstract Builder targetRevisionId(String targetRevisionId); - - @ExcludeFromGeneratedCoverageReport - abstract Builder targetRevisionId(Optional targetRevisionId); - - /** Clears the value of targetRevisionId field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearTargetRevisionId() { - return targetRevisionId(Optional.empty()); - } - - /** - * Setter for config. - * - *

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

config: - */ - @CanIgnoreReturnValue - public Builder config(RollbackAgentEngineMemoryConfig.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 RollbackAgentEngineMemoryRequestParameters build(); - } - - /** Deserializes a JSON string to a RollbackAgentEngineMemoryRequestParameters object. */ - @ExcludeFromGeneratedCoverageReport - public static RollbackAgentEngineMemoryRequestParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, RollbackAgentEngineMemoryRequestParameters.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/UpdateAgentEngineMemoryConfig.java b/src/main/java/com/google/cloud/agentplatform/types/UpdateAgentEngineMemoryConfig.java deleted file mode 100644 index 99c617d..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/UpdateAgentEngineMemoryConfig.java +++ /dev/null @@ -1,410 +0,0 @@ -/* - * 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.HttpOptions; -import java.time.Duration; -import java.time.Instant; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.Optional; - -/** Config for updating agent engine memory. */ -@AutoValue -@JsonDeserialize(builder = UpdateAgentEngineMemoryConfig.Builder.class) -public abstract class UpdateAgentEngineMemoryConfig extends JsonSerializable { - /** Used to override HTTP request options. */ - @JsonProperty("httpOptions") - public abstract Optional httpOptions(); - - /** The display name of the memory. */ - @JsonProperty("displayName") - public abstract Optional displayName(); - - /** The description of the memory. */ - @JsonProperty("description") - public abstract Optional description(); - - /** Waits for the operation to complete before returning. */ - @JsonProperty("waitForCompletion") - public abstract Optional waitForCompletion(); - - /** - * Optional. Input only. The TTL for this resource. - * - *

The expiration time is computed: now + TTL. - */ - @JsonProperty("ttl") - public abstract Optional ttl(); - - /** - * Optional. Timestamp of when this resource is considered expired. This is *always* provided on - * output, regardless of what `expiration` was sent on input. - */ - @JsonProperty("expireTime") - public abstract Optional expireTime(); - - /** - * Optional. Input only. Timestamp of when the revision is considered expired. If not set, the - * memory revision will be kept until manually deleted. - */ - @JsonProperty("revisionExpireTime") - public abstract Optional revisionExpireTime(); - - /** Optional. Input only. The TTL for the revision. The expiration time is computed: now + TTL. */ - @JsonProperty("revisionTtl") - public abstract Optional revisionTtl(); - - /** Optional. Input only. If true, no revision will be created for this request. */ - @JsonProperty("disableMemoryRevisions") - public abstract Optional disableMemoryRevisions(); - - /** Optional. The topics of the memory. */ - @JsonProperty("topics") - public abstract Optional> topics(); - - /** - * Optional. User-provided metadata for the Memory. This information was provided when creating, - * updating, or generating the Memory. It was not generated by Memory Bank. - */ - @JsonProperty("metadata") - public abstract Optional> metadata(); - - /** - * Optional. The user defined ID to use for memory, which will become the final component of the - * memory resource name. If not provided, Vertex AI will generate a value for this ID. This value - * may be up to 63 characters, and valid characters are `[a-z0-9-]`. The first character must be a - * letter, and the last character must be a letter or number. - */ - @JsonProperty("memoryId") - public abstract Optional memoryId(); - - /** - * The update mask to apply. For the `FieldMask` definition, see - * https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask. - */ - @JsonProperty("updateMask") - public abstract Optional updateMask(); - - /** Instantiates a builder for UpdateAgentEngineMemoryConfig. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_UpdateAgentEngineMemoryConfig.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for UpdateAgentEngineMemoryConfig. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `UpdateAgentEngineMemoryConfig.builder()` for instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_UpdateAgentEngineMemoryConfig.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 memory. - */ - @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 description. - * - *

description: The description of the memory. - */ - @JsonProperty("description") - public abstract Builder description(String description); - - @ExcludeFromGeneratedCoverageReport - abstract Builder description(Optional description); - - /** Clears the value of description field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearDescription() { - return description(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()); - } - - /** - * Setter for ttl. - * - *

ttl: Optional. Input only. 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 expireTime. - * - *

expireTime: Optional. Timestamp of when this resource is considered expired. This is - * *always* provided on output, regardless of what `expiration` was sent on input. - */ - @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 revisionExpireTime. - * - *

revisionExpireTime: Optional. Input only. Timestamp of when the revision is considered - * expired. If not set, the memory revision will be kept until manually deleted. - */ - @JsonProperty("revisionExpireTime") - public abstract Builder revisionExpireTime(Instant revisionExpireTime); - - @ExcludeFromGeneratedCoverageReport - abstract Builder revisionExpireTime(Optional revisionExpireTime); - - /** Clears the value of revisionExpireTime field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearRevisionExpireTime() { - return revisionExpireTime(Optional.empty()); - } - - /** - * Setter for revisionTtl. - * - *

revisionTtl: Optional. Input only. The TTL for the revision. The expiration time is - * computed: now + TTL. - */ - @JsonProperty("revisionTtl") - public abstract Builder revisionTtl(Duration revisionTtl); - - @ExcludeFromGeneratedCoverageReport - abstract Builder revisionTtl(Optional revisionTtl); - - /** Clears the value of revisionTtl field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearRevisionTtl() { - return revisionTtl(Optional.empty()); - } - - /** - * Setter for disableMemoryRevisions. - * - *

disableMemoryRevisions: Optional. Input only. If true, no revision will be created for - * this request. - */ - @JsonProperty("disableMemoryRevisions") - public abstract Builder disableMemoryRevisions(boolean disableMemoryRevisions); - - @ExcludeFromGeneratedCoverageReport - abstract Builder disableMemoryRevisions(Optional disableMemoryRevisions); - - /** Clears the value of disableMemoryRevisions field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearDisableMemoryRevisions() { - return disableMemoryRevisions(Optional.empty()); - } - - /** - * Setter for topics. - * - *

topics: Optional. The topics of the memory. - */ - @JsonProperty("topics") - public abstract Builder topics(List topics); - - /** - * Setter for topics. - * - *

topics: Optional. The topics of the memory. - */ - @CanIgnoreReturnValue - public Builder topics(MemoryTopicId... topics) { - return topics(Arrays.asList(topics)); - } - - /** - * Setter for topics builder. - * - *

topics: Optional. The topics of the memory. - */ - @CanIgnoreReturnValue - public Builder topics(MemoryTopicId.Builder... topicsBuilders) { - return topics( - Arrays.asList(topicsBuilders).stream() - .map(MemoryTopicId.Builder::build) - .collect(toImmutableList())); - } - - @ExcludeFromGeneratedCoverageReport - abstract Builder topics(Optional> topics); - - /** Clears the value of topics field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearTopics() { - return topics(Optional.empty()); - } - - /** - * Setter for metadata. - * - *

metadata: Optional. User-provided metadata for the Memory. This information was provided - * when creating, updating, or generating the Memory. It was not generated by Memory Bank. - */ - @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 memoryId. - * - *

memoryId: Optional. The user defined ID to use for memory, which will become the final - * component of the memory resource name. If not provided, Vertex AI will generate a value for - * this ID. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`. The - * first character must be a letter, and the last character must be a letter or number. - */ - @JsonProperty("memoryId") - public abstract Builder memoryId(String memoryId); - - @ExcludeFromGeneratedCoverageReport - abstract Builder memoryId(Optional memoryId); - - /** Clears the value of memoryId field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearMemoryId() { - return memoryId(Optional.empty()); - } - - /** - * Setter for updateMask. - * - *

updateMask: The update mask to apply. For the `FieldMask` definition, see - * https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask. - */ - @JsonProperty("updateMask") - public abstract Builder updateMask(String updateMask); - - @ExcludeFromGeneratedCoverageReport - abstract Builder updateMask(Optional updateMask); - - /** Clears the value of updateMask field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearUpdateMask() { - return updateMask(Optional.empty()); - } - - public abstract UpdateAgentEngineMemoryConfig build(); - } - - /** Deserializes a JSON string to a UpdateAgentEngineMemoryConfig object. */ - @ExcludeFromGeneratedCoverageReport - public static UpdateAgentEngineMemoryConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, UpdateAgentEngineMemoryConfig.class); - } -} diff --git a/src/main/java/com/google/cloud/agentplatform/types/UpdateAgentEngineMemoryRequestParameters.java b/src/main/java/com/google/cloud/agentplatform/types/UpdateAgentEngineMemoryRequestParameters.java deleted file mode 100644 index 6eac5df..0000000 --- a/src/main/java/com/google/cloud/agentplatform/types/UpdateAgentEngineMemoryRequestParameters.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * 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.Map; -import java.util.Optional; - -/** Parameters for updating agent engine memories. */ -@AutoValue -@InternalApi -@JsonDeserialize(builder = UpdateAgentEngineMemoryRequestParameters.Builder.class) -public abstract class UpdateAgentEngineMemoryRequestParameters extends JsonSerializable { - /** Name of the agent engine memory to update. */ - @JsonProperty("name") - public abstract Optional name(); - - /** - * The updated fact of the memory. - * - *

This is the semantic knowledge extracted from the source content. - */ - @JsonProperty("fact") - public abstract Optional fact(); - - /** - * The updated scope of the memory. - * - *

Memories are isolated within their scope. The scope is defined when creating or generating - * memories. Up to 5 key-value pairs are accepted, and scope values cannot contain the wildcard - * character '*'. - */ - @JsonProperty("scope") - public abstract Optional> scope(); - - /** */ - @JsonProperty("config") - public abstract Optional config(); - - /** Instantiates a builder for UpdateAgentEngineMemoryRequestParameters. */ - @ExcludeFromGeneratedCoverageReport - public static Builder builder() { - return new AutoValue_UpdateAgentEngineMemoryRequestParameters.Builder(); - } - - /** Creates a builder with the same values as this instance. */ - public abstract Builder toBuilder(); - - /** Builder for UpdateAgentEngineMemoryRequestParameters. */ - @AutoValue.Builder - public abstract static class Builder { - /** - * For internal usage. Please use `UpdateAgentEngineMemoryRequestParameters.builder()` for - * instantiation. - */ - @JsonCreator - private static Builder create() { - return new AutoValue_UpdateAgentEngineMemoryRequestParameters.Builder(); - } - - /** - * Setter for name. - * - *

name: Name of the agent engine memory to update. - */ - @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 fact. - * - *

fact: The updated fact of the memory. - * - *

This is the semantic knowledge extracted from the source content. - */ - @JsonProperty("fact") - public abstract Builder fact(String fact); - - @ExcludeFromGeneratedCoverageReport - abstract Builder fact(Optional fact); - - /** Clears the value of fact field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearFact() { - return fact(Optional.empty()); - } - - /** - * Setter for scope. - * - *

scope: The updated scope of the memory. - * - *

Memories are isolated within their scope. The scope is defined when creating or generating - * memories. Up to 5 key-value pairs are accepted, and scope values cannot contain the wildcard - * character '*'. - */ - @JsonProperty("scope") - public abstract Builder scope(Map scope); - - @ExcludeFromGeneratedCoverageReport - abstract Builder scope(Optional> scope); - - /** Clears the value of scope field. */ - @ExcludeFromGeneratedCoverageReport - @CanIgnoreReturnValue - public Builder clearScope() { - return scope(Optional.empty()); - } - - /** - * Setter for config. - * - *

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

config: - */ - @CanIgnoreReturnValue - public Builder config(UpdateAgentEngineMemoryConfig.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 UpdateAgentEngineMemoryRequestParameters build(); - } - - /** Deserializes a JSON string to a UpdateAgentEngineMemoryRequestParameters object. */ - @ExcludeFromGeneratedCoverageReport - public static UpdateAgentEngineMemoryRequestParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, UpdateAgentEngineMemoryRequestParameters.class); - } -}