From d6f04cb4a1a2cb0244d72a4e3a3046e2f8413de5 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 22:06:46 -0700 Subject: [PATCH] feat: [recaptchaenterprise] add reCAPTCHA Enterprise Fraud Prevention API (#4095) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add reCAPTCHA Enterprise Fraud Prevention API This cl adds API features for Fraud Prevention including the FraudPreventionAssessment. PiperOrigin-RevId: 517166403 Source-Link: https://github.com/googleapis/googleapis/commit/5947146b488150de2f37b61091c0f90c9fb5a2f2 Source-Link: https://github.com/googleapis/googleapis-gen/commit/85b29f6a0328468b377531542633490c24f411d6 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJlY2FwdGNoYWVudGVycHJpc2UvLk93bEJvdC55YW1sIiwiaCI6Ijg1YjI5ZjZhMDMyODQ2OGIzNzc1MzE1NDI2MzM0OTBjMjRmNDExZDYifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add reCAPTCHA Enterprise Fraud Prevention API This cl adds API features for Fraud Prevention including the FraudPreventionAssessment. PiperOrigin-RevId: 517508635 Source-Link: https://github.com/googleapis/googleapis/commit/f3c3f3868ae923b6e194185909adf14a56d9754e Source-Link: https://github.com/googleapis/googleapis-gen/commit/892d5396a4232a1effe78f530ded3445d8b9bb8c Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJlY2FwdGNoYWVudGVycHJpc2UvLk93bEJvdC55YW1sIiwiaCI6Ijg5MmQ1Mzk2YTQyMzJhMWVmZmU3OGY1MzBkZWQzNDQ1ZDhiOWJiOGMifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- .../v1/recaptchaenterprise.proto | 332 +- .../v1beta1/recaptchaenterprise.proto | 422 +- .../protos/protos.d.ts | 2355 +++- .../protos/protos.js | 11523 ++++++++++++---- .../protos/protos.json | 602 +- ..._enterprise_service.annotate_assessment.js | 5 + ...a.google.cloud.recaptchaenterprise.v1.json | 8 +- ...se_service_v1_beta1.annotate_assessment.js | 18 +- ...gle.cloud.recaptchaenterprise.v1beta1.json | 8 +- .../v1/recaptcha_enterprise_service_client.ts | 3 + ...tcha_enterprise_service_v1_beta1_client.ts | 16 +- 11 files changed, 12406 insertions(+), 2886 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 5c90c5493dd..c77eef437b2 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 @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -65,6 +65,7 @@ service RecaptchaEnterpriseService { post: "/v1/{parent=projects/*}/keys" body: "key" }; + option (google.api.method_signature) = "parent,key"; } // Returns the list of all keys that belong to a project. @@ -72,6 +73,7 @@ service RecaptchaEnterpriseService { option (google.api.http) = { get: "/v1/{parent=projects/*}/keys" }; + option (google.api.method_signature) = "parent"; } // Returns the secret key related to the specified public key. @@ -90,6 +92,7 @@ service RecaptchaEnterpriseService { option (google.api.http) = { get: "/v1/{name=projects/*/keys/*}" }; + option (google.api.method_signature) = "name"; } // Updates the specified key. @@ -98,6 +101,7 @@ service RecaptchaEnterpriseService { patch: "/v1/{key.name=projects/*/keys/*}" body: "key" }; + option (google.api.method_signature) = "key,update_mask"; } // Deletes the specified key. @@ -105,6 +109,7 @@ service RecaptchaEnterpriseService { option (google.api.http) = { delete: "/v1/{name=projects/*/keys/*}" }; + option (google.api.method_signature) = "name"; } // Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. @@ -175,6 +180,125 @@ message CreateAssessmentRequest { Assessment assessment = 2 [(google.api.field_behavior) = REQUIRED]; } +// Describes an event in the lifecycle of a payment transaction. +message TransactionEvent { + // Enum that represents an event in the payment transaction lifecycle. + enum TransactionEventType { + // Default, unspecified event type. + TRANSACTION_EVENT_TYPE_UNSPECIFIED = 0; + + // Indicates that the transaction is approved by the merchant. The + // accompanying reasons can include terms such as 'INHOUSE', 'ACCERTIFY', + // 'CYBERSOURCE', or 'MANUAL_REVIEW'. + MERCHANT_APPROVE = 1; + + // Indicates that the transaction is denied and concluded due to risks + // detected by the merchant. The accompanying reasons can include terms such + // as 'INHOUSE', 'ACCERTIFY', 'CYBERSOURCE', or 'MANUAL_REVIEW'. + MERCHANT_DENY = 2; + + // Indicates that the transaction is being evaluated by a human, due to + // suspicion or risk. + MANUAL_REVIEW = 3; + + // Indicates that the authorization attempt with the card issuer succeeded. + AUTHORIZATION = 4; + + // Indicates that the authorization attempt with the card issuer failed. + // The accompanying reasons can include Visa's '54' indicating that the card + // is expired, or '82' indicating that the CVV is incorrect. + AUTHORIZATION_DECLINE = 5; + + // Indicates that the transaction is completed because the funds were + // settled. + PAYMENT_CAPTURE = 6; + + // Indicates that the transaction could not be completed because the funds + // were not settled. + PAYMENT_CAPTURE_DECLINE = 7; + + // Indicates that the transaction has been canceled. Specify the reason + // for the cancellation. For example, 'INSUFFICIENT_INVENTORY'. + CANCEL = 8; + + // Indicates that the merchant has received a chargeback inquiry due to + // fraud for the transaction, requesting additional information before a + // fraud chargeback is officially issued and a formal chargeback + // notification is sent. + CHARGEBACK_INQUIRY = 9; + + // Indicates that the merchant has received a chargeback alert due to fraud + // for the transaction. The process of resolving the dispute without + // involving the payment network is started. + CHARGEBACK_ALERT = 10; + + // Indicates that a fraud notification is issued for the transaction, sent + // by the payment instrument's issuing bank because the transaction appears + // to be fraudulent. We recommend including TC40 or SAFE data in the + // `reason` field for this event type. For partial chargebacks, we recommend + // that you include an amount in the `value` field. + FRAUD_NOTIFICATION = 11; + + // Indicates that the merchant is informed by the payment network that the + // transaction has entered the chargeback process due to fraud. Reason code + // examples include Discover's '6005' and '6041'. For partial chargebacks, + // we recommend that you include an amount in the `value` field. + CHARGEBACK = 12; + + // Indicates that the transaction has entered the chargeback process due to + // fraud, and that the merchant has chosen to enter representment. Reason + // examples include Discover's '6005' and '6041'. For partial chargebacks, + // we recommend that you include an amount in the `value` field. + CHARGEBACK_REPRESENTMENT = 13; + + // Indicates that the transaction has had a fraud chargeback which was + // illegitimate and was reversed as a result. For partial chargebacks, we + // recommend that you include an amount in the `value` field. + CHARGEBACK_REVERSE = 14; + + // Indicates that the merchant has received a refund for a completed + // transaction. For partial refunds, we recommend that you include an amount + // in the `value` field. Reason example: 'TAX_EXEMPT' (partial refund of + // exempt tax) + REFUND_REQUEST = 15; + + // Indicates that the merchant has received a refund request for this + // transaction, but that they have declined it. For partial refunds, we + // recommend that you include an amount in the `value` field. Reason + // example: 'TAX_EXEMPT' (partial refund of exempt tax) + REFUND_DECLINE = 16; + + // Indicates that the completed transaction was refunded by the merchant. + // For partial refunds, we recommend that you include an amount in the + // `value` field. Reason example: 'TAX_EXEMPT' (partial refund of exempt + // tax) + REFUND = 17; + + // Indicates that the completed transaction was refunded by the merchant, + // and that this refund was reversed. For partial refunds, we recommend that + // you include an amount in the `value` field. + REFUND_REVERSE = 18; + } + + // Optional. The type of this transaction event. + TransactionEventType event_type = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The reason or standardized code that corresponds with this + // transaction event, if one exists. For example, a CHARGEBACK event with code + // 6005. + string reason = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value that corresponds with this transaction event, if one + // exists. For example, a refund event where $5.00 was refunded. Currency is + // obtained from the original transaction data. + double value = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Timestamp when this transaction event occurred; otherwise assumed + // to be the time of the API call. + google.protobuf.Timestamp event_time = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + // The request message to annotate an Assessment. message AnnotateAssessmentRequest { // Enum that represents the types of annotations. @@ -288,6 +412,11 @@ message AnnotateAssessmentRequest { // in the initial request. It is recommended that the identifier is hashed // using hmac-sha256 with stable secret. bytes hashed_account_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If the assessment is part of a payment transaction, provide + // details on payment lifecycle events that occur in the transaction. + TransactionEvent transaction_event = 5 + [(google.api.field_behavior) = OPTIONAL]; } // Empty response for AnnotateAssessment. @@ -401,7 +530,7 @@ message PrivatePasswordLeakVerification { [(google.api.field_behavior) = OUTPUT_ONLY]; } -// A recaptcha assessment resource. +// A reCAPTCHA Enterprise assessment resource. message Assessment { option (google.api.resource) = { type: "recaptchaenterprise.googleapis.com/Assessment" @@ -433,15 +562,19 @@ message Assessment { // The private password leak verification field contains the parameters that // are used to to check for leaks privately without sharing user credentials. PrivatePasswordLeakVerification private_password_leak_verification = 8; + + // Assessment returned by Fraud Prevention when TransactionData is provided. + FraudPreventionAssessment fraud_prevention_assessment = 11; } +// The event being assessed. 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 Enterprise + // 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 Enterprise 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 @@ -460,6 +593,149 @@ message Event { // 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]; + + // Optional. Data describing a payment transaction to be assessed. Sending + // this data enables reCAPTCHA Enterprise Fraud Prevention and the + // FraudPreventionAssessment component in the response. + TransactionData transaction_data = 13 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Transaction data associated with a payment protected by reCAPTCHA Enterprise. +// All fields are optional. +message TransactionData { + // Structured address format for billing and shipping addresses. + message Address { + // The recipient name, potentially including information such as "care of". + string recipient = 1; + + // The first lines of the address. The first line generally contains the + // street name and number, and further lines may include information such as + // an apartment number. + repeated string address = 2; + + // The town/city of the address. + string locality = 3; + + // The state, province, or otherwise administrative area of the address. + string administrative_area = 4; + + // The CLDR country/region of the address. + string region_code = 5; + + // The postal or ZIP code of the address. + string postal_code = 6; + } + + // Details about a user's account involved in the transaction. + message User { + // Unique account identifier for this user. If using account defender, + // this should match the hashed_account_id field. Otherwise, a unique and + // persistent identifier for this account. + string account_id = 6; + + // The epoch milliseconds of the user's account creation. + int64 creation_ms = 1; + + // The email address of the user. + string email = 2; + + // Whether the email has been verified to be accessible by the user (OTP or + // similar). + bool email_verified = 3; + + // The phone number of the user, with country code. + string phone_number = 4; + + // Whether the phone number has been verified to be accessible by the user + // (OTP or similar). + bool phone_verified = 5; + } + + // Line items being purchased in this transaction. + message Item { + // The full name of the item. + string name = 1; + + // The value per item that the user is paying, in the transaction currency, + // after discounts. + double value = 2; + + // The quantity of this item that is being purchased. + int64 quantity = 3; + + // When a merchant is specified, its corresponding account_id. Necessary to + // populate marketplace-style transactions. + string merchant_account_id = 4; + } + + // Details about the transaction from the gateway. + message GatewayInfo { + // Name of the gateway service (for example, stripe, square, paypal). + string name = 1; + + // Gateway response code describing the state of the transaction. + string gateway_response_code = 2; + + // AVS response code from the gateway + // (available only when reCAPTCHA Enterprise is called after authorization). + string avs_response_code = 3; + + // CVV response code from the gateway + // (available only when reCAPTCHA Enterprise is called after authorization). + string cvv_response_code = 4; + } + + // Unique identifier for the transaction. This custom identifier can be used + // to reference this transaction in the future, for example, labeling a refund + // or chargeback event. Two attempts at the same transaction should use the + // same transaction id. + optional string transaction_id = 11; + + // The payment method for the transaction. The allowed values are: + // + // * credit-card + // * debit-card + // * gift-card + // * processor-{name} (If a third-party is used, for example, + // processor-paypal) + // * custom-{name} (If an alternative method is used, for example, + // custom-crypto) + string payment_method = 1; + + // The Bank Identification Number - generally the first 6 or 8 digits of the + // card. + string card_bin = 2; + + // The last four digits of the card. + string card_last_four = 3; + + // The currency code in ISO-4217 format. + string currency_code = 4; + + // The decimal value of the transaction in the specified currency. + double value = 5; + + // The value of shipping in the specified currency. 0 for free or no shipping. + double shipping_value = 12; + + // Destination address if this transaction involves shipping a physical item. + Address shipping_address = 6; + + // Address associated with the payment method when applicable. + Address billing_address = 7; + + // Information about the user paying/initiating the transaction. + User user = 8; + + // Information about the user or users fulfilling the transaction. + repeated User merchants = 13; + + // Items purchased in this transaction. + repeated Item items = 14; + + // Information about the payment gateway's response to the transaction. + GatewayInfo gateway_info = 10; } // Risk analysis result for an event. @@ -485,6 +761,12 @@ message RiskAnalysis { // Too little traffic has been received from this site thus far to generate // quality risk analysis. LOW_CONFIDENCE_SCORE = 5; + + // The request matches behavioral characteristics of a carding attack. + SUSPECTED_CARDING = 6; + + // The request matches behavioral characteristics of chargebacks for fraud. + SUSPECTED_CHARGEBACK = 7; } // Legitimate event score from 0.0 to 1.0. @@ -496,6 +778,7 @@ message RiskAnalysis { repeated ClassificationReason reasons = 2; } +// Properties of the provided event token. message TokenProperties { // Enum that represents the types of invalid token reasons. enum InvalidReason { @@ -550,6 +833,36 @@ message TokenProperties { string action = 5; } +// Assessment for Fraud Prevention. +message FraudPreventionAssessment { + // Information about stolen instrument fraud, where the user is not the + // legitimate owner of the instrument being used for the purchase. + message StolenInstrumentVerdict { + // Probability (0-1) of this transaction being executed with a stolen + // instrument. + float risk = 1; + } + + // Information about card testing fraud, where an adversary is testing + // fraudulently obtained cards or brute forcing their details. + message CardTestingVerdict { + // Probability (0-1) of this transaction attempt being part of a card + // testing attack. + float risk = 1; + } + + // Probability (0-1) of this transaction being fraudulent. Summarizes the + // combined risk of attack vectors below. + float transaction_risk = 1; + + // Assessment of this transaction for risk of a stolen instrument. + StolenInstrumentVerdict stolen_instrument_verdict = 2; + + // Assessment of this transaction for risk of being part of a card testing + // attack. + CardTestingVerdict card_testing_verdict = 3; +} + // Account defender risk assessment. message AccountDefenderAssessment { // Labels returned by account defender for this request. @@ -770,8 +1083,9 @@ message Key { // Creating and managing labels. map labels = 6; - // The timestamp corresponding to the creation of this Key. - google.protobuf.Timestamp create_time = 7; + // Output only. The timestamp corresponding to the creation of this Key. + google.protobuf.Timestamp create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Options for user acceptance testing. TestingOptions testing_options = 9; @@ -1110,4 +1424,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/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto index ba7aaaa6a91..f2d83af2391 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto +++ b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -34,7 +34,8 @@ option ruby_package = "Google::Cloud::RecaptchaEnterprise::V1beta1"; // Service to determine the likelihood an event is legitimate. service RecaptchaEnterpriseServiceV1Beta1 { 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) { @@ -47,7 +48,8 @@ service RecaptchaEnterpriseServiceV1Beta1 { // Annotates a previously created Assessment to provide additional information // on whether the event turned out to be authentic or fradulent. - rpc AnnotateAssessment(AnnotateAssessmentRequest) returns (AnnotateAssessmentResponse) { + rpc AnnotateAssessment(AnnotateAssessmentRequest) + returns (AnnotateAssessmentResponse) { option (google.api.http) = { post: "/v1beta1/{name=projects/*/assessments/*}:annotate" body: "*" @@ -71,6 +73,125 @@ message CreateAssessmentRequest { Assessment assessment = 2 [(google.api.field_behavior) = REQUIRED]; } +// Describes an event in the lifecycle of a payment transaction. +message TransactionEvent { + // Enum that represents an event in the payment transaction lifecycle. + enum TransactionEventType { + // Default, unspecified event type. + TRANSACTION_EVENT_TYPE_UNSPECIFIED = 0; + + // Indicates that the transaction is approved by the merchant. The + // accompanying reasons can include terms such as 'INHOUSE', 'ACCERTIFY', + // 'CYBERSOURCE', or 'MANUAL_REVIEW'. + MERCHANT_APPROVE = 1; + + // Indicates that the transaction is denied and concluded due to risks + // detected by the merchant. The accompanying reasons can include terms such + // as 'INHOUSE', 'ACCERTIFY', 'CYBERSOURCE', or 'MANUAL_REVIEW'. + MERCHANT_DENY = 2; + + // Indicates that the transaction is being evaluated by a human, due to + // suspicion or risk. + MANUAL_REVIEW = 3; + + // Indicates that the authorization attempt with the card issuer succeeded. + AUTHORIZATION = 4; + + // Indicates that the authorization attempt with the card issuer failed. + // The accompanying reasons can include Visa's '54' indicating that the card + // is expired, or '82' indicating that the CVV is incorrect. + AUTHORIZATION_DECLINE = 5; + + // Indicates that the transaction is completed because the funds were + // settled. + PAYMENT_CAPTURE = 6; + + // Indicates that the transaction could not be completed because the funds + // were not settled. + PAYMENT_CAPTURE_DECLINE = 7; + + // Indicates that the transaction has been canceled. Specify the reason + // for the cancellation. For example, 'INSUFFICIENT_INVENTORY'. + CANCEL = 8; + + // Indicates that the merchant has received a chargeback inquiry due to + // fraud for the transaction, requesting additional information before a + // fraud chargeback is officially issued and a formal chargeback + // notification is sent. + CHARGEBACK_INQUIRY = 9; + + // Indicates that the merchant has received a chargeback alert due to fraud + // for the transaction. The process of resolving the dispute without + // involving the payment network is started. + CHARGEBACK_ALERT = 10; + + // Indicates that a fraud notification is issued for the transaction, sent + // by the payment instrument's issuing bank because the transaction appears + // to be fraudulent. We recommend including TC40 or SAFE data in the + // `reason` field for this event type. For partial chargebacks, we recommend + // that you include an amount in the `value` field. + FRAUD_NOTIFICATION = 11; + + // Indicates that the merchant is informed by the payment network that the + // transaction has entered the chargeback process due to fraud. Reason code + // examples include Discover's '6005' and '6041'. For partial chargebacks, + // we recommend that you include an amount in the `value` field. + CHARGEBACK = 12; + + // Indicates that the transaction has entered the chargeback process due to + // fraud, and that the merchant has chosen to enter representment. Reason + // examples include Discover's '6005' and '6041'. For partial chargebacks, + // we recommend that you include an amount in the `value` field. + CHARGEBACK_REPRESENTMENT = 13; + + // Indicates that the transaction has had a fraud chargeback which was + // illegitimate and was reversed as a result. For partial chargebacks, we + // recommend that you include an amount in the `value` field. + CHARGEBACK_REVERSE = 14; + + // Indicates that the merchant has received a refund for a completed + // transaction. For partial refunds, we recommend that you include an amount + // in the `value` field. Reason example: 'TAX_EXEMPT' (partial refund of + // exempt tax) + REFUND_REQUEST = 15; + + // Indicates that the merchant has received a refund request for this + // transaction, but that they have declined it. For partial refunds, we + // recommend that you include an amount in the `value` field. Reason + // example: 'TAX_EXEMPT' (partial refund of exempt tax) + REFUND_DECLINE = 16; + + // Indicates that the completed transaction was refunded by the merchant. + // For partial refunds, we recommend that you include an amount in the + // `value` field. Reason example: 'TAX_EXEMPT' (partial refund of exempt + // tax) + REFUND = 17; + + // Indicates that the completed transaction was refunded by the merchant, + // and that this refund was reversed. For partial refunds, we recommend that + // you include an amount in the `value` field. + REFUND_REVERSE = 18; + } + + // Optional. The type of this transaction event. + TransactionEventType event_type = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The reason or standardized code that corresponds with this + // transaction event, if one exists. For example, a CHARGEBACK event with code + // 6005. + string reason = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value that corresponds with this transaction event, if one + // exists. For example, a refund event where $5.00 was refunded. Currency is + // obtained from the original transaction data. + double value = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Timestamp when this transaction event occurred; otherwise assumed + // to be the time of the API call. + google.protobuf.Timestamp event_time = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + // The request message to annotate an Assessment. message AnnotateAssessmentRequest { // Enum that represents the types of annotations. @@ -100,21 +221,38 @@ message AnnotateAssessmentRequest { // Default unspecified reason. REASON_UNSPECIFIED = 0; - // Indicates a chargeback issued for the transaction with no other details. - // When possible, specify the type by using CHARGEBACK_FRAUD or + // Indicates that the transaction had a chargeback issued with no other + // details. When possible, specify the type by using CHARGEBACK_FRAUD or // CHARGEBACK_DISPUTE instead. CHARGEBACK = 1; - // Indicates a chargeback related to an alleged unauthorized transaction - // from the cardholder's perspective (for example, the card number was - // stolen). + // Indicates that the transaction had a chargeback issued related to an + // alleged unauthorized transaction from the cardholder's perspective (for + // example, the card number was stolen). CHARGEBACK_FRAUD = 8; - // Indicates a chargeback related to the cardholder having provided their - // card details but allegedly not being satisfied with the purchase - // (for example, misrepresentation, attempted cancellation). + // Indicates that the transaction had a chargeback issued related to the + // cardholder having provided their card details but allegedly not being + // satisfied with the purchase (for example, misrepresentation, attempted + // cancellation). CHARGEBACK_DISPUTE = 9; + // Indicates that the completed payment transaction was refunded by the + // seller. + REFUND = 10; + + // Indicates that the completed payment transaction was determined to be + // fraudulent by the seller, and was cancelled and refunded as a result. + REFUND_FRAUD = 11; + + // Indicates that the payment transaction was accepted, and the user was + // charged. + TRANSACTION_ACCEPTED = 12; + + // Indicates that the payment transaction was declined, for example due to + // invalid card details. + TRANSACTION_DECLINED = 13; + // Indicates the transaction associated with the assessment is suspected of // being fraudulent based on the payment method, billing details, shipping // address or other transaction information. @@ -137,6 +275,10 @@ message AnnotateAssessmentRequest { // Indicates the user provided an incorrect password. INCORRECT_PASSWORD = 6; + + // Indicates that the user sent unwanted and abusive messages to other users + // of the platform, such as spam, scams, phishing, or social engineering. + SOCIAL_SPAM = 14; } // Required. The resource name of the Assessment, in the format @@ -148,43 +290,48 @@ 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. Optional unique stable hashed user identifier to apply to the assessment. - // This is an alternative to setting the hashed_account_id in + // Optional. Optional unique stable hashed user identifier to apply to the + // assessment. This is an alternative to setting the hashed_account_id in // CreateAssessment, for example when the account identifier is not yet known // in the initial request. It is recommended that the identifier is hashed // using hmac-sha256 with stable secret. bytes hashed_account_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If the assessment is part of a payment transaction, provide + // details on payment lifecycle events that occur in the transaction. + TransactionEvent transaction_event = 5 + [(google.api.field_behavior) = OPTIONAL]; } // Empty response for AnnotateAssessment. -message AnnotateAssessmentResponse { - -} +message AnnotateAssessmentResponse {} // Password leak verification info. message PasswordLeakVerification { - // Optional. Scrypt hash of the username+password that the customer wants to verify - // against a known password leak. + // Optional. Scrypt hash of the username+password that the customer wants to + // verify against a known password leak. bytes hashed_user_credentials = 1 [(google.api.field_behavior) = OPTIONAL]; - // Output only. Whether or not the user's credentials are present in a known leak. + // Output only. Whether or not the user's credentials are present in a known + // leak. bool credentials_leaked = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Optional. The username part of the user credentials for which we want to trigger a - // leak check in canonicalized form. This is the same data used to create the - // hashed_user_credentials on the customer side. + // Optional. The username part of the user credentials for which we want to + // trigger a leak check in canonicalized form. This is the same data used to + // create the hashed_user_credentials on the customer side. string canonicalized_username = 3 [(google.api.field_behavior) = OPTIONAL]; } -// A recaptcha assessment resource. +// A reCAPTCHA Enterprise assessment resource. message Assessment { option (google.api.resource) = { type: "recaptchaenterprise.googleapis.com/Assessment" @@ -212,6 +359,12 @@ message Assessment { // Too little traffic has been received from this site thus far to generate // quality risk analysis. LOW_CONFIDENCE_SCORE = 5; + + // The request matches behavioral characteristics of a carding attack. + SUSPECTED_CARDING = 6; + + // The request matches behavioral characteristics of chargebacks for fraud. + SUSPECTED_CHARGEBACK = 7; } // Output only. The resource name for the Assessment in the format @@ -227,10 +380,12 @@ message Assessment { float score = 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]; // Output only. Reasons contributing to the risk analysis verdict. - repeated ClassificationReason reasons = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + repeated ClassificationReason reasons = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Information about the user's credentials used to check for leaks. // This feature is part of the Early Access Program (EAP). Exercise caution, @@ -238,35 +393,182 @@ message Assessment { // environment. PasswordLeakVerification password_leak_verification = 7; - // Assessment returned by Account Defender when a hashed_account_id is + // Assessment returned by account defender when a hashed_account_id is // provided. AccountDefenderAssessment account_defender_assessment = 8; + + // Assessment returned by Fraud Prevention when TransactionData is provided. + FraudPreventionAssessment fraud_prevention_assessment = 11; } 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 Enterprise + // 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 Enterprise 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. Optional unique stable hashed user identifier for the request. The - // identifier should ideally be hashed using 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]; + + // Optional. Data describing a payment transaction to be assessed. Sending + // this data enables reCAPTCHA Enterprise Fraud Prevention and the + // FraudPreventionAssessment component in the response. + TransactionData transaction_data = 13 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Transaction data associated with a payment protected by reCAPTCHA Enterprise. +// All fields are optional. +message TransactionData { + // Structured address format for billing and shipping addresses. + message Address { + // The recipient name, potentially including information such as "care of". + string recipient = 1; + + // The first lines of the address. The first line generally contains the + // street name and number, and further lines may include information such as + // an apartment number. + repeated string address = 2; + + // The town/city of the address. + string locality = 3; + + // The state, province, or otherwise administrative area of the address. + string administrative_area = 4; + + // The CLDR country/region of the address. + string region_code = 5; + + // The postal or ZIP code of the address. + string postal_code = 6; + } + + // Details about a user's account involved in the transaction. + message User { + // Unique account identifier for this user. If using account defender, + // this should match the hashed_account_id field. Otherwise, a unique and + // persistent identifier for this account. + string account_id = 6; + + // The epoch milliseconds of the user's account creation. + int64 creation_ms = 1; + + // The email address of the user. + string email = 2; + + // Whether the email has been verified to be accessible by the user (OTP or + // similar). + bool email_verified = 3; + + // The phone number of the user, with country code. + string phone_number = 4; + + // Whether the phone number has been verified to be accessible by the user + // (OTP or similar). + bool phone_verified = 5; + } + + // Line items being purchased in this transaction. + message Item { + // The full name of the item. + string name = 1; + + // The value per item that the user is paying, in the transaction currency, + // after discounts. + double value = 2; + + // The quantity of this item that is being purchased. + int64 quantity = 3; + + // When a merchant is specified, its corresponding account_id. Necessary to + // populate marketplace-style transactions. + string merchant_account_id = 4; + } + + // Details about the transaction from the gateway. + message GatewayInfo { + // Name of the gateway service (for example, stripe, square, paypal). + string name = 1; + + // Gateway response code describing the state of the transaction. + string gateway_response_code = 2; + + // AVS response code from the gateway + // (available only when reCAPTCHA Enterprise is called after authorization). + string avs_response_code = 3; + + // CVV response code from the gateway + // (available only when reCAPTCHA Enterprise is called after authorization). + string cvv_response_code = 4; + } + + // Unique identifier for the transaction. This custom identifier can be used + // to reference this transaction in the future, for example, labeling a refund + // or chargeback event. Two attempts at the same transaction should use the + // same transaction id. + optional string transaction_id = 11; + + // The payment method for the transaction. The allowed values are: + // + // * credit-card + // * debit-card + // * gift-card + // * processor-{name} (If a third-party is used, for example, + // processor-paypal) + // * custom-{name} (If an alternative method is used, for example, + // custom-crypto) + string payment_method = 1; + + // The Bank Identification Number - generally the first 6 or 8 digits of the + // card. + string card_bin = 2; + + // The last four digits of the card. + string card_last_four = 3; + + // The currency code in ISO-4217 format. + string currency_code = 4; + + // The decimal value of the transaction in the specified currency. + double value = 5; + + // The value of shipping in the specified currency. 0 for free or no shipping. + double shipping_value = 12; + + // Destination address if this transaction involves shipping a physical item. + Address shipping_address = 6; + + // Address associated with the payment method when applicable. + Address billing_address = 7; + + // Information about the user paying/initiating the transaction. + User user = 8; + + // Information about the user or users fulfilling the transaction. + repeated User merchants = 13; + + // Items purchased in this transaction. + repeated Item items = 14; + + // Information about the payment gateway's response to the transaction. + GatewayInfo gateway_info = 10; } message TokenProperties { @@ -288,7 +590,7 @@ message TokenProperties { DUPE = 4; // The user verification token did not match the provided site key. - // This may be a configuration error (e.g. development keys used in + // This may be a configuration error (for example, development keys used in // production) or end users trying to use verification tokens from other // sites. SITE_MISMATCH = 5 [deprecated = true]; @@ -321,9 +623,39 @@ message TokenProperties { string action = 5; } -// Account Defender risk assessment. +// Assessment for Fraud Prevention. +message FraudPreventionAssessment { + // Information about stolen instrument fraud, where the user is not the + // legitimate owner of the instrument being used for the purchase. + message StolenInstrumentVerdict { + // Probability (0-1) of this transaction being executed with a stolen + // instrument. + float risk = 1; + } + + // Information about card testing fraud, where an adversary is testing + // fraudulently obtained cards or brute forcing their details. + message CardTestingVerdict { + // Probability (0-1) of this transaction attempt being part of a card + // testing attack. + float risk = 1; + } + + // Probability (0-1) of this transaction being fraudulent. Summarizes the + // combined risk of attack vectors below. + float transaction_risk = 1; + + // Assessment of this transaction for risk of a stolen instrument. + StolenInstrumentVerdict stolen_instrument_verdict = 2; + + // Assessment of this transaction for risk of being part of a card testing + // attack. + CardTestingVerdict card_testing_verdict = 3; +} + +// Account defender risk assessment. message AccountDefenderAssessment { - // Labels returned by Account Defender for this request. + // Labels returned by account defender for this request. enum AccountDefenderLabel { // Default unspecified type. ACCOUNT_DEFENDER_LABEL_UNSPECIFIED = 0; diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index b487d988a9e..3354a8fb1c9 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -426,6 +426,147 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a TransactionEvent. */ + interface ITransactionEvent { + + /** TransactionEvent eventType */ + eventType?: (google.cloud.recaptchaenterprise.v1.TransactionEvent.TransactionEventType|keyof typeof google.cloud.recaptchaenterprise.v1.TransactionEvent.TransactionEventType|null); + + /** TransactionEvent reason */ + reason?: (string|null); + + /** TransactionEvent value */ + value?: (number|null); + + /** TransactionEvent eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TransactionEvent. */ + class TransactionEvent implements ITransactionEvent { + + /** + * Constructs a new TransactionEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.ITransactionEvent); + + /** TransactionEvent eventType. */ + public eventType: (google.cloud.recaptchaenterprise.v1.TransactionEvent.TransactionEventType|keyof typeof google.cloud.recaptchaenterprise.v1.TransactionEvent.TransactionEventType); + + /** TransactionEvent reason. */ + public reason: string; + + /** TransactionEvent value. */ + public value: number; + + /** TransactionEvent eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TransactionEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionEvent instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.ITransactionEvent): google.cloud.recaptchaenterprise.v1.TransactionEvent; + + /** + * Encodes the specified TransactionEvent message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TransactionEvent.verify|verify} messages. + * @param message TransactionEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.ITransactionEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransactionEvent message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TransactionEvent.verify|verify} messages. + * @param message TransactionEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.ITransactionEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransactionEvent + * @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.TransactionEvent; + + /** + * Decodes a TransactionEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransactionEvent + * @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.TransactionEvent; + + /** + * Verifies a TransactionEvent 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 a TransactionEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransactionEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.TransactionEvent; + + /** + * Creates a plain object from a TransactionEvent message. Also converts values to other types if specified. + * @param message TransactionEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.TransactionEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransactionEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransactionEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TransactionEvent { + + /** TransactionEventType enum. */ + enum TransactionEventType { + TRANSACTION_EVENT_TYPE_UNSPECIFIED = 0, + MERCHANT_APPROVE = 1, + MERCHANT_DENY = 2, + MANUAL_REVIEW = 3, + AUTHORIZATION = 4, + AUTHORIZATION_DECLINE = 5, + PAYMENT_CAPTURE = 6, + PAYMENT_CAPTURE_DECLINE = 7, + CANCEL = 8, + CHARGEBACK_INQUIRY = 9, + CHARGEBACK_ALERT = 10, + FRAUD_NOTIFICATION = 11, + CHARGEBACK = 12, + CHARGEBACK_REPRESENTMENT = 13, + CHARGEBACK_REVERSE = 14, + REFUND_REQUEST = 15, + REFUND_DECLINE = 16, + REFUND = 17, + REFUND_REVERSE = 18 + } + } + /** Properties of an AnnotateAssessmentRequest. */ interface IAnnotateAssessmentRequest { @@ -440,6 +581,9 @@ export namespace google { /** AnnotateAssessmentRequest hashedAccountId */ hashedAccountId?: (Uint8Array|string|null); + + /** AnnotateAssessmentRequest transactionEvent */ + transactionEvent?: (google.cloud.recaptchaenterprise.v1.ITransactionEvent|null); } /** Represents an AnnotateAssessmentRequest. */ @@ -463,6 +607,9 @@ export namespace google { /** AnnotateAssessmentRequest hashedAccountId. */ public hashedAccountId: (Uint8Array|string); + /** AnnotateAssessmentRequest transactionEvent. */ + public transactionEvent?: (google.cloud.recaptchaenterprise.v1.ITransactionEvent|null); + /** * Creates a new AnnotateAssessmentRequest instance using the specified properties. * @param [properties] Properties to set @@ -1051,6 +1198,9 @@ export namespace google { /** Assessment privatePasswordLeakVerification */ privatePasswordLeakVerification?: (google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification|null); + + /** Assessment fraudPreventionAssessment */ + fraudPreventionAssessment?: (google.cloud.recaptchaenterprise.v1.IFraudPreventionAssessment|null); } /** Represents an Assessment. */ @@ -1083,6 +1233,9 @@ export namespace google { /** Assessment privatePasswordLeakVerification. */ public privatePasswordLeakVerification?: (google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification|null); + /** Assessment fraudPreventionAssessment. */ + public fraudPreventionAssessment?: (google.cloud.recaptchaenterprise.v1.IFraudPreventionAssessment|null); + /** * Creates a new Assessment instance using the specified properties. * @param [properties] Properties to set @@ -1181,6 +1334,9 @@ export namespace google { /** Event hashedAccountId */ hashedAccountId?: (Uint8Array|string|null); + + /** Event transactionData */ + transactionData?: (google.cloud.recaptchaenterprise.v1.ITransactionData|null); } /** Represents an Event. */ @@ -1210,6 +1366,9 @@ export namespace google { /** Event hashedAccountId. */ public hashedAccountId: (Uint8Array|string); + /** Event transactionData. */ + public transactionData?: (google.cloud.recaptchaenterprise.v1.ITransactionData|null); + /** * Creates a new Event instance using the specified properties. * @param [properties] Properties to set @@ -1288,6 +1447,665 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a TransactionData. */ + interface ITransactionData { + + /** TransactionData transactionId */ + transactionId?: (string|null); + + /** TransactionData paymentMethod */ + paymentMethod?: (string|null); + + /** TransactionData cardBin */ + cardBin?: (string|null); + + /** TransactionData cardLastFour */ + cardLastFour?: (string|null); + + /** TransactionData currencyCode */ + currencyCode?: (string|null); + + /** TransactionData value */ + value?: (number|null); + + /** TransactionData shippingValue */ + shippingValue?: (number|null); + + /** TransactionData shippingAddress */ + shippingAddress?: (google.cloud.recaptchaenterprise.v1.TransactionData.IAddress|null); + + /** TransactionData billingAddress */ + billingAddress?: (google.cloud.recaptchaenterprise.v1.TransactionData.IAddress|null); + + /** TransactionData user */ + user?: (google.cloud.recaptchaenterprise.v1.TransactionData.IUser|null); + + /** TransactionData merchants */ + merchants?: (google.cloud.recaptchaenterprise.v1.TransactionData.IUser[]|null); + + /** TransactionData items */ + items?: (google.cloud.recaptchaenterprise.v1.TransactionData.IItem[]|null); + + /** TransactionData gatewayInfo */ + gatewayInfo?: (google.cloud.recaptchaenterprise.v1.TransactionData.IGatewayInfo|null); + } + + /** Represents a TransactionData. */ + class TransactionData implements ITransactionData { + + /** + * Constructs a new TransactionData. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.ITransactionData); + + /** TransactionData transactionId. */ + public transactionId?: (string|null); + + /** TransactionData paymentMethod. */ + public paymentMethod: string; + + /** TransactionData cardBin. */ + public cardBin: string; + + /** TransactionData cardLastFour. */ + public cardLastFour: string; + + /** TransactionData currencyCode. */ + public currencyCode: string; + + /** TransactionData value. */ + public value: number; + + /** TransactionData shippingValue. */ + public shippingValue: number; + + /** TransactionData shippingAddress. */ + public shippingAddress?: (google.cloud.recaptchaenterprise.v1.TransactionData.IAddress|null); + + /** TransactionData billingAddress. */ + public billingAddress?: (google.cloud.recaptchaenterprise.v1.TransactionData.IAddress|null); + + /** TransactionData user. */ + public user?: (google.cloud.recaptchaenterprise.v1.TransactionData.IUser|null); + + /** TransactionData merchants. */ + public merchants: google.cloud.recaptchaenterprise.v1.TransactionData.IUser[]; + + /** TransactionData items. */ + public items: google.cloud.recaptchaenterprise.v1.TransactionData.IItem[]; + + /** TransactionData gatewayInfo. */ + public gatewayInfo?: (google.cloud.recaptchaenterprise.v1.TransactionData.IGatewayInfo|null); + + /** TransactionData _transactionId. */ + public _transactionId?: "transactionId"; + + /** + * Creates a new TransactionData instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionData instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.ITransactionData): google.cloud.recaptchaenterprise.v1.TransactionData; + + /** + * Encodes the specified TransactionData message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TransactionData.verify|verify} messages. + * @param message TransactionData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.ITransactionData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransactionData message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TransactionData.verify|verify} messages. + * @param message TransactionData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.ITransactionData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransactionData + * @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.TransactionData; + + /** + * Decodes a TransactionData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransactionData + * @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.TransactionData; + + /** + * Verifies a TransactionData 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 a TransactionData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransactionData + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.TransactionData; + + /** + * Creates a plain object from a TransactionData message. Also converts values to other types if specified. + * @param message TransactionData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.TransactionData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransactionData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransactionData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TransactionData { + + /** Properties of an Address. */ + interface IAddress { + + /** Address recipient */ + recipient?: (string|null); + + /** Address address */ + address?: (string[]|null); + + /** Address locality */ + locality?: (string|null); + + /** Address administrativeArea */ + administrativeArea?: (string|null); + + /** Address regionCode */ + regionCode?: (string|null); + + /** Address postalCode */ + postalCode?: (string|null); + } + + /** Represents an Address. */ + class Address implements IAddress { + + /** + * Constructs a new Address. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.TransactionData.IAddress); + + /** Address recipient. */ + public recipient: string; + + /** Address address. */ + public address: string[]; + + /** Address locality. */ + public locality: string; + + /** Address administrativeArea. */ + public administrativeArea: string; + + /** Address regionCode. */ + public regionCode: string; + + /** Address postalCode. */ + public postalCode: string; + + /** + * Creates a new Address instance using the specified properties. + * @param [properties] Properties to set + * @returns Address instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.TransactionData.IAddress): google.cloud.recaptchaenterprise.v1.TransactionData.Address; + + /** + * Encodes the specified Address message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TransactionData.Address.verify|verify} messages. + * @param message Address message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.TransactionData.IAddress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Address message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TransactionData.Address.verify|verify} messages. + * @param message Address message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.TransactionData.IAddress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Address message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Address + * @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.TransactionData.Address; + + /** + * Decodes an Address message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Address + * @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.TransactionData.Address; + + /** + * Verifies an Address 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 Address message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Address + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.TransactionData.Address; + + /** + * Creates a plain object from an Address message. Also converts values to other types if specified. + * @param message Address + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.TransactionData.Address, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Address to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Address + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a User. */ + interface IUser { + + /** User accountId */ + accountId?: (string|null); + + /** User creationMs */ + creationMs?: (number|Long|string|null); + + /** User email */ + email?: (string|null); + + /** User emailVerified */ + emailVerified?: (boolean|null); + + /** User phoneNumber */ + phoneNumber?: (string|null); + + /** User phoneVerified */ + phoneVerified?: (boolean|null); + } + + /** Represents a User. */ + class User implements IUser { + + /** + * Constructs a new User. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.TransactionData.IUser); + + /** User accountId. */ + public accountId: string; + + /** User creationMs. */ + public creationMs: (number|Long|string); + + /** User email. */ + public email: string; + + /** User emailVerified. */ + public emailVerified: boolean; + + /** User phoneNumber. */ + public phoneNumber: string; + + /** User phoneVerified. */ + public phoneVerified: boolean; + + /** + * Creates a new User instance using the specified properties. + * @param [properties] Properties to set + * @returns User instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.TransactionData.IUser): google.cloud.recaptchaenterprise.v1.TransactionData.User; + + /** + * Encodes the specified User message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TransactionData.User.verify|verify} messages. + * @param message User message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.TransactionData.IUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified User message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TransactionData.User.verify|verify} messages. + * @param message User message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.TransactionData.IUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a User message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns User + * @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.TransactionData.User; + + /** + * Decodes a User message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns User + * @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.TransactionData.User; + + /** + * Verifies a User 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 a User message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns User + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.TransactionData.User; + + /** + * Creates a plain object from a User message. Also converts values to other types if specified. + * @param message User + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.TransactionData.User, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this User to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for User + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Item. */ + interface IItem { + + /** Item name */ + name?: (string|null); + + /** Item value */ + value?: (number|null); + + /** Item quantity */ + quantity?: (number|Long|string|null); + + /** Item merchantAccountId */ + merchantAccountId?: (string|null); + } + + /** Represents an Item. */ + class Item implements IItem { + + /** + * Constructs a new Item. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.TransactionData.IItem); + + /** Item name. */ + public name: string; + + /** Item value. */ + public value: number; + + /** Item quantity. */ + public quantity: (number|Long|string); + + /** Item merchantAccountId. */ + public merchantAccountId: string; + + /** + * Creates a new Item instance using the specified properties. + * @param [properties] Properties to set + * @returns Item instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.TransactionData.IItem): google.cloud.recaptchaenterprise.v1.TransactionData.Item; + + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TransactionData.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.TransactionData.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TransactionData.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.TransactionData.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Item message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Item + * @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.TransactionData.Item; + + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Item + * @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.TransactionData.Item; + + /** + * Verifies an Item 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 Item message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Item + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.TransactionData.Item; + + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @param message Item + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.TransactionData.Item, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Item to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Item + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GatewayInfo. */ + interface IGatewayInfo { + + /** GatewayInfo name */ + name?: (string|null); + + /** GatewayInfo gatewayResponseCode */ + gatewayResponseCode?: (string|null); + + /** GatewayInfo avsResponseCode */ + avsResponseCode?: (string|null); + + /** GatewayInfo cvvResponseCode */ + cvvResponseCode?: (string|null); + } + + /** Represents a GatewayInfo. */ + class GatewayInfo implements IGatewayInfo { + + /** + * Constructs a new GatewayInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.TransactionData.IGatewayInfo); + + /** GatewayInfo name. */ + public name: string; + + /** GatewayInfo gatewayResponseCode. */ + public gatewayResponseCode: string; + + /** GatewayInfo avsResponseCode. */ + public avsResponseCode: string; + + /** GatewayInfo cvvResponseCode. */ + public cvvResponseCode: string; + + /** + * Creates a new GatewayInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GatewayInfo instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.TransactionData.IGatewayInfo): google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo; + + /** + * Encodes the specified GatewayInfo message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo.verify|verify} messages. + * @param message GatewayInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.TransactionData.IGatewayInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GatewayInfo message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo.verify|verify} messages. + * @param message GatewayInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.TransactionData.IGatewayInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GatewayInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GatewayInfo + * @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.TransactionData.GatewayInfo; + + /** + * Decodes a GatewayInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GatewayInfo + * @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.TransactionData.GatewayInfo; + + /** + * Verifies a GatewayInfo 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 a GatewayInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GatewayInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo; + + /** + * Creates a plain object from a GatewayInfo message. Also converts values to other types if specified. + * @param message GatewayInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GatewayInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GatewayInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a RiskAnalysis. */ interface IRiskAnalysis { @@ -1400,7 +2218,9 @@ export namespace google { UNEXPECTED_ENVIRONMENT = 2, TOO_MUCH_TRAFFIC = 3, UNEXPECTED_USAGE_PATTERNS = 4, - LOW_CONFIDENCE_SCORE = 5 + LOW_CONFIDENCE_SCORE = 5, + SUSPECTED_CARDING = 6, + SUSPECTED_CHARGEBACK = 7 } } @@ -1551,119 +2371,425 @@ export namespace google { } } - /** Properties of an AccountDefenderAssessment. */ - interface IAccountDefenderAssessment { + /** Properties of a FraudPreventionAssessment. */ + interface IFraudPreventionAssessment { - /** AccountDefenderAssessment labels */ - labels?: (google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel[]|null); + /** FraudPreventionAssessment transactionRisk */ + transactionRisk?: (number|null); + + /** FraudPreventionAssessment stolenInstrumentVerdict */ + stolenInstrumentVerdict?: (google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.IStolenInstrumentVerdict|null); + + /** FraudPreventionAssessment cardTestingVerdict */ + cardTestingVerdict?: (google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.ICardTestingVerdict|null); } - /** Represents an AccountDefenderAssessment. */ - class AccountDefenderAssessment implements IAccountDefenderAssessment { + /** Represents a FraudPreventionAssessment. */ + class FraudPreventionAssessment implements IFraudPreventionAssessment { /** - * Constructs a new AccountDefenderAssessment. + * Constructs a new FraudPreventionAssessment. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment); + constructor(properties?: google.cloud.recaptchaenterprise.v1.IFraudPreventionAssessment); - /** AccountDefenderAssessment labels. */ - public labels: google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel[]; + /** FraudPreventionAssessment transactionRisk. */ + public transactionRisk: number; + + /** FraudPreventionAssessment stolenInstrumentVerdict. */ + public stolenInstrumentVerdict?: (google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.IStolenInstrumentVerdict|null); + + /** FraudPreventionAssessment cardTestingVerdict. */ + public cardTestingVerdict?: (google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.ICardTestingVerdict|null); /** - * Creates a new AccountDefenderAssessment instance using the specified properties. + * Creates a new FraudPreventionAssessment instance using the specified properties. * @param [properties] Properties to set - * @returns AccountDefenderAssessment instance + * @returns FraudPreventionAssessment instance */ - public static create(properties?: google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment): google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment; + public static create(properties?: google.cloud.recaptchaenterprise.v1.IFraudPreventionAssessment): google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment; /** - * Encodes the specified AccountDefenderAssessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.verify|verify} messages. - * @param message AccountDefenderAssessment message or plain object to encode + * Encodes the specified FraudPreventionAssessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.verify|verify} messages. + * @param message FraudPreventionAssessment message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.recaptchaenterprise.v1.IFraudPreventionAssessment, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AccountDefenderAssessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.verify|verify} messages. - * @param message AccountDefenderAssessment message or plain object to encode + * Encodes the specified FraudPreventionAssessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.verify|verify} messages. + * @param message FraudPreventionAssessment message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IFraudPreventionAssessment, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AccountDefenderAssessment message from the specified reader or buffer. + * Decodes a FraudPreventionAssessment message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AccountDefenderAssessment + * @returns FraudPreventionAssessment * @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.AccountDefenderAssessment; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment; /** - * Decodes an AccountDefenderAssessment message from the specified reader or buffer, length delimited. + * Decodes a FraudPreventionAssessment message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AccountDefenderAssessment + * @returns FraudPreventionAssessment * @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.AccountDefenderAssessment; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment; /** - * Verifies an AccountDefenderAssessment message. + * Verifies a FraudPreventionAssessment 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 AccountDefenderAssessment message from a plain object. Also converts values to their respective internal types. + * Creates a FraudPreventionAssessment message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AccountDefenderAssessment + * @returns FraudPreventionAssessment */ - public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment; + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment; /** - * Creates a plain object from an AccountDefenderAssessment message. Also converts values to other types if specified. - * @param message AccountDefenderAssessment + * Creates a plain object from a FraudPreventionAssessment message. Also converts values to other types if specified. + * @param message FraudPreventionAssessment * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AccountDefenderAssessment to JSON. + * Converts this FraudPreventionAssessment to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AccountDefenderAssessment + * Gets the default type url for FraudPreventionAssessment * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace AccountDefenderAssessment { + namespace FraudPreventionAssessment { - /** AccountDefenderLabel enum. */ - enum AccountDefenderLabel { - ACCOUNT_DEFENDER_LABEL_UNSPECIFIED = 0, - PROFILE_MATCH = 1, - SUSPICIOUS_LOGIN_ACTIVITY = 2, - SUSPICIOUS_ACCOUNT_CREATION = 3, - RELATED_ACCOUNTS_NUMBER_HIGH = 4 + /** Properties of a StolenInstrumentVerdict. */ + interface IStolenInstrumentVerdict { + + /** StolenInstrumentVerdict risk */ + risk?: (number|null); } - } - /** Properties of a CreateKeyRequest. */ - interface ICreateKeyRequest { + /** Represents a StolenInstrumentVerdict. */ + class StolenInstrumentVerdict implements IStolenInstrumentVerdict { + + /** + * Constructs a new StolenInstrumentVerdict. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.IStolenInstrumentVerdict); + + /** StolenInstrumentVerdict risk. */ + public risk: number; + + /** + * Creates a new StolenInstrumentVerdict instance using the specified properties. + * @param [properties] Properties to set + * @returns StolenInstrumentVerdict instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.IStolenInstrumentVerdict): google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict; + + /** + * Encodes the specified StolenInstrumentVerdict message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict.verify|verify} messages. + * @param message StolenInstrumentVerdict message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.IStolenInstrumentVerdict, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StolenInstrumentVerdict message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict.verify|verify} messages. + * @param message StolenInstrumentVerdict message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.IStolenInstrumentVerdict, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StolenInstrumentVerdict message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StolenInstrumentVerdict + * @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.FraudPreventionAssessment.StolenInstrumentVerdict; + + /** + * Decodes a StolenInstrumentVerdict message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StolenInstrumentVerdict + * @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.FraudPreventionAssessment.StolenInstrumentVerdict; + + /** + * Verifies a StolenInstrumentVerdict 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 a StolenInstrumentVerdict message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StolenInstrumentVerdict + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict; + + /** + * Creates a plain object from a StolenInstrumentVerdict message. Also converts values to other types if specified. + * @param message StolenInstrumentVerdict + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StolenInstrumentVerdict to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StolenInstrumentVerdict + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** CreateKeyRequest parent */ + /** Properties of a CardTestingVerdict. */ + interface ICardTestingVerdict { + + /** CardTestingVerdict risk */ + risk?: (number|null); + } + + /** Represents a CardTestingVerdict. */ + class CardTestingVerdict implements ICardTestingVerdict { + + /** + * Constructs a new CardTestingVerdict. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.ICardTestingVerdict); + + /** CardTestingVerdict risk. */ + public risk: number; + + /** + * Creates a new CardTestingVerdict instance using the specified properties. + * @param [properties] Properties to set + * @returns CardTestingVerdict instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.ICardTestingVerdict): google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict; + + /** + * Encodes the specified CardTestingVerdict message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict.verify|verify} messages. + * @param message CardTestingVerdict message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.ICardTestingVerdict, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CardTestingVerdict message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict.verify|verify} messages. + * @param message CardTestingVerdict message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.ICardTestingVerdict, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CardTestingVerdict message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CardTestingVerdict + * @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.FraudPreventionAssessment.CardTestingVerdict; + + /** + * Decodes a CardTestingVerdict message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CardTestingVerdict + * @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.FraudPreventionAssessment.CardTestingVerdict; + + /** + * Verifies a CardTestingVerdict 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 a CardTestingVerdict message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CardTestingVerdict + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict; + + /** + * Creates a plain object from a CardTestingVerdict message. Also converts values to other types if specified. + * @param message CardTestingVerdict + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CardTestingVerdict to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CardTestingVerdict + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AccountDefenderAssessment. */ + interface IAccountDefenderAssessment { + + /** AccountDefenderAssessment labels */ + labels?: (google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel[]|null); + } + + /** Represents an AccountDefenderAssessment. */ + class AccountDefenderAssessment implements IAccountDefenderAssessment { + + /** + * Constructs a new AccountDefenderAssessment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment); + + /** AccountDefenderAssessment labels. */ + public labels: google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel[]; + + /** + * Creates a new AccountDefenderAssessment instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountDefenderAssessment instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment): google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment; + + /** + * Encodes the specified AccountDefenderAssessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.verify|verify} messages. + * @param message AccountDefenderAssessment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccountDefenderAssessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.verify|verify} messages. + * @param message AccountDefenderAssessment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountDefenderAssessment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccountDefenderAssessment + * @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.AccountDefenderAssessment; + + /** + * Decodes an AccountDefenderAssessment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccountDefenderAssessment + * @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.AccountDefenderAssessment; + + /** + * Verifies an AccountDefenderAssessment 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 AccountDefenderAssessment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccountDefenderAssessment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment; + + /** + * Creates a plain object from an AccountDefenderAssessment message. Also converts values to other types if specified. + * @param message AccountDefenderAssessment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccountDefenderAssessment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccountDefenderAssessment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AccountDefenderAssessment { + + /** AccountDefenderLabel enum. */ + enum AccountDefenderLabel { + ACCOUNT_DEFENDER_LABEL_UNSPECIFIED = 0, + PROFILE_MATCH = 1, + SUSPICIOUS_LOGIN_ACTIVITY = 2, + SUSPICIOUS_ACCOUNT_CREATION = 3, + RELATED_ACCOUNTS_NUMBER_HIGH = 4 + } + } + + /** Properties of a CreateKeyRequest. */ + interface ICreateKeyRequest { + + /** CreateKeyRequest parent */ parent?: (string|null); /** CreateKeyRequest key */ @@ -4838,6 +5964,147 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a TransactionEvent. */ + interface ITransactionEvent { + + /** TransactionEvent eventType */ + eventType?: (google.cloud.recaptchaenterprise.v1beta1.TransactionEvent.TransactionEventType|keyof typeof google.cloud.recaptchaenterprise.v1beta1.TransactionEvent.TransactionEventType|null); + + /** TransactionEvent reason */ + reason?: (string|null); + + /** TransactionEvent value */ + value?: (number|null); + + /** TransactionEvent eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TransactionEvent. */ + class TransactionEvent implements ITransactionEvent { + + /** + * Constructs a new TransactionEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.ITransactionEvent); + + /** TransactionEvent eventType. */ + public eventType: (google.cloud.recaptchaenterprise.v1beta1.TransactionEvent.TransactionEventType|keyof typeof google.cloud.recaptchaenterprise.v1beta1.TransactionEvent.TransactionEventType); + + /** TransactionEvent reason. */ + public reason: string; + + /** TransactionEvent value. */ + public value: number; + + /** TransactionEvent eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TransactionEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionEvent instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.ITransactionEvent): google.cloud.recaptchaenterprise.v1beta1.TransactionEvent; + + /** + * Encodes the specified TransactionEvent message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TransactionEvent.verify|verify} messages. + * @param message TransactionEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.ITransactionEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransactionEvent message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TransactionEvent.verify|verify} messages. + * @param message TransactionEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.ITransactionEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransactionEvent + * @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.v1beta1.TransactionEvent; + + /** + * Decodes a TransactionEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransactionEvent + * @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.v1beta1.TransactionEvent; + + /** + * Verifies a TransactionEvent 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 a TransactionEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransactionEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.TransactionEvent; + + /** + * Creates a plain object from a TransactionEvent message. Also converts values to other types if specified. + * @param message TransactionEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.TransactionEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransactionEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransactionEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TransactionEvent { + + /** TransactionEventType enum. */ + enum TransactionEventType { + TRANSACTION_EVENT_TYPE_UNSPECIFIED = 0, + MERCHANT_APPROVE = 1, + MERCHANT_DENY = 2, + MANUAL_REVIEW = 3, + AUTHORIZATION = 4, + AUTHORIZATION_DECLINE = 5, + PAYMENT_CAPTURE = 6, + PAYMENT_CAPTURE_DECLINE = 7, + CANCEL = 8, + CHARGEBACK_INQUIRY = 9, + CHARGEBACK_ALERT = 10, + FRAUD_NOTIFICATION = 11, + CHARGEBACK = 12, + CHARGEBACK_REPRESENTMENT = 13, + CHARGEBACK_REVERSE = 14, + REFUND_REQUEST = 15, + REFUND_DECLINE = 16, + REFUND = 17, + REFUND_REVERSE = 18 + } + } + /** Properties of an AnnotateAssessmentRequest. */ interface IAnnotateAssessmentRequest { @@ -4852,6 +6119,9 @@ export namespace google { /** AnnotateAssessmentRequest hashedAccountId */ hashedAccountId?: (Uint8Array|string|null); + + /** AnnotateAssessmentRequest transactionEvent */ + transactionEvent?: (google.cloud.recaptchaenterprise.v1beta1.ITransactionEvent|null); } /** Represents an AnnotateAssessmentRequest. */ @@ -4875,6 +6145,9 @@ export namespace google { /** AnnotateAssessmentRequest hashedAccountId. */ public hashedAccountId: (Uint8Array|string); + /** AnnotateAssessmentRequest transactionEvent. */ + public transactionEvent?: (google.cloud.recaptchaenterprise.v1beta1.ITransactionEvent|null); + /** * Creates a new AnnotateAssessmentRequest instance using the specified properties. * @param [properties] Properties to set @@ -4970,12 +6243,17 @@ export namespace google { CHARGEBACK = 1, CHARGEBACK_FRAUD = 8, CHARGEBACK_DISPUTE = 9, + REFUND = 10, + REFUND_FRAUD = 11, + TRANSACTION_ACCEPTED = 12, + TRANSACTION_DECLINED = 13, PAYMENT_HEURISTICS = 2, INITIATED_TWO_FACTOR = 7, PASSED_TWO_FACTOR = 3, FAILED_TWO_FACTOR = 4, CORRECT_PASSWORD = 5, - INCORRECT_PASSWORD = 6 + INCORRECT_PASSWORD = 6, + SOCIAL_SPAM = 14 } } @@ -5202,6 +6480,9 @@ export namespace google { /** Assessment accountDefenderAssessment */ accountDefenderAssessment?: (google.cloud.recaptchaenterprise.v1beta1.IAccountDefenderAssessment|null); + + /** Assessment fraudPreventionAssessment */ + fraudPreventionAssessment?: (google.cloud.recaptchaenterprise.v1beta1.IFraudPreventionAssessment|null); } /** Represents an Assessment. */ @@ -5234,6 +6515,9 @@ export namespace google { /** Assessment accountDefenderAssessment. */ public accountDefenderAssessment?: (google.cloud.recaptchaenterprise.v1beta1.IAccountDefenderAssessment|null); + /** Assessment fraudPreventionAssessment. */ + public fraudPreventionAssessment?: (google.cloud.recaptchaenterprise.v1beta1.IFraudPreventionAssessment|null); + /** * Creates a new Assessment instance using the specified properties. * @param [properties] Properties to set @@ -5321,7 +6605,9 @@ export namespace google { UNEXPECTED_ENVIRONMENT = 2, TOO_MUCH_TRAFFIC = 3, UNEXPECTED_USAGE_PATTERNS = 4, - LOW_CONFIDENCE_SCORE = 5 + LOW_CONFIDENCE_SCORE = 5, + SUSPECTED_CARDING = 6, + SUSPECTED_CHARGEBACK = 7 } } @@ -5345,6 +6631,9 @@ export namespace google { /** Event hashedAccountId */ hashedAccountId?: (Uint8Array|string|null); + + /** Event transactionData */ + transactionData?: (google.cloud.recaptchaenterprise.v1beta1.ITransactionData|null); } /** Represents an Event. */ @@ -5374,6 +6663,9 @@ export namespace google { /** Event hashedAccountId. */ public hashedAccountId: (Uint8Array|string); + /** Event transactionData. */ + public transactionData?: (google.cloud.recaptchaenterprise.v1beta1.ITransactionData|null); + /** * Creates a new Event instance using the specified properties. * @param [properties] Properties to set @@ -5452,6 +6744,665 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a TransactionData. */ + interface ITransactionData { + + /** TransactionData transactionId */ + transactionId?: (string|null); + + /** TransactionData paymentMethod */ + paymentMethod?: (string|null); + + /** TransactionData cardBin */ + cardBin?: (string|null); + + /** TransactionData cardLastFour */ + cardLastFour?: (string|null); + + /** TransactionData currencyCode */ + currencyCode?: (string|null); + + /** TransactionData value */ + value?: (number|null); + + /** TransactionData shippingValue */ + shippingValue?: (number|null); + + /** TransactionData shippingAddress */ + shippingAddress?: (google.cloud.recaptchaenterprise.v1beta1.TransactionData.IAddress|null); + + /** TransactionData billingAddress */ + billingAddress?: (google.cloud.recaptchaenterprise.v1beta1.TransactionData.IAddress|null); + + /** TransactionData user */ + user?: (google.cloud.recaptchaenterprise.v1beta1.TransactionData.IUser|null); + + /** TransactionData merchants */ + merchants?: (google.cloud.recaptchaenterprise.v1beta1.TransactionData.IUser[]|null); + + /** TransactionData items */ + items?: (google.cloud.recaptchaenterprise.v1beta1.TransactionData.IItem[]|null); + + /** TransactionData gatewayInfo */ + gatewayInfo?: (google.cloud.recaptchaenterprise.v1beta1.TransactionData.IGatewayInfo|null); + } + + /** Represents a TransactionData. */ + class TransactionData implements ITransactionData { + + /** + * Constructs a new TransactionData. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.ITransactionData); + + /** TransactionData transactionId. */ + public transactionId?: (string|null); + + /** TransactionData paymentMethod. */ + public paymentMethod: string; + + /** TransactionData cardBin. */ + public cardBin: string; + + /** TransactionData cardLastFour. */ + public cardLastFour: string; + + /** TransactionData currencyCode. */ + public currencyCode: string; + + /** TransactionData value. */ + public value: number; + + /** TransactionData shippingValue. */ + public shippingValue: number; + + /** TransactionData shippingAddress. */ + public shippingAddress?: (google.cloud.recaptchaenterprise.v1beta1.TransactionData.IAddress|null); + + /** TransactionData billingAddress. */ + public billingAddress?: (google.cloud.recaptchaenterprise.v1beta1.TransactionData.IAddress|null); + + /** TransactionData user. */ + public user?: (google.cloud.recaptchaenterprise.v1beta1.TransactionData.IUser|null); + + /** TransactionData merchants. */ + public merchants: google.cloud.recaptchaenterprise.v1beta1.TransactionData.IUser[]; + + /** TransactionData items. */ + public items: google.cloud.recaptchaenterprise.v1beta1.TransactionData.IItem[]; + + /** TransactionData gatewayInfo. */ + public gatewayInfo?: (google.cloud.recaptchaenterprise.v1beta1.TransactionData.IGatewayInfo|null); + + /** TransactionData _transactionId. */ + public _transactionId?: "transactionId"; + + /** + * Creates a new TransactionData instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionData instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.ITransactionData): google.cloud.recaptchaenterprise.v1beta1.TransactionData; + + /** + * Encodes the specified TransactionData message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TransactionData.verify|verify} messages. + * @param message TransactionData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.ITransactionData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransactionData message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TransactionData.verify|verify} messages. + * @param message TransactionData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.ITransactionData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransactionData + * @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.v1beta1.TransactionData; + + /** + * Decodes a TransactionData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransactionData + * @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.v1beta1.TransactionData; + + /** + * Verifies a TransactionData 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 a TransactionData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransactionData + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.TransactionData; + + /** + * Creates a plain object from a TransactionData message. Also converts values to other types if specified. + * @param message TransactionData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.TransactionData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransactionData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransactionData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TransactionData { + + /** Properties of an Address. */ + interface IAddress { + + /** Address recipient */ + recipient?: (string|null); + + /** Address address */ + address?: (string[]|null); + + /** Address locality */ + locality?: (string|null); + + /** Address administrativeArea */ + administrativeArea?: (string|null); + + /** Address regionCode */ + regionCode?: (string|null); + + /** Address postalCode */ + postalCode?: (string|null); + } + + /** Represents an Address. */ + class Address implements IAddress { + + /** + * Constructs a new Address. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.TransactionData.IAddress); + + /** Address recipient. */ + public recipient: string; + + /** Address address. */ + public address: string[]; + + /** Address locality. */ + public locality: string; + + /** Address administrativeArea. */ + public administrativeArea: string; + + /** Address regionCode. */ + public regionCode: string; + + /** Address postalCode. */ + public postalCode: string; + + /** + * Creates a new Address instance using the specified properties. + * @param [properties] Properties to set + * @returns Address instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.TransactionData.IAddress): google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address; + + /** + * Encodes the specified Address message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address.verify|verify} messages. + * @param message Address message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.TransactionData.IAddress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Address message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address.verify|verify} messages. + * @param message Address message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.TransactionData.IAddress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Address message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Address + * @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.v1beta1.TransactionData.Address; + + /** + * Decodes an Address message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Address + * @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.v1beta1.TransactionData.Address; + + /** + * Verifies an Address 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 Address message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Address + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address; + + /** + * Creates a plain object from an Address message. Also converts values to other types if specified. + * @param message Address + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Address to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Address + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a User. */ + interface IUser { + + /** User accountId */ + accountId?: (string|null); + + /** User creationMs */ + creationMs?: (number|Long|string|null); + + /** User email */ + email?: (string|null); + + /** User emailVerified */ + emailVerified?: (boolean|null); + + /** User phoneNumber */ + phoneNumber?: (string|null); + + /** User phoneVerified */ + phoneVerified?: (boolean|null); + } + + /** Represents a User. */ + class User implements IUser { + + /** + * Constructs a new User. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.TransactionData.IUser); + + /** User accountId. */ + public accountId: string; + + /** User creationMs. */ + public creationMs: (number|Long|string); + + /** User email. */ + public email: string; + + /** User emailVerified. */ + public emailVerified: boolean; + + /** User phoneNumber. */ + public phoneNumber: string; + + /** User phoneVerified. */ + public phoneVerified: boolean; + + /** + * Creates a new User instance using the specified properties. + * @param [properties] Properties to set + * @returns User instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.TransactionData.IUser): google.cloud.recaptchaenterprise.v1beta1.TransactionData.User; + + /** + * Encodes the specified User message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TransactionData.User.verify|verify} messages. + * @param message User message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.TransactionData.IUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified User message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TransactionData.User.verify|verify} messages. + * @param message User message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.TransactionData.IUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a User message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns User + * @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.v1beta1.TransactionData.User; + + /** + * Decodes a User message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns User + * @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.v1beta1.TransactionData.User; + + /** + * Verifies a User 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 a User message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns User + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.TransactionData.User; + + /** + * Creates a plain object from a User message. Also converts values to other types if specified. + * @param message User + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.TransactionData.User, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this User to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for User + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Item. */ + interface IItem { + + /** Item name */ + name?: (string|null); + + /** Item value */ + value?: (number|null); + + /** Item quantity */ + quantity?: (number|Long|string|null); + + /** Item merchantAccountId */ + merchantAccountId?: (string|null); + } + + /** Represents an Item. */ + class Item implements IItem { + + /** + * Constructs a new Item. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.TransactionData.IItem); + + /** Item name. */ + public name: string; + + /** Item value. */ + public value: number; + + /** Item quantity. */ + public quantity: (number|Long|string); + + /** Item merchantAccountId. */ + public merchantAccountId: string; + + /** + * Creates a new Item instance using the specified properties. + * @param [properties] Properties to set + * @returns Item instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.TransactionData.IItem): google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item; + + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.TransactionData.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.TransactionData.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Item message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Item + * @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.v1beta1.TransactionData.Item; + + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Item + * @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.v1beta1.TransactionData.Item; + + /** + * Verifies an Item 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 Item message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Item + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item; + + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @param message Item + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Item to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Item + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GatewayInfo. */ + interface IGatewayInfo { + + /** GatewayInfo name */ + name?: (string|null); + + /** GatewayInfo gatewayResponseCode */ + gatewayResponseCode?: (string|null); + + /** GatewayInfo avsResponseCode */ + avsResponseCode?: (string|null); + + /** GatewayInfo cvvResponseCode */ + cvvResponseCode?: (string|null); + } + + /** Represents a GatewayInfo. */ + class GatewayInfo implements IGatewayInfo { + + /** + * Constructs a new GatewayInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.TransactionData.IGatewayInfo); + + /** GatewayInfo name. */ + public name: string; + + /** GatewayInfo gatewayResponseCode. */ + public gatewayResponseCode: string; + + /** GatewayInfo avsResponseCode. */ + public avsResponseCode: string; + + /** GatewayInfo cvvResponseCode. */ + public cvvResponseCode: string; + + /** + * Creates a new GatewayInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GatewayInfo instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.TransactionData.IGatewayInfo): google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo; + + /** + * Encodes the specified GatewayInfo message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo.verify|verify} messages. + * @param message GatewayInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.TransactionData.IGatewayInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GatewayInfo message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo.verify|verify} messages. + * @param message GatewayInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.TransactionData.IGatewayInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GatewayInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GatewayInfo + * @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.v1beta1.TransactionData.GatewayInfo; + + /** + * Decodes a GatewayInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GatewayInfo + * @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.v1beta1.TransactionData.GatewayInfo; + + /** + * Verifies a GatewayInfo 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 a GatewayInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GatewayInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo; + + /** + * Creates a plain object from a GatewayInfo message. Also converts values to other types if specified. + * @param message GatewayInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GatewayInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GatewayInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a TokenProperties. */ interface ITokenProperties { @@ -5588,6 +7539,312 @@ export namespace google { } } + /** Properties of a FraudPreventionAssessment. */ + interface IFraudPreventionAssessment { + + /** FraudPreventionAssessment transactionRisk */ + transactionRisk?: (number|null); + + /** FraudPreventionAssessment stolenInstrumentVerdict */ + stolenInstrumentVerdict?: (google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.IStolenInstrumentVerdict|null); + + /** FraudPreventionAssessment cardTestingVerdict */ + cardTestingVerdict?: (google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.ICardTestingVerdict|null); + } + + /** Represents a FraudPreventionAssessment. */ + class FraudPreventionAssessment implements IFraudPreventionAssessment { + + /** + * Constructs a new FraudPreventionAssessment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IFraudPreventionAssessment); + + /** FraudPreventionAssessment transactionRisk. */ + public transactionRisk: number; + + /** FraudPreventionAssessment stolenInstrumentVerdict. */ + public stolenInstrumentVerdict?: (google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.IStolenInstrumentVerdict|null); + + /** FraudPreventionAssessment cardTestingVerdict. */ + public cardTestingVerdict?: (google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.ICardTestingVerdict|null); + + /** + * Creates a new FraudPreventionAssessment instance using the specified properties. + * @param [properties] Properties to set + * @returns FraudPreventionAssessment instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IFraudPreventionAssessment): google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment; + + /** + * Encodes the specified FraudPreventionAssessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.verify|verify} messages. + * @param message FraudPreventionAssessment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IFraudPreventionAssessment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FraudPreventionAssessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.verify|verify} messages. + * @param message FraudPreventionAssessment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IFraudPreventionAssessment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FraudPreventionAssessment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FraudPreventionAssessment + * @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.v1beta1.FraudPreventionAssessment; + + /** + * Decodes a FraudPreventionAssessment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FraudPreventionAssessment + * @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.v1beta1.FraudPreventionAssessment; + + /** + * Verifies a FraudPreventionAssessment 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 a FraudPreventionAssessment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FraudPreventionAssessment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment; + + /** + * Creates a plain object from a FraudPreventionAssessment message. Also converts values to other types if specified. + * @param message FraudPreventionAssessment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FraudPreventionAssessment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FraudPreventionAssessment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FraudPreventionAssessment { + + /** Properties of a StolenInstrumentVerdict. */ + interface IStolenInstrumentVerdict { + + /** StolenInstrumentVerdict risk */ + risk?: (number|null); + } + + /** Represents a StolenInstrumentVerdict. */ + class StolenInstrumentVerdict implements IStolenInstrumentVerdict { + + /** + * Constructs a new StolenInstrumentVerdict. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.IStolenInstrumentVerdict); + + /** StolenInstrumentVerdict risk. */ + public risk: number; + + /** + * Creates a new StolenInstrumentVerdict instance using the specified properties. + * @param [properties] Properties to set + * @returns StolenInstrumentVerdict instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.IStolenInstrumentVerdict): google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict; + + /** + * Encodes the specified StolenInstrumentVerdict message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict.verify|verify} messages. + * @param message StolenInstrumentVerdict message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.IStolenInstrumentVerdict, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StolenInstrumentVerdict message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict.verify|verify} messages. + * @param message StolenInstrumentVerdict message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.IStolenInstrumentVerdict, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StolenInstrumentVerdict message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StolenInstrumentVerdict + * @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.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict; + + /** + * Decodes a StolenInstrumentVerdict message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StolenInstrumentVerdict + * @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.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict; + + /** + * Verifies a StolenInstrumentVerdict 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 a StolenInstrumentVerdict message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StolenInstrumentVerdict + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict; + + /** + * Creates a plain object from a StolenInstrumentVerdict message. Also converts values to other types if specified. + * @param message StolenInstrumentVerdict + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StolenInstrumentVerdict to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StolenInstrumentVerdict + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CardTestingVerdict. */ + interface ICardTestingVerdict { + + /** CardTestingVerdict risk */ + risk?: (number|null); + } + + /** Represents a CardTestingVerdict. */ + class CardTestingVerdict implements ICardTestingVerdict { + + /** + * Constructs a new CardTestingVerdict. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.ICardTestingVerdict); + + /** CardTestingVerdict risk. */ + public risk: number; + + /** + * Creates a new CardTestingVerdict instance using the specified properties. + * @param [properties] Properties to set + * @returns CardTestingVerdict instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.ICardTestingVerdict): google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict; + + /** + * Encodes the specified CardTestingVerdict message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict.verify|verify} messages. + * @param message CardTestingVerdict message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.ICardTestingVerdict, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CardTestingVerdict message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict.verify|verify} messages. + * @param message CardTestingVerdict message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.ICardTestingVerdict, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CardTestingVerdict message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CardTestingVerdict + * @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.v1beta1.FraudPreventionAssessment.CardTestingVerdict; + + /** + * Decodes a CardTestingVerdict message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CardTestingVerdict + * @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.v1beta1.FraudPreventionAssessment.CardTestingVerdict; + + /** + * Verifies a CardTestingVerdict 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 a CardTestingVerdict message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CardTestingVerdict + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict; + + /** + * Creates a plain object from a CardTestingVerdict message. Also converts values to other types if specified. + * @param message CardTestingVerdict + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CardTestingVerdict to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CardTestingVerdict + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of an AccountDefenderAssessment. */ interface IAccountDefenderAssessment { diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index 29647a58374..9b4c546e671 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -762,6 +762,436 @@ return CreateAssessmentRequest; })(); + v1.TransactionEvent = (function() { + + /** + * Properties of a TransactionEvent. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface ITransactionEvent + * @property {google.cloud.recaptchaenterprise.v1.TransactionEvent.TransactionEventType|null} [eventType] TransactionEvent eventType + * @property {string|null} [reason] TransactionEvent reason + * @property {number|null} [value] TransactionEvent value + * @property {google.protobuf.ITimestamp|null} [eventTime] TransactionEvent eventTime + */ + + /** + * Constructs a new TransactionEvent. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a TransactionEvent. + * @implements ITransactionEvent + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.ITransactionEvent=} [properties] Properties to set + */ + function TransactionEvent(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]]; + } + + /** + * TransactionEvent eventType. + * @member {google.cloud.recaptchaenterprise.v1.TransactionEvent.TransactionEventType} eventType + * @memberof google.cloud.recaptchaenterprise.v1.TransactionEvent + * @instance + */ + TransactionEvent.prototype.eventType = 0; + + /** + * TransactionEvent reason. + * @member {string} reason + * @memberof google.cloud.recaptchaenterprise.v1.TransactionEvent + * @instance + */ + TransactionEvent.prototype.reason = ""; + + /** + * TransactionEvent value. + * @member {number} value + * @memberof google.cloud.recaptchaenterprise.v1.TransactionEvent + * @instance + */ + TransactionEvent.prototype.value = 0; + + /** + * TransactionEvent eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.recaptchaenterprise.v1.TransactionEvent + * @instance + */ + TransactionEvent.prototype.eventTime = null; + + /** + * Creates a new TransactionEvent instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.TransactionEvent + * @static + * @param {google.cloud.recaptchaenterprise.v1.ITransactionEvent=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.TransactionEvent} TransactionEvent instance + */ + TransactionEvent.create = function create(properties) { + return new TransactionEvent(properties); + }; + + /** + * Encodes the specified TransactionEvent message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TransactionEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.TransactionEvent + * @static + * @param {google.cloud.recaptchaenterprise.v1.ITransactionEvent} message TransactionEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eventType != null && Object.hasOwnProperty.call(message, "eventType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.eventType); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.reason); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.value); + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransactionEvent message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TransactionEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.TransactionEvent + * @static + * @param {google.cloud.recaptchaenterprise.v1.ITransactionEvent} message TransactionEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransactionEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.TransactionEvent + * @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.TransactionEvent} TransactionEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionEvent.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.TransactionEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.eventType = reader.int32(); + break; + } + case 2: { + message.reason = reader.string(); + break; + } + case 3: { + message.value = reader.double(); + break; + } + case 4: { + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransactionEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.TransactionEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.TransactionEvent} TransactionEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransactionEvent message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.TransactionEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransactionEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.eventType != null && message.hasOwnProperty("eventType")) + switch (message.eventType) { + default: + return "eventType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.reason != null && message.hasOwnProperty("reason")) + if (!$util.isString(message.reason)) + return "reason: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + return null; + }; + + /** + * Creates a TransactionEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.TransactionEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.TransactionEvent} TransactionEvent + */ + TransactionEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.TransactionEvent) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.TransactionEvent(); + switch (object.eventType) { + default: + if (typeof object.eventType === "number") { + message.eventType = object.eventType; + break; + } + break; + case "TRANSACTION_EVENT_TYPE_UNSPECIFIED": + case 0: + message.eventType = 0; + break; + case "MERCHANT_APPROVE": + case 1: + message.eventType = 1; + break; + case "MERCHANT_DENY": + case 2: + message.eventType = 2; + break; + case "MANUAL_REVIEW": + case 3: + message.eventType = 3; + break; + case "AUTHORIZATION": + case 4: + message.eventType = 4; + break; + case "AUTHORIZATION_DECLINE": + case 5: + message.eventType = 5; + break; + case "PAYMENT_CAPTURE": + case 6: + message.eventType = 6; + break; + case "PAYMENT_CAPTURE_DECLINE": + case 7: + message.eventType = 7; + break; + case "CANCEL": + case 8: + message.eventType = 8; + break; + case "CHARGEBACK_INQUIRY": + case 9: + message.eventType = 9; + break; + case "CHARGEBACK_ALERT": + case 10: + message.eventType = 10; + break; + case "FRAUD_NOTIFICATION": + case 11: + message.eventType = 11; + break; + case "CHARGEBACK": + case 12: + message.eventType = 12; + break; + case "CHARGEBACK_REPRESENTMENT": + case 13: + message.eventType = 13; + break; + case "CHARGEBACK_REVERSE": + case 14: + message.eventType = 14; + break; + case "REFUND_REQUEST": + case 15: + message.eventType = 15; + break; + case "REFUND_DECLINE": + case 16: + message.eventType = 16; + break; + case "REFUND": + case 17: + message.eventType = 17; + break; + case "REFUND_REVERSE": + case 18: + message.eventType = 18; + break; + } + if (object.reason != null) + message.reason = String(object.reason); + if (object.value != null) + message.value = Number(object.value); + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.TransactionEvent.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + return message; + }; + + /** + * Creates a plain object from a TransactionEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.TransactionEvent + * @static + * @param {google.cloud.recaptchaenterprise.v1.TransactionEvent} message TransactionEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransactionEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.eventType = options.enums === String ? "TRANSACTION_EVENT_TYPE_UNSPECIFIED" : 0; + object.reason = ""; + object.value = 0; + object.eventTime = null; + } + if (message.eventType != null && message.hasOwnProperty("eventType")) + object.eventType = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.TransactionEvent.TransactionEventType[message.eventType] === undefined ? message.eventType : $root.google.cloud.recaptchaenterprise.v1.TransactionEvent.TransactionEventType[message.eventType] : message.eventType; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = message.reason; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + return object; + }; + + /** + * Converts this TransactionEvent to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.TransactionEvent + * @instance + * @returns {Object.} JSON object + */ + TransactionEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransactionEvent + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.TransactionEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.TransactionEvent"; + }; + + /** + * TransactionEventType enum. + * @name google.cloud.recaptchaenterprise.v1.TransactionEvent.TransactionEventType + * @enum {number} + * @property {number} TRANSACTION_EVENT_TYPE_UNSPECIFIED=0 TRANSACTION_EVENT_TYPE_UNSPECIFIED value + * @property {number} MERCHANT_APPROVE=1 MERCHANT_APPROVE value + * @property {number} MERCHANT_DENY=2 MERCHANT_DENY value + * @property {number} MANUAL_REVIEW=3 MANUAL_REVIEW value + * @property {number} AUTHORIZATION=4 AUTHORIZATION value + * @property {number} AUTHORIZATION_DECLINE=5 AUTHORIZATION_DECLINE value + * @property {number} PAYMENT_CAPTURE=6 PAYMENT_CAPTURE value + * @property {number} PAYMENT_CAPTURE_DECLINE=7 PAYMENT_CAPTURE_DECLINE value + * @property {number} CANCEL=8 CANCEL value + * @property {number} CHARGEBACK_INQUIRY=9 CHARGEBACK_INQUIRY value + * @property {number} CHARGEBACK_ALERT=10 CHARGEBACK_ALERT value + * @property {number} FRAUD_NOTIFICATION=11 FRAUD_NOTIFICATION value + * @property {number} CHARGEBACK=12 CHARGEBACK value + * @property {number} CHARGEBACK_REPRESENTMENT=13 CHARGEBACK_REPRESENTMENT value + * @property {number} CHARGEBACK_REVERSE=14 CHARGEBACK_REVERSE value + * @property {number} REFUND_REQUEST=15 REFUND_REQUEST value + * @property {number} REFUND_DECLINE=16 REFUND_DECLINE value + * @property {number} REFUND=17 REFUND value + * @property {number} REFUND_REVERSE=18 REFUND_REVERSE value + */ + TransactionEvent.TransactionEventType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRANSACTION_EVENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MERCHANT_APPROVE"] = 1; + values[valuesById[2] = "MERCHANT_DENY"] = 2; + values[valuesById[3] = "MANUAL_REVIEW"] = 3; + values[valuesById[4] = "AUTHORIZATION"] = 4; + values[valuesById[5] = "AUTHORIZATION_DECLINE"] = 5; + values[valuesById[6] = "PAYMENT_CAPTURE"] = 6; + values[valuesById[7] = "PAYMENT_CAPTURE_DECLINE"] = 7; + values[valuesById[8] = "CANCEL"] = 8; + values[valuesById[9] = "CHARGEBACK_INQUIRY"] = 9; + values[valuesById[10] = "CHARGEBACK_ALERT"] = 10; + values[valuesById[11] = "FRAUD_NOTIFICATION"] = 11; + values[valuesById[12] = "CHARGEBACK"] = 12; + values[valuesById[13] = "CHARGEBACK_REPRESENTMENT"] = 13; + values[valuesById[14] = "CHARGEBACK_REVERSE"] = 14; + values[valuesById[15] = "REFUND_REQUEST"] = 15; + values[valuesById[16] = "REFUND_DECLINE"] = 16; + values[valuesById[17] = "REFUND"] = 17; + values[valuesById[18] = "REFUND_REVERSE"] = 18; + return values; + })(); + + return TransactionEvent; + })(); + v1.AnnotateAssessmentRequest = (function() { /** @@ -772,6 +1202,7 @@ * @property {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation|null} [annotation] AnnotateAssessmentRequest annotation * @property {Array.|null} [reasons] AnnotateAssessmentRequest reasons * @property {Uint8Array|null} [hashedAccountId] AnnotateAssessmentRequest hashedAccountId + * @property {google.cloud.recaptchaenterprise.v1.ITransactionEvent|null} [transactionEvent] AnnotateAssessmentRequest transactionEvent */ /** @@ -822,6 +1253,14 @@ */ AnnotateAssessmentRequest.prototype.hashedAccountId = $util.newBuffer([]); + /** + * AnnotateAssessmentRequest transactionEvent. + * @member {google.cloud.recaptchaenterprise.v1.ITransactionEvent|null|undefined} transactionEvent + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest + * @instance + */ + AnnotateAssessmentRequest.prototype.transactionEvent = null; + /** * Creates a new AnnotateAssessmentRequest instance using the specified properties. * @function create @@ -858,6 +1297,8 @@ } if (message.hashedAccountId != null && Object.hasOwnProperty.call(message, "hashedAccountId")) writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.hashedAccountId); + if (message.transactionEvent != null && Object.hasOwnProperty.call(message, "transactionEvent")) + $root.google.cloud.recaptchaenterprise.v1.TransactionEvent.encode(message.transactionEvent, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -915,6 +1356,10 @@ message.hashedAccountId = reader.bytes(); break; } + case 5: { + message.transactionEvent = $root.google.cloud.recaptchaenterprise.v1.TransactionEvent.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -992,6 +1437,11 @@ if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) if (!(message.hashedAccountId && typeof message.hashedAccountId.length === "number" || $util.isString(message.hashedAccountId))) return "hashedAccountId: buffer expected"; + if (message.transactionEvent != null && message.hasOwnProperty("transactionEvent")) { + var error = $root.google.cloud.recaptchaenterprise.v1.TransactionEvent.verify(message.transactionEvent); + if (error) + return "transactionEvent." + error; + } return null; }; @@ -1115,6 +1565,11 @@ $util.base64.decode(object.hashedAccountId, message.hashedAccountId = $util.newBuffer($util.base64.length(object.hashedAccountId)), 0); else if (object.hashedAccountId.length >= 0) message.hashedAccountId = object.hashedAccountId; + if (object.transactionEvent != null) { + if (typeof object.transactionEvent !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.transactionEvent: object expected"); + message.transactionEvent = $root.google.cloud.recaptchaenterprise.v1.TransactionEvent.fromObject(object.transactionEvent); + } return message; }; @@ -1143,6 +1598,7 @@ if (options.bytes !== Array) object.hashedAccountId = $util.newBuffer(object.hashedAccountId); } + object.transactionEvent = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -1155,6 +1611,8 @@ } if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) object.hashedAccountId = options.bytes === String ? $util.base64.encode(message.hashedAccountId, 0, message.hashedAccountId.length) : options.bytes === Array ? Array.prototype.slice.call(message.hashedAccountId) : message.hashedAccountId; + if (message.transactionEvent != null && message.hasOwnProperty("transactionEvent")) + object.transactionEvent = $root.google.cloud.recaptchaenterprise.v1.TransactionEvent.toObject(message.transactionEvent, options); return object; }; @@ -2442,6 +2900,7 @@ * @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 + * @property {google.cloud.recaptchaenterprise.v1.IFraudPreventionAssessment|null} [fraudPreventionAssessment] Assessment fraudPreventionAssessment */ /** @@ -2515,6 +2974,14 @@ */ Assessment.prototype.privatePasswordLeakVerification = null; + /** + * Assessment fraudPreventionAssessment. + * @member {google.cloud.recaptchaenterprise.v1.IFraudPreventionAssessment|null|undefined} fraudPreventionAssessment + * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @instance + */ + Assessment.prototype.fraudPreventionAssessment = null; + /** * Creates a new Assessment instance using the specified properties. * @function create @@ -2553,6 +3020,8 @@ $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")) $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.encode(message.privatePasswordLeakVerification, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.fraudPreventionAssessment != null && Object.hasOwnProperty.call(message, "fraudPreventionAssessment")) + $root.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.encode(message.fraudPreventionAssessment, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; }; @@ -2615,6 +3084,10 @@ message.privatePasswordLeakVerification = $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.decode(reader, reader.uint32()); break; } + case 11: { + message.fraudPreventionAssessment = $root.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -2683,6 +3156,11 @@ if (error) return "privatePasswordLeakVerification." + error; } + if (message.fraudPreventionAssessment != null && message.hasOwnProperty("fraudPreventionAssessment")) { + var error = $root.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.verify(message.fraudPreventionAssessment); + if (error) + return "fraudPreventionAssessment." + error; + } return null; }; @@ -2730,6 +3208,11 @@ throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.privatePasswordLeakVerification: object expected"); message.privatePasswordLeakVerification = $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.fromObject(object.privatePasswordLeakVerification); } + if (object.fraudPreventionAssessment != null) { + if (typeof object.fraudPreventionAssessment !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.fraudPreventionAssessment: object expected"); + message.fraudPreventionAssessment = $root.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.fromObject(object.fraudPreventionAssessment); + } return message; }; @@ -2754,6 +3237,7 @@ object.accountVerification = null; object.accountDefenderAssessment = null; object.privatePasswordLeakVerification = null; + object.fraudPreventionAssessment = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -2769,6 +3253,8 @@ object.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.toObject(message.accountDefenderAssessment, options); if (message.privatePasswordLeakVerification != null && message.hasOwnProperty("privatePasswordLeakVerification")) object.privatePasswordLeakVerification = $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.toObject(message.privatePasswordLeakVerification, options); + if (message.fraudPreventionAssessment != null && message.hasOwnProperty("fraudPreventionAssessment")) + object.fraudPreventionAssessment = $root.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.toObject(message.fraudPreventionAssessment, options); return object; }; @@ -2813,6 +3299,7 @@ * @property {string|null} [userIpAddress] Event userIpAddress * @property {string|null} [expectedAction] Event expectedAction * @property {Uint8Array|null} [hashedAccountId] Event hashedAccountId + * @property {google.cloud.recaptchaenterprise.v1.ITransactionData|null} [transactionData] Event transactionData */ /** @@ -2878,6 +3365,14 @@ */ Event.prototype.hashedAccountId = $util.newBuffer([]); + /** + * Event transactionData. + * @member {google.cloud.recaptchaenterprise.v1.ITransactionData|null|undefined} transactionData + * @memberof google.cloud.recaptchaenterprise.v1.Event + * @instance + */ + Event.prototype.transactionData = null; + /** * Creates a new Event instance using the specified properties. * @function create @@ -2914,6 +3409,8 @@ writer.uint32(/* id 5, wireType 2 =*/42).string(message.expectedAction); if (message.hashedAccountId != null && Object.hasOwnProperty.call(message, "hashedAccountId")) writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.hashedAccountId); + if (message.transactionData != null && Object.hasOwnProperty.call(message, "transactionData")) + $root.google.cloud.recaptchaenterprise.v1.TransactionData.encode(message.transactionData, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); return writer; }; @@ -2972,6 +3469,10 @@ message.hashedAccountId = reader.bytes(); break; } + case 13: { + message.transactionData = $root.google.cloud.recaptchaenterprise.v1.TransactionData.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -3025,6 +3526,11 @@ if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) if (!(message.hashedAccountId && typeof message.hashedAccountId.length === "number" || $util.isString(message.hashedAccountId))) return "hashedAccountId: buffer expected"; + if (message.transactionData != null && message.hasOwnProperty("transactionData")) { + var error = $root.google.cloud.recaptchaenterprise.v1.TransactionData.verify(message.transactionData); + if (error) + return "transactionData." + error; + } return null; }; @@ -3055,6 +3561,11 @@ $util.base64.decode(object.hashedAccountId, message.hashedAccountId = $util.newBuffer($util.base64.length(object.hashedAccountId)), 0); else if (object.hashedAccountId.length >= 0) message.hashedAccountId = object.hashedAccountId; + if (object.transactionData != null) { + if (typeof object.transactionData !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Event.transactionData: object expected"); + message.transactionData = $root.google.cloud.recaptchaenterprise.v1.TransactionData.fromObject(object.transactionData); + } return message; }; @@ -3084,6 +3595,7 @@ if (options.bytes !== Array) object.hashedAccountId = $util.newBuffer(object.hashedAccountId); } + object.transactionData = null; } if (message.token != null && message.hasOwnProperty("token")) object.token = message.token; @@ -3097,6 +3609,8 @@ object.expectedAction = message.expectedAction; if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) object.hashedAccountId = options.bytes === String ? $util.base64.encode(message.hashedAccountId, 0, message.hashedAccountId.length) : options.bytes === Array ? Array.prototype.slice.call(message.hashedAccountId) : message.hashedAccountId; + if (message.transactionData != null && message.hasOwnProperty("transactionData")) + object.transactionData = $root.google.cloud.recaptchaenterprise.v1.TransactionData.toObject(message.transactionData, options); return object; }; @@ -3129,26 +3643,38 @@ return Event; })(); - v1.RiskAnalysis = (function() { + v1.TransactionData = (function() { /** - * Properties of a RiskAnalysis. + * Properties of a TransactionData. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IRiskAnalysis - * @property {number|null} [score] RiskAnalysis score - * @property {Array.|null} [reasons] RiskAnalysis reasons - */ - - /** - * Constructs a new RiskAnalysis. + * @interface ITransactionData + * @property {string|null} [transactionId] TransactionData transactionId + * @property {string|null} [paymentMethod] TransactionData paymentMethod + * @property {string|null} [cardBin] TransactionData cardBin + * @property {string|null} [cardLastFour] TransactionData cardLastFour + * @property {string|null} [currencyCode] TransactionData currencyCode + * @property {number|null} [value] TransactionData value + * @property {number|null} [shippingValue] TransactionData shippingValue + * @property {google.cloud.recaptchaenterprise.v1.TransactionData.IAddress|null} [shippingAddress] TransactionData shippingAddress + * @property {google.cloud.recaptchaenterprise.v1.TransactionData.IAddress|null} [billingAddress] TransactionData billingAddress + * @property {google.cloud.recaptchaenterprise.v1.TransactionData.IUser|null} [user] TransactionData user + * @property {Array.|null} [merchants] TransactionData merchants + * @property {Array.|null} [items] TransactionData items + * @property {google.cloud.recaptchaenterprise.v1.TransactionData.IGatewayInfo|null} [gatewayInfo] TransactionData gatewayInfo + */ + + /** + * Constructs a new TransactionData. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents a RiskAnalysis. - * @implements IRiskAnalysis + * @classdesc Represents a TransactionData. + * @implements ITransactionData * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IRiskAnalysis=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.ITransactionData=} [properties] Properties to set */ - function RiskAnalysis(properties) { - this.reasons = []; + function TransactionData(properties) { + this.merchants = []; + this.items = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3156,100 +3682,263 @@ } /** - * RiskAnalysis score. - * @member {number} score - * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * TransactionData transactionId. + * @member {string|null|undefined} transactionId + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData * @instance */ - RiskAnalysis.prototype.score = 0; + TransactionData.prototype.transactionId = null; /** - * RiskAnalysis reasons. - * @member {Array.} reasons - * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * TransactionData paymentMethod. + * @member {string} paymentMethod + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData * @instance */ - RiskAnalysis.prototype.reasons = $util.emptyArray; + TransactionData.prototype.paymentMethod = ""; /** - * Creates a new RiskAnalysis instance using the specified properties. + * TransactionData cardBin. + * @member {string} cardBin + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData + * @instance + */ + TransactionData.prototype.cardBin = ""; + + /** + * TransactionData cardLastFour. + * @member {string} cardLastFour + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData + * @instance + */ + TransactionData.prototype.cardLastFour = ""; + + /** + * TransactionData currencyCode. + * @member {string} currencyCode + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData + * @instance + */ + TransactionData.prototype.currencyCode = ""; + + /** + * TransactionData value. + * @member {number} value + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData + * @instance + */ + TransactionData.prototype.value = 0; + + /** + * TransactionData shippingValue. + * @member {number} shippingValue + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData + * @instance + */ + TransactionData.prototype.shippingValue = 0; + + /** + * TransactionData shippingAddress. + * @member {google.cloud.recaptchaenterprise.v1.TransactionData.IAddress|null|undefined} shippingAddress + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData + * @instance + */ + TransactionData.prototype.shippingAddress = null; + + /** + * TransactionData billingAddress. + * @member {google.cloud.recaptchaenterprise.v1.TransactionData.IAddress|null|undefined} billingAddress + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData + * @instance + */ + TransactionData.prototype.billingAddress = null; + + /** + * TransactionData user. + * @member {google.cloud.recaptchaenterprise.v1.TransactionData.IUser|null|undefined} user + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData + * @instance + */ + TransactionData.prototype.user = null; + + /** + * TransactionData merchants. + * @member {Array.} merchants + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData + * @instance + */ + TransactionData.prototype.merchants = $util.emptyArray; + + /** + * TransactionData items. + * @member {Array.} items + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData + * @instance + */ + TransactionData.prototype.items = $util.emptyArray; + + /** + * TransactionData gatewayInfo. + * @member {google.cloud.recaptchaenterprise.v1.TransactionData.IGatewayInfo|null|undefined} gatewayInfo + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData + * @instance + */ + TransactionData.prototype.gatewayInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransactionData _transactionId. + * @member {"transactionId"|undefined} _transactionId + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData + * @instance + */ + Object.defineProperty(TransactionData.prototype, "_transactionId", { + get: $util.oneOfGetter($oneOfFields = ["transactionId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionData instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData * @static - * @param {google.cloud.recaptchaenterprise.v1.IRiskAnalysis=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.RiskAnalysis} RiskAnalysis instance + * @param {google.cloud.recaptchaenterprise.v1.ITransactionData=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.TransactionData} TransactionData instance */ - RiskAnalysis.create = function create(properties) { - return new RiskAnalysis(properties); + TransactionData.create = function create(properties) { + return new TransactionData(properties); }; /** - * Encodes the specified RiskAnalysis message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RiskAnalysis.verify|verify} messages. + * Encodes the specified TransactionData message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TransactionData.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData * @static - * @param {google.cloud.recaptchaenterprise.v1.IRiskAnalysis} message RiskAnalysis message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.ITransactionData} message TransactionData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RiskAnalysis.encode = function encode(message, writer) { + TransactionData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.score != null && Object.hasOwnProperty.call(message, "score")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); - if (message.reasons != null && message.reasons.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.reasons.length; ++i) - writer.int32(message.reasons[i]); - writer.ldelim(); - } + if (message.paymentMethod != null && Object.hasOwnProperty.call(message, "paymentMethod")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paymentMethod); + if (message.cardBin != null && Object.hasOwnProperty.call(message, "cardBin")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cardBin); + if (message.cardLastFour != null && Object.hasOwnProperty.call(message, "cardLastFour")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.cardLastFour); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.currencyCode); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 5, wireType 1 =*/41).double(message.value); + if (message.shippingAddress != null && Object.hasOwnProperty.call(message, "shippingAddress")) + $root.google.cloud.recaptchaenterprise.v1.TransactionData.Address.encode(message.shippingAddress, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.billingAddress != null && Object.hasOwnProperty.call(message, "billingAddress")) + $root.google.cloud.recaptchaenterprise.v1.TransactionData.Address.encode(message.billingAddress, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + $root.google.cloud.recaptchaenterprise.v1.TransactionData.User.encode(message.user, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.gatewayInfo != null && Object.hasOwnProperty.call(message, "gatewayInfo")) + $root.google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo.encode(message.gatewayInfo, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.transactionId); + if (message.shippingValue != null && Object.hasOwnProperty.call(message, "shippingValue")) + writer.uint32(/* id 12, wireType 1 =*/97).double(message.shippingValue); + if (message.merchants != null && message.merchants.length) + for (var i = 0; i < message.merchants.length; ++i) + $root.google.cloud.recaptchaenterprise.v1.TransactionData.User.encode(message.merchants[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.recaptchaenterprise.v1.TransactionData.Item.encode(message.items[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); return writer; }; /** - * Encodes the specified RiskAnalysis message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RiskAnalysis.verify|verify} messages. + * Encodes the specified TransactionData message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TransactionData.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData * @static - * @param {google.cloud.recaptchaenterprise.v1.IRiskAnalysis} message RiskAnalysis message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.ITransactionData} message TransactionData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RiskAnalysis.encodeDelimited = function encodeDelimited(message, writer) { + TransactionData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RiskAnalysis message from the specified reader or buffer. + * Decodes a TransactionData message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData * @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.RiskAnalysis} RiskAnalysis + * @returns {google.cloud.recaptchaenterprise.v1.TransactionData} TransactionData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RiskAnalysis.decode = function decode(reader, length) { + TransactionData.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.RiskAnalysis(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.TransactionData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 11: { + message.transactionId = reader.string(); + break; + } case 1: { - message.score = reader.float(); + message.paymentMethod = reader.string(); break; } case 2: { - if (!(message.reasons && message.reasons.length)) - message.reasons = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.reasons.push(reader.int32()); - } else - message.reasons.push(reader.int32()); + message.cardBin = reader.string(); + break; + } + case 3: { + message.cardLastFour = reader.string(); + break; + } + case 4: { + message.currencyCode = reader.string(); + break; + } + case 5: { + message.value = reader.double(); + break; + } + case 12: { + message.shippingValue = reader.double(); + break; + } + case 6: { + message.shippingAddress = $root.google.cloud.recaptchaenterprise.v1.TransactionData.Address.decode(reader, reader.uint32()); + break; + } + case 7: { + message.billingAddress = $root.google.cloud.recaptchaenterprise.v1.TransactionData.Address.decode(reader, reader.uint32()); + break; + } + case 8: { + message.user = $root.google.cloud.recaptchaenterprise.v1.TransactionData.User.decode(reader, reader.uint32()); + break; + } + case 13: { + if (!(message.merchants && message.merchants.length)) + message.merchants = []; + message.merchants.push($root.google.cloud.recaptchaenterprise.v1.TransactionData.User.decode(reader, reader.uint32())); + break; + } + case 14: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.recaptchaenterprise.v1.TransactionData.Item.decode(reader, reader.uint32())); + break; + } + case 10: { + message.gatewayInfo = $root.google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo.decode(reader, reader.uint32()); break; } default: @@ -3261,210 +3950,1511 @@ }; /** - * Decodes a RiskAnalysis message from the specified reader or buffer, length delimited. + * Decodes a TransactionData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.RiskAnalysis} RiskAnalysis + * @returns {google.cloud.recaptchaenterprise.v1.TransactionData} TransactionData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RiskAnalysis.decodeDelimited = function decodeDelimited(reader) { + TransactionData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RiskAnalysis message. + * Verifies a TransactionData message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RiskAnalysis.verify = function verify(message) { + TransactionData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.score != null && message.hasOwnProperty("score")) - if (typeof message.score !== "number") - return "score: number expected"; - if (message.reasons != null && message.hasOwnProperty("reasons")) { - if (!Array.isArray(message.reasons)) - return "reasons: array expected"; - for (var i = 0; i < message.reasons.length; ++i) - switch (message.reasons[i]) { - default: - return "reasons: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } + var properties = {}; + if (message.transactionId != null && message.hasOwnProperty("transactionId")) { + properties._transactionId = 1; + if (!$util.isString(message.transactionId)) + return "transactionId: string expected"; + } + if (message.paymentMethod != null && message.hasOwnProperty("paymentMethod")) + if (!$util.isString(message.paymentMethod)) + return "paymentMethod: string expected"; + if (message.cardBin != null && message.hasOwnProperty("cardBin")) + if (!$util.isString(message.cardBin)) + return "cardBin: string expected"; + if (message.cardLastFour != null && message.hasOwnProperty("cardLastFour")) + if (!$util.isString(message.cardLastFour)) + return "cardLastFour: string expected"; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + if (message.shippingValue != null && message.hasOwnProperty("shippingValue")) + if (typeof message.shippingValue !== "number") + return "shippingValue: number expected"; + if (message.shippingAddress != null && message.hasOwnProperty("shippingAddress")) { + var error = $root.google.cloud.recaptchaenterprise.v1.TransactionData.Address.verify(message.shippingAddress); + if (error) + return "shippingAddress." + error; + } + if (message.billingAddress != null && message.hasOwnProperty("billingAddress")) { + var error = $root.google.cloud.recaptchaenterprise.v1.TransactionData.Address.verify(message.billingAddress); + if (error) + return "billingAddress." + error; + } + if (message.user != null && message.hasOwnProperty("user")) { + var error = $root.google.cloud.recaptchaenterprise.v1.TransactionData.User.verify(message.user); + if (error) + return "user." + error; + } + if (message.merchants != null && message.hasOwnProperty("merchants")) { + if (!Array.isArray(message.merchants)) + return "merchants: array expected"; + for (var i = 0; i < message.merchants.length; ++i) { + var error = $root.google.cloud.recaptchaenterprise.v1.TransactionData.User.verify(message.merchants[i]); + if (error) + return "merchants." + error; + } + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.recaptchaenterprise.v1.TransactionData.Item.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.gatewayInfo != null && message.hasOwnProperty("gatewayInfo")) { + var error = $root.google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo.verify(message.gatewayInfo); + if (error) + return "gatewayInfo." + error; } return null; }; /** - * Creates a RiskAnalysis message from a plain object. Also converts values to their respective internal types. + * Creates a TransactionData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.RiskAnalysis} RiskAnalysis + * @returns {google.cloud.recaptchaenterprise.v1.TransactionData} TransactionData */ - RiskAnalysis.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis) + TransactionData.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.TransactionData) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis(); - if (object.score != null) - message.score = Number(object.score); - if (object.reasons) { - if (!Array.isArray(object.reasons)) - throw TypeError(".google.cloud.recaptchaenterprise.v1.RiskAnalysis.reasons: array expected"); - message.reasons = []; - for (var i = 0; i < object.reasons.length; ++i) - switch (object.reasons[i]) { - default: - if (typeof object.reasons[i] === "number") { - message.reasons[i] = object.reasons[i]; - break; - } - case "CLASSIFICATION_REASON_UNSPECIFIED": - case 0: - message.reasons[i] = 0; - break; - case "AUTOMATION": - case 1: - message.reasons[i] = 1; - break; - case "UNEXPECTED_ENVIRONMENT": - case 2: - message.reasons[i] = 2; - break; - case "TOO_MUCH_TRAFFIC": - case 3: - message.reasons[i] = 3; - break; - case "UNEXPECTED_USAGE_PATTERNS": - case 4: - message.reasons[i] = 4; - break; - case "LOW_CONFIDENCE_SCORE": - case 5: - message.reasons[i] = 5; - break; - } + var message = new $root.google.cloud.recaptchaenterprise.v1.TransactionData(); + if (object.transactionId != null) + message.transactionId = String(object.transactionId); + if (object.paymentMethod != null) + message.paymentMethod = String(object.paymentMethod); + if (object.cardBin != null) + message.cardBin = String(object.cardBin); + if (object.cardLastFour != null) + message.cardLastFour = String(object.cardLastFour); + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); + if (object.value != null) + message.value = Number(object.value); + if (object.shippingValue != null) + message.shippingValue = Number(object.shippingValue); + if (object.shippingAddress != null) { + if (typeof object.shippingAddress !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.TransactionData.shippingAddress: object expected"); + message.shippingAddress = $root.google.cloud.recaptchaenterprise.v1.TransactionData.Address.fromObject(object.shippingAddress); + } + if (object.billingAddress != null) { + if (typeof object.billingAddress !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.TransactionData.billingAddress: object expected"); + message.billingAddress = $root.google.cloud.recaptchaenterprise.v1.TransactionData.Address.fromObject(object.billingAddress); + } + if (object.user != null) { + if (typeof object.user !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.TransactionData.user: object expected"); + message.user = $root.google.cloud.recaptchaenterprise.v1.TransactionData.User.fromObject(object.user); + } + if (object.merchants) { + if (!Array.isArray(object.merchants)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.TransactionData.merchants: array expected"); + message.merchants = []; + for (var i = 0; i < object.merchants.length; ++i) { + if (typeof object.merchants[i] !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.TransactionData.merchants: object expected"); + message.merchants[i] = $root.google.cloud.recaptchaenterprise.v1.TransactionData.User.fromObject(object.merchants[i]); + } + } + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.TransactionData.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.TransactionData.items: object expected"); + message.items[i] = $root.google.cloud.recaptchaenterprise.v1.TransactionData.Item.fromObject(object.items[i]); + } + } + if (object.gatewayInfo != null) { + if (typeof object.gatewayInfo !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.TransactionData.gatewayInfo: object expected"); + message.gatewayInfo = $root.google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo.fromObject(object.gatewayInfo); } return message; }; /** - * Creates a plain object from a RiskAnalysis message. Also converts values to other types if specified. + * Creates a plain object from a TransactionData message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData * @static - * @param {google.cloud.recaptchaenterprise.v1.RiskAnalysis} message RiskAnalysis + * @param {google.cloud.recaptchaenterprise.v1.TransactionData} message TransactionData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RiskAnalysis.toObject = function toObject(message, options) { + TransactionData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.reasons = []; - if (options.defaults) - object.score = 0; - if (message.score != null && message.hasOwnProperty("score")) - object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; - if (message.reasons && message.reasons.length) { - object.reasons = []; - for (var j = 0; j < message.reasons.length; ++j) - object.reasons[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason[message.reasons[j]] === undefined ? message.reasons[j] : $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason[message.reasons[j]] : message.reasons[j]; + if (options.arrays || options.defaults) { + object.merchants = []; + object.items = []; + } + if (options.defaults) { + object.paymentMethod = ""; + object.cardBin = ""; + object.cardLastFour = ""; + object.currencyCode = ""; + object.value = 0; + object.shippingAddress = null; + object.billingAddress = null; + object.user = null; + object.gatewayInfo = null; + object.shippingValue = 0; + } + if (message.paymentMethod != null && message.hasOwnProperty("paymentMethod")) + object.paymentMethod = message.paymentMethod; + if (message.cardBin != null && message.hasOwnProperty("cardBin")) + object.cardBin = message.cardBin; + if (message.cardLastFour != null && message.hasOwnProperty("cardLastFour")) + object.cardLastFour = message.cardLastFour; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + object.currencyCode = message.currencyCode; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + if (message.shippingAddress != null && message.hasOwnProperty("shippingAddress")) + object.shippingAddress = $root.google.cloud.recaptchaenterprise.v1.TransactionData.Address.toObject(message.shippingAddress, options); + if (message.billingAddress != null && message.hasOwnProperty("billingAddress")) + object.billingAddress = $root.google.cloud.recaptchaenterprise.v1.TransactionData.Address.toObject(message.billingAddress, options); + if (message.user != null && message.hasOwnProperty("user")) + object.user = $root.google.cloud.recaptchaenterprise.v1.TransactionData.User.toObject(message.user, options); + if (message.gatewayInfo != null && message.hasOwnProperty("gatewayInfo")) + object.gatewayInfo = $root.google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo.toObject(message.gatewayInfo, options); + if (message.transactionId != null && message.hasOwnProperty("transactionId")) { + object.transactionId = message.transactionId; + if (options.oneofs) + object._transactionId = "transactionId"; + } + if (message.shippingValue != null && message.hasOwnProperty("shippingValue")) + object.shippingValue = options.json && !isFinite(message.shippingValue) ? String(message.shippingValue) : message.shippingValue; + if (message.merchants && message.merchants.length) { + object.merchants = []; + for (var j = 0; j < message.merchants.length; ++j) + object.merchants[j] = $root.google.cloud.recaptchaenterprise.v1.TransactionData.User.toObject(message.merchants[j], options); + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.recaptchaenterprise.v1.TransactionData.Item.toObject(message.items[j], options); } return object; }; /** - * Converts this RiskAnalysis to JSON. + * Converts this TransactionData to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData * @instance * @returns {Object.} JSON object */ - RiskAnalysis.prototype.toJSON = function toJSON() { + TransactionData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RiskAnalysis + * Gets the default type url for TransactionData * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RiskAnalysis.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + TransactionData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.RiskAnalysis"; - }; - - /** - * ClassificationReason enum. - * @name google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason - * @enum {number} - * @property {number} CLASSIFICATION_REASON_UNSPECIFIED=0 CLASSIFICATION_REASON_UNSPECIFIED value - * @property {number} AUTOMATION=1 AUTOMATION value - * @property {number} UNEXPECTED_ENVIRONMENT=2 UNEXPECTED_ENVIRONMENT value - * @property {number} TOO_MUCH_TRAFFIC=3 TOO_MUCH_TRAFFIC value - * @property {number} UNEXPECTED_USAGE_PATTERNS=4 UNEXPECTED_USAGE_PATTERNS value - * @property {number} LOW_CONFIDENCE_SCORE=5 LOW_CONFIDENCE_SCORE value - */ - RiskAnalysis.ClassificationReason = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLASSIFICATION_REASON_UNSPECIFIED"] = 0; - values[valuesById[1] = "AUTOMATION"] = 1; - values[valuesById[2] = "UNEXPECTED_ENVIRONMENT"] = 2; - values[valuesById[3] = "TOO_MUCH_TRAFFIC"] = 3; - values[valuesById[4] = "UNEXPECTED_USAGE_PATTERNS"] = 4; - values[valuesById[5] = "LOW_CONFIDENCE_SCORE"] = 5; - return values; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.TransactionData"; + }; + + TransactionData.Address = (function() { + + /** + * Properties of an Address. + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData + * @interface IAddress + * @property {string|null} [recipient] Address recipient + * @property {Array.|null} [address] Address address + * @property {string|null} [locality] Address locality + * @property {string|null} [administrativeArea] Address administrativeArea + * @property {string|null} [regionCode] Address regionCode + * @property {string|null} [postalCode] Address postalCode + */ + + /** + * Constructs a new Address. + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData + * @classdesc Represents an Address. + * @implements IAddress + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.TransactionData.IAddress=} [properties] Properties to set + */ + function Address(properties) { + this.address = []; + 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]]; + } + + /** + * Address recipient. + * @member {string} recipient + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Address + * @instance + */ + Address.prototype.recipient = ""; + + /** + * Address address. + * @member {Array.} address + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Address + * @instance + */ + Address.prototype.address = $util.emptyArray; + + /** + * Address locality. + * @member {string} locality + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Address + * @instance + */ + Address.prototype.locality = ""; + + /** + * Address administrativeArea. + * @member {string} administrativeArea + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Address + * @instance + */ + Address.prototype.administrativeArea = ""; + + /** + * Address regionCode. + * @member {string} regionCode + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Address + * @instance + */ + Address.prototype.regionCode = ""; + + /** + * Address postalCode. + * @member {string} postalCode + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Address + * @instance + */ + Address.prototype.postalCode = ""; + + /** + * Creates a new Address instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Address + * @static + * @param {google.cloud.recaptchaenterprise.v1.TransactionData.IAddress=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.TransactionData.Address} Address instance + */ + Address.create = function create(properties) { + return new Address(properties); + }; + + /** + * Encodes the specified Address message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TransactionData.Address.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Address + * @static + * @param {google.cloud.recaptchaenterprise.v1.TransactionData.IAddress} message Address message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Address.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recipient != null && Object.hasOwnProperty.call(message, "recipient")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.recipient); + if (message.address != null && message.address.length) + for (var i = 0; i < message.address.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.address[i]); + if (message.locality != null && Object.hasOwnProperty.call(message, "locality")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.locality); + if (message.administrativeArea != null && Object.hasOwnProperty.call(message, "administrativeArea")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.administrativeArea); + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.regionCode); + if (message.postalCode != null && Object.hasOwnProperty.call(message, "postalCode")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.postalCode); + return writer; + }; + + /** + * Encodes the specified Address message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TransactionData.Address.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Address + * @static + * @param {google.cloud.recaptchaenterprise.v1.TransactionData.IAddress} message Address message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Address.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Address message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Address + * @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.TransactionData.Address} Address + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Address.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.TransactionData.Address(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.recipient = reader.string(); + break; + } + case 2: { + if (!(message.address && message.address.length)) + message.address = []; + message.address.push(reader.string()); + break; + } + case 3: { + message.locality = reader.string(); + break; + } + case 4: { + message.administrativeArea = reader.string(); + break; + } + case 5: { + message.regionCode = reader.string(); + break; + } + case 6: { + message.postalCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Address message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Address + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.TransactionData.Address} Address + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Address.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Address message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Address + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Address.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recipient != null && message.hasOwnProperty("recipient")) + if (!$util.isString(message.recipient)) + return "recipient: string expected"; + if (message.address != null && message.hasOwnProperty("address")) { + if (!Array.isArray(message.address)) + return "address: array expected"; + for (var i = 0; i < message.address.length; ++i) + if (!$util.isString(message.address[i])) + return "address: string[] expected"; + } + if (message.locality != null && message.hasOwnProperty("locality")) + if (!$util.isString(message.locality)) + return "locality: string expected"; + if (message.administrativeArea != null && message.hasOwnProperty("administrativeArea")) + if (!$util.isString(message.administrativeArea)) + return "administrativeArea: string expected"; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + if (message.postalCode != null && message.hasOwnProperty("postalCode")) + if (!$util.isString(message.postalCode)) + return "postalCode: string expected"; + return null; + }; + + /** + * Creates an Address message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Address + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.TransactionData.Address} Address + */ + Address.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.TransactionData.Address) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.TransactionData.Address(); + if (object.recipient != null) + message.recipient = String(object.recipient); + if (object.address) { + if (!Array.isArray(object.address)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.TransactionData.Address.address: array expected"); + message.address = []; + for (var i = 0; i < object.address.length; ++i) + message.address[i] = String(object.address[i]); + } + if (object.locality != null) + message.locality = String(object.locality); + if (object.administrativeArea != null) + message.administrativeArea = String(object.administrativeArea); + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + if (object.postalCode != null) + message.postalCode = String(object.postalCode); + return message; + }; + + /** + * Creates a plain object from an Address message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Address + * @static + * @param {google.cloud.recaptchaenterprise.v1.TransactionData.Address} message Address + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Address.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.address = []; + if (options.defaults) { + object.recipient = ""; + object.locality = ""; + object.administrativeArea = ""; + object.regionCode = ""; + object.postalCode = ""; + } + if (message.recipient != null && message.hasOwnProperty("recipient")) + object.recipient = message.recipient; + if (message.address && message.address.length) { + object.address = []; + for (var j = 0; j < message.address.length; ++j) + object.address[j] = message.address[j]; + } + if (message.locality != null && message.hasOwnProperty("locality")) + object.locality = message.locality; + if (message.administrativeArea != null && message.hasOwnProperty("administrativeArea")) + object.administrativeArea = message.administrativeArea; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + if (message.postalCode != null && message.hasOwnProperty("postalCode")) + object.postalCode = message.postalCode; + return object; + }; + + /** + * Converts this Address to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Address + * @instance + * @returns {Object.} JSON object + */ + Address.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Address + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Address + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Address.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.TransactionData.Address"; + }; + + return Address; })(); - return RiskAnalysis; + TransactionData.User = (function() { + + /** + * Properties of a User. + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData + * @interface IUser + * @property {string|null} [accountId] User accountId + * @property {number|Long|null} [creationMs] User creationMs + * @property {string|null} [email] User email + * @property {boolean|null} [emailVerified] User emailVerified + * @property {string|null} [phoneNumber] User phoneNumber + * @property {boolean|null} [phoneVerified] User phoneVerified + */ + + /** + * Constructs a new User. + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData + * @classdesc Represents a User. + * @implements IUser + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.TransactionData.IUser=} [properties] Properties to set + */ + function User(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]]; + } + + /** + * User accountId. + * @member {string} accountId + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.User + * @instance + */ + User.prototype.accountId = ""; + + /** + * User creationMs. + * @member {number|Long} creationMs + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.User + * @instance + */ + User.prototype.creationMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * User email. + * @member {string} email + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.User + * @instance + */ + User.prototype.email = ""; + + /** + * User emailVerified. + * @member {boolean} emailVerified + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.User + * @instance + */ + User.prototype.emailVerified = false; + + /** + * User phoneNumber. + * @member {string} phoneNumber + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.User + * @instance + */ + User.prototype.phoneNumber = ""; + + /** + * User phoneVerified. + * @member {boolean} phoneVerified + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.User + * @instance + */ + User.prototype.phoneVerified = false; + + /** + * Creates a new User instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.User + * @static + * @param {google.cloud.recaptchaenterprise.v1.TransactionData.IUser=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.TransactionData.User} User instance + */ + User.create = function create(properties) { + return new User(properties); + }; + + /** + * Encodes the specified User message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TransactionData.User.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.User + * @static + * @param {google.cloud.recaptchaenterprise.v1.TransactionData.IUser} message User message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + User.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.creationMs != null && Object.hasOwnProperty.call(message, "creationMs")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.creationMs); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.email); + if (message.emailVerified != null && Object.hasOwnProperty.call(message, "emailVerified")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.emailVerified); + if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.phoneNumber); + if (message.phoneVerified != null && Object.hasOwnProperty.call(message, "phoneVerified")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.phoneVerified); + if (message.accountId != null && Object.hasOwnProperty.call(message, "accountId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.accountId); + return writer; + }; + + /** + * Encodes the specified User message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TransactionData.User.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.User + * @static + * @param {google.cloud.recaptchaenterprise.v1.TransactionData.IUser} message User message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + User.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a User message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.User + * @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.TransactionData.User} User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + User.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.TransactionData.User(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 6: { + message.accountId = reader.string(); + break; + } + case 1: { + message.creationMs = reader.int64(); + break; + } + case 2: { + message.email = reader.string(); + break; + } + case 3: { + message.emailVerified = reader.bool(); + break; + } + case 4: { + message.phoneNumber = reader.string(); + break; + } + case 5: { + message.phoneVerified = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a User message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.User + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.TransactionData.User} User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + User.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a User message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.User + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + User.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.accountId != null && message.hasOwnProperty("accountId")) + if (!$util.isString(message.accountId)) + return "accountId: string expected"; + if (message.creationMs != null && message.hasOwnProperty("creationMs")) + if (!$util.isInteger(message.creationMs) && !(message.creationMs && $util.isInteger(message.creationMs.low) && $util.isInteger(message.creationMs.high))) + return "creationMs: integer|Long expected"; + if (message.email != null && message.hasOwnProperty("email")) + if (!$util.isString(message.email)) + return "email: string expected"; + if (message.emailVerified != null && message.hasOwnProperty("emailVerified")) + if (typeof message.emailVerified !== "boolean") + return "emailVerified: boolean expected"; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + if (!$util.isString(message.phoneNumber)) + return "phoneNumber: string expected"; + if (message.phoneVerified != null && message.hasOwnProperty("phoneVerified")) + if (typeof message.phoneVerified !== "boolean") + return "phoneVerified: boolean expected"; + return null; + }; + + /** + * Creates a User message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.User + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.TransactionData.User} User + */ + User.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.TransactionData.User) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.TransactionData.User(); + if (object.accountId != null) + message.accountId = String(object.accountId); + if (object.creationMs != null) + if ($util.Long) + (message.creationMs = $util.Long.fromValue(object.creationMs)).unsigned = false; + else if (typeof object.creationMs === "string") + message.creationMs = parseInt(object.creationMs, 10); + else if (typeof object.creationMs === "number") + message.creationMs = object.creationMs; + else if (typeof object.creationMs === "object") + message.creationMs = new $util.LongBits(object.creationMs.low >>> 0, object.creationMs.high >>> 0).toNumber(); + if (object.email != null) + message.email = String(object.email); + if (object.emailVerified != null) + message.emailVerified = Boolean(object.emailVerified); + if (object.phoneNumber != null) + message.phoneNumber = String(object.phoneNumber); + if (object.phoneVerified != null) + message.phoneVerified = Boolean(object.phoneVerified); + return message; + }; + + /** + * Creates a plain object from a User message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.User + * @static + * @param {google.cloud.recaptchaenterprise.v1.TransactionData.User} message User + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + User.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.creationMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.creationMs = options.longs === String ? "0" : 0; + object.email = ""; + object.emailVerified = false; + object.phoneNumber = ""; + object.phoneVerified = false; + object.accountId = ""; + } + if (message.creationMs != null && message.hasOwnProperty("creationMs")) + if (typeof message.creationMs === "number") + object.creationMs = options.longs === String ? String(message.creationMs) : message.creationMs; + else + object.creationMs = options.longs === String ? $util.Long.prototype.toString.call(message.creationMs) : options.longs === Number ? new $util.LongBits(message.creationMs.low >>> 0, message.creationMs.high >>> 0).toNumber() : message.creationMs; + if (message.email != null && message.hasOwnProperty("email")) + object.email = message.email; + if (message.emailVerified != null && message.hasOwnProperty("emailVerified")) + object.emailVerified = message.emailVerified; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + object.phoneNumber = message.phoneNumber; + if (message.phoneVerified != null && message.hasOwnProperty("phoneVerified")) + object.phoneVerified = message.phoneVerified; + if (message.accountId != null && message.hasOwnProperty("accountId")) + object.accountId = message.accountId; + return object; + }; + + /** + * Converts this User to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.User + * @instance + * @returns {Object.} JSON object + */ + User.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for User + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.User + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + User.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.TransactionData.User"; + }; + + return User; + })(); + + TransactionData.Item = (function() { + + /** + * Properties of an Item. + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData + * @interface IItem + * @property {string|null} [name] Item name + * @property {number|null} [value] Item value + * @property {number|Long|null} [quantity] Item quantity + * @property {string|null} [merchantAccountId] Item merchantAccountId + */ + + /** + * Constructs a new Item. + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData + * @classdesc Represents an Item. + * @implements IItem + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.TransactionData.IItem=} [properties] Properties to set + */ + function Item(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]]; + } + + /** + * Item name. + * @member {string} name + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Item + * @instance + */ + Item.prototype.name = ""; + + /** + * Item value. + * @member {number} value + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Item + * @instance + */ + Item.prototype.value = 0; + + /** + * Item quantity. + * @member {number|Long} quantity + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Item + * @instance + */ + Item.prototype.quantity = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Item merchantAccountId. + * @member {string} merchantAccountId + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Item + * @instance + */ + Item.prototype.merchantAccountId = ""; + + /** + * Creates a new Item instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Item + * @static + * @param {google.cloud.recaptchaenterprise.v1.TransactionData.IItem=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.TransactionData.Item} Item instance + */ + Item.create = function create(properties) { + return new Item(properties); + }; + + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TransactionData.Item.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Item + * @static + * @param {google.cloud.recaptchaenterprise.v1.TransactionData.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.value); + if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.quantity); + if (message.merchantAccountId != null && Object.hasOwnProperty.call(message, "merchantAccountId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.merchantAccountId); + return writer; + }; + + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TransactionData.Item.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Item + * @static + * @param {google.cloud.recaptchaenterprise.v1.TransactionData.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Item message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Item + * @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.TransactionData.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.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.TransactionData.Item(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.value = reader.double(); + break; + } + case 3: { + message.quantity = reader.int64(); + break; + } + case 4: { + message.merchantAccountId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Item + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.TransactionData.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Item message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Item + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Item.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + if (message.quantity != null && message.hasOwnProperty("quantity")) + if (!$util.isInteger(message.quantity) && !(message.quantity && $util.isInteger(message.quantity.low) && $util.isInteger(message.quantity.high))) + return "quantity: integer|Long expected"; + if (message.merchantAccountId != null && message.hasOwnProperty("merchantAccountId")) + if (!$util.isString(message.merchantAccountId)) + return "merchantAccountId: string expected"; + return null; + }; + + /** + * Creates an Item message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Item + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.TransactionData.Item} Item + */ + Item.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.TransactionData.Item) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.TransactionData.Item(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) + message.value = Number(object.value); + if (object.quantity != null) + if ($util.Long) + (message.quantity = $util.Long.fromValue(object.quantity)).unsigned = false; + else if (typeof object.quantity === "string") + message.quantity = parseInt(object.quantity, 10); + else if (typeof object.quantity === "number") + message.quantity = object.quantity; + else if (typeof object.quantity === "object") + message.quantity = new $util.LongBits(object.quantity.low >>> 0, object.quantity.high >>> 0).toNumber(); + if (object.merchantAccountId != null) + message.merchantAccountId = String(object.merchantAccountId); + return message; + }; + + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Item + * @static + * @param {google.cloud.recaptchaenterprise.v1.TransactionData.Item} message Item + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Item.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.value = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.quantity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.quantity = options.longs === String ? "0" : 0; + object.merchantAccountId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + if (message.quantity != null && message.hasOwnProperty("quantity")) + if (typeof message.quantity === "number") + object.quantity = options.longs === String ? String(message.quantity) : message.quantity; + else + object.quantity = options.longs === String ? $util.Long.prototype.toString.call(message.quantity) : options.longs === Number ? new $util.LongBits(message.quantity.low >>> 0, message.quantity.high >>> 0).toNumber() : message.quantity; + if (message.merchantAccountId != null && message.hasOwnProperty("merchantAccountId")) + object.merchantAccountId = message.merchantAccountId; + return object; + }; + + /** + * Converts this Item to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Item + * @instance + * @returns {Object.} JSON object + */ + Item.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Item + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.Item + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Item.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.TransactionData.Item"; + }; + + return Item; + })(); + + TransactionData.GatewayInfo = (function() { + + /** + * Properties of a GatewayInfo. + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData + * @interface IGatewayInfo + * @property {string|null} [name] GatewayInfo name + * @property {string|null} [gatewayResponseCode] GatewayInfo gatewayResponseCode + * @property {string|null} [avsResponseCode] GatewayInfo avsResponseCode + * @property {string|null} [cvvResponseCode] GatewayInfo cvvResponseCode + */ + + /** + * Constructs a new GatewayInfo. + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData + * @classdesc Represents a GatewayInfo. + * @implements IGatewayInfo + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.TransactionData.IGatewayInfo=} [properties] Properties to set + */ + function GatewayInfo(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]]; + } + + /** + * GatewayInfo name. + * @member {string} name + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo + * @instance + */ + GatewayInfo.prototype.name = ""; + + /** + * GatewayInfo gatewayResponseCode. + * @member {string} gatewayResponseCode + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo + * @instance + */ + GatewayInfo.prototype.gatewayResponseCode = ""; + + /** + * GatewayInfo avsResponseCode. + * @member {string} avsResponseCode + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo + * @instance + */ + GatewayInfo.prototype.avsResponseCode = ""; + + /** + * GatewayInfo cvvResponseCode. + * @member {string} cvvResponseCode + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo + * @instance + */ + GatewayInfo.prototype.cvvResponseCode = ""; + + /** + * Creates a new GatewayInfo instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo + * @static + * @param {google.cloud.recaptchaenterprise.v1.TransactionData.IGatewayInfo=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo} GatewayInfo instance + */ + GatewayInfo.create = function create(properties) { + return new GatewayInfo(properties); + }; + + /** + * Encodes the specified GatewayInfo message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo + * @static + * @param {google.cloud.recaptchaenterprise.v1.TransactionData.IGatewayInfo} message GatewayInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GatewayInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.gatewayResponseCode != null && Object.hasOwnProperty.call(message, "gatewayResponseCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gatewayResponseCode); + if (message.avsResponseCode != null && Object.hasOwnProperty.call(message, "avsResponseCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.avsResponseCode); + if (message.cvvResponseCode != null && Object.hasOwnProperty.call(message, "cvvResponseCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.cvvResponseCode); + return writer; + }; + + /** + * Encodes the specified GatewayInfo message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo + * @static + * @param {google.cloud.recaptchaenterprise.v1.TransactionData.IGatewayInfo} message GatewayInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GatewayInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GatewayInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo + * @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.TransactionData.GatewayInfo} GatewayInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GatewayInfo.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.TransactionData.GatewayInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.gatewayResponseCode = reader.string(); + break; + } + case 3: { + message.avsResponseCode = reader.string(); + break; + } + case 4: { + message.cvvResponseCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GatewayInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo} GatewayInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GatewayInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GatewayInfo message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GatewayInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.gatewayResponseCode != null && message.hasOwnProperty("gatewayResponseCode")) + if (!$util.isString(message.gatewayResponseCode)) + return "gatewayResponseCode: string expected"; + if (message.avsResponseCode != null && message.hasOwnProperty("avsResponseCode")) + if (!$util.isString(message.avsResponseCode)) + return "avsResponseCode: string expected"; + if (message.cvvResponseCode != null && message.hasOwnProperty("cvvResponseCode")) + if (!$util.isString(message.cvvResponseCode)) + return "cvvResponseCode: string expected"; + return null; + }; + + /** + * Creates a GatewayInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo} GatewayInfo + */ + GatewayInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo(); + if (object.name != null) + message.name = String(object.name); + if (object.gatewayResponseCode != null) + message.gatewayResponseCode = String(object.gatewayResponseCode); + if (object.avsResponseCode != null) + message.avsResponseCode = String(object.avsResponseCode); + if (object.cvvResponseCode != null) + message.cvvResponseCode = String(object.cvvResponseCode); + return message; + }; + + /** + * Creates a plain object from a GatewayInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo + * @static + * @param {google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo} message GatewayInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GatewayInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.gatewayResponseCode = ""; + object.avsResponseCode = ""; + object.cvvResponseCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.gatewayResponseCode != null && message.hasOwnProperty("gatewayResponseCode")) + object.gatewayResponseCode = message.gatewayResponseCode; + if (message.avsResponseCode != null && message.hasOwnProperty("avsResponseCode")) + object.avsResponseCode = message.avsResponseCode; + if (message.cvvResponseCode != null && message.hasOwnProperty("cvvResponseCode")) + object.cvvResponseCode = message.cvvResponseCode; + return object; + }; + + /** + * Converts this GatewayInfo to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo + * @instance + * @returns {Object.} JSON object + */ + GatewayInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GatewayInfo + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GatewayInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo"; + }; + + return GatewayInfo; + })(); + + return TransactionData; })(); - v1.TokenProperties = (function() { + v1.RiskAnalysis = (function() { /** - * Properties of a TokenProperties. + * Properties of a RiskAnalysis. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface ITokenProperties - * @property {boolean|null} [valid] TokenProperties valid - * @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 + * @interface IRiskAnalysis + * @property {number|null} [score] RiskAnalysis score + * @property {Array.|null} [reasons] RiskAnalysis reasons */ /** - * Constructs a new TokenProperties. + * Constructs a new RiskAnalysis. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents a TokenProperties. - * @implements ITokenProperties + * @classdesc Represents a RiskAnalysis. + * @implements IRiskAnalysis * @constructor - * @param {google.cloud.recaptchaenterprise.v1.ITokenProperties=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IRiskAnalysis=} [properties] Properties to set */ - function TokenProperties(properties) { + function RiskAnalysis(properties) { + this.reasons = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3472,159 +5462,100 @@ } /** - * TokenProperties valid. - * @member {boolean} valid - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties - * @instance - */ - TokenProperties.prototype.valid = false; - - /** - * TokenProperties invalidReason. - * @member {google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason} invalidReason - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties - * @instance - */ - TokenProperties.prototype.invalidReason = 0; - - /** - * TokenProperties createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties - * @instance - */ - TokenProperties.prototype.createTime = null; - - /** - * TokenProperties hostname. - * @member {string} hostname - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties - * @instance - */ - 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 + * RiskAnalysis score. + * @member {number} score + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis * @instance */ - TokenProperties.prototype.iosBundleId = ""; + RiskAnalysis.prototype.score = 0; /** - * TokenProperties action. - * @member {string} action - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * RiskAnalysis reasons. + * @member {Array.} reasons + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis * @instance */ - TokenProperties.prototype.action = ""; + RiskAnalysis.prototype.reasons = $util.emptyArray; /** - * Creates a new TokenProperties instance using the specified properties. + * Creates a new RiskAnalysis instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis * @static - * @param {google.cloud.recaptchaenterprise.v1.ITokenProperties=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.TokenProperties} TokenProperties instance + * @param {google.cloud.recaptchaenterprise.v1.IRiskAnalysis=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.RiskAnalysis} RiskAnalysis instance */ - TokenProperties.create = function create(properties) { - return new TokenProperties(properties); + RiskAnalysis.create = function create(properties) { + return new RiskAnalysis(properties); }; /** - * Encodes the specified TokenProperties message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TokenProperties.verify|verify} messages. + * Encodes the specified RiskAnalysis message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RiskAnalysis.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis * @static - * @param {google.cloud.recaptchaenterprise.v1.ITokenProperties} message TokenProperties message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IRiskAnalysis} message RiskAnalysis message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TokenProperties.encode = function encode(message, writer) { + RiskAnalysis.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.valid != null && Object.hasOwnProperty.call(message, "valid")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.valid); - if (message.invalidReason != null && Object.hasOwnProperty.call(message, "invalidReason")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.invalidReason); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) - 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); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); + if (message.reasons != null && message.reasons.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.reasons.length; ++i) + writer.int32(message.reasons[i]); + writer.ldelim(); + } return writer; }; /** - * Encodes the specified TokenProperties message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TokenProperties.verify|verify} messages. + * Encodes the specified RiskAnalysis message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RiskAnalysis.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis * @static - * @param {google.cloud.recaptchaenterprise.v1.ITokenProperties} message TokenProperties message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IRiskAnalysis} message RiskAnalysis message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TokenProperties.encodeDelimited = function encodeDelimited(message, writer) { + RiskAnalysis.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TokenProperties message from the specified reader or buffer. + * Decodes a RiskAnalysis message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis * @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.TokenProperties} TokenProperties + * @returns {google.cloud.recaptchaenterprise.v1.RiskAnalysis} RiskAnalysis * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TokenProperties.decode = function decode(reader, length) { + RiskAnalysis.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.TokenProperties(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.valid = reader.bool(); + message.score = reader.float(); break; } case 2: { - message.invalidReason = reader.int32(); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - 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(); + if (!(message.reasons && message.reasons.length)) + message.reasons = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.reasons.push(reader.int32()); + } else + message.reasons.push(reader.int32()); break; } default: @@ -3636,245 +5567,224 @@ }; /** - * Decodes a TokenProperties message from the specified reader or buffer, length delimited. + * Decodes a RiskAnalysis message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.TokenProperties} TokenProperties + * @returns {google.cloud.recaptchaenterprise.v1.RiskAnalysis} RiskAnalysis * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TokenProperties.decodeDelimited = function decodeDelimited(reader) { + RiskAnalysis.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TokenProperties message. + * Verifies a RiskAnalysis message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TokenProperties.verify = function verify(message) { + RiskAnalysis.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.valid != null && message.hasOwnProperty("valid")) - if (typeof message.valid !== "boolean") - return "valid: boolean expected"; - if (message.invalidReason != null && message.hasOwnProperty("invalidReason")) - switch (message.invalidReason) { - default: - return "invalidReason: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.reasons != null && message.hasOwnProperty("reasons")) { + if (!Array.isArray(message.reasons)) + return "reasons: array expected"; + for (var i = 0; i < message.reasons.length; ++i) + switch (message.reasons[i]) { + default: + return "reasons: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } } - 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"; return null; }; /** - * Creates a TokenProperties message from a plain object. Also converts values to their respective internal types. + * Creates a RiskAnalysis message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.TokenProperties} TokenProperties + * @returns {google.cloud.recaptchaenterprise.v1.RiskAnalysis} RiskAnalysis */ - TokenProperties.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.TokenProperties) + RiskAnalysis.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.TokenProperties(); - if (object.valid != null) - message.valid = Boolean(object.valid); - switch (object.invalidReason) { - default: - if (typeof object.invalidReason === "number") { - message.invalidReason = object.invalidReason; - break; - } - break; - case "INVALID_REASON_UNSPECIFIED": - case 0: - message.invalidReason = 0; - break; - case "UNKNOWN_INVALID_REASON": - case 1: - message.invalidReason = 1; - break; - case "MALFORMED": - case 2: - message.invalidReason = 2; - break; - case "EXPIRED": - case 3: - message.invalidReason = 3; - break; - case "DUPE": - case 4: - message.invalidReason = 4; - break; - case "MISSING": - case 5: - message.invalidReason = 5; - break; - case "BROWSER_ERROR": - case 6: - message.invalidReason = 6; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.TokenProperties.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + var message = new $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis(); + if (object.score != null) + message.score = Number(object.score); + if (object.reasons) { + if (!Array.isArray(object.reasons)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.RiskAnalysis.reasons: array expected"); + message.reasons = []; + for (var i = 0; i < object.reasons.length; ++i) + switch (object.reasons[i]) { + default: + if (typeof object.reasons[i] === "number") { + message.reasons[i] = object.reasons[i]; + break; + } + case "CLASSIFICATION_REASON_UNSPECIFIED": + case 0: + message.reasons[i] = 0; + break; + case "AUTOMATION": + case 1: + message.reasons[i] = 1; + break; + case "UNEXPECTED_ENVIRONMENT": + case 2: + message.reasons[i] = 2; + break; + case "TOO_MUCH_TRAFFIC": + case 3: + message.reasons[i] = 3; + break; + case "UNEXPECTED_USAGE_PATTERNS": + case 4: + message.reasons[i] = 4; + break; + case "LOW_CONFIDENCE_SCORE": + case 5: + message.reasons[i] = 5; + break; + case "SUSPECTED_CARDING": + case 6: + message.reasons[i] = 6; + break; + case "SUSPECTED_CHARGEBACK": + case 7: + message.reasons[i] = 7; + break; + } } - 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; }; /** - * Creates a plain object from a TokenProperties message. Also converts values to other types if specified. + * Creates a plain object from a RiskAnalysis message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis * @static - * @param {google.cloud.recaptchaenterprise.v1.TokenProperties} message TokenProperties + * @param {google.cloud.recaptchaenterprise.v1.RiskAnalysis} message RiskAnalysis * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TokenProperties.toObject = function toObject(message, options) { + RiskAnalysis.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.valid = false; - object.invalidReason = options.enums === String ? "INVALID_REASON_UNSPECIFIED" : 0; - object.createTime = null; - object.hostname = ""; - object.action = ""; - object.androidPackageName = ""; - object.iosBundleId = ""; + if (options.arrays || options.defaults) + object.reasons = []; + if (options.defaults) + object.score = 0; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.reasons && message.reasons.length) { + object.reasons = []; + for (var j = 0; j < message.reasons.length; ++j) + object.reasons[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason[message.reasons[j]] === undefined ? message.reasons[j] : $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason[message.reasons[j]] : message.reasons[j]; } - if (message.valid != null && message.hasOwnProperty("valid")) - object.valid = message.valid; - if (message.invalidReason != null && message.hasOwnProperty("invalidReason")) - object.invalidReason = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason[message.invalidReason] === undefined ? message.invalidReason : $root.google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason[message.invalidReason] : message.invalidReason; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.hostname != null && message.hasOwnProperty("hostname")) - 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; }; /** - * Converts this TokenProperties to JSON. + * Converts this RiskAnalysis to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis * @instance * @returns {Object.} JSON object */ - TokenProperties.prototype.toJSON = function toJSON() { + RiskAnalysis.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TokenProperties + * Gets the default type url for RiskAnalysis * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TokenProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RiskAnalysis.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.TokenProperties"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.RiskAnalysis"; }; /** - * InvalidReason enum. - * @name google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason + * ClassificationReason enum. + * @name google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason * @enum {number} - * @property {number} INVALID_REASON_UNSPECIFIED=0 INVALID_REASON_UNSPECIFIED value - * @property {number} UNKNOWN_INVALID_REASON=1 UNKNOWN_INVALID_REASON value - * @property {number} MALFORMED=2 MALFORMED value - * @property {number} EXPIRED=3 EXPIRED value - * @property {number} DUPE=4 DUPE value - * @property {number} MISSING=5 MISSING value - * @property {number} BROWSER_ERROR=6 BROWSER_ERROR value + * @property {number} CLASSIFICATION_REASON_UNSPECIFIED=0 CLASSIFICATION_REASON_UNSPECIFIED value + * @property {number} AUTOMATION=1 AUTOMATION value + * @property {number} UNEXPECTED_ENVIRONMENT=2 UNEXPECTED_ENVIRONMENT value + * @property {number} TOO_MUCH_TRAFFIC=3 TOO_MUCH_TRAFFIC value + * @property {number} UNEXPECTED_USAGE_PATTERNS=4 UNEXPECTED_USAGE_PATTERNS value + * @property {number} LOW_CONFIDENCE_SCORE=5 LOW_CONFIDENCE_SCORE value + * @property {number} SUSPECTED_CARDING=6 SUSPECTED_CARDING value + * @property {number} SUSPECTED_CHARGEBACK=7 SUSPECTED_CHARGEBACK value */ - TokenProperties.InvalidReason = (function() { + RiskAnalysis.ClassificationReason = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INVALID_REASON_UNSPECIFIED"] = 0; - values[valuesById[1] = "UNKNOWN_INVALID_REASON"] = 1; - values[valuesById[2] = "MALFORMED"] = 2; - values[valuesById[3] = "EXPIRED"] = 3; - values[valuesById[4] = "DUPE"] = 4; - values[valuesById[5] = "MISSING"] = 5; - values[valuesById[6] = "BROWSER_ERROR"] = 6; + values[valuesById[0] = "CLASSIFICATION_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTOMATION"] = 1; + values[valuesById[2] = "UNEXPECTED_ENVIRONMENT"] = 2; + values[valuesById[3] = "TOO_MUCH_TRAFFIC"] = 3; + values[valuesById[4] = "UNEXPECTED_USAGE_PATTERNS"] = 4; + values[valuesById[5] = "LOW_CONFIDENCE_SCORE"] = 5; + values[valuesById[6] = "SUSPECTED_CARDING"] = 6; + values[valuesById[7] = "SUSPECTED_CHARGEBACK"] = 7; return values; })(); - return TokenProperties; + return RiskAnalysis; })(); - v1.AccountDefenderAssessment = (function() { + v1.TokenProperties = (function() { /** - * Properties of an AccountDefenderAssessment. + * Properties of a TokenProperties. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IAccountDefenderAssessment - * @property {Array.|null} [labels] AccountDefenderAssessment labels + * @interface ITokenProperties + * @property {boolean|null} [valid] TokenProperties valid + * @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 */ /** - * Constructs a new AccountDefenderAssessment. + * Constructs a new TokenProperties. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents an AccountDefenderAssessment. - * @implements IAccountDefenderAssessment + * @classdesc Represents a TokenProperties. + * @implements ITokenProperties * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.ITokenProperties=} [properties] Properties to set */ - function AccountDefenderAssessment(properties) { - this.labels = []; + function TokenProperties(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3882,86 +5792,159 @@ } /** - * AccountDefenderAssessment labels. - * @member {Array.} labels - * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * TokenProperties valid. + * @member {boolean} valid + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties * @instance */ - AccountDefenderAssessment.prototype.labels = $util.emptyArray; + TokenProperties.prototype.valid = false; /** - * Creates a new AccountDefenderAssessment instance using the specified properties. + * TokenProperties invalidReason. + * @member {google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason} invalidReason + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @instance + */ + TokenProperties.prototype.invalidReason = 0; + + /** + * TokenProperties createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @instance + */ + TokenProperties.prototype.createTime = null; + + /** + * TokenProperties hostname. + * @member {string} hostname + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @instance + */ + 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 + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @instance + */ + TokenProperties.prototype.action = ""; + + /** + * Creates a new TokenProperties instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties * @static - * @param {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment} AccountDefenderAssessment instance + * @param {google.cloud.recaptchaenterprise.v1.ITokenProperties=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.TokenProperties} TokenProperties instance */ - AccountDefenderAssessment.create = function create(properties) { - return new AccountDefenderAssessment(properties); + TokenProperties.create = function create(properties) { + return new TokenProperties(properties); }; /** - * Encodes the specified AccountDefenderAssessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.verify|verify} messages. + * Encodes the specified TokenProperties message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TokenProperties.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties * @static - * @param {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment} message AccountDefenderAssessment message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.ITokenProperties} message TokenProperties message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AccountDefenderAssessment.encode = function encode(message, writer) { + TokenProperties.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.labels != null && message.labels.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.labels.length; ++i) - writer.int32(message.labels[i]); - writer.ldelim(); - } + if (message.valid != null && Object.hasOwnProperty.call(message, "valid")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.valid); + if (message.invalidReason != null && Object.hasOwnProperty.call(message, "invalidReason")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.invalidReason); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) + 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; }; /** - * Encodes the specified AccountDefenderAssessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.verify|verify} messages. + * Encodes the specified TokenProperties message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TokenProperties.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties * @static - * @param {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment} message AccountDefenderAssessment message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.ITokenProperties} message TokenProperties message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AccountDefenderAssessment.encodeDelimited = function encodeDelimited(message, writer) { + TokenProperties.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AccountDefenderAssessment message from the specified reader or buffer. + * Decodes a TokenProperties message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties * @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.AccountDefenderAssessment} AccountDefenderAssessment + * @returns {google.cloud.recaptchaenterprise.v1.TokenProperties} TokenProperties * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AccountDefenderAssessment.decode = function decode(reader, length) { + TokenProperties.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.AccountDefenderAssessment(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.TokenProperties(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.labels && message.labels.length)) - message.labels = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.labels.push(reader.int32()); - } else - message.labels.push(reader.int32()); + message.valid = reader.bool(); + break; + } + case 2: { + message.invalidReason = reader.int32(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + 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; } default: @@ -3973,189 +5956,246 @@ }; /** - * Decodes an AccountDefenderAssessment message from the specified reader or buffer, length delimited. + * Decodes a TokenProperties message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment} AccountDefenderAssessment + * @returns {google.cloud.recaptchaenterprise.v1.TokenProperties} TokenProperties * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AccountDefenderAssessment.decodeDelimited = function decodeDelimited(reader) { + TokenProperties.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AccountDefenderAssessment message. + * Verifies a TokenProperties message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AccountDefenderAssessment.verify = function verify(message) { + TokenProperties.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!Array.isArray(message.labels)) - return "labels: array expected"; - for (var i = 0; i < message.labels.length; ++i) - switch (message.labels[i]) { - default: - return "labels: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } + if (message.valid != null && message.hasOwnProperty("valid")) + if (typeof message.valid !== "boolean") + return "valid: boolean expected"; + if (message.invalidReason != null && message.hasOwnProperty("invalidReason")) + switch (message.invalidReason) { + default: + return "invalidReason: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; } + 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"; return null; }; /** - * Creates an AccountDefenderAssessment message from a plain object. Also converts values to their respective internal types. + * Creates a TokenProperties message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment} AccountDefenderAssessment + * @returns {google.cloud.recaptchaenterprise.v1.TokenProperties} TokenProperties */ - AccountDefenderAssessment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment) + TokenProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.TokenProperties) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment(); - if (object.labels) { - if (!Array.isArray(object.labels)) - throw TypeError(".google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.labels: array expected"); - message.labels = []; - for (var i = 0; i < object.labels.length; ++i) - switch (object.labels[i]) { - default: - if (typeof object.labels[i] === "number") { - message.labels[i] = object.labels[i]; - break; - } - case "ACCOUNT_DEFENDER_LABEL_UNSPECIFIED": - case 0: - message.labels[i] = 0; - break; - case "PROFILE_MATCH": - case 1: - message.labels[i] = 1; - break; - case "SUSPICIOUS_LOGIN_ACTIVITY": - case 2: - message.labels[i] = 2; - break; - case "SUSPICIOUS_ACCOUNT_CREATION": - case 3: - message.labels[i] = 3; - break; - case "RELATED_ACCOUNTS_NUMBER_HIGH": - case 4: - message.labels[i] = 4; - break; - } + var message = new $root.google.cloud.recaptchaenterprise.v1.TokenProperties(); + if (object.valid != null) + message.valid = Boolean(object.valid); + switch (object.invalidReason) { + default: + if (typeof object.invalidReason === "number") { + message.invalidReason = object.invalidReason; + break; + } + break; + case "INVALID_REASON_UNSPECIFIED": + case 0: + message.invalidReason = 0; + break; + case "UNKNOWN_INVALID_REASON": + case 1: + message.invalidReason = 1; + break; + case "MALFORMED": + case 2: + message.invalidReason = 2; + break; + case "EXPIRED": + case 3: + message.invalidReason = 3; + break; + case "DUPE": + case 4: + message.invalidReason = 4; + break; + case "MISSING": + case 5: + message.invalidReason = 5; + break; + case "BROWSER_ERROR": + case 6: + message.invalidReason = 6; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.TokenProperties.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } + 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; }; /** - * Creates a plain object from an AccountDefenderAssessment message. Also converts values to other types if specified. + * Creates a plain object from a TokenProperties message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties * @static - * @param {google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment} message AccountDefenderAssessment + * @param {google.cloud.recaptchaenterprise.v1.TokenProperties} message TokenProperties * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AccountDefenderAssessment.toObject = function toObject(message, options) { + TokenProperties.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.labels = []; - if (message.labels && message.labels.length) { - object.labels = []; - for (var j = 0; j < message.labels.length; ++j) - object.labels[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel[message.labels[j]] === undefined ? message.labels[j] : $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel[message.labels[j]] : message.labels[j]; + if (options.defaults) { + object.valid = false; + object.invalidReason = options.enums === String ? "INVALID_REASON_UNSPECIFIED" : 0; + object.createTime = null; + object.hostname = ""; + object.action = ""; + object.androidPackageName = ""; + object.iosBundleId = ""; } + if (message.valid != null && message.hasOwnProperty("valid")) + object.valid = message.valid; + if (message.invalidReason != null && message.hasOwnProperty("invalidReason")) + object.invalidReason = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason[message.invalidReason] === undefined ? message.invalidReason : $root.google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason[message.invalidReason] : message.invalidReason; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.hostname != null && message.hasOwnProperty("hostname")) + 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; }; /** - * Converts this AccountDefenderAssessment to JSON. + * Converts this TokenProperties to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties * @instance * @returns {Object.} JSON object */ - AccountDefenderAssessment.prototype.toJSON = function toJSON() { + TokenProperties.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AccountDefenderAssessment + * Gets the default type url for TokenProperties * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AccountDefenderAssessment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + TokenProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.TokenProperties"; }; /** - * AccountDefenderLabel enum. - * @name google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel + * InvalidReason enum. + * @name google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason * @enum {number} - * @property {number} ACCOUNT_DEFENDER_LABEL_UNSPECIFIED=0 ACCOUNT_DEFENDER_LABEL_UNSPECIFIED value - * @property {number} PROFILE_MATCH=1 PROFILE_MATCH value - * @property {number} SUSPICIOUS_LOGIN_ACTIVITY=2 SUSPICIOUS_LOGIN_ACTIVITY value - * @property {number} SUSPICIOUS_ACCOUNT_CREATION=3 SUSPICIOUS_ACCOUNT_CREATION value - * @property {number} RELATED_ACCOUNTS_NUMBER_HIGH=4 RELATED_ACCOUNTS_NUMBER_HIGH value + * @property {number} INVALID_REASON_UNSPECIFIED=0 INVALID_REASON_UNSPECIFIED value + * @property {number} UNKNOWN_INVALID_REASON=1 UNKNOWN_INVALID_REASON value + * @property {number} MALFORMED=2 MALFORMED value + * @property {number} EXPIRED=3 EXPIRED value + * @property {number} DUPE=4 DUPE value + * @property {number} MISSING=5 MISSING value + * @property {number} BROWSER_ERROR=6 BROWSER_ERROR value */ - AccountDefenderAssessment.AccountDefenderLabel = (function() { + TokenProperties.InvalidReason = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACCOUNT_DEFENDER_LABEL_UNSPECIFIED"] = 0; - values[valuesById[1] = "PROFILE_MATCH"] = 1; - values[valuesById[2] = "SUSPICIOUS_LOGIN_ACTIVITY"] = 2; - values[valuesById[3] = "SUSPICIOUS_ACCOUNT_CREATION"] = 3; - values[valuesById[4] = "RELATED_ACCOUNTS_NUMBER_HIGH"] = 4; + values[valuesById[0] = "INVALID_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "UNKNOWN_INVALID_REASON"] = 1; + values[valuesById[2] = "MALFORMED"] = 2; + values[valuesById[3] = "EXPIRED"] = 3; + values[valuesById[4] = "DUPE"] = 4; + values[valuesById[5] = "MISSING"] = 5; + values[valuesById[6] = "BROWSER_ERROR"] = 6; return values; })(); - return AccountDefenderAssessment; + return TokenProperties; })(); - v1.CreateKeyRequest = (function() { + v1.FraudPreventionAssessment = (function() { /** - * Properties of a CreateKeyRequest. + * Properties of a FraudPreventionAssessment. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface ICreateKeyRequest - * @property {string|null} [parent] CreateKeyRequest parent - * @property {google.cloud.recaptchaenterprise.v1.IKey|null} [key] CreateKeyRequest key + * @interface IFraudPreventionAssessment + * @property {number|null} [transactionRisk] FraudPreventionAssessment transactionRisk + * @property {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.IStolenInstrumentVerdict|null} [stolenInstrumentVerdict] FraudPreventionAssessment stolenInstrumentVerdict + * @property {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.ICardTestingVerdict|null} [cardTestingVerdict] FraudPreventionAssessment cardTestingVerdict */ /** - * Constructs a new CreateKeyRequest. + * Constructs a new FraudPreventionAssessment. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents a CreateKeyRequest. - * @implements ICreateKeyRequest + * @classdesc Represents a FraudPreventionAssessment. + * @implements IFraudPreventionAssessment * @constructor - * @param {google.cloud.recaptchaenterprise.v1.ICreateKeyRequest=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IFraudPreventionAssessment=} [properties] Properties to set */ - function CreateKeyRequest(properties) { + function FraudPreventionAssessment(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4163,89 +6203,103 @@ } /** - * CreateKeyRequest parent. - * @member {string} parent - * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest + * FraudPreventionAssessment transactionRisk. + * @member {number} transactionRisk + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment * @instance */ - CreateKeyRequest.prototype.parent = ""; + FraudPreventionAssessment.prototype.transactionRisk = 0; /** - * CreateKeyRequest key. - * @member {google.cloud.recaptchaenterprise.v1.IKey|null|undefined} key - * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest + * FraudPreventionAssessment stolenInstrumentVerdict. + * @member {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.IStolenInstrumentVerdict|null|undefined} stolenInstrumentVerdict + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment * @instance */ - CreateKeyRequest.prototype.key = null; + FraudPreventionAssessment.prototype.stolenInstrumentVerdict = null; /** - * Creates a new CreateKeyRequest instance using the specified properties. + * FraudPreventionAssessment cardTestingVerdict. + * @member {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.ICardTestingVerdict|null|undefined} cardTestingVerdict + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment + * @instance + */ + FraudPreventionAssessment.prototype.cardTestingVerdict = null; + + /** + * Creates a new FraudPreventionAssessment instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment * @static - * @param {google.cloud.recaptchaenterprise.v1.ICreateKeyRequest=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.CreateKeyRequest} CreateKeyRequest instance + * @param {google.cloud.recaptchaenterprise.v1.IFraudPreventionAssessment=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment} FraudPreventionAssessment instance */ - CreateKeyRequest.create = function create(properties) { - return new CreateKeyRequest(properties); + FraudPreventionAssessment.create = function create(properties) { + return new FraudPreventionAssessment(properties); }; /** - * Encodes the specified CreateKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.CreateKeyRequest.verify|verify} messages. + * Encodes the specified FraudPreventionAssessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment * @static - * @param {google.cloud.recaptchaenterprise.v1.ICreateKeyRequest} message CreateKeyRequest message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IFraudPreventionAssessment} message FraudPreventionAssessment message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateKeyRequest.encode = function encode(message, writer) { + FraudPreventionAssessment.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - $root.google.cloud.recaptchaenterprise.v1.Key.encode(message.key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.transactionRisk != null && Object.hasOwnProperty.call(message, "transactionRisk")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.transactionRisk); + if (message.stolenInstrumentVerdict != null && Object.hasOwnProperty.call(message, "stolenInstrumentVerdict")) + $root.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict.encode(message.stolenInstrumentVerdict, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cardTestingVerdict != null && Object.hasOwnProperty.call(message, "cardTestingVerdict")) + $root.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict.encode(message.cardTestingVerdict, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.CreateKeyRequest.verify|verify} messages. + * Encodes the specified FraudPreventionAssessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment * @static - * @param {google.cloud.recaptchaenterprise.v1.ICreateKeyRequest} message CreateKeyRequest message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IFraudPreventionAssessment} message FraudPreventionAssessment message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + FraudPreventionAssessment.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateKeyRequest message from the specified reader or buffer. + * Decodes a FraudPreventionAssessment message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment * @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.CreateKeyRequest} CreateKeyRequest + * @returns {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment} FraudPreventionAssessment * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateKeyRequest.decode = function decode(reader, length) { + FraudPreventionAssessment.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.CreateKeyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.transactionRisk = reader.float(); break; } case 2: { - message.key = $root.google.cloud.recaptchaenterprise.v1.Key.decode(reader, reader.uint32()); + message.stolenInstrumentVerdict = $root.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cardTestingVerdict = $root.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict.decode(reader, reader.uint32()); break; } default: @@ -4257,138 +6311,556 @@ }; /** - * Decodes a CreateKeyRequest message from the specified reader or buffer, length delimited. + * Decodes a FraudPreventionAssessment message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.CreateKeyRequest} CreateKeyRequest + * @returns {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment} FraudPreventionAssessment * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateKeyRequest.decodeDelimited = function decodeDelimited(reader) { + FraudPreventionAssessment.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateKeyRequest message. + * Verifies a FraudPreventionAssessment message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateKeyRequest.verify = function verify(message) { + FraudPreventionAssessment.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.key != null && message.hasOwnProperty("key")) { - var error = $root.google.cloud.recaptchaenterprise.v1.Key.verify(message.key); + if (message.transactionRisk != null && message.hasOwnProperty("transactionRisk")) + if (typeof message.transactionRisk !== "number") + return "transactionRisk: number expected"; + if (message.stolenInstrumentVerdict != null && message.hasOwnProperty("stolenInstrumentVerdict")) { + var error = $root.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict.verify(message.stolenInstrumentVerdict); if (error) - return "key." + error; + return "stolenInstrumentVerdict." + error; + } + if (message.cardTestingVerdict != null && message.hasOwnProperty("cardTestingVerdict")) { + var error = $root.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict.verify(message.cardTestingVerdict); + if (error) + return "cardTestingVerdict." + error; } return null; }; /** - * Creates a CreateKeyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a FraudPreventionAssessment message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.CreateKeyRequest} CreateKeyRequest + * @returns {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment} FraudPreventionAssessment */ - CreateKeyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.CreateKeyRequest) + FraudPreventionAssessment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.CreateKeyRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.key != null) { - if (typeof object.key !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.CreateKeyRequest.key: object expected"); - message.key = $root.google.cloud.recaptchaenterprise.v1.Key.fromObject(object.key); + var message = new $root.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment(); + if (object.transactionRisk != null) + message.transactionRisk = Number(object.transactionRisk); + if (object.stolenInstrumentVerdict != null) { + if (typeof object.stolenInstrumentVerdict !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.stolenInstrumentVerdict: object expected"); + message.stolenInstrumentVerdict = $root.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict.fromObject(object.stolenInstrumentVerdict); + } + if (object.cardTestingVerdict != null) { + if (typeof object.cardTestingVerdict !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.cardTestingVerdict: object expected"); + message.cardTestingVerdict = $root.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict.fromObject(object.cardTestingVerdict); } return message; }; /** - * Creates a plain object from a CreateKeyRequest message. Also converts values to other types if specified. + * Creates a plain object from a FraudPreventionAssessment message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment * @static - * @param {google.cloud.recaptchaenterprise.v1.CreateKeyRequest} message CreateKeyRequest + * @param {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment} message FraudPreventionAssessment * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateKeyRequest.toObject = function toObject(message, options) { + FraudPreventionAssessment.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.key = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.key != null && message.hasOwnProperty("key")) - object.key = $root.google.cloud.recaptchaenterprise.v1.Key.toObject(message.key, options); + object.transactionRisk = 0; + object.stolenInstrumentVerdict = null; + object.cardTestingVerdict = null; + } + if (message.transactionRisk != null && message.hasOwnProperty("transactionRisk")) + object.transactionRisk = options.json && !isFinite(message.transactionRisk) ? String(message.transactionRisk) : message.transactionRisk; + if (message.stolenInstrumentVerdict != null && message.hasOwnProperty("stolenInstrumentVerdict")) + object.stolenInstrumentVerdict = $root.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict.toObject(message.stolenInstrumentVerdict, options); + if (message.cardTestingVerdict != null && message.hasOwnProperty("cardTestingVerdict")) + object.cardTestingVerdict = $root.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict.toObject(message.cardTestingVerdict, options); return object; }; /** - * Converts this CreateKeyRequest to JSON. + * Converts this FraudPreventionAssessment to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment * @instance * @returns {Object.} JSON object */ - CreateKeyRequest.prototype.toJSON = function toJSON() { + FraudPreventionAssessment.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateKeyRequest + * Gets the default type url for FraudPreventionAssessment * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FraudPreventionAssessment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.CreateKeyRequest"; - }; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment"; + }; + + FraudPreventionAssessment.StolenInstrumentVerdict = (function() { + + /** + * Properties of a StolenInstrumentVerdict. + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment + * @interface IStolenInstrumentVerdict + * @property {number|null} [risk] StolenInstrumentVerdict risk + */ + + /** + * Constructs a new StolenInstrumentVerdict. + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment + * @classdesc Represents a StolenInstrumentVerdict. + * @implements IStolenInstrumentVerdict + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.IStolenInstrumentVerdict=} [properties] Properties to set + */ + function StolenInstrumentVerdict(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]]; + } + + /** + * StolenInstrumentVerdict risk. + * @member {number} risk + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict + * @instance + */ + StolenInstrumentVerdict.prototype.risk = 0; + + /** + * Creates a new StolenInstrumentVerdict instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict + * @static + * @param {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.IStolenInstrumentVerdict=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict} StolenInstrumentVerdict instance + */ + StolenInstrumentVerdict.create = function create(properties) { + return new StolenInstrumentVerdict(properties); + }; + + /** + * Encodes the specified StolenInstrumentVerdict message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict + * @static + * @param {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.IStolenInstrumentVerdict} message StolenInstrumentVerdict message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StolenInstrumentVerdict.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.risk != null && Object.hasOwnProperty.call(message, "risk")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.risk); + return writer; + }; + + /** + * Encodes the specified StolenInstrumentVerdict message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict + * @static + * @param {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.IStolenInstrumentVerdict} message StolenInstrumentVerdict message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StolenInstrumentVerdict.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StolenInstrumentVerdict message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict + * @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.FraudPreventionAssessment.StolenInstrumentVerdict} StolenInstrumentVerdict + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StolenInstrumentVerdict.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.FraudPreventionAssessment.StolenInstrumentVerdict(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.risk = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StolenInstrumentVerdict message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict} StolenInstrumentVerdict + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StolenInstrumentVerdict.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StolenInstrumentVerdict message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StolenInstrumentVerdict.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.risk != null && message.hasOwnProperty("risk")) + if (typeof message.risk !== "number") + return "risk: number expected"; + return null; + }; + + /** + * Creates a StolenInstrumentVerdict message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict} StolenInstrumentVerdict + */ + StolenInstrumentVerdict.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict(); + if (object.risk != null) + message.risk = Number(object.risk); + return message; + }; + + /** + * Creates a plain object from a StolenInstrumentVerdict message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict + * @static + * @param {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict} message StolenInstrumentVerdict + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StolenInstrumentVerdict.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.risk = 0; + if (message.risk != null && message.hasOwnProperty("risk")) + object.risk = options.json && !isFinite(message.risk) ? String(message.risk) : message.risk; + return object; + }; + + /** + * Converts this StolenInstrumentVerdict to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict + * @instance + * @returns {Object.} JSON object + */ + StolenInstrumentVerdict.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StolenInstrumentVerdict + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StolenInstrumentVerdict.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict"; + }; - return CreateKeyRequest; + return StolenInstrumentVerdict; + })(); + + FraudPreventionAssessment.CardTestingVerdict = (function() { + + /** + * Properties of a CardTestingVerdict. + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment + * @interface ICardTestingVerdict + * @property {number|null} [risk] CardTestingVerdict risk + */ + + /** + * Constructs a new CardTestingVerdict. + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment + * @classdesc Represents a CardTestingVerdict. + * @implements ICardTestingVerdict + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.ICardTestingVerdict=} [properties] Properties to set + */ + function CardTestingVerdict(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]]; + } + + /** + * CardTestingVerdict risk. + * @member {number} risk + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict + * @instance + */ + CardTestingVerdict.prototype.risk = 0; + + /** + * Creates a new CardTestingVerdict instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict + * @static + * @param {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.ICardTestingVerdict=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict} CardTestingVerdict instance + */ + CardTestingVerdict.create = function create(properties) { + return new CardTestingVerdict(properties); + }; + + /** + * Encodes the specified CardTestingVerdict message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict + * @static + * @param {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.ICardTestingVerdict} message CardTestingVerdict message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CardTestingVerdict.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.risk != null && Object.hasOwnProperty.call(message, "risk")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.risk); + return writer; + }; + + /** + * Encodes the specified CardTestingVerdict message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict + * @static + * @param {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.ICardTestingVerdict} message CardTestingVerdict message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CardTestingVerdict.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CardTestingVerdict message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict + * @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.FraudPreventionAssessment.CardTestingVerdict} CardTestingVerdict + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CardTestingVerdict.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.FraudPreventionAssessment.CardTestingVerdict(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.risk = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CardTestingVerdict message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict} CardTestingVerdict + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CardTestingVerdict.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CardTestingVerdict message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CardTestingVerdict.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.risk != null && message.hasOwnProperty("risk")) + if (typeof message.risk !== "number") + return "risk: number expected"; + return null; + }; + + /** + * Creates a CardTestingVerdict message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict} CardTestingVerdict + */ + CardTestingVerdict.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict(); + if (object.risk != null) + message.risk = Number(object.risk); + return message; + }; + + /** + * Creates a plain object from a CardTestingVerdict message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict + * @static + * @param {google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict} message CardTestingVerdict + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CardTestingVerdict.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.risk = 0; + if (message.risk != null && message.hasOwnProperty("risk")) + object.risk = options.json && !isFinite(message.risk) ? String(message.risk) : message.risk; + return object; + }; + + /** + * Converts this CardTestingVerdict to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict + * @instance + * @returns {Object.} JSON object + */ + CardTestingVerdict.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CardTestingVerdict + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CardTestingVerdict.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict"; + }; + + return CardTestingVerdict; + })(); + + return FraudPreventionAssessment; })(); - v1.ListKeysRequest = (function() { + v1.AccountDefenderAssessment = (function() { /** - * Properties of a ListKeysRequest. + * Properties of an AccountDefenderAssessment. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IListKeysRequest - * @property {string|null} [parent] ListKeysRequest parent - * @property {number|null} [pageSize] ListKeysRequest pageSize - * @property {string|null} [pageToken] ListKeysRequest pageToken + * @interface IAccountDefenderAssessment + * @property {Array.|null} [labels] AccountDefenderAssessment labels */ /** - * Constructs a new ListKeysRequest. + * Constructs a new AccountDefenderAssessment. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents a ListKeysRequest. - * @implements IListKeysRequest + * @classdesc Represents an AccountDefenderAssessment. + * @implements IAccountDefenderAssessment * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IListKeysRequest=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment=} [properties] Properties to set */ - function ListKeysRequest(properties) { + function AccountDefenderAssessment(properties) { + this.labels = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4396,103 +6868,86 @@ } /** - * ListKeysRequest parent. - * @member {string} parent - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest - * @instance - */ - ListKeysRequest.prototype.parent = ""; - - /** - * ListKeysRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest - * @instance - */ - ListKeysRequest.prototype.pageSize = 0; - - /** - * ListKeysRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * AccountDefenderAssessment labels. + * @member {Array.} labels + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment * @instance */ - ListKeysRequest.prototype.pageToken = ""; + AccountDefenderAssessment.prototype.labels = $util.emptyArray; /** - * Creates a new ListKeysRequest instance using the specified properties. + * Creates a new AccountDefenderAssessment instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment * @static - * @param {google.cloud.recaptchaenterprise.v1.IListKeysRequest=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.ListKeysRequest} ListKeysRequest instance + * @param {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment} AccountDefenderAssessment instance */ - ListKeysRequest.create = function create(properties) { - return new ListKeysRequest(properties); + AccountDefenderAssessment.create = function create(properties) { + return new AccountDefenderAssessment(properties); }; /** - * Encodes the specified ListKeysRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListKeysRequest.verify|verify} messages. + * Encodes the specified AccountDefenderAssessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment * @static - * @param {google.cloud.recaptchaenterprise.v1.IListKeysRequest} message ListKeysRequest message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment} message AccountDefenderAssessment message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListKeysRequest.encode = function encode(message, writer) { + AccountDefenderAssessment.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.labels != null && message.labels.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.labels.length; ++i) + writer.int32(message.labels[i]); + writer.ldelim(); + } return writer; }; /** - * Encodes the specified ListKeysRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListKeysRequest.verify|verify} messages. + * Encodes the specified AccountDefenderAssessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment * @static - * @param {google.cloud.recaptchaenterprise.v1.IListKeysRequest} message ListKeysRequest message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment} message AccountDefenderAssessment message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { + AccountDefenderAssessment.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListKeysRequest message from the specified reader or buffer. + * Decodes an AccountDefenderAssessment message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment * @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.ListKeysRequest} ListKeysRequest + * @returns {google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment} AccountDefenderAssessment * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListKeysRequest.decode = function decode(reader, length) { + AccountDefenderAssessment.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.ListKeysRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); + if (!(message.labels && message.labels.length)) + message.labels = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.labels.push(reader.int32()); + } else + message.labels.push(reader.int32()); break; } default: @@ -4504,141 +6959,189 @@ }; /** - * Decodes a ListKeysRequest message from the specified reader or buffer, length delimited. + * Decodes an AccountDefenderAssessment message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.ListKeysRequest} ListKeysRequest + * @returns {google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment} AccountDefenderAssessment * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListKeysRequest.decodeDelimited = function decodeDelimited(reader) { + AccountDefenderAssessment.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListKeysRequest message. + * Verifies an AccountDefenderAssessment message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListKeysRequest.verify = function verify(message) { + AccountDefenderAssessment.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!Array.isArray(message.labels)) + return "labels: array expected"; + for (var i = 0; i < message.labels.length; ++i) + switch (message.labels[i]) { + default: + return "labels: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + } return null; }; /** - * Creates a ListKeysRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AccountDefenderAssessment message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.ListKeysRequest} ListKeysRequest + * @returns {google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment} AccountDefenderAssessment */ - ListKeysRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.ListKeysRequest) + AccountDefenderAssessment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.ListKeysRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); + var message = new $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment(); + if (object.labels) { + if (!Array.isArray(object.labels)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.labels: array expected"); + message.labels = []; + for (var i = 0; i < object.labels.length; ++i) + switch (object.labels[i]) { + default: + if (typeof object.labels[i] === "number") { + message.labels[i] = object.labels[i]; + break; + } + case "ACCOUNT_DEFENDER_LABEL_UNSPECIFIED": + case 0: + message.labels[i] = 0; + break; + case "PROFILE_MATCH": + case 1: + message.labels[i] = 1; + break; + case "SUSPICIOUS_LOGIN_ACTIVITY": + case 2: + message.labels[i] = 2; + break; + case "SUSPICIOUS_ACCOUNT_CREATION": + case 3: + message.labels[i] = 3; + break; + case "RELATED_ACCOUNTS_NUMBER_HIGH": + case 4: + message.labels[i] = 4; + break; + } + } return message; }; /** - * Creates a plain object from a ListKeysRequest message. Also converts values to other types if specified. + * Creates a plain object from an AccountDefenderAssessment message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment * @static - * @param {google.cloud.recaptchaenterprise.v1.ListKeysRequest} message ListKeysRequest + * @param {google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment} message AccountDefenderAssessment * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListKeysRequest.toObject = function toObject(message, options) { + AccountDefenderAssessment.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; + if (options.arrays || options.defaults) + object.labels = []; + if (message.labels && message.labels.length) { + object.labels = []; + for (var j = 0; j < message.labels.length; ++j) + object.labels[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel[message.labels[j]] === undefined ? message.labels[j] : $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel[message.labels[j]] : message.labels[j]; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; return object; }; /** - * Converts this ListKeysRequest to JSON. + * Converts this AccountDefenderAssessment to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment * @instance * @returns {Object.} JSON object */ - ListKeysRequest.prototype.toJSON = function toJSON() { + AccountDefenderAssessment.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListKeysRequest + * Gets the default type url for AccountDefenderAssessment * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListKeysRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AccountDefenderAssessment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.ListKeysRequest"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment"; }; - return ListKeysRequest; + /** + * AccountDefenderLabel enum. + * @name google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel + * @enum {number} + * @property {number} ACCOUNT_DEFENDER_LABEL_UNSPECIFIED=0 ACCOUNT_DEFENDER_LABEL_UNSPECIFIED value + * @property {number} PROFILE_MATCH=1 PROFILE_MATCH value + * @property {number} SUSPICIOUS_LOGIN_ACTIVITY=2 SUSPICIOUS_LOGIN_ACTIVITY value + * @property {number} SUSPICIOUS_ACCOUNT_CREATION=3 SUSPICIOUS_ACCOUNT_CREATION value + * @property {number} RELATED_ACCOUNTS_NUMBER_HIGH=4 RELATED_ACCOUNTS_NUMBER_HIGH value + */ + AccountDefenderAssessment.AccountDefenderLabel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACCOUNT_DEFENDER_LABEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROFILE_MATCH"] = 1; + values[valuesById[2] = "SUSPICIOUS_LOGIN_ACTIVITY"] = 2; + values[valuesById[3] = "SUSPICIOUS_ACCOUNT_CREATION"] = 3; + values[valuesById[4] = "RELATED_ACCOUNTS_NUMBER_HIGH"] = 4; + return values; + })(); + + return AccountDefenderAssessment; })(); - v1.ListKeysResponse = (function() { + v1.CreateKeyRequest = (function() { /** - * Properties of a ListKeysResponse. + * Properties of a CreateKeyRequest. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IListKeysResponse - * @property {Array.|null} [keys] ListKeysResponse keys - * @property {string|null} [nextPageToken] ListKeysResponse nextPageToken + * @interface ICreateKeyRequest + * @property {string|null} [parent] CreateKeyRequest parent + * @property {google.cloud.recaptchaenterprise.v1.IKey|null} [key] CreateKeyRequest key */ /** - * Constructs a new ListKeysResponse. + * Constructs a new CreateKeyRequest. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents a ListKeysResponse. - * @implements IListKeysResponse + * @classdesc Represents a CreateKeyRequest. + * @implements ICreateKeyRequest * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IListKeysResponse=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.ICreateKeyRequest=} [properties] Properties to set */ - function ListKeysResponse(properties) { - this.keys = []; + function CreateKeyRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4646,92 +7149,89 @@ } /** - * ListKeysResponse keys. - * @member {Array.} keys - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * CreateKeyRequest parent. + * @member {string} parent + * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest * @instance */ - ListKeysResponse.prototype.keys = $util.emptyArray; + CreateKeyRequest.prototype.parent = ""; /** - * ListKeysResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * CreateKeyRequest key. + * @member {google.cloud.recaptchaenterprise.v1.IKey|null|undefined} key + * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest * @instance */ - ListKeysResponse.prototype.nextPageToken = ""; + CreateKeyRequest.prototype.key = null; /** - * Creates a new ListKeysResponse instance using the specified properties. + * Creates a new CreateKeyRequest instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IListKeysResponse=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.ListKeysResponse} ListKeysResponse instance + * @param {google.cloud.recaptchaenterprise.v1.ICreateKeyRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.CreateKeyRequest} CreateKeyRequest instance */ - ListKeysResponse.create = function create(properties) { - return new ListKeysResponse(properties); + CreateKeyRequest.create = function create(properties) { + return new CreateKeyRequest(properties); }; /** - * Encodes the specified ListKeysResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListKeysResponse.verify|verify} messages. + * Encodes the specified CreateKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.CreateKeyRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IListKeysResponse} message ListKeysResponse message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.ICreateKeyRequest} message CreateKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListKeysResponse.encode = function encode(message, writer) { + CreateKeyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.keys != null && message.keys.length) - for (var i = 0; i < message.keys.length; ++i) - $root.google.cloud.recaptchaenterprise.v1.Key.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + $root.google.cloud.recaptchaenterprise.v1.Key.encode(message.key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListKeysResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListKeysResponse.verify|verify} messages. + * Encodes the specified CreateKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.CreateKeyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IListKeysResponse} message ListKeysResponse message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.ICreateKeyRequest} message CreateKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { + CreateKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListKeysResponse message from the specified reader or buffer. + * Decodes a CreateKeyRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest * @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.ListKeysResponse} ListKeysResponse + * @returns {google.cloud.recaptchaenterprise.v1.CreateKeyRequest} CreateKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListKeysResponse.decode = function decode(reader, length) { + CreateKeyRequest.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.ListKeysResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.CreateKeyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.google.cloud.recaptchaenterprise.v1.Key.decode(reader, reader.uint32())); + message.parent = reader.string(); break; } case 2: { - message.nextPageToken = reader.string(); + message.key = $root.google.cloud.recaptchaenterprise.v1.Key.decode(reader, reader.uint32()); break; } default: @@ -4743,148 +7243,138 @@ }; /** - * Decodes a ListKeysResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateKeyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.ListKeysResponse} ListKeysResponse + * @returns {google.cloud.recaptchaenterprise.v1.CreateKeyRequest} CreateKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListKeysResponse.decodeDelimited = function decodeDelimited(reader) { + CreateKeyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListKeysResponse message. + * Verifies a CreateKeyRequest message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListKeysResponse.verify = function verify(message) { + CreateKeyRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.keys != null && message.hasOwnProperty("keys")) { - if (!Array.isArray(message.keys)) - return "keys: array expected"; - for (var i = 0; i < message.keys.length; ++i) { - var error = $root.google.cloud.recaptchaenterprise.v1.Key.verify(message.keys[i]); - if (error) - return "keys." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.key != null && message.hasOwnProperty("key")) { + var error = $root.google.cloud.recaptchaenterprise.v1.Key.verify(message.key); + if (error) + return "key." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListKeysResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateKeyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.ListKeysResponse} ListKeysResponse + * @returns {google.cloud.recaptchaenterprise.v1.CreateKeyRequest} CreateKeyRequest */ - ListKeysResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.ListKeysResponse) + CreateKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.CreateKeyRequest) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.ListKeysResponse(); - if (object.keys) { - if (!Array.isArray(object.keys)) - throw TypeError(".google.cloud.recaptchaenterprise.v1.ListKeysResponse.keys: array expected"); - message.keys = []; - for (var i = 0; i < object.keys.length; ++i) { - if (typeof object.keys[i] !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.ListKeysResponse.keys: object expected"); - message.keys[i] = $root.google.cloud.recaptchaenterprise.v1.Key.fromObject(object.keys[i]); - } + var message = new $root.google.cloud.recaptchaenterprise.v1.CreateKeyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.CreateKeyRequest.key: object expected"); + message.key = $root.google.cloud.recaptchaenterprise.v1.Key.fromObject(object.key); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListKeysResponse message. Also converts values to other types if specified. + * Creates a plain object from a CreateKeyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.ListKeysResponse} message ListKeysResponse + * @param {google.cloud.recaptchaenterprise.v1.CreateKeyRequest} message CreateKeyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListKeysResponse.toObject = function toObject(message, options) { + CreateKeyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.keys = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.keys && message.keys.length) { - object.keys = []; - for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = $root.google.cloud.recaptchaenterprise.v1.Key.toObject(message.keys[j], options); + if (options.defaults) { + object.parent = ""; + object.key = null; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.google.cloud.recaptchaenterprise.v1.Key.toObject(message.key, options); return object; }; /** - * Converts this ListKeysResponse to JSON. + * Converts this CreateKeyRequest to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest * @instance * @returns {Object.} JSON object */ - ListKeysResponse.prototype.toJSON = function toJSON() { + CreateKeyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListKeysResponse + * Gets the default type url for CreateKeyRequest * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListKeysResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.ListKeysResponse"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.CreateKeyRequest"; }; - return ListKeysResponse; + return CreateKeyRequest; })(); - v1.RetrieveLegacySecretKeyRequest = (function() { + v1.ListKeysRequest = (function() { /** - * Properties of a RetrieveLegacySecretKeyRequest. + * Properties of a ListKeysRequest. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IRetrieveLegacySecretKeyRequest - * @property {string|null} [key] RetrieveLegacySecretKeyRequest key + * @interface IListKeysRequest + * @property {string|null} [parent] ListKeysRequest parent + * @property {number|null} [pageSize] ListKeysRequest pageSize + * @property {string|null} [pageToken] ListKeysRequest pageToken */ /** - * Constructs a new RetrieveLegacySecretKeyRequest. + * Constructs a new ListKeysRequest. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents a RetrieveLegacySecretKeyRequest. - * @implements IRetrieveLegacySecretKeyRequest + * @classdesc Represents a ListKeysRequest. + * @implements IListKeysRequest * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IListKeysRequest=} [properties] Properties to set */ - function RetrieveLegacySecretKeyRequest(properties) { + function ListKeysRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4892,75 +7382,103 @@ } /** - * RetrieveLegacySecretKeyRequest key. - * @member {string} key - * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest + * ListKeysRequest parent. + * @member {string} parent + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest * @instance */ - RetrieveLegacySecretKeyRequest.prototype.key = ""; + ListKeysRequest.prototype.parent = ""; /** - * Creates a new RetrieveLegacySecretKeyRequest instance using the specified properties. + * ListKeysRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @instance + */ + ListKeysRequest.prototype.pageSize = 0; + + /** + * ListKeysRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @instance + */ + ListKeysRequest.prototype.pageToken = ""; + + /** + * Creates a new ListKeysRequest instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest} RetrieveLegacySecretKeyRequest instance + * @param {google.cloud.recaptchaenterprise.v1.IListKeysRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.ListKeysRequest} ListKeysRequest instance */ - RetrieveLegacySecretKeyRequest.create = function create(properties) { - return new RetrieveLegacySecretKeyRequest(properties); + ListKeysRequest.create = function create(properties) { + return new ListKeysRequest(properties); }; /** - * Encodes the specified RetrieveLegacySecretKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest.verify|verify} messages. + * Encodes the specified ListKeysRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListKeysRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest} message RetrieveLegacySecretKeyRequest message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IListKeysRequest} message ListKeysRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RetrieveLegacySecretKeyRequest.encode = function encode(message, writer) { + ListKeysRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); return writer; }; /** - * Encodes the specified RetrieveLegacySecretKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest.verify|verify} messages. + * Encodes the specified ListKeysRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListKeysRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest} message RetrieveLegacySecretKeyRequest message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IListKeysRequest} message ListKeysRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RetrieveLegacySecretKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RetrieveLegacySecretKeyRequest message from the specified reader or buffer. + * Decodes a ListKeysRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest * @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.RetrieveLegacySecretKeyRequest} RetrieveLegacySecretKeyRequest + * @returns {google.cloud.recaptchaenterprise.v1.ListKeysRequest} ListKeysRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RetrieveLegacySecretKeyRequest.decode = function decode(reader, length) { + ListKeysRequest.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.RetrieveLegacySecretKeyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.ListKeysRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.key = reader.string(); + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); break; } default: @@ -4972,122 +7490,141 @@ }; /** - * Decodes a RetrieveLegacySecretKeyRequest message from the specified reader or buffer, length delimited. + * Decodes a ListKeysRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest} RetrieveLegacySecretKeyRequest + * @returns {google.cloud.recaptchaenterprise.v1.ListKeysRequest} ListKeysRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RetrieveLegacySecretKeyRequest.decodeDelimited = function decodeDelimited(reader) { + ListKeysRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RetrieveLegacySecretKeyRequest message. + * Verifies a ListKeysRequest message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RetrieveLegacySecretKeyRequest.verify = function verify(message) { + ListKeysRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!$util.isString(message.key)) - return "key: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a RetrieveLegacySecretKeyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListKeysRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest} RetrieveLegacySecretKeyRequest + * @returns {google.cloud.recaptchaenterprise.v1.ListKeysRequest} ListKeysRequest */ - RetrieveLegacySecretKeyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest) + ListKeysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.ListKeysRequest) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest(); - if (object.key != null) - message.key = String(object.key); + var message = new $root.google.cloud.recaptchaenterprise.v1.ListKeysRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from a RetrieveLegacySecretKeyRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListKeysRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest} message RetrieveLegacySecretKeyRequest + * @param {google.cloud.recaptchaenterprise.v1.ListKeysRequest} message ListKeysRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RetrieveLegacySecretKeyRequest.toObject = function toObject(message, options) { + ListKeysRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.key = ""; - if (message.key != null && message.hasOwnProperty("key")) - object.key = message.key; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this RetrieveLegacySecretKeyRequest to JSON. + * Converts this ListKeysRequest to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest * @instance * @returns {Object.} JSON object */ - RetrieveLegacySecretKeyRequest.prototype.toJSON = function toJSON() { + ListKeysRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RetrieveLegacySecretKeyRequest + * Gets the default type url for ListKeysRequest * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RetrieveLegacySecretKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListKeysRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.ListKeysRequest"; }; - return RetrieveLegacySecretKeyRequest; + return ListKeysRequest; })(); - v1.GetKeyRequest = (function() { + v1.ListKeysResponse = (function() { /** - * Properties of a GetKeyRequest. + * Properties of a ListKeysResponse. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IGetKeyRequest - * @property {string|null} [name] GetKeyRequest name + * @interface IListKeysResponse + * @property {Array.|null} [keys] ListKeysResponse keys + * @property {string|null} [nextPageToken] ListKeysResponse nextPageToken */ /** - * Constructs a new GetKeyRequest. + * Constructs a new ListKeysResponse. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents a GetKeyRequest. - * @implements IGetKeyRequest + * @classdesc Represents a ListKeysResponse. + * @implements IListKeysResponse * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IGetKeyRequest=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IListKeysResponse=} [properties] Properties to set */ - function GetKeyRequest(properties) { + function ListKeysResponse(properties) { + this.keys = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5095,75 +7632,92 @@ } /** - * GetKeyRequest name. - * @member {string} name - * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest + * ListKeysResponse keys. + * @member {Array.} keys + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse * @instance */ - GetKeyRequest.prototype.name = ""; + ListKeysResponse.prototype.keys = $util.emptyArray; /** - * Creates a new GetKeyRequest instance using the specified properties. + * ListKeysResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @instance + */ + ListKeysResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListKeysResponse instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse * @static - * @param {google.cloud.recaptchaenterprise.v1.IGetKeyRequest=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.GetKeyRequest} GetKeyRequest instance + * @param {google.cloud.recaptchaenterprise.v1.IListKeysResponse=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.ListKeysResponse} ListKeysResponse instance */ - GetKeyRequest.create = function create(properties) { - return new GetKeyRequest(properties); + ListKeysResponse.create = function create(properties) { + return new ListKeysResponse(properties); }; /** - * Encodes the specified GetKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.GetKeyRequest.verify|verify} messages. + * Encodes the specified ListKeysResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListKeysResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse * @static - * @param {google.cloud.recaptchaenterprise.v1.IGetKeyRequest} message GetKeyRequest message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IListKeysResponse} message ListKeysResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetKeyRequest.encode = function encode(message, writer) { + ListKeysResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.keys != null && message.keys.length) + for (var i = 0; i < message.keys.length; ++i) + $root.google.cloud.recaptchaenterprise.v1.Key.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified GetKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.GetKeyRequest.verify|verify} messages. + * Encodes the specified ListKeysResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListKeysResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse * @static - * @param {google.cloud.recaptchaenterprise.v1.IGetKeyRequest} message GetKeyRequest message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IListKeysResponse} message ListKeysResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetKeyRequest message from the specified reader or buffer. + * Decodes a ListKeysResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse * @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.GetKeyRequest} GetKeyRequest + * @returns {google.cloud.recaptchaenterprise.v1.ListKeysResponse} ListKeysResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetKeyRequest.decode = function decode(reader, length) { + ListKeysResponse.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.GetKeyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.ListKeysResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push($root.google.cloud.recaptchaenterprise.v1.Key.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); break; } default: @@ -5175,123 +7729,148 @@ }; /** - * Decodes a GetKeyRequest message from the specified reader or buffer, length delimited. + * Decodes a ListKeysResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.GetKeyRequest} GetKeyRequest + * @returns {google.cloud.recaptchaenterprise.v1.ListKeysResponse} ListKeysResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetKeyRequest.decodeDelimited = function decodeDelimited(reader) { + ListKeysResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetKeyRequest message. + * Verifies a ListKeysResponse message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetKeyRequest.verify = function verify(message) { + ListKeysResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.keys != null && message.hasOwnProperty("keys")) { + if (!Array.isArray(message.keys)) + return "keys: array expected"; + for (var i = 0; i < message.keys.length; ++i) { + var error = $root.google.cloud.recaptchaenterprise.v1.Key.verify(message.keys[i]); + if (error) + return "keys." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a GetKeyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListKeysResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.GetKeyRequest} GetKeyRequest + * @returns {google.cloud.recaptchaenterprise.v1.ListKeysResponse} ListKeysResponse */ - GetKeyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.GetKeyRequest) + ListKeysResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.ListKeysResponse) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.GetKeyRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.recaptchaenterprise.v1.ListKeysResponse(); + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.ListKeysResponse.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) { + if (typeof object.keys[i] !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.ListKeysResponse.keys: object expected"); + message.keys[i] = $root.google.cloud.recaptchaenterprise.v1.Key.fromObject(object.keys[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a GetKeyRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListKeysResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse * @static - * @param {google.cloud.recaptchaenterprise.v1.GetKeyRequest} message GetKeyRequest + * @param {google.cloud.recaptchaenterprise.v1.ListKeysResponse} message ListKeysResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetKeyRequest.toObject = function toObject(message, options) { + ListKeysResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.keys = []; if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + object.nextPageToken = ""; + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = $root.google.cloud.recaptchaenterprise.v1.Key.toObject(message.keys[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this GetKeyRequest to JSON. + * Converts this ListKeysResponse to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse * @instance * @returns {Object.} JSON object */ - GetKeyRequest.prototype.toJSON = function toJSON() { + ListKeysResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetKeyRequest + * Gets the default type url for ListKeysResponse * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListKeysResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.GetKeyRequest"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.ListKeysResponse"; }; - return GetKeyRequest; + return ListKeysResponse; })(); - v1.UpdateKeyRequest = (function() { + v1.RetrieveLegacySecretKeyRequest = (function() { /** - * Properties of an UpdateKeyRequest. + * Properties of a RetrieveLegacySecretKeyRequest. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IUpdateKeyRequest - * @property {google.cloud.recaptchaenterprise.v1.IKey|null} [key] UpdateKeyRequest key - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateKeyRequest updateMask + * @interface IRetrieveLegacySecretKeyRequest + * @property {string|null} [key] RetrieveLegacySecretKeyRequest key */ /** - * Constructs a new UpdateKeyRequest. + * Constructs a new RetrieveLegacySecretKeyRequest. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents an UpdateKeyRequest. - * @implements IUpdateKeyRequest + * @classdesc Represents a RetrieveLegacySecretKeyRequest. + * @implements IRetrieveLegacySecretKeyRequest * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest=} [properties] Properties to set */ - function UpdateKeyRequest(properties) { + function RetrieveLegacySecretKeyRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5299,89 +7878,75 @@ } /** - * UpdateKeyRequest key. - * @member {google.cloud.recaptchaenterprise.v1.IKey|null|undefined} key - * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest - * @instance - */ - UpdateKeyRequest.prototype.key = null; - - /** - * UpdateKeyRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest + * RetrieveLegacySecretKeyRequest key. + * @member {string} key + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest * @instance */ - UpdateKeyRequest.prototype.updateMask = null; + RetrieveLegacySecretKeyRequest.prototype.key = ""; /** - * Creates a new UpdateKeyRequest instance using the specified properties. + * Creates a new RetrieveLegacySecretKeyRequest instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.UpdateKeyRequest} UpdateKeyRequest instance + * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest} RetrieveLegacySecretKeyRequest instance */ - UpdateKeyRequest.create = function create(properties) { - return new UpdateKeyRequest(properties); + RetrieveLegacySecretKeyRequest.create = function create(properties) { + return new RetrieveLegacySecretKeyRequest(properties); }; /** - * Encodes the specified UpdateKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.UpdateKeyRequest.verify|verify} messages. + * Encodes the specified RetrieveLegacySecretKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest} message UpdateKeyRequest message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest} message RetrieveLegacySecretKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateKeyRequest.encode = function encode(message, writer) { + RetrieveLegacySecretKeyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.key != null && Object.hasOwnProperty.call(message, "key")) - $root.google.cloud.recaptchaenterprise.v1.Key.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); return writer; }; /** - * Encodes the specified UpdateKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.UpdateKeyRequest.verify|verify} messages. + * Encodes the specified RetrieveLegacySecretKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest} message UpdateKeyRequest message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest} message RetrieveLegacySecretKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + RetrieveLegacySecretKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateKeyRequest message from the specified reader or buffer. + * Decodes a RetrieveLegacySecretKeyRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest * @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.UpdateKeyRequest} UpdateKeyRequest + * @returns {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest} RetrieveLegacySecretKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateKeyRequest.decode = function decode(reader, length) { + RetrieveLegacySecretKeyRequest.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.UpdateKeyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.key = $root.google.cloud.recaptchaenterprise.v1.Key.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.key = reader.string(); break; } default: @@ -5393,141 +7958,122 @@ }; /** - * Decodes an UpdateKeyRequest message from the specified reader or buffer, length delimited. + * Decodes a RetrieveLegacySecretKeyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.UpdateKeyRequest} UpdateKeyRequest + * @returns {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest} RetrieveLegacySecretKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateKeyRequest.decodeDelimited = function decodeDelimited(reader) { + RetrieveLegacySecretKeyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateKeyRequest message. + * Verifies a RetrieveLegacySecretKeyRequest message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateKeyRequest.verify = function verify(message) { + RetrieveLegacySecretKeyRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) { - var error = $root.google.cloud.recaptchaenterprise.v1.Key.verify(message.key); - if (error) - return "key." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; return null; }; /** - * Creates an UpdateKeyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RetrieveLegacySecretKeyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.UpdateKeyRequest} UpdateKeyRequest + * @returns {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest} RetrieveLegacySecretKeyRequest */ - UpdateKeyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest) + RetrieveLegacySecretKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest(); - if (object.key != null) { - if (typeof object.key !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.UpdateKeyRequest.key: object expected"); - message.key = $root.google.cloud.recaptchaenterprise.v1.Key.fromObject(object.key); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.UpdateKeyRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + var message = new $root.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest(); + if (object.key != null) + message.key = String(object.key); return message; }; /** - * Creates a plain object from an UpdateKeyRequest message. Also converts values to other types if specified. + * Creates a plain object from a RetrieveLegacySecretKeyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.UpdateKeyRequest} message UpdateKeyRequest + * @param {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest} message RetrieveLegacySecretKeyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateKeyRequest.toObject = function toObject(message, options) { + RetrieveLegacySecretKeyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.key = null; - object.updateMask = null; - } + if (options.defaults) + object.key = ""; if (message.key != null && message.hasOwnProperty("key")) - object.key = $root.google.cloud.recaptchaenterprise.v1.Key.toObject(message.key, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + object.key = message.key; return object; }; /** - * Converts this UpdateKeyRequest to JSON. + * Converts this RetrieveLegacySecretKeyRequest to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest * @instance * @returns {Object.} JSON object */ - UpdateKeyRequest.prototype.toJSON = function toJSON() { + RetrieveLegacySecretKeyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateKeyRequest + * Gets the default type url for RetrieveLegacySecretKeyRequest * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RetrieveLegacySecretKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.UpdateKeyRequest"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest"; }; - return UpdateKeyRequest; + return RetrieveLegacySecretKeyRequest; })(); - v1.DeleteKeyRequest = (function() { + v1.GetKeyRequest = (function() { /** - * Properties of a DeleteKeyRequest. + * Properties of a GetKeyRequest. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IDeleteKeyRequest - * @property {string|null} [name] DeleteKeyRequest name - */ + * @interface IGetKeyRequest + * @property {string|null} [name] GetKeyRequest name + */ /** - * Constructs a new DeleteKeyRequest. + * Constructs a new GetKeyRequest. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents a DeleteKeyRequest. - * @implements IDeleteKeyRequest + * @classdesc Represents a GetKeyRequest. + * @implements IGetKeyRequest * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IGetKeyRequest=} [properties] Properties to set */ - function DeleteKeyRequest(properties) { + function GetKeyRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5535,35 +8081,35 @@ } /** - * DeleteKeyRequest name. + * GetKeyRequest name. * @member {string} name - * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest * @instance */ - DeleteKeyRequest.prototype.name = ""; + GetKeyRequest.prototype.name = ""; /** - * Creates a new DeleteKeyRequest instance using the specified properties. + * Creates a new GetKeyRequest instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.DeleteKeyRequest} DeleteKeyRequest instance + * @param {google.cloud.recaptchaenterprise.v1.IGetKeyRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.GetKeyRequest} GetKeyRequest instance */ - DeleteKeyRequest.create = function create(properties) { - return new DeleteKeyRequest(properties); + GetKeyRequest.create = function create(properties) { + return new GetKeyRequest(properties); }; /** - * Encodes the specified DeleteKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.DeleteKeyRequest.verify|verify} messages. + * Encodes the specified GetKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.GetKeyRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest} message DeleteKeyRequest message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IGetKeyRequest} message GetKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteKeyRequest.encode = function encode(message, writer) { + GetKeyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -5572,33 +8118,33 @@ }; /** - * Encodes the specified DeleteKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.DeleteKeyRequest.verify|verify} messages. + * Encodes the specified GetKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.GetKeyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest} message DeleteKeyRequest message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IGetKeyRequest} message GetKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteKeyRequest message from the specified reader or buffer. + * Decodes a GetKeyRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest * @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.DeleteKeyRequest} DeleteKeyRequest + * @returns {google.cloud.recaptchaenterprise.v1.GetKeyRequest} GetKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteKeyRequest.decode = function decode(reader, length) { + GetKeyRequest.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.DeleteKeyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.GetKeyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -5615,30 +8161,30 @@ }; /** - * Decodes a DeleteKeyRequest message from the specified reader or buffer, length delimited. + * Decodes a GetKeyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.DeleteKeyRequest} DeleteKeyRequest + * @returns {google.cloud.recaptchaenterprise.v1.GetKeyRequest} GetKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteKeyRequest.decodeDelimited = function decodeDelimited(reader) { + GetKeyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteKeyRequest message. + * Verifies a GetKeyRequest message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteKeyRequest.verify = function verify(message) { + GetKeyRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -5648,32 +8194,32 @@ }; /** - * Creates a DeleteKeyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetKeyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.DeleteKeyRequest} DeleteKeyRequest + * @returns {google.cloud.recaptchaenterprise.v1.GetKeyRequest} GetKeyRequest */ - DeleteKeyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest) + GetKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.GetKeyRequest) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest(); + var message = new $root.google.cloud.recaptchaenterprise.v1.GetKeyRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a DeleteKeyRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetKeyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.DeleteKeyRequest} message DeleteKeyRequest + * @param {google.cloud.recaptchaenterprise.v1.GetKeyRequest} message GetKeyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteKeyRequest.toObject = function toObject(message, options) { + GetKeyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -5685,53 +8231,53 @@ }; /** - * Converts this DeleteKeyRequest to JSON. + * Converts this GetKeyRequest to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest * @instance * @returns {Object.} JSON object */ - DeleteKeyRequest.prototype.toJSON = function toJSON() { + GetKeyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteKeyRequest + * Gets the default type url for GetKeyRequest * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.DeleteKeyRequest"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.GetKeyRequest"; }; - return DeleteKeyRequest; + return GetKeyRequest; })(); - v1.MigrateKeyRequest = (function() { + v1.UpdateKeyRequest = (function() { /** - * Properties of a MigrateKeyRequest. + * Properties of an UpdateKeyRequest. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IMigrateKeyRequest - * @property {string|null} [name] MigrateKeyRequest name - * @property {boolean|null} [skipBillingCheck] MigrateKeyRequest skipBillingCheck + * @interface IUpdateKeyRequest + * @property {google.cloud.recaptchaenterprise.v1.IKey|null} [key] UpdateKeyRequest key + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateKeyRequest updateMask */ /** - * Constructs a new MigrateKeyRequest. + * Constructs a new UpdateKeyRequest. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents a MigrateKeyRequest. - * @implements IMigrateKeyRequest + * @classdesc Represents an UpdateKeyRequest. + * @implements IUpdateKeyRequest * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest=} [properties] Properties to set */ - function MigrateKeyRequest(properties) { + function UpdateKeyRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5739,89 +8285,89 @@ } /** - * MigrateKeyRequest name. - * @member {string} name - * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest + * UpdateKeyRequest key. + * @member {google.cloud.recaptchaenterprise.v1.IKey|null|undefined} key + * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest * @instance */ - MigrateKeyRequest.prototype.name = ""; + UpdateKeyRequest.prototype.key = null; /** - * MigrateKeyRequest skipBillingCheck. - * @member {boolean} skipBillingCheck - * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest + * UpdateKeyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest * @instance */ - MigrateKeyRequest.prototype.skipBillingCheck = false; + UpdateKeyRequest.prototype.updateMask = null; /** - * Creates a new MigrateKeyRequest instance using the specified properties. + * Creates a new UpdateKeyRequest instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.MigrateKeyRequest} MigrateKeyRequest instance + * @param {google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.UpdateKeyRequest} UpdateKeyRequest instance */ - MigrateKeyRequest.create = function create(properties) { - return new MigrateKeyRequest(properties); + UpdateKeyRequest.create = function create(properties) { + return new UpdateKeyRequest(properties); }; /** - * Encodes the specified MigrateKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.MigrateKeyRequest.verify|verify} messages. + * Encodes the specified UpdateKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.UpdateKeyRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest} message MigrateKeyRequest message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest} message UpdateKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MigrateKeyRequest.encode = function encode(message, writer) { + UpdateKeyRequest.encode = function encode(message, writer) { if (!writer) 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); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + $root.google.cloud.recaptchaenterprise.v1.Key.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified MigrateKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.MigrateKeyRequest.verify|verify} messages. + * Encodes the specified UpdateKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.UpdateKeyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest} message MigrateKeyRequest message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest} message UpdateKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MigrateKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MigrateKeyRequest message from the specified reader or buffer. + * Decodes an UpdateKeyRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest * @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.MigrateKeyRequest} MigrateKeyRequest + * @returns {google.cloud.recaptchaenterprise.v1.UpdateKeyRequest} UpdateKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigrateKeyRequest.decode = function decode(reader, length) { + UpdateKeyRequest.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.MigrateKeyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.key = $root.google.cloud.recaptchaenterprise.v1.Key.decode(reader, reader.uint32()); break; } case 2: { - message.skipBillingCheck = reader.bool(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } default: @@ -5833,131 +8379,141 @@ }; /** - * Decodes a MigrateKeyRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateKeyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.MigrateKeyRequest} MigrateKeyRequest + * @returns {google.cloud.recaptchaenterprise.v1.UpdateKeyRequest} UpdateKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigrateKeyRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateKeyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MigrateKeyRequest message. + * Verifies an UpdateKeyRequest message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MigrateKeyRequest.verify = function verify(message) { + UpdateKeyRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - 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"; + if (message.key != null && message.hasOwnProperty("key")) { + var error = $root.google.cloud.recaptchaenterprise.v1.Key.verify(message.key); + if (error) + return "key." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } return null; }; /** - * Creates a MigrateKeyRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateKeyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.MigrateKeyRequest} MigrateKeyRequest + * @returns {google.cloud.recaptchaenterprise.v1.UpdateKeyRequest} UpdateKeyRequest */ - MigrateKeyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest) + UpdateKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest) return object; - 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); + var message = new $root.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest(); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.UpdateKeyRequest.key: object expected"); + message.key = $root.google.cloud.recaptchaenterprise.v1.Key.fromObject(object.key); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.UpdateKeyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } return message; }; /** - * Creates a plain object from a MigrateKeyRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateKeyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.MigrateKeyRequest} message MigrateKeyRequest + * @param {google.cloud.recaptchaenterprise.v1.UpdateKeyRequest} message UpdateKeyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MigrateKeyRequest.toObject = function toObject(message, options) { + UpdateKeyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.skipBillingCheck = false; + object.key = null; + object.updateMask = null; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.skipBillingCheck != null && message.hasOwnProperty("skipBillingCheck")) - object.skipBillingCheck = message.skipBillingCheck; + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.google.cloud.recaptchaenterprise.v1.Key.toObject(message.key, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this MigrateKeyRequest to JSON. + * Converts this UpdateKeyRequest to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest * @instance * @returns {Object.} JSON object */ - MigrateKeyRequest.prototype.toJSON = function toJSON() { + UpdateKeyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MigrateKeyRequest + * Gets the default type url for UpdateKeyRequest * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MigrateKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.MigrateKeyRequest"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.UpdateKeyRequest"; }; - return MigrateKeyRequest; + return UpdateKeyRequest; })(); - v1.GetMetricsRequest = (function() { + v1.DeleteKeyRequest = (function() { /** - * Properties of a GetMetricsRequest. + * Properties of a DeleteKeyRequest. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IGetMetricsRequest - * @property {string|null} [name] GetMetricsRequest name + * @interface IDeleteKeyRequest + * @property {string|null} [name] DeleteKeyRequest name */ /** - * Constructs a new GetMetricsRequest. + * Constructs a new DeleteKeyRequest. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents a GetMetricsRequest. - * @implements IGetMetricsRequest + * @classdesc Represents a DeleteKeyRequest. + * @implements IDeleteKeyRequest * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IGetMetricsRequest=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest=} [properties] Properties to set */ - function GetMetricsRequest(properties) { + function DeleteKeyRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5965,35 +8521,35 @@ } /** - * GetMetricsRequest name. + * DeleteKeyRequest name. * @member {string} name - * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest + * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest * @instance */ - GetMetricsRequest.prototype.name = ""; + DeleteKeyRequest.prototype.name = ""; /** - * Creates a new GetMetricsRequest instance using the specified properties. + * Creates a new DeleteKeyRequest instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest + * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IGetMetricsRequest=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.GetMetricsRequest} GetMetricsRequest instance + * @param {google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.DeleteKeyRequest} DeleteKeyRequest instance */ - GetMetricsRequest.create = function create(properties) { - return new GetMetricsRequest(properties); + DeleteKeyRequest.create = function create(properties) { + return new DeleteKeyRequest(properties); }; /** - * Encodes the specified GetMetricsRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.GetMetricsRequest.verify|verify} messages. + * Encodes the specified DeleteKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.DeleteKeyRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest + * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IGetMetricsRequest} message GetMetricsRequest message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest} message DeleteKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetMetricsRequest.encode = function encode(message, writer) { + DeleteKeyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -6002,33 +8558,33 @@ }; /** - * Encodes the specified GetMetricsRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.GetMetricsRequest.verify|verify} messages. + * Encodes the specified DeleteKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.DeleteKeyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest + * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IGetMetricsRequest} message GetMetricsRequest message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest} message DeleteKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetMetricsRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetMetricsRequest message from the specified reader or buffer. + * Decodes a DeleteKeyRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest + * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest * @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.GetMetricsRequest} GetMetricsRequest + * @returns {google.cloud.recaptchaenterprise.v1.DeleteKeyRequest} DeleteKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetMetricsRequest.decode = function decode(reader, length) { + DeleteKeyRequest.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.GetMetricsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -6045,30 +8601,30 @@ }; /** - * Decodes a GetMetricsRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteKeyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest + * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.GetMetricsRequest} GetMetricsRequest + * @returns {google.cloud.recaptchaenterprise.v1.DeleteKeyRequest} DeleteKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetMetricsRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteKeyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetMetricsRequest message. + * Verifies a DeleteKeyRequest message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest + * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetMetricsRequest.verify = function verify(message) { + DeleteKeyRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -6078,32 +8634,32 @@ }; /** - * Creates a GetMetricsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteKeyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest + * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.GetMetricsRequest} GetMetricsRequest + * @returns {google.cloud.recaptchaenterprise.v1.DeleteKeyRequest} DeleteKeyRequest */ - GetMetricsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.GetMetricsRequest) + DeleteKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.GetMetricsRequest(); + var message = new $root.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a GetMetricsRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteKeyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest + * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.GetMetricsRequest} message GetMetricsRequest + * @param {google.cloud.recaptchaenterprise.v1.DeleteKeyRequest} message DeleteKeyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetMetricsRequest.toObject = function toObject(message, options) { + DeleteKeyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -6115,57 +8671,53 @@ }; /** - * Converts this GetMetricsRequest to JSON. + * Converts this DeleteKeyRequest to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest + * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest * @instance * @returns {Object.} JSON object */ - GetMetricsRequest.prototype.toJSON = function toJSON() { + DeleteKeyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetMetricsRequest + * Gets the default type url for DeleteKeyRequest * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest + * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetMetricsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.GetMetricsRequest"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.DeleteKeyRequest"; }; - return GetMetricsRequest; + return DeleteKeyRequest; })(); - v1.Metrics = (function() { + v1.MigrateKeyRequest = (function() { /** - * Properties of a Metrics. + * Properties of a MigrateKeyRequest. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IMetrics - * @property {string|null} [name] Metrics name - * @property {google.protobuf.ITimestamp|null} [startTime] Metrics startTime - * @property {Array.|null} [scoreMetrics] Metrics scoreMetrics - * @property {Array.|null} [challengeMetrics] Metrics challengeMetrics + * @interface IMigrateKeyRequest + * @property {string|null} [name] MigrateKeyRequest name + * @property {boolean|null} [skipBillingCheck] MigrateKeyRequest skipBillingCheck */ /** - * Constructs a new Metrics. + * Constructs a new MigrateKeyRequest. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents a Metrics. - * @implements IMetrics + * @classdesc Represents a MigrateKeyRequest. + * @implements IMigrateKeyRequest * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IMetrics=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest=} [properties] Properties to set */ - function Metrics(properties) { - this.scoreMetrics = []; - this.challengeMetrics = []; + function MigrateKeyRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6173,123 +8725,89 @@ } /** - * Metrics name. + * MigrateKeyRequest name. * @member {string} name - * @memberof google.cloud.recaptchaenterprise.v1.Metrics - * @instance - */ - Metrics.prototype.name = ""; - - /** - * Metrics startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.recaptchaenterprise.v1.Metrics - * @instance - */ - Metrics.prototype.startTime = null; - - /** - * Metrics scoreMetrics. - * @member {Array.} scoreMetrics - * @memberof google.cloud.recaptchaenterprise.v1.Metrics + * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest * @instance */ - Metrics.prototype.scoreMetrics = $util.emptyArray; + MigrateKeyRequest.prototype.name = ""; /** - * Metrics challengeMetrics. - * @member {Array.} challengeMetrics - * @memberof google.cloud.recaptchaenterprise.v1.Metrics + * MigrateKeyRequest skipBillingCheck. + * @member {boolean} skipBillingCheck + * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest * @instance */ - Metrics.prototype.challengeMetrics = $util.emptyArray; + MigrateKeyRequest.prototype.skipBillingCheck = false; /** - * Creates a new Metrics instance using the specified properties. + * Creates a new MigrateKeyRequest instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.Metrics + * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IMetrics=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.Metrics} Metrics instance + * @param {google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.MigrateKeyRequest} MigrateKeyRequest instance */ - Metrics.create = function create(properties) { - return new Metrics(properties); + MigrateKeyRequest.create = function create(properties) { + return new MigrateKeyRequest(properties); }; /** - * Encodes the specified Metrics message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Metrics.verify|verify} messages. + * Encodes the specified MigrateKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.MigrateKeyRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.Metrics + * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IMetrics} message Metrics message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest} message MigrateKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Metrics.encode = function encode(message, writer) { + MigrateKeyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.scoreMetrics != null && message.scoreMetrics.length) - for (var i = 0; i < message.scoreMetrics.length; ++i) - $root.google.cloud.recaptchaenterprise.v1.ScoreMetrics.encode(message.scoreMetrics[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.challengeMetrics != null && message.challengeMetrics.length) - for (var i = 0; i < message.challengeMetrics.length; ++i) - $root.google.cloud.recaptchaenterprise.v1.ChallengeMetrics.encode(message.challengeMetrics[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(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; }; /** - * Encodes the specified Metrics message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Metrics.verify|verify} messages. + * Encodes the specified MigrateKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.MigrateKeyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.Metrics + * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IMetrics} message Metrics message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest} message MigrateKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Metrics.encodeDelimited = function encodeDelimited(message, writer) { + MigrateKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Metrics message from the specified reader or buffer. + * Decodes a MigrateKeyRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.Metrics + * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest * @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.Metrics} Metrics + * @returns {google.cloud.recaptchaenterprise.v1.MigrateKeyRequest} MigrateKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Metrics.decode = function decode(reader, length) { + MigrateKeyRequest.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.Metrics(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 4: { - message.name = reader.string(); - break; - } case 1: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.name = reader.string(); break; } case 2: { - if (!(message.scoreMetrics && message.scoreMetrics.length)) - message.scoreMetrics = []; - message.scoreMetrics.push($root.google.cloud.recaptchaenterprise.v1.ScoreMetrics.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.challengeMetrics && message.challengeMetrics.length)) - message.challengeMetrics = []; - message.challengeMetrics.push($root.google.cloud.recaptchaenterprise.v1.ChallengeMetrics.decode(reader, reader.uint32())); + message.skipBillingCheck = reader.bool(); break; } default: @@ -6301,188 +8819,131 @@ }; /** - * Decodes a Metrics message from the specified reader or buffer, length delimited. + * Decodes a MigrateKeyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.Metrics + * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.Metrics} Metrics + * @returns {google.cloud.recaptchaenterprise.v1.MigrateKeyRequest} MigrateKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Metrics.decodeDelimited = function decodeDelimited(reader) { + MigrateKeyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Metrics message. + * Verifies a MigrateKeyRequest message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.Metrics + * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Metrics.verify = function verify(message) { + MigrateKeyRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.scoreMetrics != null && message.hasOwnProperty("scoreMetrics")) { - if (!Array.isArray(message.scoreMetrics)) - return "scoreMetrics: array expected"; - for (var i = 0; i < message.scoreMetrics.length; ++i) { - var error = $root.google.cloud.recaptchaenterprise.v1.ScoreMetrics.verify(message.scoreMetrics[i]); - if (error) - return "scoreMetrics." + error; - } - } - if (message.challengeMetrics != null && message.hasOwnProperty("challengeMetrics")) { - if (!Array.isArray(message.challengeMetrics)) - return "challengeMetrics: array expected"; - for (var i = 0; i < message.challengeMetrics.length; ++i) { - var error = $root.google.cloud.recaptchaenterprise.v1.ChallengeMetrics.verify(message.challengeMetrics[i]); - if (error) - return "challengeMetrics." + error; - } - } + if (message.skipBillingCheck != null && message.hasOwnProperty("skipBillingCheck")) + if (typeof message.skipBillingCheck !== "boolean") + return "skipBillingCheck: boolean expected"; return null; }; /** - * Creates a Metrics message from a plain object. Also converts values to their respective internal types. + * Creates a MigrateKeyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.Metrics + * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.Metrics} Metrics + * @returns {google.cloud.recaptchaenterprise.v1.MigrateKeyRequest} MigrateKeyRequest */ - Metrics.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.Metrics) + MigrateKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.Metrics(); + var message = new $root.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest(); if (object.name != null) message.name = String(object.name); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.Metrics.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.scoreMetrics) { - if (!Array.isArray(object.scoreMetrics)) - throw TypeError(".google.cloud.recaptchaenterprise.v1.Metrics.scoreMetrics: array expected"); - message.scoreMetrics = []; - for (var i = 0; i < object.scoreMetrics.length; ++i) { - if (typeof object.scoreMetrics[i] !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.Metrics.scoreMetrics: object expected"); - message.scoreMetrics[i] = $root.google.cloud.recaptchaenterprise.v1.ScoreMetrics.fromObject(object.scoreMetrics[i]); - } - } - if (object.challengeMetrics) { - if (!Array.isArray(object.challengeMetrics)) - throw TypeError(".google.cloud.recaptchaenterprise.v1.Metrics.challengeMetrics: array expected"); - message.challengeMetrics = []; - for (var i = 0; i < object.challengeMetrics.length; ++i) { - if (typeof object.challengeMetrics[i] !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.Metrics.challengeMetrics: object expected"); - message.challengeMetrics[i] = $root.google.cloud.recaptchaenterprise.v1.ChallengeMetrics.fromObject(object.challengeMetrics[i]); - } - } + if (object.skipBillingCheck != null) + message.skipBillingCheck = Boolean(object.skipBillingCheck); return message; }; /** - * Creates a plain object from a Metrics message. Also converts values to other types if specified. + * Creates a plain object from a MigrateKeyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.Metrics + * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.Metrics} message Metrics + * @param {google.cloud.recaptchaenterprise.v1.MigrateKeyRequest} message MigrateKeyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Metrics.toObject = function toObject(message, options) { + MigrateKeyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.scoreMetrics = []; - object.challengeMetrics = []; - } if (options.defaults) { - object.startTime = null; object.name = ""; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.scoreMetrics && message.scoreMetrics.length) { - object.scoreMetrics = []; - for (var j = 0; j < message.scoreMetrics.length; ++j) - object.scoreMetrics[j] = $root.google.cloud.recaptchaenterprise.v1.ScoreMetrics.toObject(message.scoreMetrics[j], options); - } - if (message.challengeMetrics && message.challengeMetrics.length) { - object.challengeMetrics = []; - for (var j = 0; j < message.challengeMetrics.length; ++j) - object.challengeMetrics[j] = $root.google.cloud.recaptchaenterprise.v1.ChallengeMetrics.toObject(message.challengeMetrics[j], options); + 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; }; /** - * Converts this Metrics to JSON. + * Converts this MigrateKeyRequest to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.Metrics + * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest * @instance * @returns {Object.} JSON object */ - Metrics.prototype.toJSON = function toJSON() { + MigrateKeyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Metrics + * Gets the default type url for MigrateKeyRequest * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1.Metrics + * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Metrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MigrateKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.Metrics"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.MigrateKeyRequest"; }; - return Metrics; + return MigrateKeyRequest; })(); - v1.RetrieveLegacySecretKeyResponse = (function() { + v1.GetMetricsRequest = (function() { /** - * Properties of a RetrieveLegacySecretKeyResponse. + * Properties of a GetMetricsRequest. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IRetrieveLegacySecretKeyResponse - * @property {string|null} [legacySecretKey] RetrieveLegacySecretKeyResponse legacySecretKey + * @interface IGetMetricsRequest + * @property {string|null} [name] GetMetricsRequest name */ /** - * Constructs a new RetrieveLegacySecretKeyResponse. + * Constructs a new GetMetricsRequest. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents a RetrieveLegacySecretKeyResponse. - * @implements IRetrieveLegacySecretKeyResponse + * @classdesc Represents a GetMetricsRequest. + * @implements IGetMetricsRequest * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IGetMetricsRequest=} [properties] Properties to set */ - function RetrieveLegacySecretKeyResponse(properties) { + function GetMetricsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6490,75 +8951,75 @@ } /** - * RetrieveLegacySecretKeyResponse legacySecretKey. - * @member {string} legacySecretKey - * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse + * GetMetricsRequest name. + * @member {string} name + * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest * @instance */ - RetrieveLegacySecretKeyResponse.prototype.legacySecretKey = ""; + GetMetricsRequest.prototype.name = ""; /** - * Creates a new RetrieveLegacySecretKeyResponse instance using the specified properties. + * Creates a new GetMetricsRequest instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse + * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse} RetrieveLegacySecretKeyResponse instance + * @param {google.cloud.recaptchaenterprise.v1.IGetMetricsRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.GetMetricsRequest} GetMetricsRequest instance */ - RetrieveLegacySecretKeyResponse.create = function create(properties) { - return new RetrieveLegacySecretKeyResponse(properties); + GetMetricsRequest.create = function create(properties) { + return new GetMetricsRequest(properties); }; /** - * Encodes the specified RetrieveLegacySecretKeyResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse.verify|verify} messages. + * Encodes the specified GetMetricsRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.GetMetricsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse + * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse} message RetrieveLegacySecretKeyResponse message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IGetMetricsRequest} message GetMetricsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RetrieveLegacySecretKeyResponse.encode = function encode(message, writer) { + GetMetricsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.legacySecretKey != null && Object.hasOwnProperty.call(message, "legacySecretKey")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.legacySecretKey); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified RetrieveLegacySecretKeyResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse.verify|verify} messages. + * Encodes the specified GetMetricsRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.GetMetricsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse + * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse} message RetrieveLegacySecretKeyResponse message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IGetMetricsRequest} message GetMetricsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RetrieveLegacySecretKeyResponse.encodeDelimited = function encodeDelimited(message, writer) { + GetMetricsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RetrieveLegacySecretKeyResponse message from the specified reader or buffer. + * Decodes a GetMetricsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse + * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest * @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.RetrieveLegacySecretKeyResponse} RetrieveLegacySecretKeyResponse + * @returns {google.cloud.recaptchaenterprise.v1.GetMetricsRequest} GetMetricsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RetrieveLegacySecretKeyResponse.decode = function decode(reader, length) { + GetMetricsRequest.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.RetrieveLegacySecretKeyResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.GetMetricsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.legacySecretKey = reader.string(); + message.name = reader.string(); break; } default: @@ -6570,131 +9031,127 @@ }; /** - * Decodes a RetrieveLegacySecretKeyResponse message from the specified reader or buffer, length delimited. + * Decodes a GetMetricsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse + * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse} RetrieveLegacySecretKeyResponse + * @returns {google.cloud.recaptchaenterprise.v1.GetMetricsRequest} GetMetricsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RetrieveLegacySecretKeyResponse.decodeDelimited = function decodeDelimited(reader) { + GetMetricsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RetrieveLegacySecretKeyResponse message. + * Verifies a GetMetricsRequest message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse + * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RetrieveLegacySecretKeyResponse.verify = function verify(message) { + GetMetricsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.legacySecretKey != null && message.hasOwnProperty("legacySecretKey")) - if (!$util.isString(message.legacySecretKey)) - return "legacySecretKey: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a RetrieveLegacySecretKeyResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetMetricsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse + * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse} RetrieveLegacySecretKeyResponse + * @returns {google.cloud.recaptchaenterprise.v1.GetMetricsRequest} GetMetricsRequest */ - RetrieveLegacySecretKeyResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse) + GetMetricsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.GetMetricsRequest) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse(); - if (object.legacySecretKey != null) - message.legacySecretKey = String(object.legacySecretKey); + var message = new $root.google.cloud.recaptchaenterprise.v1.GetMetricsRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a RetrieveLegacySecretKeyResponse message. Also converts values to other types if specified. + * Creates a plain object from a GetMetricsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse + * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse} message RetrieveLegacySecretKeyResponse + * @param {google.cloud.recaptchaenterprise.v1.GetMetricsRequest} message GetMetricsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RetrieveLegacySecretKeyResponse.toObject = function toObject(message, options) { + GetMetricsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.legacySecretKey = ""; - if (message.legacySecretKey != null && message.hasOwnProperty("legacySecretKey")) - object.legacySecretKey = message.legacySecretKey; + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this RetrieveLegacySecretKeyResponse to JSON. + * Converts this GetMetricsRequest to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse + * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest * @instance * @returns {Object.} JSON object */ - RetrieveLegacySecretKeyResponse.prototype.toJSON = function toJSON() { + GetMetricsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RetrieveLegacySecretKeyResponse + * Gets the default type url for GetMetricsRequest * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse + * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RetrieveLegacySecretKeyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetMetricsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.GetMetricsRequest"; }; - return RetrieveLegacySecretKeyResponse; + return GetMetricsRequest; })(); - v1.Key = (function() { + v1.Metrics = (function() { /** - * Properties of a Key. + * Properties of a Metrics. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IKey - * @property {string|null} [name] Key name - * @property {string|null} [displayName] Key displayName - * @property {google.cloud.recaptchaenterprise.v1.IWebKeySettings|null} [webSettings] Key webSettings - * @property {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings|null} [androidSettings] Key androidSettings - * @property {google.cloud.recaptchaenterprise.v1.IIOSKeySettings|null} [iosSettings] Key iosSettings - * @property {Object.|null} [labels] Key labels - * @property {google.protobuf.ITimestamp|null} [createTime] Key createTime - * @property {google.cloud.recaptchaenterprise.v1.ITestingOptions|null} [testingOptions] Key testingOptions - * @property {google.cloud.recaptchaenterprise.v1.IWafSettings|null} [wafSettings] Key wafSettings + * @interface IMetrics + * @property {string|null} [name] Metrics name + * @property {google.protobuf.ITimestamp|null} [startTime] Metrics startTime + * @property {Array.|null} [scoreMetrics] Metrics scoreMetrics + * @property {Array.|null} [challengeMetrics] Metrics challengeMetrics */ /** - * Constructs a new Key. + * Constructs a new Metrics. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents a Key. - * @implements IKey + * @classdesc Represents a Metrics. + * @implements IMetrics * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IKey=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IMetrics=} [properties] Properties to set */ - function Key(properties) { - this.labels = {}; + function Metrics(properties) { + this.scoreMetrics = []; + this.challengeMetrics = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6702,221 +9159,123 @@ } /** - * Key name. + * Metrics name. * @member {string} name - * @memberof google.cloud.recaptchaenterprise.v1.Key - * @instance - */ - Key.prototype.name = ""; - - /** - * Key displayName. - * @member {string} displayName - * @memberof google.cloud.recaptchaenterprise.v1.Key - * @instance - */ - Key.prototype.displayName = ""; - - /** - * Key webSettings. - * @member {google.cloud.recaptchaenterprise.v1.IWebKeySettings|null|undefined} webSettings - * @memberof google.cloud.recaptchaenterprise.v1.Key - * @instance - */ - Key.prototype.webSettings = null; - - /** - * Key androidSettings. - * @member {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings|null|undefined} androidSettings - * @memberof google.cloud.recaptchaenterprise.v1.Key - * @instance - */ - Key.prototype.androidSettings = null; - - /** - * Key iosSettings. - * @member {google.cloud.recaptchaenterprise.v1.IIOSKeySettings|null|undefined} iosSettings - * @memberof google.cloud.recaptchaenterprise.v1.Key - * @instance - */ - Key.prototype.iosSettings = null; - - /** - * Key labels. - * @member {Object.} labels - * @memberof google.cloud.recaptchaenterprise.v1.Key - * @instance - */ - Key.prototype.labels = $util.emptyObject; - - /** - * Key createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.recaptchaenterprise.v1.Key + * @memberof google.cloud.recaptchaenterprise.v1.Metrics * @instance */ - Key.prototype.createTime = null; + Metrics.prototype.name = ""; /** - * Key testingOptions. - * @member {google.cloud.recaptchaenterprise.v1.ITestingOptions|null|undefined} testingOptions - * @memberof google.cloud.recaptchaenterprise.v1.Key + * Metrics startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.recaptchaenterprise.v1.Metrics * @instance */ - Key.prototype.testingOptions = null; + Metrics.prototype.startTime = null; /** - * Key wafSettings. - * @member {google.cloud.recaptchaenterprise.v1.IWafSettings|null|undefined} wafSettings - * @memberof google.cloud.recaptchaenterprise.v1.Key + * Metrics scoreMetrics. + * @member {Array.} scoreMetrics + * @memberof google.cloud.recaptchaenterprise.v1.Metrics * @instance */ - Key.prototype.wafSettings = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + Metrics.prototype.scoreMetrics = $util.emptyArray; /** - * Key platformSettings. - * @member {"webSettings"|"androidSettings"|"iosSettings"|undefined} platformSettings - * @memberof google.cloud.recaptchaenterprise.v1.Key + * Metrics challengeMetrics. + * @member {Array.} challengeMetrics + * @memberof google.cloud.recaptchaenterprise.v1.Metrics * @instance */ - Object.defineProperty(Key.prototype, "platformSettings", { - get: $util.oneOfGetter($oneOfFields = ["webSettings", "androidSettings", "iosSettings"]), - set: $util.oneOfSetter($oneOfFields) - }); + Metrics.prototype.challengeMetrics = $util.emptyArray; /** - * Creates a new Key instance using the specified properties. + * Creates a new Metrics instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.Key + * @memberof google.cloud.recaptchaenterprise.v1.Metrics * @static - * @param {google.cloud.recaptchaenterprise.v1.IKey=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.Key} Key instance + * @param {google.cloud.recaptchaenterprise.v1.IMetrics=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.Metrics} Metrics instance */ - Key.create = function create(properties) { - return new Key(properties); + Metrics.create = function create(properties) { + return new Metrics(properties); }; /** - * Encodes the specified Key message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Key.verify|verify} messages. + * Encodes the specified Metrics message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Metrics.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.Key + * @memberof google.cloud.recaptchaenterprise.v1.Metrics * @static - * @param {google.cloud.recaptchaenterprise.v1.IKey} message Key message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IMetrics} message Metrics message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Key.encode = function encode(message, writer) { + Metrics.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.scoreMetrics != null && message.scoreMetrics.length) + for (var i = 0; i < message.scoreMetrics.length; ++i) + $root.google.cloud.recaptchaenterprise.v1.ScoreMetrics.encode(message.scoreMetrics[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.challengeMetrics != null && message.challengeMetrics.length) + for (var i = 0; i < message.challengeMetrics.length; ++i) + $root.google.cloud.recaptchaenterprise.v1.ChallengeMetrics.encode(message.challengeMetrics[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.webSettings != null && Object.hasOwnProperty.call(message, "webSettings")) - $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.encode(message.webSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.androidSettings != null && Object.hasOwnProperty.call(message, "androidSettings")) - $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.encode(message.androidSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.iosSettings != null && Object.hasOwnProperty.call(message, "iosSettings")) - $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.encode(message.iosSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.testingOptions != null && Object.hasOwnProperty.call(message, "testingOptions")) - $root.google.cloud.recaptchaenterprise.v1.TestingOptions.encode(message.testingOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.wafSettings != null && Object.hasOwnProperty.call(message, "wafSettings")) - $root.google.cloud.recaptchaenterprise.v1.WafSettings.encode(message.wafSettings, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); return writer; }; /** - * Encodes the specified Key message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Key.verify|verify} messages. + * Encodes the specified Metrics message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Metrics.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.Key + * @memberof google.cloud.recaptchaenterprise.v1.Metrics * @static - * @param {google.cloud.recaptchaenterprise.v1.IKey} message Key message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IMetrics} message Metrics message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Key.encodeDelimited = function encodeDelimited(message, writer) { + Metrics.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Key message from the specified reader or buffer. + * Decodes a Metrics message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.Key + * @memberof google.cloud.recaptchaenterprise.v1.Metrics * @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.Key} Key + * @returns {google.cloud.recaptchaenterprise.v1.Metrics} Metrics * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Key.decode = function decode(reader, length) { + Metrics.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.Key(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.Metrics(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.webSettings = $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.decode(reader, reader.uint32()); - break; - } case 4: { - message.androidSettings = $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.decode(reader, reader.uint32()); - break; - } - case 5: { - message.iosSettings = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.decode(reader, reader.uint32()); - break; - } - case 6: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; + message.name = reader.string(); break; } - case 7: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } - case 9: { - message.testingOptions = $root.google.cloud.recaptchaenterprise.v1.TestingOptions.decode(reader, reader.uint32()); + case 2: { + if (!(message.scoreMetrics && message.scoreMetrics.length)) + message.scoreMetrics = []; + message.scoreMetrics.push($root.google.cloud.recaptchaenterprise.v1.ScoreMetrics.decode(reader, reader.uint32())); break; } - case 10: { - message.wafSettings = $root.google.cloud.recaptchaenterprise.v1.WafSettings.decode(reader, reader.uint32()); + case 3: { + if (!(message.challengeMetrics && message.challengeMetrics.length)) + message.challengeMetrics = []; + message.challengeMetrics.push($root.google.cloud.recaptchaenterprise.v1.ChallengeMetrics.decode(reader, reader.uint32())); break; } default: @@ -6928,253 +9287,188 @@ }; /** - * Decodes a Key message from the specified reader or buffer, length delimited. + * Decodes a Metrics message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.Key + * @memberof google.cloud.recaptchaenterprise.v1.Metrics * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.Key} Key + * @returns {google.cloud.recaptchaenterprise.v1.Metrics} Metrics * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Key.decodeDelimited = function decodeDelimited(reader) { + Metrics.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Key message. + * Verifies a Metrics message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.Key + * @memberof google.cloud.recaptchaenterprise.v1.Metrics * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Key.verify = function verify(message) { + Metrics.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.webSettings != null && message.hasOwnProperty("webSettings")) { - properties.platformSettings = 1; - { - var error = $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.verify(message.webSettings); - if (error) - return "webSettings." + error; - } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; } - if (message.androidSettings != null && message.hasOwnProperty("androidSettings")) { - if (properties.platformSettings === 1) - return "platformSettings: multiple values"; - properties.platformSettings = 1; - { - var error = $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.verify(message.androidSettings); + if (message.scoreMetrics != null && message.hasOwnProperty("scoreMetrics")) { + if (!Array.isArray(message.scoreMetrics)) + return "scoreMetrics: array expected"; + for (var i = 0; i < message.scoreMetrics.length; ++i) { + var error = $root.google.cloud.recaptchaenterprise.v1.ScoreMetrics.verify(message.scoreMetrics[i]); if (error) - return "androidSettings." + error; + return "scoreMetrics." + error; } } - if (message.iosSettings != null && message.hasOwnProperty("iosSettings")) { - if (properties.platformSettings === 1) - return "platformSettings: multiple values"; - properties.platformSettings = 1; - { - var error = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.verify(message.iosSettings); + if (message.challengeMetrics != null && message.hasOwnProperty("challengeMetrics")) { + if (!Array.isArray(message.challengeMetrics)) + return "challengeMetrics: array expected"; + for (var i = 0; i < message.challengeMetrics.length; ++i) { + var error = $root.google.cloud.recaptchaenterprise.v1.ChallengeMetrics.verify(message.challengeMetrics[i]); if (error) - return "iosSettings." + error; + return "challengeMetrics." + error; } } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.testingOptions != null && message.hasOwnProperty("testingOptions")) { - var error = $root.google.cloud.recaptchaenterprise.v1.TestingOptions.verify(message.testingOptions); - if (error) - return "testingOptions." + error; - } - if (message.wafSettings != null && message.hasOwnProperty("wafSettings")) { - var error = $root.google.cloud.recaptchaenterprise.v1.WafSettings.verify(message.wafSettings); - if (error) - return "wafSettings." + error; - } return null; }; /** - * Creates a Key message from a plain object. Also converts values to their respective internal types. + * Creates a Metrics message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.Key + * @memberof google.cloud.recaptchaenterprise.v1.Metrics * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.Key} Key + * @returns {google.cloud.recaptchaenterprise.v1.Metrics} Metrics */ - Key.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.Key) + Metrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.Metrics) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.Key(); + var message = new $root.google.cloud.recaptchaenterprise.v1.Metrics(); if (object.name != null) message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.webSettings != null) { - if (typeof object.webSettings !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.webSettings: object expected"); - message.webSettings = $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.fromObject(object.webSettings); - } - if (object.androidSettings != null) { - if (typeof object.androidSettings !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.androidSettings: object expected"); - message.androidSettings = $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.fromObject(object.androidSettings); - } - if (object.iosSettings != null) { - if (typeof object.iosSettings !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.iosSettings: object expected"); - message.iosSettings = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.fromObject(object.iosSettings); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Metrics.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); } - if (object.testingOptions != null) { - if (typeof object.testingOptions !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.testingOptions: object expected"); - message.testingOptions = $root.google.cloud.recaptchaenterprise.v1.TestingOptions.fromObject(object.testingOptions); + if (object.scoreMetrics) { + if (!Array.isArray(object.scoreMetrics)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.Metrics.scoreMetrics: array expected"); + message.scoreMetrics = []; + for (var i = 0; i < object.scoreMetrics.length; ++i) { + if (typeof object.scoreMetrics[i] !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Metrics.scoreMetrics: object expected"); + message.scoreMetrics[i] = $root.google.cloud.recaptchaenterprise.v1.ScoreMetrics.fromObject(object.scoreMetrics[i]); + } } - if (object.wafSettings != null) { - if (typeof object.wafSettings !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.wafSettings: object expected"); - message.wafSettings = $root.google.cloud.recaptchaenterprise.v1.WafSettings.fromObject(object.wafSettings); + if (object.challengeMetrics) { + if (!Array.isArray(object.challengeMetrics)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.Metrics.challengeMetrics: array expected"); + message.challengeMetrics = []; + for (var i = 0; i < object.challengeMetrics.length; ++i) { + if (typeof object.challengeMetrics[i] !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Metrics.challengeMetrics: object expected"); + message.challengeMetrics[i] = $root.google.cloud.recaptchaenterprise.v1.ChallengeMetrics.fromObject(object.challengeMetrics[i]); + } } return message; }; /** - * Creates a plain object from a Key message. Also converts values to other types if specified. + * Creates a plain object from a Metrics message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.Key + * @memberof google.cloud.recaptchaenterprise.v1.Metrics * @static - * @param {google.cloud.recaptchaenterprise.v1.Key} message Key + * @param {google.cloud.recaptchaenterprise.v1.Metrics} message Metrics * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Key.toObject = function toObject(message, options) { + Metrics.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.labels = {}; + if (options.arrays || options.defaults) { + object.scoreMetrics = []; + object.challengeMetrics = []; + } if (options.defaults) { + object.startTime = null; object.name = ""; - object.displayName = ""; - object.createTime = null; - object.testingOptions = null; - object.wafSettings = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.webSettings != null && message.hasOwnProperty("webSettings")) { - object.webSettings = $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.toObject(message.webSettings, options); - if (options.oneofs) - object.platformSettings = "webSettings"; - } - if (message.androidSettings != null && message.hasOwnProperty("androidSettings")) { - object.androidSettings = $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.toObject(message.androidSettings, options); - if (options.oneofs) - object.platformSettings = "androidSettings"; } - if (message.iosSettings != null && message.hasOwnProperty("iosSettings")) { - object.iosSettings = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.toObject(message.iosSettings, options); - if (options.oneofs) - object.platformSettings = "iosSettings"; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.scoreMetrics && message.scoreMetrics.length) { + object.scoreMetrics = []; + for (var j = 0; j < message.scoreMetrics.length; ++j) + object.scoreMetrics[j] = $root.google.cloud.recaptchaenterprise.v1.ScoreMetrics.toObject(message.scoreMetrics[j], options); } - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; + if (message.challengeMetrics && message.challengeMetrics.length) { + object.challengeMetrics = []; + for (var j = 0; j < message.challengeMetrics.length; ++j) + object.challengeMetrics[j] = $root.google.cloud.recaptchaenterprise.v1.ChallengeMetrics.toObject(message.challengeMetrics[j], options); } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.testingOptions != null && message.hasOwnProperty("testingOptions")) - object.testingOptions = $root.google.cloud.recaptchaenterprise.v1.TestingOptions.toObject(message.testingOptions, options); - if (message.wafSettings != null && message.hasOwnProperty("wafSettings")) - object.wafSettings = $root.google.cloud.recaptchaenterprise.v1.WafSettings.toObject(message.wafSettings, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this Key to JSON. + * Converts this Metrics to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.Key + * @memberof google.cloud.recaptchaenterprise.v1.Metrics * @instance * @returns {Object.} JSON object */ - Key.prototype.toJSON = function toJSON() { + Metrics.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Key + * Gets the default type url for Metrics * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1.Key + * @memberof google.cloud.recaptchaenterprise.v1.Metrics * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Metrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.Key"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.Metrics"; }; - return Key; + return Metrics; })(); - v1.TestingOptions = (function() { + v1.RetrieveLegacySecretKeyResponse = (function() { /** - * Properties of a TestingOptions. + * Properties of a RetrieveLegacySecretKeyResponse. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface ITestingOptions - * @property {number|null} [testingScore] TestingOptions testingScore - * @property {google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge|null} [testingChallenge] TestingOptions testingChallenge + * @interface IRetrieveLegacySecretKeyResponse + * @property {string|null} [legacySecretKey] RetrieveLegacySecretKeyResponse legacySecretKey */ /** - * Constructs a new TestingOptions. + * Constructs a new RetrieveLegacySecretKeyResponse. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents a TestingOptions. - * @implements ITestingOptions + * @classdesc Represents a RetrieveLegacySecretKeyResponse. + * @implements IRetrieveLegacySecretKeyResponse * @constructor - * @param {google.cloud.recaptchaenterprise.v1.ITestingOptions=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse=} [properties] Properties to set */ - function TestingOptions(properties) { + function RetrieveLegacySecretKeyResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7182,89 +9476,75 @@ } /** - * TestingOptions testingScore. - * @member {number} testingScore - * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * RetrieveLegacySecretKeyResponse legacySecretKey. + * @member {string} legacySecretKey + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse * @instance */ - TestingOptions.prototype.testingScore = 0; + RetrieveLegacySecretKeyResponse.prototype.legacySecretKey = ""; /** - * TestingOptions testingChallenge. - * @member {google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge} testingChallenge - * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions - * @instance + * Creates a new RetrieveLegacySecretKeyResponse instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse} RetrieveLegacySecretKeyResponse instance */ - TestingOptions.prototype.testingChallenge = 0; + RetrieveLegacySecretKeyResponse.create = function create(properties) { + return new RetrieveLegacySecretKeyResponse(properties); + }; /** - * Creates a new TestingOptions instance using the specified properties. - * @function create - * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions - * @static - * @param {google.cloud.recaptchaenterprise.v1.ITestingOptions=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.TestingOptions} TestingOptions instance - */ - TestingOptions.create = function create(properties) { - return new TestingOptions(properties); - }; - - /** - * Encodes the specified TestingOptions message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TestingOptions.verify|verify} messages. + * Encodes the specified RetrieveLegacySecretKeyResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse * @static - * @param {google.cloud.recaptchaenterprise.v1.ITestingOptions} message TestingOptions message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse} message RetrieveLegacySecretKeyResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TestingOptions.encode = function encode(message, writer) { + RetrieveLegacySecretKeyResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.testingScore != null && Object.hasOwnProperty.call(message, "testingScore")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.testingScore); - if (message.testingChallenge != null && Object.hasOwnProperty.call(message, "testingChallenge")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.testingChallenge); + if (message.legacySecretKey != null && Object.hasOwnProperty.call(message, "legacySecretKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.legacySecretKey); return writer; }; /** - * Encodes the specified TestingOptions message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TestingOptions.verify|verify} messages. + * Encodes the specified RetrieveLegacySecretKeyResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse * @static - * @param {google.cloud.recaptchaenterprise.v1.ITestingOptions} message TestingOptions message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse} message RetrieveLegacySecretKeyResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TestingOptions.encodeDelimited = function encodeDelimited(message, writer) { + RetrieveLegacySecretKeyResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TestingOptions message from the specified reader or buffer. + * Decodes a RetrieveLegacySecretKeyResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse * @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.TestingOptions} TestingOptions + * @returns {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse} RetrieveLegacySecretKeyResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TestingOptions.decode = function decode(reader, length) { + RetrieveLegacySecretKeyResponse.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.TestingOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.testingScore = reader.float(); - break; - } - case 2: { - message.testingChallenge = reader.int32(); + message.legacySecretKey = reader.string(); break; } default: @@ -7276,176 +9556,131 @@ }; /** - * Decodes a TestingOptions message from the specified reader or buffer, length delimited. + * Decodes a RetrieveLegacySecretKeyResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.TestingOptions} TestingOptions + * @returns {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse} RetrieveLegacySecretKeyResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TestingOptions.decodeDelimited = function decodeDelimited(reader) { + RetrieveLegacySecretKeyResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TestingOptions message. + * Verifies a RetrieveLegacySecretKeyResponse message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TestingOptions.verify = function verify(message) { + RetrieveLegacySecretKeyResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.testingScore != null && message.hasOwnProperty("testingScore")) - if (typeof message.testingScore !== "number") - return "testingScore: number expected"; - if (message.testingChallenge != null && message.hasOwnProperty("testingChallenge")) - switch (message.testingChallenge) { - default: - return "testingChallenge: enum value expected"; - case 0: - case 1: - case 2: - break; - } + if (message.legacySecretKey != null && message.hasOwnProperty("legacySecretKey")) + if (!$util.isString(message.legacySecretKey)) + return "legacySecretKey: string expected"; return null; }; /** - * Creates a TestingOptions message from a plain object. Also converts values to their respective internal types. + * Creates a RetrieveLegacySecretKeyResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.TestingOptions} TestingOptions + * @returns {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse} RetrieveLegacySecretKeyResponse */ - TestingOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.TestingOptions) + RetrieveLegacySecretKeyResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.TestingOptions(); - if (object.testingScore != null) - message.testingScore = Number(object.testingScore); - switch (object.testingChallenge) { - default: - if (typeof object.testingChallenge === "number") { - message.testingChallenge = object.testingChallenge; - break; - } - break; - case "TESTING_CHALLENGE_UNSPECIFIED": - case 0: - message.testingChallenge = 0; - break; - case "NOCAPTCHA": - case 1: - message.testingChallenge = 1; - break; - case "UNSOLVABLE_CHALLENGE": - case 2: - message.testingChallenge = 2; - break; - } + var message = new $root.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse(); + if (object.legacySecretKey != null) + message.legacySecretKey = String(object.legacySecretKey); return message; }; /** - * Creates a plain object from a TestingOptions message. Also converts values to other types if specified. + * Creates a plain object from a RetrieveLegacySecretKeyResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse * @static - * @param {google.cloud.recaptchaenterprise.v1.TestingOptions} message TestingOptions + * @param {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse} message RetrieveLegacySecretKeyResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TestingOptions.toObject = function toObject(message, options) { + RetrieveLegacySecretKeyResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.testingScore = 0; - object.testingChallenge = options.enums === String ? "TESTING_CHALLENGE_UNSPECIFIED" : 0; - } - if (message.testingScore != null && message.hasOwnProperty("testingScore")) - object.testingScore = options.json && !isFinite(message.testingScore) ? String(message.testingScore) : message.testingScore; - if (message.testingChallenge != null && message.hasOwnProperty("testingChallenge")) - object.testingChallenge = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge[message.testingChallenge] === undefined ? message.testingChallenge : $root.google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge[message.testingChallenge] : message.testingChallenge; + if (options.defaults) + object.legacySecretKey = ""; + if (message.legacySecretKey != null && message.hasOwnProperty("legacySecretKey")) + object.legacySecretKey = message.legacySecretKey; return object; }; /** - * Converts this TestingOptions to JSON. + * Converts this RetrieveLegacySecretKeyResponse to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse * @instance * @returns {Object.} JSON object */ - TestingOptions.prototype.toJSON = function toJSON() { + RetrieveLegacySecretKeyResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TestingOptions + * Gets the default type url for RetrieveLegacySecretKeyResponse * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TestingOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RetrieveLegacySecretKeyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.TestingOptions"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse"; }; - /** - * TestingChallenge enum. - * @name google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge - * @enum {number} - * @property {number} TESTING_CHALLENGE_UNSPECIFIED=0 TESTING_CHALLENGE_UNSPECIFIED value - * @property {number} NOCAPTCHA=1 NOCAPTCHA value - * @property {number} UNSOLVABLE_CHALLENGE=2 UNSOLVABLE_CHALLENGE value - */ - TestingOptions.TestingChallenge = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TESTING_CHALLENGE_UNSPECIFIED"] = 0; - values[valuesById[1] = "NOCAPTCHA"] = 1; - values[valuesById[2] = "UNSOLVABLE_CHALLENGE"] = 2; - return values; - })(); - - return TestingOptions; + return RetrieveLegacySecretKeyResponse; })(); - v1.WebKeySettings = (function() { + v1.Key = (function() { /** - * Properties of a WebKeySettings. + * Properties of a Key. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IWebKeySettings - * @property {boolean|null} [allowAllDomains] WebKeySettings allowAllDomains - * @property {Array.|null} [allowedDomains] WebKeySettings allowedDomains - * @property {boolean|null} [allowAmpTraffic] WebKeySettings allowAmpTraffic - * @property {google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType|null} [integrationType] WebKeySettings integrationType - * @property {google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference|null} [challengeSecurityPreference] WebKeySettings challengeSecurityPreference + * @interface IKey + * @property {string|null} [name] Key name + * @property {string|null} [displayName] Key displayName + * @property {google.cloud.recaptchaenterprise.v1.IWebKeySettings|null} [webSettings] Key webSettings + * @property {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings|null} [androidSettings] Key androidSettings + * @property {google.cloud.recaptchaenterprise.v1.IIOSKeySettings|null} [iosSettings] Key iosSettings + * @property {Object.|null} [labels] Key labels + * @property {google.protobuf.ITimestamp|null} [createTime] Key createTime + * @property {google.cloud.recaptchaenterprise.v1.ITestingOptions|null} [testingOptions] Key testingOptions + * @property {google.cloud.recaptchaenterprise.v1.IWafSettings|null} [wafSettings] Key wafSettings */ /** - * Constructs a new WebKeySettings. + * Constructs a new Key. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents a WebKeySettings. - * @implements IWebKeySettings + * @classdesc Represents a Key. + * @implements IKey * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IWebKeySettings=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IKey=} [properties] Properties to set */ - function WebKeySettings(properties) { - this.allowedDomains = []; + function Key(properties) { + this.labels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7453,134 +9688,221 @@ } /** - * WebKeySettings allowAllDomains. - * @member {boolean} allowAllDomains - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * Key name. + * @member {string} name + * @memberof google.cloud.recaptchaenterprise.v1.Key * @instance */ - WebKeySettings.prototype.allowAllDomains = false; + Key.prototype.name = ""; /** - * WebKeySettings allowedDomains. - * @member {Array.} allowedDomains - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * Key displayName. + * @member {string} displayName + * @memberof google.cloud.recaptchaenterprise.v1.Key * @instance */ - WebKeySettings.prototype.allowedDomains = $util.emptyArray; + Key.prototype.displayName = ""; /** - * WebKeySettings allowAmpTraffic. - * @member {boolean} allowAmpTraffic - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * Key webSettings. + * @member {google.cloud.recaptchaenterprise.v1.IWebKeySettings|null|undefined} webSettings + * @memberof google.cloud.recaptchaenterprise.v1.Key * @instance */ - WebKeySettings.prototype.allowAmpTraffic = false; + Key.prototype.webSettings = null; /** - * WebKeySettings integrationType. - * @member {google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType} integrationType - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * Key androidSettings. + * @member {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings|null|undefined} androidSettings + * @memberof google.cloud.recaptchaenterprise.v1.Key * @instance */ - WebKeySettings.prototype.integrationType = 0; + Key.prototype.androidSettings = null; /** - * WebKeySettings challengeSecurityPreference. - * @member {google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference} challengeSecurityPreference - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * Key iosSettings. + * @member {google.cloud.recaptchaenterprise.v1.IIOSKeySettings|null|undefined} iosSettings + * @memberof google.cloud.recaptchaenterprise.v1.Key * @instance */ - WebKeySettings.prototype.challengeSecurityPreference = 0; + Key.prototype.iosSettings = null; /** - * Creates a new WebKeySettings instance using the specified properties. - * @function create - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings - * @static - * @param {google.cloud.recaptchaenterprise.v1.IWebKeySettings=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.WebKeySettings} WebKeySettings instance + * Key labels. + * @member {Object.} labels + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance */ - WebKeySettings.create = function create(properties) { - return new WebKeySettings(properties); - }; + Key.prototype.labels = $util.emptyObject; /** - * Encodes the specified WebKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.WebKeySettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings - * @static - * @param {google.cloud.recaptchaenterprise.v1.IWebKeySettings} message WebKeySettings message or plain object to encode + * Key createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + */ + Key.prototype.createTime = null; + + /** + * Key testingOptions. + * @member {google.cloud.recaptchaenterprise.v1.ITestingOptions|null|undefined} testingOptions + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + */ + Key.prototype.testingOptions = null; + + /** + * Key wafSettings. + * @member {google.cloud.recaptchaenterprise.v1.IWafSettings|null|undefined} wafSettings + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + */ + Key.prototype.wafSettings = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Key platformSettings. + * @member {"webSettings"|"androidSettings"|"iosSettings"|undefined} platformSettings + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + */ + Object.defineProperty(Key.prototype, "platformSettings", { + get: $util.oneOfGetter($oneOfFields = ["webSettings", "androidSettings", "iosSettings"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @static + * @param {google.cloud.recaptchaenterprise.v1.IKey=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Key.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @static + * @param {google.cloud.recaptchaenterprise.v1.IKey} message Key message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WebKeySettings.encode = function encode(message, writer) { + Key.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allowedDomains != null && message.allowedDomains.length) - for (var i = 0; i < message.allowedDomains.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedDomains[i]); - if (message.allowAmpTraffic != null && Object.hasOwnProperty.call(message, "allowAmpTraffic")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAmpTraffic); - if (message.allowAllDomains != null && Object.hasOwnProperty.call(message, "allowAllDomains")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowAllDomains); - if (message.integrationType != null && Object.hasOwnProperty.call(message, "integrationType")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.integrationType); - if (message.challengeSecurityPreference != null && Object.hasOwnProperty.call(message, "challengeSecurityPreference")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.challengeSecurityPreference); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.webSettings != null && Object.hasOwnProperty.call(message, "webSettings")) + $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.encode(message.webSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.androidSettings != null && Object.hasOwnProperty.call(message, "androidSettings")) + $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.encode(message.androidSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.iosSettings != null && Object.hasOwnProperty.call(message, "iosSettings")) + $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.encode(message.iosSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.testingOptions != null && Object.hasOwnProperty.call(message, "testingOptions")) + $root.google.cloud.recaptchaenterprise.v1.TestingOptions.encode(message.testingOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.wafSettings != null && Object.hasOwnProperty.call(message, "wafSettings")) + $root.google.cloud.recaptchaenterprise.v1.WafSettings.encode(message.wafSettings, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; /** - * Encodes the specified WebKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.WebKeySettings.verify|verify} messages. + * Encodes the specified Key message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Key.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.Key * @static - * @param {google.cloud.recaptchaenterprise.v1.IWebKeySettings} message WebKeySettings message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IKey} message Key message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WebKeySettings.encodeDelimited = function encodeDelimited(message, writer) { + Key.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WebKeySettings message from the specified reader or buffer. + * Decodes a Key message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.Key * @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.WebKeySettings} WebKeySettings + * @returns {google.cloud.recaptchaenterprise.v1.Key} Key * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebKeySettings.decode = function decode(reader, length) { + Key.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.WebKeySettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.Key(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: { - message.allowAllDomains = reader.bool(); - break; - } case 1: { - if (!(message.allowedDomains && message.allowedDomains.length)) - message.allowedDomains = []; - message.allowedDomains.push(reader.string()); + message.name = reader.string(); break; } case 2: { - message.allowAmpTraffic = reader.bool(); + message.displayName = reader.string(); + break; + } + case 3: { + message.webSettings = $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.decode(reader, reader.uint32()); break; } case 4: { - message.integrationType = reader.int32(); + message.androidSettings = $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.decode(reader, reader.uint32()); break; } case 5: { - message.challengeSecurityPreference = reader.int32(); + message.iosSettings = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.decode(reader, reader.uint32()); + break; + } + case 6: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.testingOptions = $root.google.cloud.recaptchaenterprise.v1.TestingOptions.decode(reader, reader.uint32()); + break; + } + case 10: { + message.wafSettings = $root.google.cloud.recaptchaenterprise.v1.WafSettings.decode(reader, reader.uint32()); break; } default: @@ -7592,96 +9914,760 @@ }; /** - * Decodes a WebKeySettings message from the specified reader or buffer, length delimited. + * Decodes a Key message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.Key * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.WebKeySettings} WebKeySettings + * @returns {google.cloud.recaptchaenterprise.v1.Key} Key * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebKeySettings.decodeDelimited = function decodeDelimited(reader) { + Key.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WebKeySettings message. + * Verifies a Key message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.Key * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WebKeySettings.verify = function verify(message) { + Key.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.allowAllDomains != null && message.hasOwnProperty("allowAllDomains")) - if (typeof message.allowAllDomains !== "boolean") - return "allowAllDomains: boolean expected"; - if (message.allowedDomains != null && message.hasOwnProperty("allowedDomains")) { - if (!Array.isArray(message.allowedDomains)) - return "allowedDomains: array expected"; - for (var i = 0; i < message.allowedDomains.length; ++i) - if (!$util.isString(message.allowedDomains[i])) - return "allowedDomains: string[] expected"; - } - if (message.allowAmpTraffic != null && message.hasOwnProperty("allowAmpTraffic")) - if (typeof message.allowAmpTraffic !== "boolean") - return "allowAmpTraffic: boolean expected"; - if (message.integrationType != null && message.hasOwnProperty("integrationType")) - switch (message.integrationType) { - default: - return "integrationType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.challengeSecurityPreference != null && message.hasOwnProperty("challengeSecurityPreference")) - switch (message.challengeSecurityPreference) { - default: - return "challengeSecurityPreference: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.webSettings != null && message.hasOwnProperty("webSettings")) { + properties.platformSettings = 1; + { + var error = $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.verify(message.webSettings); + if (error) + return "webSettings." + error; } - return null; - }; - - /** - * Creates a WebKeySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.WebKeySettings} WebKeySettings - */ - WebKeySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.WebKeySettings) - return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.WebKeySettings(); - if (object.allowAllDomains != null) - message.allowAllDomains = Boolean(object.allowAllDomains); - if (object.allowedDomains) { - if (!Array.isArray(object.allowedDomains)) - throw TypeError(".google.cloud.recaptchaenterprise.v1.WebKeySettings.allowedDomains: array expected"); - message.allowedDomains = []; - for (var i = 0; i < object.allowedDomains.length; ++i) - message.allowedDomains[i] = String(object.allowedDomains[i]); } - if (object.allowAmpTraffic != null) - message.allowAmpTraffic = Boolean(object.allowAmpTraffic); - switch (object.integrationType) { - default: - if (typeof object.integrationType === "number") { - message.integrationType = object.integrationType; - break; + if (message.androidSettings != null && message.hasOwnProperty("androidSettings")) { + if (properties.platformSettings === 1) + return "platformSettings: multiple values"; + properties.platformSettings = 1; + { + var error = $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.verify(message.androidSettings); + if (error) + return "androidSettings." + error; + } + } + if (message.iosSettings != null && message.hasOwnProperty("iosSettings")) { + if (properties.platformSettings === 1) + return "platformSettings: multiple values"; + properties.platformSettings = 1; + { + var error = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.verify(message.iosSettings); + if (error) + return "iosSettings." + error; + } + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.testingOptions != null && message.hasOwnProperty("testingOptions")) { + var error = $root.google.cloud.recaptchaenterprise.v1.TestingOptions.verify(message.testingOptions); + if (error) + return "testingOptions." + error; + } + if (message.wafSettings != null && message.hasOwnProperty("wafSettings")) { + var error = $root.google.cloud.recaptchaenterprise.v1.WafSettings.verify(message.wafSettings); + if (error) + return "wafSettings." + error; + } + return null; + }; + + /** + * Creates a Key message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.Key} Key + */ + Key.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.Key) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.Key(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.webSettings != null) { + if (typeof object.webSettings !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.webSettings: object expected"); + message.webSettings = $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.fromObject(object.webSettings); + } + if (object.androidSettings != null) { + if (typeof object.androidSettings !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.androidSettings: object expected"); + message.androidSettings = $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.fromObject(object.androidSettings); + } + if (object.iosSettings != null) { + if (typeof object.iosSettings !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.iosSettings: object expected"); + message.iosSettings = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.fromObject(object.iosSettings); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.testingOptions != null) { + if (typeof object.testingOptions !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.testingOptions: object expected"); + message.testingOptions = $root.google.cloud.recaptchaenterprise.v1.TestingOptions.fromObject(object.testingOptions); + } + if (object.wafSettings != null) { + if (typeof object.wafSettings !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.wafSettings: object expected"); + message.wafSettings = $root.google.cloud.recaptchaenterprise.v1.WafSettings.fromObject(object.wafSettings); + } + return message; + }; + + /** + * Creates a plain object from a Key message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @static + * @param {google.cloud.recaptchaenterprise.v1.Key} message Key + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Key.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.createTime = null; + object.testingOptions = null; + object.wafSettings = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.webSettings != null && message.hasOwnProperty("webSettings")) { + object.webSettings = $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.toObject(message.webSettings, options); + if (options.oneofs) + object.platformSettings = "webSettings"; + } + if (message.androidSettings != null && message.hasOwnProperty("androidSettings")) { + object.androidSettings = $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.toObject(message.androidSettings, options); + if (options.oneofs) + object.platformSettings = "androidSettings"; + } + if (message.iosSettings != null && message.hasOwnProperty("iosSettings")) { + object.iosSettings = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.toObject(message.iosSettings, options); + if (options.oneofs) + object.platformSettings = "iosSettings"; + } + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.testingOptions != null && message.hasOwnProperty("testingOptions")) + object.testingOptions = $root.google.cloud.recaptchaenterprise.v1.TestingOptions.toObject(message.testingOptions, options); + if (message.wafSettings != null && message.hasOwnProperty("wafSettings")) + object.wafSettings = $root.google.cloud.recaptchaenterprise.v1.WafSettings.toObject(message.wafSettings, options); + return object; + }; + + /** + * Converts this Key to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + * @returns {Object.} JSON object + */ + Key.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.Key"; + }; + + return Key; + })(); + + v1.TestingOptions = (function() { + + /** + * Properties of a TestingOptions. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface ITestingOptions + * @property {number|null} [testingScore] TestingOptions testingScore + * @property {google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge|null} [testingChallenge] TestingOptions testingChallenge + */ + + /** + * Constructs a new TestingOptions. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a TestingOptions. + * @implements ITestingOptions + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.ITestingOptions=} [properties] Properties to set + */ + function TestingOptions(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]]; + } + + /** + * TestingOptions testingScore. + * @member {number} testingScore + * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @instance + */ + TestingOptions.prototype.testingScore = 0; + + /** + * TestingOptions testingChallenge. + * @member {google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge} testingChallenge + * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @instance + */ + TestingOptions.prototype.testingChallenge = 0; + + /** + * Creates a new TestingOptions instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @static + * @param {google.cloud.recaptchaenterprise.v1.ITestingOptions=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.TestingOptions} TestingOptions instance + */ + TestingOptions.create = function create(properties) { + return new TestingOptions(properties); + }; + + /** + * Encodes the specified TestingOptions message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TestingOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @static + * @param {google.cloud.recaptchaenterprise.v1.ITestingOptions} message TestingOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestingOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.testingScore != null && Object.hasOwnProperty.call(message, "testingScore")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.testingScore); + if (message.testingChallenge != null && Object.hasOwnProperty.call(message, "testingChallenge")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.testingChallenge); + return writer; + }; + + /** + * Encodes the specified TestingOptions message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TestingOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @static + * @param {google.cloud.recaptchaenterprise.v1.ITestingOptions} message TestingOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestingOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestingOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @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.TestingOptions} TestingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestingOptions.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.TestingOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.testingScore = reader.float(); + break; + } + case 2: { + message.testingChallenge = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestingOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.TestingOptions} TestingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestingOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestingOptions message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestingOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.testingScore != null && message.hasOwnProperty("testingScore")) + if (typeof message.testingScore !== "number") + return "testingScore: number expected"; + if (message.testingChallenge != null && message.hasOwnProperty("testingChallenge")) + switch (message.testingChallenge) { + default: + return "testingChallenge: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TestingOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.TestingOptions} TestingOptions + */ + TestingOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.TestingOptions) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.TestingOptions(); + if (object.testingScore != null) + message.testingScore = Number(object.testingScore); + switch (object.testingChallenge) { + default: + if (typeof object.testingChallenge === "number") { + message.testingChallenge = object.testingChallenge; + break; + } + break; + case "TESTING_CHALLENGE_UNSPECIFIED": + case 0: + message.testingChallenge = 0; + break; + case "NOCAPTCHA": + case 1: + message.testingChallenge = 1; + break; + case "UNSOLVABLE_CHALLENGE": + case 2: + message.testingChallenge = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TestingOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @static + * @param {google.cloud.recaptchaenterprise.v1.TestingOptions} message TestingOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestingOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.testingScore = 0; + object.testingChallenge = options.enums === String ? "TESTING_CHALLENGE_UNSPECIFIED" : 0; + } + if (message.testingScore != null && message.hasOwnProperty("testingScore")) + object.testingScore = options.json && !isFinite(message.testingScore) ? String(message.testingScore) : message.testingScore; + if (message.testingChallenge != null && message.hasOwnProperty("testingChallenge")) + object.testingChallenge = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge[message.testingChallenge] === undefined ? message.testingChallenge : $root.google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge[message.testingChallenge] : message.testingChallenge; + return object; + }; + + /** + * Converts this TestingOptions to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @instance + * @returns {Object.} JSON object + */ + TestingOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestingOptions + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestingOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.TestingOptions"; + }; + + /** + * TestingChallenge enum. + * @name google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge + * @enum {number} + * @property {number} TESTING_CHALLENGE_UNSPECIFIED=0 TESTING_CHALLENGE_UNSPECIFIED value + * @property {number} NOCAPTCHA=1 NOCAPTCHA value + * @property {number} UNSOLVABLE_CHALLENGE=2 UNSOLVABLE_CHALLENGE value + */ + TestingOptions.TestingChallenge = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TESTING_CHALLENGE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NOCAPTCHA"] = 1; + values[valuesById[2] = "UNSOLVABLE_CHALLENGE"] = 2; + return values; + })(); + + return TestingOptions; + })(); + + v1.WebKeySettings = (function() { + + /** + * Properties of a WebKeySettings. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IWebKeySettings + * @property {boolean|null} [allowAllDomains] WebKeySettings allowAllDomains + * @property {Array.|null} [allowedDomains] WebKeySettings allowedDomains + * @property {boolean|null} [allowAmpTraffic] WebKeySettings allowAmpTraffic + * @property {google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType|null} [integrationType] WebKeySettings integrationType + * @property {google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference|null} [challengeSecurityPreference] WebKeySettings challengeSecurityPreference + */ + + /** + * Constructs a new WebKeySettings. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a WebKeySettings. + * @implements IWebKeySettings + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IWebKeySettings=} [properties] Properties to set + */ + function WebKeySettings(properties) { + this.allowedDomains = []; + 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]]; + } + + /** + * WebKeySettings allowAllDomains. + * @member {boolean} allowAllDomains + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @instance + */ + WebKeySettings.prototype.allowAllDomains = false; + + /** + * WebKeySettings allowedDomains. + * @member {Array.} allowedDomains + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @instance + */ + WebKeySettings.prototype.allowedDomains = $util.emptyArray; + + /** + * WebKeySettings allowAmpTraffic. + * @member {boolean} allowAmpTraffic + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @instance + */ + WebKeySettings.prototype.allowAmpTraffic = false; + + /** + * WebKeySettings integrationType. + * @member {google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType} integrationType + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @instance + */ + WebKeySettings.prototype.integrationType = 0; + + /** + * WebKeySettings challengeSecurityPreference. + * @member {google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference} challengeSecurityPreference + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @instance + */ + WebKeySettings.prototype.challengeSecurityPreference = 0; + + /** + * Creates a new WebKeySettings instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IWebKeySettings=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.WebKeySettings} WebKeySettings instance + */ + WebKeySettings.create = function create(properties) { + return new WebKeySettings(properties); + }; + + /** + * Encodes the specified WebKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.WebKeySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IWebKeySettings} message WebKeySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebKeySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedDomains != null && message.allowedDomains.length) + for (var i = 0; i < message.allowedDomains.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedDomains[i]); + if (message.allowAmpTraffic != null && Object.hasOwnProperty.call(message, "allowAmpTraffic")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAmpTraffic); + if (message.allowAllDomains != null && Object.hasOwnProperty.call(message, "allowAllDomains")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowAllDomains); + if (message.integrationType != null && Object.hasOwnProperty.call(message, "integrationType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.integrationType); + if (message.challengeSecurityPreference != null && Object.hasOwnProperty.call(message, "challengeSecurityPreference")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.challengeSecurityPreference); + return writer; + }; + + /** + * Encodes the specified WebKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.WebKeySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IWebKeySettings} message WebKeySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebKeySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebKeySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @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.WebKeySettings} WebKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebKeySettings.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.WebKeySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.allowAllDomains = reader.bool(); + break; + } + case 1: { + if (!(message.allowedDomains && message.allowedDomains.length)) + message.allowedDomains = []; + message.allowedDomains.push(reader.string()); + break; + } + case 2: { + message.allowAmpTraffic = reader.bool(); + break; + } + case 4: { + message.integrationType = reader.int32(); + break; + } + case 5: { + message.challengeSecurityPreference = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebKeySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.WebKeySettings} WebKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebKeySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebKeySettings message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebKeySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAllDomains != null && message.hasOwnProperty("allowAllDomains")) + if (typeof message.allowAllDomains !== "boolean") + return "allowAllDomains: boolean expected"; + if (message.allowedDomains != null && message.hasOwnProperty("allowedDomains")) { + if (!Array.isArray(message.allowedDomains)) + return "allowedDomains: array expected"; + for (var i = 0; i < message.allowedDomains.length; ++i) + if (!$util.isString(message.allowedDomains[i])) + return "allowedDomains: string[] expected"; + } + if (message.allowAmpTraffic != null && message.hasOwnProperty("allowAmpTraffic")) + if (typeof message.allowAmpTraffic !== "boolean") + return "allowAmpTraffic: boolean expected"; + if (message.integrationType != null && message.hasOwnProperty("integrationType")) + switch (message.integrationType) { + default: + return "integrationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.challengeSecurityPreference != null && message.hasOwnProperty("challengeSecurityPreference")) + switch (message.challengeSecurityPreference) { + default: + return "challengeSecurityPreference: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a WebKeySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.WebKeySettings} WebKeySettings + */ + WebKeySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.WebKeySettings) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.WebKeySettings(); + if (object.allowAllDomains != null) + message.allowAllDomains = Boolean(object.allowAllDomains); + if (object.allowedDomains) { + if (!Array.isArray(object.allowedDomains)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.WebKeySettings.allowedDomains: array expected"); + message.allowedDomains = []; + for (var i = 0; i < object.allowedDomains.length; ++i) + message.allowedDomains[i] = String(object.allowedDomains[i]); + } + if (object.allowAmpTraffic != null) + message.allowAmpTraffic = Boolean(object.allowAmpTraffic); + switch (object.integrationType) { + default: + if (typeof object.integrationType === "number") { + message.integrationType = object.integrationType; + break; } break; case "INTEGRATION_TYPE_UNSPECIFIED": @@ -11787,6 +14773,436 @@ return CreateAssessmentRequest; })(); + v1beta1.TransactionEvent = (function() { + + /** + * Properties of a TransactionEvent. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @interface ITransactionEvent + * @property {google.cloud.recaptchaenterprise.v1beta1.TransactionEvent.TransactionEventType|null} [eventType] TransactionEvent eventType + * @property {string|null} [reason] TransactionEvent reason + * @property {number|null} [value] TransactionEvent value + * @property {google.protobuf.ITimestamp|null} [eventTime] TransactionEvent eventTime + */ + + /** + * Constructs a new TransactionEvent. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @classdesc Represents a TransactionEvent. + * @implements ITransactionEvent + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.ITransactionEvent=} [properties] Properties to set + */ + function TransactionEvent(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]]; + } + + /** + * TransactionEvent eventType. + * @member {google.cloud.recaptchaenterprise.v1beta1.TransactionEvent.TransactionEventType} eventType + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionEvent + * @instance + */ + TransactionEvent.prototype.eventType = 0; + + /** + * TransactionEvent reason. + * @member {string} reason + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionEvent + * @instance + */ + TransactionEvent.prototype.reason = ""; + + /** + * TransactionEvent value. + * @member {number} value + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionEvent + * @instance + */ + TransactionEvent.prototype.value = 0; + + /** + * TransactionEvent eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionEvent + * @instance + */ + TransactionEvent.prototype.eventTime = null; + + /** + * Creates a new TransactionEvent instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionEvent + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.ITransactionEvent=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.TransactionEvent} TransactionEvent instance + */ + TransactionEvent.create = function create(properties) { + return new TransactionEvent(properties); + }; + + /** + * Encodes the specified TransactionEvent message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TransactionEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionEvent + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.ITransactionEvent} message TransactionEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eventType != null && Object.hasOwnProperty.call(message, "eventType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.eventType); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.reason); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.value); + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransactionEvent message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TransactionEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionEvent + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.ITransactionEvent} message TransactionEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransactionEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.TransactionEvent} TransactionEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionEvent.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.v1beta1.TransactionEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.eventType = reader.int32(); + break; + } + case 2: { + message.reason = reader.string(); + break; + } + case 3: { + message.value = reader.double(); + break; + } + case 4: { + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransactionEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.TransactionEvent} TransactionEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransactionEvent message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransactionEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.eventType != null && message.hasOwnProperty("eventType")) + switch (message.eventType) { + default: + return "eventType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.reason != null && message.hasOwnProperty("reason")) + if (!$util.isString(message.reason)) + return "reason: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + return null; + }; + + /** + * Creates a TransactionEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.TransactionEvent} TransactionEvent + */ + TransactionEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.TransactionEvent) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.TransactionEvent(); + switch (object.eventType) { + default: + if (typeof object.eventType === "number") { + message.eventType = object.eventType; + break; + } + break; + case "TRANSACTION_EVENT_TYPE_UNSPECIFIED": + case 0: + message.eventType = 0; + break; + case "MERCHANT_APPROVE": + case 1: + message.eventType = 1; + break; + case "MERCHANT_DENY": + case 2: + message.eventType = 2; + break; + case "MANUAL_REVIEW": + case 3: + message.eventType = 3; + break; + case "AUTHORIZATION": + case 4: + message.eventType = 4; + break; + case "AUTHORIZATION_DECLINE": + case 5: + message.eventType = 5; + break; + case "PAYMENT_CAPTURE": + case 6: + message.eventType = 6; + break; + case "PAYMENT_CAPTURE_DECLINE": + case 7: + message.eventType = 7; + break; + case "CANCEL": + case 8: + message.eventType = 8; + break; + case "CHARGEBACK_INQUIRY": + case 9: + message.eventType = 9; + break; + case "CHARGEBACK_ALERT": + case 10: + message.eventType = 10; + break; + case "FRAUD_NOTIFICATION": + case 11: + message.eventType = 11; + break; + case "CHARGEBACK": + case 12: + message.eventType = 12; + break; + case "CHARGEBACK_REPRESENTMENT": + case 13: + message.eventType = 13; + break; + case "CHARGEBACK_REVERSE": + case 14: + message.eventType = 14; + break; + case "REFUND_REQUEST": + case 15: + message.eventType = 15; + break; + case "REFUND_DECLINE": + case 16: + message.eventType = 16; + break; + case "REFUND": + case 17: + message.eventType = 17; + break; + case "REFUND_REVERSE": + case 18: + message.eventType = 18; + break; + } + if (object.reason != null) + message.reason = String(object.reason); + if (object.value != null) + message.value = Number(object.value); + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.TransactionEvent.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + return message; + }; + + /** + * Creates a plain object from a TransactionEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionEvent + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.TransactionEvent} message TransactionEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransactionEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.eventType = options.enums === String ? "TRANSACTION_EVENT_TYPE_UNSPECIFIED" : 0; + object.reason = ""; + object.value = 0; + object.eventTime = null; + } + if (message.eventType != null && message.hasOwnProperty("eventType")) + object.eventType = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1beta1.TransactionEvent.TransactionEventType[message.eventType] === undefined ? message.eventType : $root.google.cloud.recaptchaenterprise.v1beta1.TransactionEvent.TransactionEventType[message.eventType] : message.eventType; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = message.reason; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + return object; + }; + + /** + * Converts this TransactionEvent to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionEvent + * @instance + * @returns {Object.} JSON object + */ + TransactionEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransactionEvent + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.TransactionEvent"; + }; + + /** + * TransactionEventType enum. + * @name google.cloud.recaptchaenterprise.v1beta1.TransactionEvent.TransactionEventType + * @enum {number} + * @property {number} TRANSACTION_EVENT_TYPE_UNSPECIFIED=0 TRANSACTION_EVENT_TYPE_UNSPECIFIED value + * @property {number} MERCHANT_APPROVE=1 MERCHANT_APPROVE value + * @property {number} MERCHANT_DENY=2 MERCHANT_DENY value + * @property {number} MANUAL_REVIEW=3 MANUAL_REVIEW value + * @property {number} AUTHORIZATION=4 AUTHORIZATION value + * @property {number} AUTHORIZATION_DECLINE=5 AUTHORIZATION_DECLINE value + * @property {number} PAYMENT_CAPTURE=6 PAYMENT_CAPTURE value + * @property {number} PAYMENT_CAPTURE_DECLINE=7 PAYMENT_CAPTURE_DECLINE value + * @property {number} CANCEL=8 CANCEL value + * @property {number} CHARGEBACK_INQUIRY=9 CHARGEBACK_INQUIRY value + * @property {number} CHARGEBACK_ALERT=10 CHARGEBACK_ALERT value + * @property {number} FRAUD_NOTIFICATION=11 FRAUD_NOTIFICATION value + * @property {number} CHARGEBACK=12 CHARGEBACK value + * @property {number} CHARGEBACK_REPRESENTMENT=13 CHARGEBACK_REPRESENTMENT value + * @property {number} CHARGEBACK_REVERSE=14 CHARGEBACK_REVERSE value + * @property {number} REFUND_REQUEST=15 REFUND_REQUEST value + * @property {number} REFUND_DECLINE=16 REFUND_DECLINE value + * @property {number} REFUND=17 REFUND value + * @property {number} REFUND_REVERSE=18 REFUND_REVERSE value + */ + TransactionEvent.TransactionEventType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRANSACTION_EVENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MERCHANT_APPROVE"] = 1; + values[valuesById[2] = "MERCHANT_DENY"] = 2; + values[valuesById[3] = "MANUAL_REVIEW"] = 3; + values[valuesById[4] = "AUTHORIZATION"] = 4; + values[valuesById[5] = "AUTHORIZATION_DECLINE"] = 5; + values[valuesById[6] = "PAYMENT_CAPTURE"] = 6; + values[valuesById[7] = "PAYMENT_CAPTURE_DECLINE"] = 7; + values[valuesById[8] = "CANCEL"] = 8; + values[valuesById[9] = "CHARGEBACK_INQUIRY"] = 9; + values[valuesById[10] = "CHARGEBACK_ALERT"] = 10; + values[valuesById[11] = "FRAUD_NOTIFICATION"] = 11; + values[valuesById[12] = "CHARGEBACK"] = 12; + values[valuesById[13] = "CHARGEBACK_REPRESENTMENT"] = 13; + values[valuesById[14] = "CHARGEBACK_REVERSE"] = 14; + values[valuesById[15] = "REFUND_REQUEST"] = 15; + values[valuesById[16] = "REFUND_DECLINE"] = 16; + values[valuesById[17] = "REFUND"] = 17; + values[valuesById[18] = "REFUND_REVERSE"] = 18; + return values; + })(); + + return TransactionEvent; + })(); + v1beta1.AnnotateAssessmentRequest = (function() { /** @@ -11797,6 +15213,7 @@ * @property {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation|null} [annotation] AnnotateAssessmentRequest annotation * @property {Array.|null} [reasons] AnnotateAssessmentRequest reasons * @property {Uint8Array|null} [hashedAccountId] AnnotateAssessmentRequest hashedAccountId + * @property {google.cloud.recaptchaenterprise.v1beta1.ITransactionEvent|null} [transactionEvent] AnnotateAssessmentRequest transactionEvent */ /** @@ -11840,12 +15257,20 @@ AnnotateAssessmentRequest.prototype.reasons = $util.emptyArray; /** - * AnnotateAssessmentRequest hashedAccountId. - * @member {Uint8Array} hashedAccountId + * AnnotateAssessmentRequest hashedAccountId. + * @member {Uint8Array} hashedAccountId + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest + * @instance + */ + AnnotateAssessmentRequest.prototype.hashedAccountId = $util.newBuffer([]); + + /** + * AnnotateAssessmentRequest transactionEvent. + * @member {google.cloud.recaptchaenterprise.v1beta1.ITransactionEvent|null|undefined} transactionEvent * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest * @instance */ - AnnotateAssessmentRequest.prototype.hashedAccountId = $util.newBuffer([]); + AnnotateAssessmentRequest.prototype.transactionEvent = null; /** * Creates a new AnnotateAssessmentRequest instance using the specified properties. @@ -11883,6 +15308,8 @@ } if (message.hashedAccountId != null && Object.hasOwnProperty.call(message, "hashedAccountId")) writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.hashedAccountId); + if (message.transactionEvent != null && Object.hasOwnProperty.call(message, "transactionEvent")) + $root.google.cloud.recaptchaenterprise.v1beta1.TransactionEvent.encode(message.transactionEvent, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -11940,6 +15367,10 @@ message.hashedAccountId = reader.bytes(); break; } + case 5: { + message.transactionEvent = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionEvent.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -12000,18 +15431,28 @@ case 1: case 8: case 9: + case 10: + case 11: + case 12: + case 13: case 2: case 7: case 3: case 4: case 5: case 6: + case 14: break; } } if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) if (!(message.hashedAccountId && typeof message.hashedAccountId.length === "number" || $util.isString(message.hashedAccountId))) return "hashedAccountId: buffer expected"; + if (message.transactionEvent != null && message.hasOwnProperty("transactionEvent")) { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionEvent.verify(message.transactionEvent); + if (error) + return "transactionEvent." + error; + } return null; }; @@ -12084,6 +15525,22 @@ case 9: message.reasons[i] = 9; break; + case "REFUND": + case 10: + message.reasons[i] = 10; + break; + case "REFUND_FRAUD": + case 11: + message.reasons[i] = 11; + break; + case "TRANSACTION_ACCEPTED": + case 12: + message.reasons[i] = 12; + break; + case "TRANSACTION_DECLINED": + case 13: + message.reasons[i] = 13; + break; case "PAYMENT_HEURISTICS": case 2: message.reasons[i] = 2; @@ -12108,6 +15565,10 @@ case 6: message.reasons[i] = 6; break; + case "SOCIAL_SPAM": + case 14: + message.reasons[i] = 14; + break; } } if (object.hashedAccountId != null) @@ -12115,6 +15576,11 @@ $util.base64.decode(object.hashedAccountId, message.hashedAccountId = $util.newBuffer($util.base64.length(object.hashedAccountId)), 0); else if (object.hashedAccountId.length >= 0) message.hashedAccountId = object.hashedAccountId; + if (object.transactionEvent != null) { + if (typeof object.transactionEvent !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.transactionEvent: object expected"); + message.transactionEvent = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionEvent.fromObject(object.transactionEvent); + } return message; }; @@ -12143,6 +15609,7 @@ if (options.bytes !== Array) object.hashedAccountId = $util.newBuffer(object.hashedAccountId); } + object.transactionEvent = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -12155,6 +15622,8 @@ } if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) object.hashedAccountId = options.bytes === String ? $util.base64.encode(message.hashedAccountId, 0, message.hashedAccountId.length) : options.bytes === Array ? Array.prototype.slice.call(message.hashedAccountId) : message.hashedAccountId; + if (message.transactionEvent != null && message.hasOwnProperty("transactionEvent")) + object.transactionEvent = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionEvent.toObject(message.transactionEvent, options); return object; }; @@ -12212,12 +15681,17 @@ * @property {number} CHARGEBACK=1 CHARGEBACK value * @property {number} CHARGEBACK_FRAUD=8 CHARGEBACK_FRAUD value * @property {number} CHARGEBACK_DISPUTE=9 CHARGEBACK_DISPUTE value + * @property {number} REFUND=10 REFUND value + * @property {number} REFUND_FRAUD=11 REFUND_FRAUD value + * @property {number} TRANSACTION_ACCEPTED=12 TRANSACTION_ACCEPTED value + * @property {number} TRANSACTION_DECLINED=13 TRANSACTION_DECLINED value * @property {number} PAYMENT_HEURISTICS=2 PAYMENT_HEURISTICS value * @property {number} INITIATED_TWO_FACTOR=7 INITIATED_TWO_FACTOR value * @property {number} PASSED_TWO_FACTOR=3 PASSED_TWO_FACTOR value * @property {number} FAILED_TWO_FACTOR=4 FAILED_TWO_FACTOR value * @property {number} CORRECT_PASSWORD=5 CORRECT_PASSWORD value * @property {number} INCORRECT_PASSWORD=6 INCORRECT_PASSWORD value + * @property {number} SOCIAL_SPAM=14 SOCIAL_SPAM value */ AnnotateAssessmentRequest.Reason = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -12225,12 +15699,17 @@ values[valuesById[1] = "CHARGEBACK"] = 1; values[valuesById[8] = "CHARGEBACK_FRAUD"] = 8; values[valuesById[9] = "CHARGEBACK_DISPUTE"] = 9; + values[valuesById[10] = "REFUND"] = 10; + values[valuesById[11] = "REFUND_FRAUD"] = 11; + values[valuesById[12] = "TRANSACTION_ACCEPTED"] = 12; + values[valuesById[13] = "TRANSACTION_DECLINED"] = 13; values[valuesById[2] = "PAYMENT_HEURISTICS"] = 2; values[valuesById[7] = "INITIATED_TWO_FACTOR"] = 7; values[valuesById[3] = "PASSED_TWO_FACTOR"] = 3; values[valuesById[4] = "FAILED_TWO_FACTOR"] = 4; values[valuesById[5] = "CORRECT_PASSWORD"] = 5; values[valuesById[6] = "INCORRECT_PASSWORD"] = 6; + values[valuesById[14] = "SOCIAL_SPAM"] = 14; return values; })(); @@ -12327,111 +15806,376 @@ }; /** - * Decodes an AnnotateAssessmentResponse message from the specified reader or buffer, length delimited. + * Decodes an AnnotateAssessmentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse} AnnotateAssessmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateAssessmentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateAssessmentResponse message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateAssessmentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AnnotateAssessmentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse} AnnotateAssessmentResponse + */ + AnnotateAssessmentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse) + return object; + return new $root.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse(); + }; + + /** + * Creates a plain object from an AnnotateAssessmentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse} message AnnotateAssessmentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateAssessmentResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AnnotateAssessmentResponse to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + * @instance + * @returns {Object.} JSON object + */ + AnnotateAssessmentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotateAssessmentResponse + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotateAssessmentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse"; + }; + + return AnnotateAssessmentResponse; + })(); + + v1beta1.PasswordLeakVerification = (function() { + + /** + * Properties of a PasswordLeakVerification. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @interface IPasswordLeakVerification + * @property {Uint8Array|null} [hashedUserCredentials] PasswordLeakVerification hashedUserCredentials + * @property {boolean|null} [credentialsLeaked] PasswordLeakVerification credentialsLeaked + * @property {string|null} [canonicalizedUsername] PasswordLeakVerification canonicalizedUsername + */ + + /** + * Constructs a new PasswordLeakVerification. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @classdesc Represents a PasswordLeakVerification. + * @implements IPasswordLeakVerification + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.IPasswordLeakVerification=} [properties] Properties to set + */ + function PasswordLeakVerification(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]]; + } + + /** + * PasswordLeakVerification hashedUserCredentials. + * @member {Uint8Array} hashedUserCredentials + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @instance + */ + PasswordLeakVerification.prototype.hashedUserCredentials = $util.newBuffer([]); + + /** + * PasswordLeakVerification credentialsLeaked. + * @member {boolean} credentialsLeaked + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @instance + */ + PasswordLeakVerification.prototype.credentialsLeaked = false; + + /** + * PasswordLeakVerification canonicalizedUsername. + * @member {string} canonicalizedUsername + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @instance + */ + PasswordLeakVerification.prototype.canonicalizedUsername = ""; + + /** + * Creates a new PasswordLeakVerification instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IPasswordLeakVerification=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification} PasswordLeakVerification instance + */ + PasswordLeakVerification.create = function create(properties) { + return new PasswordLeakVerification(properties); + }; + + /** + * Encodes the specified PasswordLeakVerification message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IPasswordLeakVerification} message PasswordLeakVerification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PasswordLeakVerification.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hashedUserCredentials != null && Object.hasOwnProperty.call(message, "hashedUserCredentials")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.hashedUserCredentials); + if (message.credentialsLeaked != null && Object.hasOwnProperty.call(message, "credentialsLeaked")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.credentialsLeaked); + if (message.canonicalizedUsername != null && Object.hasOwnProperty.call(message, "canonicalizedUsername")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.canonicalizedUsername); + return writer; + }; + + /** + * Encodes the specified PasswordLeakVerification message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IPasswordLeakVerification} message PasswordLeakVerification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PasswordLeakVerification.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PasswordLeakVerification message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification} PasswordLeakVerification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PasswordLeakVerification.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.v1beta1.PasswordLeakVerification(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.hashedUserCredentials = reader.bytes(); + break; + } + case 2: { + message.credentialsLeaked = reader.bool(); + break; + } + case 3: { + message.canonicalizedUsername = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PasswordLeakVerification message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse} AnnotateAssessmentResponse + * @returns {google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification} PasswordLeakVerification * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnnotateAssessmentResponse.decodeDelimited = function decodeDelimited(reader) { + PasswordLeakVerification.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AnnotateAssessmentResponse message. + * Verifies a PasswordLeakVerification message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AnnotateAssessmentResponse.verify = function verify(message) { + PasswordLeakVerification.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.hashedUserCredentials != null && message.hasOwnProperty("hashedUserCredentials")) + if (!(message.hashedUserCredentials && typeof message.hashedUserCredentials.length === "number" || $util.isString(message.hashedUserCredentials))) + return "hashedUserCredentials: buffer expected"; + if (message.credentialsLeaked != null && message.hasOwnProperty("credentialsLeaked")) + if (typeof message.credentialsLeaked !== "boolean") + return "credentialsLeaked: boolean expected"; + if (message.canonicalizedUsername != null && message.hasOwnProperty("canonicalizedUsername")) + if (!$util.isString(message.canonicalizedUsername)) + return "canonicalizedUsername: string expected"; return null; }; /** - * Creates an AnnotateAssessmentResponse message from a plain object. Also converts values to their respective internal types. + * Creates a PasswordLeakVerification message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse} AnnotateAssessmentResponse + * @returns {google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification} PasswordLeakVerification */ - AnnotateAssessmentResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse) + PasswordLeakVerification.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification) return object; - return new $root.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse(); + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification(); + if (object.hashedUserCredentials != null) + if (typeof object.hashedUserCredentials === "string") + $util.base64.decode(object.hashedUserCredentials, message.hashedUserCredentials = $util.newBuffer($util.base64.length(object.hashedUserCredentials)), 0); + else if (object.hashedUserCredentials.length >= 0) + message.hashedUserCredentials = object.hashedUserCredentials; + if (object.credentialsLeaked != null) + message.credentialsLeaked = Boolean(object.credentialsLeaked); + if (object.canonicalizedUsername != null) + message.canonicalizedUsername = String(object.canonicalizedUsername); + return message; }; /** - * Creates a plain object from an AnnotateAssessmentResponse message. Also converts values to other types if specified. + * Creates a plain object from a PasswordLeakVerification message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse} message AnnotateAssessmentResponse + * @param {google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification} message PasswordLeakVerification * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AnnotateAssessmentResponse.toObject = function toObject() { - return {}; + PasswordLeakVerification.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.hashedUserCredentials = ""; + else { + object.hashedUserCredentials = []; + if (options.bytes !== Array) + object.hashedUserCredentials = $util.newBuffer(object.hashedUserCredentials); + } + object.credentialsLeaked = false; + object.canonicalizedUsername = ""; + } + if (message.hashedUserCredentials != null && message.hasOwnProperty("hashedUserCredentials")) + object.hashedUserCredentials = options.bytes === String ? $util.base64.encode(message.hashedUserCredentials, 0, message.hashedUserCredentials.length) : options.bytes === Array ? Array.prototype.slice.call(message.hashedUserCredentials) : message.hashedUserCredentials; + if (message.credentialsLeaked != null && message.hasOwnProperty("credentialsLeaked")) + object.credentialsLeaked = message.credentialsLeaked; + if (message.canonicalizedUsername != null && message.hasOwnProperty("canonicalizedUsername")) + object.canonicalizedUsername = message.canonicalizedUsername; + return object; }; /** - * Converts this AnnotateAssessmentResponse to JSON. + * Converts this PasswordLeakVerification to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification * @instance * @returns {Object.} JSON object */ - AnnotateAssessmentResponse.prototype.toJSON = function toJSON() { + PasswordLeakVerification.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AnnotateAssessmentResponse + * Gets the default type url for PasswordLeakVerification * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AnnotateAssessmentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PasswordLeakVerification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification"; }; - return AnnotateAssessmentResponse; + return PasswordLeakVerification; })(); - v1beta1.PasswordLeakVerification = (function() { + v1beta1.Assessment = (function() { /** - * Properties of a PasswordLeakVerification. + * Properties of an Assessment. * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @interface IPasswordLeakVerification - * @property {Uint8Array|null} [hashedUserCredentials] PasswordLeakVerification hashedUserCredentials - * @property {boolean|null} [credentialsLeaked] PasswordLeakVerification credentialsLeaked - * @property {string|null} [canonicalizedUsername] PasswordLeakVerification canonicalizedUsername + * @interface IAssessment + * @property {string|null} [name] Assessment name + * @property {google.cloud.recaptchaenterprise.v1beta1.IEvent|null} [event] Assessment event + * @property {number|null} [score] Assessment score + * @property {google.cloud.recaptchaenterprise.v1beta1.ITokenProperties|null} [tokenProperties] Assessment tokenProperties + * @property {Array.|null} [reasons] Assessment reasons + * @property {google.cloud.recaptchaenterprise.v1beta1.IPasswordLeakVerification|null} [passwordLeakVerification] Assessment passwordLeakVerification + * @property {google.cloud.recaptchaenterprise.v1beta1.IAccountDefenderAssessment|null} [accountDefenderAssessment] Assessment accountDefenderAssessment + * @property {google.cloud.recaptchaenterprise.v1beta1.IFraudPreventionAssessment|null} [fraudPreventionAssessment] Assessment fraudPreventionAssessment */ /** - * Constructs a new PasswordLeakVerification. + * Constructs a new Assessment. * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @classdesc Represents a PasswordLeakVerification. - * @implements IPasswordLeakVerification + * @classdesc Represents an Assessment. + * @implements IAssessment * @constructor - * @param {google.cloud.recaptchaenterprise.v1beta1.IPasswordLeakVerification=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1beta1.IAssessment=} [properties] Properties to set */ - function PasswordLeakVerification(properties) { + function Assessment(properties) { + this.reasons = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12439,103 +16183,184 @@ } /** - * PasswordLeakVerification hashedUserCredentials. - * @member {Uint8Array} hashedUserCredentials - * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * Assessment name. + * @member {string} name + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment * @instance */ - PasswordLeakVerification.prototype.hashedUserCredentials = $util.newBuffer([]); + Assessment.prototype.name = ""; /** - * PasswordLeakVerification credentialsLeaked. - * @member {boolean} credentialsLeaked - * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * Assessment event. + * @member {google.cloud.recaptchaenterprise.v1beta1.IEvent|null|undefined} event + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment * @instance */ - PasswordLeakVerification.prototype.credentialsLeaked = false; + Assessment.prototype.event = null; /** - * PasswordLeakVerification canonicalizedUsername. - * @member {string} canonicalizedUsername - * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * Assessment score. + * @member {number} score + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment * @instance */ - PasswordLeakVerification.prototype.canonicalizedUsername = ""; + Assessment.prototype.score = 0; /** - * Creates a new PasswordLeakVerification instance using the specified properties. + * Assessment tokenProperties. + * @member {google.cloud.recaptchaenterprise.v1beta1.ITokenProperties|null|undefined} tokenProperties + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @instance + */ + Assessment.prototype.tokenProperties = null; + + /** + * Assessment reasons. + * @member {Array.} reasons + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @instance + */ + Assessment.prototype.reasons = $util.emptyArray; + + /** + * Assessment passwordLeakVerification. + * @member {google.cloud.recaptchaenterprise.v1beta1.IPasswordLeakVerification|null|undefined} passwordLeakVerification + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @instance + */ + Assessment.prototype.passwordLeakVerification = null; + + /** + * Assessment accountDefenderAssessment. + * @member {google.cloud.recaptchaenterprise.v1beta1.IAccountDefenderAssessment|null|undefined} accountDefenderAssessment + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @instance + */ + Assessment.prototype.accountDefenderAssessment = null; + + /** + * Assessment fraudPreventionAssessment. + * @member {google.cloud.recaptchaenterprise.v1beta1.IFraudPreventionAssessment|null|undefined} fraudPreventionAssessment + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @instance + */ + Assessment.prototype.fraudPreventionAssessment = null; + + /** + * Creates a new Assessment instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IPasswordLeakVerification=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification} PasswordLeakVerification instance + * @param {google.cloud.recaptchaenterprise.v1beta1.IAssessment=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.Assessment} Assessment instance */ - PasswordLeakVerification.create = function create(properties) { - return new PasswordLeakVerification(properties); + Assessment.create = function create(properties) { + return new Assessment(properties); }; /** - * Encodes the specified PasswordLeakVerification message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.verify|verify} messages. + * Encodes the specified Assessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Assessment.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IPasswordLeakVerification} message PasswordLeakVerification message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1beta1.IAssessment} message Assessment message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PasswordLeakVerification.encode = function encode(message, writer) { + Assessment.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.hashedUserCredentials != null && Object.hasOwnProperty.call(message, "hashedUserCredentials")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.hashedUserCredentials); - if (message.credentialsLeaked != null && Object.hasOwnProperty.call(message, "credentialsLeaked")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.credentialsLeaked); - if (message.canonicalizedUsername != null && Object.hasOwnProperty.call(message, "canonicalizedUsername")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.canonicalizedUsername); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + $root.google.cloud.recaptchaenterprise.v1beta1.Event.encode(message.event, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.score); + if (message.tokenProperties != null && Object.hasOwnProperty.call(message, "tokenProperties")) + $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.encode(message.tokenProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reasons != null && message.reasons.length) { + writer.uint32(/* id 5, wireType 2 =*/42).fork(); + for (var i = 0; i < message.reasons.length; ++i) + writer.int32(message.reasons[i]); + writer.ldelim(); + } + if (message.passwordLeakVerification != null && Object.hasOwnProperty.call(message, "passwordLeakVerification")) + $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.encode(message.passwordLeakVerification, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.accountDefenderAssessment != null && Object.hasOwnProperty.call(message, "accountDefenderAssessment")) + $root.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.encode(message.accountDefenderAssessment, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.fraudPreventionAssessment != null && Object.hasOwnProperty.call(message, "fraudPreventionAssessment")) + $root.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.encode(message.fraudPreventionAssessment, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; }; /** - * Encodes the specified PasswordLeakVerification message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.verify|verify} messages. + * Encodes the specified Assessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Assessment.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IPasswordLeakVerification} message PasswordLeakVerification message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1beta1.IAssessment} message Assessment message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PasswordLeakVerification.encodeDelimited = function encodeDelimited(message, writer) { + Assessment.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PasswordLeakVerification message from the specified reader or buffer. + * Decodes an Assessment message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification} PasswordLeakVerification + * @returns {google.cloud.recaptchaenterprise.v1beta1.Assessment} Assessment * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PasswordLeakVerification.decode = function decode(reader, length) { + Assessment.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.v1beta1.PasswordLeakVerification(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.Assessment(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.hashedUserCredentials = reader.bytes(); + message.name = reader.string(); + break; + } + case 2: { + message.event = $root.google.cloud.recaptchaenterprise.v1beta1.Event.decode(reader, reader.uint32()); + break; + } + case 3: { + message.score = reader.float(); break; } - case 2: { - message.credentialsLeaked = reader.bool(); + case 4: { + message.tokenProperties = $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.decode(reader, reader.uint32()); break; } - case 3: { - message.canonicalizedUsername = reader.string(); + case 5: { + if (!(message.reasons && message.reasons.length)) + message.reasons = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.reasons.push(reader.int32()); + } else + message.reasons.push(reader.int32()); + break; + } + case 7: { + message.passwordLeakVerification = $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.decode(reader, reader.uint32()); + break; + } + case 8: { + message.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.decode(reader, reader.uint32()); + break; + } + case 11: { + message.fraudPreventionAssessment = $root.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.decode(reader, reader.uint32()); break; } default: @@ -12547,155 +16372,298 @@ }; /** - * Decodes a PasswordLeakVerification message from the specified reader or buffer, length delimited. + * Decodes an Assessment message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification} PasswordLeakVerification + * @returns {google.cloud.recaptchaenterprise.v1beta1.Assessment} Assessment * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PasswordLeakVerification.decodeDelimited = function decodeDelimited(reader) { + Assessment.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PasswordLeakVerification message. + * Verifies an Assessment message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PasswordLeakVerification.verify = function verify(message) { + Assessment.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.hashedUserCredentials != null && message.hasOwnProperty("hashedUserCredentials")) - if (!(message.hashedUserCredentials && typeof message.hashedUserCredentials.length === "number" || $util.isString(message.hashedUserCredentials))) - return "hashedUserCredentials: buffer expected"; - if (message.credentialsLeaked != null && message.hasOwnProperty("credentialsLeaked")) - if (typeof message.credentialsLeaked !== "boolean") - return "credentialsLeaked: boolean expected"; - if (message.canonicalizedUsername != null && message.hasOwnProperty("canonicalizedUsername")) - if (!$util.isString(message.canonicalizedUsername)) - return "canonicalizedUsername: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.event != null && message.hasOwnProperty("event")) { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.Event.verify(message.event); + if (error) + return "event." + error; + } + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.tokenProperties != null && message.hasOwnProperty("tokenProperties")) { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.verify(message.tokenProperties); + if (error) + return "tokenProperties." + error; + } + if (message.reasons != null && message.hasOwnProperty("reasons")) { + if (!Array.isArray(message.reasons)) + return "reasons: array expected"; + for (var i = 0; i < message.reasons.length; ++i) + switch (message.reasons[i]) { + default: + return "reasons: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message.passwordLeakVerification != null && message.hasOwnProperty("passwordLeakVerification")) { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.verify(message.passwordLeakVerification); + if (error) + return "passwordLeakVerification." + error; + } + if (message.accountDefenderAssessment != null && message.hasOwnProperty("accountDefenderAssessment")) { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.verify(message.accountDefenderAssessment); + if (error) + return "accountDefenderAssessment." + error; + } + if (message.fraudPreventionAssessment != null && message.hasOwnProperty("fraudPreventionAssessment")) { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.verify(message.fraudPreventionAssessment); + if (error) + return "fraudPreventionAssessment." + error; + } return null; }; /** - * Creates a PasswordLeakVerification message from a plain object. Also converts values to their respective internal types. + * Creates an Assessment message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification} PasswordLeakVerification + * @returns {google.cloud.recaptchaenterprise.v1beta1.Assessment} Assessment */ - PasswordLeakVerification.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification) + Assessment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.Assessment) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification(); - if (object.hashedUserCredentials != null) - if (typeof object.hashedUserCredentials === "string") - $util.base64.decode(object.hashedUserCredentials, message.hashedUserCredentials = $util.newBuffer($util.base64.length(object.hashedUserCredentials)), 0); - else if (object.hashedUserCredentials.length >= 0) - message.hashedUserCredentials = object.hashedUserCredentials; - if (object.credentialsLeaked != null) - message.credentialsLeaked = Boolean(object.credentialsLeaked); - if (object.canonicalizedUsername != null) - message.canonicalizedUsername = String(object.canonicalizedUsername); + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.Assessment(); + if (object.name != null) + message.name = String(object.name); + if (object.event != null) { + if (typeof object.event !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.Assessment.event: object expected"); + message.event = $root.google.cloud.recaptchaenterprise.v1beta1.Event.fromObject(object.event); + } + if (object.score != null) + message.score = Number(object.score); + if (object.tokenProperties != null) { + if (typeof object.tokenProperties !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.Assessment.tokenProperties: object expected"); + message.tokenProperties = $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.fromObject(object.tokenProperties); + } + if (object.reasons) { + if (!Array.isArray(object.reasons)) + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.Assessment.reasons: array expected"); + message.reasons = []; + for (var i = 0; i < object.reasons.length; ++i) + switch (object.reasons[i]) { + default: + if (typeof object.reasons[i] === "number") { + message.reasons[i] = object.reasons[i]; + break; + } + case "CLASSIFICATION_REASON_UNSPECIFIED": + case 0: + message.reasons[i] = 0; + break; + case "AUTOMATION": + case 1: + message.reasons[i] = 1; + break; + case "UNEXPECTED_ENVIRONMENT": + case 2: + message.reasons[i] = 2; + break; + case "TOO_MUCH_TRAFFIC": + case 3: + message.reasons[i] = 3; + break; + case "UNEXPECTED_USAGE_PATTERNS": + case 4: + message.reasons[i] = 4; + break; + case "LOW_CONFIDENCE_SCORE": + case 5: + message.reasons[i] = 5; + break; + case "SUSPECTED_CARDING": + case 6: + message.reasons[i] = 6; + break; + case "SUSPECTED_CHARGEBACK": + case 7: + message.reasons[i] = 7; + break; + } + } + if (object.passwordLeakVerification != null) { + if (typeof object.passwordLeakVerification !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.Assessment.passwordLeakVerification: object expected"); + message.passwordLeakVerification = $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.fromObject(object.passwordLeakVerification); + } + if (object.accountDefenderAssessment != null) { + if (typeof object.accountDefenderAssessment !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.Assessment.accountDefenderAssessment: object expected"); + message.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.fromObject(object.accountDefenderAssessment); + } + if (object.fraudPreventionAssessment != null) { + if (typeof object.fraudPreventionAssessment !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.Assessment.fraudPreventionAssessment: object expected"); + message.fraudPreventionAssessment = $root.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.fromObject(object.fraudPreventionAssessment); + } return message; }; /** - * Creates a plain object from a PasswordLeakVerification message. Also converts values to other types if specified. + * Creates a plain object from an Assessment message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification} message PasswordLeakVerification + * @param {google.cloud.recaptchaenterprise.v1beta1.Assessment} message Assessment * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PasswordLeakVerification.toObject = function toObject(message, options) { + Assessment.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.reasons = []; if (options.defaults) { - if (options.bytes === String) - object.hashedUserCredentials = ""; - else { - object.hashedUserCredentials = []; - if (options.bytes !== Array) - object.hashedUserCredentials = $util.newBuffer(object.hashedUserCredentials); - } - object.credentialsLeaked = false; - object.canonicalizedUsername = ""; + object.name = ""; + object.event = null; + object.score = 0; + object.tokenProperties = null; + object.passwordLeakVerification = null; + object.accountDefenderAssessment = null; + object.fraudPreventionAssessment = null; } - if (message.hashedUserCredentials != null && message.hasOwnProperty("hashedUserCredentials")) - object.hashedUserCredentials = options.bytes === String ? $util.base64.encode(message.hashedUserCredentials, 0, message.hashedUserCredentials.length) : options.bytes === Array ? Array.prototype.slice.call(message.hashedUserCredentials) : message.hashedUserCredentials; - if (message.credentialsLeaked != null && message.hasOwnProperty("credentialsLeaked")) - object.credentialsLeaked = message.credentialsLeaked; - if (message.canonicalizedUsername != null && message.hasOwnProperty("canonicalizedUsername")) - object.canonicalizedUsername = message.canonicalizedUsername; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.event != null && message.hasOwnProperty("event")) + object.event = $root.google.cloud.recaptchaenterprise.v1beta1.Event.toObject(message.event, options); + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.tokenProperties != null && message.hasOwnProperty("tokenProperties")) + object.tokenProperties = $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.toObject(message.tokenProperties, options); + if (message.reasons && message.reasons.length) { + object.reasons = []; + for (var j = 0; j < message.reasons.length; ++j) + object.reasons[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason[message.reasons[j]] === undefined ? message.reasons[j] : $root.google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason[message.reasons[j]] : message.reasons[j]; + } + if (message.passwordLeakVerification != null && message.hasOwnProperty("passwordLeakVerification")) + object.passwordLeakVerification = $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.toObject(message.passwordLeakVerification, options); + if (message.accountDefenderAssessment != null && message.hasOwnProperty("accountDefenderAssessment")) + object.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.toObject(message.accountDefenderAssessment, options); + if (message.fraudPreventionAssessment != null && message.hasOwnProperty("fraudPreventionAssessment")) + object.fraudPreventionAssessment = $root.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.toObject(message.fraudPreventionAssessment, options); return object; }; /** - * Converts this PasswordLeakVerification to JSON. + * Converts this Assessment to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment * @instance * @returns {Object.} JSON object */ - PasswordLeakVerification.prototype.toJSON = function toJSON() { + Assessment.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PasswordLeakVerification + * Gets the default type url for Assessment * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PasswordLeakVerification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Assessment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.Assessment"; }; - return PasswordLeakVerification; + /** + * ClassificationReason enum. + * @name google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason + * @enum {number} + * @property {number} CLASSIFICATION_REASON_UNSPECIFIED=0 CLASSIFICATION_REASON_UNSPECIFIED value + * @property {number} AUTOMATION=1 AUTOMATION value + * @property {number} UNEXPECTED_ENVIRONMENT=2 UNEXPECTED_ENVIRONMENT value + * @property {number} TOO_MUCH_TRAFFIC=3 TOO_MUCH_TRAFFIC value + * @property {number} UNEXPECTED_USAGE_PATTERNS=4 UNEXPECTED_USAGE_PATTERNS value + * @property {number} LOW_CONFIDENCE_SCORE=5 LOW_CONFIDENCE_SCORE value + * @property {number} SUSPECTED_CARDING=6 SUSPECTED_CARDING value + * @property {number} SUSPECTED_CHARGEBACK=7 SUSPECTED_CHARGEBACK value + */ + Assessment.ClassificationReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLASSIFICATION_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTOMATION"] = 1; + values[valuesById[2] = "UNEXPECTED_ENVIRONMENT"] = 2; + values[valuesById[3] = "TOO_MUCH_TRAFFIC"] = 3; + values[valuesById[4] = "UNEXPECTED_USAGE_PATTERNS"] = 4; + values[valuesById[5] = "LOW_CONFIDENCE_SCORE"] = 5; + values[valuesById[6] = "SUSPECTED_CARDING"] = 6; + values[valuesById[7] = "SUSPECTED_CHARGEBACK"] = 7; + return values; + })(); + + return Assessment; })(); - v1beta1.Assessment = (function() { + v1beta1.Event = (function() { /** - * Properties of an Assessment. + * Properties of an Event. * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @interface IAssessment - * @property {string|null} [name] Assessment name - * @property {google.cloud.recaptchaenterprise.v1beta1.IEvent|null} [event] Assessment event - * @property {number|null} [score] Assessment score - * @property {google.cloud.recaptchaenterprise.v1beta1.ITokenProperties|null} [tokenProperties] Assessment tokenProperties - * @property {Array.|null} [reasons] Assessment reasons - * @property {google.cloud.recaptchaenterprise.v1beta1.IPasswordLeakVerification|null} [passwordLeakVerification] Assessment passwordLeakVerification - * @property {google.cloud.recaptchaenterprise.v1beta1.IAccountDefenderAssessment|null} [accountDefenderAssessment] Assessment accountDefenderAssessment + * @interface IEvent + * @property {string|null} [token] Event token + * @property {string|null} [siteKey] Event siteKey + * @property {string|null} [userAgent] Event userAgent + * @property {string|null} [userIpAddress] Event userIpAddress + * @property {string|null} [expectedAction] Event expectedAction + * @property {Uint8Array|null} [hashedAccountId] Event hashedAccountId + * @property {google.cloud.recaptchaenterprise.v1beta1.ITransactionData|null} [transactionData] Event transactionData */ /** - * Constructs a new Assessment. + * Constructs a new Event. * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @classdesc Represents an Assessment. - * @implements IAssessment + * @classdesc Represents an Event. + * @implements IEvent * @constructor - * @param {google.cloud.recaptchaenterprise.v1beta1.IAssessment=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1beta1.IEvent=} [properties] Properties to set */ - function Assessment(properties) { - this.reasons = []; + function Event(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12703,170 +16671,159 @@ } /** - * Assessment name. - * @member {string} name - * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * Event token. + * @member {string} token + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event * @instance */ - Assessment.prototype.name = ""; + Event.prototype.token = ""; /** - * Assessment event. - * @member {google.cloud.recaptchaenterprise.v1beta1.IEvent|null|undefined} event - * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * Event siteKey. + * @member {string} siteKey + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event * @instance */ - Assessment.prototype.event = null; + Event.prototype.siteKey = ""; /** - * Assessment score. - * @member {number} score - * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * Event userAgent. + * @member {string} userAgent + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event * @instance */ - Assessment.prototype.score = 0; + Event.prototype.userAgent = ""; /** - * Assessment tokenProperties. - * @member {google.cloud.recaptchaenterprise.v1beta1.ITokenProperties|null|undefined} tokenProperties - * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * Event userIpAddress. + * @member {string} userIpAddress + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event * @instance */ - Assessment.prototype.tokenProperties = null; + Event.prototype.userIpAddress = ""; /** - * Assessment reasons. - * @member {Array.} reasons - * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * Event expectedAction. + * @member {string} expectedAction + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event * @instance */ - Assessment.prototype.reasons = $util.emptyArray; + Event.prototype.expectedAction = ""; /** - * Assessment passwordLeakVerification. - * @member {google.cloud.recaptchaenterprise.v1beta1.IPasswordLeakVerification|null|undefined} passwordLeakVerification - * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * Event hashedAccountId. + * @member {Uint8Array} hashedAccountId + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event * @instance */ - Assessment.prototype.passwordLeakVerification = null; + Event.prototype.hashedAccountId = $util.newBuffer([]); /** - * Assessment accountDefenderAssessment. - * @member {google.cloud.recaptchaenterprise.v1beta1.IAccountDefenderAssessment|null|undefined} accountDefenderAssessment - * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * Event transactionData. + * @member {google.cloud.recaptchaenterprise.v1beta1.ITransactionData|null|undefined} transactionData + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event * @instance */ - Assessment.prototype.accountDefenderAssessment = null; + Event.prototype.transactionData = null; /** - * Creates a new Assessment instance using the specified properties. + * Creates a new Event instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IAssessment=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1beta1.Assessment} Assessment instance + * @param {google.cloud.recaptchaenterprise.v1beta1.IEvent=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.Event} Event instance */ - Assessment.create = function create(properties) { - return new Assessment(properties); + Event.create = function create(properties) { + return new Event(properties); }; /** - * Encodes the specified Assessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Assessment.verify|verify} messages. + * Encodes the specified Event message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Event.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IAssessment} message Assessment message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1beta1.IEvent} message Event message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Assessment.encode = function encode(message, writer) { + Event.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.event != null && Object.hasOwnProperty.call(message, "event")) - $root.google.cloud.recaptchaenterprise.v1beta1.Event.encode(message.event, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.score != null && Object.hasOwnProperty.call(message, "score")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.score); - if (message.tokenProperties != null && Object.hasOwnProperty.call(message, "tokenProperties")) - $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.encode(message.tokenProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reasons != null && message.reasons.length) { - writer.uint32(/* id 5, wireType 2 =*/42).fork(); - for (var i = 0; i < message.reasons.length; ++i) - writer.int32(message.reasons[i]); - writer.ldelim(); - } - if (message.passwordLeakVerification != null && Object.hasOwnProperty.call(message, "passwordLeakVerification")) - $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.encode(message.passwordLeakVerification, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.accountDefenderAssessment != null && Object.hasOwnProperty.call(message, "accountDefenderAssessment")) - $root.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.encode(message.accountDefenderAssessment, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.token != null && Object.hasOwnProperty.call(message, "token")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); + if (message.siteKey != null && Object.hasOwnProperty.call(message, "siteKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.siteKey); + if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.userAgent); + if (message.userIpAddress != null && Object.hasOwnProperty.call(message, "userIpAddress")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.userIpAddress); + if (message.expectedAction != null && Object.hasOwnProperty.call(message, "expectedAction")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.expectedAction); + if (message.hashedAccountId != null && Object.hasOwnProperty.call(message, "hashedAccountId")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.hashedAccountId); + if (message.transactionData != null && Object.hasOwnProperty.call(message, "transactionData")) + $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.encode(message.transactionData, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); return writer; }; /** - * Encodes the specified Assessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Assessment.verify|verify} messages. + * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Event.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IAssessment} message Assessment message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1beta1.IEvent} message Event message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Assessment.encodeDelimited = function encodeDelimited(message, writer) { + Event.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Assessment message from the specified reader or buffer. + * Decodes an Event message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1beta1.Assessment} Assessment + * @returns {google.cloud.recaptchaenterprise.v1beta1.Event} Event * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Assessment.decode = function decode(reader, length) { + Event.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.v1beta1.Assessment(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.Event(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.token = reader.string(); break; } case 2: { - message.event = $root.google.cloud.recaptchaenterprise.v1beta1.Event.decode(reader, reader.uint32()); + message.siteKey = reader.string(); break; } case 3: { - message.score = reader.float(); + message.userAgent = reader.string(); break; } case 4: { - message.tokenProperties = $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.decode(reader, reader.uint32()); + message.userIpAddress = reader.string(); break; } case 5: { - if (!(message.reasons && message.reasons.length)) - message.reasons = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.reasons.push(reader.int32()); - } else - message.reasons.push(reader.int32()); + message.expectedAction = reader.string(); break; } - case 7: { - message.passwordLeakVerification = $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.decode(reader, reader.uint32()); + case 6: { + message.hashedAccountId = reader.bytes(); break; } - case 8: { - message.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.decode(reader, reader.uint32()); + case 13: { + message.transactionData = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.decode(reader, reader.uint32()); break; } default: @@ -12878,416 +16835,463 @@ }; /** - * Decodes an Assessment message from the specified reader or buffer, length delimited. + * Decodes an Event message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1beta1.Assessment} Assessment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Assessment.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Assessment message. - * @function verify - * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Assessment.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.event != null && message.hasOwnProperty("event")) { - var error = $root.google.cloud.recaptchaenterprise.v1beta1.Event.verify(message.event); - if (error) - return "event." + error; - } - if (message.score != null && message.hasOwnProperty("score")) - if (typeof message.score !== "number") - return "score: number expected"; - if (message.tokenProperties != null && message.hasOwnProperty("tokenProperties")) { - var error = $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.verify(message.tokenProperties); - if (error) - return "tokenProperties." + error; - } - if (message.reasons != null && message.hasOwnProperty("reasons")) { - if (!Array.isArray(message.reasons)) - return "reasons: array expected"; - for (var i = 0; i < message.reasons.length; ++i) - switch (message.reasons[i]) { - default: - return "reasons: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - } - if (message.passwordLeakVerification != null && message.hasOwnProperty("passwordLeakVerification")) { - var error = $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.verify(message.passwordLeakVerification); - if (error) - return "passwordLeakVerification." + error; - } - if (message.accountDefenderAssessment != null && message.hasOwnProperty("accountDefenderAssessment")) { - var error = $root.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.verify(message.accountDefenderAssessment); + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Event message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Event.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.token != null && message.hasOwnProperty("token")) + if (!$util.isString(message.token)) + return "token: string expected"; + if (message.siteKey != null && message.hasOwnProperty("siteKey")) + if (!$util.isString(message.siteKey)) + return "siteKey: string expected"; + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + if (!$util.isString(message.userAgent)) + return "userAgent: string expected"; + if (message.userIpAddress != null && message.hasOwnProperty("userIpAddress")) + if (!$util.isString(message.userIpAddress)) + return "userIpAddress: string expected"; + if (message.expectedAction != null && message.hasOwnProperty("expectedAction")) + if (!$util.isString(message.expectedAction)) + return "expectedAction: string expected"; + if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) + if (!(message.hashedAccountId && typeof message.hashedAccountId.length === "number" || $util.isString(message.hashedAccountId))) + return "hashedAccountId: buffer expected"; + if (message.transactionData != null && message.hasOwnProperty("transactionData")) { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.verify(message.transactionData); if (error) - return "accountDefenderAssessment." + error; + return "transactionData." + error; } return null; }; /** - * Creates an Assessment message from a plain object. Also converts values to their respective internal types. + * Creates an Event message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1beta1.Assessment} Assessment + * @returns {google.cloud.recaptchaenterprise.v1beta1.Event} Event */ - Assessment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.Assessment) + Event.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.Event) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1beta1.Assessment(); - if (object.name != null) - message.name = String(object.name); - if (object.event != null) { - if (typeof object.event !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.Assessment.event: object expected"); - message.event = $root.google.cloud.recaptchaenterprise.v1beta1.Event.fromObject(object.event); - } - if (object.score != null) - message.score = Number(object.score); - if (object.tokenProperties != null) { - if (typeof object.tokenProperties !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.Assessment.tokenProperties: object expected"); - message.tokenProperties = $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.fromObject(object.tokenProperties); - } - if (object.reasons) { - if (!Array.isArray(object.reasons)) - throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.Assessment.reasons: array expected"); - message.reasons = []; - for (var i = 0; i < object.reasons.length; ++i) - switch (object.reasons[i]) { - default: - if (typeof object.reasons[i] === "number") { - message.reasons[i] = object.reasons[i]; - break; - } - case "CLASSIFICATION_REASON_UNSPECIFIED": - case 0: - message.reasons[i] = 0; - break; - case "AUTOMATION": - case 1: - message.reasons[i] = 1; - break; - case "UNEXPECTED_ENVIRONMENT": - case 2: - message.reasons[i] = 2; - break; - case "TOO_MUCH_TRAFFIC": - case 3: - message.reasons[i] = 3; - break; - case "UNEXPECTED_USAGE_PATTERNS": - case 4: - message.reasons[i] = 4; - break; - case "LOW_CONFIDENCE_SCORE": - case 5: - message.reasons[i] = 5; - break; - } - } - if (object.passwordLeakVerification != null) { - if (typeof object.passwordLeakVerification !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.Assessment.passwordLeakVerification: object expected"); - message.passwordLeakVerification = $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.fromObject(object.passwordLeakVerification); - } - if (object.accountDefenderAssessment != null) { - if (typeof object.accountDefenderAssessment !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.Assessment.accountDefenderAssessment: object expected"); - message.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.fromObject(object.accountDefenderAssessment); + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.Event(); + if (object.token != null) + message.token = String(object.token); + if (object.siteKey != null) + message.siteKey = String(object.siteKey); + if (object.userAgent != null) + message.userAgent = String(object.userAgent); + if (object.userIpAddress != null) + message.userIpAddress = String(object.userIpAddress); + if (object.expectedAction != null) + message.expectedAction = String(object.expectedAction); + if (object.hashedAccountId != null) + if (typeof object.hashedAccountId === "string") + $util.base64.decode(object.hashedAccountId, message.hashedAccountId = $util.newBuffer($util.base64.length(object.hashedAccountId)), 0); + else if (object.hashedAccountId.length >= 0) + message.hashedAccountId = object.hashedAccountId; + if (object.transactionData != null) { + if (typeof object.transactionData !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.Event.transactionData: object expected"); + message.transactionData = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.fromObject(object.transactionData); } return message; }; /** - * Creates a plain object from an Assessment message. Also converts values to other types if specified. + * Creates a plain object from an Event message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.Assessment} message Assessment + * @param {google.cloud.recaptchaenterprise.v1beta1.Event} message Event * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Assessment.toObject = function toObject(message, options) { + Event.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.reasons = []; if (options.defaults) { - object.name = ""; - object.event = null; - object.score = 0; - object.tokenProperties = null; - object.passwordLeakVerification = null; - object.accountDefenderAssessment = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.event != null && message.hasOwnProperty("event")) - object.event = $root.google.cloud.recaptchaenterprise.v1beta1.Event.toObject(message.event, options); - if (message.score != null && message.hasOwnProperty("score")) - object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; - if (message.tokenProperties != null && message.hasOwnProperty("tokenProperties")) - object.tokenProperties = $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.toObject(message.tokenProperties, options); - if (message.reasons && message.reasons.length) { - object.reasons = []; - for (var j = 0; j < message.reasons.length; ++j) - object.reasons[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason[message.reasons[j]] === undefined ? message.reasons[j] : $root.google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason[message.reasons[j]] : message.reasons[j]; + object.token = ""; + object.siteKey = ""; + object.userAgent = ""; + object.userIpAddress = ""; + object.expectedAction = ""; + if (options.bytes === String) + object.hashedAccountId = ""; + else { + object.hashedAccountId = []; + if (options.bytes !== Array) + object.hashedAccountId = $util.newBuffer(object.hashedAccountId); + } + object.transactionData = null; } - if (message.passwordLeakVerification != null && message.hasOwnProperty("passwordLeakVerification")) - object.passwordLeakVerification = $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.toObject(message.passwordLeakVerification, options); - if (message.accountDefenderAssessment != null && message.hasOwnProperty("accountDefenderAssessment")) - object.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.toObject(message.accountDefenderAssessment, options); + if (message.token != null && message.hasOwnProperty("token")) + object.token = message.token; + if (message.siteKey != null && message.hasOwnProperty("siteKey")) + object.siteKey = message.siteKey; + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + object.userAgent = message.userAgent; + if (message.userIpAddress != null && message.hasOwnProperty("userIpAddress")) + object.userIpAddress = message.userIpAddress; + if (message.expectedAction != null && message.hasOwnProperty("expectedAction")) + object.expectedAction = message.expectedAction; + if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) + object.hashedAccountId = options.bytes === String ? $util.base64.encode(message.hashedAccountId, 0, message.hashedAccountId.length) : options.bytes === Array ? Array.prototype.slice.call(message.hashedAccountId) : message.hashedAccountId; + if (message.transactionData != null && message.hasOwnProperty("transactionData")) + object.transactionData = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.toObject(message.transactionData, options); return object; }; /** - * Converts this Assessment to JSON. + * Converts this Event to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event * @instance * @returns {Object.} JSON object */ - Assessment.prototype.toJSON = function toJSON() { + Event.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Assessment + * Gets the default type url for Event * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Assessment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Event.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.Assessment"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.Event"; }; + return Event; + })(); + + v1beta1.TransactionData = (function() { + /** - * ClassificationReason enum. - * @name google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason - * @enum {number} - * @property {number} CLASSIFICATION_REASON_UNSPECIFIED=0 CLASSIFICATION_REASON_UNSPECIFIED value - * @property {number} AUTOMATION=1 AUTOMATION value - * @property {number} UNEXPECTED_ENVIRONMENT=2 UNEXPECTED_ENVIRONMENT value - * @property {number} TOO_MUCH_TRAFFIC=3 TOO_MUCH_TRAFFIC value - * @property {number} UNEXPECTED_USAGE_PATTERNS=4 UNEXPECTED_USAGE_PATTERNS value - * @property {number} LOW_CONFIDENCE_SCORE=5 LOW_CONFIDENCE_SCORE value + * Properties of a TransactionData. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @interface ITransactionData + * @property {string|null} [transactionId] TransactionData transactionId + * @property {string|null} [paymentMethod] TransactionData paymentMethod + * @property {string|null} [cardBin] TransactionData cardBin + * @property {string|null} [cardLastFour] TransactionData cardLastFour + * @property {string|null} [currencyCode] TransactionData currencyCode + * @property {number|null} [value] TransactionData value + * @property {number|null} [shippingValue] TransactionData shippingValue + * @property {google.cloud.recaptchaenterprise.v1beta1.TransactionData.IAddress|null} [shippingAddress] TransactionData shippingAddress + * @property {google.cloud.recaptchaenterprise.v1beta1.TransactionData.IAddress|null} [billingAddress] TransactionData billingAddress + * @property {google.cloud.recaptchaenterprise.v1beta1.TransactionData.IUser|null} [user] TransactionData user + * @property {Array.|null} [merchants] TransactionData merchants + * @property {Array.|null} [items] TransactionData items + * @property {google.cloud.recaptchaenterprise.v1beta1.TransactionData.IGatewayInfo|null} [gatewayInfo] TransactionData gatewayInfo + */ + + /** + * Constructs a new TransactionData. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @classdesc Represents a TransactionData. + * @implements ITransactionData + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.ITransactionData=} [properties] Properties to set */ - Assessment.ClassificationReason = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLASSIFICATION_REASON_UNSPECIFIED"] = 0; - values[valuesById[1] = "AUTOMATION"] = 1; - values[valuesById[2] = "UNEXPECTED_ENVIRONMENT"] = 2; - values[valuesById[3] = "TOO_MUCH_TRAFFIC"] = 3; - values[valuesById[4] = "UNEXPECTED_USAGE_PATTERNS"] = 4; - values[valuesById[5] = "LOW_CONFIDENCE_SCORE"] = 5; - return values; - })(); + function TransactionData(properties) { + this.merchants = []; + this.items = []; + 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]]; + } - return Assessment; - })(); + /** + * TransactionData transactionId. + * @member {string|null|undefined} transactionId + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData + * @instance + */ + TransactionData.prototype.transactionId = null; - v1beta1.Event = (function() { + /** + * TransactionData paymentMethod. + * @member {string} paymentMethod + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData + * @instance + */ + TransactionData.prototype.paymentMethod = ""; + + /** + * TransactionData cardBin. + * @member {string} cardBin + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData + * @instance + */ + TransactionData.prototype.cardBin = ""; + + /** + * TransactionData cardLastFour. + * @member {string} cardLastFour + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData + * @instance + */ + TransactionData.prototype.cardLastFour = ""; + + /** + * TransactionData currencyCode. + * @member {string} currencyCode + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData + * @instance + */ + TransactionData.prototype.currencyCode = ""; + + /** + * TransactionData value. + * @member {number} value + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData + * @instance + */ + TransactionData.prototype.value = 0; /** - * Properties of an Event. - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @interface IEvent - * @property {string|null} [token] Event token - * @property {string|null} [siteKey] Event siteKey - * @property {string|null} [userAgent] Event userAgent - * @property {string|null} [userIpAddress] Event userIpAddress - * @property {string|null} [expectedAction] Event expectedAction - * @property {Uint8Array|null} [hashedAccountId] Event hashedAccountId + * TransactionData shippingValue. + * @member {number} shippingValue + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData + * @instance */ + TransactionData.prototype.shippingValue = 0; /** - * Constructs a new Event. - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @classdesc Represents an Event. - * @implements IEvent - * @constructor - * @param {google.cloud.recaptchaenterprise.v1beta1.IEvent=} [properties] Properties to set + * TransactionData shippingAddress. + * @member {google.cloud.recaptchaenterprise.v1beta1.TransactionData.IAddress|null|undefined} shippingAddress + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData + * @instance */ - function Event(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]]; - } + TransactionData.prototype.shippingAddress = null; /** - * Event token. - * @member {string} token - * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * TransactionData billingAddress. + * @member {google.cloud.recaptchaenterprise.v1beta1.TransactionData.IAddress|null|undefined} billingAddress + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData * @instance */ - Event.prototype.token = ""; + TransactionData.prototype.billingAddress = null; /** - * Event siteKey. - * @member {string} siteKey - * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * TransactionData user. + * @member {google.cloud.recaptchaenterprise.v1beta1.TransactionData.IUser|null|undefined} user + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData * @instance */ - Event.prototype.siteKey = ""; + TransactionData.prototype.user = null; /** - * Event userAgent. - * @member {string} userAgent - * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * TransactionData merchants. + * @member {Array.} merchants + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData * @instance */ - Event.prototype.userAgent = ""; + TransactionData.prototype.merchants = $util.emptyArray; /** - * Event userIpAddress. - * @member {string} userIpAddress - * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * TransactionData items. + * @member {Array.} items + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData * @instance */ - Event.prototype.userIpAddress = ""; + TransactionData.prototype.items = $util.emptyArray; /** - * Event expectedAction. - * @member {string} expectedAction - * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * TransactionData gatewayInfo. + * @member {google.cloud.recaptchaenterprise.v1beta1.TransactionData.IGatewayInfo|null|undefined} gatewayInfo + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData * @instance */ - Event.prototype.expectedAction = ""; + TransactionData.prototype.gatewayInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Event hashedAccountId. - * @member {Uint8Array} hashedAccountId - * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * TransactionData _transactionId. + * @member {"transactionId"|undefined} _transactionId + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData * @instance */ - Event.prototype.hashedAccountId = $util.newBuffer([]); + Object.defineProperty(TransactionData.prototype, "_transactionId", { + get: $util.oneOfGetter($oneOfFields = ["transactionId"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new Event instance using the specified properties. + * Creates a new TransactionData instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IEvent=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1beta1.Event} Event instance + * @param {google.cloud.recaptchaenterprise.v1beta1.ITransactionData=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.TransactionData} TransactionData instance */ - Event.create = function create(properties) { - return new Event(properties); + TransactionData.create = function create(properties) { + return new TransactionData(properties); }; /** - * Encodes the specified Event message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Event.verify|verify} messages. + * Encodes the specified TransactionData message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TransactionData.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IEvent} message Event message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1beta1.ITransactionData} message TransactionData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Event.encode = function encode(message, writer) { + TransactionData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.token != null && Object.hasOwnProperty.call(message, "token")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); - if (message.siteKey != null && Object.hasOwnProperty.call(message, "siteKey")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.siteKey); - if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.userAgent); - if (message.userIpAddress != null && Object.hasOwnProperty.call(message, "userIpAddress")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.userIpAddress); - if (message.expectedAction != null && Object.hasOwnProperty.call(message, "expectedAction")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.expectedAction); - if (message.hashedAccountId != null && Object.hasOwnProperty.call(message, "hashedAccountId")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.hashedAccountId); + if (message.paymentMethod != null && Object.hasOwnProperty.call(message, "paymentMethod")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paymentMethod); + if (message.cardBin != null && Object.hasOwnProperty.call(message, "cardBin")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cardBin); + if (message.cardLastFour != null && Object.hasOwnProperty.call(message, "cardLastFour")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.cardLastFour); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.currencyCode); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 5, wireType 1 =*/41).double(message.value); + if (message.shippingAddress != null && Object.hasOwnProperty.call(message, "shippingAddress")) + $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address.encode(message.shippingAddress, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.billingAddress != null && Object.hasOwnProperty.call(message, "billingAddress")) + $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address.encode(message.billingAddress, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.User.encode(message.user, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.gatewayInfo != null && Object.hasOwnProperty.call(message, "gatewayInfo")) + $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo.encode(message.gatewayInfo, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.transactionId); + if (message.shippingValue != null && Object.hasOwnProperty.call(message, "shippingValue")) + writer.uint32(/* id 12, wireType 1 =*/97).double(message.shippingValue); + if (message.merchants != null && message.merchants.length) + for (var i = 0; i < message.merchants.length; ++i) + $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.User.encode(message.merchants[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item.encode(message.items[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); return writer; }; /** - * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Event.verify|verify} messages. + * Encodes the specified TransactionData message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TransactionData.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IEvent} message Event message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1beta1.ITransactionData} message TransactionData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Event.encodeDelimited = function encodeDelimited(message, writer) { + TransactionData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Event message from the specified reader or buffer. + * Decodes a TransactionData message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1beta1.Event} Event + * @returns {google.cloud.recaptchaenterprise.v1beta1.TransactionData} TransactionData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Event.decode = function decode(reader, length) { + TransactionData.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.v1beta1.Event(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 11: { + message.transactionId = reader.string(); + break; + } case 1: { - message.token = reader.string(); + message.paymentMethod = reader.string(); break; } case 2: { - message.siteKey = reader.string(); + message.cardBin = reader.string(); break; } case 3: { - message.userAgent = reader.string(); + message.cardLastFour = reader.string(); break; } case 4: { - message.userIpAddress = reader.string(); + message.currencyCode = reader.string(); break; } case 5: { - message.expectedAction = reader.string(); + message.value = reader.double(); + break; + } + case 12: { + message.shippingValue = reader.double(); break; } case 6: { - message.hashedAccountId = reader.bytes(); + message.shippingAddress = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address.decode(reader, reader.uint32()); + break; + } + case 7: { + message.billingAddress = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address.decode(reader, reader.uint32()); + break; + } + case 8: { + message.user = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.User.decode(reader, reader.uint32()); + break; + } + case 13: { + if (!(message.merchants && message.merchants.length)) + message.merchants = []; + message.merchants.push($root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.User.decode(reader, reader.uint32())); + break; + } + case 14: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item.decode(reader, reader.uint32())); + break; + } + case 10: { + message.gatewayInfo = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo.decode(reader, reader.uint32()); break; } default: @@ -13299,152 +17303,1489 @@ }; /** - * Decodes an Event message from the specified reader or buffer, length delimited. + * Decodes a TransactionData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1beta1.Event} Event + * @returns {google.cloud.recaptchaenterprise.v1beta1.TransactionData} TransactionData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Event.decodeDelimited = function decodeDelimited(reader) { + TransactionData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Event message. + * Verifies a TransactionData message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Event.verify = function verify(message) { + TransactionData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.token != null && message.hasOwnProperty("token")) - if (!$util.isString(message.token)) - return "token: string expected"; - if (message.siteKey != null && message.hasOwnProperty("siteKey")) - if (!$util.isString(message.siteKey)) - return "siteKey: string expected"; - if (message.userAgent != null && message.hasOwnProperty("userAgent")) - if (!$util.isString(message.userAgent)) - return "userAgent: string expected"; - if (message.userIpAddress != null && message.hasOwnProperty("userIpAddress")) - if (!$util.isString(message.userIpAddress)) - return "userIpAddress: string expected"; - if (message.expectedAction != null && message.hasOwnProperty("expectedAction")) - if (!$util.isString(message.expectedAction)) - return "expectedAction: string expected"; - if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) - if (!(message.hashedAccountId && typeof message.hashedAccountId.length === "number" || $util.isString(message.hashedAccountId))) - return "hashedAccountId: buffer expected"; + var properties = {}; + if (message.transactionId != null && message.hasOwnProperty("transactionId")) { + properties._transactionId = 1; + if (!$util.isString(message.transactionId)) + return "transactionId: string expected"; + } + if (message.paymentMethod != null && message.hasOwnProperty("paymentMethod")) + if (!$util.isString(message.paymentMethod)) + return "paymentMethod: string expected"; + if (message.cardBin != null && message.hasOwnProperty("cardBin")) + if (!$util.isString(message.cardBin)) + return "cardBin: string expected"; + if (message.cardLastFour != null && message.hasOwnProperty("cardLastFour")) + if (!$util.isString(message.cardLastFour)) + return "cardLastFour: string expected"; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + if (message.shippingValue != null && message.hasOwnProperty("shippingValue")) + if (typeof message.shippingValue !== "number") + return "shippingValue: number expected"; + if (message.shippingAddress != null && message.hasOwnProperty("shippingAddress")) { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address.verify(message.shippingAddress); + if (error) + return "shippingAddress." + error; + } + if (message.billingAddress != null && message.hasOwnProperty("billingAddress")) { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address.verify(message.billingAddress); + if (error) + return "billingAddress." + error; + } + if (message.user != null && message.hasOwnProperty("user")) { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.User.verify(message.user); + if (error) + return "user." + error; + } + if (message.merchants != null && message.hasOwnProperty("merchants")) { + if (!Array.isArray(message.merchants)) + return "merchants: array expected"; + for (var i = 0; i < message.merchants.length; ++i) { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.User.verify(message.merchants[i]); + if (error) + return "merchants." + error; + } + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.gatewayInfo != null && message.hasOwnProperty("gatewayInfo")) { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo.verify(message.gatewayInfo); + if (error) + return "gatewayInfo." + error; + } return null; }; /** - * Creates an Event message from a plain object. Also converts values to their respective internal types. + * Creates a TransactionData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1beta1.Event} Event + * @returns {google.cloud.recaptchaenterprise.v1beta1.TransactionData} TransactionData */ - Event.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.Event) + TransactionData.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1beta1.Event(); - if (object.token != null) - message.token = String(object.token); - if (object.siteKey != null) - message.siteKey = String(object.siteKey); - if (object.userAgent != null) - message.userAgent = String(object.userAgent); - if (object.userIpAddress != null) - message.userIpAddress = String(object.userIpAddress); - if (object.expectedAction != null) - message.expectedAction = String(object.expectedAction); - if (object.hashedAccountId != null) - if (typeof object.hashedAccountId === "string") - $util.base64.decode(object.hashedAccountId, message.hashedAccountId = $util.newBuffer($util.base64.length(object.hashedAccountId)), 0); - else if (object.hashedAccountId.length >= 0) - message.hashedAccountId = object.hashedAccountId; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData(); + if (object.transactionId != null) + message.transactionId = String(object.transactionId); + if (object.paymentMethod != null) + message.paymentMethod = String(object.paymentMethod); + if (object.cardBin != null) + message.cardBin = String(object.cardBin); + if (object.cardLastFour != null) + message.cardLastFour = String(object.cardLastFour); + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); + if (object.value != null) + message.value = Number(object.value); + if (object.shippingValue != null) + message.shippingValue = Number(object.shippingValue); + if (object.shippingAddress != null) { + if (typeof object.shippingAddress !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.TransactionData.shippingAddress: object expected"); + message.shippingAddress = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address.fromObject(object.shippingAddress); + } + if (object.billingAddress != null) { + if (typeof object.billingAddress !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.TransactionData.billingAddress: object expected"); + message.billingAddress = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address.fromObject(object.billingAddress); + } + if (object.user != null) { + if (typeof object.user !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.TransactionData.user: object expected"); + message.user = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.User.fromObject(object.user); + } + if (object.merchants) { + if (!Array.isArray(object.merchants)) + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.TransactionData.merchants: array expected"); + message.merchants = []; + for (var i = 0; i < object.merchants.length; ++i) { + if (typeof object.merchants[i] !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.TransactionData.merchants: object expected"); + message.merchants[i] = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.User.fromObject(object.merchants[i]); + } + } + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.TransactionData.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.TransactionData.items: object expected"); + message.items[i] = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item.fromObject(object.items[i]); + } + } + if (object.gatewayInfo != null) { + if (typeof object.gatewayInfo !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.TransactionData.gatewayInfo: object expected"); + message.gatewayInfo = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo.fromObject(object.gatewayInfo); + } return message; }; /** - * Creates a plain object from an Event message. Also converts values to other types if specified. + * Creates a plain object from a TransactionData message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.Event} message Event + * @param {google.cloud.recaptchaenterprise.v1beta1.TransactionData} message TransactionData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Event.toObject = function toObject(message, options) { + TransactionData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.merchants = []; + object.items = []; + } if (options.defaults) { - object.token = ""; - object.siteKey = ""; - object.userAgent = ""; - object.userIpAddress = ""; - object.expectedAction = ""; - if (options.bytes === String) - object.hashedAccountId = ""; - else { - object.hashedAccountId = []; - if (options.bytes !== Array) - object.hashedAccountId = $util.newBuffer(object.hashedAccountId); + object.paymentMethod = ""; + object.cardBin = ""; + object.cardLastFour = ""; + object.currencyCode = ""; + object.value = 0; + object.shippingAddress = null; + object.billingAddress = null; + object.user = null; + object.gatewayInfo = null; + object.shippingValue = 0; + } + if (message.paymentMethod != null && message.hasOwnProperty("paymentMethod")) + object.paymentMethod = message.paymentMethod; + if (message.cardBin != null && message.hasOwnProperty("cardBin")) + object.cardBin = message.cardBin; + if (message.cardLastFour != null && message.hasOwnProperty("cardLastFour")) + object.cardLastFour = message.cardLastFour; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + object.currencyCode = message.currencyCode; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + if (message.shippingAddress != null && message.hasOwnProperty("shippingAddress")) + object.shippingAddress = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address.toObject(message.shippingAddress, options); + if (message.billingAddress != null && message.hasOwnProperty("billingAddress")) + object.billingAddress = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address.toObject(message.billingAddress, options); + if (message.user != null && message.hasOwnProperty("user")) + object.user = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.User.toObject(message.user, options); + if (message.gatewayInfo != null && message.hasOwnProperty("gatewayInfo")) + object.gatewayInfo = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo.toObject(message.gatewayInfo, options); + if (message.transactionId != null && message.hasOwnProperty("transactionId")) { + object.transactionId = message.transactionId; + if (options.oneofs) + object._transactionId = "transactionId"; + } + if (message.shippingValue != null && message.hasOwnProperty("shippingValue")) + object.shippingValue = options.json && !isFinite(message.shippingValue) ? String(message.shippingValue) : message.shippingValue; + if (message.merchants && message.merchants.length) { + object.merchants = []; + for (var j = 0; j < message.merchants.length; ++j) + object.merchants[j] = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.User.toObject(message.merchants[j], options); + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item.toObject(message.items[j], options); + } + return object; + }; + + /** + * Converts this TransactionData to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData + * @instance + * @returns {Object.} JSON object + */ + TransactionData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransactionData + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.TransactionData"; + }; + + TransactionData.Address = (function() { + + /** + * Properties of an Address. + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData + * @interface IAddress + * @property {string|null} [recipient] Address recipient + * @property {Array.|null} [address] Address address + * @property {string|null} [locality] Address locality + * @property {string|null} [administrativeArea] Address administrativeArea + * @property {string|null} [regionCode] Address regionCode + * @property {string|null} [postalCode] Address postalCode + */ + + /** + * Constructs a new Address. + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData + * @classdesc Represents an Address. + * @implements IAddress + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.TransactionData.IAddress=} [properties] Properties to set + */ + function Address(properties) { + this.address = []; + 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]]; + } + + /** + * Address recipient. + * @member {string} recipient + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address + * @instance + */ + Address.prototype.recipient = ""; + + /** + * Address address. + * @member {Array.} address + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address + * @instance + */ + Address.prototype.address = $util.emptyArray; + + /** + * Address locality. + * @member {string} locality + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address + * @instance + */ + Address.prototype.locality = ""; + + /** + * Address administrativeArea. + * @member {string} administrativeArea + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address + * @instance + */ + Address.prototype.administrativeArea = ""; + + /** + * Address regionCode. + * @member {string} regionCode + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address + * @instance + */ + Address.prototype.regionCode = ""; + + /** + * Address postalCode. + * @member {string} postalCode + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address + * @instance + */ + Address.prototype.postalCode = ""; + + /** + * Creates a new Address instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.TransactionData.IAddress=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address} Address instance + */ + Address.create = function create(properties) { + return new Address(properties); + }; + + /** + * Encodes the specified Address message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.TransactionData.IAddress} message Address message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Address.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recipient != null && Object.hasOwnProperty.call(message, "recipient")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.recipient); + if (message.address != null && message.address.length) + for (var i = 0; i < message.address.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.address[i]); + if (message.locality != null && Object.hasOwnProperty.call(message, "locality")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.locality); + if (message.administrativeArea != null && Object.hasOwnProperty.call(message, "administrativeArea")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.administrativeArea); + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.regionCode); + if (message.postalCode != null && Object.hasOwnProperty.call(message, "postalCode")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.postalCode); + return writer; + }; + + /** + * Encodes the specified Address message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.TransactionData.IAddress} message Address message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Address.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Address message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address} Address + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Address.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.v1beta1.TransactionData.Address(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.recipient = reader.string(); + break; + } + case 2: { + if (!(message.address && message.address.length)) + message.address = []; + message.address.push(reader.string()); + break; + } + case 3: { + message.locality = reader.string(); + break; + } + case 4: { + message.administrativeArea = reader.string(); + break; + } + case 5: { + message.regionCode = reader.string(); + break; + } + case 6: { + message.postalCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Address message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address} Address + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Address.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Address message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Address.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recipient != null && message.hasOwnProperty("recipient")) + if (!$util.isString(message.recipient)) + return "recipient: string expected"; + if (message.address != null && message.hasOwnProperty("address")) { + if (!Array.isArray(message.address)) + return "address: array expected"; + for (var i = 0; i < message.address.length; ++i) + if (!$util.isString(message.address[i])) + return "address: string[] expected"; + } + if (message.locality != null && message.hasOwnProperty("locality")) + if (!$util.isString(message.locality)) + return "locality: string expected"; + if (message.administrativeArea != null && message.hasOwnProperty("administrativeArea")) + if (!$util.isString(message.administrativeArea)) + return "administrativeArea: string expected"; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + if (message.postalCode != null && message.hasOwnProperty("postalCode")) + if (!$util.isString(message.postalCode)) + return "postalCode: string expected"; + return null; + }; + + /** + * Creates an Address message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address} Address + */ + Address.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address(); + if (object.recipient != null) + message.recipient = String(object.recipient); + if (object.address) { + if (!Array.isArray(object.address)) + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address.address: array expected"); + message.address = []; + for (var i = 0; i < object.address.length; ++i) + message.address[i] = String(object.address[i]); + } + if (object.locality != null) + message.locality = String(object.locality); + if (object.administrativeArea != null) + message.administrativeArea = String(object.administrativeArea); + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + if (object.postalCode != null) + message.postalCode = String(object.postalCode); + return message; + }; + + /** + * Creates a plain object from an Address message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address} message Address + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Address.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.address = []; + if (options.defaults) { + object.recipient = ""; + object.locality = ""; + object.administrativeArea = ""; + object.regionCode = ""; + object.postalCode = ""; + } + if (message.recipient != null && message.hasOwnProperty("recipient")) + object.recipient = message.recipient; + if (message.address && message.address.length) { + object.address = []; + for (var j = 0; j < message.address.length; ++j) + object.address[j] = message.address[j]; + } + if (message.locality != null && message.hasOwnProperty("locality")) + object.locality = message.locality; + if (message.administrativeArea != null && message.hasOwnProperty("administrativeArea")) + object.administrativeArea = message.administrativeArea; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + if (message.postalCode != null && message.hasOwnProperty("postalCode")) + object.postalCode = message.postalCode; + return object; + }; + + /** + * Converts this Address to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address + * @instance + * @returns {Object.} JSON object + */ + Address.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Address + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Address.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address"; + }; + + return Address; + })(); + + TransactionData.User = (function() { + + /** + * Properties of a User. + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData + * @interface IUser + * @property {string|null} [accountId] User accountId + * @property {number|Long|null} [creationMs] User creationMs + * @property {string|null} [email] User email + * @property {boolean|null} [emailVerified] User emailVerified + * @property {string|null} [phoneNumber] User phoneNumber + * @property {boolean|null} [phoneVerified] User phoneVerified + */ + + /** + * Constructs a new User. + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData + * @classdesc Represents a User. + * @implements IUser + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.TransactionData.IUser=} [properties] Properties to set + */ + function User(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]]; + } + + /** + * User accountId. + * @member {string} accountId + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.User + * @instance + */ + User.prototype.accountId = ""; + + /** + * User creationMs. + * @member {number|Long} creationMs + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.User + * @instance + */ + User.prototype.creationMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * User email. + * @member {string} email + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.User + * @instance + */ + User.prototype.email = ""; + + /** + * User emailVerified. + * @member {boolean} emailVerified + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.User + * @instance + */ + User.prototype.emailVerified = false; + + /** + * User phoneNumber. + * @member {string} phoneNumber + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.User + * @instance + */ + User.prototype.phoneNumber = ""; + + /** + * User phoneVerified. + * @member {boolean} phoneVerified + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.User + * @instance + */ + User.prototype.phoneVerified = false; + + /** + * Creates a new User instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.User + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.TransactionData.IUser=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.TransactionData.User} User instance + */ + User.create = function create(properties) { + return new User(properties); + }; + + /** + * Encodes the specified User message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TransactionData.User.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.User + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.TransactionData.IUser} message User message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + User.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.creationMs != null && Object.hasOwnProperty.call(message, "creationMs")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.creationMs); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.email); + if (message.emailVerified != null && Object.hasOwnProperty.call(message, "emailVerified")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.emailVerified); + if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.phoneNumber); + if (message.phoneVerified != null && Object.hasOwnProperty.call(message, "phoneVerified")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.phoneVerified); + if (message.accountId != null && Object.hasOwnProperty.call(message, "accountId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.accountId); + return writer; + }; + + /** + * Encodes the specified User message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TransactionData.User.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.User + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.TransactionData.IUser} message User message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + User.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a User message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.User + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.TransactionData.User} User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + User.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.v1beta1.TransactionData.User(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 6: { + message.accountId = reader.string(); + break; + } + case 1: { + message.creationMs = reader.int64(); + break; + } + case 2: { + message.email = reader.string(); + break; + } + case 3: { + message.emailVerified = reader.bool(); + break; + } + case 4: { + message.phoneNumber = reader.string(); + break; + } + case 5: { + message.phoneVerified = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a User message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.User + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.TransactionData.User} User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + User.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a User message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.User + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + User.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.accountId != null && message.hasOwnProperty("accountId")) + if (!$util.isString(message.accountId)) + return "accountId: string expected"; + if (message.creationMs != null && message.hasOwnProperty("creationMs")) + if (!$util.isInteger(message.creationMs) && !(message.creationMs && $util.isInteger(message.creationMs.low) && $util.isInteger(message.creationMs.high))) + return "creationMs: integer|Long expected"; + if (message.email != null && message.hasOwnProperty("email")) + if (!$util.isString(message.email)) + return "email: string expected"; + if (message.emailVerified != null && message.hasOwnProperty("emailVerified")) + if (typeof message.emailVerified !== "boolean") + return "emailVerified: boolean expected"; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + if (!$util.isString(message.phoneNumber)) + return "phoneNumber: string expected"; + if (message.phoneVerified != null && message.hasOwnProperty("phoneVerified")) + if (typeof message.phoneVerified !== "boolean") + return "phoneVerified: boolean expected"; + return null; + }; + + /** + * Creates a User message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.User + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.TransactionData.User} User + */ + User.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.User) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.User(); + if (object.accountId != null) + message.accountId = String(object.accountId); + if (object.creationMs != null) + if ($util.Long) + (message.creationMs = $util.Long.fromValue(object.creationMs)).unsigned = false; + else if (typeof object.creationMs === "string") + message.creationMs = parseInt(object.creationMs, 10); + else if (typeof object.creationMs === "number") + message.creationMs = object.creationMs; + else if (typeof object.creationMs === "object") + message.creationMs = new $util.LongBits(object.creationMs.low >>> 0, object.creationMs.high >>> 0).toNumber(); + if (object.email != null) + message.email = String(object.email); + if (object.emailVerified != null) + message.emailVerified = Boolean(object.emailVerified); + if (object.phoneNumber != null) + message.phoneNumber = String(object.phoneNumber); + if (object.phoneVerified != null) + message.phoneVerified = Boolean(object.phoneVerified); + return message; + }; + + /** + * Creates a plain object from a User message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.User + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.TransactionData.User} message User + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + User.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.creationMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.creationMs = options.longs === String ? "0" : 0; + object.email = ""; + object.emailVerified = false; + object.phoneNumber = ""; + object.phoneVerified = false; + object.accountId = ""; } - } - if (message.token != null && message.hasOwnProperty("token")) - object.token = message.token; - if (message.siteKey != null && message.hasOwnProperty("siteKey")) - object.siteKey = message.siteKey; - if (message.userAgent != null && message.hasOwnProperty("userAgent")) - object.userAgent = message.userAgent; - if (message.userIpAddress != null && message.hasOwnProperty("userIpAddress")) - object.userIpAddress = message.userIpAddress; - if (message.expectedAction != null && message.hasOwnProperty("expectedAction")) - object.expectedAction = message.expectedAction; - if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) - object.hashedAccountId = options.bytes === String ? $util.base64.encode(message.hashedAccountId, 0, message.hashedAccountId.length) : options.bytes === Array ? Array.prototype.slice.call(message.hashedAccountId) : message.hashedAccountId; - return object; - }; + if (message.creationMs != null && message.hasOwnProperty("creationMs")) + if (typeof message.creationMs === "number") + object.creationMs = options.longs === String ? String(message.creationMs) : message.creationMs; + else + object.creationMs = options.longs === String ? $util.Long.prototype.toString.call(message.creationMs) : options.longs === Number ? new $util.LongBits(message.creationMs.low >>> 0, message.creationMs.high >>> 0).toNumber() : message.creationMs; + if (message.email != null && message.hasOwnProperty("email")) + object.email = message.email; + if (message.emailVerified != null && message.hasOwnProperty("emailVerified")) + object.emailVerified = message.emailVerified; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + object.phoneNumber = message.phoneNumber; + if (message.phoneVerified != null && message.hasOwnProperty("phoneVerified")) + object.phoneVerified = message.phoneVerified; + if (message.accountId != null && message.hasOwnProperty("accountId")) + object.accountId = message.accountId; + return object; + }; + + /** + * Converts this User to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.User + * @instance + * @returns {Object.} JSON object + */ + User.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for User + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.User + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + User.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.TransactionData.User"; + }; - /** - * Converts this Event to JSON. - * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1beta1.Event - * @instance - * @returns {Object.} JSON object - */ - Event.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return User; + })(); - /** - * Gets the default type url for Event - * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1beta1.Event - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Event.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.Event"; - }; + TransactionData.Item = (function() { + + /** + * Properties of an Item. + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData + * @interface IItem + * @property {string|null} [name] Item name + * @property {number|null} [value] Item value + * @property {number|Long|null} [quantity] Item quantity + * @property {string|null} [merchantAccountId] Item merchantAccountId + */ + + /** + * Constructs a new Item. + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData + * @classdesc Represents an Item. + * @implements IItem + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.TransactionData.IItem=} [properties] Properties to set + */ + function Item(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]]; + } + + /** + * Item name. + * @member {string} name + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item + * @instance + */ + Item.prototype.name = ""; + + /** + * Item value. + * @member {number} value + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item + * @instance + */ + Item.prototype.value = 0; + + /** + * Item quantity. + * @member {number|Long} quantity + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item + * @instance + */ + Item.prototype.quantity = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Item merchantAccountId. + * @member {string} merchantAccountId + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item + * @instance + */ + Item.prototype.merchantAccountId = ""; + + /** + * Creates a new Item instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.TransactionData.IItem=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item} Item instance + */ + Item.create = function create(properties) { + return new Item(properties); + }; + + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.TransactionData.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.value); + if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.quantity); + if (message.merchantAccountId != null && Object.hasOwnProperty.call(message, "merchantAccountId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.merchantAccountId); + return writer; + }; + + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.TransactionData.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Item message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.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.v1beta1.TransactionData.Item(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.value = reader.double(); + break; + } + case 3: { + message.quantity = reader.int64(); + break; + } + case 4: { + message.merchantAccountId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Item message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Item.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + if (message.quantity != null && message.hasOwnProperty("quantity")) + if (!$util.isInteger(message.quantity) && !(message.quantity && $util.isInteger(message.quantity.low) && $util.isInteger(message.quantity.high))) + return "quantity: integer|Long expected"; + if (message.merchantAccountId != null && message.hasOwnProperty("merchantAccountId")) + if (!$util.isString(message.merchantAccountId)) + return "merchantAccountId: string expected"; + return null; + }; + + /** + * Creates an Item message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item} Item + */ + Item.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) + message.value = Number(object.value); + if (object.quantity != null) + if ($util.Long) + (message.quantity = $util.Long.fromValue(object.quantity)).unsigned = false; + else if (typeof object.quantity === "string") + message.quantity = parseInt(object.quantity, 10); + else if (typeof object.quantity === "number") + message.quantity = object.quantity; + else if (typeof object.quantity === "object") + message.quantity = new $util.LongBits(object.quantity.low >>> 0, object.quantity.high >>> 0).toNumber(); + if (object.merchantAccountId != null) + message.merchantAccountId = String(object.merchantAccountId); + return message; + }; + + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item} message Item + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Item.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.value = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.quantity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.quantity = options.longs === String ? "0" : 0; + object.merchantAccountId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + if (message.quantity != null && message.hasOwnProperty("quantity")) + if (typeof message.quantity === "number") + object.quantity = options.longs === String ? String(message.quantity) : message.quantity; + else + object.quantity = options.longs === String ? $util.Long.prototype.toString.call(message.quantity) : options.longs === Number ? new $util.LongBits(message.quantity.low >>> 0, message.quantity.high >>> 0).toNumber() : message.quantity; + if (message.merchantAccountId != null && message.hasOwnProperty("merchantAccountId")) + object.merchantAccountId = message.merchantAccountId; + return object; + }; + + /** + * Converts this Item to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item + * @instance + * @returns {Object.} JSON object + */ + Item.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Item + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Item.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item"; + }; - return Event; + return Item; + })(); + + TransactionData.GatewayInfo = (function() { + + /** + * Properties of a GatewayInfo. + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData + * @interface IGatewayInfo + * @property {string|null} [name] GatewayInfo name + * @property {string|null} [gatewayResponseCode] GatewayInfo gatewayResponseCode + * @property {string|null} [avsResponseCode] GatewayInfo avsResponseCode + * @property {string|null} [cvvResponseCode] GatewayInfo cvvResponseCode + */ + + /** + * Constructs a new GatewayInfo. + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData + * @classdesc Represents a GatewayInfo. + * @implements IGatewayInfo + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.TransactionData.IGatewayInfo=} [properties] Properties to set + */ + function GatewayInfo(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]]; + } + + /** + * GatewayInfo name. + * @member {string} name + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo + * @instance + */ + GatewayInfo.prototype.name = ""; + + /** + * GatewayInfo gatewayResponseCode. + * @member {string} gatewayResponseCode + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo + * @instance + */ + GatewayInfo.prototype.gatewayResponseCode = ""; + + /** + * GatewayInfo avsResponseCode. + * @member {string} avsResponseCode + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo + * @instance + */ + GatewayInfo.prototype.avsResponseCode = ""; + + /** + * GatewayInfo cvvResponseCode. + * @member {string} cvvResponseCode + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo + * @instance + */ + GatewayInfo.prototype.cvvResponseCode = ""; + + /** + * Creates a new GatewayInfo instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.TransactionData.IGatewayInfo=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo} GatewayInfo instance + */ + GatewayInfo.create = function create(properties) { + return new GatewayInfo(properties); + }; + + /** + * Encodes the specified GatewayInfo message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.TransactionData.IGatewayInfo} message GatewayInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GatewayInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.gatewayResponseCode != null && Object.hasOwnProperty.call(message, "gatewayResponseCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gatewayResponseCode); + if (message.avsResponseCode != null && Object.hasOwnProperty.call(message, "avsResponseCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.avsResponseCode); + if (message.cvvResponseCode != null && Object.hasOwnProperty.call(message, "cvvResponseCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.cvvResponseCode); + return writer; + }; + + /** + * Encodes the specified GatewayInfo message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.TransactionData.IGatewayInfo} message GatewayInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GatewayInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GatewayInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo} GatewayInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GatewayInfo.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.v1beta1.TransactionData.GatewayInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.gatewayResponseCode = reader.string(); + break; + } + case 3: { + message.avsResponseCode = reader.string(); + break; + } + case 4: { + message.cvvResponseCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GatewayInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo} GatewayInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GatewayInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GatewayInfo message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GatewayInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.gatewayResponseCode != null && message.hasOwnProperty("gatewayResponseCode")) + if (!$util.isString(message.gatewayResponseCode)) + return "gatewayResponseCode: string expected"; + if (message.avsResponseCode != null && message.hasOwnProperty("avsResponseCode")) + if (!$util.isString(message.avsResponseCode)) + return "avsResponseCode: string expected"; + if (message.cvvResponseCode != null && message.hasOwnProperty("cvvResponseCode")) + if (!$util.isString(message.cvvResponseCode)) + return "cvvResponseCode: string expected"; + return null; + }; + + /** + * Creates a GatewayInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo} GatewayInfo + */ + GatewayInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo(); + if (object.name != null) + message.name = String(object.name); + if (object.gatewayResponseCode != null) + message.gatewayResponseCode = String(object.gatewayResponseCode); + if (object.avsResponseCode != null) + message.avsResponseCode = String(object.avsResponseCode); + if (object.cvvResponseCode != null) + message.cvvResponseCode = String(object.cvvResponseCode); + return message; + }; + + /** + * Creates a plain object from a GatewayInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo} message GatewayInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GatewayInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.gatewayResponseCode = ""; + object.avsResponseCode = ""; + object.cvvResponseCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.gatewayResponseCode != null && message.hasOwnProperty("gatewayResponseCode")) + object.gatewayResponseCode = message.gatewayResponseCode; + if (message.avsResponseCode != null && message.hasOwnProperty("avsResponseCode")) + object.avsResponseCode = message.avsResponseCode; + if (message.cvvResponseCode != null && message.hasOwnProperty("cvvResponseCode")) + object.cvvResponseCode = message.cvvResponseCode; + return object; + }; + + /** + * Converts this GatewayInfo to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo + * @instance + * @returns {Object.} JSON object + */ + GatewayInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GatewayInfo + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GatewayInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo"; + }; + + return GatewayInfo; + })(); + + return TransactionData; })(); v1beta1.TokenProperties = (function() { @@ -13823,6 +19164,672 @@ return TokenProperties; })(); + v1beta1.FraudPreventionAssessment = (function() { + + /** + * Properties of a FraudPreventionAssessment. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @interface IFraudPreventionAssessment + * @property {number|null} [transactionRisk] FraudPreventionAssessment transactionRisk + * @property {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.IStolenInstrumentVerdict|null} [stolenInstrumentVerdict] FraudPreventionAssessment stolenInstrumentVerdict + * @property {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.ICardTestingVerdict|null} [cardTestingVerdict] FraudPreventionAssessment cardTestingVerdict + */ + + /** + * Constructs a new FraudPreventionAssessment. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @classdesc Represents a FraudPreventionAssessment. + * @implements IFraudPreventionAssessment + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.IFraudPreventionAssessment=} [properties] Properties to set + */ + function FraudPreventionAssessment(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]]; + } + + /** + * FraudPreventionAssessment transactionRisk. + * @member {number} transactionRisk + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment + * @instance + */ + FraudPreventionAssessment.prototype.transactionRisk = 0; + + /** + * FraudPreventionAssessment stolenInstrumentVerdict. + * @member {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.IStolenInstrumentVerdict|null|undefined} stolenInstrumentVerdict + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment + * @instance + */ + FraudPreventionAssessment.prototype.stolenInstrumentVerdict = null; + + /** + * FraudPreventionAssessment cardTestingVerdict. + * @member {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.ICardTestingVerdict|null|undefined} cardTestingVerdict + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment + * @instance + */ + FraudPreventionAssessment.prototype.cardTestingVerdict = null; + + /** + * Creates a new FraudPreventionAssessment instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IFraudPreventionAssessment=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment} FraudPreventionAssessment instance + */ + FraudPreventionAssessment.create = function create(properties) { + return new FraudPreventionAssessment(properties); + }; + + /** + * Encodes the specified FraudPreventionAssessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IFraudPreventionAssessment} message FraudPreventionAssessment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FraudPreventionAssessment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transactionRisk != null && Object.hasOwnProperty.call(message, "transactionRisk")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.transactionRisk); + if (message.stolenInstrumentVerdict != null && Object.hasOwnProperty.call(message, "stolenInstrumentVerdict")) + $root.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict.encode(message.stolenInstrumentVerdict, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cardTestingVerdict != null && Object.hasOwnProperty.call(message, "cardTestingVerdict")) + $root.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict.encode(message.cardTestingVerdict, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FraudPreventionAssessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IFraudPreventionAssessment} message FraudPreventionAssessment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FraudPreventionAssessment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FraudPreventionAssessment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment} FraudPreventionAssessment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FraudPreventionAssessment.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.v1beta1.FraudPreventionAssessment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.transactionRisk = reader.float(); + break; + } + case 2: { + message.stolenInstrumentVerdict = $root.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cardTestingVerdict = $root.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FraudPreventionAssessment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment} FraudPreventionAssessment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FraudPreventionAssessment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FraudPreventionAssessment message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FraudPreventionAssessment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transactionRisk != null && message.hasOwnProperty("transactionRisk")) + if (typeof message.transactionRisk !== "number") + return "transactionRisk: number expected"; + if (message.stolenInstrumentVerdict != null && message.hasOwnProperty("stolenInstrumentVerdict")) { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict.verify(message.stolenInstrumentVerdict); + if (error) + return "stolenInstrumentVerdict." + error; + } + if (message.cardTestingVerdict != null && message.hasOwnProperty("cardTestingVerdict")) { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict.verify(message.cardTestingVerdict); + if (error) + return "cardTestingVerdict." + error; + } + return null; + }; + + /** + * Creates a FraudPreventionAssessment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment} FraudPreventionAssessment + */ + FraudPreventionAssessment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment(); + if (object.transactionRisk != null) + message.transactionRisk = Number(object.transactionRisk); + if (object.stolenInstrumentVerdict != null) { + if (typeof object.stolenInstrumentVerdict !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.stolenInstrumentVerdict: object expected"); + message.stolenInstrumentVerdict = $root.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict.fromObject(object.stolenInstrumentVerdict); + } + if (object.cardTestingVerdict != null) { + if (typeof object.cardTestingVerdict !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.cardTestingVerdict: object expected"); + message.cardTestingVerdict = $root.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict.fromObject(object.cardTestingVerdict); + } + return message; + }; + + /** + * Creates a plain object from a FraudPreventionAssessment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment} message FraudPreventionAssessment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FraudPreventionAssessment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.transactionRisk = 0; + object.stolenInstrumentVerdict = null; + object.cardTestingVerdict = null; + } + if (message.transactionRisk != null && message.hasOwnProperty("transactionRisk")) + object.transactionRisk = options.json && !isFinite(message.transactionRisk) ? String(message.transactionRisk) : message.transactionRisk; + if (message.stolenInstrumentVerdict != null && message.hasOwnProperty("stolenInstrumentVerdict")) + object.stolenInstrumentVerdict = $root.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict.toObject(message.stolenInstrumentVerdict, options); + if (message.cardTestingVerdict != null && message.hasOwnProperty("cardTestingVerdict")) + object.cardTestingVerdict = $root.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict.toObject(message.cardTestingVerdict, options); + return object; + }; + + /** + * Converts this FraudPreventionAssessment to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment + * @instance + * @returns {Object.} JSON object + */ + FraudPreventionAssessment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FraudPreventionAssessment + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FraudPreventionAssessment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment"; + }; + + FraudPreventionAssessment.StolenInstrumentVerdict = (function() { + + /** + * Properties of a StolenInstrumentVerdict. + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment + * @interface IStolenInstrumentVerdict + * @property {number|null} [risk] StolenInstrumentVerdict risk + */ + + /** + * Constructs a new StolenInstrumentVerdict. + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment + * @classdesc Represents a StolenInstrumentVerdict. + * @implements IStolenInstrumentVerdict + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.IStolenInstrumentVerdict=} [properties] Properties to set + */ + function StolenInstrumentVerdict(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]]; + } + + /** + * StolenInstrumentVerdict risk. + * @member {number} risk + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict + * @instance + */ + StolenInstrumentVerdict.prototype.risk = 0; + + /** + * Creates a new StolenInstrumentVerdict instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.IStolenInstrumentVerdict=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict} StolenInstrumentVerdict instance + */ + StolenInstrumentVerdict.create = function create(properties) { + return new StolenInstrumentVerdict(properties); + }; + + /** + * Encodes the specified StolenInstrumentVerdict message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.IStolenInstrumentVerdict} message StolenInstrumentVerdict message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StolenInstrumentVerdict.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.risk != null && Object.hasOwnProperty.call(message, "risk")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.risk); + return writer; + }; + + /** + * Encodes the specified StolenInstrumentVerdict message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.IStolenInstrumentVerdict} message StolenInstrumentVerdict message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StolenInstrumentVerdict.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StolenInstrumentVerdict message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict} StolenInstrumentVerdict + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StolenInstrumentVerdict.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.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.risk = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StolenInstrumentVerdict message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict} StolenInstrumentVerdict + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StolenInstrumentVerdict.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StolenInstrumentVerdict message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StolenInstrumentVerdict.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.risk != null && message.hasOwnProperty("risk")) + if (typeof message.risk !== "number") + return "risk: number expected"; + return null; + }; + + /** + * Creates a StolenInstrumentVerdict message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict} StolenInstrumentVerdict + */ + StolenInstrumentVerdict.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict(); + if (object.risk != null) + message.risk = Number(object.risk); + return message; + }; + + /** + * Creates a plain object from a StolenInstrumentVerdict message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict} message StolenInstrumentVerdict + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StolenInstrumentVerdict.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.risk = 0; + if (message.risk != null && message.hasOwnProperty("risk")) + object.risk = options.json && !isFinite(message.risk) ? String(message.risk) : message.risk; + return object; + }; + + /** + * Converts this StolenInstrumentVerdict to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict + * @instance + * @returns {Object.} JSON object + */ + StolenInstrumentVerdict.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StolenInstrumentVerdict + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StolenInstrumentVerdict.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict"; + }; + + return StolenInstrumentVerdict; + })(); + + FraudPreventionAssessment.CardTestingVerdict = (function() { + + /** + * Properties of a CardTestingVerdict. + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment + * @interface ICardTestingVerdict + * @property {number|null} [risk] CardTestingVerdict risk + */ + + /** + * Constructs a new CardTestingVerdict. + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment + * @classdesc Represents a CardTestingVerdict. + * @implements ICardTestingVerdict + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.ICardTestingVerdict=} [properties] Properties to set + */ + function CardTestingVerdict(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]]; + } + + /** + * CardTestingVerdict risk. + * @member {number} risk + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict + * @instance + */ + CardTestingVerdict.prototype.risk = 0; + + /** + * Creates a new CardTestingVerdict instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.ICardTestingVerdict=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict} CardTestingVerdict instance + */ + CardTestingVerdict.create = function create(properties) { + return new CardTestingVerdict(properties); + }; + + /** + * Encodes the specified CardTestingVerdict message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.ICardTestingVerdict} message CardTestingVerdict message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CardTestingVerdict.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.risk != null && Object.hasOwnProperty.call(message, "risk")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.risk); + return writer; + }; + + /** + * Encodes the specified CardTestingVerdict message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.ICardTestingVerdict} message CardTestingVerdict message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CardTestingVerdict.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CardTestingVerdict message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict} CardTestingVerdict + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CardTestingVerdict.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.v1beta1.FraudPreventionAssessment.CardTestingVerdict(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.risk = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CardTestingVerdict message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict} CardTestingVerdict + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CardTestingVerdict.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CardTestingVerdict message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CardTestingVerdict.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.risk != null && message.hasOwnProperty("risk")) + if (typeof message.risk !== "number") + return "risk: number expected"; + return null; + }; + + /** + * Creates a CardTestingVerdict message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict} CardTestingVerdict + */ + CardTestingVerdict.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict(); + if (object.risk != null) + message.risk = Number(object.risk); + return message; + }; + + /** + * Creates a plain object from a CardTestingVerdict message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict} message CardTestingVerdict + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CardTestingVerdict.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.risk = 0; + if (message.risk != null && message.hasOwnProperty("risk")) + object.risk = options.json && !isFinite(message.risk) ? String(message.risk) : message.risk; + return object; + }; + + /** + * Converts this CardTestingVerdict to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict + * @instance + * @returns {Object.} JSON object + */ + CardTestingVerdict.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CardTestingVerdict + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CardTestingVerdict.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict"; + }; + + return CardTestingVerdict; + })(); + + return FraudPreventionAssessment; + })(); + v1beta1.AccountDefenderAssessment = (function() { /** diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index 0c61272546e..7e1017f82b1 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -69,7 +69,8 @@ "responseType": "Key", "options": { "(google.api.http).post": "/v1/{parent=projects/*}/keys", - "(google.api.http).body": "key" + "(google.api.http).body": "key", + "(google.api.method_signature)": "parent,key" }, "parsedOptions": [ { @@ -77,6 +78,9 @@ "post": "/v1/{parent=projects/*}/keys", "body": "key" } + }, + { + "(google.api.method_signature)": "parent,key" } ] }, @@ -84,13 +88,17 @@ "requestType": "ListKeysRequest", "responseType": "ListKeysResponse", "options": { - "(google.api.http).get": "/v1/{parent=projects/*}/keys" + "(google.api.http).get": "/v1/{parent=projects/*}/keys", + "(google.api.method_signature)": "parent" }, "parsedOptions": [ { "(google.api.http)": { "get": "/v1/{parent=projects/*}/keys" } + }, + { + "(google.api.method_signature)": "parent" } ] }, @@ -116,13 +124,17 @@ "requestType": "GetKeyRequest", "responseType": "Key", "options": { - "(google.api.http).get": "/v1/{name=projects/*/keys/*}" + "(google.api.http).get": "/v1/{name=projects/*/keys/*}", + "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { "get": "/v1/{name=projects/*/keys/*}" } + }, + { + "(google.api.method_signature)": "name" } ] }, @@ -131,7 +143,8 @@ "responseType": "Key", "options": { "(google.api.http).patch": "/v1/{key.name=projects/*/keys/*}", - "(google.api.http).body": "key" + "(google.api.http).body": "key", + "(google.api.method_signature)": "key,update_mask" }, "parsedOptions": [ { @@ -139,6 +152,9 @@ "patch": "/v1/{key.name=projects/*/keys/*}", "body": "key" } + }, + { + "(google.api.method_signature)": "key,update_mask" } ] }, @@ -146,13 +162,17 @@ "requestType": "DeleteKeyRequest", "responseType": "google.protobuf.Empty", "options": { - "(google.api.http).delete": "/v1/{name=projects/*/keys/*}" + "(google.api.http).delete": "/v1/{name=projects/*/keys/*}", + "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { "delete": "/v1/{name=projects/*/keys/*}" } + }, + { + "(google.api.method_signature)": "name" } ] }, @@ -267,6 +287,63 @@ } } }, + "TransactionEvent": { + "fields": { + "eventType": { + "type": "TransactionEventType", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "reason": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "value": { + "type": "double", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "TransactionEventType": { + "values": { + "TRANSACTION_EVENT_TYPE_UNSPECIFIED": 0, + "MERCHANT_APPROVE": 1, + "MERCHANT_DENY": 2, + "MANUAL_REVIEW": 3, + "AUTHORIZATION": 4, + "AUTHORIZATION_DECLINE": 5, + "PAYMENT_CAPTURE": 6, + "PAYMENT_CAPTURE_DECLINE": 7, + "CANCEL": 8, + "CHARGEBACK_INQUIRY": 9, + "CHARGEBACK_ALERT": 10, + "FRAUD_NOTIFICATION": 11, + "CHARGEBACK": 12, + "CHARGEBACK_REPRESENTMENT": 13, + "CHARGEBACK_REVERSE": 14, + "REFUND_REQUEST": 15, + "REFUND_DECLINE": 16, + "REFUND": 17, + "REFUND_REVERSE": 18 + } + } + } + }, "AnnotateAssessmentRequest": { "fields": { "name": { @@ -298,6 +375,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "transactionEvent": { + "type": "TransactionEvent", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -494,6 +578,10 @@ "privatePasswordLeakVerification": { "type": "PrivatePasswordLeakVerification", "id": 8 + }, + "fraudPreventionAssessment": { + "type": "FraudPreventionAssessment", + "id": 11 } } }, @@ -540,6 +628,180 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "transactionData": { + "type": "TransactionData", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TransactionData": { + "oneofs": { + "_transactionId": { + "oneof": [ + "transactionId" + ] + } + }, + "fields": { + "transactionId": { + "type": "string", + "id": 11, + "options": { + "proto3_optional": true + } + }, + "paymentMethod": { + "type": "string", + "id": 1 + }, + "cardBin": { + "type": "string", + "id": 2 + }, + "cardLastFour": { + "type": "string", + "id": 3 + }, + "currencyCode": { + "type": "string", + "id": 4 + }, + "value": { + "type": "double", + "id": 5 + }, + "shippingValue": { + "type": "double", + "id": 12 + }, + "shippingAddress": { + "type": "Address", + "id": 6 + }, + "billingAddress": { + "type": "Address", + "id": 7 + }, + "user": { + "type": "User", + "id": 8 + }, + "merchants": { + "rule": "repeated", + "type": "User", + "id": 13 + }, + "items": { + "rule": "repeated", + "type": "Item", + "id": 14 + }, + "gatewayInfo": { + "type": "GatewayInfo", + "id": 10 + } + }, + "nested": { + "Address": { + "fields": { + "recipient": { + "type": "string", + "id": 1 + }, + "address": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "locality": { + "type": "string", + "id": 3 + }, + "administrativeArea": { + "type": "string", + "id": 4 + }, + "regionCode": { + "type": "string", + "id": 5 + }, + "postalCode": { + "type": "string", + "id": 6 + } + } + }, + "User": { + "fields": { + "accountId": { + "type": "string", + "id": 6 + }, + "creationMs": { + "type": "int64", + "id": 1 + }, + "email": { + "type": "string", + "id": 2 + }, + "emailVerified": { + "type": "bool", + "id": 3 + }, + "phoneNumber": { + "type": "string", + "id": 4 + }, + "phoneVerified": { + "type": "bool", + "id": 5 + } + } + }, + "Item": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "double", + "id": 2 + }, + "quantity": { + "type": "int64", + "id": 3 + }, + "merchantAccountId": { + "type": "string", + "id": 4 + } + } + }, + "GatewayInfo": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "gatewayResponseCode": { + "type": "string", + "id": 2 + }, + "avsResponseCode": { + "type": "string", + "id": 3 + }, + "cvvResponseCode": { + "type": "string", + "id": 4 + } + } } } }, @@ -563,7 +825,9 @@ "UNEXPECTED_ENVIRONMENT": 2, "TOO_MUCH_TRAFFIC": 3, "UNEXPECTED_USAGE_PATTERNS": 4, - "LOW_CONFIDENCE_SCORE": 5 + "LOW_CONFIDENCE_SCORE": 5, + "SUSPECTED_CARDING": 6, + "SUSPECTED_CHARGEBACK": 7 } } } @@ -613,6 +877,40 @@ } } }, + "FraudPreventionAssessment": { + "fields": { + "transactionRisk": { + "type": "float", + "id": 1 + }, + "stolenInstrumentVerdict": { + "type": "StolenInstrumentVerdict", + "id": 2 + }, + "cardTestingVerdict": { + "type": "CardTestingVerdict", + "id": 3 + } + }, + "nested": { + "StolenInstrumentVerdict": { + "fields": { + "risk": { + "type": "float", + "id": 1 + } + } + }, + "CardTestingVerdict": { + "fields": { + "risk": { + "type": "float", + "id": 1 + } + } + } + } + }, "AccountDefenderAssessment": { "fields": { "labels": { @@ -855,7 +1153,10 @@ }, "createTime": { "type": "google.protobuf.Timestamp", - "id": 7 + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "testingOptions": { "type": "TestingOptions", @@ -1277,6 +1578,63 @@ } } }, + "TransactionEvent": { + "fields": { + "eventType": { + "type": "TransactionEventType", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "reason": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "value": { + "type": "double", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "TransactionEventType": { + "values": { + "TRANSACTION_EVENT_TYPE_UNSPECIFIED": 0, + "MERCHANT_APPROVE": 1, + "MERCHANT_DENY": 2, + "MANUAL_REVIEW": 3, + "AUTHORIZATION": 4, + "AUTHORIZATION_DECLINE": 5, + "PAYMENT_CAPTURE": 6, + "PAYMENT_CAPTURE_DECLINE": 7, + "CANCEL": 8, + "CHARGEBACK_INQUIRY": 9, + "CHARGEBACK_ALERT": 10, + "FRAUD_NOTIFICATION": 11, + "CHARGEBACK": 12, + "CHARGEBACK_REPRESENTMENT": 13, + "CHARGEBACK_REVERSE": 14, + "REFUND_REQUEST": 15, + "REFUND_DECLINE": 16, + "REFUND": 17, + "REFUND_REVERSE": 18 + } + } + } + }, "AnnotateAssessmentRequest": { "fields": { "name": { @@ -1308,6 +1666,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "transactionEvent": { + "type": "TransactionEvent", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -1334,12 +1699,17 @@ "CHARGEBACK": 1, "CHARGEBACK_FRAUD": 8, "CHARGEBACK_DISPUTE": 9, + "REFUND": 10, + "REFUND_FRAUD": 11, + "TRANSACTION_ACCEPTED": 12, + "TRANSACTION_DECLINED": 13, "PAYMENT_HEURISTICS": 2, "INITIATED_TWO_FACTOR": 7, "PASSED_TWO_FACTOR": 3, "FAILED_TWO_FACTOR": 4, "CORRECT_PASSWORD": 5, - "INCORRECT_PASSWORD": 6 + "INCORRECT_PASSWORD": 6, + "SOCIAL_SPAM": 14 } } } @@ -1418,6 +1788,10 @@ "accountDefenderAssessment": { "type": "AccountDefenderAssessment", "id": 8 + }, + "fraudPreventionAssessment": { + "type": "FraudPreventionAssessment", + "id": 11 } }, "nested": { @@ -1428,7 +1802,9 @@ "UNEXPECTED_ENVIRONMENT": 2, "TOO_MUCH_TRAFFIC": 3, "UNEXPECTED_USAGE_PATTERNS": 4, - "LOW_CONFIDENCE_SCORE": 5 + "LOW_CONFIDENCE_SCORE": 5, + "SUSPECTED_CARDING": 6, + "SUSPECTED_CHARGEBACK": 7 } } } @@ -1476,6 +1852,180 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "transactionData": { + "type": "TransactionData", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TransactionData": { + "oneofs": { + "_transactionId": { + "oneof": [ + "transactionId" + ] + } + }, + "fields": { + "transactionId": { + "type": "string", + "id": 11, + "options": { + "proto3_optional": true + } + }, + "paymentMethod": { + "type": "string", + "id": 1 + }, + "cardBin": { + "type": "string", + "id": 2 + }, + "cardLastFour": { + "type": "string", + "id": 3 + }, + "currencyCode": { + "type": "string", + "id": 4 + }, + "value": { + "type": "double", + "id": 5 + }, + "shippingValue": { + "type": "double", + "id": 12 + }, + "shippingAddress": { + "type": "Address", + "id": 6 + }, + "billingAddress": { + "type": "Address", + "id": 7 + }, + "user": { + "type": "User", + "id": 8 + }, + "merchants": { + "rule": "repeated", + "type": "User", + "id": 13 + }, + "items": { + "rule": "repeated", + "type": "Item", + "id": 14 + }, + "gatewayInfo": { + "type": "GatewayInfo", + "id": 10 + } + }, + "nested": { + "Address": { + "fields": { + "recipient": { + "type": "string", + "id": 1 + }, + "address": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "locality": { + "type": "string", + "id": 3 + }, + "administrativeArea": { + "type": "string", + "id": 4 + }, + "regionCode": { + "type": "string", + "id": 5 + }, + "postalCode": { + "type": "string", + "id": 6 + } + } + }, + "User": { + "fields": { + "accountId": { + "type": "string", + "id": 6 + }, + "creationMs": { + "type": "int64", + "id": 1 + }, + "email": { + "type": "string", + "id": 2 + }, + "emailVerified": { + "type": "bool", + "id": 3 + }, + "phoneNumber": { + "type": "string", + "id": 4 + }, + "phoneVerified": { + "type": "bool", + "id": 5 + } + } + }, + "Item": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "double", + "id": 2 + }, + "quantity": { + "type": "int64", + "id": 3 + }, + "merchantAccountId": { + "type": "string", + "id": 4 + } + } + }, + "GatewayInfo": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "gatewayResponseCode": { + "type": "string", + "id": 2 + }, + "avsResponseCode": { + "type": "string", + "id": 3 + }, + "cvvResponseCode": { + "type": "string", + "id": 4 + } + } } } }, @@ -1522,6 +2072,40 @@ } } }, + "FraudPreventionAssessment": { + "fields": { + "transactionRisk": { + "type": "float", + "id": 1 + }, + "stolenInstrumentVerdict": { + "type": "StolenInstrumentVerdict", + "id": 2 + }, + "cardTestingVerdict": { + "type": "CardTestingVerdict", + "id": 3 + } + }, + "nested": { + "StolenInstrumentVerdict": { + "fields": { + "risk": { + "type": "float", + "id": 1 + } + } + }, + "CardTestingVerdict": { + "fields": { + "risk": { + "type": "float", + "id": 1 + } + } + } + } + }, "AccountDefenderAssessment": { "fields": { "labels": { 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 e450640214f..2e34be34c34 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 @@ -52,6 +52,11 @@ function main(name) { * using hmac-sha256 with stable secret. */ // const hashedAccountId = 'Buffer.from('string')' + /** + * Optional. If the assessment is part of a payment transaction, provide + * details on payment lifecycle events that occur in the transaction. + */ + // const transactionEvent = {} // Imports the Recaptchaenterprise library const {RecaptchaEnterpriseServiceClient} = require('@google-cloud/recaptcha-enterprise').v1; 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 c476299c3c2..640528dbf91 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 @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "3.3.0", + "version": "3.3.1", "language": "TYPESCRIPT", "apis": [ { @@ -66,7 +66,7 @@ "segments": [ { "start": 25, - "end": 73, + "end": 78, "type": "FULL" } ], @@ -90,6 +90,10 @@ { "name": "hashed_account_id", "type": "TYPE_BYTES" + }, + { + "name": "transaction_event", + "type": ".google.cloud.recaptchaenterprise.v1.TransactionEvent" } ], "resultType": ".google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse", diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js index 52664d53e3c..0dca8116c94 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js @@ -34,23 +34,29 @@ 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 /** - * Optional. Optional unique stable hashed user identifier to apply to the assessment. - * This is an alternative to setting the hashed_account_id in + * Optional. Optional unique stable hashed user identifier to apply to the + * assessment. This is an alternative to setting the hashed_account_id in * CreateAssessment, for example when the account identifier is not yet known * in the initial request. It is recommended that the identifier is hashed * using hmac-sha256 with stable secret. */ // const hashedAccountId = 'Buffer.from('string')' + /** + * Optional. If the assessment is part of a payment transaction, provide + * details on payment lifecycle events that occur in the transaction. + */ + // const transactionEvent = {} // Imports the Recaptchaenterprise library const {RecaptchaEnterpriseServiceV1Beta1Client} = require('@google-cloud/recaptcha-enterprise').v1beta1; diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json index e297828f72b..64a59537a6d 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "3.3.0", + "version": "3.3.1", "language": "TYPESCRIPT", "apis": [ { @@ -66,7 +66,7 @@ "segments": [ { "start": 25, - "end": 72, + "end": 78, "type": "FULL" } ], @@ -90,6 +90,10 @@ { "name": "hashed_account_id", "type": "TYPE_BYTES" + }, + { + "name": "transaction_event", + "type": ".google.cloud.recaptchaenterprise.v1beta1.TransactionEvent" } ], "resultType": ".google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse", 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 639d3906e33..3d87d14f242 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 @@ -495,6 +495,9 @@ export class RecaptchaEnterpriseServiceClient { * CreateAssessment, for example when the account identifier is not yet known * in the initial request. It is recommended that the identifier is hashed * using hmac-sha256 with stable secret. + * @param {google.cloud.recaptchaenterprise.v1.TransactionEvent} [request.transactionEvent] + * Optional. If the assessment is part of a payment transaction, provide + * details on payment lifecycle events that occur in the transaction. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. 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 3323b3888c5..8c2b87bcd93 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 @@ -431,17 +431,21 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * Required. The resource name of the Assessment, in the format * "projects/{project_number}/assessments/{assessment_id}". * @param {google.cloud.recaptchaenterprise.v1beta1.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. Optional unique stable hashed user identifier to apply to the assessment. - * This is an alternative to setting the hashed_account_id in + * Optional. Optional unique stable hashed user identifier to apply to the + * assessment. This is an alternative to setting the hashed_account_id in * CreateAssessment, for example when the account identifier is not yet known * in the initial request. It is recommended that the identifier is hashed * using hmac-sha256 with stable secret. + * @param {google.cloud.recaptchaenterprise.v1beta1.TransactionEvent} [request.transactionEvent] + * Optional. If the assessment is part of a payment transaction, provide + * details on payment lifecycle events that occur in the transaction. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array.