Class protos.google.ai.generativelanguage.v1beta.CacheService (2.6.0)

Represents a CacheService

Inheritance

$protobuf.rpc.Service > protos.google.ai.generativelanguage.v1beta.CacheService

Package

@google-ai/generativelanguage

Constructors

(constructor)(rpcImpl, requestDelimited, responseDelimited)

constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);

Constructs a new CacheService service.

Parameters
Name Description
rpcImpl $protobuf.RPCImpl

RPC implementation

requestDelimited boolean

Whether requests are length-delimited

responseDelimited boolean

Whether responses are length-delimited

Methods

create(rpcImpl, requestDelimited, responseDelimited)

public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): CacheService;

Creates new CacheService service using the specified rpc implementation.

Parameters
Name Description
rpcImpl $protobuf.RPCImpl

RPC implementation

requestDelimited boolean

Whether requests are length-delimited

responseDelimited boolean

Whether responses are length-delimited

Returns
Type Description
CacheService

RPC service. Useful where requests and/or responses are streamed.

createCachedContent(request, callback)

public createCachedContent(request: google.ai.generativelanguage.v1beta.ICreateCachedContentRequest, callback: google.ai.generativelanguage.v1beta.CacheService.CreateCachedContentCallback): void;

Calls CreateCachedContent.

Parameters
Name Description
request ICreateCachedContentRequest

CreateCachedContentRequest message or plain object

callback CreateCachedContentCallback

Node-style callback called with the error, if any, and CachedContent

Returns
Type Description
void

createCachedContent(request)

public createCachedContent(request: google.ai.generativelanguage.v1beta.ICreateCachedContentRequest): Promise<google.ai.generativelanguage.v1beta.CachedContent>;

Calls CreateCachedContent.

Parameter
Name Description
request ICreateCachedContentRequest

CreateCachedContentRequest message or plain object

Returns
Type Description
Promise<google.ai.generativelanguage.v1beta.CachedContent>

Promise

deleteCachedContent(request, callback)

public deleteCachedContent(request: google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest, callback: google.ai.generativelanguage.v1beta.CacheService.DeleteCachedContentCallback): void;

Calls DeleteCachedContent.

Parameters
Name Description
request IDeleteCachedContentRequest

DeleteCachedContentRequest message or plain object

callback DeleteCachedContentCallback

Node-style callback called with the error, if any, and Empty

Returns
Type Description
void

deleteCachedContent(request)

public deleteCachedContent(request: google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest): Promise<google.protobuf.Empty>;

Calls DeleteCachedContent.

Parameter
Name Description
request IDeleteCachedContentRequest

DeleteCachedContentRequest message or plain object

Returns
Type Description
Promise<google.protobuf.Empty>

Promise

getCachedContent(request, callback)

public getCachedContent(request: google.ai.generativelanguage.v1beta.IGetCachedContentRequest, callback: google.ai.generativelanguage.v1beta.CacheService.GetCachedContentCallback): void;

Calls GetCachedContent.

Parameters
Name Description
request IGetCachedContentRequest

GetCachedContentRequest message or plain object

callback GetCachedContentCallback

Node-style callback called with the error, if any, and CachedContent

Returns
Type Description
void

getCachedContent(request)

public getCachedContent(request: google.ai.generativelanguage.v1beta.IGetCachedContentRequest): Promise<google.ai.generativelanguage.v1beta.CachedContent>;

Calls GetCachedContent.

Parameter
Name Description
request IGetCachedContentRequest

GetCachedContentRequest message or plain object

Returns
Type Description
Promise<google.ai.generativelanguage.v1beta.CachedContent>

Promise

listCachedContents(request, callback)

public listCachedContents(request: google.ai.generativelanguage.v1beta.IListCachedContentsRequest, callback: google.ai.generativelanguage.v1beta.CacheService.ListCachedContentsCallback): void;

Calls ListCachedContents.

Parameters
Name Description
request IListCachedContentsRequest

ListCachedContentsRequest message or plain object

callback ListCachedContentsCallback

Node-style callback called with the error, if any, and ListCachedContentsResponse

Returns
Type Description
void

listCachedContents(request)

public listCachedContents(request: google.ai.generativelanguage.v1beta.IListCachedContentsRequest): Promise<google.ai.generativelanguage.v1beta.ListCachedContentsResponse>;

Calls ListCachedContents.

Parameter
Name Description
request IListCachedContentsRequest

ListCachedContentsRequest message or plain object

Returns
Type Description
Promise<google.ai.generativelanguage.v1beta.ListCachedContentsResponse>

Promise

updateCachedContent(request, callback)

public updateCachedContent(request: google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest, callback: google.ai.generativelanguage.v1beta.CacheService.UpdateCachedContentCallback): void;

Calls UpdateCachedContent.

Parameters
Name Description
request IUpdateCachedContentRequest

UpdateCachedContentRequest message or plain object

callback UpdateCachedContentCallback

Node-style callback called with the error, if any, and CachedContent

Returns
Type Description
void

updateCachedContent(request)

public updateCachedContent(request: google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest): Promise<google.ai.generativelanguage.v1beta.CachedContent>;

Calls UpdateCachedContent.

Parameter
Name Description
request IUpdateCachedContentRequest

UpdateCachedContentRequest message or plain object

Returns
Type Description
Promise<google.ai.generativelanguage.v1beta.CachedContent>

Promise