# Interface CachedContentOrBuilder (1.48.0)

1.48.0 (latest) 1.47.0 1.45.0 1.43.0 1.42.0 1.40.0 1.38.0 1.36.0 1.35.0 1.34.0 1.33.0 1.32.0 1.30.0 1.28.0 1.27.0 1.24.0 1.23.0 1.22.0 1.20.1 1.19.0 1.18.0 1.17.0 1.16.0 1.15.0 1.14.0 1.13.0 1.12.0 1.11.0 1.9.0 1.8.0 1.7.0 1.6.0 1.5.0 1.4.0 1.3.0 1.2.0 1.1.0 1.0.0 0.8.0 0.6.0 0.5.0 0.4.0 0.3.0 0.2.0 0.1.0

    public interface CachedContentOrBuilder extends MessageOrBuilder

## Implements

[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)

## Methods

### getContents(int index)

    public abstract Content getContents(int index)

Optional. Input only. Immutable. The content to cache

`
repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-vertexai/latest/com.google.cloud.vertexai.api.Content` |   |

### getContentsCount()

    public abstract int getContentsCount()

Optional. Input only. Immutable. The content to cache

`
repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getContentsList()

    public abstract List<Content> getContentsList()

Optional. Input only. Immutable. The content to cache

`
repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-vertexai/latest/com.google.cloud.vertexai.api.Content>` |   |

### getContentsOrBuilder(int index)

    public abstract ContentOrBuilder getContentsOrBuilder(int index)

Optional. Input only. Immutable. The content to cache

`
repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-vertexai/latest/com.google.cloud.vertexai.api.ContentOrBuilder` |   |

### getContentsOrBuilderList()

    public abstract List<? extends ContentOrBuilder> getContentsOrBuilderList()

Optional. Input only. Immutable. The content to cache

`
repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<? extends com.google.cloud.vertexai.api.ContentOrBuilder>` |   |

### getCreateTime()

    public abstract Timestamp getCreateTime()

Output only. Creation time of the cache entry.

`.google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Timestamp.html` | The createTime. |

### getCreateTimeOrBuilder()

    public abstract TimestampOrBuilder getCreateTimeOrBuilder()

Output only. Creation time of the cache entry.

`.google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.TimestampOrBuilder.html` |   |

### getDisplayName()

    public abstract String getDisplayName()

Optional. Immutable. The user-generated meaningful display name of the
cached content.

`
string display_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The displayName. |

### getDisplayNameBytes()

    public abstract ByteString getDisplayNameBytes()

Optional. Immutable. The user-generated meaningful display name of the
cached content.

`
string display_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for displayName. |

### getEncryptionSpec()

    public abstract EncryptionSpec getEncryptionSpec()

Input only. Immutable. Customer-managed encryption key spec for a
`CachedContent`. If set, this `CachedContent` and all its sub-resources
will be secured by this key.

`
.google.cloud.vertexai.v1.EncryptionSpec encryption_spec = 13 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-vertexai/latest/com.google.cloud.vertexai.api.EncryptionSpec` | The encryptionSpec. |

### getEncryptionSpecOrBuilder()

    public abstract EncryptionSpecOrBuilder getEncryptionSpecOrBuilder()

Input only. Immutable. Customer-managed encryption key spec for a
`CachedContent`. If set, this `CachedContent` and all its sub-resources
will be secured by this key.

`
.google.cloud.vertexai.v1.EncryptionSpec encryption_spec = 13 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-vertexai/latest/com.google.cloud.vertexai.api.EncryptionSpecOrBuilder` |   |

### getExpirationCase()

    public abstract CachedContent.ExpirationCase getExpirationCase()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-vertexai/latest/com.google.cloud.vertexai.api.CachedContent.ExpirationCase` |   |

### getExpireTime()

    public abstract Timestamp getExpireTime()

Timestamp of when this resource is considered expired.
This is *always* provided on output, regardless of what was sent
on input.

`.google.protobuf.Timestamp expire_time = 9;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Timestamp.html` | The expireTime. |

