Class v1.RecaptchaEnterpriseServiceClient (3.1.1)

Service to determine the likelihood an event is legitimate. v1

Package

@google-cloud/recaptcha-enterprise

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of RecaptchaEnterpriseServiceClient.

Parameters
NameDescription
opts ClientOptions
gaxInstance typeof gax | typeof gax.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 RecaptchaEnterpriseServiceClient({fallback: 'rest'}, gax); ```

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.

recaptchaEnterpriseServiceStub

recaptchaEnterpriseServiceStub?: 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.v1.IAnnotateAssessmentRequest, options?: CallOptions): Promise<[
        protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse,
        (protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest | undefined),
        {} | undefined
    ]>;

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

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

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, (protos.google.cloud.recaptchaenterprise.v1.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

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the Assessment, in the format
   *  "projects/{project}/assessments/{assessment}".
   */
  // const name = 'abc123'
  /**
   *  Optional. The annotation that will be assigned to the Event. This field can be left
   *  empty to provide reasons that apply to an event without concluding whether
   *  the event is legitimate or fraudulent.
   */
  // const annotation = {}
  /**
   *  Optional. Optional reasons for the annotation that will be assigned to the Event.
   */
  // const reasons = 1234
  /**
   *  Optional. Unique stable hashed user identifier to apply to the assessment.
   *  This is an alternative to setting the hashed_account_id in
   *  CreateAssessment, for example when the account identifier is not yet known
   *  in the initial request. It is recommended that the identifier is hashed
   *  using hmac-sha256 with stable secret.
   */
  // const hashedAccountId = 'Buffer.from('string')'

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

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

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

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

  callAnnotateAssessment();

annotateAssessment(request, options, callback)

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

annotateAssessment(request, callback)

annotateAssessment(request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, callback: Callback<protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest
callback Callback<protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, protos.google.cloud.recaptchaenterprise.v1.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.v1.ICreateAssessmentRequest, options?: CallOptions): Promise<[
        protos.google.cloud.recaptchaenterprise.v1.IAssessment,
        (protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest | undefined),
        {} | undefined
    ]>;

Creates an Assessment of the likelihood an event is legitimate.

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

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.recaptchaenterprise.v1.IAssessment, (protos.google.cloud.recaptchaenterprise.v1.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

  /**
   * 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 project in which the assessment will be created,
   *  in the format "projects/{project}".
   */
  // const parent = 'abc123'
  /**
   *  Required. The assessment details.
   */
  // const assessment = {}

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

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

  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.v1.ICreateAssessmentRequest, options: CallOptions, callback: Callback<protos.google.cloud.recaptchaenterprise.v1.IAssessment, protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest
options CallOptions
callback Callback<protos.google.cloud.recaptchaenterprise.v1.IAssessment, protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createAssessment(request, callback)

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

createKey(request, options)

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

Creates a new reCAPTCHA Enterprise key.

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

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.recaptchaenterprise.v1.IKey, protos.google.cloud.recaptchaenterprise.v1.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

  /**
   * 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 project in which the key will be created, in the
   *  format "projects/{project}".
   */
  // const parent = 'abc123'
  /**
   *  Required. Information to create a reCAPTCHA Enterprise key.
   */
  // const key = {}

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

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

  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.v1.ICreateKeyRequest, options: CallOptions, callback: Callback<protos.google.cloud.recaptchaenterprise.v1.IKey, protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest
options CallOptions
callback Callback<protos.google.cloud.recaptchaenterprise.v1.IKey, protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createKey(request, callback)

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

deleteKey(request, options)

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

Deletes the specified key.

Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.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.v1.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

  /**
   * 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 key to be deleted, in the format
   *  "projects/{project}/keys/{key}".
   */
  // const name = 'abc123'

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

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

  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.v1.IDeleteKeyRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteKey(request, callback)

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

getKey(request, options)

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

Returns the specified key.

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

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.recaptchaenterprise.v1.IKey, protos.google.cloud.recaptchaenterprise.v1.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

  /**
   * 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 requested key, in the format
   *  "projects/{project}/keys/{key}".
   */
  // const name = 'abc123'

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

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

  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.v1.IGetKeyRequest, options: CallOptions, callback: Callback<protos.google.cloud.recaptchaenterprise.v1.IKey, protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest
options CallOptions
callback Callback<protos.google.cloud.recaptchaenterprise.v1.IKey, protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getKey(request, callback)

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

getMetrics(request, options)

getMetrics(request?: protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.recaptchaenterprise.v1.IMetrics,
        protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest | undefined,
        {} | undefined
    ]>;

Get some aggregated metrics for a Key. This data can be used to build dashboards.

Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.recaptchaenterprise.v1.IMetrics, protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Metrics]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) 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 requested metrics, in the format
   *  "projects/{project}/keys/{key}/metrics".
   */
  // const name = 'abc123'

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

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

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

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

  callGetMetrics();

getMetrics(request, options, callback)

getMetrics(request: protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest, options: CallOptions, callback: Callback<protos.google.cloud.recaptchaenterprise.v1.IMetrics, protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest
options CallOptions
callback Callback<protos.google.cloud.recaptchaenterprise.v1.IMetrics, protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getMetrics(request, callback)

getMetrics(request: protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest, callback: Callback<protos.google.cloud.recaptchaenterprise.v1.IMetrics, protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest
callback Callback<protos.google.cloud.recaptchaenterprise.v1.IMetrics, protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest | 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.v1.IListKeysRequest, options?: CallOptions): Promise<[
        protos.google.cloud.recaptchaenterprise.v1.IKey[],
        protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest | null,
        protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse
    ]>;

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

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

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.recaptchaenterprise.v1.IKey[], protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest | null, protos.google.cloud.recaptchaenterprise.v1.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.v1.IListKeysRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse | null | undefined, protos.google.cloud.recaptchaenterprise.v1.IKey>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse | null | undefined, protos.google.cloud.recaptchaenterprise.v1.IKey>
Returns
TypeDescription
void

listKeys(request, callback)

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

listKeysAsync(request, options)

listKeysAsync(request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.recaptchaenterprise.v1.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.v1.IListKeysRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.recaptchaenterprise.v1.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

  /**
   * 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 project that contains the keys that will be
   *  listed, in the format "projects/{project}".
   */
  // 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 {RecaptchaEnterpriseServiceClient} = require('@google-cloud/recaptcha-enterprise').v1;

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

  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.v1.IListKeysRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.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.

listRelatedAccountGroupMemberships(request, options)

listRelatedAccountGroupMemberships(request?: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership[],
        protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest | null,
        protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse
    ]>;

Get memberships in a group of related accounts.

Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership[], protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest | null, protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of [RelatedAccountGroupMembership]. 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 listRelatedAccountGroupMembershipsAsync() 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.

listRelatedAccountGroupMemberships(request, options, callback)

listRelatedAccountGroupMemberships(request: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse | null | undefined, protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse | null | undefined, protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership>
Returns
TypeDescription
void

listRelatedAccountGroupMemberships(request, callback)

listRelatedAccountGroupMemberships(request: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, callback: PaginationCallback<protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse | null | undefined, protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest
callback PaginationCallback<protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse | null | undefined, protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership>
Returns
TypeDescription
void

listRelatedAccountGroupMembershipsAsync(request, options)

listRelatedAccountGroupMembershipsAsync(request?: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership>;

Equivalent to listRelatedAccountGroupMemberships, 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.v1.IListRelatedAccountGroupMembershipsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership>

{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 [RelatedAccountGroupMembership]. 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

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name for the related account group in the format
   *  `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`.
   */
  // const parent = 'abc123'
  /**
   *  Optional. The maximum number of accounts to return. The service might return fewer
   *  than this value.
   *  If unspecified, at most 50 accounts are returned.
   *  The maximum value is 1000; values above 1000 are coerced to 1000.
   */
  // const pageSize = 1234
  /**
   *  Optional. A page token, received from a previous `ListRelatedAccountGroupMemberships`
   *  call.
   *  When paginating, all other parameters provided to
   *  `ListRelatedAccountGroupMemberships` must match the call that provided the
   *  page token.
   */
  // const pageToken = 'abc123'

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

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

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

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

  callListRelatedAccountGroupMemberships();

listRelatedAccountGroupMembershipsStream(request, options)

listRelatedAccountGroupMembershipsStream(request?: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest

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 [RelatedAccountGroupMembership] 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 listRelatedAccountGroupMembershipsAsync() 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.

listRelatedAccountGroups(request, options)

listRelatedAccountGroups(request?: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup[],
        protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest | null,
        protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse
    ]>;

List groups of related accounts.

Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup[], protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest | null, protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of [RelatedAccountGroup]. 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 listRelatedAccountGroupsAsync() 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.

listRelatedAccountGroups(request, options, callback)

listRelatedAccountGroups(request: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse | null | undefined, protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse | null | undefined, protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup>
Returns
TypeDescription
void

listRelatedAccountGroups(request, callback)

listRelatedAccountGroups(request: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, callback: PaginationCallback<protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse | null | undefined, protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest
callback PaginationCallback<protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse | null | undefined, protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup>
Returns
TypeDescription
void

listRelatedAccountGroupsAsync(request, options)

listRelatedAccountGroupsAsync(request?: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup>;

Equivalent to listRelatedAccountGroups, 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.v1.IListRelatedAccountGroupsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup>

{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 [RelatedAccountGroup]. 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

  /**
   * 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 project to list related account groups from, in the format
   *  "projects/{project}".
   */
  // const parent = 'abc123'
  /**
   *  Optional. The maximum number of groups to return. The service might return fewer than
   *  this value.
   *  If unspecified, at most 50 groups are returned.
   *  The maximum value is 1000; values above 1000 are coerced to 1000.
   */
  // const pageSize = 1234
  /**
   *  Optional. A page token, received from a previous `ListRelatedAccountGroups` call.
   *  Provide this to retrieve the subsequent page.
   *  When paginating, all other parameters provided to
   *  `ListRelatedAccountGroups` must match the call that provided the page
   *  token.
   */
  // const pageToken = 'abc123'

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

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

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

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

  callListRelatedAccountGroups();

listRelatedAccountGroupsStream(request, options)

listRelatedAccountGroupsStream(request?: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest

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 [RelatedAccountGroup] 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 listRelatedAccountGroupsAsync() 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.

matchKeyFromMetricsName(metricsName)

matchKeyFromMetricsName(metricsName: string): string | number;

Parse the key from Metrics resource.

Parameter
NameDescription
metricsName string

A fully-qualified path representing Metrics resource.

Returns
TypeDescription
string | number

{string} A string representing the key.

matchMembershipFromRelatedAccountGroupMembershipName(relatedAccountGroupMembershipName)

matchMembershipFromRelatedAccountGroupMembershipName(relatedAccountGroupMembershipName: string): string | number;

Parse the membership from RelatedAccountGroupMembership resource.

Parameter
NameDescription
relatedAccountGroupMembershipName string

A fully-qualified path representing RelatedAccountGroupMembership resource.

Returns
TypeDescription
string | number

{string} A string representing the membership.

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.

matchProjectFromMetricsName(metricsName)

matchProjectFromMetricsName(metricsName: string): string | number;

Parse the project from Metrics resource.

Parameter
NameDescription
metricsName string

A fully-qualified path representing Metrics 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.

matchProjectFromRelatedAccountGroupMembershipName(relatedAccountGroupMembershipName)

matchProjectFromRelatedAccountGroupMembershipName(relatedAccountGroupMembershipName: string): string | number;

Parse the project from RelatedAccountGroupMembership resource.

Parameter
NameDescription
relatedAccountGroupMembershipName string

A fully-qualified path representing RelatedAccountGroupMembership resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromRelatedAccountGroupName(relatedAccountGroupName)

matchProjectFromRelatedAccountGroupName(relatedAccountGroupName: string): string | number;

Parse the project from RelatedAccountGroup resource.

Parameter
NameDescription
relatedAccountGroupName string

A fully-qualified path representing RelatedAccountGroup resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchRelatedaccountgroupFromRelatedAccountGroupMembershipName(relatedAccountGroupMembershipName)

matchRelatedaccountgroupFromRelatedAccountGroupMembershipName(relatedAccountGroupMembershipName: string): string | number;

Parse the relatedaccountgroup from RelatedAccountGroupMembership resource.

Parameter
NameDescription
relatedAccountGroupMembershipName string

A fully-qualified path representing RelatedAccountGroupMembership resource.

Returns
TypeDescription
string | number

{string} A string representing the relatedaccountgroup.

matchRelatedaccountgroupFromRelatedAccountGroupName(relatedAccountGroupName)

matchRelatedaccountgroupFromRelatedAccountGroupName(relatedAccountGroupName: string): string | number;

Parse the relatedaccountgroup from RelatedAccountGroup resource.

Parameter
NameDescription
relatedAccountGroupName string

A fully-qualified path representing RelatedAccountGroup resource.

Returns
TypeDescription
string | number

{string} A string representing the relatedaccountgroup.

metricsPath(project, key)

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

Return a fully-qualified metrics resource name string.

Parameters
NameDescription
project string
key string
Returns
TypeDescription
string

{string} Resource name string.

migrateKey(request, options)

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

Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. Once a key is migrated, it can be used from either product. SiteVerify requests are billed as CreateAssessment calls. You must be authenticated as one of the current owners of the reCAPTCHA Site Key, and your user must have the reCAPTCHA Enterprise Admin IAM role in the destination project.

Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.recaptchaenterprise.v1.IKey, protos.google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest | 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

  /**
   * 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 key to be migrated, in the format
   *  "projects/{project}/keys/{key}".
   */
  // const name = 'abc123'

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

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

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

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

  callMigrateKey();

migrateKey(request, options, callback)

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

migrateKey(request, callback)

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

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.

relatedAccountGroupMembershipPath(project, relatedaccountgroup, membership)

relatedAccountGroupMembershipPath(project: string, relatedaccountgroup: string, membership: string): string;

Return a fully-qualified relatedAccountGroupMembership resource name string.

Parameters
NameDescription
project string
relatedaccountgroup string
membership string
Returns
TypeDescription
string

{string} Resource name string.

relatedAccountGroupPath(project, relatedaccountgroup)

relatedAccountGroupPath(project: string, relatedaccountgroup: string): string;

Return a fully-qualified relatedAccountGroup resource name string.

Parameters
NameDescription
project string
relatedaccountgroup string
Returns
TypeDescription
string

{string} Resource name string.

retrieveLegacySecretKey(request, options)

retrieveLegacySecretKey(request?: protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest, options?: CallOptions): Promise<[
        protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse,
        (protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest | undefined),
        {} | undefined
    ]>;

Returns the secret key related to the specified public key. You must use the legacy secret key only in a 3rd party integration with legacy reCAPTCHA.

Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse, (protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [RetrieveLegacySecretKeyResponse]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) 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 public key name linked to the requested secret key in the format
   *  "projects/{project}/keys/{key}".
   */
  // const key = 'abc123'

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

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

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

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

  callRetrieveLegacySecretKey();

retrieveLegacySecretKey(request, options, callback)

retrieveLegacySecretKey(request: protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest, options: CallOptions, callback: Callback<protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse, protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest
options CallOptions
callback Callback<protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse, protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

retrieveLegacySecretKey(request, callback)

retrieveLegacySecretKey(request: protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest, callback: Callback<protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse, protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest
callback Callback<protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse, protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

searchRelatedAccountGroupMemberships(request, options)

searchRelatedAccountGroupMemberships(request?: protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership[],
        protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest | null,
        protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse
    ]>;

Search group memberships related to a given account.

Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership[], protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest | null, protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of [RelatedAccountGroupMembership]. 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 searchRelatedAccountGroupMembershipsAsync() 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.

searchRelatedAccountGroupMemberships(request, options, callback)

searchRelatedAccountGroupMemberships(request: protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse | null | undefined, protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse | null | undefined, protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership>
Returns
TypeDescription
void

searchRelatedAccountGroupMemberships(request, callback)

searchRelatedAccountGroupMemberships(request: protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, callback: PaginationCallback<protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse | null | undefined, protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest
callback PaginationCallback<protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse | null | undefined, protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership>
Returns
TypeDescription
void

searchRelatedAccountGroupMembershipsAsync(request, options)

searchRelatedAccountGroupMembershipsAsync(request?: protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership>;

Equivalent to searchRelatedAccountGroupMemberships, 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.v1.ISearchRelatedAccountGroupMembershipsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership>

{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 [RelatedAccountGroupMembership]. 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

  /**
   * 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 project to search related account group memberships from.
   *  Specify the project name in the following format: "projects/{project}".
   */
  // const project = 'my-project'
  /**
   *  Optional. The unique stable hashed user identifier we should search connections to.
   *  The identifier should correspond to a `hashed_account_id` provided in a
   *  previous `CreateAssessment` or `AnnotateAssessment` call.
   */
  // const hashedAccountId = 'Buffer.from('string')'
  /**
   *  Optional. The maximum number of groups to return. The service might return fewer than
   *  this value.
   *  If unspecified, at most 50 groups are returned.
   *  The maximum value is 1000; values above 1000 are coerced to 1000.
   */
  // const pageSize = 1234
  /**
   *  Optional. A page token, received from a previous
   *  `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the
   *  subsequent page.
   *  When paginating, all other parameters provided to
   *  `SearchRelatedAccountGroupMemberships` must match the call that provided
   *  the page token.
   */
  // const pageToken = 'abc123'

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

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

  async function callSearchRelatedAccountGroupMemberships() {
    // Construct request
    const request = {
      project,
    };

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

  callSearchRelatedAccountGroupMemberships();

searchRelatedAccountGroupMembershipsStream(request, options)

searchRelatedAccountGroupMembershipsStream(request?: protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest

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 [RelatedAccountGroupMembership] 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 searchRelatedAccountGroupMembershipsAsync() 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.

updateKey(request, options)

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

Updates the specified key.

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

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.recaptchaenterprise.v1.IKey, protos.google.cloud.recaptchaenterprise.v1.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

  /**
   * 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 key to update.
   */
  // const key = {}
  /**
   *  Optional. The mask to control which fields of the key get updated. If the mask is not
   *  present, all fields will be updated.
   */
  // const updateMask = {}

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

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

  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.v1.IUpdateKeyRequest, options: CallOptions, callback: Callback<protos.google.cloud.recaptchaenterprise.v1.IKey, protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest
options CallOptions
callback Callback<protos.google.cloud.recaptchaenterprise.v1.IKey, protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateKey(request, callback)

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