UNPKG

@google-cloud/recaptcha-enterprise

Version:
683 lines 93.4 kB
import type * as gax from 'google-gax'; import type { Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback } from 'google-gax'; import { Transform } from 'stream'; import * as protos from '../../protos/protos'; /** * Service to determine the likelihood an event is legitimate. * @class * @memberof v1 */ export declare class RecaptchaEnterpriseServiceClient { private _terminated; private _opts; private _providedCustomServicePath; private _gaxModule; private _gaxGrpc; private _protos; private _defaults; private _universeDomain; private _servicePath; private _log; auth: gax.GoogleAuth; descriptors: Descriptors; warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: { [name: string]: Function; }; pathTemplates: { [name: string]: gax.PathTemplate; }; recaptchaEnterpriseServiceStub?: Promise<{ [name: string]: Function; }>; /** * Construct an instance of RecaptchaEnterpriseServiceClient. * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] * @param {string} [options.credentials.private_key] * @param {string} [options.email] - Account email address. Required when * using a .pem or .p12 keyFilename. * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or * .p12 key downloaded from the Google Developers Console. If you provide * a path to a JSON file, the projectId option below is not necessary. * NOTE: .pem and .p12 require you to specify options.email as well. * @param {number} [options.port] - The port on which to connect to * the remote host. * @param {string} [options.projectId] - The project ID from the Google * Developer's Console, e.g. 'grape-spaceship-123'. We will also check * the environment variable GCLOUD_PROJECT for your project ID. If your * app is running in an environment which supports * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: 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: true}, gax); * ``` */ constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback); /** * 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 {Promise} A promise that resolves to an authenticated service stub. */ initialize(): Promise<{ [name: string]: Function; }>; /** * The DNS address for this API service. * @deprecated Use the apiEndpoint method of the client instance. * @returns {string} The DNS address for this service. */ static get servicePath(): string; /** * The DNS address for this API service - same as servicePath. * @deprecated Use the apiEndpoint method of the client instance. * @returns {string} The DNS address for this service. */ static get apiEndpoint(): string; /** * The DNS address for this API service. * @returns {string} The DNS address for this service. */ get apiEndpoint(): string; get universeDomain(): string; /** * The port for this API service. * @returns {number} The default port for this service. */ static get port(): number; /** * The scopes needed to make gRPC calls for every method defined * in this service. * @returns {string[]} List of default scopes. */ static get scopes(): string[]; getProjectId(): Promise<string>; getProjectId(callback: Callback<string, undefined, undefined>): void; /** * Creates an Assessment of the likelihood an event is legitimate. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The name of the project in which the assessment is created, * in the format `projects/{project}`. * @param {google.cloud.recaptchaenterprise.v1.Assessment} request.assessment * Required. The assessment details. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.recaptchaenterprise.v1.Assessment|Assessment}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/recaptcha_enterprise_service.create_assessment.js</caption> * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateAssessment_async */ 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 ]>; 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; 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; /** * Annotates a previously created Assessment to provide additional information * on whether the event turned out to be authentic or fraudulent. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The resource name of the Assessment, in the format * `projects/{project}/assessments/{assessment}`. * @param {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation} [request.annotation] * Optional. The annotation that is 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. * @param {number[]} [request.reasons] * Optional. Reasons for the annotation that are assigned to the event. * @param {string} [request.accountId] * Optional. A stable account identifier to apply to the assessment. This is * an alternative to setting `account_id` in `CreateAssessment`, for example * when a stable account identifier is not yet known in the initial request. * @param {Buffer} [request.hashedAccountId] * Optional. A stable hashed account identifier to apply to the assessment. * This is an alternative to setting `hashed_account_id` in * `CreateAssessment`, for example when a stable account identifier is not yet * known in the initial request. * @param {google.cloud.recaptchaenterprise.v1.TransactionEvent} [request.transactionEvent] * Optional. If the assessment is part of a payment transaction, provide * details on payment lifecycle events that occur in the transaction. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse|AnnotateAssessmentResponse}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js</caption> * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AnnotateAssessment_async */ 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 ]>; 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; 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; /** * Creates a new reCAPTCHA Enterprise key. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The name of the project in which the key is created, in the * format `projects/{project}`. * @param {google.cloud.recaptchaenterprise.v1.Key} request.key * Required. Information to create a reCAPTCHA Enterprise key. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.recaptchaenterprise.v1.Key|Key}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/recaptcha_enterprise_service.create_key.js</caption> * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateKey_async */ 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 ]>; 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; 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; /** * 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. * * @param {Object} request * The request object that will be sent. * @param {string} request.key * Required. The public key name linked to the requested secret key in the * format `projects/{project}/keys/{key}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse|RetrieveLegacySecretKeyResponse}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/recaptcha_enterprise_service.retrieve_legacy_secret_key.js</caption> * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_RetrieveLegacySecretKey_async */ 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 ]>; 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; 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; /** * Returns the specified key. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The name of the requested key, in the format * `projects/{project}/keys/{key}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.recaptchaenterprise.v1.Key|Key}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/recaptcha_enterprise_service.get_key.js</caption> * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetKey_async */ 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 ]>; 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; 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; /** * Updates the specified key. * * @param {Object} request * The request object that will be sent. * @param {google.cloud.recaptchaenterprise.v1.Key} request.key * Required. The key to update. * @param {google.protobuf.FieldMask} [request.updateMask] * Optional. The mask to control which fields of the key get updated. If the * mask is not present, all fields are updated. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.recaptchaenterprise.v1.Key|Key}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/recaptcha_enterprise_service.update_key.js</caption> * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateKey_async */ 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 ]>; 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; 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; /** * Deletes the specified key. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The name of the key to be deleted, in the format * `projects/{project}/keys/{key}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/recaptcha_enterprise_service.delete_key.js</caption> * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteKey_async */ deleteKey(request?: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, options?: CallOptions): Promise<[ protos.google.protobuf.IEmpty, protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest | undefined, {} | undefined ]>; 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; 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; /** * 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 Key, and * your user must have the reCAPTCHA Enterprise Admin IAM role in the * destination project. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The name of the key to be migrated, in the format * `projects/{project}/keys/{key}`. * @param {boolean} [request.skipBillingCheck] * Optional. If true, skips the billing check. * A reCAPTCHA Enterprise key or migrated key behaves differently than a * reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see * https://cloud.google.com/recaptcha/quotas#quota_limit). To avoid * any disruption of your usage, we check that a billing account is present. * If your usage of reCAPTCHA is under the free quota, you can safely skip the * billing check and proceed with the migration. See * https://cloud.google.com/recaptcha/docs/billing-information. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.recaptchaenterprise.v1.Key|Key}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/recaptcha_enterprise_service.migrate_key.js</caption> * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_MigrateKey_async */ 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 ]>; 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; 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; /** * Adds an IP override to a key. The following restrictions hold: * * The maximum number of IP overrides per key is 100. * * For any conflict (such as IP already exists or IP part of an existing * IP range), an error is returned. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The name of the key to which the IP override is added, in the * format `projects/{project}/keys/{key}`. * @param {google.cloud.recaptchaenterprise.v1.IpOverrideData} request.ipOverrideData * Required. IP override added to the key. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse|AddIpOverrideResponse}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/recaptcha_enterprise_service.add_ip_override.js</caption> * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AddIpOverride_async */ addIpOverride(request?: protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest, options?: CallOptions): Promise<[ protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideResponse, (protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest | undefined), {} | undefined ]>; addIpOverride(request: protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest, options: CallOptions, callback: Callback<protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideResponse, protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest | null | undefined, {} | null | undefined>): void; addIpOverride(request: protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest, callback: Callback<protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideResponse, protos.google.cloud.recaptchaenterprise.v1.IAddIpOverrideRequest | null | undefined, {} | null | undefined>): void; /** * Removes an IP override from a key. The following restrictions hold: * * If the IP isn't found in an existing IP override, a `NOT_FOUND` error * is returned. * * If the IP is found in an existing IP override, but the * override type does not match, a `NOT_FOUND` error is returned. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The name of the key from which the IP override is removed, in the * format `projects/{project}/keys/{key}`. * @param {google.cloud.recaptchaenterprise.v1.IpOverrideData} request.ipOverrideData * Required. IP override to be removed from the key. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.recaptchaenterprise.v1.RemoveIpOverrideResponse|RemoveIpOverrideResponse}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/recaptcha_enterprise_service.remove_ip_override.js</caption> * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_RemoveIpOverride_async */ removeIpOverride(request?: protos.google.cloud.recaptchaenterprise.v1.IRemoveIpOverrideRequest, options?: CallOptions): Promise<[ protos.google.cloud.recaptchaenterprise.v1.IRemoveIpOverrideResponse, (protos.google.cloud.recaptchaenterprise.v1.IRemoveIpOverrideRequest | undefined), {} | undefined ]>; removeIpOverride(request: protos.google.cloud.recaptchaenterprise.v1.IRemoveIpOverrideRequest, options: CallOptions, callback: Callback<protos.google.cloud.recaptchaenterprise.v1.IRemoveIpOverrideResponse, protos.google.cloud.recaptchaenterprise.v1.IRemoveIpOverrideRequest | null | undefined, {} | null | undefined>): void; removeIpOverride(request: protos.google.cloud.recaptchaenterprise.v1.IRemoveIpOverrideRequest, callback: Callback<protos.google.cloud.recaptchaenterprise.v1.IRemoveIpOverrideResponse, protos.google.cloud.recaptchaenterprise.v1.IRemoveIpOverrideRequest | null | undefined, {} | null | undefined>): void; /** * Get some aggregated metrics for a Key. This data can be used to build * dashboards. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The name of the requested metrics, in the format * `projects/{project}/keys/{key}/metrics`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.recaptchaenterprise.v1.Metrics|Metrics}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/recaptcha_enterprise_service.get_metrics.js</caption> * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetMetrics_async */ 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 ]>; 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; 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; /** * Creates a new FirewallPolicy, specifying conditions at which reCAPTCHA * Enterprise actions can be executed. * A project may have a maximum of 1000 policies. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The name of the project this policy applies to, in the format * `projects/{project}`. * @param {google.cloud.recaptchaenterprise.v1.FirewallPolicy} request.firewallPolicy * Required. Information to create the policy. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.recaptchaenterprise.v1.FirewallPolicy|FirewallPolicy}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/recaptcha_enterprise_service.create_firewall_policy.js</caption> * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateFirewallPolicy_async */ createFirewallPolicy(request?: protos.google.cloud.recaptchaenterprise.v1.ICreateFirewallPolicyRequest, options?: CallOptions): Promise<[ protos.google.cloud.recaptchaenterprise.v1.IFirewallPolicy, (protos.google.cloud.recaptchaenterprise.v1.ICreateFirewallPolicyRequest | undefined), {} | undefined ]>; createFirewallPolicy(request: protos.google.cloud.recaptchaenterprise.v1.ICreateFirewallPolicyRequest, options: CallOptions, callback: Callback<protos.google.cloud.recaptchaenterprise.v1.IFirewallPolicy, protos.google.cloud.recaptchaenterprise.v1.ICreateFirewallPolicyRequest | null | undefined, {} | null | undefined>): void; createFirewallPolicy(request: protos.google.cloud.recaptchaenterprise.v1.ICreateFirewallPolicyRequest, callback: Callback<protos.google.cloud.recaptchaenterprise.v1.IFirewallPolicy, protos.google.cloud.recaptchaenterprise.v1.ICreateFirewallPolicyRequest | null | undefined, {} | null | undefined>): void; /** * Returns the specified firewall policy. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The name of the requested policy, in the format * `projects/{project}/firewallpolicies/{firewallpolicy}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.recaptchaenterprise.v1.FirewallPolicy|FirewallPolicy}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/recaptcha_enterprise_service.get_firewall_policy.js</caption> * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetFirewallPolicy_async */ getFirewallPolicy(request?: protos.google.cloud.recaptchaenterprise.v1.IGetFirewallPolicyRequest, options?: CallOptions): Promise<[ protos.google.cloud.recaptchaenterprise.v1.IFirewallPolicy, (protos.google.cloud.recaptchaenterprise.v1.IGetFirewallPolicyRequest | undefined), {} | undefined ]>; getFirewallPolicy(request: protos.google.cloud.recaptchaenterprise.v1.IGetFirewallPolicyRequest, options: CallOptions, callback: Callback<protos.google.cloud.recaptchaenterprise.v1.IFirewallPolicy, protos.google.cloud.recaptchaenterprise.v1.IGetFirewallPolicyRequest | null | undefined, {} | null | undefined>): void; getFirewallPolicy(request: protos.google.cloud.recaptchaenterprise.v1.IGetFirewallPolicyRequest, callback: Callback<protos.google.cloud.recaptchaenterprise.v1.IFirewallPolicy, protos.google.cloud.recaptchaenterprise.v1.IGetFirewallPolicyRequest | null | undefined, {} | null | undefined>): void; /** * Updates the specified firewall policy. * * @param {Object} request * The request object that will be sent. * @param {google.cloud.recaptchaenterprise.v1.FirewallPolicy} request.firewallPolicy * Required. The policy to update. * @param {google.protobuf.FieldMask} [request.updateMask] * Optional. The mask to control which fields of the policy get updated. If * the mask is not present, all fields are updated. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.recaptchaenterprise.v1.FirewallPolicy|FirewallPolicy}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/recaptcha_enterprise_service.update_firewall_policy.js</caption> * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateFirewallPolicy_async */ updateFirewallPolicy(request?: protos.google.cloud.recaptchaenterprise.v1.IUpdateFirewallPolicyRequest, options?: CallOptions): Promise<[ protos.google.cloud.recaptchaenterprise.v1.IFirewallPolicy, (protos.google.cloud.recaptchaenterprise.v1.IUpdateFirewallPolicyRequest | undefined), {} | undefined ]>; updateFirewallPolicy(request: protos.google.cloud.recaptchaenterprise.v1.IUpdateFirewallPolicyRequest, options: CallOptions, callback: Callback<protos.google.cloud.recaptchaenterprise.v1.IFirewallPolicy, protos.google.cloud.recaptchaenterprise.v1.IUpdateFirewallPolicyRequest | null | undefined, {} | null | undefined>): void; updateFirewallPolicy(request: protos.google.cloud.recaptchaenterprise.v1.IUpdateFirewallPolicyRequest, callback: Callback<protos.google.cloud.recaptchaenterprise.v1.IFirewallPolicy, protos.google.cloud.recaptchaenterprise.v1.IUpdateFirewallPolicyRequest | null | undefined, {} | null | undefined>): void; /** * Deletes the specified firewall policy. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The name of the policy to be deleted, in the format * `projects/{project}/firewallpolicies/{firewallpolicy}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/recaptcha_enterprise_service.delete_firewall_policy.js</caption> * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteFirewallPolicy_async */ deleteFirewallPolicy(request?: protos.google.cloud.recaptchaenterprise.v1.IDeleteFirewallPolicyRequest, options?: CallOptions): Promise<[ protos.google.protobuf.IEmpty, (protos.google.cloud.recaptchaenterprise.v1.IDeleteFirewallPolicyRequest | undefined), {} | undefined ]>; deleteFirewallPolicy(request: protos.google.cloud.recaptchaenterprise.v1.IDeleteFirewallPolicyRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.recaptchaenterprise.v1.IDeleteFirewallPolicyRequest | null | undefined, {} | null | undefined>): void; deleteFirewallPolicy(request: protos.google.cloud.recaptchaenterprise.v1.IDeleteFirewallPolicyRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.recaptchaenterprise.v1.IDeleteFirewallPolicyRequest | null | undefined, {} | null | undefined>): void; /** * Reorders all firewall policies. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The name of the project to list the policies for, in the format * `projects/{project}`. * @param {string[]} request.names * Required. A list containing all policy names, in the new order. Each name * is in the format `projects/{project}/firewallpolicies/{firewallpolicy}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.recaptchaenterprise.v1.ReorderFirewallPoliciesResponse|ReorderFirewallPoliciesResponse}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/recaptcha_enterprise_service.reorder_firewall_policies.js</caption> * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ReorderFirewallPolicies_async */ reorderFirewallPolicies(request?: protos.google.cloud.recaptchaenterprise.v1.IReorderFirewallPoliciesRequest, options?: CallOptions): Promise<[ protos.google.cloud.recaptchaenterprise.v1.IReorderFirewallPoliciesResponse, (protos.google.cloud.recaptchaenterprise.v1.IReorderFirewallPoliciesRequest | undefined), {} | undefined ]>; reorderFirewallPolicies(request: protos.google.cloud.recaptchaenterprise.v1.IReorderFirewallPoliciesRequest, options: CallOptions, callback: Callback<protos.google.cloud.recaptchaenterprise.v1.IReorderFirewallPoliciesResponse, protos.google.cloud.recaptchaenterprise.v1.IReorderFirewallPoliciesRequest | null | undefined, {} | null | undefined>): void; reorderFirewallPolicies(request: protos.google.cloud.recaptchaenterprise.v1.IReorderFirewallPoliciesRequest, callback: Callback<protos.google.cloud.recaptchaenterprise.v1.IReorderFirewallPoliciesResponse, protos.google.cloud.recaptchaenterprise.v1.IReorderFirewallPoliciesRequest | null | undefined, {} | null | undefined>): void; /** * Returns the list of all keys that belong to a project. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The name of the project that contains the keys that is * listed, in the format `projects/{project}`. * @param {number} [request.pageSize] * Optional. The maximum number of keys to return. Default is 10. Max limit is * 1000. * @param {string} [request.pageToken] * Optional. The next_page_token value returned from a previous. * ListKeysRequest, if any. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of {@link protos.google.cloud.recaptchaenterprise.v1.Key|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ 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 ]>; 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; 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; /** * Equivalent to `listKeys`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The name of the project that contains the keys that is * listed, in the format `projects/{project}`. * @param {number} [request.pageSize] * Optional. The maximum number of keys to return. Default is 10. Max limit is * 1000. * @param {string} [request.pageToken] * Optional. The next_page_token value returned from a previous. * ListKeysRequest, if any. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing {@link protos.google.cloud.recaptchaenterprise.v1.Key|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listKeysStream(request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, options?: CallOptions): Transform; /** * Equivalent to `listKeys`, but returns an iterable object. * * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The name of the project that contains the keys that is * listed, in the format `projects/{project}`. * @param {number} [request.pageSize] * Optional. The maximum number of keys to return. Default is 10. Max limit is * 1000. * @param {string} [request.pageToken] * Optional. The next_page_token value returned from a previous. * ListKeysRequest, if any. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. * When you iterate the returned iterable, each element will be an object representing * {@link protos.google.cloud.recaptchaenterprise.v1.Key|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. * @example <caption>include:samples/generated/v1/recaptcha_enterprise_service.list_keys.js</caption> * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListKeys_async */ listKeysAsync(request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.recaptchaenterprise.v1.IKey>; /** * Lists all IP overrides for a key. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The parent key for which the IP overrides are listed, in the * format `projects/{project}/keys/{key}`. * @param {number} [request.pageSize] * Optional. The maximum number of overrides to return. Default is 10. Max * limit is 100. If the number of overrides is less than the page_size, all * overrides are returned. If the page size is more than 100, it is coerced to * 100. * @param {string} [request.pageToken] * Optional. The next_page_token value returned from a previous * ListIpOverridesRequest, if any. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of {@link protos.google.cloud.recaptchaenterprise.v1.IpOverrideData|IpOverrideData}. * 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 `listIpOverridesAsync()` * method described below for async iteration which you can stop as needed. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listIpOverrides(request?: protos.google.cloud.recaptchaenterprise.v1.IListIpOverridesRequest, options?: CallOptions): Promise<[ protos.google.cloud.recaptchaenterprise.v1.IIpOverrideData[], protos.google.cloud.recaptchaenterprise.v1.IListIpOverridesRequest | null, protos.google.cloud.recaptchaenterprise.v1.IListIpOverridesResponse ]>; listIpOverrides(request: protos.google.cloud.recaptchaenterprise.v1.IListIpOverridesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.recaptchaenterprise.v1.IListIpOverridesRequest, proto