From 54a540d06e982dc09f63673fd7e0a04ddcfc95e1 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 12 Dec 2022 20:10:16 +0000 Subject: [PATCH] feat: add account_verification field to Assessment for MFA (#3709) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 493691493 Source-Link: https://togithub.com/googleapis/googleapis/commit/c9560d8f8f535936baff1fcda1f12806e38f67b9 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/ec825c8ef9987b67d43dfffab50914e032275d63 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJlY2FwdGNoYWVudGVycHJpc2UvLk93bEJvdC55YW1sIiwiaCI6ImVjODI1YzhlZjk5ODdiNjdkNDNkZmZmYWI1MDkxNGUwMzIyNzVkNjMifQ== --- .../v1/recaptchaenterprise.proto | 253 ++++-- .../protos/protos.d.ts | 274 ++++++ .../protos/protos.js | 787 +++++++++++++++++- .../protos/protos.json | 96 +++ ..._enterprise_service.annotate_assessment.js | 9 +- ....list_related_account_group_memberships.js | 11 +- ...ise_service.list_related_account_groups.js | 15 +- ...ecaptcha_enterprise_service.migrate_key.js | 11 + ...rise_service.retrieve_legacy_secret_key.js | 4 +- ...earch_related_account_group_memberships.js | 18 +- ...recaptcha_enterprise_service.update_key.js | 4 +- ...a.google.cloud.recaptchaenterprise.v1.json | 12 +- .../v1/recaptcha_enterprise_service_client.ts | 161 ++-- ...tcha_enterprise_service_v1_beta1_client.ts | 3 + 14 files changed, 1476 insertions(+), 182 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto index 9376f342ce5..12e5852d50c 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto +++ b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto @@ -36,7 +36,8 @@ option ruby_package = "Google::Cloud::RecaptchaEnterprise::V1"; // Service to determine the likelihood an event is legitimate. service RecaptchaEnterpriseService { option (google.api.default_host) = "recaptchaenterprise.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; // Creates an Assessment of the likelihood an event is legitimate. rpc CreateAssessment(CreateAssessmentRequest) returns (Assessment) { @@ -49,7 +50,8 @@ service RecaptchaEnterpriseService { // Annotates a previously created Assessment to provide additional information // on whether the event turned out to be authentic or fraudulent. - rpc AnnotateAssessment(AnnotateAssessmentRequest) returns (AnnotateAssessmentResponse) { + rpc AnnotateAssessment(AnnotateAssessmentRequest) + returns (AnnotateAssessmentResponse) { option (google.api.http) = { post: "/v1/{name=projects/*/assessments/*}:annotate" body: "*" @@ -75,7 +77,8 @@ service RecaptchaEnterpriseService { // 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. - rpc RetrieveLegacySecretKey(RetrieveLegacySecretKeyRequest) returns (RetrieveLegacySecretKeyResponse) { + rpc RetrieveLegacySecretKey(RetrieveLegacySecretKeyRequest) + returns (RetrieveLegacySecretKeyResponse) { option (google.api.http) = { get: "/v1/{key=projects/*/keys/*}:retrieveLegacySecretKey" }; @@ -127,7 +130,8 @@ service RecaptchaEnterpriseService { } // List groups of related accounts. - rpc ListRelatedAccountGroups(ListRelatedAccountGroupsRequest) returns (ListRelatedAccountGroupsResponse) { + rpc ListRelatedAccountGroups(ListRelatedAccountGroupsRequest) + returns (ListRelatedAccountGroupsResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*}/relatedaccountgroups" }; @@ -135,7 +139,9 @@ service RecaptchaEnterpriseService { } // Get memberships in a group of related accounts. - rpc ListRelatedAccountGroupMemberships(ListRelatedAccountGroupMembershipsRequest) returns (ListRelatedAccountGroupMembershipsResponse) { + rpc ListRelatedAccountGroupMemberships( + ListRelatedAccountGroupMembershipsRequest) + returns (ListRelatedAccountGroupMembershipsResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/relatedaccountgroups/*}/memberships" }; @@ -143,7 +149,9 @@ service RecaptchaEnterpriseService { } // Search group memberships related to a given account. - rpc SearchRelatedAccountGroupMemberships(SearchRelatedAccountGroupMembershipsRequest) returns (SearchRelatedAccountGroupMembershipsResponse) { + rpc SearchRelatedAccountGroupMemberships( + SearchRelatedAccountGroupMembershipsRequest) + returns (SearchRelatedAccountGroupMembershipsResponse) { option (google.api.http) = { post: "/v1/{project=projects/*}/relatedaccountgroupmemberships:search" body: "*" @@ -265,12 +273,13 @@ message AnnotateAssessmentRequest { } ]; - // 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. + // 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. Annotation annotation = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Optional reasons for the annotation that will be assigned to the Event. + // Optional. Optional reasons for the annotation that will be assigned to the + // Event. repeated Reason reasons = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. Unique stable hashed user identifier to apply to the assessment. @@ -282,30 +291,114 @@ message AnnotateAssessmentRequest { } // Empty response for AnnotateAssessment. -message AnnotateAssessmentResponse { +message AnnotateAssessmentResponse {} +// Information about a verification endpoint that can be used for 2FA. +message EndpointVerificationInfo { + oneof endpoint { + // Email address for which to trigger a verification request. + string email_address = 1; + + // Phone number for which to trigger a verification request. Should be given + // in E.164 format. + string phone_number = 2; + } + + // Output only. Token to provide to the client to trigger endpoint + // verification. It must be used within 15 minutes. + string request_token = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp of the last successful verification for the + // endpoint, if any. + google.protobuf.Timestamp last_verification_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Information about account verification, used for identity verification. +message AccountVerificationInfo { + // Result of the account verification as contained in the verdict token issued + // at the end of the verification flow. + enum Result { + // No information about the latest account verification. + RESULT_UNSPECIFIED = 0; + + // The user was successfully verified. This means the account verification + // challenge was successfully completed. + SUCCESS_USER_VERIFIED = 1; + + // The user failed the verification challenge. + ERROR_USER_NOT_VERIFIED = 2; + + // The site is not properly onboarded to use the account verification + // feature. + ERROR_SITE_ONBOARDING_INCOMPLETE = 3; + + // The recipient is not allowed for account verification. This can occur + // during integration but should not occur in production. + ERROR_RECIPIENT_NOT_ALLOWED = 4; + + // The recipient has already been sent too many verification codes in a + // short amount of time. + ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED = 5; + + // The verification flow could not be completed due to a critical internal + // error. + ERROR_CRITICAL_INTERNAL = 6; + + // The client has exceeded their two factor request quota for this period of + // time. + ERROR_CUSTOMER_QUOTA_EXHAUSTED = 7; + + // The request cannot be processed at the time because of an incident. This + // bypass can be restricted to a problematic destination email domain, a + // customer, or could affect the entire service. + ERROR_VERIFICATION_BYPASSED = 8; + + // The request parameters do not match with the token provided and cannot be + // processed. + ERROR_VERDICT_MISMATCH = 9; + } + + // Endpoints that can be used for identity verification. + repeated EndpointVerificationInfo endpoints = 1; + + // Language code preference for the verification message, set as a IETF BCP 47 + // language code. + string language_code = 3; + + // Output only. Result of the latest account verification challenge. + Result latest_verification_result = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Username of the account that is being verified. Deprecated. Customers + // should now provide the hashed account ID field in Event. + string username = 2 [deprecated = true]; } // Private password leak verification info. message PrivatePasswordLeakVerification { - // Optional. Exactly 26-bit prefix of the SHA-256 hash of the canonicalized username. It - // is used to look up password leaks associated with that hash prefix. + // Optional. Exactly 26-bit prefix of the SHA-256 hash of the canonicalized + // username. It is used to look up password leaks associated with that hash + // prefix. bytes lookup_hash_prefix = 1 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Encrypted Scrypt hash of the canonicalized username+password. It is - // re-encrypted by the server and returned through + // Optional. Encrypted Scrypt hash of the canonicalized username+password. It + // is re-encrypted by the server and returned through // `reencrypted_user_credentials_hash`. - bytes encrypted_user_credentials_hash = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. List of prefixes of the encrypted potential password leaks that matched the - // given parameters. They must be compared with the client-side decryption - // prefix of `reencrypted_user_credentials_hash` - repeated bytes encrypted_leak_match_prefixes = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Corresponds to the re-encryption of the `encrypted_user_credentials_hash` - // field. It is used to match potential password leaks within - // `encrypted_leak_match_prefixes`. - bytes reencrypted_user_credentials_hash = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + bytes encrypted_user_credentials_hash = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. List of prefixes of the encrypted potential password leaks + // that matched the given parameters. They must be compared with the + // client-side decryption prefix of `reencrypted_user_credentials_hash` + repeated bytes encrypted_leak_match_prefixes = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Corresponds to the re-encryption of the + // `encrypted_user_credentials_hash` field. It is used to match potential + // password leaks within `encrypted_leak_match_prefixes`. + bytes reencrypted_user_credentials_hash = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // A recaptcha assessment resource. @@ -326,7 +419,12 @@ message Assessment { RiskAnalysis risk_analysis = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Properties of the provided event token. - TokenProperties token_properties = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + TokenProperties token_properties = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Account verification information for identity verification. The assessment + // event must include a token and site key to use this feature. + AccountVerificationInfo account_verification = 5; // Assessment returned by account defender when a hashed_account_id is // provided. @@ -338,28 +436,29 @@ message Assessment { } message Event { - // Optional. The user response token provided by the reCAPTCHA client-side integration - // on your site. + // Optional. The user response token provided by the reCAPTCHA client-side + // integration on your site. string token = 1 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The site key that was used to invoke reCAPTCHA on your site and generate - // the token. + // Optional. The site key that was used to invoke reCAPTCHA on your site and + // generate the token. string site_key = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The user agent present in the request from the user's device related to - // this event. + // Optional. The user agent present in the request from the user's device + // related to this event. string user_agent = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The IP address in the request from the user's device related to this event. + // Optional. The IP address in the request from the user's device related to + // this event. string user_ip_address = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The expected action for this type of event. This should be the same action - // provided at token generation time on client-side platforms already - // integrated with recaptcha enterprise. + // Optional. The expected action for this type of event. This should be the + // same action provided at token generation time on client-side platforms + // already integrated with recaptcha enterprise. string expected_action = 5 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Unique stable hashed user identifier for the request. The identifier must - // be hashed using hmac-sha256 with stable secret. + // Optional. Unique stable hashed user identifier for the request. The + // identifier must be hashed using hmac-sha256 with stable secret. bytes hashed_account_id = 6 [(google.api.field_behavior) = OPTIONAL]; } @@ -439,6 +538,14 @@ message TokenProperties { // The hostname of the page on which the token was generated (Web keys only). string hostname = 4; + // The name of the Android package with which the token was generated (Android + // keys only). + string android_package_name = 8; + + // The ID of the iOS bundle with which the token was generated (iOS keys + // only). + string ios_bundle_id = 9; + // Action name provided at token generation. string action = 5; } @@ -518,8 +625,8 @@ message ListKeysResponse { // The retrieve legacy secret key request message. message RetrieveLegacySecretKeyRequest { - // Required. The public key name linked to the requested secret key in the format - // "projects/{project}/keys/{key}". + // Required. The public key name linked to the requested secret key in the + // format "projects/{project}/keys/{key}". string key = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -545,9 +652,10 @@ message UpdateKeyRequest { // Required. The key to update. Key key = 1 [(google.api.field_behavior) = REQUIRED]; - // Optional. The mask to control which fields of the key get updated. If the mask is not - // present, all fields will be updated. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; + // Optional. The mask to control which fields of the key get updated. If the + // mask is not present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; } // The delete key request message. @@ -572,6 +680,16 @@ message MigrateKeyRequest { type: "recaptchaenterprise.googleapis.com/Key" } ]; + + // 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-enterprise/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-enterprise/docs/billing-information. + bool skip_billing_check = 2 [(google.api.field_behavior) = OPTIONAL]; } // The get metrics request message. @@ -785,7 +903,6 @@ message ScoreMetrics { // Action-based metrics. The map key is the action name which specified by the // site owners at time of the "execute" client-side call. - // Populated only for SCORE keys. map action_metrics = 2; } @@ -819,14 +936,13 @@ message ListRelatedAccountGroupMembershipsRequest { } ]; - // 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. + // 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. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A page token, received from a previous `ListRelatedAccountGroupMemberships` - // call. + // 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 @@ -846,8 +962,8 @@ message ListRelatedAccountGroupMembershipsResponse { // The request message to list related account groups. message ListRelatedAccountGroupsRequest { - // Required. The name of the project to list related account groups from, in the format - // "projects/{project}". + // Required. The name of the project to list related account groups from, in + // the format "projects/{project}". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -855,14 +971,13 @@ message ListRelatedAccountGroupsRequest { } ]; - // 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. + // 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. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A page token, received from a previous `ListRelatedAccountGroups` call. - // Provide this to retrieve the subsequent page. + // 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 @@ -882,8 +997,9 @@ message ListRelatedAccountGroupsResponse { // The request message to search related account group memberships. message SearchRelatedAccountGroupMembershipsRequest { - // Required. The name of the project to search related account group memberships from. - // Specify the project name in the following format: "projects/{project}". + // Required. The name of the project to search related account group + // memberships from. Specify the project name in the following format: + // "projects/{project}". string project = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -891,15 +1007,14 @@ message SearchRelatedAccountGroupMembershipsRequest { } ]; - // 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. + // 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. bytes hashed_account_id = 2 [(google.api.field_behavior) = OPTIONAL]; - // 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. + // 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. int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. A page token, received from a previous @@ -995,4 +1110,4 @@ message WafSettings { // Required. The WAF feature for which this key is enabled. WafFeature waf_feature = 2 [(google.api.field_behavior) = REQUIRED]; -} +} \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index 819d15cf6a6..9982f333e22 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -663,6 +663,256 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an EndpointVerificationInfo. */ + interface IEndpointVerificationInfo { + + /** EndpointVerificationInfo emailAddress */ + emailAddress?: (string|null); + + /** EndpointVerificationInfo phoneNumber */ + phoneNumber?: (string|null); + + /** EndpointVerificationInfo requestToken */ + requestToken?: (string|null); + + /** EndpointVerificationInfo lastVerificationTime */ + lastVerificationTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an EndpointVerificationInfo. */ + class EndpointVerificationInfo implements IEndpointVerificationInfo { + + /** + * Constructs a new EndpointVerificationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IEndpointVerificationInfo); + + /** EndpointVerificationInfo emailAddress. */ + public emailAddress?: (string|null); + + /** EndpointVerificationInfo phoneNumber. */ + public phoneNumber?: (string|null); + + /** EndpointVerificationInfo requestToken. */ + public requestToken: string; + + /** EndpointVerificationInfo lastVerificationTime. */ + public lastVerificationTime?: (google.protobuf.ITimestamp|null); + + /** EndpointVerificationInfo endpoint. */ + public endpoint?: ("emailAddress"|"phoneNumber"); + + /** + * Creates a new EndpointVerificationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns EndpointVerificationInfo instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IEndpointVerificationInfo): google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo; + + /** + * Encodes the specified EndpointVerificationInfo message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo.verify|verify} messages. + * @param message EndpointVerificationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IEndpointVerificationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EndpointVerificationInfo message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo.verify|verify} messages. + * @param message EndpointVerificationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IEndpointVerificationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EndpointVerificationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EndpointVerificationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo; + + /** + * Decodes an EndpointVerificationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EndpointVerificationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo; + + /** + * Verifies an EndpointVerificationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EndpointVerificationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EndpointVerificationInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo; + + /** + * Creates a plain object from an EndpointVerificationInfo message. Also converts values to other types if specified. + * @param message EndpointVerificationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EndpointVerificationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EndpointVerificationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountVerificationInfo. */ + interface IAccountVerificationInfo { + + /** AccountVerificationInfo endpoints */ + endpoints?: (google.cloud.recaptchaenterprise.v1.IEndpointVerificationInfo[]|null); + + /** AccountVerificationInfo languageCode */ + languageCode?: (string|null); + + /** AccountVerificationInfo latestVerificationResult */ + latestVerificationResult?: (google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.Result|keyof typeof google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.Result|null); + + /** AccountVerificationInfo username */ + username?: (string|null); + } + + /** Represents an AccountVerificationInfo. */ + class AccountVerificationInfo implements IAccountVerificationInfo { + + /** + * Constructs a new AccountVerificationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IAccountVerificationInfo); + + /** AccountVerificationInfo endpoints. */ + public endpoints: google.cloud.recaptchaenterprise.v1.IEndpointVerificationInfo[]; + + /** AccountVerificationInfo languageCode. */ + public languageCode: string; + + /** AccountVerificationInfo latestVerificationResult. */ + public latestVerificationResult: (google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.Result|keyof typeof google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.Result); + + /** AccountVerificationInfo username. */ + public username: string; + + /** + * Creates a new AccountVerificationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountVerificationInfo instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IAccountVerificationInfo): google.cloud.recaptchaenterprise.v1.AccountVerificationInfo; + + /** + * Encodes the specified AccountVerificationInfo message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.verify|verify} messages. + * @param message AccountVerificationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IAccountVerificationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccountVerificationInfo message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.verify|verify} messages. + * @param message AccountVerificationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IAccountVerificationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountVerificationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccountVerificationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.AccountVerificationInfo; + + /** + * Decodes an AccountVerificationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccountVerificationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.AccountVerificationInfo; + + /** + * Verifies an AccountVerificationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccountVerificationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccountVerificationInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.AccountVerificationInfo; + + /** + * Creates a plain object from an AccountVerificationInfo message. Also converts values to other types if specified. + * @param message AccountVerificationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.AccountVerificationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccountVerificationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccountVerificationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AccountVerificationInfo { + + /** Result enum. */ + enum Result { + RESULT_UNSPECIFIED = 0, + SUCCESS_USER_VERIFIED = 1, + ERROR_USER_NOT_VERIFIED = 2, + ERROR_SITE_ONBOARDING_INCOMPLETE = 3, + ERROR_RECIPIENT_NOT_ALLOWED = 4, + ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED = 5, + ERROR_CRITICAL_INTERNAL = 6, + ERROR_CUSTOMER_QUOTA_EXHAUSTED = 7, + ERROR_VERIFICATION_BYPASSED = 8, + ERROR_VERDICT_MISMATCH = 9 + } + } + /** Properties of a PrivatePasswordLeakVerification. */ interface IPrivatePasswordLeakVerification { @@ -793,6 +1043,9 @@ export namespace google { /** Assessment tokenProperties */ tokenProperties?: (google.cloud.recaptchaenterprise.v1.ITokenProperties|null); + /** Assessment accountVerification */ + accountVerification?: (google.cloud.recaptchaenterprise.v1.IAccountVerificationInfo|null); + /** Assessment accountDefenderAssessment */ accountDefenderAssessment?: (google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment|null); @@ -821,6 +1074,9 @@ export namespace google { /** Assessment tokenProperties. */ public tokenProperties?: (google.cloud.recaptchaenterprise.v1.ITokenProperties|null); + /** Assessment accountVerification. */ + public accountVerification?: (google.cloud.recaptchaenterprise.v1.IAccountVerificationInfo|null); + /** Assessment accountDefenderAssessment. */ public accountDefenderAssessment?: (google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment|null); @@ -1163,6 +1419,12 @@ export namespace google { /** TokenProperties hostname */ hostname?: (string|null); + /** TokenProperties androidPackageName */ + androidPackageName?: (string|null); + + /** TokenProperties iosBundleId */ + iosBundleId?: (string|null); + /** TokenProperties action */ action?: (string|null); } @@ -1188,6 +1450,12 @@ export namespace google { /** TokenProperties hostname. */ public hostname: string; + /** TokenProperties androidPackageName. */ + public androidPackageName: string; + + /** TokenProperties iosBundleId. */ + public iosBundleId: string; + /** TokenProperties action. */ public action: string; @@ -2106,6 +2374,9 @@ export namespace google { /** MigrateKeyRequest name */ name?: (string|null); + + /** MigrateKeyRequest skipBillingCheck */ + skipBillingCheck?: (boolean|null); } /** Represents a MigrateKeyRequest. */ @@ -2120,6 +2391,9 @@ export namespace google { /** MigrateKeyRequest name. */ public name: string; + /** MigrateKeyRequest skipBillingCheck. */ + public skipBillingCheck: boolean; + /** * Creates a new MigrateKeyRequest instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index 479c0761672..d4af4552589 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -1422,6 +1422,693 @@ return AnnotateAssessmentResponse; })(); + v1.EndpointVerificationInfo = (function() { + + /** + * Properties of an EndpointVerificationInfo. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IEndpointVerificationInfo + * @property {string|null} [emailAddress] EndpointVerificationInfo emailAddress + * @property {string|null} [phoneNumber] EndpointVerificationInfo phoneNumber + * @property {string|null} [requestToken] EndpointVerificationInfo requestToken + * @property {google.protobuf.ITimestamp|null} [lastVerificationTime] EndpointVerificationInfo lastVerificationTime + */ + + /** + * Constructs a new EndpointVerificationInfo. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents an EndpointVerificationInfo. + * @implements IEndpointVerificationInfo + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IEndpointVerificationInfo=} [properties] Properties to set + */ + function EndpointVerificationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EndpointVerificationInfo emailAddress. + * @member {string|null|undefined} emailAddress + * @memberof google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo + * @instance + */ + EndpointVerificationInfo.prototype.emailAddress = null; + + /** + * EndpointVerificationInfo phoneNumber. + * @member {string|null|undefined} phoneNumber + * @memberof google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo + * @instance + */ + EndpointVerificationInfo.prototype.phoneNumber = null; + + /** + * EndpointVerificationInfo requestToken. + * @member {string} requestToken + * @memberof google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo + * @instance + */ + EndpointVerificationInfo.prototype.requestToken = ""; + + /** + * EndpointVerificationInfo lastVerificationTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastVerificationTime + * @memberof google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo + * @instance + */ + EndpointVerificationInfo.prototype.lastVerificationTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EndpointVerificationInfo endpoint. + * @member {"emailAddress"|"phoneNumber"|undefined} endpoint + * @memberof google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo + * @instance + */ + Object.defineProperty(EndpointVerificationInfo.prototype, "endpoint", { + get: $util.oneOfGetter($oneOfFields = ["emailAddress", "phoneNumber"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EndpointVerificationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo + * @static + * @param {google.cloud.recaptchaenterprise.v1.IEndpointVerificationInfo=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo} EndpointVerificationInfo instance + */ + EndpointVerificationInfo.create = function create(properties) { + return new EndpointVerificationInfo(properties); + }; + + /** + * Encodes the specified EndpointVerificationInfo message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo + * @static + * @param {google.cloud.recaptchaenterprise.v1.IEndpointVerificationInfo} message EndpointVerificationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndpointVerificationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.emailAddress != null && Object.hasOwnProperty.call(message, "emailAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.emailAddress); + if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.phoneNumber); + if (message.requestToken != null && Object.hasOwnProperty.call(message, "requestToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestToken); + if (message.lastVerificationTime != null && Object.hasOwnProperty.call(message, "lastVerificationTime")) + $root.google.protobuf.Timestamp.encode(message.lastVerificationTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EndpointVerificationInfo message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo + * @static + * @param {google.cloud.recaptchaenterprise.v1.IEndpointVerificationInfo} message EndpointVerificationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndpointVerificationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EndpointVerificationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo} EndpointVerificationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndpointVerificationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.emailAddress = reader.string(); + break; + } + case 2: { + message.phoneNumber = reader.string(); + break; + } + case 3: { + message.requestToken = reader.string(); + break; + } + case 4: { + message.lastVerificationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EndpointVerificationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo} EndpointVerificationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndpointVerificationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EndpointVerificationInfo message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EndpointVerificationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.emailAddress != null && message.hasOwnProperty("emailAddress")) { + properties.endpoint = 1; + if (!$util.isString(message.emailAddress)) + return "emailAddress: string expected"; + } + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) { + if (properties.endpoint === 1) + return "endpoint: multiple values"; + properties.endpoint = 1; + if (!$util.isString(message.phoneNumber)) + return "phoneNumber: string expected"; + } + if (message.requestToken != null && message.hasOwnProperty("requestToken")) + if (!$util.isString(message.requestToken)) + return "requestToken: string expected"; + if (message.lastVerificationTime != null && message.hasOwnProperty("lastVerificationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastVerificationTime); + if (error) + return "lastVerificationTime." + error; + } + return null; + }; + + /** + * Creates an EndpointVerificationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo} EndpointVerificationInfo + */ + EndpointVerificationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo(); + if (object.emailAddress != null) + message.emailAddress = String(object.emailAddress); + if (object.phoneNumber != null) + message.phoneNumber = String(object.phoneNumber); + if (object.requestToken != null) + message.requestToken = String(object.requestToken); + if (object.lastVerificationTime != null) { + if (typeof object.lastVerificationTime !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo.lastVerificationTime: object expected"); + message.lastVerificationTime = $root.google.protobuf.Timestamp.fromObject(object.lastVerificationTime); + } + return message; + }; + + /** + * Creates a plain object from an EndpointVerificationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo + * @static + * @param {google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo} message EndpointVerificationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EndpointVerificationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.requestToken = ""; + object.lastVerificationTime = null; + } + if (message.emailAddress != null && message.hasOwnProperty("emailAddress")) { + object.emailAddress = message.emailAddress; + if (options.oneofs) + object.endpoint = "emailAddress"; + } + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) { + object.phoneNumber = message.phoneNumber; + if (options.oneofs) + object.endpoint = "phoneNumber"; + } + if (message.requestToken != null && message.hasOwnProperty("requestToken")) + object.requestToken = message.requestToken; + if (message.lastVerificationTime != null && message.hasOwnProperty("lastVerificationTime")) + object.lastVerificationTime = $root.google.protobuf.Timestamp.toObject(message.lastVerificationTime, options); + return object; + }; + + /** + * Converts this EndpointVerificationInfo to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo + * @instance + * @returns {Object.} JSON object + */ + EndpointVerificationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EndpointVerificationInfo + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EndpointVerificationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo"; + }; + + return EndpointVerificationInfo; + })(); + + v1.AccountVerificationInfo = (function() { + + /** + * Properties of an AccountVerificationInfo. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IAccountVerificationInfo + * @property {Array.|null} [endpoints] AccountVerificationInfo endpoints + * @property {string|null} [languageCode] AccountVerificationInfo languageCode + * @property {google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.Result|null} [latestVerificationResult] AccountVerificationInfo latestVerificationResult + * @property {string|null} [username] AccountVerificationInfo username + */ + + /** + * Constructs a new AccountVerificationInfo. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents an AccountVerificationInfo. + * @implements IAccountVerificationInfo + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IAccountVerificationInfo=} [properties] Properties to set + */ + function AccountVerificationInfo(properties) { + this.endpoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccountVerificationInfo endpoints. + * @member {Array.} endpoints + * @memberof google.cloud.recaptchaenterprise.v1.AccountVerificationInfo + * @instance + */ + AccountVerificationInfo.prototype.endpoints = $util.emptyArray; + + /** + * AccountVerificationInfo languageCode. + * @member {string} languageCode + * @memberof google.cloud.recaptchaenterprise.v1.AccountVerificationInfo + * @instance + */ + AccountVerificationInfo.prototype.languageCode = ""; + + /** + * AccountVerificationInfo latestVerificationResult. + * @member {google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.Result} latestVerificationResult + * @memberof google.cloud.recaptchaenterprise.v1.AccountVerificationInfo + * @instance + */ + AccountVerificationInfo.prototype.latestVerificationResult = 0; + + /** + * AccountVerificationInfo username. + * @member {string} username + * @memberof google.cloud.recaptchaenterprise.v1.AccountVerificationInfo + * @instance + */ + AccountVerificationInfo.prototype.username = ""; + + /** + * Creates a new AccountVerificationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.AccountVerificationInfo + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAccountVerificationInfo=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.AccountVerificationInfo} AccountVerificationInfo instance + */ + AccountVerificationInfo.create = function create(properties) { + return new AccountVerificationInfo(properties); + }; + + /** + * Encodes the specified AccountVerificationInfo message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.AccountVerificationInfo + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAccountVerificationInfo} message AccountVerificationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountVerificationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.endpoints != null && message.endpoints.length) + for (var i = 0; i < message.endpoints.length; ++i) + $root.google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo.encode(message.endpoints[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.username); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + if (message.latestVerificationResult != null && Object.hasOwnProperty.call(message, "latestVerificationResult")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.latestVerificationResult); + return writer; + }; + + /** + * Encodes the specified AccountVerificationInfo message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.AccountVerificationInfo + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAccountVerificationInfo} message AccountVerificationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountVerificationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccountVerificationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.AccountVerificationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.AccountVerificationInfo} AccountVerificationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountVerificationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.AccountVerificationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.endpoints && message.endpoints.length)) + message.endpoints = []; + message.endpoints.push($root.google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo.decode(reader, reader.uint32())); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + case 7: { + message.latestVerificationResult = reader.int32(); + break; + } + case 2: { + message.username = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccountVerificationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.AccountVerificationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.AccountVerificationInfo} AccountVerificationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountVerificationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccountVerificationInfo message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.AccountVerificationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccountVerificationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.endpoints != null && message.hasOwnProperty("endpoints")) { + if (!Array.isArray(message.endpoints)) + return "endpoints: array expected"; + for (var i = 0; i < message.endpoints.length; ++i) { + var error = $root.google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo.verify(message.endpoints[i]); + if (error) + return "endpoints." + error; + } + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.latestVerificationResult != null && message.hasOwnProperty("latestVerificationResult")) + switch (message.latestVerificationResult) { + default: + return "latestVerificationResult: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + return null; + }; + + /** + * Creates an AccountVerificationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.AccountVerificationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.AccountVerificationInfo} AccountVerificationInfo + */ + AccountVerificationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.AccountVerificationInfo) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.AccountVerificationInfo(); + if (object.endpoints) { + if (!Array.isArray(object.endpoints)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.endpoints: array expected"); + message.endpoints = []; + for (var i = 0; i < object.endpoints.length; ++i) { + if (typeof object.endpoints[i] !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.endpoints: object expected"); + message.endpoints[i] = $root.google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo.fromObject(object.endpoints[i]); + } + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + switch (object.latestVerificationResult) { + default: + if (typeof object.latestVerificationResult === "number") { + message.latestVerificationResult = object.latestVerificationResult; + break; + } + break; + case "RESULT_UNSPECIFIED": + case 0: + message.latestVerificationResult = 0; + break; + case "SUCCESS_USER_VERIFIED": + case 1: + message.latestVerificationResult = 1; + break; + case "ERROR_USER_NOT_VERIFIED": + case 2: + message.latestVerificationResult = 2; + break; + case "ERROR_SITE_ONBOARDING_INCOMPLETE": + case 3: + message.latestVerificationResult = 3; + break; + case "ERROR_RECIPIENT_NOT_ALLOWED": + case 4: + message.latestVerificationResult = 4; + break; + case "ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED": + case 5: + message.latestVerificationResult = 5; + break; + case "ERROR_CRITICAL_INTERNAL": + case 6: + message.latestVerificationResult = 6; + break; + case "ERROR_CUSTOMER_QUOTA_EXHAUSTED": + case 7: + message.latestVerificationResult = 7; + break; + case "ERROR_VERIFICATION_BYPASSED": + case 8: + message.latestVerificationResult = 8; + break; + case "ERROR_VERDICT_MISMATCH": + case 9: + message.latestVerificationResult = 9; + break; + } + if (object.username != null) + message.username = String(object.username); + return message; + }; + + /** + * Creates a plain object from an AccountVerificationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.AccountVerificationInfo + * @static + * @param {google.cloud.recaptchaenterprise.v1.AccountVerificationInfo} message AccountVerificationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccountVerificationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.endpoints = []; + if (options.defaults) { + object.username = ""; + object.languageCode = ""; + object.latestVerificationResult = options.enums === String ? "RESULT_UNSPECIFIED" : 0; + } + if (message.endpoints && message.endpoints.length) { + object.endpoints = []; + for (var j = 0; j < message.endpoints.length; ++j) + object.endpoints[j] = $root.google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo.toObject(message.endpoints[j], options); + } + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.latestVerificationResult != null && message.hasOwnProperty("latestVerificationResult")) + object.latestVerificationResult = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.Result[message.latestVerificationResult] === undefined ? message.latestVerificationResult : $root.google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.Result[message.latestVerificationResult] : message.latestVerificationResult; + return object; + }; + + /** + * Converts this AccountVerificationInfo to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.AccountVerificationInfo + * @instance + * @returns {Object.} JSON object + */ + AccountVerificationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccountVerificationInfo + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.AccountVerificationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountVerificationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.AccountVerificationInfo"; + }; + + /** + * Result enum. + * @name google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.Result + * @enum {number} + * @property {number} RESULT_UNSPECIFIED=0 RESULT_UNSPECIFIED value + * @property {number} SUCCESS_USER_VERIFIED=1 SUCCESS_USER_VERIFIED value + * @property {number} ERROR_USER_NOT_VERIFIED=2 ERROR_USER_NOT_VERIFIED value + * @property {number} ERROR_SITE_ONBOARDING_INCOMPLETE=3 ERROR_SITE_ONBOARDING_INCOMPLETE value + * @property {number} ERROR_RECIPIENT_NOT_ALLOWED=4 ERROR_RECIPIENT_NOT_ALLOWED value + * @property {number} ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED=5 ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED value + * @property {number} ERROR_CRITICAL_INTERNAL=6 ERROR_CRITICAL_INTERNAL value + * @property {number} ERROR_CUSTOMER_QUOTA_EXHAUSTED=7 ERROR_CUSTOMER_QUOTA_EXHAUSTED value + * @property {number} ERROR_VERIFICATION_BYPASSED=8 ERROR_VERIFICATION_BYPASSED value + * @property {number} ERROR_VERDICT_MISMATCH=9 ERROR_VERDICT_MISMATCH value + */ + AccountVerificationInfo.Result = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESULT_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUCCESS_USER_VERIFIED"] = 1; + values[valuesById[2] = "ERROR_USER_NOT_VERIFIED"] = 2; + values[valuesById[3] = "ERROR_SITE_ONBOARDING_INCOMPLETE"] = 3; + values[valuesById[4] = "ERROR_RECIPIENT_NOT_ALLOWED"] = 4; + values[valuesById[5] = "ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED"] = 5; + values[valuesById[6] = "ERROR_CRITICAL_INTERNAL"] = 6; + values[valuesById[7] = "ERROR_CUSTOMER_QUOTA_EXHAUSTED"] = 7; + values[valuesById[8] = "ERROR_VERIFICATION_BYPASSED"] = 8; + values[valuesById[9] = "ERROR_VERDICT_MISMATCH"] = 9; + return values; + })(); + + return AccountVerificationInfo; + })(); + v1.PrivatePasswordLeakVerification = (function() { /** @@ -1752,6 +2439,7 @@ * @property {google.cloud.recaptchaenterprise.v1.IEvent|null} [event] Assessment event * @property {google.cloud.recaptchaenterprise.v1.IRiskAnalysis|null} [riskAnalysis] Assessment riskAnalysis * @property {google.cloud.recaptchaenterprise.v1.ITokenProperties|null} [tokenProperties] Assessment tokenProperties + * @property {google.cloud.recaptchaenterprise.v1.IAccountVerificationInfo|null} [accountVerification] Assessment accountVerification * @property {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment|null} [accountDefenderAssessment] Assessment accountDefenderAssessment * @property {google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification|null} [privatePasswordLeakVerification] Assessment privatePasswordLeakVerification */ @@ -1803,6 +2491,14 @@ */ Assessment.prototype.tokenProperties = null; + /** + * Assessment accountVerification. + * @member {google.cloud.recaptchaenterprise.v1.IAccountVerificationInfo|null|undefined} accountVerification + * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @instance + */ + Assessment.prototype.accountVerification = null; + /** * Assessment accountDefenderAssessment. * @member {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment|null|undefined} accountDefenderAssessment @@ -1851,6 +2547,8 @@ $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.encode(message.riskAnalysis, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.tokenProperties != null && Object.hasOwnProperty.call(message, "tokenProperties")) $root.google.cloud.recaptchaenterprise.v1.TokenProperties.encode(message.tokenProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.accountVerification != null && Object.hasOwnProperty.call(message, "accountVerification")) + $root.google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.encode(message.accountVerification, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.accountDefenderAssessment != null && Object.hasOwnProperty.call(message, "accountDefenderAssessment")) $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.encode(message.accountDefenderAssessment, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.privatePasswordLeakVerification != null && Object.hasOwnProperty.call(message, "privatePasswordLeakVerification")) @@ -1905,6 +2603,10 @@ message.tokenProperties = $root.google.cloud.recaptchaenterprise.v1.TokenProperties.decode(reader, reader.uint32()); break; } + case 5: { + message.accountVerification = $root.google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.decode(reader, reader.uint32()); + break; + } case 6: { message.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.decode(reader, reader.uint32()); break; @@ -1966,6 +2668,11 @@ if (error) return "tokenProperties." + error; } + if (message.accountVerification != null && message.hasOwnProperty("accountVerification")) { + var error = $root.google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.verify(message.accountVerification); + if (error) + return "accountVerification." + error; + } if (message.accountDefenderAssessment != null && message.hasOwnProperty("accountDefenderAssessment")) { var error = $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.verify(message.accountDefenderAssessment); if (error) @@ -2008,6 +2715,11 @@ throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.tokenProperties: object expected"); message.tokenProperties = $root.google.cloud.recaptchaenterprise.v1.TokenProperties.fromObject(object.tokenProperties); } + if (object.accountVerification != null) { + if (typeof object.accountVerification !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.accountVerification: object expected"); + message.accountVerification = $root.google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.fromObject(object.accountVerification); + } if (object.accountDefenderAssessment != null) { if (typeof object.accountDefenderAssessment !== "object") throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.accountDefenderAssessment: object expected"); @@ -2039,6 +2751,7 @@ object.event = null; object.riskAnalysis = null; object.tokenProperties = null; + object.accountVerification = null; object.accountDefenderAssessment = null; object.privatePasswordLeakVerification = null; } @@ -2050,6 +2763,8 @@ object.riskAnalysis = $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.toObject(message.riskAnalysis, options); if (message.tokenProperties != null && message.hasOwnProperty("tokenProperties")) object.tokenProperties = $root.google.cloud.recaptchaenterprise.v1.TokenProperties.toObject(message.tokenProperties, options); + if (message.accountVerification != null && message.hasOwnProperty("accountVerification")) + object.accountVerification = $root.google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.toObject(message.accountVerification, options); if (message.accountDefenderAssessment != null && message.hasOwnProperty("accountDefenderAssessment")) object.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.toObject(message.accountDefenderAssessment, options); if (message.privatePasswordLeakVerification != null && message.hasOwnProperty("privatePasswordLeakVerification")) @@ -2736,6 +3451,8 @@ * @property {google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason|null} [invalidReason] TokenProperties invalidReason * @property {google.protobuf.ITimestamp|null} [createTime] TokenProperties createTime * @property {string|null} [hostname] TokenProperties hostname + * @property {string|null} [androidPackageName] TokenProperties androidPackageName + * @property {string|null} [iosBundleId] TokenProperties iosBundleId * @property {string|null} [action] TokenProperties action */ @@ -2786,6 +3503,22 @@ */ TokenProperties.prototype.hostname = ""; + /** + * TokenProperties androidPackageName. + * @member {string} androidPackageName + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @instance + */ + TokenProperties.prototype.androidPackageName = ""; + + /** + * TokenProperties iosBundleId. + * @member {string} iosBundleId + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @instance + */ + TokenProperties.prototype.iosBundleId = ""; + /** * TokenProperties action. * @member {string} action @@ -2828,6 +3561,10 @@ writer.uint32(/* id 4, wireType 2 =*/34).string(message.hostname); if (message.action != null && Object.hasOwnProperty.call(message, "action")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.action); + if (message.androidPackageName != null && Object.hasOwnProperty.call(message, "androidPackageName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.androidPackageName); + if (message.iosBundleId != null && Object.hasOwnProperty.call(message, "iosBundleId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.iosBundleId); return writer; }; @@ -2878,6 +3615,14 @@ message.hostname = reader.string(); break; } + case 8: { + message.androidPackageName = reader.string(); + break; + } + case 9: { + message.iosBundleId = reader.string(); + break; + } case 5: { message.action = reader.string(); break; @@ -2941,6 +3686,12 @@ if (message.hostname != null && message.hasOwnProperty("hostname")) if (!$util.isString(message.hostname)) return "hostname: string expected"; + if (message.androidPackageName != null && message.hasOwnProperty("androidPackageName")) + if (!$util.isString(message.androidPackageName)) + return "androidPackageName: string expected"; + if (message.iosBundleId != null && message.hasOwnProperty("iosBundleId")) + if (!$util.isString(message.iosBundleId)) + return "iosBundleId: string expected"; if (message.action != null && message.hasOwnProperty("action")) if (!$util.isString(message.action)) return "action: string expected"; @@ -3004,6 +3755,10 @@ } if (object.hostname != null) message.hostname = String(object.hostname); + if (object.androidPackageName != null) + message.androidPackageName = String(object.androidPackageName); + if (object.iosBundleId != null) + message.iosBundleId = String(object.iosBundleId); if (object.action != null) message.action = String(object.action); return message; @@ -3028,6 +3783,8 @@ object.createTime = null; object.hostname = ""; object.action = ""; + object.androidPackageName = ""; + object.iosBundleId = ""; } if (message.valid != null && message.hasOwnProperty("valid")) object.valid = message.valid; @@ -3039,6 +3796,10 @@ object.hostname = message.hostname; if (message.action != null && message.hasOwnProperty("action")) object.action = message.action; + if (message.androidPackageName != null && message.hasOwnProperty("androidPackageName")) + object.androidPackageName = message.androidPackageName; + if (message.iosBundleId != null && message.hasOwnProperty("iosBundleId")) + object.iosBundleId = message.iosBundleId; return object; }; @@ -4959,6 +5720,7 @@ * @memberof google.cloud.recaptchaenterprise.v1 * @interface IMigrateKeyRequest * @property {string|null} [name] MigrateKeyRequest name + * @property {boolean|null} [skipBillingCheck] MigrateKeyRequest skipBillingCheck */ /** @@ -4984,6 +5746,14 @@ */ MigrateKeyRequest.prototype.name = ""; + /** + * MigrateKeyRequest skipBillingCheck. + * @member {boolean} skipBillingCheck + * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest + * @instance + */ + MigrateKeyRequest.prototype.skipBillingCheck = false; + /** * Creates a new MigrateKeyRequest instance using the specified properties. * @function create @@ -5010,6 +5780,8 @@ writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.skipBillingCheck != null && Object.hasOwnProperty.call(message, "skipBillingCheck")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.skipBillingCheck); return writer; }; @@ -5048,6 +5820,10 @@ message.name = reader.string(); break; } + case 2: { + message.skipBillingCheck = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -5086,6 +5862,9 @@ if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; + if (message.skipBillingCheck != null && message.hasOwnProperty("skipBillingCheck")) + if (typeof message.skipBillingCheck !== "boolean") + return "skipBillingCheck: boolean expected"; return null; }; @@ -5103,6 +5882,8 @@ var message = new $root.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest(); if (object.name != null) message.name = String(object.name); + if (object.skipBillingCheck != null) + message.skipBillingCheck = Boolean(object.skipBillingCheck); return message; }; @@ -5119,10 +5900,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.skipBillingCheck = false; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.skipBillingCheck != null && message.hasOwnProperty("skipBillingCheck")) + object.skipBillingCheck = message.skipBillingCheck; return object; }; diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index 305751757a8..30e689d5a78 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -342,6 +342,83 @@ "AnnotateAssessmentResponse": { "fields": {} }, + "EndpointVerificationInfo": { + "oneofs": { + "endpoint": { + "oneof": [ + "emailAddress", + "phoneNumber" + ] + } + }, + "fields": { + "emailAddress": { + "type": "string", + "id": 1 + }, + "phoneNumber": { + "type": "string", + "id": 2 + }, + "requestToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastVerificationTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "AccountVerificationInfo": { + "fields": { + "endpoints": { + "rule": "repeated", + "type": "EndpointVerificationInfo", + "id": 1 + }, + "languageCode": { + "type": "string", + "id": 3 + }, + "latestVerificationResult": { + "type": "Result", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "username": { + "type": "string", + "id": 2, + "options": { + "deprecated": true + } + } + }, + "nested": { + "Result": { + "values": { + "RESULT_UNSPECIFIED": 0, + "SUCCESS_USER_VERIFIED": 1, + "ERROR_USER_NOT_VERIFIED": 2, + "ERROR_SITE_ONBOARDING_INCOMPLETE": 3, + "ERROR_RECIPIENT_NOT_ALLOWED": 4, + "ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED": 5, + "ERROR_CRITICAL_INTERNAL": 6, + "ERROR_CUSTOMER_QUOTA_EXHAUSTED": 7, + "ERROR_VERIFICATION_BYPASSED": 8, + "ERROR_VERDICT_MISMATCH": 9 + } + } + } + }, "PrivatePasswordLeakVerification": { "fields": { "lookupHashPrefix": { @@ -406,6 +483,10 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, + "accountVerification": { + "type": "AccountVerificationInfo", + "id": 5 + }, "accountDefenderAssessment": { "type": "AccountDefenderAssessment", "id": 6 @@ -505,6 +586,14 @@ "type": "string", "id": 4 }, + "androidPackageName": { + "type": "string", + "id": 8 + }, + "iosBundleId": { + "type": "string", + "id": 9 + }, "action": { "type": "string", "id": 5 @@ -665,6 +754,13 @@ "(google.api.field_behavior)": "REQUIRED", "(google.api.resource_reference).type": "recaptchaenterprise.googleapis.com/Key" } + }, + "skipBillingCheck": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js index 24146c3cd7d..04fb366c8fa 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js @@ -34,13 +34,14 @@ function main(name) { */ // 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. + * 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. + * Optional. Optional reasons for the annotation that will be assigned to the + * Event. */ // const reasons = 1234 /** diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js index 097f294ce3c..523c80763c4 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js @@ -34,15 +34,14 @@ function main(parent) { */ // 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. + * 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. + * 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. diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js index 9be614706a0..d5edb77984c 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js @@ -29,20 +29,19 @@ function main(parent) { * 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}". + * 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. + * 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. + * 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. diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js index 7437784d6db..108ddc86c4e 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js @@ -33,6 +33,17 @@ function main(name) { * "projects/{project}/keys/{key}". */ // const name = 'abc123' + /** + * 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-enterprise/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-enterprise/docs/billing-information. + */ + // const skipBillingCheck = true // Imports the Recaptchaenterprise library const {RecaptchaEnterpriseServiceClient} = require('@google-cloud/recaptcha-enterprise').v1; diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.retrieve_legacy_secret_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.retrieve_legacy_secret_key.js index 95cb5eb22e9..f3575ba3070 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.retrieve_legacy_secret_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.retrieve_legacy_secret_key.js @@ -29,8 +29,8 @@ function main(key) { * 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}". + * Required. The public key name linked to the requested secret key in the + * format "projects/{project}/keys/{key}". */ // const key = 'abc123' diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js index 1e85d154cb6..81bb0b2abf0 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js @@ -29,21 +29,21 @@ function main(project) { * 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}". + * 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. + * 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. + * 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 /** diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js index b7fc0fc86cd..b50005c503d 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js @@ -33,8 +33,8 @@ function main(key) { */ // 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. + * 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 = {} diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json index 8084719b40d..b4321984c71 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json @@ -66,7 +66,7 @@ "segments": [ { "start": 25, - "end": 72, + "end": 73, "type": "FULL" } ], @@ -374,7 +374,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 65, "type": "FULL" } ], @@ -386,6 +386,10 @@ { "name": "name", "type": "TYPE_STRING" + }, + { + "name": "skip_billing_check", + "type": "TYPE_BOOL" } ], "resultType": ".google.cloud.recaptchaenterprise.v1.Key", @@ -454,7 +458,7 @@ "segments": [ { "start": 25, - "end": 71, + "end": 70, "type": "FULL" } ], @@ -502,7 +506,7 @@ "segments": [ { "start": 25, - "end": 71, + "end": 70, "type": "FULL" } ], diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index f4b28da6fb2..c292ed638c7 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -121,6 +121,9 @@ export class RecaptchaEnterpriseServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; @@ -480,11 +483,12 @@ export class RecaptchaEnterpriseServiceClient { * 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 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. + * 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. * @param {number[]} [request.reasons] - * Optional. Optional reasons for the annotation that will be assigned to the Event. + * Optional. Optional reasons for the annotation that will be assigned to the + * Event. * @param {Buffer} [request.hashedAccountId] * Optional. Unique stable hashed user identifier to apply to the assessment. * This is an alternative to setting the hashed_account_id in @@ -683,8 +687,8 @@ export class RecaptchaEnterpriseServiceClient { * @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}". + * 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. @@ -879,8 +883,8 @@ export class RecaptchaEnterpriseServiceClient { * @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 will be updated. + * Optional. The mask to control which fields of the key get updated. If the + * mask is not present, all fields will be 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. @@ -1070,6 +1074,15 @@ export class RecaptchaEnterpriseServiceClient { * @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-enterprise/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-enterprise/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. @@ -1452,16 +1465,15 @@ export class RecaptchaEnterpriseServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the project to list related account groups from, in the format - * "projects/{project}". + * Required. The name of the project to list related account groups from, in + * the format "projects/{project}". * @param {number} [request.pageSize] - * 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. + * 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. * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListRelatedAccountGroups` call. - * Provide this to retrieve the subsequent page. + * 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 @@ -1563,16 +1575,15 @@ export class RecaptchaEnterpriseServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the project to list related account groups from, in the format - * "projects/{project}". + * Required. The name of the project to list related account groups from, in + * the format "projects/{project}". * @param {number} [request.pageSize] - * 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. + * 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. * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListRelatedAccountGroups` call. - * Provide this to retrieve the subsequent page. + * 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 @@ -1618,16 +1629,15 @@ export class RecaptchaEnterpriseServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the project to list related account groups from, in the format - * "projects/{project}". + * Required. The name of the project to list related account groups from, in + * the format "projects/{project}". * @param {number} [request.pageSize] - * 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. + * 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. * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListRelatedAccountGroups` call. - * Provide this to retrieve the subsequent page. + * 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 @@ -1675,13 +1685,12 @@ export class RecaptchaEnterpriseServiceClient { * Required. The resource name for the related account group in the format * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. * @param {number} [request.pageSize] - * 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. + * 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. * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListRelatedAccountGroupMemberships` - * call. + * 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 @@ -1786,13 +1795,12 @@ export class RecaptchaEnterpriseServiceClient { * Required. The resource name for the related account group in the format * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. * @param {number} [request.pageSize] - * 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. + * 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. * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListRelatedAccountGroupMemberships` - * call. + * 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 @@ -1842,13 +1850,12 @@ export class RecaptchaEnterpriseServiceClient { * Required. The resource name for the related account group in the format * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. * @param {number} [request.pageSize] - * 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. + * 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. * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListRelatedAccountGroupMemberships` - * call. + * 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 @@ -1894,17 +1901,17 @@ export class RecaptchaEnterpriseServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.project - * Required. The name of the project to search related account group memberships from. - * Specify the project name in the following format: "projects/{project}". + * Required. The name of the project to search related account group + * memberships from. Specify the project name in the following format: + * "projects/{project}". * @param {Buffer} [request.hashedAccountId] - * 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. + * 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. * @param {number} [request.pageSize] - * 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. + * 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. * @param {string} [request.pageToken] * Optional. A page token, received from a previous * `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the @@ -2010,17 +2017,17 @@ export class RecaptchaEnterpriseServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.project - * Required. The name of the project to search related account group memberships from. - * Specify the project name in the following format: "projects/{project}". + * Required. The name of the project to search related account group + * memberships from. Specify the project name in the following format: + * "projects/{project}". * @param {Buffer} [request.hashedAccountId] - * 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. + * 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. * @param {number} [request.pageSize] - * 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. + * 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. * @param {string} [request.pageToken] * Optional. A page token, received from a previous * `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the @@ -2071,17 +2078,17 @@ export class RecaptchaEnterpriseServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.project - * Required. The name of the project to search related account group memberships from. - * Specify the project name in the following format: "projects/{project}". + * Required. The name of the project to search related account group + * memberships from. Specify the project name in the following format: + * "projects/{project}". * @param {Buffer} [request.hashedAccountId] - * 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. + * 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. * @param {number} [request.pageSize] - * 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. + * 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. * @param {string} [request.pageToken] * Optional. A page token, received from a previous * `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index be347ee16e4..744ed5f3d35 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -119,6 +119,9 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes;