Class v1beta1.RecaptchaEnterpriseServiceV1Beta1Client

Service to determine the likelihood an event is legitimate. v1beta1

Package

@google-cloud/recaptcha-enterprise

Constructors

(constructor)(opts)

constructor(opts?: ClientOptions);

Construct an instance of RecaptchaEnterpriseServiceV1Beta1Client.

Parameter
NameDescription
opts ClientOptions

Properties

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

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.

recaptchaEnterpriseServiceV1Beta1Stub

recaptchaEnterpriseServiceV1Beta1Stub?: 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.

warn

warn: (code: string, message: string, warnType?: string) => void;

Methods

annotateAssessment(request, options)

annotateAssessment(request?: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, options?: CallOptions): Promise<[protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, (protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest | undefined), {} | undefined]>;

Annotates a previously created Assessment to provide additional information on whether the event turned out to be authentic or fradulent.

Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, (protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest | undefined), {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [AnnotateAssessmentResponse]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the Assessment, in the format
   *  "projects/{project_number}/assessments/{assessment_id}".
   */
  // const name = 'abc123'
  /**
   *  Required. The annotation that will be assigned to the Event.
   */
  // const annotation = {}

  // Imports the Recaptchaenterprise library
  const {RecaptchaEnterpriseServiceV1Beta1Client} =
    require('@google-cloud/recaptcha-enterprise').v1beta1;

  // Instantiates a client
  const recaptchaenterpriseClient =
    new RecaptchaEnterpriseServiceV1Beta1Client();

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

    // Run request
    const response = await recaptchaenterpriseClient.annotateAssessment(
      request
    );
    console.log(response);
  }

  callAnnotateAssessment();

annotateAssessment(request, options, callback)

annotateAssessment(request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, options: CallOptions, callback: Callback<protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest
options CallOptions
callback Callback<protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

annotateAssessment(request, callback)

annotateAssessment(request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, callback: Callback<protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest
callback Callback<protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

assessmentPath(project, assessment)

assessmentPath(project: string, assessment: string): string;

Return a fully-qualified assessment resource name string.

Parameters
NameDescription
project string
assessment string
Returns
TypeDescription
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
TypeDescription
Promise<void>

{Promise} A promise that resolves when the client is closed.

createAssessment(request, options)

createAssessment(request?: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, options?: CallOptions): Promise<[protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, (protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest | undefined), {} | undefined]>;

Creates an Assessment of the likelihood an event is legitimate.

Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, (protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest | undefined), {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Assessment]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the project in which the assessment will be created,
   *  in the format "projects/{project_number}".
   */
  // const parent = 'abc123'
  /**
   *  Required. The assessment details.
   */
  // const assessment = {}

  // Imports the Recaptchaenterprise library
  const {RecaptchaEnterpriseServiceV1Beta1Client} =
    require('@google-cloud/recaptcha-enterprise').v1beta1;

  // Instantiates a client
  const recaptchaenterpriseClient =
    new RecaptchaEnterpriseServiceV1Beta1Client();

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

    // Run request
    const response = await recaptchaenterpriseClient.createAssessment(request);
    console.log(response);
  }

  callCreateAssessment();

createAssessment(request, options, callback)

createAssessment(request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, options: CallOptions, callback: Callback<protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest
options CallOptions
callback Callback<protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createAssessment(request, callback)

createAssessment(request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, callback: Callback<protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest
callback Callback<protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createKey(request, options)

createKey(request?: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, options?: CallOptions): Promise<[protos.google.cloud.recaptchaenterprise.v1beta1.IKey, (protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest | undefined), {} | undefined]>;

Creates a new reCAPTCHA Enterprise key.

Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.recaptchaenterprise.v1beta1.IKey, (protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest | undefined), {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Key]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the project in which the key will be created, in the
   *  format "projects/{project_number}".
   */
  // const parent = 'abc123'
  /**
   *  Required. Information to create a reCAPTCHA Enterprise key.
   */
  // const key = {}

  // Imports the Recaptchaenterprise library
  const {RecaptchaEnterpriseServiceV1Beta1Client} =
    require('@google-cloud/recaptcha-enterprise').v1beta1;

  // Instantiates a client
  const recaptchaenterpriseClient =
    new RecaptchaEnterpriseServiceV1Beta1Client();

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

    // Run request
    const response = await recaptchaenterpriseClient.createKey(request);
    console.log(response);
  }

  callCreateKey();

createKey(request, options, callback)

createKey(request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, options: CallOptions, callback: Callback<protos.google.cloud.recaptchaenterprise.v1beta1.IKey, protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest
options CallOptions
callback Callback<protos.google.cloud.recaptchaenterprise.v1beta1.IKey, protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createKey(request, callback)

createKey(request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, callback: Callback<protos.google.cloud.recaptchaenterprise.v1beta1.IKey, protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest
callback Callback<protos.google.cloud.recaptchaenterprise.v1beta1.IKey, protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteKey(request, options)

deleteKey(request?: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, options?: CallOptions): Promise<[protos.google.protobuf.IEmpty, (protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest | undefined), {} | undefined]>;

Deletes the specified key.

Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.protobuf.IEmpty, (protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest | 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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the key to be deleted, in the format
   *  "projects/{project_number}/keys/{key_id}".
   */
  // const name = 'abc123'

  // Imports the Recaptchaenterprise library
  const {RecaptchaEnterpriseServiceV1Beta1Client} =
    require('@google-cloud/recaptcha-enterprise').v1beta1;

  // Instantiates a client
  const recaptchaenterpriseClient =
    new RecaptchaEnterpriseServiceV1Beta1Client();

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

    // Run request
    const response = await recaptchaenterpriseClient.deleteKey(request);
    console.log(response);
  }

  callDeleteKey();

deleteKey(request, options, callback)

deleteKey(request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteKey(request, callback)

deleteKey(request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getKey(request, options)

getKey(request?: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, options?: CallOptions): Promise<[protos.google.cloud.recaptchaenterprise.v1beta1.IKey, (protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest | undefined), {} | undefined]>;

Returns the specified key.

Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.recaptchaenterprise.v1beta1.IKey, (protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest | undefined), {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Key]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the requested key, in the format
   *  "projects/{project_number}/keys/{key_id}".
   */
  // const name = 'abc123'

  // Imports the Recaptchaenterprise library
  const {RecaptchaEnterpriseServiceV1Beta1Client} =
    require('@google-cloud/recaptcha-enterprise').v1beta1;

  // Instantiates a client
  const recaptchaenterpriseClient =
    new RecaptchaEnterpriseServiceV1Beta1Client();

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

    // Run request
    const response = await recaptchaenterpriseClient.getKey(request);
    console.log(response);
  }

  callGetKey();

getKey(request, options, callback)

getKey(request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, options: CallOptions, callback: Callback<protos.google.cloud.recaptchaenterprise.v1beta1.IKey, protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest
options CallOptions
callback Callback<protos.google.cloud.recaptchaenterprise.v1beta1.IKey, protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getKey(request, callback)

getKey(request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, callback: Callback<protos.google.cloud.recaptchaenterprise.v1beta1.IKey, protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest
callback Callback<protos.google.cloud.recaptchaenterprise.v1beta1.IKey, protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getProjectId()

getProjectId(): Promise<string>;
Returns
TypeDescription
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
NameDescription
callback Callback<string, undefined, undefined>
Returns
TypeDescription
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
TypeDescription
Promise<{ [name: string]: Function; }>

{Promise} A promise that resolves to an authenticated service stub.

keyPath(project, key)

keyPath(project: string, key: string): string;

Return a fully-qualified key resource name string.

Parameters
NameDescription
project string
key string
Returns
TypeDescription
string

{string} Resource name string.

listKeys(request, options)

listKeys(request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, options?: CallOptions): Promise<[protos.google.cloud.recaptchaenterprise.v1beta1.IKey[], protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest | null, protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse]>;

Returns the list of all keys that belong to a project.

Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.recaptchaenterprise.v1beta1.IKey[], protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest | null, protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of [Key]. 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 listKeysAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

listKeys(request, options, callback)

listKeys(request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse | null | undefined, protos.google.cloud.recaptchaenterprise.v1beta1.IKey>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse | null | undefined, protos.google.cloud.recaptchaenterprise.v1beta1.IKey>
Returns
TypeDescription
void

listKeys(request, callback)

listKeys(request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, callback: PaginationCallback<protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse | null | undefined, protos.google.cloud.recaptchaenterprise.v1beta1.IKey>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest
callback PaginationCallback<protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse | null | undefined, protos.google.cloud.recaptchaenterprise.v1beta1.IKey>
Returns
TypeDescription
void

listKeysAsync(request, options)

listKeysAsync(request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.recaptchaenterprise.v1beta1.IKey>;

Equivalent to listKeys, but returns an iterable object.

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

Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.recaptchaenterprise.v1beta1.IKey>

{Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Key]. 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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the project that contains the keys that will be
   *  listed, in the format "projects/{project_number}".
   */
  // const parent = 'abc123'
  /**
   *  Optional. The maximum number of keys to return. Default is 10. Max limit is
   *  1000.
   */
  // const pageSize = 1234
  /**
   *  Optional. The next_page_token value returned from a previous.
   *  ListKeysRequest, if any.
   */
  // const pageToken = 'abc123'

  // Imports the Recaptchaenterprise library
  const {RecaptchaEnterpriseServiceV1Beta1Client} =
    require('@google-cloud/recaptcha-enterprise').v1beta1;

  // Instantiates a client
  const recaptchaenterpriseClient =
    new RecaptchaEnterpriseServiceV1Beta1Client();

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

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

  callListKeys();

listKeysStream(request, options)

listKeysStream(request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing [Key] 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 listKeysAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

matchAssessmentFromAssessmentName(assessmentName)

matchAssessmentFromAssessmentName(assessmentName: string): string | number;

Parse the assessment from Assessment resource.

Parameter
NameDescription
assessmentName string

A fully-qualified path representing Assessment resource.

Returns
TypeDescription
string | number

{string} A string representing the assessment.

matchKeyFromKeyName(keyName)

matchKeyFromKeyName(keyName: string): string | number;

Parse the key from Key resource.

Parameter
NameDescription
keyName string

A fully-qualified path representing Key resource.

Returns
TypeDescription
string | number

{string} A string representing the key.

matchProjectFromAssessmentName(assessmentName)

matchProjectFromAssessmentName(assessmentName: string): string | number;

Parse the project from Assessment resource.

Parameter
NameDescription
assessmentName string

A fully-qualified path representing Assessment resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromKeyName(keyName)

matchProjectFromKeyName(keyName: string): string | number;

Parse the project from Key resource.

Parameter
NameDescription
keyName string

A fully-qualified path representing Key resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromProjectName(projectName)

matchProjectFromProjectName(projectName: string): string | number;

Parse the project from Project resource.

Parameter
NameDescription
projectName string

A fully-qualified path representing Project resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

projectPath(project)

projectPath(project: string): string;

Return a fully-qualified project resource name string.

Parameter
NameDescription
project string
Returns
TypeDescription
string

{string} Resource name string.

updateKey(request, options)

updateKey(request?: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, options?: CallOptions): Promise<[protos.google.cloud.recaptchaenterprise.v1beta1.IKey, (protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest | undefined), {} | undefined]>;

Updates the specified key.

Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.recaptchaenterprise.v1beta1.IKey, (protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest | undefined), {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Key]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The key to update.
   */
  // const key = {}
  /**
   *  Optional. The mask to control which field of the key get updated. If the mask is not
   *  present, all fields will be updated.
   */
  // const updateMask = {}

  // Imports the Recaptchaenterprise library
  const {RecaptchaEnterpriseServiceV1Beta1Client} =
    require('@google-cloud/recaptcha-enterprise').v1beta1;

  // Instantiates a client
  const recaptchaenterpriseClient =
    new RecaptchaEnterpriseServiceV1Beta1Client();

  async function callUpdateKey() {
    // Construct request
    const request = {
      key,
    };

    // Run request
    const response = await recaptchaenterpriseClient.updateKey(request);
    console.log(response);
  }

  callUpdateKey();

updateKey(request, options, callback)

updateKey(request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, options: CallOptions, callback: Callback<protos.google.cloud.recaptchaenterprise.v1beta1.IKey, protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest
options CallOptions
callback Callback<protos.google.cloud.recaptchaenterprise.v1beta1.IKey, protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateKey(request, callback)

updateKey(request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, callback: Callback<protos.google.cloud.recaptchaenterprise.v1beta1.IKey, protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest
callback Callback<protos.google.cloud.recaptchaenterprise.v1beta1.IKey, protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void