Package com.google.genai
Class Caches
-
-
Method Summary
Modifier and Type Method Description CachedContentcreate(String model, CreateCachedContentConfig config)Creates a cached content resource. CachedContentget(String name, GetCachedContentConfig config)Gets a cached content resource. DeleteCachedContentResponsedelete(String name, DeleteCachedContentConfig config)Deletes a cached content resource. CachedContentupdate(String name, UpdateCachedContentConfig config)Updates a cached content resource. Pager<CachedContent>list(ListCachedContentsConfig config)Makes an API request to list the available cached contents. -
-
Constructor Detail
-
Caches
Caches(ApiClient apiClient)
-
-
Method Detail
-
create
CachedContent create(String model, CreateCachedContentConfig config)
Creates a cached content resource.
- Parameters:
model- The model to use.config- A CreateCachedContentConfig for configuring the create request.- Returns:
A CachedContent object that contains the info of the created resource.
-
get
CachedContent get(String name, GetCachedContentConfig config)
Gets a cached content resource.
- Parameters:
name- The name(resource id) of the cached content to get.config- A GetCachedContentConfig for configuring the get request.- Returns:
A CachedContent object that contains the info of the cached content.
-
delete
DeleteCachedContentResponse delete(String name, DeleteCachedContentConfig config)
Deletes a cached content resource.
- Parameters:
name- The name(resource id) of the cached content to delete.config- A DeleteCachedContentConfig for configuring the delete request.
-
update
CachedContent update(String name, UpdateCachedContentConfig config)
Updates a cached content resource.
- Parameters:
name- The name(resource id) of the cached content to update.config- A UpdateCachedContentConfig for configuring the update request.- Returns:
A CachedContent object that contains the info of the updated resource.
-
list
Pager<CachedContent> list(ListCachedContentsConfig config)
Makes an API request to list the available cached contents.
- Parameters:
config- A ListCachedContentsConfig for configuring the list request.- Returns:
A Pager object that contains the list of cached contents. The pager is an iterable and automatically queries the next page once the current page is exhausted.
-
-
-
-