Class CachedContent
A resource used in LLM queries for users to explicitly specify what to cache.
public record CachedContent : IEquatable<CachedContent>
- Inheritance
-
CachedContent
- Implements
- Inherited Members
Properties
CreateTime
Creation time of the cache entry.
[JsonPropertyName("createTime")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public DateTime? CreateTime { get; set; }
Property Value
DisplayName
The user-generated meaningful display name of the cached content.
[JsonPropertyName("displayName")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? DisplayName { get; set; }
Property Value
ExpireTime
Expiration time of the cached content.
[JsonPropertyName("expireTime")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public DateTime? ExpireTime { get; set; }
Property Value
Model
The name of the publisher model to use for cached content.
[JsonPropertyName("model")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Model { get; set; }
Property Value
Name
The server-generated resource name of the cached content.
[JsonPropertyName("name")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Name { get; set; }
Property Value
UpdateTime
When the cache entry was last updated in UTC time.
[JsonPropertyName("updateTime")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public DateTime? UpdateTime { get; set; }
Property Value
UsageMetadata
Metadata on the usage of the cached content.
[JsonPropertyName("usageMetadata")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public CachedContentUsageMetadata? UsageMetadata { get; set; }
Property Value
Methods
FromJson(string, JsonSerializerOptions?)
Deserializes a JSON string to a CachedContent object.
public static CachedContent? FromJson(string jsonString, JsonSerializerOptions? options = null)
Parameters
jsonStringstringThe JSON string to deserialize.
optionsJsonSerializerOptionsOptional JsonSerializerOptions.
Returns
- CachedContent
The deserialized CachedContent object, or null if deserialization fails.