diff --git a/src/main/java/com/google/cloud/agentplatform/AgentEngines.java b/src/main/java/com/google/cloud/agentplatform/AgentEngines.java index bd1a171..fa29529 100644 --- a/src/main/java/com/google/cloud/agentplatform/AgentEngines.java +++ b/src/main/java/com/google/cloud/agentplatform/AgentEngines.java @@ -419,6 +419,13 @@ ObjectNode reasoningEngineContextSpecFromVertex(JsonNode fromObject, ObjectNode toObject)); } + if (Common.getValueByPath(fromObject, new String[] {"exampleStoreConfig"}) != null) { + Common.setValueByPath( + toObject, + new String[] {"exampleStoreConfig"}, + Common.getValueByPath(fromObject, new String[] {"exampleStoreConfig"})); + } + return toObject; } @@ -543,6 +550,13 @@ ObjectNode reasoningEngineContextSpecToVertex(JsonNode fromObject, ObjectNode pa toObject)); } + if (Common.getValueByPath(fromObject, new String[] {"exampleStoreConfig"}) != null) { + Common.setValueByPath( + toObject, + new String[] {"exampleStoreConfig"}, + Common.getValueByPath(fromObject, new String[] {"exampleStoreConfig"})); + } + return toObject; } @@ -629,6 +643,26 @@ ObjectNode reasoningEngineFromVertex(JsonNode fromObject, ObjectNode parentObjec Common.getValueByPath(fromObject, new String[] {"trafficConfig"})); } + if (Common.getValueByPath(fromObject, new String[] {"experimentConfig"}) != null) { + Common.setValueByPath( + toObject, + new String[] {"experimentConfig"}, + Common.getValueByPath(fromObject, new String[] {"experimentConfig"})); + } + + if (Common.getValueByPath(fromObject, new String[] {"revisionGarbageCollectionStrategy"}) + != null) { + Common.setValueByPath( + toObject, + new String[] {"revisionGarbageCollectionStrategy"}, + Common.getValueByPath(fromObject, new String[] {"revisionGarbageCollectionStrategy"})); + } + + if (Common.getValueByPath(fromObject, new String[] {"url"}) != null) { + Common.setValueByPath( + toObject, new String[] {"url"}, Common.getValueByPath(fromObject, new String[] {"url"})); + } + return toObject; } diff --git a/src/main/java/com/google/cloud/agentplatform/types/Citation.java b/src/main/java/com/google/cloud/agentplatform/types/Citation.java new file mode 100644 index 0000000..f3d84a8 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/Citation.java @@ -0,0 +1,201 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Optional; + +/** A citation for a piece of generatedcontent. */ +@AutoValue +@JsonDeserialize(builder = Citation.Builder.class) +public abstract class Citation extends JsonSerializable { + /** Output only. The start index of the citation in the content. */ + @JsonProperty("startIndex") + public abstract Optional startIndex(); + + /** Output only. The end index of the citation in the content. */ + @JsonProperty("endIndex") + public abstract Optional endIndex(); + + /** Output only. The URI of the source of the citation. */ + @JsonProperty("uri") + public abstract Optional uri(); + + /** Output only. The title of the source of the citation. */ + @JsonProperty("title") + public abstract Optional title(); + + /** Output only. The license of the source of the citation. */ + @JsonProperty("license") + public abstract Optional license(); + + /** Output only. The publication date of the source of the citation. */ + @JsonProperty("publicationDate") + public abstract Optional publicationDate(); + + /** Instantiates a builder for Citation. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_Citation.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for Citation. */ + @AutoValue.Builder + public abstract static class Builder { + /** For internal usage. Please use `Citation.builder()` for instantiation. */ + @JsonCreator + private static Builder create() { + return new AutoValue_Citation.Builder(); + } + + /** + * Setter for startIndex. + * + *

startIndex: Output only. The start index of the citation in the content. + */ + @JsonProperty("startIndex") + public abstract Builder startIndex(Integer startIndex); + + @ExcludeFromGeneratedCoverageReport + abstract Builder startIndex(Optional startIndex); + + /** Clears the value of startIndex field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearStartIndex() { + return startIndex(Optional.empty()); + } + + /** + * Setter for endIndex. + * + *

endIndex: Output only. The end index of the citation in the content. + */ + @JsonProperty("endIndex") + public abstract Builder endIndex(Integer endIndex); + + @ExcludeFromGeneratedCoverageReport + abstract Builder endIndex(Optional endIndex); + + /** Clears the value of endIndex field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearEndIndex() { + return endIndex(Optional.empty()); + } + + /** + * Setter for uri. + * + *

uri: Output only. The URI of the source of the citation. + */ + @JsonProperty("uri") + public abstract Builder uri(String uri); + + @ExcludeFromGeneratedCoverageReport + abstract Builder uri(Optional uri); + + /** Clears the value of uri field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearUri() { + return uri(Optional.empty()); + } + + /** + * Setter for title. + * + *

title: Output only. The title of the source of the citation. + */ + @JsonProperty("title") + public abstract Builder title(String title); + + @ExcludeFromGeneratedCoverageReport + abstract Builder title(Optional title); + + /** Clears the value of title field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearTitle() { + return title(Optional.empty()); + } + + /** + * Setter for license. + * + *

license: Output only. The license of the source of the citation. + */ + @JsonProperty("license") + public abstract Builder license(String license); + + @ExcludeFromGeneratedCoverageReport + abstract Builder license(Optional license); + + /** Clears the value of license field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearLicense() { + return license(Optional.empty()); + } + + /** + * Setter for publicationDate. + * + *

publicationDate: Output only. The publication date of the source of the citation. + */ + @JsonProperty("publicationDate") + public abstract Builder publicationDate(GoogleTypeDate publicationDate); + + /** + * Setter for publicationDate builder. + * + *

publicationDate: Output only. The publication date of the source of the citation. + */ + @CanIgnoreReturnValue + public Builder publicationDate(GoogleTypeDate.Builder publicationDateBuilder) { + return publicationDate(publicationDateBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder publicationDate(Optional publicationDate); + + /** Clears the value of publicationDate field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearPublicationDate() { + return publicationDate(Optional.empty()); + } + + public abstract Citation build(); + } + + /** Deserializes a JSON string to a Citation object. */ + @ExcludeFromGeneratedCoverageReport + public static Citation fromJson(String jsonString) { + return JsonSerializable.fromJsonString(jsonString, Citation.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/CitationMetadata.java b/src/main/java/com/google/cloud/agentplatform/types/CitationMetadata.java new file mode 100644 index 0000000..f9c845b --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/CitationMetadata.java @@ -0,0 +1,108 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import 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 collection of citations that apply to a piece of generated content. */ +@AutoValue +@JsonDeserialize(builder = CitationMetadata.Builder.class) +public abstract class CitationMetadata extends JsonSerializable { + /** Output only. A list of citations for the content. */ + @JsonProperty("citations") + public abstract Optional> citations(); + + /** Instantiates a builder for CitationMetadata. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_CitationMetadata.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for CitationMetadata. */ + @AutoValue.Builder + public abstract static class Builder { + /** For internal usage. Please use `CitationMetadata.builder()` for instantiation. */ + @JsonCreator + private static Builder create() { + return new AutoValue_CitationMetadata.Builder(); + } + + /** + * Setter for citations. + * + *

citations: Output only. A list of citations for the content. + */ + @JsonProperty("citations") + public abstract Builder citations(List citations); + + /** + * Setter for citations. + * + *

citations: Output only. A list of citations for the content. + */ + @CanIgnoreReturnValue + public Builder citations(Citation... citations) { + return citations(Arrays.asList(citations)); + } + + /** + * Setter for citations builder. + * + *

citations: Output only. A list of citations for the content. + */ + @CanIgnoreReturnValue + public Builder citations(Citation.Builder... citationsBuilders) { + return citations( + Arrays.asList(citationsBuilders).stream() + .map(Citation.Builder::build) + .collect(toImmutableList())); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder citations(Optional> citations); + + /** Clears the value of citations field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearCitations() { + return citations(Optional.empty()); + } + + public abstract CitationMetadata build(); + } + + /** Deserializes a JSON string to a CitationMetadata object. */ + @ExcludeFromGeneratedCoverageReport + public static CitationMetadata fromJson(String jsonString) { + return JsonSerializable.fromJsonString(jsonString, CitationMetadata.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/EventActions.java b/src/main/java/com/google/cloud/agentplatform/types/EventActions.java index fff23d2..df2b053 100644 --- a/src/main/java/com/google/cloud/agentplatform/types/EventActions.java +++ b/src/main/java/com/google/cloud/agentplatform/types/EventActions.java @@ -65,6 +65,25 @@ public abstract class EventActions extends JsonSerializable { @JsonProperty("transferAgent") public abstract Optional transferAgent(); + /** + * Optional. If set, the event transfers to the specified agent. This field is intended to replace + * 'transfer_agent'. Not in use pending data migration. + */ + @JsonProperty("transferToAgent") + public abstract Optional transferToAgent(); + + /** Optional. A dict of tool confirmation requested by this event, keyed by function call id. */ + @JsonProperty("requestedToolConfirmations") + public abstract Optional> requestedToolConfirmations(); + + /** Optional. If true, the current agent has finished its current run. */ + @JsonProperty("endOfAgent") + public abstract Optional endOfAgent(); + + /** Optional. The agent state at the current event. */ + @JsonProperty("agentState") + public abstract Optional> agentState(); + /** Instantiates a builder for EventActions. */ @ExcludeFromGeneratedCoverageReport public static Builder builder() { @@ -196,6 +215,82 @@ public Builder clearTransferAgent() { return transferAgent(Optional.empty()); } + /** + * Setter for transferToAgent. + * + *

transferToAgent: Optional. If set, the event transfers to the specified agent. This field + * is intended to replace 'transfer_agent'. Not in use pending data migration. + */ + @JsonProperty("transferToAgent") + public abstract Builder transferToAgent(String transferToAgent); + + @ExcludeFromGeneratedCoverageReport + abstract Builder transferToAgent(Optional transferToAgent); + + /** Clears the value of transferToAgent field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearTransferToAgent() { + return transferToAgent(Optional.empty()); + } + + /** + * Setter for requestedToolConfirmations. + * + *

requestedToolConfirmations: Optional. A dict of tool confirmation requested by this event, + * keyed by function call id. + */ + @JsonProperty("requestedToolConfirmations") + public abstract Builder requestedToolConfirmations( + Map requestedToolConfirmations); + + @ExcludeFromGeneratedCoverageReport + abstract Builder requestedToolConfirmations( + Optional> requestedToolConfirmations); + + /** Clears the value of requestedToolConfirmations field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearRequestedToolConfirmations() { + return requestedToolConfirmations(Optional.empty()); + } + + /** + * Setter for endOfAgent. + * + *

endOfAgent: Optional. If true, the current agent has finished its current run. + */ + @JsonProperty("endOfAgent") + public abstract Builder endOfAgent(boolean endOfAgent); + + @ExcludeFromGeneratedCoverageReport + abstract Builder endOfAgent(Optional endOfAgent); + + /** Clears the value of endOfAgent field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearEndOfAgent() { + return endOfAgent(Optional.empty()); + } + + /** + * Setter for agentState. + * + *

agentState: Optional. The agent state at the current event. + */ + @JsonProperty("agentState") + public abstract Builder agentState(Map agentState); + + @ExcludeFromGeneratedCoverageReport + abstract Builder agentState(Optional> agentState); + + /** Clears the value of agentState field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearAgentState() { + return agentState(Optional.empty()); + } + public abstract EventActions build(); } diff --git a/src/main/java/com/google/cloud/agentplatform/types/EventMetadata.java b/src/main/java/com/google/cloud/agentplatform/types/EventMetadata.java index 315465d..5178707 100644 --- a/src/main/java/com/google/cloud/agentplatform/types/EventMetadata.java +++ b/src/main/java/com/google/cloud/agentplatform/types/EventMetadata.java @@ -87,6 +87,14 @@ public abstract class EventMetadata extends JsonSerializable { @JsonProperty("outputTranscription") public abstract Optional outputTranscription(); + /** Optional. Citation metadata for the response. */ + @JsonProperty("citationMetadata") + public abstract Optional citationMetadata(); + + /** Optional. Usage metadata for the response. */ + @JsonProperty("usageMetadata") + public abstract Optional usageMetadata(); + /** Instantiates a builder for EventMetadata. */ @ExcludeFromGeneratedCoverageReport public static Builder builder() { @@ -286,6 +294,62 @@ public Builder clearOutputTranscription() { return outputTranscription(Optional.empty()); } + /** + * Setter for citationMetadata. + * + *

citationMetadata: Optional. Citation metadata for the response. + */ + @JsonProperty("citationMetadata") + public abstract Builder citationMetadata(CitationMetadata citationMetadata); + + /** + * Setter for citationMetadata builder. + * + *

citationMetadata: Optional. Citation metadata for the response. + */ + @CanIgnoreReturnValue + public Builder citationMetadata(CitationMetadata.Builder citationMetadataBuilder) { + return citationMetadata(citationMetadataBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder citationMetadata(Optional citationMetadata); + + /** Clears the value of citationMetadata field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearCitationMetadata() { + return citationMetadata(Optional.empty()); + } + + /** + * Setter for usageMetadata. + * + *

usageMetadata: Optional. Usage metadata for the response. + */ + @JsonProperty("usageMetadata") + public abstract Builder usageMetadata(UsageMetadata usageMetadata); + + /** + * Setter for usageMetadata builder. + * + *

usageMetadata: Optional. Usage metadata for the response. + */ + @CanIgnoreReturnValue + public Builder usageMetadata(UsageMetadata.Builder usageMetadataBuilder) { + return usageMetadata(usageMetadataBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder usageMetadata(Optional usageMetadata); + + /** Clears the value of usageMetadata field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearUsageMetadata() { + return usageMetadata(Optional.empty()); + } + public abstract EventMetadata build(); } diff --git a/src/main/java/com/google/cloud/agentplatform/types/ExperimentConfig.java b/src/main/java/com/google/cloud/agentplatform/types/ExperimentConfig.java new file mode 100644 index 0000000..870c67d --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/ExperimentConfig.java @@ -0,0 +1,56 @@ +/* + * 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.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.genai.JsonSerializable; + +/** The experiment config to control feature experiments. */ +@AutoValue +@JsonDeserialize(builder = ExperimentConfig.Builder.class) +public abstract class ExperimentConfig extends JsonSerializable { + /** Instantiates a builder for ExperimentConfig. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_ExperimentConfig.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for ExperimentConfig. */ + @AutoValue.Builder + public abstract static class Builder { + /** For internal usage. Please use `ExperimentConfig.builder()` for instantiation. */ + @JsonCreator + private static Builder create() { + return new AutoValue_ExperimentConfig.Builder(); + } + + public abstract ExperimentConfig build(); + } + + /** Deserializes a JSON string to a ExperimentConfig object. */ + @ExcludeFromGeneratedCoverageReport + public static ExperimentConfig fromJson(String jsonString) { + return JsonSerializable.fromJsonString(jsonString, ExperimentConfig.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 index b388b3d..94227cc 100644 --- a/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesRequestDirectContentsSourceEvent.java +++ b/src/main/java/com/google/cloud/agentplatform/types/GenerateMemoriesRequestDirectContentsSourceEvent.java @@ -25,6 +25,7 @@ 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; /** */ @@ -35,6 +36,10 @@ public abstract class GenerateMemoriesRequestDirectContentsSourceEvent extends J @JsonProperty("content") public abstract Optional content(); + /** Optional. The time at which the event occurred. */ + @JsonProperty("eventTime") + public abstract Optional eventTime(); + /** Instantiates a builder for GenerateMemoriesRequestDirectContentsSourceEvent. */ @ExcludeFromGeneratedCoverageReport public static Builder builder() { @@ -74,6 +79,24 @@ public Builder clearContent() { return content(Optional.empty()); } + /** + * Setter for eventTime. + * + *

eventTime: Optional. The time at which the event occurred. + */ + @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 GenerateMemoriesRequestDirectContentsSourceEvent build(); } diff --git a/src/main/java/com/google/cloud/agentplatform/types/GoogleTypeDate.java b/src/main/java/com/google/cloud/agentplatform/types/GoogleTypeDate.java new file mode 100644 index 0000000..a8fc5d7 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/GoogleTypeDate.java @@ -0,0 +1,138 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Optional; + +/** + * Represents a whole or partial calendar date, such as a birthday. The time of day and time zone + * are either specified elsewhere or are insignificant. The date is relative to the Gregorian + * Calendar. This can represent one of the following: * A full date, with non-zero year, month, and + * day values. * A month and day, with a zero year (for example, an anniversary). * A year on its + * own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit + * card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * + * google.protobuf.Timestamp + */ +@AutoValue +@JsonDeserialize(builder = GoogleTypeDate.Builder.class) +public abstract class GoogleTypeDate extends JsonSerializable { + /** Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. */ + @JsonProperty("year") + public abstract Optional year(); + + /** Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. */ + @JsonProperty("month") + public abstract Optional month(); + + /** + * Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year + * by itself or a year and month where the day isn't significant. + */ + @JsonProperty("day") + public abstract Optional day(); + + /** Instantiates a builder for GoogleTypeDate. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_GoogleTypeDate.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for GoogleTypeDate. */ + @AutoValue.Builder + public abstract static class Builder { + /** For internal usage. Please use `GoogleTypeDate.builder()` for instantiation. */ + @JsonCreator + private static Builder create() { + return new AutoValue_GoogleTypeDate.Builder(); + } + + /** + * Setter for year. + * + *

year: Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. + */ + @JsonProperty("year") + public abstract Builder year(Integer year); + + @ExcludeFromGeneratedCoverageReport + abstract Builder year(Optional year); + + /** Clears the value of year field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearYear() { + return year(Optional.empty()); + } + + /** + * Setter for month. + * + *

month: Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and + * day. + */ + @JsonProperty("month") + public abstract Builder month(Integer month); + + @ExcludeFromGeneratedCoverageReport + abstract Builder month(Optional month); + + /** Clears the value of month field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearMonth() { + return month(Optional.empty()); + } + + /** + * Setter for day. + * + *

day: Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to + * specify a year by itself or a year and month where the day isn't significant. + */ + @JsonProperty("day") + public abstract Builder day(Integer day); + + @ExcludeFromGeneratedCoverageReport + abstract Builder day(Optional day); + + /** Clears the value of day field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearDay() { + return day(Optional.empty()); + } + + public abstract GoogleTypeDate build(); + } + + /** Deserializes a JSON string to a GoogleTypeDate object. */ + @ExcludeFromGeneratedCoverageReport + public static GoogleTypeDate fromJson(String jsonString) { + return JsonSerializable.fromJsonString(jsonString, GoogleTypeDate.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 index 70cd875..b3af147 100644 --- a/src/main/java/com/google/cloud/agentplatform/types/IntermediateExtractedMemory.java +++ b/src/main/java/com/google/cloud/agentplatform/types/IntermediateExtractedMemory.java @@ -46,6 +46,13 @@ public abstract class IntermediateExtractedMemory extends JsonSerializable { @JsonProperty("context") public abstract Optional context(); + /** + * Output only. Indicates that the extracted memory originated from an explicit instruction to + * remember or forget information. + */ + @JsonProperty("isExplicit") + public abstract Optional isExplicit(); + /** Instantiates a builder for IntermediateExtractedMemory. */ @ExcludeFromGeneratedCoverageReport public static Builder builder() { @@ -119,6 +126,25 @@ public Builder clearContext() { return context(Optional.empty()); } + /** + * Setter for isExplicit. + * + *

isExplicit: Output only. Indicates that the extracted memory originated from an explicit + * instruction to remember or forget information. + */ + @JsonProperty("isExplicit") + public abstract Builder isExplicit(boolean isExplicit); + + @ExcludeFromGeneratedCoverageReport + abstract Builder isExplicit(Optional isExplicit); + + /** Clears the value of isExplicit field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearIsExplicit() { + return isExplicit(Optional.empty()); + } + public abstract IntermediateExtractedMemory build(); } diff --git a/src/main/java/com/google/cloud/agentplatform/types/MediaModality.java b/src/main/java/com/google/cloud/agentplatform/types/MediaModality.java new file mode 100644 index 0000000..8e830ab --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/MediaModality.java @@ -0,0 +1,122 @@ +/* + * 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 modality that this token count applies to. */ +public class MediaModality { + + /** Enum representing the known values for MediaModality. */ + public enum Known { + /** When a modality is not specified, it is treated as `TEXT`. */ + MODALITY_UNSPECIFIED, + + /** The `Part` contains plain text. */ + TEXT, + + /** The `Part` contains an image. */ + IMAGE, + + /** The `Part` contains a video. */ + VIDEO, + + /** The `Part` contains audio. */ + AUDIO, + + /** The `Part` contains a document, such as a PDF. */ + DOCUMENT, + + MEDIA_MODALITY_UNSPECIFIED + } + + private Known mediaModalityEnum; + private final String value; + + @JsonCreator + public MediaModality(String value) { + this.value = value; + for (Known mediaModalityEnum : Known.values()) { + if (Ascii.equalsIgnoreCase(mediaModalityEnum.toString(), value)) { + this.mediaModalityEnum = mediaModalityEnum; + break; + } + } + if (this.mediaModalityEnum == null) { + this.mediaModalityEnum = Known.MEDIA_MODALITY_UNSPECIFIED; + } + } + + public MediaModality(Known knownValue) { + this.mediaModalityEnum = 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 MediaModality)) { + return false; + } + + MediaModality other = (MediaModality) o; + + if (this.mediaModalityEnum != Known.MEDIA_MODALITY_UNSPECIFIED + && other.mediaModalityEnum != Known.MEDIA_MODALITY_UNSPECIFIED) { + return this.mediaModalityEnum == other.mediaModalityEnum; + } else if (this.mediaModalityEnum == Known.MEDIA_MODALITY_UNSPECIFIED + && other.mediaModalityEnum == Known.MEDIA_MODALITY_UNSPECIFIED) { + return this.value.equals(other.value); + } + return false; + } + + @ExcludeFromGeneratedCoverageReport + @Override + public int hashCode() { + if (this.mediaModalityEnum != Known.MEDIA_MODALITY_UNSPECIFIED) { + return this.mediaModalityEnum.hashCode(); + } else { + return Objects.hashCode(this.value); + } + } + + @ExcludeFromGeneratedCoverageReport + public Known knownEnum() { + return this.mediaModalityEnum; + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/Memory.java b/src/main/java/com/google/cloud/agentplatform/types/Memory.java index 20a713e..d7b36ad 100644 --- a/src/main/java/com/google/cloud/agentplatform/types/Memory.java +++ b/src/main/java/com/google/cloud/agentplatform/types/Memory.java @@ -135,6 +135,10 @@ public abstract class Memory extends JsonSerializable { @JsonProperty("structuredContent") public abstract Optional structuredContent(); + /** Optional. Deprecated: Use `structured_content` instead. */ + @JsonProperty("structuredData") + public abstract Optional> structuredData(); + /** Instantiates a builder for Memory. */ @ExcludeFromGeneratedCoverageReport public static Builder builder() { @@ -531,6 +535,24 @@ public Builder clearStructuredContent() { return structuredContent(Optional.empty()); } + /** + * Setter for structuredData. + * + *

structuredData: Optional. Deprecated: Use `structured_content` instead. + */ + @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 Memory build(); } diff --git a/src/main/java/com/google/cloud/agentplatform/types/MemoryGenerationTriggerConfigGenerationTriggerRule.java b/src/main/java/com/google/cloud/agentplatform/types/MemoryGenerationTriggerConfigGenerationTriggerRule.java index 7c21c8b..3a69bff 100644 --- a/src/main/java/com/google/cloud/agentplatform/types/MemoryGenerationTriggerConfigGenerationTriggerRule.java +++ b/src/main/java/com/google/cloud/agentplatform/types/MemoryGenerationTriggerConfigGenerationTriggerRule.java @@ -53,6 +53,10 @@ public abstract class MemoryGenerationTriggerConfigGenerationTriggerRule extends @JsonProperty("overlapEventCount") public abstract Optional overlapEventCount(); + /** Optional. Specifies to trigger generation when the token count reaches this limit. */ + @JsonProperty("tokenLimit") + public abstract Optional tokenLimit(); + /** Instantiates a builder for MemoryGenerationTriggerConfigGenerationTriggerRule. */ @ExcludeFromGeneratedCoverageReport public static Builder builder() { @@ -151,6 +155,25 @@ public Builder clearOverlapEventCount() { return overlapEventCount(Optional.empty()); } + /** + * Setter for tokenLimit. + * + *

tokenLimit: Optional. Specifies to trigger generation when the token count reaches this + * limit. + */ + @JsonProperty("tokenLimit") + public abstract Builder tokenLimit(Integer tokenLimit); + + @ExcludeFromGeneratedCoverageReport + abstract Builder tokenLimit(Optional tokenLimit); + + /** Clears the value of tokenLimit field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearTokenLimit() { + return tokenLimit(Optional.empty()); + } + public abstract MemoryGenerationTriggerConfigGenerationTriggerRule build(); } 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..6e3ee9c 100644 --- a/src/main/java/com/google/cloud/agentplatform/types/MemoryTopicId.java +++ b/src/main/java/com/google/cloud/agentplatform/types/MemoryTopicId.java @@ -38,6 +38,10 @@ public abstract class MemoryTopicId extends JsonSerializable { @JsonProperty("managedMemoryTopic") public abstract Optional managedMemoryTopic(); + /** Optional. Deprecated: Use `schema_id` in top-level protos instead. */ + @JsonProperty("schemaId") + public abstract Optional schemaId(); + /** Instantiates a builder for MemoryTopicId. */ @ExcludeFromGeneratedCoverageReport public static Builder builder() { @@ -112,6 +116,24 @@ public Builder managedMemoryTopic(String managedMemoryTopic) { return managedMemoryTopic(new ManagedTopicEnum(managedMemoryTopic)); } + /** + * Setter for schemaId. + * + *

schemaId: Optional. Deprecated: Use `schema_id` in top-level protos instead. + */ + @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 MemoryTopicId build(); } diff --git a/src/main/java/com/google/cloud/agentplatform/types/ModalityTokenCount.java b/src/main/java/com/google/cloud/agentplatform/types/ModalityTokenCount.java new file mode 100644 index 0000000..c41972a --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/ModalityTokenCount.java @@ -0,0 +1,129 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Optional; + +/** + * Represents a breakdown of token usage by modality. This message is used in CountTokensResponse + * and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used + * by each modality (e.g., text, image, video) in a request. This is particularly useful for + * multimodal models, allowing you to track and manage token consumption for billing and quota + * purposes. + */ +@AutoValue +@JsonDeserialize(builder = ModalityTokenCount.Builder.class) +public abstract class ModalityTokenCount extends JsonSerializable { + /** The modality that this token count applies to. */ + @JsonProperty("modality") + public abstract Optional modality(); + + /** The number of tokens counted for this modality. */ + @JsonProperty("tokenCount") + public abstract Optional tokenCount(); + + /** Instantiates a builder for ModalityTokenCount. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_ModalityTokenCount.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for ModalityTokenCount. */ + @AutoValue.Builder + public abstract static class Builder { + /** For internal usage. Please use `ModalityTokenCount.builder()` for instantiation. */ + @JsonCreator + private static Builder create() { + return new AutoValue_ModalityTokenCount.Builder(); + } + + /** + * Setter for modality. + * + *

modality: The modality that this token count applies to. + */ + @JsonProperty("modality") + public abstract Builder modality(MediaModality modality); + + @ExcludeFromGeneratedCoverageReport + abstract Builder modality(Optional modality); + + /** Clears the value of modality field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearModality() { + return modality(Optional.empty()); + } + + /** + * Setter for modality given a known enum. + * + *

modality: The modality that this token count applies to. + */ + @CanIgnoreReturnValue + public Builder modality(MediaModality.Known knownType) { + return modality(new MediaModality(knownType)); + } + + /** + * Setter for modality given a string. + * + *

modality: The modality that this token count applies to. + */ + @CanIgnoreReturnValue + public Builder modality(String modality) { + return modality(new MediaModality(modality)); + } + + /** + * Setter for tokenCount. + * + *

tokenCount: The number of tokens counted for this modality. + */ + @JsonProperty("tokenCount") + public abstract Builder tokenCount(Integer tokenCount); + + @ExcludeFromGeneratedCoverageReport + abstract Builder tokenCount(Optional tokenCount); + + /** Clears the value of tokenCount field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearTokenCount() { + return tokenCount(Optional.empty()); + } + + public abstract ModalityTokenCount build(); + } + + /** Deserializes a JSON string to a ModalityTokenCount object. */ + @ExcludeFromGeneratedCoverageReport + public static ModalityTokenCount fromJson(String jsonString) { + return JsonSerializable.fromJsonString(jsonString, ModalityTokenCount.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngine.java b/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngine.java index 8e4d834..cdb67b8 100644 --- a/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngine.java +++ b/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngine.java @@ -86,6 +86,19 @@ public abstract class ReasoningEngine extends JsonSerializable { @JsonProperty("trafficConfig") public abstract Optional trafficConfig(); + /** Optional. The experiment config used to control which features to enable in this API call. */ + @JsonProperty("experimentConfig") + public abstract Optional experimentConfig(); + + /** Optional. Configures garbage collection of Runtime Revisions. */ + @JsonProperty("revisionGarbageCollectionStrategy") + public abstract Optional + revisionGarbageCollectionStrategy(); + + /** Output only. The URL of the reasoning engine. */ + @JsonProperty("url") + public abstract Optional url(); + /** Instantiates a builder for ReasoningEngine. */ @ExcludeFromGeneratedCoverageReport public static Builder builder() { @@ -337,6 +350,89 @@ public Builder clearTrafficConfig() { return trafficConfig(Optional.empty()); } + /** + * Setter for experimentConfig. + * + *

experimentConfig: Optional. The experiment config used to control which features to enable + * in this API call. + */ + @JsonProperty("experimentConfig") + public abstract Builder experimentConfig(ExperimentConfig experimentConfig); + + /** + * Setter for experimentConfig builder. + * + *

experimentConfig: Optional. The experiment config used to control which features to enable + * in this API call. + */ + @CanIgnoreReturnValue + public Builder experimentConfig(ExperimentConfig.Builder experimentConfigBuilder) { + return experimentConfig(experimentConfigBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder experimentConfig(Optional experimentConfig); + + /** Clears the value of experimentConfig field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearExperimentConfig() { + return experimentConfig(Optional.empty()); + } + + /** + * Setter for revisionGarbageCollectionStrategy. + * + *

revisionGarbageCollectionStrategy: Optional. Configures garbage collection of Runtime + * Revisions. + */ + @JsonProperty("revisionGarbageCollectionStrategy") + public abstract Builder revisionGarbageCollectionStrategy( + ReasoningEngineRevisionGarbageCollectionStrategy revisionGarbageCollectionStrategy); + + /** + * Setter for revisionGarbageCollectionStrategy builder. + * + *

revisionGarbageCollectionStrategy: Optional. Configures garbage collection of Runtime + * Revisions. + */ + @CanIgnoreReturnValue + public Builder revisionGarbageCollectionStrategy( + ReasoningEngineRevisionGarbageCollectionStrategy.Builder + revisionGarbageCollectionStrategyBuilder) { + return revisionGarbageCollectionStrategy(revisionGarbageCollectionStrategyBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder revisionGarbageCollectionStrategy( + Optional + revisionGarbageCollectionStrategy); + + /** Clears the value of revisionGarbageCollectionStrategy field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearRevisionGarbageCollectionStrategy() { + return revisionGarbageCollectionStrategy(Optional.empty()); + } + + /** + * Setter for url. + * + *

url: Output only. The URL of the reasoning engine. + */ + @JsonProperty("url") + public abstract Builder url(String url); + + @ExcludeFromGeneratedCoverageReport + abstract Builder url(Optional url); + + /** Clears the value of url field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearUrl() { + return url(Optional.empty()); + } + public abstract ReasoningEngine build(); } diff --git a/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineContextSpec.java b/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineContextSpec.java index 5736d4d..f5a4ac9 100644 --- a/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineContextSpec.java +++ b/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineContextSpec.java @@ -34,6 +34,13 @@ public abstract class ReasoningEngineContextSpec extends JsonSerializable { @JsonProperty("memoryBankConfig") public abstract Optional memoryBankConfig(); + /** + * Optional. Specification for an Example Store, which manages few-shot examples for the Agent + * Engine. + */ + @JsonProperty("exampleStoreConfig") + public abstract Optional exampleStoreConfig(); + /** Instantiates a builder for ReasoningEngineContextSpec. */ @ExcludeFromGeneratedCoverageReport public static Builder builder() { @@ -85,6 +92,39 @@ public Builder clearMemoryBankConfig() { return memoryBankConfig(Optional.empty()); } + /** + * Setter for exampleStoreConfig. + * + *

exampleStoreConfig: Optional. Specification for an Example Store, which manages few-shot + * examples for the Agent Engine. + */ + @JsonProperty("exampleStoreConfig") + public abstract Builder exampleStoreConfig( + ReasoningEngineContextSpecExampleStoreConfig exampleStoreConfig); + + /** + * Setter for exampleStoreConfig builder. + * + *

exampleStoreConfig: Optional. Specification for an Example Store, which manages few-shot + * examples for the Agent Engine. + */ + @CanIgnoreReturnValue + public Builder exampleStoreConfig( + ReasoningEngineContextSpecExampleStoreConfig.Builder exampleStoreConfigBuilder) { + return exampleStoreConfig(exampleStoreConfigBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder exampleStoreConfig( + Optional exampleStoreConfig); + + /** Clears the value of exampleStoreConfig field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearExampleStoreConfig() { + return exampleStoreConfig(Optional.empty()); + } + public abstract ReasoningEngineContextSpec build(); } diff --git a/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineContextSpecExampleStoreConfig.java b/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineContextSpecExampleStoreConfig.java new file mode 100644 index 0000000..637a1b1 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineContextSpecExampleStoreConfig.java @@ -0,0 +1,108 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Optional; + +/** Specification for an Example Store. */ +@AutoValue +@JsonDeserialize(builder = ReasoningEngineContextSpecExampleStoreConfig.Builder.class) +public abstract class ReasoningEngineContextSpecExampleStoreConfig extends JsonSerializable { + /** + * Optional. Configuration for how to perform similarity search on examples. If not set, the + * Example Store will use the default embedding model `text-embedding-005`. + */ + @JsonProperty("similaritySearchConfig") + public abstract Optional + similaritySearchConfig(); + + /** Instantiates a builder for ReasoningEngineContextSpecExampleStoreConfig. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_ReasoningEngineContextSpecExampleStoreConfig.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for ReasoningEngineContextSpecExampleStoreConfig. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `ReasoningEngineContextSpecExampleStoreConfig.builder()` for + * instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_ReasoningEngineContextSpecExampleStoreConfig.Builder(); + } + + /** + * Setter for similaritySearchConfig. + * + *

similaritySearchConfig: Optional. Configuration for how to perform similarity search on + * examples. If not set, the Example Store will use the default embedding model + * `text-embedding-005`. + */ + @JsonProperty("similaritySearchConfig") + public abstract Builder similaritySearchConfig( + ReasoningEngineContextSpecExampleStoreConfigSimilaritySearchConfig similaritySearchConfig); + + /** + * Setter for similaritySearchConfig builder. + * + *

similaritySearchConfig: Optional. Configuration for how to perform similarity search on + * examples. If not set, the Example Store will use the default embedding model + * `text-embedding-005`. + */ + @CanIgnoreReturnValue + public Builder similaritySearchConfig( + ReasoningEngineContextSpecExampleStoreConfigSimilaritySearchConfig.Builder + similaritySearchConfigBuilder) { + return similaritySearchConfig(similaritySearchConfigBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder similaritySearchConfig( + Optional + similaritySearchConfig); + + /** Clears the value of similaritySearchConfig field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearSimilaritySearchConfig() { + return similaritySearchConfig(Optional.empty()); + } + + public abstract ReasoningEngineContextSpecExampleStoreConfig build(); + } + + /** Deserializes a JSON string to a ReasoningEngineContextSpecExampleStoreConfig object. */ + @ExcludeFromGeneratedCoverageReport + public static ReasoningEngineContextSpecExampleStoreConfig fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, ReasoningEngineContextSpecExampleStoreConfig.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineContextSpecExampleStoreConfigSimilaritySearchConfig.java b/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineContextSpecExampleStoreConfigSimilaritySearchConfig.java new file mode 100644 index 0000000..9c3eb3d --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineContextSpecExampleStoreConfigSimilaritySearchConfig.java @@ -0,0 +1,100 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Optional; + +/** Configuration for how to perform similarity search on examples. */ +@AutoValue +@JsonDeserialize( + builder = ReasoningEngineContextSpecExampleStoreConfigSimilaritySearchConfig.Builder.class) +public abstract class ReasoningEngineContextSpecExampleStoreConfigSimilaritySearchConfig + extends JsonSerializable { + /** + * Required. The Gemini model used to generate embeddings to lookup similar examples. Format: + * `projects/{project}/locations/{location}/publishers/google/models/{model}`. + */ + @JsonProperty("embeddingModel") + public abstract Optional embeddingModel(); + + /** + * Instantiates a builder for ReasoningEngineContextSpecExampleStoreConfigSimilaritySearchConfig. + */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_ReasoningEngineContextSpecExampleStoreConfigSimilaritySearchConfig + .Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for ReasoningEngineContextSpecExampleStoreConfigSimilaritySearchConfig. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use + * `ReasoningEngineContextSpecExampleStoreConfigSimilaritySearchConfig.builder()` for + * instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_ReasoningEngineContextSpecExampleStoreConfigSimilaritySearchConfig + .Builder(); + } + + /** + * Setter for embeddingModel. + * + *

embeddingModel: Required. The Gemini model used to generate embeddings to lookup similar + * examples. Format: `projects/{project}/locations/{location}/publishers/google/models/{model}`. + */ + @JsonProperty("embeddingModel") + public abstract Builder embeddingModel(String embeddingModel); + + @ExcludeFromGeneratedCoverageReport + abstract Builder embeddingModel(Optional embeddingModel); + + /** Clears the value of embeddingModel field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearEmbeddingModel() { + return embeddingModel(Optional.empty()); + } + + public abstract ReasoningEngineContextSpecExampleStoreConfigSimilaritySearchConfig build(); + } + + /** + * Deserializes a JSON string to a + * ReasoningEngineContextSpecExampleStoreConfigSimilaritySearchConfig object. + */ + @ExcludeFromGeneratedCoverageReport + public static ReasoningEngineContextSpecExampleStoreConfigSimilaritySearchConfig fromJson( + String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, ReasoningEngineContextSpecExampleStoreConfigSimilaritySearchConfig.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineContextSpecMemoryBankConfigGenerationConfig.java b/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineContextSpecMemoryBankConfigGenerationConfig.java index 652c1ac..2a1c5ed 100644 --- a/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineContextSpecMemoryBankConfigGenerationConfig.java +++ b/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineContextSpecMemoryBankConfigGenerationConfig.java @@ -45,6 +45,13 @@ public abstract class ReasoningEngineContextSpecMemoryBankConfigGenerationConfig @JsonProperty("generationTriggerConfig") public abstract Optional generationTriggerConfig(); + /** + * Optional. A custom prompt to use for extracting memories from conversations. If not set, a + * default prompt will be used. + */ + @JsonProperty("memoryExtractionInstructions") + public abstract Optional memoryExtractionInstructions(); + /** Instantiates a builder for ReasoningEngineContextSpecMemoryBankConfigGenerationConfig. */ @ExcludeFromGeneratedCoverageReport public static Builder builder() { @@ -118,6 +125,25 @@ public Builder clearGenerationTriggerConfig() { return generationTriggerConfig(Optional.empty()); } + /** + * Setter for memoryExtractionInstructions. + * + *

memoryExtractionInstructions: Optional. A custom prompt to use for extracting memories + * from conversations. If not set, a default prompt will be used. + */ + @JsonProperty("memoryExtractionInstructions") + public abstract Builder memoryExtractionInstructions(String memoryExtractionInstructions); + + @ExcludeFromGeneratedCoverageReport + abstract Builder memoryExtractionInstructions(Optional memoryExtractionInstructions); + + /** Clears the value of memoryExtractionInstructions field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearMemoryExtractionInstructions() { + return memoryExtractionInstructions(Optional.empty()); + } + public abstract ReasoningEngineContextSpecMemoryBankConfigGenerationConfig build(); } diff --git a/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineRevisionGarbageCollectionStrategy.java b/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineRevisionGarbageCollectionStrategy.java new file mode 100644 index 0000000..6ff5562 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineRevisionGarbageCollectionStrategy.java @@ -0,0 +1,139 @@ +/* + * 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; + +/** Configures garbage collection of Runtime Revisions. */ +@AutoValue +@JsonDeserialize(builder = ReasoningEngineRevisionGarbageCollectionStrategy.Builder.class) +public abstract class ReasoningEngineRevisionGarbageCollectionStrategy extends JsonSerializable { + /** Optional. Performs no automatic garbage collection on Runtime Revisions. */ + @JsonProperty("noGarbageCollection") + public abstract Optional + noGarbageCollection(); + + /** Optional. Keeps only the latest N Runtime Revisions active. */ + @JsonProperty("keepNLatest") + public abstract Optional + keepNLatest(); + + /** Instantiates a builder for ReasoningEngineRevisionGarbageCollectionStrategy. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_ReasoningEngineRevisionGarbageCollectionStrategy.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for ReasoningEngineRevisionGarbageCollectionStrategy. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `ReasoningEngineRevisionGarbageCollectionStrategy.builder()` + * for instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_ReasoningEngineRevisionGarbageCollectionStrategy.Builder(); + } + + /** + * Setter for noGarbageCollection. + * + *

noGarbageCollection: Optional. Performs no automatic garbage collection on Runtime + * Revisions. + */ + @JsonProperty("noGarbageCollection") + public abstract Builder noGarbageCollection( + ReasoningEngineRevisionGarbageCollectionStrategyNoGarbageCollection noGarbageCollection); + + /** + * Setter for noGarbageCollection builder. + * + *

noGarbageCollection: Optional. Performs no automatic garbage collection on Runtime + * Revisions. + */ + @CanIgnoreReturnValue + public Builder noGarbageCollection( + ReasoningEngineRevisionGarbageCollectionStrategyNoGarbageCollection.Builder + noGarbageCollectionBuilder) { + return noGarbageCollection(noGarbageCollectionBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder noGarbageCollection( + Optional + noGarbageCollection); + + /** Clears the value of noGarbageCollection field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearNoGarbageCollection() { + return noGarbageCollection(Optional.empty()); + } + + /** + * Setter for keepNLatest. + * + *

keepNLatest: Optional. Keeps only the latest N Runtime Revisions active. + */ + @JsonProperty("keepNLatest") + public abstract Builder keepNLatest( + ReasoningEngineRevisionGarbageCollectionStrategyKeepNLatest keepNLatest); + + /** + * Setter for keepNLatest builder. + * + *

keepNLatest: Optional. Keeps only the latest N Runtime Revisions active. + */ + @CanIgnoreReturnValue + public Builder keepNLatest( + ReasoningEngineRevisionGarbageCollectionStrategyKeepNLatest.Builder keepNLatestBuilder) { + return keepNLatest(keepNLatestBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder keepNLatest( + Optional keepNLatest); + + /** Clears the value of keepNLatest field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearKeepNLatest() { + return keepNLatest(Optional.empty()); + } + + public abstract ReasoningEngineRevisionGarbageCollectionStrategy build(); + } + + /** Deserializes a JSON string to a ReasoningEngineRevisionGarbageCollectionStrategy object. */ + @ExcludeFromGeneratedCoverageReport + public static ReasoningEngineRevisionGarbageCollectionStrategy fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, ReasoningEngineRevisionGarbageCollectionStrategy.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineRevisionGarbageCollectionStrategyKeepNLatest.java b/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineRevisionGarbageCollectionStrategyKeepNLatest.java new file mode 100644 index 0000000..8389339 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineRevisionGarbageCollectionStrategyKeepNLatest.java @@ -0,0 +1,105 @@ +/* + * 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; + +/** Keeps only the latest N Runtime Revisions active. */ +@AutoValue +@JsonDeserialize( + builder = ReasoningEngineRevisionGarbageCollectionStrategyKeepNLatest.Builder.class) +public abstract class ReasoningEngineRevisionGarbageCollectionStrategyKeepNLatest + extends JsonSerializable { + /** + * Required. Specifies the maximum number of Runtime Revisions to keep active. If an update to + * Reasoning Engine would result in exceeding this number of active Runtime Revisions, a new + * Runtime Revision will be created, while the oldest Runtime Revision will be automatically + * deprecated, providing it's not configured to serve traffic via `traffic_config`. If the oldest + * Runtime Revision is configured to serve traffic, the update will fail validation. No changes + * will be made to the Reasoning Engine, existing Runtime Revisions, and no new Runtime Revision + * will be created. + */ + @JsonProperty("maxActiveRevisions") + public abstract Optional maxActiveRevisions(); + + /** Instantiates a builder for ReasoningEngineRevisionGarbageCollectionStrategyKeepNLatest. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_ReasoningEngineRevisionGarbageCollectionStrategyKeepNLatest.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for ReasoningEngineRevisionGarbageCollectionStrategyKeepNLatest. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use + * `ReasoningEngineRevisionGarbageCollectionStrategyKeepNLatest.builder()` for instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_ReasoningEngineRevisionGarbageCollectionStrategyKeepNLatest.Builder(); + } + + /** + * Setter for maxActiveRevisions. + * + *

maxActiveRevisions: Required. Specifies the maximum number of Runtime Revisions to keep + * active. If an update to Reasoning Engine would result in exceeding this number of active + * Runtime Revisions, a new Runtime Revision will be created, while the oldest Runtime Revision + * will be automatically deprecated, providing it's not configured to serve traffic via + * `traffic_config`. If the oldest Runtime Revision is configured to serve traffic, the update + * will fail validation. No changes will be made to the Reasoning Engine, existing Runtime + * Revisions, and no new Runtime Revision will be created. + */ + @JsonProperty("maxActiveRevisions") + public abstract Builder maxActiveRevisions(Integer maxActiveRevisions); + + @ExcludeFromGeneratedCoverageReport + abstract Builder maxActiveRevisions(Optional maxActiveRevisions); + + /** Clears the value of maxActiveRevisions field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearMaxActiveRevisions() { + return maxActiveRevisions(Optional.empty()); + } + + public abstract ReasoningEngineRevisionGarbageCollectionStrategyKeepNLatest build(); + } + + /** + * Deserializes a JSON string to a ReasoningEngineRevisionGarbageCollectionStrategyKeepNLatest + * object. + */ + @ExcludeFromGeneratedCoverageReport + public static ReasoningEngineRevisionGarbageCollectionStrategyKeepNLatest fromJson( + String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, ReasoningEngineRevisionGarbageCollectionStrategyKeepNLatest.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineRevisionGarbageCollectionStrategyNoGarbageCollection.java b/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineRevisionGarbageCollectionStrategyNoGarbageCollection.java new file mode 100644 index 0000000..52f3b2f --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineRevisionGarbageCollectionStrategyNoGarbageCollection.java @@ -0,0 +1,71 @@ +/* + * 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.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.genai.JsonSerializable; + +/** Performs no automatic garbage collection on Runtime Revisions. */ +@AutoValue +@JsonDeserialize( + builder = ReasoningEngineRevisionGarbageCollectionStrategyNoGarbageCollection.Builder.class) +public abstract class ReasoningEngineRevisionGarbageCollectionStrategyNoGarbageCollection + extends JsonSerializable { + /** + * Instantiates a builder for ReasoningEngineRevisionGarbageCollectionStrategyNoGarbageCollection. + */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_ReasoningEngineRevisionGarbageCollectionStrategyNoGarbageCollection + .Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for ReasoningEngineRevisionGarbageCollectionStrategyNoGarbageCollection. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use + * `ReasoningEngineRevisionGarbageCollectionStrategyNoGarbageCollection.builder()` for + * instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_ReasoningEngineRevisionGarbageCollectionStrategyNoGarbageCollection + .Builder(); + } + + public abstract ReasoningEngineRevisionGarbageCollectionStrategyNoGarbageCollection build(); + } + + /** + * Deserializes a JSON string to a + * ReasoningEngineRevisionGarbageCollectionStrategyNoGarbageCollection object. + */ + @ExcludeFromGeneratedCoverageReport + public static ReasoningEngineRevisionGarbageCollectionStrategyNoGarbageCollection fromJson( + String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, ReasoningEngineRevisionGarbageCollectionStrategyNoGarbageCollection.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineSpec.java b/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineSpec.java index d1ea817..9d8ead2 100644 --- a/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineSpec.java +++ b/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineSpec.java @@ -99,6 +99,23 @@ public abstract class ReasoningEngineSpec extends JsonSerializable { @JsonProperty("containerSpec") public abstract Optional containerSpec(); + /** + * Optional. The resource name of the linked ExampleStore. At query time, examples can be used to + * guide the performance of the agent by providing the expected response or demonstrating when and + * how tools should be called. Format: + * `projects/{project}/locations/{location}/exampleStores/{example_store}` + */ + @JsonProperty("exampleStore") + public abstract Optional exampleStore(); + + /** Output only. Boolean signifying if this agent engine has a runtime currently or not. */ + @JsonProperty("runtimeActive") + public abstract Optional runtimeActive(); + + /** Optional. Configuration for building container image. */ + @JsonProperty("buildSpec") + public abstract Optional buildSpec(); + /** Instantiates a builder for ReasoningEngineSpec. */ @ExcludeFromGeneratedCoverageReport public static Builder builder() { @@ -394,6 +411,74 @@ public Builder clearContainerSpec() { return containerSpec(Optional.empty()); } + /** + * Setter for exampleStore. + * + *

exampleStore: Optional. The resource name of the linked ExampleStore. At query time, + * examples can be used to guide the performance of the agent by providing the expected response + * or demonstrating when and how tools should be called. Format: + * `projects/{project}/locations/{location}/exampleStores/{example_store}` + */ + @JsonProperty("exampleStore") + public abstract Builder exampleStore(String exampleStore); + + @ExcludeFromGeneratedCoverageReport + abstract Builder exampleStore(Optional exampleStore); + + /** Clears the value of exampleStore field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearExampleStore() { + return exampleStore(Optional.empty()); + } + + /** + * Setter for runtimeActive. + * + *

runtimeActive: Output only. Boolean signifying if this agent engine has a runtime + * currently or not. + */ + @JsonProperty("runtimeActive") + public abstract Builder runtimeActive(boolean runtimeActive); + + @ExcludeFromGeneratedCoverageReport + abstract Builder runtimeActive(Optional runtimeActive); + + /** Clears the value of runtimeActive field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearRuntimeActive() { + return runtimeActive(Optional.empty()); + } + + /** + * Setter for buildSpec. + * + *

buildSpec: Optional. Configuration for building container image. + */ + @JsonProperty("buildSpec") + public abstract Builder buildSpec(ReasoningEngineSpecBuildSpec buildSpec); + + /** + * Setter for buildSpec builder. + * + *

buildSpec: Optional. Configuration for building container image. + */ + @CanIgnoreReturnValue + public Builder buildSpec(ReasoningEngineSpecBuildSpec.Builder buildSpecBuilder) { + return buildSpec(buildSpecBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder buildSpec(Optional buildSpec); + + /** Clears the value of buildSpec field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearBuildSpec() { + return buildSpec(Optional.empty()); + } + public abstract ReasoningEngineSpec build(); } diff --git a/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineSpecBuildSpec.java b/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineSpecBuildSpec.java new file mode 100644 index 0000000..045574e --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineSpecBuildSpec.java @@ -0,0 +1,87 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Optional; + +/** Specification for building container image. */ +@AutoValue +@JsonDeserialize(builder = ReasoningEngineSpecBuildSpec.Builder.class) +public abstract class ReasoningEngineSpecBuildSpec extends JsonSerializable { + /** + * Optional. Identifier. The resource name of the Cloud Build WorkerPool to use for the build. + * Format: `projects/{project}/locations/{location}/workerPools/{worker_pool}` + */ + @JsonProperty("workerPool") + public abstract Optional workerPool(); + + /** Instantiates a builder for ReasoningEngineSpecBuildSpec. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_ReasoningEngineSpecBuildSpec.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for ReasoningEngineSpecBuildSpec. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `ReasoningEngineSpecBuildSpec.builder()` for instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_ReasoningEngineSpecBuildSpec.Builder(); + } + + /** + * Setter for workerPool. + * + *

workerPool: Optional. Identifier. The resource name of the Cloud Build WorkerPool to use + * for the build. Format: `projects/{project}/locations/{location}/workerPools/{worker_pool}` + */ + @JsonProperty("workerPool") + public abstract Builder workerPool(String workerPool); + + @ExcludeFromGeneratedCoverageReport + abstract Builder workerPool(Optional workerPool); + + /** Clears the value of workerPool field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearWorkerPool() { + return workerPool(Optional.empty()); + } + + public abstract ReasoningEngineSpecBuildSpec build(); + } + + /** Deserializes a JSON string to a ReasoningEngineSpecBuildSpec object. */ + @ExcludeFromGeneratedCoverageReport + public static ReasoningEngineSpecBuildSpec fromJson(String jsonString) { + return JsonSerializable.fromJsonString(jsonString, ReasoningEngineSpecBuildSpec.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineSpecDeploymentSpec.java b/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineSpecDeploymentSpec.java index 4dca71f..1a0f16b 100644 --- a/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineSpecDeploymentSpec.java +++ b/src/main/java/com/google/cloud/agentplatform/types/ReasoningEngineSpecDeploymentSpec.java @@ -104,6 +104,10 @@ public abstract class ReasoningEngineSpecDeploymentSpec extends JsonSerializable @JsonProperty("keepAliveProbe") public abstract Optional keepAliveProbe(); + /** Optional. If true, the Reasoning Engine will be deployed with a dedicated ingress endpoint. */ + @JsonProperty("dedicatedIngressEndpointEnabled") + public abstract Optional dedicatedIngressEndpointEnabled(); + /** Instantiates a builder for ReasoningEngineSpecDeploymentSpec. */ @ExcludeFromGeneratedCoverageReport public static Builder builder() { @@ -428,6 +432,27 @@ public Builder clearKeepAliveProbe() { return keepAliveProbe(Optional.empty()); } + /** + * Setter for dedicatedIngressEndpointEnabled. + * + *

dedicatedIngressEndpointEnabled: Optional. If true, the Reasoning Engine will be deployed + * with a dedicated ingress endpoint. + */ + @JsonProperty("dedicatedIngressEndpointEnabled") + public abstract Builder dedicatedIngressEndpointEnabled( + boolean dedicatedIngressEndpointEnabled); + + @ExcludeFromGeneratedCoverageReport + abstract Builder dedicatedIngressEndpointEnabled( + Optional dedicatedIngressEndpointEnabled); + + /** Clears the value of dedicatedIngressEndpointEnabled field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearDedicatedIngressEndpointEnabled() { + return dedicatedIngressEndpointEnabled(Optional.empty()); + } + public abstract ReasoningEngineSpecDeploymentSpec build(); } diff --git a/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentConnectionInfo.java b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentConnectionInfo.java index 8d704f3..2227e7d 100644 --- a/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentConnectionInfo.java +++ b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentConnectionInfo.java @@ -46,6 +46,10 @@ public abstract class SandboxEnvironmentConnectionInfo extends JsonSerializable @JsonProperty("routingToken") public abstract Optional routingToken(); + /** Output only. The hostname of the SandboxEnvironment. */ + @JsonProperty("sandboxHostname") + public abstract Optional sandboxHostname(); + /** Instantiates a builder for SandboxEnvironmentConnectionInfo. */ @ExcludeFromGeneratedCoverageReport public static Builder builder() { @@ -139,6 +143,24 @@ public Builder clearRoutingToken() { return routingToken(Optional.empty()); } + /** + * Setter for sandboxHostname. + * + *

sandboxHostname: Output only. The hostname of the SandboxEnvironment. + */ + @JsonProperty("sandboxHostname") + public abstract Builder sandboxHostname(String sandboxHostname); + + @ExcludeFromGeneratedCoverageReport + abstract Builder sandboxHostname(Optional sandboxHostname); + + /** Clears the value of sandboxHostname field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearSandboxHostname() { + return sandboxHostname(Optional.empty()); + } + public abstract SandboxEnvironmentConnectionInfo build(); } diff --git a/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentSpecComputerUseEnvironment.java b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentSpecComputerUseEnvironment.java index 8471a0d..b3f70d9 100644 --- a/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentSpecComputerUseEnvironment.java +++ b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentSpecComputerUseEnvironment.java @@ -19,14 +19,25 @@ 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 computer use environment with customized settings. */ @AutoValue @JsonDeserialize(builder = SandboxEnvironmentSpecComputerUseEnvironment.Builder.class) public abstract class SandboxEnvironmentSpecComputerUseEnvironment extends JsonSerializable { + /** + * Optional. The Artifact Registry Docker image URI (e.g., + * us-docker.dev.pkg/my-proj/my-repo/my-image:my-tag). When unspecified, the default Computer Use + * container image will be used. + */ + @JsonProperty("imageUri") + public abstract Optional imageUri(); + /** Instantiates a builder for SandboxEnvironmentSpecComputerUseEnvironment. */ @ExcludeFromGeneratedCoverageReport public static Builder builder() { @@ -48,6 +59,26 @@ private static Builder create() { return new AutoValue_SandboxEnvironmentSpecComputerUseEnvironment.Builder(); } + /** + * Setter for imageUri. + * + *

imageUri: Optional. The Artifact Registry Docker image URI (e.g., + * us-docker.dev.pkg/my-proj/my-repo/my-image:my-tag). When unspecified, the default Computer + * Use container image will be used. + */ + @JsonProperty("imageUri") + public abstract Builder imageUri(String imageUri); + + @ExcludeFromGeneratedCoverageReport + abstract Builder imageUri(Optional imageUri); + + /** Clears the value of imageUri field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearImageUri() { + return imageUri(Optional.empty()); + } + public abstract SandboxEnvironmentSpecComputerUseEnvironment build(); } diff --git a/src/main/java/com/google/cloud/agentplatform/types/SandboxState.java b/src/main/java/com/google/cloud/agentplatform/types/SandboxState.java index cf9adc9..fc46600 100644 --- a/src/main/java/com/google/cloud/agentplatform/types/SandboxState.java +++ b/src/main/java/com/google/cloud/agentplatform/types/SandboxState.java @@ -46,6 +46,15 @@ public enum Known { /** Sandbox runtime has been deleted. */ STATE_DELETED, + /** Sandbox runtime is paused. */ + STATE_PAUSED, + + /** Sandbox runtime is pausing. */ + STATE_PAUSING, + + /** Sandbox runtime is resuming. */ + STATE_RESUMING, + SANDBOX_STATE_UNSPECIFIED } diff --git a/src/main/java/com/google/cloud/agentplatform/types/Session.java b/src/main/java/com/google/cloud/agentplatform/types/Session.java index 6745b4e..4f02870 100644 --- a/src/main/java/com/google/cloud/agentplatform/types/Session.java +++ b/src/main/java/com/google/cloud/agentplatform/types/Session.java @@ -26,6 +26,8 @@ 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; @@ -81,6 +83,28 @@ public abstract class Session extends JsonSerializable { @JsonProperty("userId") public abstract Optional userId(); + /** + * Output only. The resource names of the Agents that interacted within the session. Each resource + * name has the format: `projects/{project}/locations/{location}/agents/{agent}`. + */ + @JsonProperty("agents") + public abstract Optional> agents(); + + /** + * The default limit of the number of steps each child Run can contain. Default to 20 if not + * specified. + */ + @JsonProperty("defaultRunStepLimit") + public abstract Optional defaultRunStepLimit(); + + /** Output only. The state of the session. */ + @JsonProperty("state") + public abstract Optional state(); + + /** Optional. Custom metadata for the session. */ + @JsonProperty("customMetadata") + public abstract Optional> customMetadata(); + /** Instantiates a builder for Session. */ @ExcludeFromGeneratedCoverageReport public static Builder builder() { @@ -267,6 +291,111 @@ public Builder clearUserId() { return userId(Optional.empty()); } + /** + * Setter for agents. + * + *

agents: Output only. The resource names of the Agents that interacted within the session. + * Each resource name has the format: `projects/{project}/locations/{location}/agents/{agent}`. + */ + @JsonProperty("agents") + public abstract Builder agents(List agents); + + /** + * Setter for agents. + * + *

agents: Output only. The resource names of the Agents that interacted within the session. + * Each resource name has the format: `projects/{project}/locations/{location}/agents/{agent}`. + */ + @CanIgnoreReturnValue + public Builder agents(String... agents) { + return agents(Arrays.asList(agents)); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder agents(Optional> agents); + + /** Clears the value of agents field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearAgents() { + return agents(Optional.empty()); + } + + /** + * Setter for defaultRunStepLimit. + * + *

defaultRunStepLimit: The default limit of the number of steps each child Run can contain. + * Default to 20 if not specified. + */ + @JsonProperty("defaultRunStepLimit") + public abstract Builder defaultRunStepLimit(Long defaultRunStepLimit); + + @ExcludeFromGeneratedCoverageReport + abstract Builder defaultRunStepLimit(Optional defaultRunStepLimit); + + /** Clears the value of defaultRunStepLimit field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearDefaultRunStepLimit() { + return defaultRunStepLimit(Optional.empty()); + } + + /** + * Setter for state. + * + *

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

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

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

customMetadata: Optional. Custom metadata for the session. + */ + @JsonProperty("customMetadata") + public abstract Builder customMetadata(Map customMetadata); + + @ExcludeFromGeneratedCoverageReport + abstract Builder customMetadata(Optional> customMetadata); + + /** Clears the value of customMetadata field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearCustomMetadata() { + return customMetadata(Optional.empty()); + } + public abstract Session build(); } diff --git a/src/main/java/com/google/cloud/agentplatform/types/State.java b/src/main/java/com/google/cloud/agentplatform/types/State.java index 919f267..4b5d58a 100644 --- a/src/main/java/com/google/cloud/agentplatform/types/State.java +++ b/src/main/java/com/google/cloud/agentplatform/types/State.java @@ -23,19 +23,19 @@ import com.google.common.base.Ascii; import java.util.Objects; -/** Output only. The state of the revision. */ +/** Output only. The state of the session. */ public class State { /** Enum representing the known values for State. */ public enum Known { - /** The unspecified state. */ + /** State unspecified. */ STATE_UNSPECIFIED, - /** Is deployed and ready to be used. */ - ACTIVE, + /** The session is idle. */ + SESSION_IDLE, - /** Is deprecated, may not be used, only preserved for historical purposes. */ - DEPRECATED + /** The session is in progress. */ + SESSION_IN_PROGRESS } private Known stateEnum; diff --git a/src/main/java/com/google/cloud/agentplatform/types/ToolCallStats.java b/src/main/java/com/google/cloud/agentplatform/types/ToolCallStats.java new file mode 100644 index 0000000..c1b6ad3 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/ToolCallStats.java @@ -0,0 +1,129 @@ +/* + * 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; + +/** */ +@AutoValue +@JsonDeserialize(builder = ToolCallStats.Builder.class) +public abstract class ToolCallStats extends JsonSerializable { + /** + * Output only. Note: Assuming `ToolType` mapping or just standardizing on strings depending on + * Vertex's `Tool` definitions. + */ + @JsonProperty("functionName") + public abstract Optional functionName(); + + /** toolCallCount */ + @JsonProperty("toolCallCount") + public abstract Optional toolCallCount(); + + /** serverExecuted */ + @JsonProperty("serverExecuted") + public abstract Optional serverExecuted(); + + /** Instantiates a builder for ToolCallStats. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_ToolCallStats.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for ToolCallStats. */ + @AutoValue.Builder + public abstract static class Builder { + /** For internal usage. Please use `ToolCallStats.builder()` for instantiation. */ + @JsonCreator + private static Builder create() { + return new AutoValue_ToolCallStats.Builder(); + } + + /** + * Setter for functionName. + * + *

functionName: Output only. Note: Assuming `ToolType` mapping or just standardizing on + * strings depending on Vertex's `Tool` definitions. + */ + @JsonProperty("functionName") + public abstract Builder functionName(String functionName); + + @ExcludeFromGeneratedCoverageReport + abstract Builder functionName(Optional functionName); + + /** Clears the value of functionName field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearFunctionName() { + return functionName(Optional.empty()); + } + + /** + * Setter for toolCallCount. + * + *

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

serverExecuted: serverExecuted + */ + @JsonProperty("serverExecuted") + public abstract Builder serverExecuted(boolean serverExecuted); + + @ExcludeFromGeneratedCoverageReport + abstract Builder serverExecuted(Optional serverExecuted); + + /** Clears the value of serverExecuted field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearServerExecuted() { + return serverExecuted(Optional.empty()); + } + + public abstract ToolCallStats build(); + } + + /** Deserializes a JSON string to a ToolCallStats object. */ + @ExcludeFromGeneratedCoverageReport + public static ToolCallStats fromJson(String jsonString) { + return JsonSerializable.fromJsonString(jsonString, ToolCallStats.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/TrafficType.java b/src/main/java/com/google/cloud/agentplatform/types/TrafficType.java new file mode 100644 index 0000000..2e20e8c --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/TrafficType.java @@ -0,0 +1,117 @@ +/* + * 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; + +/** Output only. The traffic type for this request. */ +public class TrafficType { + + /** Enum representing the known values for TrafficType. */ + public enum Known { + /** Unspecified request traffic type. */ + TRAFFIC_TYPE_UNSPECIFIED, + + /** Type for Pay-As-You-Go traffic. */ + ON_DEMAND, + + /** Type for Priority Pay-As-You-Go traffic. */ + ON_DEMAND_PRIORITY, + + /** Type for Flex traffic. */ + ON_DEMAND_FLEX, + + /** Type for Provisioned Throughput traffic. */ + PROVISIONED_THROUGHPUT + } + + private Known trafficTypeEnum; + private final String value; + + @JsonCreator + public TrafficType(String value) { + this.value = value; + for (Known trafficTypeEnum : Known.values()) { + if (Ascii.equalsIgnoreCase(trafficTypeEnum.toString(), value)) { + this.trafficTypeEnum = trafficTypeEnum; + break; + } + } + if (this.trafficTypeEnum == null) { + this.trafficTypeEnum = Known.TRAFFIC_TYPE_UNSPECIFIED; + } + } + + public TrafficType(Known knownValue) { + this.trafficTypeEnum = 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 TrafficType)) { + return false; + } + + TrafficType other = (TrafficType) o; + + if (this.trafficTypeEnum != Known.TRAFFIC_TYPE_UNSPECIFIED + && other.trafficTypeEnum != Known.TRAFFIC_TYPE_UNSPECIFIED) { + return this.trafficTypeEnum == other.trafficTypeEnum; + } else if (this.trafficTypeEnum == Known.TRAFFIC_TYPE_UNSPECIFIED + && other.trafficTypeEnum == Known.TRAFFIC_TYPE_UNSPECIFIED) { + return this.value.equals(other.value); + } + return false; + } + + @ExcludeFromGeneratedCoverageReport + @Override + public int hashCode() { + if (this.trafficTypeEnum != Known.TRAFFIC_TYPE_UNSPECIFIED) { + return this.trafficTypeEnum.hashCode(); + } else { + return Objects.hashCode(this.value); + } + } + + @ExcludeFromGeneratedCoverageReport + public Known knownEnum() { + return this.trafficTypeEnum; + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/UsageMetadata.java b/src/main/java/com/google/cloud/agentplatform/types/UsageMetadata.java new file mode 100644 index 0000000..5c03aff --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/UsageMetadata.java @@ -0,0 +1,581 @@ +/* + * 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; + +/** + * Usage metadata about the content generation request and response. This message provides a + * detailed breakdown of token usage and other relevant metrics. + */ +@AutoValue +@JsonDeserialize(builder = UsageMetadata.Builder.class) +public abstract class UsageMetadata extends JsonSerializable { + /** + * The total number of tokens in the prompt. This includes any text, images, or other media + * provided in the request. When `cached_content` is set, this also includes the number of tokens + * in the cached content. + */ + @JsonProperty("promptTokenCount") + public abstract Optional promptTokenCount(); + + /** The total number of tokens in the generated candidates. */ + @JsonProperty("candidatesTokenCount") + public abstract Optional candidatesTokenCount(); + + /** + * The total number of tokens for the entire request. This is the sum of `prompt_token_count`, + * `candidates_token_count`, `tool_use_prompt_token_count`, and `thoughts_token_count`. + */ + @JsonProperty("totalTokenCount") + public abstract Optional totalTokenCount(); + + /** + * Output only. The number of tokens in the results from tool executions, which are provided back + * to the model as input, if applicable. + */ + @JsonProperty("toolUsePromptTokenCount") + public abstract Optional toolUsePromptTokenCount(); + + /** + * Output only. The number of tokens that were part of the model's generated "thoughts" output, if + * applicable. + */ + @JsonProperty("thoughtsTokenCount") + public abstract Optional thoughtsTokenCount(); + + /** Output only. The number of tokens in the cached content that was used for this request. */ + @JsonProperty("cachedContentTokenCount") + public abstract Optional cachedContentTokenCount(); + + /** Output only. A detailed breakdown of the token count for each modality in the prompt. */ + @JsonProperty("promptTokensDetails") + public abstract Optional> promptTokensDetails(); + + /** + * Output only. A detailed breakdown of the token count for each modality in the cached content. + */ + @JsonProperty("cacheTokensDetails") + public abstract Optional> cacheTokensDetails(); + + /** + * Output only. A detailed breakdown of the token count for each modality in the generated + * candidates. + */ + @JsonProperty("candidatesTokensDetails") + public abstract Optional> candidatesTokensDetails(); + + /** + * Output only. A detailed breakdown by modality of the token counts from the results of tool + * executions, which are provided back to the model as input. + */ + @JsonProperty("toolUsePromptTokensDetails") + public abstract Optional> toolUsePromptTokensDetails(); + + /** Output only. The traffic type for this request. */ + @JsonProperty("trafficType") + public abstract Optional trafficType(); + + /** Output only. [Deprecated] Billable usage for the prompt. */ + @JsonProperty("billablePromptUsage") + public abstract Optional billablePromptUsage(); + + /** Output only. [Deprecated] Billable usage for the cached content. */ + @JsonProperty("billableCachedContentUsage") + public abstract Optional billableCachedContentUsage(); + + /** Output only. Statistics about function calls in this generation request. */ + @JsonProperty("toolCallStats") + public abstract Optional> toolCallStats(); + + /** Instantiates a builder for UsageMetadata. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_UsageMetadata.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for UsageMetadata. */ + @AutoValue.Builder + public abstract static class Builder { + /** For internal usage. Please use `UsageMetadata.builder()` for instantiation. */ + @JsonCreator + private static Builder create() { + return new AutoValue_UsageMetadata.Builder(); + } + + /** + * Setter for promptTokenCount. + * + *

promptTokenCount: The total number of tokens in the prompt. This includes any text, + * images, or other media provided in the request. When `cached_content` is set, this also + * includes the number of tokens in the cached content. + */ + @JsonProperty("promptTokenCount") + public abstract Builder promptTokenCount(Integer promptTokenCount); + + @ExcludeFromGeneratedCoverageReport + abstract Builder promptTokenCount(Optional promptTokenCount); + + /** Clears the value of promptTokenCount field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearPromptTokenCount() { + return promptTokenCount(Optional.empty()); + } + + /** + * Setter for candidatesTokenCount. + * + *

candidatesTokenCount: The total number of tokens in the generated candidates. + */ + @JsonProperty("candidatesTokenCount") + public abstract Builder candidatesTokenCount(Integer candidatesTokenCount); + + @ExcludeFromGeneratedCoverageReport + abstract Builder candidatesTokenCount(Optional candidatesTokenCount); + + /** Clears the value of candidatesTokenCount field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearCandidatesTokenCount() { + return candidatesTokenCount(Optional.empty()); + } + + /** + * Setter for totalTokenCount. + * + *

totalTokenCount: The total number of tokens for the entire request. This is the sum of + * `prompt_token_count`, `candidates_token_count`, `tool_use_prompt_token_count`, and + * `thoughts_token_count`. + */ + @JsonProperty("totalTokenCount") + public abstract Builder totalTokenCount(Integer totalTokenCount); + + @ExcludeFromGeneratedCoverageReport + abstract Builder totalTokenCount(Optional totalTokenCount); + + /** Clears the value of totalTokenCount field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearTotalTokenCount() { + return totalTokenCount(Optional.empty()); + } + + /** + * Setter for toolUsePromptTokenCount. + * + *

toolUsePromptTokenCount: Output only. The number of tokens in the results from tool + * executions, which are provided back to the model as input, if applicable. + */ + @JsonProperty("toolUsePromptTokenCount") + public abstract Builder toolUsePromptTokenCount(Integer toolUsePromptTokenCount); + + @ExcludeFromGeneratedCoverageReport + abstract Builder toolUsePromptTokenCount(Optional toolUsePromptTokenCount); + + /** Clears the value of toolUsePromptTokenCount field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearToolUsePromptTokenCount() { + return toolUsePromptTokenCount(Optional.empty()); + } + + /** + * Setter for thoughtsTokenCount. + * + *

thoughtsTokenCount: Output only. The number of tokens that were part of the model's + * generated "thoughts" output, if applicable. + */ + @JsonProperty("thoughtsTokenCount") + public abstract Builder thoughtsTokenCount(Integer thoughtsTokenCount); + + @ExcludeFromGeneratedCoverageReport + abstract Builder thoughtsTokenCount(Optional thoughtsTokenCount); + + /** Clears the value of thoughtsTokenCount field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearThoughtsTokenCount() { + return thoughtsTokenCount(Optional.empty()); + } + + /** + * Setter for cachedContentTokenCount. + * + *

cachedContentTokenCount: Output only. The number of tokens in the cached content that was + * used for this request. + */ + @JsonProperty("cachedContentTokenCount") + public abstract Builder cachedContentTokenCount(Integer cachedContentTokenCount); + + @ExcludeFromGeneratedCoverageReport + abstract Builder cachedContentTokenCount(Optional cachedContentTokenCount); + + /** Clears the value of cachedContentTokenCount field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearCachedContentTokenCount() { + return cachedContentTokenCount(Optional.empty()); + } + + /** + * Setter for promptTokensDetails. + * + *

promptTokensDetails: Output only. A detailed breakdown of the token count for each + * modality in the prompt. + */ + @JsonProperty("promptTokensDetails") + public abstract Builder promptTokensDetails(List promptTokensDetails); + + /** + * Setter for promptTokensDetails. + * + *

promptTokensDetails: Output only. A detailed breakdown of the token count for each + * modality in the prompt. + */ + @CanIgnoreReturnValue + public Builder promptTokensDetails(ModalityTokenCount... promptTokensDetails) { + return promptTokensDetails(Arrays.asList(promptTokensDetails)); + } + + /** + * Setter for promptTokensDetails builder. + * + *

promptTokensDetails: Output only. A detailed breakdown of the token count for each + * modality in the prompt. + */ + @CanIgnoreReturnValue + public Builder promptTokensDetails(ModalityTokenCount.Builder... promptTokensDetailsBuilders) { + return promptTokensDetails( + Arrays.asList(promptTokensDetailsBuilders).stream() + .map(ModalityTokenCount.Builder::build) + .collect(toImmutableList())); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder promptTokensDetails(Optional> promptTokensDetails); + + /** Clears the value of promptTokensDetails field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearPromptTokensDetails() { + return promptTokensDetails(Optional.empty()); + } + + /** + * Setter for cacheTokensDetails. + * + *

cacheTokensDetails: Output only. A detailed breakdown of the token count for each modality + * in the cached content. + */ + @JsonProperty("cacheTokensDetails") + public abstract Builder cacheTokensDetails(List cacheTokensDetails); + + /** + * Setter for cacheTokensDetails. + * + *

cacheTokensDetails: Output only. A detailed breakdown of the token count for each modality + * in the cached content. + */ + @CanIgnoreReturnValue + public Builder cacheTokensDetails(ModalityTokenCount... cacheTokensDetails) { + return cacheTokensDetails(Arrays.asList(cacheTokensDetails)); + } + + /** + * Setter for cacheTokensDetails builder. + * + *

cacheTokensDetails: Output only. A detailed breakdown of the token count for each modality + * in the cached content. + */ + @CanIgnoreReturnValue + public Builder cacheTokensDetails(ModalityTokenCount.Builder... cacheTokensDetailsBuilders) { + return cacheTokensDetails( + Arrays.asList(cacheTokensDetailsBuilders).stream() + .map(ModalityTokenCount.Builder::build) + .collect(toImmutableList())); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder cacheTokensDetails(Optional> cacheTokensDetails); + + /** Clears the value of cacheTokensDetails field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearCacheTokensDetails() { + return cacheTokensDetails(Optional.empty()); + } + + /** + * Setter for candidatesTokensDetails. + * + *

candidatesTokensDetails: Output only. A detailed breakdown of the token count for each + * modality in the generated candidates. + */ + @JsonProperty("candidatesTokensDetails") + public abstract Builder candidatesTokensDetails( + List candidatesTokensDetails); + + /** + * Setter for candidatesTokensDetails. + * + *

candidatesTokensDetails: Output only. A detailed breakdown of the token count for each + * modality in the generated candidates. + */ + @CanIgnoreReturnValue + public Builder candidatesTokensDetails(ModalityTokenCount... candidatesTokensDetails) { + return candidatesTokensDetails(Arrays.asList(candidatesTokensDetails)); + } + + /** + * Setter for candidatesTokensDetails builder. + * + *

candidatesTokensDetails: Output only. A detailed breakdown of the token count for each + * modality in the generated candidates. + */ + @CanIgnoreReturnValue + public Builder candidatesTokensDetails( + ModalityTokenCount.Builder... candidatesTokensDetailsBuilders) { + return candidatesTokensDetails( + Arrays.asList(candidatesTokensDetailsBuilders).stream() + .map(ModalityTokenCount.Builder::build) + .collect(toImmutableList())); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder candidatesTokensDetails( + Optional> candidatesTokensDetails); + + /** Clears the value of candidatesTokensDetails field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearCandidatesTokensDetails() { + return candidatesTokensDetails(Optional.empty()); + } + + /** + * Setter for toolUsePromptTokensDetails. + * + *

toolUsePromptTokensDetails: Output only. A detailed breakdown by modality of the token + * counts from the results of tool executions, which are provided back to the model as input. + */ + @JsonProperty("toolUsePromptTokensDetails") + public abstract Builder toolUsePromptTokensDetails( + List toolUsePromptTokensDetails); + + /** + * Setter for toolUsePromptTokensDetails. + * + *

toolUsePromptTokensDetails: Output only. A detailed breakdown by modality of the token + * counts from the results of tool executions, which are provided back to the model as input. + */ + @CanIgnoreReturnValue + public Builder toolUsePromptTokensDetails(ModalityTokenCount... toolUsePromptTokensDetails) { + return toolUsePromptTokensDetails(Arrays.asList(toolUsePromptTokensDetails)); + } + + /** + * Setter for toolUsePromptTokensDetails builder. + * + *

toolUsePromptTokensDetails: Output only. A detailed breakdown by modality of the token + * counts from the results of tool executions, which are provided back to the model as input. + */ + @CanIgnoreReturnValue + public Builder toolUsePromptTokensDetails( + ModalityTokenCount.Builder... toolUsePromptTokensDetailsBuilders) { + return toolUsePromptTokensDetails( + Arrays.asList(toolUsePromptTokensDetailsBuilders).stream() + .map(ModalityTokenCount.Builder::build) + .collect(toImmutableList())); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder toolUsePromptTokensDetails( + Optional> toolUsePromptTokensDetails); + + /** Clears the value of toolUsePromptTokensDetails field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearToolUsePromptTokensDetails() { + return toolUsePromptTokensDetails(Optional.empty()); + } + + /** + * Setter for trafficType. + * + *

trafficType: Output only. The traffic type for this request. + */ + @JsonProperty("trafficType") + public abstract Builder trafficType(TrafficType trafficType); + + @ExcludeFromGeneratedCoverageReport + abstract Builder trafficType(Optional trafficType); + + /** Clears the value of trafficType field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearTrafficType() { + return trafficType(Optional.empty()); + } + + /** + * Setter for trafficType given a known enum. + * + *

trafficType: Output only. The traffic type for this request. + */ + @CanIgnoreReturnValue + public Builder trafficType(TrafficType.Known knownType) { + return trafficType(new TrafficType(knownType)); + } + + /** + * Setter for trafficType given a string. + * + *

trafficType: Output only. The traffic type for this request. + */ + @CanIgnoreReturnValue + public Builder trafficType(String trafficType) { + return trafficType(new TrafficType(trafficType)); + } + + /** + * Setter for billablePromptUsage. + * + *

billablePromptUsage: Output only. [Deprecated] Billable usage for the prompt. + */ + @JsonProperty("billablePromptUsage") + public abstract Builder billablePromptUsage(UsageMetadataBillablleUsage billablePromptUsage); + + /** + * Setter for billablePromptUsage builder. + * + *

billablePromptUsage: Output only. [Deprecated] Billable usage for the prompt. + */ + @CanIgnoreReturnValue + public Builder billablePromptUsage( + UsageMetadataBillablleUsage.Builder billablePromptUsageBuilder) { + return billablePromptUsage(billablePromptUsageBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder billablePromptUsage(Optional billablePromptUsage); + + /** Clears the value of billablePromptUsage field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearBillablePromptUsage() { + return billablePromptUsage(Optional.empty()); + } + + /** + * Setter for billableCachedContentUsage. + * + *

billableCachedContentUsage: Output only. [Deprecated] Billable usage for the cached + * content. + */ + @JsonProperty("billableCachedContentUsage") + public abstract Builder billableCachedContentUsage( + UsageMetadataBillablleUsage billableCachedContentUsage); + + /** + * Setter for billableCachedContentUsage builder. + * + *

billableCachedContentUsage: Output only. [Deprecated] Billable usage for the cached + * content. + */ + @CanIgnoreReturnValue + public Builder billableCachedContentUsage( + UsageMetadataBillablleUsage.Builder billableCachedContentUsageBuilder) { + return billableCachedContentUsage(billableCachedContentUsageBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder billableCachedContentUsage( + Optional billableCachedContentUsage); + + /** Clears the value of billableCachedContentUsage field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearBillableCachedContentUsage() { + return billableCachedContentUsage(Optional.empty()); + } + + /** + * Setter for toolCallStats. + * + *

toolCallStats: Output only. Statistics about function calls in this generation request. + */ + @JsonProperty("toolCallStats") + public abstract Builder toolCallStats(List toolCallStats); + + /** + * Setter for toolCallStats. + * + *

toolCallStats: Output only. Statistics about function calls in this generation request. + */ + @CanIgnoreReturnValue + public Builder toolCallStats(ToolCallStats... toolCallStats) { + return toolCallStats(Arrays.asList(toolCallStats)); + } + + /** + * Setter for toolCallStats builder. + * + *

toolCallStats: Output only. Statistics about function calls in this generation request. + */ + @CanIgnoreReturnValue + public Builder toolCallStats(ToolCallStats.Builder... toolCallStatsBuilders) { + return toolCallStats( + Arrays.asList(toolCallStatsBuilders).stream() + .map(ToolCallStats.Builder::build) + .collect(toImmutableList())); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder toolCallStats(Optional> toolCallStats); + + /** Clears the value of toolCallStats field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearToolCallStats() { + return toolCallStats(Optional.empty()); + } + + public abstract UsageMetadata build(); + } + + /** Deserializes a JSON string to a UsageMetadata object. */ + @ExcludeFromGeneratedCoverageReport + public static UsageMetadata fromJson(String jsonString) { + return JsonSerializable.fromJsonString(jsonString, UsageMetadata.class); + } +} diff --git a/src/main/java/com/google/cloud/agentplatform/types/UsageMetadataBillablleUsage.java b/src/main/java/com/google/cloud/agentplatform/types/UsageMetadataBillablleUsage.java new file mode 100644 index 0000000..84ebf78 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/UsageMetadataBillablleUsage.java @@ -0,0 +1,147 @@ +/* + * 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; + +/** [Deprecated] Billable usage information. */ +@AutoValue +@JsonDeserialize(builder = UsageMetadataBillablleUsage.Builder.class) +public abstract class UsageMetadataBillablleUsage extends JsonSerializable { + /** The number of text characters. */ + @JsonProperty("textCount") + public abstract Optional textCount(); + + /** The number of images. */ + @JsonProperty("imageCount") + public abstract Optional imageCount(); + + /** The duration of video in seconds. */ + @JsonProperty("videoDurationSeconds") + public abstract Optional videoDurationSeconds(); + + /** The duration of audio in seconds. */ + @JsonProperty("audioDurationSeconds") + public abstract Optional audioDurationSeconds(); + + /** Instantiates a builder for UsageMetadataBillablleUsage. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_UsageMetadataBillablleUsage.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for UsageMetadataBillablleUsage. */ + @AutoValue.Builder + public abstract static class Builder { + /** For internal usage. Please use `UsageMetadataBillablleUsage.builder()` for instantiation. */ + @JsonCreator + private static Builder create() { + return new AutoValue_UsageMetadataBillablleUsage.Builder(); + } + + /** + * Setter for textCount. + * + *

textCount: The number of text characters. + */ + @JsonProperty("textCount") + public abstract Builder textCount(Integer textCount); + + @ExcludeFromGeneratedCoverageReport + abstract Builder textCount(Optional textCount); + + /** Clears the value of textCount field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearTextCount() { + return textCount(Optional.empty()); + } + + /** + * Setter for imageCount. + * + *

imageCount: The number of images. + */ + @JsonProperty("imageCount") + public abstract Builder imageCount(Integer imageCount); + + @ExcludeFromGeneratedCoverageReport + abstract Builder imageCount(Optional imageCount); + + /** Clears the value of imageCount field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearImageCount() { + return imageCount(Optional.empty()); + } + + /** + * Setter for videoDurationSeconds. + * + *

videoDurationSeconds: The duration of video in seconds. + */ + @JsonProperty("videoDurationSeconds") + public abstract Builder videoDurationSeconds(Integer videoDurationSeconds); + + @ExcludeFromGeneratedCoverageReport + abstract Builder videoDurationSeconds(Optional videoDurationSeconds); + + /** Clears the value of videoDurationSeconds field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearVideoDurationSeconds() { + return videoDurationSeconds(Optional.empty()); + } + + /** + * Setter for audioDurationSeconds. + * + *

audioDurationSeconds: The duration of audio in seconds. + */ + @JsonProperty("audioDurationSeconds") + public abstract Builder audioDurationSeconds(Integer audioDurationSeconds); + + @ExcludeFromGeneratedCoverageReport + abstract Builder audioDurationSeconds(Optional audioDurationSeconds); + + /** Clears the value of audioDurationSeconds field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearAudioDurationSeconds() { + return audioDurationSeconds(Optional.empty()); + } + + public abstract UsageMetadataBillablleUsage build(); + } + + /** Deserializes a JSON string to a UsageMetadataBillablleUsage object. */ + @ExcludeFromGeneratedCoverageReport + public static UsageMetadataBillablleUsage fromJson(String jsonString) { + return JsonSerializable.fromJsonString(jsonString, UsageMetadataBillablleUsage.class); + } +}