### getExpireTimeOrBuilder()

    public abstract TimestampOrBuilder getExpireTimeOrBuilder()

Timestamp of when this resource is considered expired.
This is *always* provided on output, regardless of what was sent
on input.

`.google.protobuf.Timestamp expire_time = 9;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.TimestampOrBuilder.html` |   |

### getModel()

    public abstract String getModel()

Immutable. The name of the `Model` to use for cached content. Currently,
only the published Gemini base models are supported, in form of
projects/{PROJECT}/locations/{LOCATION}/publishers/google/models/{MODEL}

`string model = 2 [(.google.api.field_behavior) = IMMUTABLE];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The model. |

### getModelBytes()

    public abstract ByteString getModelBytes()

Immutable. The name of the `Model` to use for cached content. Currently,
only the published Gemini base models are supported, in form of
projects/{PROJECT}/locations/{LOCATION}/publishers/google/models/{MODEL}

`string model = 2 [(.google.api.field_behavior) = IMMUTABLE];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for model. |

### getName()

    public abstract String getName()

Immutable. Identifier. The server-generated resource name of the cached
content Format:
projects/{project}/locations/{location}/cachedContents/{cached_content}

`
string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = IMMUTABLE];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The name. |

### getNameBytes()

    public abstract ByteString getNameBytes()

Immutable. Identifier. The server-generated resource name of the cached
content Format:
projects/{project}/locations/{location}/cachedContents/{cached_content}

`
string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = IMMUTABLE];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for name. |

### getSystemInstruction()

    public abstract Content getSystemInstruction()

Optional. Input only. Immutable. Developer set system instruction.
Currently, text only

`
.google.cloud.vertexai.v1.Content system_instruction = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-vertexai/latest/com.google.cloud.vertexai.api.Content` | The systemInstruction. |

### getSystemInstructionOrBuilder()

    public abstract ContentOrBuilder getSystemInstructionOrBuilder()

Optional. Input only. Immutable. Developer set system instruction.
Currently, text only

`
.google.cloud.vertexai.v1.Content system_instruction = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-vertexai/latest/com.google.cloud.vertexai.api.ContentOrBuilder` |   |

### getToolConfig()

    public abstract ToolConfig getToolConfig()

Optional. Input only. Immutable. Tool config. This config is shared for all
tools

`
.google.cloud.vertexai.v1.ToolConfig tool_config = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-vertexai/latest/com.google.cloud.vertexai.api.ToolConfig` | The toolConfig. |

### getToolConfigOrBuilder()

    public abstract ToolConfigOrBuilder getToolConfigOrBuilder()

Optional. Input only. Immutable. Tool config. This config is shared for all
tools

`
.google.cloud.vertexai.v1.ToolConfig tool_config = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-vertexai/latest/com.google.cloud.vertexai.api.ToolConfigOrBuilder` |   |

### getTools(int index)

    public abstract Tool getTools(int index)

Optional. Input only. Immutable. A list of `Tools` the model may use to
generate the next response

`
repeated .google.cloud.vertexai.v1.Tool tools = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-vertexai/latest/com.google.cloud.vertexai.api.Tool` |   |

### getToolsCount()

    public abstract int getToolsCount()

Optional. Input only. Immutable. A list of `Tools` the model may use to
generate the next response

