Package com.google.genai
Class AsyncCaches
-
- All Implemented Interfaces:
public final class AsyncCachesAsync module of Caches
-
-
Constructor Summary
Constructors Constructor Description AsyncCaches(ApiClient apiClient)
-
Method Summary
Modifier and Type Method Description CompletableFuture<CachedContent>create(String model, CreateCachedContentConfig config)Asynchronously creates a cached content resource. CompletableFuture<CachedContent>get(String name, GetCachedContentConfig config)Asynchronously gets a cached content resource. CompletableFuture<DeleteCachedContentResponse>delete(String name, DeleteCachedContentConfig config)Asynchronously deletes a cached content resource. CompletableFuture<CachedContent>update(String name, UpdateCachedContentConfig config)Asynchronously updates a cached content resource. CompletableFuture<AsyncPager<CachedContent>>list(ListCachedContentsConfig config)Asynchronously makes an API request to list the available cached contents. -
-
Constructor Detail
-
AsyncCaches
AsyncCaches(ApiClient apiClient)
-
-
Method Detail
-
create
CompletableFuture<CachedContent> create(String model, CreateCachedContentConfig config)
Asynchronously 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
CompletableFuture<CachedContent> get(String name, GetCachedContentConfig config)
Asynchronously 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
CompletableFuture<DeleteCachedContentResponse> delete(String name, DeleteCachedContentConfig config)
Asynchronously 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
CompletableFuture<CachedContent> update(String name, UpdateCachedContentConfig config)
Asynchronously 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
CompletableFuture<AsyncPager<CachedContent>> list(ListCachedContentsConfig config)
Asynchronously makes an API request to list the available cached contents.
- Parameters:
config- A ListCachedContentsConfig for configuring the list request.- Returns:
A CompletableFuture that resolves to a AsyncPager. The AsyncPager has a `forEach` method that can be used to asynchronously process items in the page and automatically query the next page once the current page is exhausted.
-
-
-
-