Class v1.RuleSetServiceClient (1.7.0)

Service to manage customer specific RuleSets. v1

Package

@google-cloud/contentwarehouse

Constructors

(constructor)(opts, gaxInstance)

constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);

Construct an instance of RuleSetServiceClient.

Parameters
Name Description
opts ClientOptions
gaxInstance typeof gax | typeof fallback

: loaded instance of google-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new RuleSetServiceClient({fallback: true}, gax); ```

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.

ruleSetServiceStub

ruleSetServiceStub?: Promise<{
        [name: string]: Function;
    }>;

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.

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.

createRuleSet(request, options)

createRuleSet(request?: protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest, options?: CallOptions): Promise<[
        protos.google.cloud.contentwarehouse.v1.IRuleSet,
        protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest | undefined,
        {} | undefined
    ]>;

Creates a ruleset.

Parameters
Name Description
request ICreateRuleSetRequest

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.IRuleSet, protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing RuleSet. Please see the documentation for more details and examples.

Example

  /**
   * 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 rule set to create.
   */
  // const ruleSet = {}

  // Imports the Contentwarehouse library
  const {RuleSetServiceClient} = require('@google-cloud/contentwarehouse').v1;

  // Instantiates a client
  const contentwarehouseClient = new RuleSetServiceClient();

  async function callCreateRuleSet() {
    // Construct request
    const request = {
      parent,
      ruleSet,
    };

    // Run request
    const response = await contentwarehouseClient.createRuleSet(request);
    console.log(response);
  }

  callCreateRuleSet();

createRuleSet(request, options, callback)

createRuleSet(request: protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest, options: CallOptions, callback: Callback<protos.google.cloud.contentwarehouse.v1.IRuleSet, protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateRuleSetRequest
options CallOptions
callback Callback<protos.google.cloud.contentwarehouse.v1.IRuleSet, protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createRuleSet(request, callback)

createRuleSet(request: protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest, callback: Callback<protos.google.cloud.contentwarehouse.v1.IRuleSet, protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateRuleSetRequest
callback Callback<protos.google.cloud.contentwarehouse.v1.IRuleSet, protos.google.cloud.contentwarehouse.v1.ICreateRuleSetRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteRuleSet(request, options)

deleteRuleSet(request?: protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest | undefined,
        {} | undefined
    ]>;

Deletes a ruleset. Returns NOT_FOUND if the document does not exist.

Parameters
Name Description
request IDeleteRuleSetRequest

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.IDeleteRuleSetRequest | 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.

Example

  /**
   * 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 rule set to delete.
   *  Format:
   *  projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
   */
  // const name = 'abc123'

  // Imports the Contentwarehouse library
  const {RuleSetServiceClient} = require('@google-cloud/contentwarehouse').v1;

  // Instantiates a client
  const contentwarehouseClient = new RuleSetServiceClient();

  async function callDeleteRuleSet() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await contentwarehouseClient.deleteRuleSet(request);
    console.log(response);
  }

  callDeleteRuleSet();

deleteRuleSet(request, options, callback)

deleteRuleSet(request: protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteRuleSetRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteRuleSet(request, callback)

deleteRuleSet(request: protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteRuleSetRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.contentwarehouse.v1.IDeleteRuleSetRequest | 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

getRuleSet(request, options)

getRuleSet(request?: protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest, options?: CallOptions): Promise<[
        protos.google.cloud.contentwarehouse.v1.IRuleSet,
        protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest | undefined,
        {} | undefined
    ]>;

Gets a ruleset. Returns NOT_FOUND if the ruleset does not exist.

Parameters
Name Description
request IGetRuleSetRequest

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.IRuleSet, protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing RuleSet. Please see the documentation for more details and examples.

Example

  /**
   * 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 rule set to retrieve.
   *  Format:
   *  projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
   */
  // const name = 'abc123'

  // Imports the Contentwarehouse library
  const {RuleSetServiceClient} = require('@google-cloud/contentwarehouse').v1;

  // Instantiates a client
  const contentwarehouseClient = new RuleSetServiceClient();

  async function callGetRuleSet() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await contentwarehouseClient.getRuleSet(request);
    console.log(response);
  }

  callGetRuleSet();

getRuleSet(request, options, callback)

getRuleSet(request: protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest, options: CallOptions, callback: Callback<protos.google.cloud.contentwarehouse.v1.IRuleSet, protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetRuleSetRequest
options CallOptions
callback Callback<protos.google.cloud.contentwarehouse.v1.IRuleSet, protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getRuleSet(request, callback)

getRuleSet(request: protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest, callback: Callback<protos.google.cloud.contentwarehouse.v1.IRuleSet, protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetRuleSetRequest
callback Callback<protos.google.cloud.contentwarehouse.v1.IRuleSet, protos.google.cloud.contentwarehouse.v1.IGetRuleSetRequest | 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.

listRuleSets(request, options)

listRuleSets(request?: protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.contentwarehouse.v1.IRuleSet[],
        protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest | null,
        protos.google.cloud.contentwarehouse.v1.IListRuleSetsResponse
    ]>;

Lists rulesets.

Parameters
Name Description
request IListRuleSetsRequest

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.IRuleSet[], protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest | null, protos.google.cloud.contentwarehouse.v1.IListRuleSetsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of RuleSet. 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 listRuleSetsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listRuleSets(request, options, callback)

listRuleSets(request: protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, protos.google.cloud.contentwarehouse.v1.IListRuleSetsResponse | null | undefined, protos.google.cloud.contentwarehouse.v1.IRuleSet>): void;
Parameters
Name Description
request IListRuleSetsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, protos.google.cloud.contentwarehouse.v1.IListRuleSetsResponse | null | undefined, protos.google.cloud.contentwarehouse.v1.IRuleSet>
Returns
Type Description
void

listRuleSets(request, callback)

listRuleSets(request: protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, callback: PaginationCallback<protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, protos.google.cloud.contentwarehouse.v1.IListRuleSetsResponse | null | undefined, protos.google.cloud.contentwarehouse.v1.IRuleSet>): void;
Parameters
Name Description
request IListRuleSetsRequest
callback PaginationCallback<protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, protos.google.cloud.contentwarehouse.v1.IListRuleSetsResponse | null | undefined, protos.google.cloud.contentwarehouse.v1.IRuleSet>
Returns
Type Description
void

listRuleSetsAsync(request, options)

listRuleSetsAsync(request?: protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.contentwarehouse.v1.IRuleSet>;

Equivalent to listRuleSets, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
Name Description
request IListRuleSetsRequest

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.IRuleSet>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing RuleSet. 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.

Example

  /**
   * 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, which owns this collection of document.
   *  Format: projects/{project_number}/locations/{location}.
   */
  // const parent = 'abc123'
  /**
   *  The maximum number of rule sets 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 `ListRuleSets` call.
   *  Provide this to retrieve the subsequent page.
   *  When paginating, all other parameters provided to `ListRuleSets`
   *  must match the call that provided the page token.
   */
  // const pageToken = 'abc123'

  // Imports the Contentwarehouse library
  const {RuleSetServiceClient} = require('@google-cloud/contentwarehouse').v1;

  // Instantiates a client
  const contentwarehouseClient = new RuleSetServiceClient();

  async function callListRuleSets() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = contentwarehouseClient.listRuleSetsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListRuleSets();

listRuleSetsStream(request, options)

listRuleSetsStream(request?: protos.google.cloud.contentwarehouse.v1.IListRuleSetsRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
Name Description
request IListRuleSetsRequest

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 RuleSet 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 listRuleSetsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

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.

updateRuleSet(request, options)

updateRuleSet(request?: protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest, options?: CallOptions): Promise<[
        protos.google.cloud.contentwarehouse.v1.IRuleSet,
        protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest | undefined,
        {} | undefined
    ]>;

Updates a ruleset. Returns INVALID_ARGUMENT if the name of the ruleset is non-empty and does not equal the existing name.

Parameters
Name Description
request IUpdateRuleSetRequest

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.IRuleSet, protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing RuleSet. Please see the documentation for more details and examples.

Example

  /**
   * 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 rule set to update.
   *  Format:
   *  projects/{project_number}/locations/{location}/ruleSets/{rule_set_id}.
   */
  // const name = 'abc123'
  /**
   *  Required. The rule set to update.
   */
  // const ruleSet = {}

  // Imports the Contentwarehouse library
  const {RuleSetServiceClient} = require('@google-cloud/contentwarehouse').v1;

  // Instantiates a client
  const contentwarehouseClient = new RuleSetServiceClient();

  async function callUpdateRuleSet() {
    // Construct request
    const request = {
      name,
      ruleSet,
    };

    // Run request
    const response = await contentwarehouseClient.updateRuleSet(request);
    console.log(response);
  }

  callUpdateRuleSet();

updateRuleSet(request, options, callback)

updateRuleSet(request: protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest, options: CallOptions, callback: Callback<protos.google.cloud.contentwarehouse.v1.IRuleSet, protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateRuleSetRequest
options CallOptions
callback Callback<protos.google.cloud.contentwarehouse.v1.IRuleSet, protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateRuleSet(request, callback)

updateRuleSet(request: protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest, callback: Callback<protos.google.cloud.contentwarehouse.v1.IRuleSet, protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateRuleSetRequest
callback Callback<protos.google.cloud.contentwarehouse.v1.IRuleSet, protos.google.cloud.contentwarehouse.v1.IUpdateRuleSetRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void