`
repeated .google.cloud.vertexai.v1.Tool tools = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getToolsList()

    public abstract List<Tool> getToolsList()

Optional. Input only. Immutable. A list of `Tools` the model may use to
generate the next response

`
repeated .google.cloud.vertexai.v1.Tool tools = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-vertexai/latest/com.google.cloud.vertexai.api.Tool>` |   |

### getToolsOrBuilder(int index)

    public abstract ToolOrBuilder getToolsOrBuilder(int index)

Optional. Input only. Immutable. A list of `Tools` the model may use to
generate the next response

`
repeated .google.cloud.vertexai.v1.Tool tools = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-vertexai/latest/com.google.cloud.vertexai.api.ToolOrBuilder` |   |

### getToolsOrBuilderList()

    public abstract List<? extends ToolOrBuilder> getToolsOrBuilderList()

Optional. Input only. Immutable. A list of `Tools` the model may use to
generate the next response

`
repeated .google.cloud.vertexai.v1.Tool tools = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<? extends com.google.cloud.vertexai.api.ToolOrBuilder>` |   |

### getTtl()

    public abstract Duration getTtl()

Input only. The TTL for this resource. The expiration time is computed:
now + TTL.

`.google.protobuf.Duration ttl = 10 [(.google.api.field_behavior) = INPUT_ONLY];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Duration.html` | The ttl. |

### getTtlOrBuilder()

    public abstract DurationOrBuilder getTtlOrBuilder()

Input only. The TTL for this resource. The expiration time is computed:
now + TTL.

`.google.protobuf.Duration ttl = 10 [(.google.api.field_behavior) = INPUT_ONLY];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.DurationOrBuilder.html` |   |

### getUpdateTime()

    public abstract Timestamp getUpdateTime()

Output only. When the cache entry was last updated in UTC time.

`.google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Timestamp.html` | The updateTime. |

### getUpdateTimeOrBuilder()

    public abstract TimestampOrBuilder getUpdateTimeOrBuilder()

Output only. When the cache entry was last updated in UTC time.

`.google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.TimestampOrBuilder.html` |   |

### getUsageMetadata()

    public abstract CachedContent.UsageMetadata getUsageMetadata()

Output only. Metadata on the usage of the cached content.

`
.google.cloud.vertexai.v1.CachedContent.UsageMetadata usage_metadata = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-vertexai/latest/com.google.cloud.vertexai.api.CachedContent.UsageMetadata` | The usageMetadata. |

### getUsageMetadataOrBuilder()

    public abstract CachedContent.UsageMetadataOrBuilder getUsageMetadataOrBuilder()

Output only. Metadata on the usage of the cached content.

`
.google.cloud.vertexai.v1.CachedContent.UsageMetadata usage_metadata = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-vertexai/latest/com.google.cloud.vertexai.api.CachedContent.UsageMetadataOrBuilder` |   |

### hasCreateTime()

    public abstract boolean hasCreateTime()

Output only. Creation time of the cache entry.

`.google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the createTime field is set. |

### hasEncryptionSpec()

    public abstract boolean hasEncryptionSpec()

Input only. Immutable. Customer-managed encryption key spec for a
`CachedContent`. If set, this `CachedContent` and all its sub-resources
will be secured by this key.

`
.google.cloud.vertexai.v1.EncryptionSpec encryption_spec = 13 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the encryptionSpec field is set. |

### hasExpireTime()

    public abstract boolean hasExpireTime()

Timestamp of when this resource is considered expired.
This is *always* provided on output, regardless of what was sent
on input.

`.google.protobuf.Timestamp expire_time = 9;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the expireTime field is set. |

### hasSystemInstruction()

    public abstract boolean hasSystemInstruction()

Optional. Input only. Immutable. Developer set system instruction.
Currently, text only

`
.google.cloud.vertexai.v1.Content system_instruction = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the systemInstruction field is set. |

### hasToolConfig()

    public abstract boolean hasToolConfig()

Optional. Input only. Immutable. Tool config. This config is shared for all
tools

`
.google.cloud.vertexai.v1.ToolConfig tool_config = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the toolConfig field is set. |

### hasTtl()

    public abstract boolean hasTtl()

Input only. The TTL for this resource. The expiration time is computed:
now + TTL.

`.google.protobuf.Duration ttl = 10 [(.google.api.field_behavior) = INPUT_ONLY];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the ttl field is set. |

### hasUpdateTime()

    public abstract boolean hasUpdateTime()

Output only. When the cache entry was last updated in UTC time.

`.google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the updateTime field is set. |

### hasUsageMetadata()

    public abstract boolean hasUsageMetadata()

Output only. Metadata on the usage of the cached content.

`
.google.cloud.vertexai.v1.CachedContent.UsageMetadata usage_metadata = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the usageMetadata field is set. |