Provides methods for managing permissions to PaLM API resources. v1beta
Package
@google-ai/generativelanguageConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of PermissionServiceClient.
Parameters | |
---|---|
Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof fallback
: loaded instance of |
Properties
apiEndpoint
get apiEndpoint(): string;
The DNS address for this API service.
apiEndpoint
static get apiEndpoint(): string;
The DNS address for this API service - same as servicePath.
auth
auth: gax.GoogleAuth;
descriptors
descriptors: Descriptors;
innerApiCalls
innerApiCalls: {
[name: string]: Function;
};
pathTemplates
pathTemplates: {
[name: string]: gax.PathTemplate;
};
permissionServiceStub
permissionServiceStub?: Promise<{
[name: string]: Function;
}>;
port
static get port(): number;
The port for this API service.
scopes
static get scopes(): never[];
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
static get servicePath(): string;
The DNS address for this API service.
universeDomain
get universeDomain(): string;
warn
warn: (code: string, message: string, warnType?: string) => void;
Methods
cachedContentPath(id)
cachedContentPath(id: string): string;
Return a fully-qualified cachedContent resource name string.
Parameter | |
---|---|
Name | Description |
id |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
chunkPath(corpus, document, chunk)
chunkPath(corpus: string, document: string, chunk: string): string;
Return a fully-qualified chunk resource name string.
Parameters | |
---|---|
Name | Description |
corpus |
string
|
document |
string
|
chunk |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
close()
close(): Promise<void>;
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Returns | |
---|---|
Type | Description |
Promise<void> |
{Promise} A promise that resolves when the client is closed. |
corpusPath(corpus)
corpusPath(corpus: string): string;
Return a fully-qualified corpus resource name string.
Parameter | |
---|---|
Name | Description |
corpus |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
corpusPermissionPath(corpus, permission)
corpusPermissionPath(corpus: string, permission: string): string;
Return a fully-qualified corpusPermission resource name string.
Parameters | |
---|---|
Name | Description |
corpus |
string
|
permission |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
createPermission(request, options)
createPermission(request?: protos.google.ai.generativelanguage.v1beta.ICreatePermissionRequest, options?: CallOptions): Promise<[
protos.google.ai.generativelanguage.v1beta.IPermission,
(protos.google.ai.generativelanguage.v1beta.ICreatePermissionRequest | undefined),
{} | undefined
]>;
Create a permission to a specific resource.
Parameters | |
---|---|
Name | Description |
request |
ICreatePermissionRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.ai.generativelanguage.v1beta.IPermission,
(protos.google.ai.generativelanguage.v1beta.ICreatePermissionRequest | undefined),
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent resource of the `Permission`.
* Formats:
* `tunedModels/{tuned_model}`
* `corpora/{corpus}`
*/
// const parent = 'abc123'
/**
* Required. The permission to create.
*/
// const permission = {}
// Imports the Generativelanguage library
const {PermissionServiceClient} = require('@google-ai/generativelanguage').v1beta;
// Instantiates a client
const generativelanguageClient = new PermissionServiceClient();
async function callCreatePermission() {
// Construct request
const request = {
parent,
permission,
};
// Run request
const response = await generativelanguageClient.createPermission(request);
console.log(response);
}
callCreatePermission();
createPermission(request, options, callback)
createPermission(request: protos.google.ai.generativelanguage.v1beta.ICreatePermissionRequest, options: CallOptions, callback: Callback<protos.google.ai.generativelanguage.v1beta.IPermission, protos.google.ai.generativelanguage.v1beta.ICreatePermissionRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ICreatePermissionRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.ai.generativelanguage.v1beta.IPermission, protos.google.ai.generativelanguage.v1beta.ICreatePermissionRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
createPermission(request, callback)
createPermission(request: protos.google.ai.generativelanguage.v1beta.ICreatePermissionRequest, callback: Callback<protos.google.ai.generativelanguage.v1beta.IPermission, protos.google.ai.generativelanguage.v1beta.ICreatePermissionRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ICreatePermissionRequest
|
callback |
Callback<protos.google.ai.generativelanguage.v1beta.IPermission, protos.google.ai.generativelanguage.v1beta.ICreatePermissionRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deletePermission(request, options)
deletePermission(request?: protos.google.ai.generativelanguage.v1beta.IDeletePermissionRequest, options?: CallOptions): Promise<[
protos.google.protobuf.IEmpty,
(protos.google.ai.generativelanguage.v1beta.IDeletePermissionRequest | undefined),
{} | undefined
]>;
Deletes the permission.
Parameters | |
---|---|
Name | Description |
request |
IDeletePermissionRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.protobuf.IEmpty,
(protos.google.ai.generativelanguage.v1beta.IDeletePermissionRequest | undefined),
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource name of the permission.
* Formats:
* `tunedModels/{tuned_model}/permissions/{permission}`
* `corpora/{corpus}/permissions/{permission}`
*/
// const name = 'abc123'
// Imports the Generativelanguage library
const {PermissionServiceClient} = require('@google-ai/generativelanguage').v1beta;
// Instantiates a client
const generativelanguageClient = new PermissionServiceClient();
async function callDeletePermission() {
// Construct request
const request = {
name,
};
// Run request
const response = await generativelanguageClient.deletePermission(request);
console.log(response);
}
callDeletePermission();
deletePermission(request, options, callback)
deletePermission(request: protos.google.ai.generativelanguage.v1beta.IDeletePermissionRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.ai.generativelanguage.v1beta.IDeletePermissionRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IDeletePermissionRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.ai.generativelanguage.v1beta.IDeletePermissionRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deletePermission(request, callback)
deletePermission(request: protos.google.ai.generativelanguage.v1beta.IDeletePermissionRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.ai.generativelanguage.v1beta.IDeletePermissionRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IDeletePermissionRequest
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.ai.generativelanguage.v1beta.IDeletePermissionRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
documentPath(corpus, document)
documentPath(corpus: string, document: string): string;
Return a fully-qualified document resource name string.
Parameters | |
---|---|
Name | Description |
corpus |
string
|
document |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
filePath(file)
filePath(file: string): string;
Return a fully-qualified file resource name string.
Parameter | |
---|---|
Name | Description |
file |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
getPermission(request, options)
getPermission(request?: protos.google.ai.generativelanguage.v1beta.IGetPermissionRequest, options?: CallOptions): Promise<[
protos.google.ai.generativelanguage.v1beta.IPermission,
(protos.google.ai.generativelanguage.v1beta.IGetPermissionRequest | undefined),
{} | undefined
]>;
Gets information about a specific Permission.
Parameters | |
---|---|
Name | Description |
request |
IGetPermissionRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.ai.generativelanguage.v1beta.IPermission,
(protos.google.ai.generativelanguage.v1beta.IGetPermissionRequest | undefined),
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource name of the permission.
* Formats:
* `tunedModels/{tuned_model}/permissions/{permission}`
* `corpora/{corpus}/permissions/{permission}`
*/
// const name = 'abc123'
// Imports the Generativelanguage library
const {PermissionServiceClient} = require('@google-ai/generativelanguage').v1beta;
// Instantiates a client
const generativelanguageClient = new PermissionServiceClient();
async function callGetPermission() {
// Construct request
const request = {
name,
};
// Run request
const response = await generativelanguageClient.getPermission(request);
console.log(response);
}
callGetPermission();
getPermission(request, options, callback)
getPermission(request: protos.google.ai.generativelanguage.v1beta.IGetPermissionRequest, options: CallOptions, callback: Callback<protos.google.ai.generativelanguage.v1beta.IPermission, protos.google.ai.generativelanguage.v1beta.IGetPermissionRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetPermissionRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.ai.generativelanguage.v1beta.IPermission, protos.google.ai.generativelanguage.v1beta.IGetPermissionRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getPermission(request, callback)
getPermission(request: protos.google.ai.generativelanguage.v1beta.IGetPermissionRequest, callback: Callback<protos.google.ai.generativelanguage.v1beta.IPermission, protos.google.ai.generativelanguage.v1beta.IGetPermissionRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetPermissionRequest
|
callback |
Callback<protos.google.ai.generativelanguage.v1beta.IPermission, protos.google.ai.generativelanguage.v1beta.IGetPermissionRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getProjectId()
getProjectId(): Promise<string>;
Returns | |
---|---|
Type | Description |
Promise<string> |
getProjectId(callback)
getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter | |
---|---|
Name | Description |
callback |
Callback<string, undefined, undefined>
|
Returns | |
---|---|
Type | Description |
void |
initialize()
initialize(): Promise<{
[name: string]: Function;
}>;
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Returns | |
---|---|
Type | Description |
Promise<{
[name: string]: Function;
}> |
{Promise} A promise that resolves to an authenticated service stub. |
listPermissions(request, options)
listPermissions(request?: protos.google.ai.generativelanguage.v1beta.IListPermissionsRequest, options?: CallOptions): Promise<[
protos.google.ai.generativelanguage.v1beta.IPermission[],
protos.google.ai.generativelanguage.v1beta.IListPermissionsRequest | null,
protos.google.ai.generativelanguage.v1beta.IListPermissionsResponse
]>;
Lists permissions for the specific resource.
Parameters | |
---|---|
Name | Description |
request |
IListPermissionsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.ai.generativelanguage.v1beta.IPermission[],
protos.google.ai.generativelanguage.v1beta.IListPermissionsRequest | null,
protos.google.ai.generativelanguage.v1beta.IListPermissionsResponse
]> |
{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listPermissions(request, options, callback)
listPermissions(request: protos.google.ai.generativelanguage.v1beta.IListPermissionsRequest, options: CallOptions, callback: PaginationCallback<protos.google.ai.generativelanguage.v1beta.IListPermissionsRequest, protos.google.ai.generativelanguage.v1beta.IListPermissionsResponse | null | undefined, protos.google.ai.generativelanguage.v1beta.IPermission>): void;
Parameters | |
---|---|
Name | Description |
request |
IListPermissionsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.ai.generativelanguage.v1beta.IListPermissionsRequest, protos.google.ai.generativelanguage.v1beta.IListPermissionsResponse | null | undefined, protos.google.ai.generativelanguage.v1beta.IPermission>
|
Returns | |
---|---|
Type | Description |
void |
listPermissions(request, callback)
listPermissions(request: protos.google.ai.generativelanguage.v1beta.IListPermissionsRequest, callback: PaginationCallback<protos.google.ai.generativelanguage.v1beta.IListPermissionsRequest, protos.google.ai.generativelanguage.v1beta.IListPermissionsResponse | null | undefined, protos.google.ai.generativelanguage.v1beta.IPermission>): void;
Parameters | |
---|---|
Name | Description |
request |
IListPermissionsRequest
|
callback |
PaginationCallback<protos.google.ai.generativelanguage.v1beta.IListPermissionsRequest, protos.google.ai.generativelanguage.v1beta.IListPermissionsResponse | null | undefined, protos.google.ai.generativelanguage.v1beta.IPermission>
|
Returns | |
---|---|
Type | Description |
void |
listPermissionsAsync(request, options)
listPermissionsAsync(request?: protos.google.ai.generativelanguage.v1beta.IListPermissionsRequest, options?: CallOptions): AsyncIterable<protos.google.ai.generativelanguage.v1beta.IPermission>;
Equivalent to listPermissions
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
IListPermissionsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.ai.generativelanguage.v1beta.IPermission> |
{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent resource of the permissions.
* Formats:
* `tunedModels/{tuned_model}`
* `corpora/{corpus}`
*/
// const parent = 'abc123'
/**
* Optional. The maximum number of `Permission`s to return (per page).
* The service may return fewer permissions.
* If unspecified, at most 10 permissions will be returned.
* This method returns at most 1000 permissions per page, even if you pass
* larger page_size.
*/
// const pageSize = 1234
/**
* Optional. A page token, received from a previous `ListPermissions` call.
* Provide the `page_token` returned by one request as an argument to the
* next request to retrieve the next page.
* When paginating, all other parameters provided to `ListPermissions`
* must match the call that provided the page token.
*/
// const pageToken = 'abc123'
// Imports the Generativelanguage library
const {PermissionServiceClient} = require('@google-ai/generativelanguage').v1beta;
// Instantiates a client
const generativelanguageClient = new PermissionServiceClient();
async function callListPermissions() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = generativelanguageClient.listPermissionsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListPermissions();
listPermissionsStream(request, options)
listPermissionsStream(request?: protos.google.ai.generativelanguage.v1beta.IListPermissionsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
IListPermissionsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Transform |
{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
matchChunkFromChunkName(chunkName)
matchChunkFromChunkName(chunkName: string): string | number;
Parse the chunk from Chunk resource.
Parameter | |
---|---|
Name | Description |
chunkName |
string
A fully-qualified path representing Chunk resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the chunk. |
matchCorpusFromChunkName(chunkName)
matchCorpusFromChunkName(chunkName: string): string | number;
Parse the corpus from Chunk resource.
Parameter | |
---|---|
Name | Description |
chunkName |
string
A fully-qualified path representing Chunk resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the corpus. |
matchCorpusFromCorpusName(corpusName)
matchCorpusFromCorpusName(corpusName: string): string | number;
Parse the corpus from Corpus resource.
Parameter | |
---|---|
Name | Description |
corpusName |
string
A fully-qualified path representing Corpus resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the corpus. |
matchCorpusFromCorpusPermissionName(corpusPermissionName)
matchCorpusFromCorpusPermissionName(corpusPermissionName: string): string | number;
Parse the corpus from CorpusPermission resource.
Parameter | |
---|---|
Name | Description |
corpusPermissionName |
string
A fully-qualified path representing corpus_permission resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the corpus. |
matchCorpusFromDocumentName(documentName)
matchCorpusFromDocumentName(documentName: string): string | number;
Parse the corpus from Document resource.
Parameter | |
---|---|
Name | Description |
documentName |
string
A fully-qualified path representing Document resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the corpus. |
matchDocumentFromChunkName(chunkName)
matchDocumentFromChunkName(chunkName: string): string | number;
Parse the document from Chunk resource.
Parameter | |
---|---|
Name | Description |
chunkName |
string
A fully-qualified path representing Chunk resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the document. |
matchDocumentFromDocumentName(documentName)
matchDocumentFromDocumentName(documentName: string): string | number;
Parse the document from Document resource.
Parameter | |
---|---|
Name | Description |
documentName |
string
A fully-qualified path representing Document resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the document. |
matchFileFromFileName(fileName)
matchFileFromFileName(fileName: string): string | number;
Parse the file from File resource.
Parameter | |
---|---|
Name | Description |
fileName |
string
A fully-qualified path representing File resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the file. |
matchIdFromCachedContentName(cachedContentName)
matchIdFromCachedContentName(cachedContentName: string): string | number;
Parse the id from CachedContent resource.
Parameter | |
---|---|
Name | Description |
cachedContentName |
string
A fully-qualified path representing CachedContent resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the id. |
matchModelFromModelName(modelName)
matchModelFromModelName(modelName: string): string | number;
Parse the model from Model resource.
Parameter | |
---|---|
Name | Description |
modelName |
string
A fully-qualified path representing Model resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the model. |
matchPermissionFromCorpusPermissionName(corpusPermissionName)
matchPermissionFromCorpusPermissionName(corpusPermissionName: string): string | number;
Parse the permission from CorpusPermission resource.
Parameter | |
---|---|
Name | Description |
corpusPermissionName |
string
A fully-qualified path representing corpus_permission resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the permission. |
matchPermissionFromTunedModelPermissionName(tunedModelPermissionName)
matchPermissionFromTunedModelPermissionName(tunedModelPermissionName: string): string | number;
Parse the permission from TunedModelPermission resource.
Parameter | |
---|---|
Name | Description |
tunedModelPermissionName |
string
A fully-qualified path representing tuned_model_permission resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the permission. |
matchTunedModelFromTunedModelName(tunedModelName)
matchTunedModelFromTunedModelName(tunedModelName: string): string | number;
Parse the tuned_model from TunedModel resource.
Parameter | |
---|---|
Name | Description |
tunedModelName |
string
A fully-qualified path representing TunedModel resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the tuned_model. |
matchTunedModelFromTunedModelPermissionName(tunedModelPermissionName)
matchTunedModelFromTunedModelPermissionName(tunedModelPermissionName: string): string | number;
Parse the tuned_model from TunedModelPermission resource.
Parameter | |
---|---|
Name | Description |
tunedModelPermissionName |
string
A fully-qualified path representing tuned_model_permission resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the tuned_model. |
modelPath(model)
modelPath(model: string): string;
Return a fully-qualified model resource name string.
Parameter | |
---|---|
Name | Description |
model |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
transferOwnership(request, options)
transferOwnership(request?: protos.google.ai.generativelanguage.v1beta.ITransferOwnershipRequest, options?: CallOptions): Promise<[
protos.google.ai.generativelanguage.v1beta.ITransferOwnershipResponse,
(protos.google.ai.generativelanguage.v1beta.ITransferOwnershipRequest | undefined),
{} | undefined
]>;
Transfers ownership of the tuned model. This is the only way to change ownership of the tuned model. The current owner will be downgraded to writer role.
Parameters | |
---|---|
Name | Description |
request |
ITransferOwnershipRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.ai.generativelanguage.v1beta.ITransferOwnershipResponse,
(protos.google.ai.generativelanguage.v1beta.ITransferOwnershipRequest | undefined),
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing TransferOwnershipResponse. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource name of the tuned model to transfer ownership.
* Format: `tunedModels/my-model-id`
*/
// const name = 'abc123'
/**
* Required. The email address of the user to whom the tuned model is being
* transferred to.
*/
// const emailAddress = 'abc123'
// Imports the Generativelanguage library
const {PermissionServiceClient} = require('@google-ai/generativelanguage').v1beta;
// Instantiates a client
const generativelanguageClient = new PermissionServiceClient();
async function callTransferOwnership() {
// Construct request
const request = {
name,
emailAddress,
};
// Run request
const response = await generativelanguageClient.transferOwnership(request);
console.log(response);
}
callTransferOwnership();
transferOwnership(request, options, callback)
transferOwnership(request: protos.google.ai.generativelanguage.v1beta.ITransferOwnershipRequest, options: CallOptions, callback: Callback<protos.google.ai.generativelanguage.v1beta.ITransferOwnershipResponse, protos.google.ai.generativelanguage.v1beta.ITransferOwnershipRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ITransferOwnershipRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.ai.generativelanguage.v1beta.ITransferOwnershipResponse, protos.google.ai.generativelanguage.v1beta.ITransferOwnershipRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
transferOwnership(request, callback)
transferOwnership(request: protos.google.ai.generativelanguage.v1beta.ITransferOwnershipRequest, callback: Callback<protos.google.ai.generativelanguage.v1beta.ITransferOwnershipResponse, protos.google.ai.generativelanguage.v1beta.ITransferOwnershipRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ITransferOwnershipRequest
|
callback |
Callback<protos.google.ai.generativelanguage.v1beta.ITransferOwnershipResponse, protos.google.ai.generativelanguage.v1beta.ITransferOwnershipRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
tunedModelPath(tunedModel)
tunedModelPath(tunedModel: string): string;
Return a fully-qualified tunedModel resource name string.
Parameter | |
---|---|
Name | Description |
tunedModel |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
tunedModelPermissionPath(tunedModel, permission)
tunedModelPermissionPath(tunedModel: string, permission: string): string;
Return a fully-qualified tunedModelPermission resource name string.
Parameters | |
---|---|
Name | Description |
tunedModel |
string
|
permission |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
updatePermission(request, options)
updatePermission(request?: protos.google.ai.generativelanguage.v1beta.IUpdatePermissionRequest, options?: CallOptions): Promise<[
protos.google.ai.generativelanguage.v1beta.IPermission,
(protos.google.ai.generativelanguage.v1beta.IUpdatePermissionRequest | undefined),
{} | undefined
]>;
Updates the permission.
Parameters | |
---|---|
Name | Description |
request |
IUpdatePermissionRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.ai.generativelanguage.v1beta.IPermission,
(protos.google.ai.generativelanguage.v1beta.IUpdatePermissionRequest | undefined),
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The permission to update.
* The permission's `name` field is used to identify the permission to update.
*/
// const permission = {}
/**
* Required. The list of fields to update. Accepted ones:
* - role (`Permission.role` field)
*/
// const updateMask = {}
// Imports the Generativelanguage library
const {PermissionServiceClient} = require('@google-ai/generativelanguage').v1beta;
// Instantiates a client
const generativelanguageClient = new PermissionServiceClient();
async function callUpdatePermission() {
// Construct request
const request = {
permission,
updateMask,
};
// Run request
const response = await generativelanguageClient.updatePermission(request);
console.log(response);
}
callUpdatePermission();
updatePermission(request, options, callback)
updatePermission(request: protos.google.ai.generativelanguage.v1beta.IUpdatePermissionRequest, options: CallOptions, callback: Callback<protos.google.ai.generativelanguage.v1beta.IPermission, protos.google.ai.generativelanguage.v1beta.IUpdatePermissionRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdatePermissionRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.ai.generativelanguage.v1beta.IPermission, protos.google.ai.generativelanguage.v1beta.IUpdatePermissionRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updatePermission(request, callback)
updatePermission(request: protos.google.ai.generativelanguage.v1beta.IUpdatePermissionRequest, callback: Callback<protos.google.ai.generativelanguage.v1beta.IPermission, protos.google.ai.generativelanguage.v1beta.IUpdatePermissionRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdatePermissionRequest
|
callback |
Callback<protos.google.ai.generativelanguage.v1beta.IPermission, protos.google.ai.generativelanguage.v1beta.IUpdatePermissionRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |