From e85a1273338e35ee707c0ac9e15db4532746a238 Mon Sep 17 00:00:00 2001 From: Google Team Member Date: Sun, 27 Sep 2026 09:34:44 -0700 Subject: [PATCH] feat: update discovery doc PiperOrigin-RevId: 989217122 --- .../types/SandboxEnvironmentTemplate.java | 46 +++++++ ...vironmentTemplatePersistentDiskConfig.java | 127 ++++++++++++++++++ 2 files changed, 173 insertions(+) create mode 100644 src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplatePersistentDiskConfig.java diff --git a/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplate.java b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplate.java index ed98a13..7c3247f 100644 --- a/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplate.java +++ b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplate.java @@ -87,6 +87,15 @@ public abstract class SandboxEnvironmentTemplate extends JsonSerializable { @JsonProperty("useGkeTd") public abstract Optional useGkeTd(); + /** + * Optional. Configuration for attaching a persistent disk (PD) to each SandboxEnvironment created + * from this template. When unset (or when `enabled` is `false`), sandboxes created from this + * template are not backed by a persistent disk and rely on ephemeral storage only. See + * PersistentDiskConfig for details. + */ + @JsonProperty("persistentDiskConfig") + public abstract Optional persistentDiskConfig(); + /** Instantiates a builder for SandboxEnvironmentTemplate. */ @ExcludeFromGeneratedCoverageReport public static Builder builder() { @@ -378,6 +387,43 @@ public Builder clearUseGkeTd() { return useGkeTd(Optional.empty()); } + /** + * Setter for persistentDiskConfig. + * + *

persistentDiskConfig: Optional. Configuration for attaching a persistent disk (PD) to each + * SandboxEnvironment created from this template. When unset (or when `enabled` is `false`), + * sandboxes created from this template are not backed by a persistent disk and rely on + * ephemeral storage only. See PersistentDiskConfig for details. + */ + @JsonProperty("persistentDiskConfig") + public abstract Builder persistentDiskConfig( + SandboxEnvironmentTemplatePersistentDiskConfig persistentDiskConfig); + + /** + * Setter for persistentDiskConfig builder. + * + *

persistentDiskConfig: Optional. Configuration for attaching a persistent disk (PD) to each + * SandboxEnvironment created from this template. When unset (or when `enabled` is `false`), + * sandboxes created from this template are not backed by a persistent disk and rely on + * ephemeral storage only. See PersistentDiskConfig for details. + */ + @CanIgnoreReturnValue + public Builder persistentDiskConfig( + SandboxEnvironmentTemplatePersistentDiskConfig.Builder persistentDiskConfigBuilder) { + return persistentDiskConfig(persistentDiskConfigBuilder.build()); + } + + @ExcludeFromGeneratedCoverageReport + abstract Builder persistentDiskConfig( + Optional persistentDiskConfig); + + /** Clears the value of persistentDiskConfig field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearPersistentDiskConfig() { + return persistentDiskConfig(Optional.empty()); + } + public abstract SandboxEnvironmentTemplate build(); } diff --git a/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplatePersistentDiskConfig.java b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplatePersistentDiskConfig.java new file mode 100644 index 0000000..9ab0123 --- /dev/null +++ b/src/main/java/com/google/cloud/agentplatform/types/SandboxEnvironmentTemplatePersistentDiskConfig.java @@ -0,0 +1,127 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Auto-generated code. Do not edit. + +package com.google.cloud.agentplatform.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.auto.value.AutoValue; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.JsonSerializable; +import java.util.Optional; + +/** + * Configuration for attaching a persistent disk (PD) to each SandboxEnvironment created from this + * template. A persistent disk provides durable, per-sandbox block storage whose contents survive + * across the sandbox lifecycle events that this service supports (e.g. pause/resume), unlike + * ephemeral local storage which is lost when the underlying runtime is torn down. + */ +@AutoValue +@JsonDeserialize(builder = SandboxEnvironmentTemplatePersistentDiskConfig.Builder.class) +public abstract class SandboxEnvironmentTemplatePersistentDiskConfig extends JsonSerializable { + /** + * Optional. Whether a persistent disk is attached to sandboxes created from this template. + * Defaults to `false`. This flag lets a template carry (and preserve) disk configuration while + * keeping the disk detached, so it can be toggled on later without re-specifying the rest of the + * config. When `false`, the remaining fields in this message are ignored. + */ + @JsonProperty("enabled") + public abstract Optional enabled(); + + /** + * Optional. The size of the persistent disk in GB. Must be non-negative. When `enabled` is + * `true`, a positive value is required; when unset or zero while enabled, the service applies a + * default size. Ignored when `enabled` is `false`. + */ + @JsonProperty("sizeGb") + public abstract Optional sizeGb(); + + /** Instantiates a builder for SandboxEnvironmentTemplatePersistentDiskConfig. */ + @ExcludeFromGeneratedCoverageReport + public static Builder builder() { + return new AutoValue_SandboxEnvironmentTemplatePersistentDiskConfig.Builder(); + } + + /** Creates a builder with the same values as this instance. */ + public abstract Builder toBuilder(); + + /** Builder for SandboxEnvironmentTemplatePersistentDiskConfig. */ + @AutoValue.Builder + public abstract static class Builder { + /** + * For internal usage. Please use `SandboxEnvironmentTemplatePersistentDiskConfig.builder()` for + * instantiation. + */ + @JsonCreator + private static Builder create() { + return new AutoValue_SandboxEnvironmentTemplatePersistentDiskConfig.Builder(); + } + + /** + * Setter for enabled. + * + *

enabled: Optional. Whether a persistent disk is attached to sandboxes created from this + * template. Defaults to `false`. This flag lets a template carry (and preserve) disk + * configuration while keeping the disk detached, so it can be toggled on later without + * re-specifying the rest of the config. When `false`, the remaining fields in this message are + * ignored. + */ + @JsonProperty("enabled") + public abstract Builder enabled(boolean enabled); + + @ExcludeFromGeneratedCoverageReport + abstract Builder enabled(Optional enabled); + + /** Clears the value of enabled field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearEnabled() { + return enabled(Optional.empty()); + } + + /** + * Setter for sizeGb. + * + *

sizeGb: Optional. The size of the persistent disk in GB. Must be non-negative. When + * `enabled` is `true`, a positive value is required; when unset or zero while enabled, the + * service applies a default size. Ignored when `enabled` is `false`. + */ + @JsonProperty("sizeGb") + public abstract Builder sizeGb(Long sizeGb); + + @ExcludeFromGeneratedCoverageReport + abstract Builder sizeGb(Optional sizeGb); + + /** Clears the value of sizeGb field. */ + @ExcludeFromGeneratedCoverageReport + @CanIgnoreReturnValue + public Builder clearSizeGb() { + return sizeGb(Optional.empty()); + } + + public abstract SandboxEnvironmentTemplatePersistentDiskConfig build(); + } + + /** Deserializes a JSON string to a SandboxEnvironmentTemplatePersistentDiskConfig object. */ + @ExcludeFromGeneratedCoverageReport + public static SandboxEnvironmentTemplatePersistentDiskConfig fromJson(String jsonString) { + return JsonSerializable.fromJsonString( + jsonString, SandboxEnvironmentTemplatePersistentDiskConfig.class); + } +}