A Service that manage/custom customer specified SynonymSets. v1
Package
@google-cloud/contentwarehouseConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of SynonymSetServiceClient.
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;
};
port
static get port(): number;
The port for this API service.
scopes
static get scopes(): string[];
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.
synonymSetServiceStub
synonymSetServiceStub?: Promise<{
[name: string]: Function;
}>;
universeDomain
get universeDomain(): string;
warn
warn: (code: string, message: string, warnType?: string) => void;
Methods
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. |
createSynonymSet(request, options)
createSynonymSet(request?: protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest, options?: CallOptions): Promise<[
protos.google.cloud.contentwarehouse.v1.ISynonymSet,
(protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest | undefined),
{} | undefined
]>;
Creates a SynonymSet for a single context. Throws an ALREADY_EXISTS exception if a synonymset already exists for the context.
Parameters | |
---|---|
Name | Description |
request |
ICreateSynonymSetRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.contentwarehouse.v1.ISynonymSet,
(protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest | 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 name.
* Format: projects/{project_number}/locations/{location}.
*/
// const parent = 'abc123'
/**
* Required. The synonymSet to be created for a context
*/
// const synonymSet = {}
// Imports the Contentwarehouse library
const {SynonymSetServiceClient} = require('@google-cloud/contentwarehouse').v1;
// Instantiates a client
const contentwarehouseClient = new SynonymSetServiceClient();
async function callCreateSynonymSet() {
// Construct request
const request = {
parent,
synonymSet,
};
// Run request
const response = await contentwarehouseClient.createSynonymSet(request);
console.log(response);
}
callCreateSynonymSet();
createSynonymSet(request, options, callback)
createSynonymSet(request: protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest, options: CallOptions, callback: Callback<protos.google.cloud.contentwarehouse.v1.ISynonymSet, protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ICreateSynonymSetRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.contentwarehouse.v1.ISynonymSet, protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
createSynonymSet(request, callback)
createSynonymSet(request: protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest, callback: Callback<protos.google.cloud.contentwarehouse.v1.ISynonymSet, protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ICreateSynonymSetRequest
|
callback |
Callback<protos.google.cloud.contentwarehouse.v1.ISynonymSet, protos.google.cloud.contentwarehouse.v1.ICreateSynonymSetRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deleteSynonymSet(request, options)
deleteSynonymSet(request?: protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest, options?: CallOptions): Promise<[
protos.google.protobuf.IEmpty,
(protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest | undefined),
{} | undefined
]>;
Deletes a SynonymSet for a given context. Throws a NOT_FOUND exception if the SynonymSet is not found.
Parameters | |
---|---|
Name | Description |
request |
IDeleteSynonymSetRequest
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.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest | 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 name of the synonymSet to delete
* Format:
* projects/{project_number}/locations/{location}/synonymSets/{context}.
*/
// const name = 'abc123'
// Imports the Contentwarehouse library
const {SynonymSetServiceClient} = require('@google-cloud/contentwarehouse').v1;
// Instantiates a client
const contentwarehouseClient = new SynonymSetServiceClient();
async function callDeleteSynonymSet() {
// Construct request
const request = {
name,
};
// Run request
const response = await contentwarehouseClient.deleteSynonymSet(request);
console.log(response);
}
callDeleteSynonymSet();
deleteSynonymSet(request, options, callback)
deleteSynonymSet(request: protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IDeleteSynonymSetRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deleteSynonymSet(request, callback)
deleteSynonymSet(request: protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IDeleteSynonymSetRequest
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.cloud.contentwarehouse.v1.IDeleteSynonymSetRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
documentLinkPath(project, location, document, documentLink)
documentLinkPath(project: string, location: string, document: string, documentLink: string): string;
Return a fully-qualified documentLink resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
document |
string
|
documentLink |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
documentSchemaPath(project, location, documentSchema)
documentSchemaPath(project: string, location: string, documentSchema: string): string;
Return a fully-qualified documentSchema resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
documentSchema |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
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 |
getSynonymSet(request, options)
getSynonymSet(request?: protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest, options?: CallOptions): Promise<[
protos.google.cloud.contentwarehouse.v1.ISynonymSet,
protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest | undefined,
{} | undefined
]>;
Gets a SynonymSet for a particular context. Throws a NOT_FOUND exception if the Synonymset does not exist
Parameters | |
---|---|
Name | Description |
request |
IGetSynonymSetRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.contentwarehouse.v1.ISynonymSet,
protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest | 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 name of the synonymSet to retrieve
* Format:
* projects/{project_number}/locations/{location}/synonymSets/{context}.
*/
// const name = 'abc123'
// Imports the Contentwarehouse library
const {SynonymSetServiceClient} = require('@google-cloud/contentwarehouse').v1;
// Instantiates a client
const contentwarehouseClient = new SynonymSetServiceClient();
async function callGetSynonymSet() {
// Construct request
const request = {
name,
};
// Run request
const response = await contentwarehouseClient.getSynonymSet(request);
console.log(response);
}
callGetSynonymSet();
getSynonymSet(request, options, callback)
getSynonymSet(request: protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest, options: CallOptions, callback: Callback<protos.google.cloud.contentwarehouse.v1.ISynonymSet, protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetSynonymSetRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.contentwarehouse.v1.ISynonymSet, protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getSynonymSet(request, callback)
getSynonymSet(request: protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest, callback: Callback<protos.google.cloud.contentwarehouse.v1.ISynonymSet, protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetSynonymSetRequest
|
callback |
Callback<protos.google.cloud.contentwarehouse.v1.ISynonymSet, protos.google.cloud.contentwarehouse.v1.IGetSynonymSetRequest | null | undefined, {} | null | 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. |
listSynonymSets(request, options)
listSynonymSets(request?: protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, options?: CallOptions): Promise<[
protos.google.cloud.contentwarehouse.v1.ISynonymSet[],
protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest | null,
protos.google.cloud.contentwarehouse.v1.IListSynonymSetsResponse
]>;
Returns all SynonymSets (for all contexts) for the specified location.
Parameters | |
---|---|
Name | Description |
request |
IListSynonymSetsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.contentwarehouse.v1.ISynonymSet[],
protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest | null,
protos.google.cloud.contentwarehouse.v1.IListSynonymSetsResponse
]> |
{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 |
listSynonymSets(request, options, callback)
listSynonymSets(request: protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, protos.google.cloud.contentwarehouse.v1.IListSynonymSetsResponse | null | undefined, protos.google.cloud.contentwarehouse.v1.ISynonymSet>): void;
Parameters | |
---|---|
Name | Description |
request |
IListSynonymSetsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, protos.google.cloud.contentwarehouse.v1.IListSynonymSetsResponse | null | undefined, protos.google.cloud.contentwarehouse.v1.ISynonymSet>
|
Returns | |
---|---|
Type | Description |
void |
listSynonymSets(request, callback)
listSynonymSets(request: protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, callback: PaginationCallback<protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, protos.google.cloud.contentwarehouse.v1.IListSynonymSetsResponse | null | undefined, protos.google.cloud.contentwarehouse.v1.ISynonymSet>): void;
Parameters | |
---|---|
Name | Description |
request |
IListSynonymSetsRequest
|
callback |
PaginationCallback<protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, protos.google.cloud.contentwarehouse.v1.IListSynonymSetsResponse | null | undefined, protos.google.cloud.contentwarehouse.v1.ISynonymSet>
|
Returns | |
---|---|
Type | Description |
void |
listSynonymSetsAsync(request, options)
listSynonymSetsAsync(request?: protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.contentwarehouse.v1.ISynonymSet>;
Equivalent to listSynonymSets
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
IListSynonymSetsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.cloud.contentwarehouse.v1.ISynonymSet> |
{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 name.
* Format: projects/{project_number}/locations/{location}.
*/
// const parent = 'abc123'
/**
* The maximum number of synonymSets to return. The service may return
* fewer than this value.
* If unspecified, at most 50 rule sets will be returned.
* The maximum value is 1000; values above 1000 will be coerced to 1000.
*/
// const pageSize = 1234
/**
* A page token, received from a previous `ListSynonymSets` call.
* Provide this to retrieve the subsequent page.
* When paginating, all other parameters provided to `ListSynonymSets`
* must match the call that provided the page token.
*/
// const pageToken = 'abc123'
// Imports the Contentwarehouse library
const {SynonymSetServiceClient} = require('@google-cloud/contentwarehouse').v1;
// Instantiates a client
const contentwarehouseClient = new SynonymSetServiceClient();
async function callListSynonymSets() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = contentwarehouseClient.listSynonymSetsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListSynonymSets();
listSynonymSetsStream(request, options)
listSynonymSetsStream(request?: protos.google.cloud.contentwarehouse.v1.IListSynonymSetsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
IListSynonymSetsRequest
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 |
matchContextFromSynonymSetName(synonymSetName)
matchContextFromSynonymSetName(synonymSetName: string): string | number;
Parse the context from SynonymSet resource.
Parameter | |
---|---|
Name | Description |
synonymSetName |
string
A fully-qualified path representing SynonymSet resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the context. |
matchDocumentFromDocumentLinkName(documentLinkName)
matchDocumentFromDocumentLinkName(documentLinkName: string): string | number;
Parse the document from DocumentLink resource.
Parameter | |
---|---|
Name | Description |
documentLinkName |
string
A fully-qualified path representing DocumentLink resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the document. |
matchDocumentFromProjectLocationDocumentName(projectLocationDocumentName)
matchDocumentFromProjectLocationDocumentName(projectLocationDocumentName: string): string | number;
Parse the document from ProjectLocationDocument resource.
Parameter | |
---|---|
Name | Description |
projectLocationDocumentName |
string
A fully-qualified path representing project_location_document resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the document. |
matchDocumentLinkFromDocumentLinkName(documentLinkName)
matchDocumentLinkFromDocumentLinkName(documentLinkName: string): string | number;
Parse the document_link from DocumentLink resource.
Parameter | |
---|---|
Name | Description |
documentLinkName |
string
A fully-qualified path representing DocumentLink resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the document_link. |
matchDocumentSchemaFromDocumentSchemaName(documentSchemaName)
matchDocumentSchemaFromDocumentSchemaName(documentSchemaName: string): string | number;
Parse the document_schema from DocumentSchema resource.
Parameter | |
---|---|
Name | Description |
documentSchemaName |
string
A fully-qualified path representing DocumentSchema resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the document_schema. |
matchLocationFromDocumentLinkName(documentLinkName)
matchLocationFromDocumentLinkName(documentLinkName: string): string | number;
Parse the location from DocumentLink resource.
Parameter | |
---|---|
Name | Description |
documentLinkName |
string
A fully-qualified path representing DocumentLink resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromDocumentSchemaName(documentSchemaName)
matchLocationFromDocumentSchemaName(documentSchemaName: string): string | number;
Parse the location from DocumentSchema resource.
Parameter | |
---|---|
Name | Description |
documentSchemaName |
string
A fully-qualified path representing DocumentSchema resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromProjectLocationDocumentName(projectLocationDocumentName)
matchLocationFromProjectLocationDocumentName(projectLocationDocumentName: string): string | number;
Parse the location from ProjectLocationDocument resource.
Parameter | |
---|---|
Name | Description |
projectLocationDocumentName |
string
A fully-qualified path representing project_location_document resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName)
matchLocationFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string): string | number;
Parse the location from ProjectLocationDocumentsReferenceId resource.
Parameter | |
---|---|
Name | Description |
projectLocationDocumentsReferenceIdName |
string
A fully-qualified path representing project_location_documents_reference_id resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromRuleSetName(ruleSetName)
matchLocationFromRuleSetName(ruleSetName: string): string | number;
Parse the location from RuleSet resource.
Parameter | |
---|---|
Name | Description |
ruleSetName |
string
A fully-qualified path representing RuleSet resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromSynonymSetName(synonymSetName)
matchLocationFromSynonymSetName(synonymSetName: string): string | number;
Parse the location from SynonymSet resource.
Parameter | |
---|---|
Name | Description |
synonymSetName |
string
A fully-qualified path representing SynonymSet resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the location. |
matchProjectFromDocumentLinkName(documentLinkName)
matchProjectFromDocumentLinkName(documentLinkName: string): string | number;
Parse the project from DocumentLink resource.
Parameter | |
---|---|
Name | Description |
documentLinkName |
string
A fully-qualified path representing DocumentLink resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromDocumentSchemaName(documentSchemaName)
matchProjectFromDocumentSchemaName(documentSchemaName: string): string | number;
Parse the project from DocumentSchema resource.
Parameter | |
---|---|
Name | Description |
documentSchemaName |
string
A fully-qualified path representing DocumentSchema resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromProjectLocationDocumentName(projectLocationDocumentName)
matchProjectFromProjectLocationDocumentName(projectLocationDocumentName: string): string | number;
Parse the project from ProjectLocationDocument resource.
Parameter | |
---|---|
Name | Description |
projectLocationDocumentName |
string
A fully-qualified path representing project_location_document resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName)
matchProjectFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string): string | number;
Parse the project from ProjectLocationDocumentsReferenceId resource.
Parameter | |
---|---|
Name | Description |
projectLocationDocumentsReferenceIdName |
string
A fully-qualified path representing project_location_documents_reference_id resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromRuleSetName(ruleSetName)
matchProjectFromRuleSetName(ruleSetName: string): string | number;
Parse the project from RuleSet resource.
Parameter | |
---|---|
Name | Description |
ruleSetName |
string
A fully-qualified path representing RuleSet resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromSynonymSetName(synonymSetName)
matchProjectFromSynonymSetName(synonymSetName: string): string | number;
Parse the project from SynonymSet resource.
Parameter | |
---|---|
Name | Description |
synonymSetName |
string
A fully-qualified path representing SynonymSet resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the project. |
matchReferenceIdFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName)
matchReferenceIdFromProjectLocationDocumentsReferenceIdName(projectLocationDocumentsReferenceIdName: string): string | number;
Parse the reference_id from ProjectLocationDocumentsReferenceId resource.
Parameter | |
---|---|
Name | Description |
projectLocationDocumentsReferenceIdName |
string
A fully-qualified path representing project_location_documents_reference_id resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the reference_id. |
matchRuleSetFromRuleSetName(ruleSetName)
matchRuleSetFromRuleSetName(ruleSetName: string): string | number;
Parse the rule_set from RuleSet resource.
Parameter | |
---|---|
Name | Description |
ruleSetName |
string
A fully-qualified path representing RuleSet resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the rule_set. |
projectLocationDocumentPath(project, location, document)
projectLocationDocumentPath(project: string, location: string, document: string): string;
Return a fully-qualified projectLocationDocument resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
document |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
projectLocationDocumentsReferenceIdPath(project, location, referenceId)
projectLocationDocumentsReferenceIdPath(project: string, location: string, referenceId: string): string;
Return a fully-qualified projectLocationDocumentsReferenceId resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
referenceId |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
ruleSetPath(project, location, ruleSet)
ruleSetPath(project: string, location: string, ruleSet: string): string;
Return a fully-qualified ruleSet resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
ruleSet |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
synonymSetPath(project, location, context)
synonymSetPath(project: string, location: string, context: string): string;
Return a fully-qualified synonymSet resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
context |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
updateSynonymSet(request, options)
updateSynonymSet(request?: protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest, options?: CallOptions): Promise<[
protos.google.cloud.contentwarehouse.v1.ISynonymSet,
(protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest | undefined),
{} | undefined
]>;
Remove the existing SynonymSet for the context and replaces it with a new one. Throws a NOT_FOUND exception if the SynonymSet is not found.
Parameters | |
---|---|
Name | Description |
request |
IUpdateSynonymSetRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.contentwarehouse.v1.ISynonymSet,
(protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest | 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 name of the synonymSet to update
* Format:
* projects/{project_number}/locations/{location}/synonymSets/{context}.
*/
// const name = 'abc123'
/**
* Required. The synonymSet to be updated for the customer
*/
// const synonymSet = {}
// Imports the Contentwarehouse library
const {SynonymSetServiceClient} = require('@google-cloud/contentwarehouse').v1;
// Instantiates a client
const contentwarehouseClient = new SynonymSetServiceClient();
async function callUpdateSynonymSet() {
// Construct request
const request = {
name,
synonymSet,
};
// Run request
const response = await contentwarehouseClient.updateSynonymSet(request);
console.log(response);
}
callUpdateSynonymSet();
updateSynonymSet(request, options, callback)
updateSynonymSet(request: protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest, options: CallOptions, callback: Callback<protos.google.cloud.contentwarehouse.v1.ISynonymSet, protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdateSynonymSetRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.contentwarehouse.v1.ISynonymSet, protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateSynonymSet(request, callback)
updateSynonymSet(request: protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest, callback: Callback<protos.google.cloud.contentwarehouse.v1.ISynonymSet, protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdateSynonymSetRequest
|
callback |
Callback<protos.google.cloud.contentwarehouse.v1.ISynonymSet, protos.google.cloud.contentwarehouse.v1.IUpdateSynonymSetRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |