createCachedContent method

Future<CachedContent> createCachedContent(
  1. CreateCachedContentRequest request
)

Creates cached content, this call will initialize the cached content in the data storage, and users need to pay for the cache data storage.

Throws a http.ClientException if there were problems communicating with the API service. Throws a StatusException if the API failed with a Status message. Throws a ServiceException for any other failure.

Implementation

Future<CachedContent> createCachedContent(
  CreateCachedContentRequest request,
) async {
  final url = Uri.https(_host, '/v1beta1/${request.parent}/cachedContents');
  final response = await _client.post(url, body: request.cachedContent);
  return CachedContent.fromJson(response);
}