diff --git a/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto b/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto
index 9b60fce..c28fbde 100644
--- a/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto
+++ b/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto
@@ -1,4 +1,4 @@
-// Copyright 2020 Google LLC
+// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -48,7 +48,7 @@ service RecaptchaEnterpriseService {
}
// Annotates a previously created Assessment to provide additional information
- // on whether the event turned out to be authentic or fradulent.
+ // on whether the event turned out to be authentic or fraudulent.
rpc AnnotateAssessment(AnnotateAssessmentRequest) returns (AnnotateAssessmentResponse) {
option (google.api.http) = {
post: "/v1/{name=projects/*/assessments/*}:annotate"
@@ -93,6 +93,28 @@ service RecaptchaEnterpriseService {
delete: "/v1/{name=projects/*/keys/*}"
};
}
+
+ // Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise.
+ // Once a key is migrated, it can be used from either product. SiteVerify
+ // requests are billed as CreateAssessment calls. You must be
+ // authenticated as one of the current owners of the reCAPTCHA Site Key, and
+ // your user must have the reCAPTCHA Enterprise Admin IAM role in the
+ // destination project.
+ rpc MigrateKey(MigrateKeyRequest) returns (Key) {
+ option (google.api.http) = {
+ post: "/v1/{name=projects/*/keys/*}:migrate"
+ body: "*"
+ };
+ }
+
+ // Get some aggregated metrics for a Key. This data can be used to build
+ // dashboards.
+ rpc GetMetrics(GetMetricsRequest) returns (Metrics) {
+ option (google.api.http) = {
+ get: "/v1/{name=projects/*/keys/*/metrics}"
+ };
+ option (google.api.method_signature) = "name";
+ }
}
// The create assessment request message.
@@ -112,7 +134,7 @@ message CreateAssessmentRequest {
// The request message to annotate an Assessment.
message AnnotateAssessmentRequest {
- // Enum that reprensents the types of annotations.
+ // Enum that represents the types of annotations.
enum Annotation {
// Default unspecified type.
ANNOTATION_UNSPECIFIED = 0;
@@ -124,12 +146,47 @@ message AnnotateAssessmentRequest {
FRAUDULENT = 2;
// Provides information that the event was related to a login event in which
- // the user typed the correct password.
- PASSWORD_CORRECT = 3;
+ // the user typed the correct password. Deprecated, prefer indicating
+ // CORRECT_PASSWORD through the reasons field instead.
+ PASSWORD_CORRECT = 3 [deprecated = true];
// Provides information that the event was related to a login event in which
- // the user typed the incorrect password.
- PASSWORD_INCORRECT = 4;
+ // the user typed the incorrect password. Deprecated, prefer indicating
+ // INCORRECT_PASSWORD through the reasons field instead.
+ PASSWORD_INCORRECT = 4 [deprecated = true];
+ }
+
+ // Enum that represents potential reasons for annotating an assessment.
+ enum Reason {
+ // Default unspecified reason.
+ REASON_UNSPECIFIED = 0;
+
+ // Indicates a chargeback for fraud was issued for the transaction
+ // associated with the assessment.
+ CHARGEBACK = 1;
+
+ // 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.
+ PAYMENT_HEURISTICS = 2;
+
+ // Indicates that the user was served a 2FA challenge. An old assessment
+ // with `ENUM_VALUES.INITIATED_TWO_FACTOR` reason that has not been
+ // overwritten with `PASSED_TWO_FACTOR` is treated as an abandoned 2FA flow.
+ // This is equivalent to `FAILED_TWO_FACTOR`.
+ INITIATED_TWO_FACTOR = 7;
+
+ // Indicates that the user passed a 2FA challenge.
+ PASSED_TWO_FACTOR = 3;
+
+ // Indicates that the user failed a 2FA challenge.
+ FAILED_TWO_FACTOR = 4;
+
+ // Indicates the user provided the correct password.
+ CORRECT_PASSWORD = 5;
+
+ // Indicates the user provided an incorrect password.
+ INCORRECT_PASSWORD = 6;
}
// Required. The resource name of the Assessment, in the format
@@ -141,8 +198,13 @@ message AnnotateAssessmentRequest {
}
];
- // Required. The annotation that will be assigned to the Event.
- Annotation annotation = 2 [(google.api.field_behavior) = REQUIRED];
+ // 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.
+ repeated Reason reasons = 3 [(google.api.field_behavior) = OPTIONAL];
}
// Empty response for AnnotateAssessment.
@@ -195,7 +257,6 @@ message Event {
// Risk analysis result for an event.
message RiskAnalysis {
- // LINT.IfChange(classification_reason)
// Reasons contributing to the risk analysis verdict.
enum ClassificationReason {
// Default unspecified type.
@@ -229,7 +290,6 @@ message RiskAnalysis {
}
message TokenProperties {
- // LINT.IfChange
// Enum that represents the types of invalid token reasons.
enum InvalidReason {
// Default unspecified type.
@@ -249,6 +309,10 @@ message TokenProperties {
// The user verification token was not present.
MISSING = 5;
+
+ // A retriable error (such as network failure) occurred on the browser.
+ // Could easily be simulated by an attacker.
+ BROWSER_ERROR = 6;
}
// Whether the provided user response token is valid. When valid = false, the
@@ -333,7 +397,7 @@ message UpdateKeyRequest {
// Required. The key to update.
Key key = 1 [(google.api.field_behavior) = REQUIRED];
- // Optional. The mask to control which field of the key get updated. If the mask is not
+ // Optional. The mask to control which fields of the key get updated. If the mask is not
// present, all fields will be updated.
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL];
}
@@ -350,6 +414,54 @@ message DeleteKeyRequest {
];
}
+// The migrate key request message.
+message MigrateKeyRequest {
+ // Required. The name of the key to be migrated, in the format
+ // "projects/{project}/keys/{key}".
+ string name = 1 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource_reference) = {
+ type: "recaptchaenterprise.googleapis.com/Key"
+ }
+ ];
+}
+
+// The get metrics request message.
+message GetMetricsRequest {
+ // Required. The name of the requested metrics, in the format
+ // "projects/{project}/keys/{key}/metrics".
+ string name = 1 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource_reference) = {
+ type: "recaptchaenterprise.googleapis.com/Metrics"
+ }
+ ];
+}
+
+// Metrics for a single Key.
+message Metrics {
+ option (google.api.resource) = {
+ type: "recaptchaenterprise.googleapis.com/Metrics"
+ pattern: "projects/{project}/keys/{key}/metrics"
+ };
+
+ // Output only. The name of the metrics, in the format
+ // "projects/{project}/keys/{key}/metrics".
+ string name = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // Inclusive start time aligned to a day (UTC).
+ google.protobuf.Timestamp start_time = 1;
+
+ // Metrics will be continuous and in order by dates, and in the granularity
+ // of day. All Key types should have score-based data.
+ repeated ScoreMetrics score_metrics = 2;
+
+ // Metrics will be continuous and in order by dates, and in the granularity
+ // of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+ // challenge-based data.
+ repeated ChallengeMetrics challenge_metrics = 3;
+}
+
// A key used to identify and configure applications (web and/or mobile) that
// use reCAPTCHA Enterprise.
message Key {
@@ -378,12 +490,43 @@ message Key {
IOSKeySettings ios_settings = 5;
}
- // Optional. See
+ // See
// Creating and managing labels.
- map labels = 6 [(google.api.field_behavior) = OPTIONAL];
+ map labels = 6;
// The timestamp corresponding to the creation of this Key.
google.protobuf.Timestamp create_time = 7;
+
+ // Options for user acceptance testing.
+ TestingOptions testing_options = 9;
+}
+
+// Options for user acceptance testing.
+message TestingOptions {
+ // Enum that represents the challenge option for challenge-based (CHECKBOX,
+ // INVISIBLE) testing keys.
+ enum TestingChallenge {
+ // Perform the normal risk analysis and return either nocaptcha or a
+ // challenge depending on risk and trust factors.
+ TESTING_CHALLENGE_UNSPECIFIED = 0;
+
+ // Challenge requests for this key will always return a nocaptcha, which
+ // does not require a solution.
+ NOCAPTCHA = 1;
+
+ // Challenge requests for this key will always return an unsolvable
+ // challenge.
+ UNSOLVABLE_CHALLENGE = 2;
+ }
+
+ // All assessments for this Key will return this score. Must be between 0
+ // (likely not legitimate) and 1 (likely legitimate) inclusive.
+ float testing_score = 1;
+
+ // For challenge-based keys only (CHECKBOX, INVISIBLE), all challenge requests
+ // for this site will return nocaptcha if NOCAPTCHA, or an unsolvable
+ // challenge if CHALLENGE.
+ TestingChallenge testing_challenge = 2;
}
// Settings specific to keys that can be used by websites.
@@ -434,6 +577,7 @@ message WebKeySettings {
repeated string allowed_domains = 1;
// Required. Whether this key can be used on AMP (Accelerated Mobile Pages) websites.
+ // This can only be set for the SCORE integration type.
bool allow_amp_traffic = 2 [(google.api.field_behavior) = REQUIRED];
// Required. Describes how this key is integrated with the website.
@@ -447,6 +591,9 @@ message WebKeySettings {
// Settings specific to keys that can be used by Android apps.
message AndroidKeySettings {
+ // If set to true, it means allowed_package_names will not be enforced.
+ bool allow_all_package_names = 2;
+
// Android package names of apps allowed to use the key.
// Example: 'com.companyname.appname'
repeated string allowed_package_names = 1;
@@ -454,7 +601,48 @@ message AndroidKeySettings {
// Settings specific to keys that can be used by iOS apps.
message IOSKeySettings {
+ // If set to true, it means allowed_bundle_ids will not be enforced.
+ bool allow_all_bundle_ids = 2;
+
// iOS bundle ids of apps allowed to use the key.
// Example: 'com.companyname.productname.appname'
repeated string allowed_bundle_ids = 1;
}
+
+// Score distribution.
+message ScoreDistribution {
+ // Map key is score value multiplied by 100. The scores are discrete values
+ // between [0, 1]. The maximum number of buckets is on order of a few dozen,
+ // but typically much lower (ie. 10).
+ map score_buckets = 1;
+}
+
+// Metrics related to scoring.
+message ScoreMetrics {
+ // Aggregated score metrics for all traffic.
+ ScoreDistribution overall_metrics = 1;
+
+ // Action-based metrics. The map key is the action name which specified by the
+ // site owners at time of the "execute" client-side call.
+ // Populated only for SCORE keys.
+ map action_metrics = 2;
+}
+
+// Metrics related to challenges.
+message ChallengeMetrics {
+ // Count of reCAPTCHA checkboxes or badges rendered. This is mostly equivalent
+ // to a count of pageloads for pages that include reCAPTCHA.
+ int64 pageload_count = 1;
+
+ // Count of nocaptchas (successful verification without a challenge) issued.
+ int64 nocaptcha_count = 2;
+
+ // Count of submitted challenge solutions that were incorrect or otherwise
+ // deemed suspicious such that a subsequent challenge was triggered.
+ int64 failed_count = 3;
+
+ // Count of nocaptchas (successful verification without a challenge) plus
+ // submitted challenge solutions that were correct and resulted in
+ // verification.
+ int64 passed_count = 4;
+}
diff --git a/protos/protos.d.ts b/protos/protos.d.ts
index b4becef..95e5c6b 100644
--- a/protos/protos.d.ts
+++ b/protos/protos.d.ts
@@ -143,6 +143,34 @@ export namespace google {
* @returns Promise
*/
public deleteKey(request: google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest): Promise;
+
+ /**
+ * Calls MigrateKey.
+ * @param request MigrateKeyRequest message or plain object
+ * @param callback Node-style callback called with the error, if any, and Key
+ */
+ public migrateKey(request: google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest, callback: google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.MigrateKeyCallback): void;
+
+ /**
+ * Calls MigrateKey.
+ * @param request MigrateKeyRequest message or plain object
+ * @returns Promise
+ */
+ public migrateKey(request: google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest): Promise;
+
+ /**
+ * Calls GetMetrics.
+ * @param request GetMetricsRequest message or plain object
+ * @param callback Node-style callback called with the error, if any, and Metrics
+ */
+ public getMetrics(request: google.cloud.recaptchaenterprise.v1.IGetMetricsRequest, callback: google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.GetMetricsCallback): void;
+
+ /**
+ * Calls GetMetrics.
+ * @param request GetMetricsRequest message or plain object
+ * @returns Promise
+ */
+ public getMetrics(request: google.cloud.recaptchaenterprise.v1.IGetMetricsRequest): Promise;
}
namespace RecaptchaEnterpriseService {
@@ -195,6 +223,20 @@ export namespace google {
* @param [response] Empty
*/
type DeleteKeyCallback = (error: (Error|null), response?: google.protobuf.Empty) => void;
+
+ /**
+ * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#migrateKey}.
+ * @param error Error, if any
+ * @param [response] Key
+ */
+ type MigrateKeyCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.Key) => void;
+
+ /**
+ * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#getMetrics}.
+ * @param error Error, if any
+ * @param [response] Metrics
+ */
+ type GetMetricsCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.Metrics) => void;
}
/** Properties of a CreateAssessmentRequest. */
@@ -301,6 +343,9 @@ export namespace google {
/** AnnotateAssessmentRequest annotation */
annotation?: (google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation|keyof typeof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation|null);
+
+ /** AnnotateAssessmentRequest reasons */
+ reasons?: (google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason[]|null);
}
/** Represents an AnnotateAssessmentRequest. */
@@ -318,6 +363,9 @@ export namespace google {
/** AnnotateAssessmentRequest annotation. */
public annotation: (google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation|keyof typeof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation);
+ /** AnnotateAssessmentRequest reasons. */
+ public reasons: google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason[];
+
/**
* Creates a new AnnotateAssessmentRequest instance using the specified properties.
* @param [properties] Properties to set
@@ -399,6 +447,18 @@ export namespace google {
PASSWORD_CORRECT = 3,
PASSWORD_INCORRECT = 4
}
+
+ /** Reason enum. */
+ enum Reason {
+ REASON_UNSPECIFIED = 0,
+ CHARGEBACK = 1,
+ PAYMENT_HEURISTICS = 2,
+ INITIATED_TWO_FACTOR = 7,
+ PASSED_TWO_FACTOR = 3,
+ FAILED_TWO_FACTOR = 4,
+ CORRECT_PASSWORD = 5,
+ INCORRECT_PASSWORD = 6
+ }
}
/** Properties of an AnnotateAssessmentResponse. */
@@ -939,7 +999,8 @@ export namespace google {
MALFORMED = 2,
EXPIRED = 3,
DUPE = 4,
- MISSING = 5
+ MISSING = 5,
+ BROWSER_ERROR = 6
}
}
@@ -1513,6 +1574,294 @@ export namespace google {
public toJSON(): { [k: string]: any };
}
+ /** Properties of a MigrateKeyRequest. */
+ interface IMigrateKeyRequest {
+
+ /** MigrateKeyRequest name */
+ name?: (string|null);
+ }
+
+ /** Represents a MigrateKeyRequest. */
+ class MigrateKeyRequest implements IMigrateKeyRequest {
+
+ /**
+ * Constructs a new MigrateKeyRequest.
+ * @param [properties] Properties to set
+ */
+ constructor(properties?: google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest);
+
+ /** MigrateKeyRequest name. */
+ public name: string;
+
+ /**
+ * Creates a new MigrateKeyRequest instance using the specified properties.
+ * @param [properties] Properties to set
+ * @returns MigrateKeyRequest instance
+ */
+ public static create(properties?: google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest): google.cloud.recaptchaenterprise.v1.MigrateKeyRequest;
+
+ /**
+ * Encodes the specified MigrateKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.MigrateKeyRequest.verify|verify} messages.
+ * @param message MigrateKeyRequest message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encode(message: google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Encodes the specified MigrateKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.MigrateKeyRequest.verify|verify} messages.
+ * @param message MigrateKeyRequest message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Decodes a MigrateKeyRequest message from the specified reader or buffer.
+ * @param reader Reader or buffer to decode from
+ * @param [length] Message length if known beforehand
+ * @returns MigrateKeyRequest
+ * @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.MigrateKeyRequest;
+
+ /**
+ * Decodes a MigrateKeyRequest message from the specified reader or buffer, length delimited.
+ * @param reader Reader or buffer to decode from
+ * @returns MigrateKeyRequest
+ * @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.MigrateKeyRequest;
+
+ /**
+ * Verifies a MigrateKeyRequest 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 MigrateKeyRequest message from a plain object. Also converts values to their respective internal types.
+ * @param object Plain object
+ * @returns MigrateKeyRequest
+ */
+ public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.MigrateKeyRequest;
+
+ /**
+ * Creates a plain object from a MigrateKeyRequest message. Also converts values to other types if specified.
+ * @param message MigrateKeyRequest
+ * @param [options] Conversion options
+ * @returns Plain object
+ */
+ public static toObject(message: google.cloud.recaptchaenterprise.v1.MigrateKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any };
+
+ /**
+ * Converts this MigrateKeyRequest to JSON.
+ * @returns JSON object
+ */
+ public toJSON(): { [k: string]: any };
+ }
+
+ /** Properties of a GetMetricsRequest. */
+ interface IGetMetricsRequest {
+
+ /** GetMetricsRequest name */
+ name?: (string|null);
+ }
+
+ /** Represents a GetMetricsRequest. */
+ class GetMetricsRequest implements IGetMetricsRequest {
+
+ /**
+ * Constructs a new GetMetricsRequest.
+ * @param [properties] Properties to set
+ */
+ constructor(properties?: google.cloud.recaptchaenterprise.v1.IGetMetricsRequest);
+
+ /** GetMetricsRequest name. */
+ public name: string;
+
+ /**
+ * Creates a new GetMetricsRequest instance using the specified properties.
+ * @param [properties] Properties to set
+ * @returns GetMetricsRequest instance
+ */
+ public static create(properties?: google.cloud.recaptchaenterprise.v1.IGetMetricsRequest): google.cloud.recaptchaenterprise.v1.GetMetricsRequest;
+
+ /**
+ * Encodes the specified GetMetricsRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.GetMetricsRequest.verify|verify} messages.
+ * @param message GetMetricsRequest message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encode(message: google.cloud.recaptchaenterprise.v1.IGetMetricsRequest, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Encodes the specified GetMetricsRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.GetMetricsRequest.verify|verify} messages.
+ * @param message GetMetricsRequest message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IGetMetricsRequest, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Decodes a GetMetricsRequest message from the specified reader or buffer.
+ * @param reader Reader or buffer to decode from
+ * @param [length] Message length if known beforehand
+ * @returns GetMetricsRequest
+ * @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.GetMetricsRequest;
+
+ /**
+ * Decodes a GetMetricsRequest message from the specified reader or buffer, length delimited.
+ * @param reader Reader or buffer to decode from
+ * @returns GetMetricsRequest
+ * @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.GetMetricsRequest;
+
+ /**
+ * Verifies a GetMetricsRequest 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 GetMetricsRequest message from a plain object. Also converts values to their respective internal types.
+ * @param object Plain object
+ * @returns GetMetricsRequest
+ */
+ public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.GetMetricsRequest;
+
+ /**
+ * Creates a plain object from a GetMetricsRequest message. Also converts values to other types if specified.
+ * @param message GetMetricsRequest
+ * @param [options] Conversion options
+ * @returns Plain object
+ */
+ public static toObject(message: google.cloud.recaptchaenterprise.v1.GetMetricsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any };
+
+ /**
+ * Converts this GetMetricsRequest to JSON.
+ * @returns JSON object
+ */
+ public toJSON(): { [k: string]: any };
+ }
+
+ /** Properties of a Metrics. */
+ interface IMetrics {
+
+ /** Metrics name */
+ name?: (string|null);
+
+ /** Metrics startTime */
+ startTime?: (google.protobuf.ITimestamp|null);
+
+ /** Metrics scoreMetrics */
+ scoreMetrics?: (google.cloud.recaptchaenterprise.v1.IScoreMetrics[]|null);
+
+ /** Metrics challengeMetrics */
+ challengeMetrics?: (google.cloud.recaptchaenterprise.v1.IChallengeMetrics[]|null);
+ }
+
+ /** Represents a Metrics. */
+ class Metrics implements IMetrics {
+
+ /**
+ * Constructs a new Metrics.
+ * @param [properties] Properties to set
+ */
+ constructor(properties?: google.cloud.recaptchaenterprise.v1.IMetrics);
+
+ /** Metrics name. */
+ public name: string;
+
+ /** Metrics startTime. */
+ public startTime?: (google.protobuf.ITimestamp|null);
+
+ /** Metrics scoreMetrics. */
+ public scoreMetrics: google.cloud.recaptchaenterprise.v1.IScoreMetrics[];
+
+ /** Metrics challengeMetrics. */
+ public challengeMetrics: google.cloud.recaptchaenterprise.v1.IChallengeMetrics[];
+
+ /**
+ * Creates a new Metrics instance using the specified properties.
+ * @param [properties] Properties to set
+ * @returns Metrics instance
+ */
+ public static create(properties?: google.cloud.recaptchaenterprise.v1.IMetrics): google.cloud.recaptchaenterprise.v1.Metrics;
+
+ /**
+ * Encodes the specified Metrics message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Metrics.verify|verify} messages.
+ * @param message Metrics message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encode(message: google.cloud.recaptchaenterprise.v1.IMetrics, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Encodes the specified Metrics message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Metrics.verify|verify} messages.
+ * @param message Metrics message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IMetrics, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Decodes a Metrics message from the specified reader or buffer.
+ * @param reader Reader or buffer to decode from
+ * @param [length] Message length if known beforehand
+ * @returns Metrics
+ * @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.Metrics;
+
+ /**
+ * Decodes a Metrics message from the specified reader or buffer, length delimited.
+ * @param reader Reader or buffer to decode from
+ * @returns Metrics
+ * @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.Metrics;
+
+ /**
+ * Verifies a Metrics 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 Metrics message from a plain object. Also converts values to their respective internal types.
+ * @param object Plain object
+ * @returns Metrics
+ */
+ public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.Metrics;
+
+ /**
+ * Creates a plain object from a Metrics message. Also converts values to other types if specified.
+ * @param message Metrics
+ * @param [options] Conversion options
+ * @returns Plain object
+ */
+ public static toObject(message: google.cloud.recaptchaenterprise.v1.Metrics, options?: $protobuf.IConversionOptions): { [k: string]: any };
+
+ /**
+ * Converts this Metrics to JSON.
+ * @returns JSON object
+ */
+ public toJSON(): { [k: string]: any };
+ }
+
/** Properties of a Key. */
interface IKey {
@@ -1536,6 +1885,9 @@ export namespace google {
/** Key createTime */
createTime?: (google.protobuf.ITimestamp|null);
+
+ /** Key testingOptions */
+ testingOptions?: (google.cloud.recaptchaenterprise.v1.ITestingOptions|null);
}
/** Represents a Key. */
@@ -1568,6 +1920,9 @@ export namespace google {
/** Key createTime. */
public createTime?: (google.protobuf.ITimestamp|null);
+ /** Key testingOptions. */
+ public testingOptions?: (google.cloud.recaptchaenterprise.v1.ITestingOptions|null);
+
/** Key platformSettings. */
public platformSettings?: ("webSettings"|"androidSettings"|"iosSettings");
@@ -1642,6 +1997,112 @@ export namespace google {
public toJSON(): { [k: string]: any };
}
+ /** Properties of a TestingOptions. */
+ interface ITestingOptions {
+
+ /** TestingOptions testingScore */
+ testingScore?: (number|null);
+
+ /** TestingOptions testingChallenge */
+ testingChallenge?: (google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge|keyof typeof google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge|null);
+ }
+
+ /** Represents a TestingOptions. */
+ class TestingOptions implements ITestingOptions {
+
+ /**
+ * Constructs a new TestingOptions.
+ * @param [properties] Properties to set
+ */
+ constructor(properties?: google.cloud.recaptchaenterprise.v1.ITestingOptions);
+
+ /** TestingOptions testingScore. */
+ public testingScore: number;
+
+ /** TestingOptions testingChallenge. */
+ public testingChallenge: (google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge|keyof typeof google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge);
+
+ /**
+ * Creates a new TestingOptions instance using the specified properties.
+ * @param [properties] Properties to set
+ * @returns TestingOptions instance
+ */
+ public static create(properties?: google.cloud.recaptchaenterprise.v1.ITestingOptions): google.cloud.recaptchaenterprise.v1.TestingOptions;
+
+ /**
+ * Encodes the specified TestingOptions message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TestingOptions.verify|verify} messages.
+ * @param message TestingOptions message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encode(message: google.cloud.recaptchaenterprise.v1.ITestingOptions, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Encodes the specified TestingOptions message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TestingOptions.verify|verify} messages.
+ * @param message TestingOptions message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.ITestingOptions, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Decodes a TestingOptions message from the specified reader or buffer.
+ * @param reader Reader or buffer to decode from
+ * @param [length] Message length if known beforehand
+ * @returns TestingOptions
+ * @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.TestingOptions;
+
+ /**
+ * Decodes a TestingOptions message from the specified reader or buffer, length delimited.
+ * @param reader Reader or buffer to decode from
+ * @returns TestingOptions
+ * @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.TestingOptions;
+
+ /**
+ * Verifies a TestingOptions 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 TestingOptions message from a plain object. Also converts values to their respective internal types.
+ * @param object Plain object
+ * @returns TestingOptions
+ */
+ public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.TestingOptions;
+
+ /**
+ * Creates a plain object from a TestingOptions message. Also converts values to other types if specified.
+ * @param message TestingOptions
+ * @param [options] Conversion options
+ * @returns Plain object
+ */
+ public static toObject(message: google.cloud.recaptchaenterprise.v1.TestingOptions, options?: $protobuf.IConversionOptions): { [k: string]: any };
+
+ /**
+ * Converts this TestingOptions to JSON.
+ * @returns JSON object
+ */
+ public toJSON(): { [k: string]: any };
+ }
+
+ namespace TestingOptions {
+
+ /** TestingChallenge enum. */
+ enum TestingChallenge {
+ TESTING_CHALLENGE_UNSPECIFIED = 0,
+ NOCAPTCHA = 1,
+ UNSOLVABLE_CHALLENGE = 2
+ }
+ }
+
/** Properties of a WebKeySettings. */
interface IWebKeySettings {
@@ -1778,6 +2239,9 @@ export namespace google {
/** Properties of an AndroidKeySettings. */
interface IAndroidKeySettings {
+ /** AndroidKeySettings allowAllPackageNames */
+ allowAllPackageNames?: (boolean|null);
+
/** AndroidKeySettings allowedPackageNames */
allowedPackageNames?: (string[]|null);
}
@@ -1791,6 +2255,9 @@ export namespace google {
*/
constructor(properties?: google.cloud.recaptchaenterprise.v1.IAndroidKeySettings);
+ /** AndroidKeySettings allowAllPackageNames. */
+ public allowAllPackageNames: boolean;
+
/** AndroidKeySettings allowedPackageNames. */
public allowedPackageNames: string[];
@@ -1868,6 +2335,9 @@ export namespace google {
/** Properties of a IOSKeySettings. */
interface IIOSKeySettings {
+ /** IOSKeySettings allowAllBundleIds */
+ allowAllBundleIds?: (boolean|null);
+
/** IOSKeySettings allowedBundleIds */
allowedBundleIds?: (string[]|null);
}
@@ -1881,6 +2351,9 @@ export namespace google {
*/
constructor(properties?: google.cloud.recaptchaenterprise.v1.IIOSKeySettings);
+ /** IOSKeySettings allowAllBundleIds. */
+ public allowAllBundleIds: boolean;
+
/** IOSKeySettings allowedBundleIds. */
public allowedBundleIds: string[];
@@ -1954,6 +2427,300 @@ export namespace google {
*/
public toJSON(): { [k: string]: any };
}
+
+ /** Properties of a ScoreDistribution. */
+ interface IScoreDistribution {
+
+ /** ScoreDistribution scoreBuckets */
+ scoreBuckets?: ({ [k: string]: (number|Long|string) }|null);
+ }
+
+ /** Represents a ScoreDistribution. */
+ class ScoreDistribution implements IScoreDistribution {
+
+ /**
+ * Constructs a new ScoreDistribution.
+ * @param [properties] Properties to set
+ */
+ constructor(properties?: google.cloud.recaptchaenterprise.v1.IScoreDistribution);
+
+ /** ScoreDistribution scoreBuckets. */
+ public scoreBuckets: { [k: string]: (number|Long|string) };
+
+ /**
+ * Creates a new ScoreDistribution instance using the specified properties.
+ * @param [properties] Properties to set
+ * @returns ScoreDistribution instance
+ */
+ public static create(properties?: google.cloud.recaptchaenterprise.v1.IScoreDistribution): google.cloud.recaptchaenterprise.v1.ScoreDistribution;
+
+ /**
+ * Encodes the specified ScoreDistribution message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ScoreDistribution.verify|verify} messages.
+ * @param message ScoreDistribution message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encode(message: google.cloud.recaptchaenterprise.v1.IScoreDistribution, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Encodes the specified ScoreDistribution message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ScoreDistribution.verify|verify} messages.
+ * @param message ScoreDistribution message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IScoreDistribution, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Decodes a ScoreDistribution message from the specified reader or buffer.
+ * @param reader Reader or buffer to decode from
+ * @param [length] Message length if known beforehand
+ * @returns ScoreDistribution
+ * @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.ScoreDistribution;
+
+ /**
+ * Decodes a ScoreDistribution message from the specified reader or buffer, length delimited.
+ * @param reader Reader or buffer to decode from
+ * @returns ScoreDistribution
+ * @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.ScoreDistribution;
+
+ /**
+ * Verifies a ScoreDistribution 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 ScoreDistribution message from a plain object. Also converts values to their respective internal types.
+ * @param object Plain object
+ * @returns ScoreDistribution
+ */
+ public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.ScoreDistribution;
+
+ /**
+ * Creates a plain object from a ScoreDistribution message. Also converts values to other types if specified.
+ * @param message ScoreDistribution
+ * @param [options] Conversion options
+ * @returns Plain object
+ */
+ public static toObject(message: google.cloud.recaptchaenterprise.v1.ScoreDistribution, options?: $protobuf.IConversionOptions): { [k: string]: any };
+
+ /**
+ * Converts this ScoreDistribution to JSON.
+ * @returns JSON object
+ */
+ public toJSON(): { [k: string]: any };
+ }
+
+ /** Properties of a ScoreMetrics. */
+ interface IScoreMetrics {
+
+ /** ScoreMetrics overallMetrics */
+ overallMetrics?: (google.cloud.recaptchaenterprise.v1.IScoreDistribution|null);
+
+ /** ScoreMetrics actionMetrics */
+ actionMetrics?: ({ [k: string]: google.cloud.recaptchaenterprise.v1.IScoreDistribution }|null);
+ }
+
+ /** Represents a ScoreMetrics. */
+ class ScoreMetrics implements IScoreMetrics {
+
+ /**
+ * Constructs a new ScoreMetrics.
+ * @param [properties] Properties to set
+ */
+ constructor(properties?: google.cloud.recaptchaenterprise.v1.IScoreMetrics);
+
+ /** ScoreMetrics overallMetrics. */
+ public overallMetrics?: (google.cloud.recaptchaenterprise.v1.IScoreDistribution|null);
+
+ /** ScoreMetrics actionMetrics. */
+ public actionMetrics: { [k: string]: google.cloud.recaptchaenterprise.v1.IScoreDistribution };
+
+ /**
+ * Creates a new ScoreMetrics instance using the specified properties.
+ * @param [properties] Properties to set
+ * @returns ScoreMetrics instance
+ */
+ public static create(properties?: google.cloud.recaptchaenterprise.v1.IScoreMetrics): google.cloud.recaptchaenterprise.v1.ScoreMetrics;
+
+ /**
+ * Encodes the specified ScoreMetrics message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ScoreMetrics.verify|verify} messages.
+ * @param message ScoreMetrics message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encode(message: google.cloud.recaptchaenterprise.v1.IScoreMetrics, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Encodes the specified ScoreMetrics message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ScoreMetrics.verify|verify} messages.
+ * @param message ScoreMetrics message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IScoreMetrics, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Decodes a ScoreMetrics message from the specified reader or buffer.
+ * @param reader Reader or buffer to decode from
+ * @param [length] Message length if known beforehand
+ * @returns ScoreMetrics
+ * @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.ScoreMetrics;
+
+ /**
+ * Decodes a ScoreMetrics message from the specified reader or buffer, length delimited.
+ * @param reader Reader or buffer to decode from
+ * @returns ScoreMetrics
+ * @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.ScoreMetrics;
+
+ /**
+ * Verifies a ScoreMetrics 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 ScoreMetrics message from a plain object. Also converts values to their respective internal types.
+ * @param object Plain object
+ * @returns ScoreMetrics
+ */
+ public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.ScoreMetrics;
+
+ /**
+ * Creates a plain object from a ScoreMetrics message. Also converts values to other types if specified.
+ * @param message ScoreMetrics
+ * @param [options] Conversion options
+ * @returns Plain object
+ */
+ public static toObject(message: google.cloud.recaptchaenterprise.v1.ScoreMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any };
+
+ /**
+ * Converts this ScoreMetrics to JSON.
+ * @returns JSON object
+ */
+ public toJSON(): { [k: string]: any };
+ }
+
+ /** Properties of a ChallengeMetrics. */
+ interface IChallengeMetrics {
+
+ /** ChallengeMetrics pageloadCount */
+ pageloadCount?: (number|Long|string|null);
+
+ /** ChallengeMetrics nocaptchaCount */
+ nocaptchaCount?: (number|Long|string|null);
+
+ /** ChallengeMetrics failedCount */
+ failedCount?: (number|Long|string|null);
+
+ /** ChallengeMetrics passedCount */
+ passedCount?: (number|Long|string|null);
+ }
+
+ /** Represents a ChallengeMetrics. */
+ class ChallengeMetrics implements IChallengeMetrics {
+
+ /**
+ * Constructs a new ChallengeMetrics.
+ * @param [properties] Properties to set
+ */
+ constructor(properties?: google.cloud.recaptchaenterprise.v1.IChallengeMetrics);
+
+ /** ChallengeMetrics pageloadCount. */
+ public pageloadCount: (number|Long|string);
+
+ /** ChallengeMetrics nocaptchaCount. */
+ public nocaptchaCount: (number|Long|string);
+
+ /** ChallengeMetrics failedCount. */
+ public failedCount: (number|Long|string);
+
+ /** ChallengeMetrics passedCount. */
+ public passedCount: (number|Long|string);
+
+ /**
+ * Creates a new ChallengeMetrics instance using the specified properties.
+ * @param [properties] Properties to set
+ * @returns ChallengeMetrics instance
+ */
+ public static create(properties?: google.cloud.recaptchaenterprise.v1.IChallengeMetrics): google.cloud.recaptchaenterprise.v1.ChallengeMetrics;
+
+ /**
+ * Encodes the specified ChallengeMetrics message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ChallengeMetrics.verify|verify} messages.
+ * @param message ChallengeMetrics message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encode(message: google.cloud.recaptchaenterprise.v1.IChallengeMetrics, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Encodes the specified ChallengeMetrics message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ChallengeMetrics.verify|verify} messages.
+ * @param message ChallengeMetrics message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IChallengeMetrics, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Decodes a ChallengeMetrics message from the specified reader or buffer.
+ * @param reader Reader or buffer to decode from
+ * @param [length] Message length if known beforehand
+ * @returns ChallengeMetrics
+ * @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.ChallengeMetrics;
+
+ /**
+ * Decodes a ChallengeMetrics message from the specified reader or buffer, length delimited.
+ * @param reader Reader or buffer to decode from
+ * @returns ChallengeMetrics
+ * @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.ChallengeMetrics;
+
+ /**
+ * Verifies a ChallengeMetrics 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 ChallengeMetrics message from a plain object. Also converts values to their respective internal types.
+ * @param object Plain object
+ * @returns ChallengeMetrics
+ */
+ public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.ChallengeMetrics;
+
+ /**
+ * Creates a plain object from a ChallengeMetrics message. Also converts values to other types if specified.
+ * @param message ChallengeMetrics
+ * @param [options] Conversion options
+ * @returns Plain object
+ */
+ public static toObject(message: google.cloud.recaptchaenterprise.v1.ChallengeMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any };
+
+ /**
+ * Converts this ChallengeMetrics to JSON.
+ * @returns JSON object
+ */
+ public toJSON(): { [k: string]: any };
+ }
}
/** Namespace v1beta1. */
diff --git a/protos/protos.js b/protos/protos.js
index 85a4d4c..c667be1 100644
--- a/protos/protos.js
+++ b/protos/protos.js
@@ -329,6 +329,72 @@
* @variation 2
*/
+ /**
+ * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#migrateKey}.
+ * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService
+ * @typedef MigrateKeyCallback
+ * @type {function}
+ * @param {Error|null} error Error, if any
+ * @param {google.cloud.recaptchaenterprise.v1.Key} [response] Key
+ */
+
+ /**
+ * Calls MigrateKey.
+ * @function migrateKey
+ * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService
+ * @instance
+ * @param {google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest} request MigrateKeyRequest message or plain object
+ * @param {google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.MigrateKeyCallback} callback Node-style callback called with the error, if any, and Key
+ * @returns {undefined}
+ * @variation 1
+ */
+ Object.defineProperty(RecaptchaEnterpriseService.prototype.migrateKey = function migrateKey(request, callback) {
+ return this.rpcCall(migrateKey, $root.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest, $root.google.cloud.recaptchaenterprise.v1.Key, request, callback);
+ }, "name", { value: "MigrateKey" });
+
+ /**
+ * Calls MigrateKey.
+ * @function migrateKey
+ * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService
+ * @instance
+ * @param {google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest} request MigrateKeyRequest message or plain object
+ * @returns {Promise} Promise
+ * @variation 2
+ */
+
+ /**
+ * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#getMetrics}.
+ * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService
+ * @typedef GetMetricsCallback
+ * @type {function}
+ * @param {Error|null} error Error, if any
+ * @param {google.cloud.recaptchaenterprise.v1.Metrics} [response] Metrics
+ */
+
+ /**
+ * Calls GetMetrics.
+ * @function getMetrics
+ * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService
+ * @instance
+ * @param {google.cloud.recaptchaenterprise.v1.IGetMetricsRequest} request GetMetricsRequest message or plain object
+ * @param {google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.GetMetricsCallback} callback Node-style callback called with the error, if any, and Metrics
+ * @returns {undefined}
+ * @variation 1
+ */
+ Object.defineProperty(RecaptchaEnterpriseService.prototype.getMetrics = function getMetrics(request, callback) {
+ return this.rpcCall(getMetrics, $root.google.cloud.recaptchaenterprise.v1.GetMetricsRequest, $root.google.cloud.recaptchaenterprise.v1.Metrics, request, callback);
+ }, "name", { value: "GetMetrics" });
+
+ /**
+ * Calls GetMetrics.
+ * @function getMetrics
+ * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService
+ * @instance
+ * @param {google.cloud.recaptchaenterprise.v1.IGetMetricsRequest} request GetMetricsRequest message or plain object
+ * @returns {Promise} Promise
+ * @variation 2
+ */
+
return RecaptchaEnterpriseService;
})();
@@ -555,6 +621,7 @@
* @interface IAnnotateAssessmentRequest
* @property {string|null} [name] AnnotateAssessmentRequest name
* @property {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation|null} [annotation] AnnotateAssessmentRequest annotation
+ * @property {Array.|null} [reasons] AnnotateAssessmentRequest reasons
*/
/**
@@ -566,6 +633,7 @@
* @param {google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest=} [properties] Properties to set
*/
function AnnotateAssessmentRequest(properties) {
+ this.reasons = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
@@ -588,6 +656,14 @@
*/
AnnotateAssessmentRequest.prototype.annotation = 0;
+ /**
+ * AnnotateAssessmentRequest reasons.
+ * @member {Array.} reasons
+ * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest
+ * @instance
+ */
+ AnnotateAssessmentRequest.prototype.reasons = $util.emptyArray;
+
/**
* Creates a new AnnotateAssessmentRequest instance using the specified properties.
* @function create
@@ -616,6 +692,12 @@
writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
if (message.annotation != null && Object.hasOwnProperty.call(message, "annotation"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.annotation);
+ if (message.reasons != null && message.reasons.length) {
+ writer.uint32(/* id 3, wireType 2 =*/26).fork();
+ for (var i = 0; i < message.reasons.length; ++i)
+ writer.int32(message.reasons[i]);
+ writer.ldelim();
+ }
return writer;
};
@@ -656,6 +738,16 @@
case 2:
message.annotation = reader.int32();
break;
+ case 3:
+ 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:
reader.skipType(tag & 7);
break;
@@ -705,6 +797,24 @@
case 4:
break;
}
+ 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 7:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ break;
+ }
+ }
return null;
};
@@ -744,6 +854,47 @@
message.annotation = 4;
break;
}
+ if (object.reasons) {
+ if (!Array.isArray(object.reasons))
+ throw TypeError(".google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.reasons: array expected");
+ message.reasons = [];
+ for (var i = 0; i < object.reasons.length; ++i)
+ switch (object.reasons[i]) {
+ default:
+ case "REASON_UNSPECIFIED":
+ case 0:
+ message.reasons[i] = 0;
+ break;
+ case "CHARGEBACK":
+ case 1:
+ message.reasons[i] = 1;
+ break;
+ case "PAYMENT_HEURISTICS":
+ case 2:
+ message.reasons[i] = 2;
+ break;
+ case "INITIATED_TWO_FACTOR":
+ case 7:
+ message.reasons[i] = 7;
+ break;
+ case "PASSED_TWO_FACTOR":
+ case 3:
+ message.reasons[i] = 3;
+ break;
+ case "FAILED_TWO_FACTOR":
+ case 4:
+ message.reasons[i] = 4;
+ break;
+ case "CORRECT_PASSWORD":
+ case 5:
+ message.reasons[i] = 5;
+ break;
+ case "INCORRECT_PASSWORD":
+ case 6:
+ message.reasons[i] = 6;
+ break;
+ }
+ }
return message;
};
@@ -760,6 +911,8 @@
if (!options)
options = {};
var object = {};
+ if (options.arrays || options.defaults)
+ object.reasons = [];
if (options.defaults) {
object.name = "";
object.annotation = options.enums === String ? "ANNOTATION_UNSPECIFIED" : 0;
@@ -768,6 +921,11 @@
object.name = message.name;
if (message.annotation != null && message.hasOwnProperty("annotation"))
object.annotation = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation[message.annotation] : message.annotation;
+ 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.AnnotateAssessmentRequest.Reason[message.reasons[j]] : message.reasons[j];
+ }
return object;
};
@@ -802,6 +960,32 @@
return values;
})();
+ /**
+ * Reason enum.
+ * @name google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason
+ * @enum {number}
+ * @property {number} REASON_UNSPECIFIED=0 REASON_UNSPECIFIED value
+ * @property {number} CHARGEBACK=1 CHARGEBACK 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
+ */
+ AnnotateAssessmentRequest.Reason = (function() {
+ var valuesById = {}, values = Object.create(valuesById);
+ values[valuesById[0] = "REASON_UNSPECIFIED"] = 0;
+ values[valuesById[1] = "CHARGEBACK"] = 1;
+ 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;
+ return values;
+ })();
+
return AnnotateAssessmentRequest;
})();
@@ -2000,6 +2184,7 @@
case 3:
case 4:
case 5:
+ case 6:
break;
}
if (message.createTime != null && message.hasOwnProperty("createTime")) {
@@ -2055,6 +2240,10 @@
case 5:
message.invalidReason = 5;
break;
+ case "BROWSER_ERROR":
+ case 6:
+ message.invalidReason = 6;
+ break;
}
if (object.createTime != null) {
if (typeof object.createTime !== "object")
@@ -2122,6 +2311,7 @@
* @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
*/
TokenProperties.InvalidReason = (function() {
var valuesById = {}, values = Object.create(valuesById);
@@ -2131,6 +2321,7 @@
values[valuesById[3] = "EXPIRED"] = 3;
values[valuesById[4] = "DUPE"] = 4;
values[valuesById[5] = "MISSING"] = 5;
+ values[valuesById[6] = "BROWSER_ERROR"] = 6;
return values;
})();
@@ -3409,31 +3600,24 @@
return DeleteKeyRequest;
})();
- v1.Key = (function() {
+ v1.MigrateKeyRequest = (function() {
/**
- * Properties of a Key.
+ * Properties of a MigrateKeyRequest.
* @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
+ * @interface IMigrateKeyRequest
+ * @property {string|null} [name] MigrateKeyRequest name
*/
/**
- * Constructs a new Key.
+ * Constructs a new MigrateKeyRequest.
* @memberof google.cloud.recaptchaenterprise.v1
- * @classdesc Represents a Key.
- * @implements IKey
+ * @classdesc Represents a MigrateKeyRequest.
+ * @implements IMigrateKeyRequest
* @constructor
- * @param {google.cloud.recaptchaenterprise.v1.IKey=} [properties] Properties to set
+ * @param {google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest=} [properties] Properties to set
*/
- function Key(properties) {
- this.labels = {};
+ function MigrateKeyRequest(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
@@ -3441,190 +3625,78 @@
}
/**
- * Key name.
+ * MigrateKeyRequest 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
- * @instance
- */
- Key.prototype.createTime = 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
+ * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest
* @instance
*/
- Object.defineProperty(Key.prototype, "platformSettings", {
- get: $util.oneOfGetter($oneOfFields = ["webSettings", "androidSettings", "iosSettings"]),
- set: $util.oneOfSetter($oneOfFields)
- });
+ MigrateKeyRequest.prototype.name = "";
/**
- * Creates a new Key instance using the specified properties.
+ * Creates a new MigrateKeyRequest instance using the specified properties.
* @function create
- * @memberof google.cloud.recaptchaenterprise.v1.Key
+ * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest
* @static
- * @param {google.cloud.recaptchaenterprise.v1.IKey=} [properties] Properties to set
- * @returns {google.cloud.recaptchaenterprise.v1.Key} Key instance
+ * @param {google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest=} [properties] Properties to set
+ * @returns {google.cloud.recaptchaenterprise.v1.MigrateKeyRequest} MigrateKeyRequest instance
*/
- Key.create = function create(properties) {
- return new Key(properties);
+ MigrateKeyRequest.create = function create(properties) {
+ return new MigrateKeyRequest(properties);
};
/**
- * Encodes the specified Key message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Key.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.Key
+ * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest
* @static
- * @param {google.cloud.recaptchaenterprise.v1.IKey} message Key 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
*/
- Key.encode = function encode(message, writer) {
+ MigrateKeyRequest.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.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();
return writer;
};
/**
- * Encodes the specified Key message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Key.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.Key
+ * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest
* @static
- * @param {google.cloud.recaptchaenterprise.v1.IKey} message Key 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
*/
- Key.encodeDelimited = function encodeDelimited(message, writer) {
+ MigrateKeyRequest.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
- * Decodes a Key message from the specified reader or buffer.
+ * Decodes a MigrateKeyRequest message from the specified reader or buffer.
* @function decode
- * @memberof google.cloud.recaptchaenterprise.v1.Key
+ * @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.Key} Key
+ * @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
*/
- Key.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.Key(), key, value;
+ 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 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;
- break;
- case 7:
- message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
- break;
- default:
- reader.skipType(tag & 7);
+ default:
+ reader.skipType(tag & 7);
break;
}
}
@@ -3632,216 +3704,107 @@
};
/**
- * Decodes a Key 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.Key
+ * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @returns {google.cloud.recaptchaenterprise.v1.Key} Key
+ * @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
*/
- Key.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 Key message.
+ * Verifies a MigrateKeyRequest message.
* @function verify
- * @memberof google.cloud.recaptchaenterprise.v1.Key
+ * @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
*/
- Key.verify = function verify(message) {
+ MigrateKeyRequest.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.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;
- }
return null;
};
/**
- * Creates a Key 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.Key
+ * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest
* @static
* @param {Object.} object Plain object
- * @returns {google.cloud.recaptchaenterprise.v1.Key} Key
+ * @returns {google.cloud.recaptchaenterprise.v1.MigrateKeyRequest} MigrateKeyRequest
*/
- Key.fromObject = function fromObject(object) {
- if (object instanceof $root.google.cloud.recaptchaenterprise.v1.Key)
+ MigrateKeyRequest.fromObject = function fromObject(object) {
+ if (object instanceof $root.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest)
return object;
- var message = new $root.google.cloud.recaptchaenterprise.v1.Key();
+ var message = new $root.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest();
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);
- }
return message;
};
/**
- * Creates a plain object from a Key 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.Key
+ * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest
* @static
- * @param {google.cloud.recaptchaenterprise.v1.Key} message Key
+ * @param {google.cloud.recaptchaenterprise.v1.MigrateKeyRequest} message MigrateKeyRequest
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.} Plain object
*/
- Key.toObject = function toObject(message, options) {
+ MigrateKeyRequest.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
- if (options.objects || options.defaults)
- object.labels = {};
- if (options.defaults) {
+ if (options.defaults)
object.name = "";
- object.displayName = "";
- object.createTime = 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);
return object;
};
/**
- * Converts this Key to JSON.
+ * Converts this MigrateKeyRequest to JSON.
* @function toJSON
- * @memberof google.cloud.recaptchaenterprise.v1.Key
+ * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest
* @instance
* @returns {Object.} JSON object
*/
- Key.prototype.toJSON = function toJSON() {
+ MigrateKeyRequest.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
- return Key;
+ return MigrateKeyRequest;
})();
- v1.WebKeySettings = (function() {
+ v1.GetMetricsRequest = (function() {
/**
- * Properties of a WebKeySettings.
+ * Properties of a GetMetricsRequest.
* @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 IGetMetricsRequest
+ * @property {string|null} [name] GetMetricsRequest name
*/
/**
- * Constructs a new WebKeySettings.
+ * Constructs a new GetMetricsRequest.
* @memberof google.cloud.recaptchaenterprise.v1
- * @classdesc Represents a WebKeySettings.
- * @implements IWebKeySettings
+ * @classdesc Represents a GetMetricsRequest.
+ * @implements IGetMetricsRequest
* @constructor
- * @param {google.cloud.recaptchaenterprise.v1.IWebKeySettings=} [properties] Properties to set
+ * @param {google.cloud.recaptchaenterprise.v1.IGetMetricsRequest=} [properties] Properties to set
*/
- function WebKeySettings(properties) {
- this.allowedDomains = [];
+ function GetMetricsRequest(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
@@ -3849,130 +3812,75 @@
}
/**
- * 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
+ * GetMetricsRequest name.
+ * @member {string} name
+ * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest
* @instance
*/
- WebKeySettings.prototype.challengeSecurityPreference = 0;
+ GetMetricsRequest.prototype.name = "";
/**
- * Creates a new WebKeySettings instance using the specified properties.
+ * Creates a new GetMetricsRequest instance using the specified properties.
* @function create
- * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest
* @static
- * @param {google.cloud.recaptchaenterprise.v1.IWebKeySettings=} [properties] Properties to set
- * @returns {google.cloud.recaptchaenterprise.v1.WebKeySettings} WebKeySettings instance
+ * @param {google.cloud.recaptchaenterprise.v1.IGetMetricsRequest=} [properties] Properties to set
+ * @returns {google.cloud.recaptchaenterprise.v1.GetMetricsRequest} GetMetricsRequest instance
*/
- WebKeySettings.create = function create(properties) {
- return new WebKeySettings(properties);
+ GetMetricsRequest.create = function create(properties) {
+ return new GetMetricsRequest(properties);
};
/**
- * Encodes the specified WebKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.WebKeySettings.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.WebKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest
* @static
- * @param {google.cloud.recaptchaenterprise.v1.IWebKeySettings} message WebKeySettings 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
*/
- WebKeySettings.encode = function encode(message, writer) {
+ GetMetricsRequest.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);
return writer;
};
/**
- * Encodes the specified WebKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.WebKeySettings.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.WebKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest
* @static
- * @param {google.cloud.recaptchaenterprise.v1.IWebKeySettings} message WebKeySettings 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
*/
- WebKeySettings.encodeDelimited = function encodeDelimited(message, writer) {
+ GetMetricsRequest.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
- * Decodes a WebKeySettings message from the specified reader or buffer.
+ * Decodes a GetMetricsRequest message from the specified reader or buffer.
* @function decode
- * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings
+ * @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.WebKeySettings} WebKeySettings
+ * @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
*/
- WebKeySettings.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.WebKeySettings();
+ 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 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();
+ message.name = reader.string();
break;
default:
reader.skipType(tag & 7);
@@ -3983,236 +3891,2155 @@
};
/**
- * Decodes a WebKeySettings 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.WebKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @returns {google.cloud.recaptchaenterprise.v1.WebKeySettings} WebKeySettings
+ * @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
*/
- WebKeySettings.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 WebKeySettings message.
+ * Verifies a GetMetricsRequest message.
* @function verify
- * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings
+ * @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
*/
- WebKeySettings.verify = function verify(message) {
+ GetMetricsRequest.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:
+ if (message.name != null && message.hasOwnProperty("name"))
+ if (!$util.isString(message.name))
+ return "name: string expected";
+ return null;
+ };
+
+ /**
+ * Creates a GetMetricsRequest message from a plain object. Also converts values to their respective internal types.
+ * @function fromObject
+ * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest
+ * @static
+ * @param {Object.} object Plain object
+ * @returns {google.cloud.recaptchaenterprise.v1.GetMetricsRequest} GetMetricsRequest
+ */
+ GetMetricsRequest.fromObject = function fromObject(object) {
+ if (object instanceof $root.google.cloud.recaptchaenterprise.v1.GetMetricsRequest)
+ return object;
+ 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 GetMetricsRequest message. Also converts values to other types if specified.
+ * @function toObject
+ * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest
+ * @static
+ * @param {google.cloud.recaptchaenterprise.v1.GetMetricsRequest} message GetMetricsRequest
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
+ * @returns {Object.} Plain object
+ */
+ GetMetricsRequest.toObject = function toObject(message, options) {
+ if (!options)
+ options = {};
+ var object = {};
+ if (options.defaults)
+ object.name = "";
+ if (message.name != null && message.hasOwnProperty("name"))
+ object.name = message.name;
+ return object;
+ };
+
+ /**
+ * Converts this GetMetricsRequest to JSON.
+ * @function toJSON
+ * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest
+ * @instance
+ * @returns {Object.} JSON object
+ */
+ GetMetricsRequest.prototype.toJSON = function toJSON() {
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+ };
+
+ return GetMetricsRequest;
+ })();
+
+ v1.Metrics = (function() {
+
+ /**
+ * Properties of a Metrics.
+ * @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
+ */
+
+ /**
+ * Constructs a new Metrics.
+ * @memberof google.cloud.recaptchaenterprise.v1
+ * @classdesc Represents a Metrics.
+ * @implements IMetrics
+ * @constructor
+ * @param {google.cloud.recaptchaenterprise.v1.IMetrics=} [properties] Properties to set
+ */
+ 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)
+ this[keys[i]] = properties[keys[i]];
+ }
+
+ /**
+ * Metrics 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
+ * @instance
+ */
+ Metrics.prototype.scoreMetrics = $util.emptyArray;
+
+ /**
+ * Metrics challengeMetrics.
+ * @member {Array.} challengeMetrics
+ * @memberof google.cloud.recaptchaenterprise.v1.Metrics
+ * @instance
+ */
+ Metrics.prototype.challengeMetrics = $util.emptyArray;
+
+ /**
+ * Creates a new Metrics instance using the specified properties.
+ * @function create
+ * @memberof google.cloud.recaptchaenterprise.v1.Metrics
+ * @static
+ * @param {google.cloud.recaptchaenterprise.v1.IMetrics=} [properties] Properties to set
+ * @returns {google.cloud.recaptchaenterprise.v1.Metrics} Metrics instance
+ */
+ Metrics.create = function create(properties) {
+ return new Metrics(properties);
+ };
+
+ /**
+ * Encodes the specified Metrics message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Metrics.verify|verify} messages.
+ * @function encode
+ * @memberof google.cloud.recaptchaenterprise.v1.Metrics
+ * @static
+ * @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
+ */
+ 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 4, wireType 2 =*/34).string(message.name);
+ return writer;
+ };
+
+ /**
+ * 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.Metrics
+ * @static
+ * @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
+ */
+ Metrics.encodeDelimited = function encodeDelimited(message, writer) {
+ return this.encode(message, writer).ldelim();
+ };
+
+ /**
+ * Decodes a Metrics message from the specified reader or buffer.
+ * @function decode
+ * @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.Metrics} Metrics
+ * @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) {
+ 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();
+ 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());
+ 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()));
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:
+ reader.skipType(tag & 7);
break;
}
+ }
+ return message;
+ };
+
+ /**
+ * Decodes a Metrics message from the specified reader or buffer, length delimited.
+ * @function decodeDelimited
+ * @memberof google.cloud.recaptchaenterprise.v1.Metrics
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @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
+ */
+ Metrics.decodeDelimited = function decodeDelimited(reader) {
+ if (!(reader instanceof $Reader))
+ reader = new $Reader(reader);
+ return this.decode(reader, reader.uint32());
+ };
+
+ /**
+ * Verifies a Metrics message.
+ * @function verify
+ * @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
+ */
+ Metrics.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;
+ }
+ }
return null;
};
/**
- * Creates a WebKeySettings 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.WebKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.Metrics
* @static
* @param {Object.} object Plain object
- * @returns {google.cloud.recaptchaenterprise.v1.WebKeySettings} WebKeySettings
+ * @returns {google.cloud.recaptchaenterprise.v1.Metrics} Metrics
*/
- WebKeySettings.fromObject = function fromObject(object) {
- if (object instanceof $root.google.cloud.recaptchaenterprise.v1.WebKeySettings)
+ Metrics.fromObject = function fromObject(object) {
+ if (object instanceof $root.google.cloud.recaptchaenterprise.v1.Metrics)
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]);
+ var message = new $root.google.cloud.recaptchaenterprise.v1.Metrics();
+ 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.allowAmpTraffic != null)
- message.allowAmpTraffic = Boolean(object.allowAmpTraffic);
- switch (object.integrationType) {
- case "INTEGRATION_TYPE_UNSPECIFIED":
- case 0:
- message.integrationType = 0;
- break;
- case "SCORE":
- case 1:
- message.integrationType = 1;
- break;
- case "CHECKBOX":
- case 2:
- message.integrationType = 2;
- break;
- case "INVISIBLE":
- case 3:
- message.integrationType = 3;
- break;
+ 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]);
+ }
}
- switch (object.challengeSecurityPreference) {
- case "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED":
- case 0:
- message.challengeSecurityPreference = 0;
- break;
- case "USABILITY":
- case 1:
- message.challengeSecurityPreference = 1;
- break;
- case "BALANCE":
- case 2:
- message.challengeSecurityPreference = 2;
- break;
- case "SECURITY":
- case 3:
- message.challengeSecurityPreference = 3;
- break;
+ 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 WebKeySettings 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.WebKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.Metrics
* @static
- * @param {google.cloud.recaptchaenterprise.v1.WebKeySettings} message WebKeySettings
+ * @param {google.cloud.recaptchaenterprise.v1.Metrics} message Metrics
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.} Plain object
*/
- WebKeySettings.toObject = function toObject(message, options) {
+ Metrics.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
- if (options.arrays || options.defaults)
- object.allowedDomains = [];
+ if (options.arrays || options.defaults) {
+ object.scoreMetrics = [];
+ object.challengeMetrics = [];
+ }
if (options.defaults) {
- object.allowAmpTraffic = false;
- object.allowAllDomains = false;
- object.integrationType = options.enums === String ? "INTEGRATION_TYPE_UNSPECIFIED" : 0;
- object.challengeSecurityPreference = options.enums === String ? "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED" : 0;
+ object.startTime = null;
+ object.name = "";
}
- if (message.allowedDomains && message.allowedDomains.length) {
- object.allowedDomains = [];
- for (var j = 0; j < message.allowedDomains.length; ++j)
- object.allowedDomains[j] = message.allowedDomains[j];
+ 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);
+ }
+ if (message.name != null && message.hasOwnProperty("name"))
+ object.name = message.name;
+ return object;
+ };
+
+ /**
+ * Converts this Metrics to JSON.
+ * @function toJSON
+ * @memberof google.cloud.recaptchaenterprise.v1.Metrics
+ * @instance
+ * @returns {Object.} JSON object
+ */
+ Metrics.prototype.toJSON = function toJSON() {
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+ };
+
+ return Metrics;
+ })();
+
+ v1.Key = (function() {
+
+ /**
+ * Properties of a Key.
+ * @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
+ */
+
+ /**
+ * Constructs a new Key.
+ * @memberof google.cloud.recaptchaenterprise.v1
+ * @classdesc Represents a Key.
+ * @implements IKey
+ * @constructor
+ * @param {google.cloud.recaptchaenterprise.v1.IKey=} [properties] Properties to set
+ */
+ function Key(properties) {
+ this.labels = {};
+ 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]];
+ }
+
+ /**
+ * Key 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
+ * @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;
+
+ // 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
+ */
+ Key.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.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();
+ return writer;
+ };
+
+ /**
+ * 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.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
+ */
+ Key.encodeDelimited = function encodeDelimited(message, writer) {
+ return this.encode(message, writer).ldelim();
+ };
+
+ /**
+ * Decodes a Key message from the specified reader or buffer.
+ * @function decode
+ * @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.Key} Key
+ * @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) {
+ 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;
+ 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;
+ 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;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Decodes a Key message from the specified reader or buffer, length delimited.
+ * @function decodeDelimited
+ * @memberof google.cloud.recaptchaenterprise.v1.Key
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @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
+ */
+ Key.decodeDelimited = function decodeDelimited(reader) {
+ if (!(reader instanceof $Reader))
+ reader = new $Reader(reader);
+ return this.decode(reader, reader.uint32());
+ };
+
+ /**
+ * Verifies a Key message.
+ * @function verify
+ * @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
+ */
+ Key.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.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;
+ }
+ 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);
+ }
+ 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;
+ }
+ 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);
+ 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);
+ };
+
+ 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) {
+ 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] : 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);
+ };
+
+ /**
+ * 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) {
+ case "INTEGRATION_TYPE_UNSPECIFIED":
+ case 0:
+ message.integrationType = 0;
+ break;
+ case "SCORE":
+ case 1:
+ message.integrationType = 1;
+ break;
+ case "CHECKBOX":
+ case 2:
+ message.integrationType = 2;
+ break;
+ case "INVISIBLE":
+ case 3:
+ message.integrationType = 3;
+ break;
+ }
+ switch (object.challengeSecurityPreference) {
+ case "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED":
+ case 0:
+ message.challengeSecurityPreference = 0;
+ break;
+ case "USABILITY":
+ case 1:
+ message.challengeSecurityPreference = 1;
+ break;
+ case "BALANCE":
+ case 2:
+ message.challengeSecurityPreference = 2;
+ break;
+ case "SECURITY":
+ case 3:
+ message.challengeSecurityPreference = 3;
+ break;
+ }
+ return message;
+ };
+
+ /**
+ * Creates a plain object from a WebKeySettings message. Also converts values to other types if specified.
+ * @function toObject
+ * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings
+ * @static
+ * @param {google.cloud.recaptchaenterprise.v1.WebKeySettings} message WebKeySettings
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
+ * @returns {Object.} Plain object
+ */
+ WebKeySettings.toObject = function toObject(message, options) {
+ if (!options)
+ options = {};
+ var object = {};
+ if (options.arrays || options.defaults)
+ object.allowedDomains = [];
+ if (options.defaults) {
+ object.allowAmpTraffic = false;
+ object.allowAllDomains = false;
+ object.integrationType = options.enums === String ? "INTEGRATION_TYPE_UNSPECIFIED" : 0;
+ object.challengeSecurityPreference = options.enums === String ? "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED" : 0;
+ }
+ if (message.allowedDomains && message.allowedDomains.length) {
+ object.allowedDomains = [];
+ for (var j = 0; j < message.allowedDomains.length; ++j)
+ object.allowedDomains[j] = message.allowedDomains[j];
+ }
+ if (message.allowAmpTraffic != null && message.hasOwnProperty("allowAmpTraffic"))
+ object.allowAmpTraffic = message.allowAmpTraffic;
+ if (message.allowAllDomains != null && message.hasOwnProperty("allowAllDomains"))
+ object.allowAllDomains = message.allowAllDomains;
+ if (message.integrationType != null && message.hasOwnProperty("integrationType"))
+ object.integrationType = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType[message.integrationType] : message.integrationType;
+ if (message.challengeSecurityPreference != null && message.hasOwnProperty("challengeSecurityPreference"))
+ object.challengeSecurityPreference = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference[message.challengeSecurityPreference] : message.challengeSecurityPreference;
+ return object;
+ };
+
+ /**
+ * Converts this WebKeySettings to JSON.
+ * @function toJSON
+ * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings
+ * @instance
+ * @returns {Object.} JSON object
+ */
+ WebKeySettings.prototype.toJSON = function toJSON() {
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+ };
+
+ /**
+ * IntegrationType enum.
+ * @name google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType
+ * @enum {number}
+ * @property {number} INTEGRATION_TYPE_UNSPECIFIED=0 INTEGRATION_TYPE_UNSPECIFIED value
+ * @property {number} SCORE=1 SCORE value
+ * @property {number} CHECKBOX=2 CHECKBOX value
+ * @property {number} INVISIBLE=3 INVISIBLE value
+ */
+ WebKeySettings.IntegrationType = (function() {
+ var valuesById = {}, values = Object.create(valuesById);
+ values[valuesById[0] = "INTEGRATION_TYPE_UNSPECIFIED"] = 0;
+ values[valuesById[1] = "SCORE"] = 1;
+ values[valuesById[2] = "CHECKBOX"] = 2;
+ values[valuesById[3] = "INVISIBLE"] = 3;
+ return values;
+ })();
+
+ /**
+ * ChallengeSecurityPreference enum.
+ * @name google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference
+ * @enum {number}
+ * @property {number} CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED=0 CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED value
+ * @property {number} USABILITY=1 USABILITY value
+ * @property {number} BALANCE=2 BALANCE value
+ * @property {number} SECURITY=3 SECURITY value
+ */
+ WebKeySettings.ChallengeSecurityPreference = (function() {
+ var valuesById = {}, values = Object.create(valuesById);
+ values[valuesById[0] = "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED"] = 0;
+ values[valuesById[1] = "USABILITY"] = 1;
+ values[valuesById[2] = "BALANCE"] = 2;
+ values[valuesById[3] = "SECURITY"] = 3;
+ return values;
+ })();
+
+ return WebKeySettings;
+ })();
+
+ v1.AndroidKeySettings = (function() {
+
+ /**
+ * Properties of an AndroidKeySettings.
+ * @memberof google.cloud.recaptchaenterprise.v1
+ * @interface IAndroidKeySettings
+ * @property {boolean|null} [allowAllPackageNames] AndroidKeySettings allowAllPackageNames
+ * @property {Array.|null} [allowedPackageNames] AndroidKeySettings allowedPackageNames
+ */
+
+ /**
+ * Constructs a new AndroidKeySettings.
+ * @memberof google.cloud.recaptchaenterprise.v1
+ * @classdesc Represents an AndroidKeySettings.
+ * @implements IAndroidKeySettings
+ * @constructor
+ * @param {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings=} [properties] Properties to set
+ */
+ function AndroidKeySettings(properties) {
+ this.allowedPackageNames = [];
+ 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]];
+ }
+
+ /**
+ * AndroidKeySettings allowAllPackageNames.
+ * @member {boolean} allowAllPackageNames
+ * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings
+ * @instance
+ */
+ AndroidKeySettings.prototype.allowAllPackageNames = false;
+
+ /**
+ * AndroidKeySettings allowedPackageNames.
+ * @member {Array.} allowedPackageNames
+ * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings
+ * @instance
+ */
+ AndroidKeySettings.prototype.allowedPackageNames = $util.emptyArray;
+
+ /**
+ * Creates a new AndroidKeySettings instance using the specified properties.
+ * @function create
+ * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings
+ * @static
+ * @param {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings=} [properties] Properties to set
+ * @returns {google.cloud.recaptchaenterprise.v1.AndroidKeySettings} AndroidKeySettings instance
+ */
+ AndroidKeySettings.create = function create(properties) {
+ return new AndroidKeySettings(properties);
+ };
+
+ /**
+ * Encodes the specified AndroidKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AndroidKeySettings.verify|verify} messages.
+ * @function encode
+ * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings
+ * @static
+ * @param {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings} message AndroidKeySettings message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ AndroidKeySettings.encode = function encode(message, writer) {
+ if (!writer)
+ writer = $Writer.create();
+ if (message.allowedPackageNames != null && message.allowedPackageNames.length)
+ for (var i = 0; i < message.allowedPackageNames.length; ++i)
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedPackageNames[i]);
+ if (message.allowAllPackageNames != null && Object.hasOwnProperty.call(message, "allowAllPackageNames"))
+ writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAllPackageNames);
+ return writer;
+ };
+
+ /**
+ * Encodes the specified AndroidKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AndroidKeySettings.verify|verify} messages.
+ * @function encodeDelimited
+ * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings
+ * @static
+ * @param {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings} message AndroidKeySettings message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ AndroidKeySettings.encodeDelimited = function encodeDelimited(message, writer) {
+ return this.encode(message, writer).ldelim();
+ };
+
+ /**
+ * Decodes an AndroidKeySettings message from the specified reader or buffer.
+ * @function decode
+ * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings
+ * @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.AndroidKeySettings} AndroidKeySettings
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ AndroidKeySettings.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.AndroidKeySettings();
+ while (reader.pos < end) {
+ var tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 2:
+ message.allowAllPackageNames = reader.bool();
+ break;
+ case 1:
+ if (!(message.allowedPackageNames && message.allowedPackageNames.length))
+ message.allowedPackageNames = [];
+ message.allowedPackageNames.push(reader.string());
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Decodes an AndroidKeySettings message from the specified reader or buffer, length delimited.
+ * @function decodeDelimited
+ * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @returns {google.cloud.recaptchaenterprise.v1.AndroidKeySettings} AndroidKeySettings
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ AndroidKeySettings.decodeDelimited = function decodeDelimited(reader) {
+ if (!(reader instanceof $Reader))
+ reader = new $Reader(reader);
+ return this.decode(reader, reader.uint32());
+ };
+
+ /**
+ * Verifies an AndroidKeySettings message.
+ * @function verify
+ * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings
+ * @static
+ * @param {Object.} message Plain object to verify
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
+ */
+ AndroidKeySettings.verify = function verify(message) {
+ if (typeof message !== "object" || message === null)
+ return "object expected";
+ if (message.allowAllPackageNames != null && message.hasOwnProperty("allowAllPackageNames"))
+ if (typeof message.allowAllPackageNames !== "boolean")
+ return "allowAllPackageNames: boolean expected";
+ if (message.allowedPackageNames != null && message.hasOwnProperty("allowedPackageNames")) {
+ if (!Array.isArray(message.allowedPackageNames))
+ return "allowedPackageNames: array expected";
+ for (var i = 0; i < message.allowedPackageNames.length; ++i)
+ if (!$util.isString(message.allowedPackageNames[i]))
+ return "allowedPackageNames: string[] expected";
+ }
+ return null;
+ };
+
+ /**
+ * Creates an AndroidKeySettings message from a plain object. Also converts values to their respective internal types.
+ * @function fromObject
+ * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings
+ * @static
+ * @param {Object.} object Plain object
+ * @returns {google.cloud.recaptchaenterprise.v1.AndroidKeySettings} AndroidKeySettings
+ */
+ AndroidKeySettings.fromObject = function fromObject(object) {
+ if (object instanceof $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings)
+ return object;
+ var message = new $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings();
+ if (object.allowAllPackageNames != null)
+ message.allowAllPackageNames = Boolean(object.allowAllPackageNames);
+ if (object.allowedPackageNames) {
+ if (!Array.isArray(object.allowedPackageNames))
+ throw TypeError(".google.cloud.recaptchaenterprise.v1.AndroidKeySettings.allowedPackageNames: array expected");
+ message.allowedPackageNames = [];
+ for (var i = 0; i < object.allowedPackageNames.length; ++i)
+ message.allowedPackageNames[i] = String(object.allowedPackageNames[i]);
+ }
+ return message;
+ };
+
+ /**
+ * Creates a plain object from an AndroidKeySettings message. Also converts values to other types if specified.
+ * @function toObject
+ * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings
+ * @static
+ * @param {google.cloud.recaptchaenterprise.v1.AndroidKeySettings} message AndroidKeySettings
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
+ * @returns {Object.} Plain object
+ */
+ AndroidKeySettings.toObject = function toObject(message, options) {
+ if (!options)
+ options = {};
+ var object = {};
+ if (options.arrays || options.defaults)
+ object.allowedPackageNames = [];
+ if (options.defaults)
+ object.allowAllPackageNames = false;
+ if (message.allowedPackageNames && message.allowedPackageNames.length) {
+ object.allowedPackageNames = [];
+ for (var j = 0; j < message.allowedPackageNames.length; ++j)
+ object.allowedPackageNames[j] = message.allowedPackageNames[j];
+ }
+ if (message.allowAllPackageNames != null && message.hasOwnProperty("allowAllPackageNames"))
+ object.allowAllPackageNames = message.allowAllPackageNames;
+ return object;
+ };
+
+ /**
+ * Converts this AndroidKeySettings to JSON.
+ * @function toJSON
+ * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings
+ * @instance
+ * @returns {Object.} JSON object
+ */
+ AndroidKeySettings.prototype.toJSON = function toJSON() {
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+ };
+
+ return AndroidKeySettings;
+ })();
+
+ v1.IOSKeySettings = (function() {
+
+ /**
+ * Properties of a IOSKeySettings.
+ * @memberof google.cloud.recaptchaenterprise.v1
+ * @interface IIOSKeySettings
+ * @property {boolean|null} [allowAllBundleIds] IOSKeySettings allowAllBundleIds
+ * @property {Array.|null} [allowedBundleIds] IOSKeySettings allowedBundleIds
+ */
+
+ /**
+ * Constructs a new IOSKeySettings.
+ * @memberof google.cloud.recaptchaenterprise.v1
+ * @classdesc Represents a IOSKeySettings.
+ * @implements IIOSKeySettings
+ * @constructor
+ * @param {google.cloud.recaptchaenterprise.v1.IIOSKeySettings=} [properties] Properties to set
+ */
+ function IOSKeySettings(properties) {
+ this.allowedBundleIds = [];
+ 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]];
+ }
+
+ /**
+ * IOSKeySettings allowAllBundleIds.
+ * @member {boolean} allowAllBundleIds
+ * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings
+ * @instance
+ */
+ IOSKeySettings.prototype.allowAllBundleIds = false;
+
+ /**
+ * IOSKeySettings allowedBundleIds.
+ * @member {Array.} allowedBundleIds
+ * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings
+ * @instance
+ */
+ IOSKeySettings.prototype.allowedBundleIds = $util.emptyArray;
+
+ /**
+ * Creates a new IOSKeySettings instance using the specified properties.
+ * @function create
+ * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings
+ * @static
+ * @param {google.cloud.recaptchaenterprise.v1.IIOSKeySettings=} [properties] Properties to set
+ * @returns {google.cloud.recaptchaenterprise.v1.IOSKeySettings} IOSKeySettings instance
+ */
+ IOSKeySettings.create = function create(properties) {
+ return new IOSKeySettings(properties);
+ };
+
+ /**
+ * Encodes the specified IOSKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.IOSKeySettings.verify|verify} messages.
+ * @function encode
+ * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings
+ * @static
+ * @param {google.cloud.recaptchaenterprise.v1.IIOSKeySettings} message IOSKeySettings message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ IOSKeySettings.encode = function encode(message, writer) {
+ if (!writer)
+ writer = $Writer.create();
+ if (message.allowedBundleIds != null && message.allowedBundleIds.length)
+ for (var i = 0; i < message.allowedBundleIds.length; ++i)
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedBundleIds[i]);
+ if (message.allowAllBundleIds != null && Object.hasOwnProperty.call(message, "allowAllBundleIds"))
+ writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAllBundleIds);
+ return writer;
+ };
+
+ /**
+ * Encodes the specified IOSKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.IOSKeySettings.verify|verify} messages.
+ * @function encodeDelimited
+ * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings
+ * @static
+ * @param {google.cloud.recaptchaenterprise.v1.IIOSKeySettings} message IOSKeySettings message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ IOSKeySettings.encodeDelimited = function encodeDelimited(message, writer) {
+ return this.encode(message, writer).ldelim();
+ };
+
+ /**
+ * Decodes a IOSKeySettings message from the specified reader or buffer.
+ * @function decode
+ * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings
+ * @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.IOSKeySettings} IOSKeySettings
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ IOSKeySettings.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.IOSKeySettings();
+ while (reader.pos < end) {
+ var tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 2:
+ message.allowAllBundleIds = reader.bool();
+ break;
+ case 1:
+ if (!(message.allowedBundleIds && message.allowedBundleIds.length))
+ message.allowedBundleIds = [];
+ message.allowedBundleIds.push(reader.string());
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Decodes a IOSKeySettings message from the specified reader or buffer, length delimited.
+ * @function decodeDelimited
+ * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @returns {google.cloud.recaptchaenterprise.v1.IOSKeySettings} IOSKeySettings
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ IOSKeySettings.decodeDelimited = function decodeDelimited(reader) {
+ if (!(reader instanceof $Reader))
+ reader = new $Reader(reader);
+ return this.decode(reader, reader.uint32());
+ };
+
+ /**
+ * Verifies a IOSKeySettings message.
+ * @function verify
+ * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings
+ * @static
+ * @param {Object.} message Plain object to verify
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
+ */
+ IOSKeySettings.verify = function verify(message) {
+ if (typeof message !== "object" || message === null)
+ return "object expected";
+ if (message.allowAllBundleIds != null && message.hasOwnProperty("allowAllBundleIds"))
+ if (typeof message.allowAllBundleIds !== "boolean")
+ return "allowAllBundleIds: boolean expected";
+ if (message.allowedBundleIds != null && message.hasOwnProperty("allowedBundleIds")) {
+ if (!Array.isArray(message.allowedBundleIds))
+ return "allowedBundleIds: array expected";
+ for (var i = 0; i < message.allowedBundleIds.length; ++i)
+ if (!$util.isString(message.allowedBundleIds[i]))
+ return "allowedBundleIds: string[] expected";
+ }
+ return null;
+ };
+
+ /**
+ * Creates a IOSKeySettings message from a plain object. Also converts values to their respective internal types.
+ * @function fromObject
+ * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings
+ * @static
+ * @param {Object.} object Plain object
+ * @returns {google.cloud.recaptchaenterprise.v1.IOSKeySettings} IOSKeySettings
+ */
+ IOSKeySettings.fromObject = function fromObject(object) {
+ if (object instanceof $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings)
+ return object;
+ var message = new $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings();
+ if (object.allowAllBundleIds != null)
+ message.allowAllBundleIds = Boolean(object.allowAllBundleIds);
+ if (object.allowedBundleIds) {
+ if (!Array.isArray(object.allowedBundleIds))
+ throw TypeError(".google.cloud.recaptchaenterprise.v1.IOSKeySettings.allowedBundleIds: array expected");
+ message.allowedBundleIds = [];
+ for (var i = 0; i < object.allowedBundleIds.length; ++i)
+ message.allowedBundleIds[i] = String(object.allowedBundleIds[i]);
+ }
+ return message;
+ };
+
+ /**
+ * Creates a plain object from a IOSKeySettings message. Also converts values to other types if specified.
+ * @function toObject
+ * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings
+ * @static
+ * @param {google.cloud.recaptchaenterprise.v1.IOSKeySettings} message IOSKeySettings
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
+ * @returns {Object.} Plain object
+ */
+ IOSKeySettings.toObject = function toObject(message, options) {
+ if (!options)
+ options = {};
+ var object = {};
+ if (options.arrays || options.defaults)
+ object.allowedBundleIds = [];
+ if (options.defaults)
+ object.allowAllBundleIds = false;
+ if (message.allowedBundleIds && message.allowedBundleIds.length) {
+ object.allowedBundleIds = [];
+ for (var j = 0; j < message.allowedBundleIds.length; ++j)
+ object.allowedBundleIds[j] = message.allowedBundleIds[j];
+ }
+ if (message.allowAllBundleIds != null && message.hasOwnProperty("allowAllBundleIds"))
+ object.allowAllBundleIds = message.allowAllBundleIds;
+ return object;
+ };
+
+ /**
+ * Converts this IOSKeySettings to JSON.
+ * @function toJSON
+ * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings
+ * @instance
+ * @returns {Object.} JSON object
+ */
+ IOSKeySettings.prototype.toJSON = function toJSON() {
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+ };
+
+ return IOSKeySettings;
+ })();
+
+ v1.ScoreDistribution = (function() {
+
+ /**
+ * Properties of a ScoreDistribution.
+ * @memberof google.cloud.recaptchaenterprise.v1
+ * @interface IScoreDistribution
+ * @property {Object.|null} [scoreBuckets] ScoreDistribution scoreBuckets
+ */
+
+ /**
+ * Constructs a new ScoreDistribution.
+ * @memberof google.cloud.recaptchaenterprise.v1
+ * @classdesc Represents a ScoreDistribution.
+ * @implements IScoreDistribution
+ * @constructor
+ * @param {google.cloud.recaptchaenterprise.v1.IScoreDistribution=} [properties] Properties to set
+ */
+ function ScoreDistribution(properties) {
+ this.scoreBuckets = {};
+ 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]];
+ }
+
+ /**
+ * ScoreDistribution scoreBuckets.
+ * @member {Object.} scoreBuckets
+ * @memberof google.cloud.recaptchaenterprise.v1.ScoreDistribution
+ * @instance
+ */
+ ScoreDistribution.prototype.scoreBuckets = $util.emptyObject;
+
+ /**
+ * Creates a new ScoreDistribution instance using the specified properties.
+ * @function create
+ * @memberof google.cloud.recaptchaenterprise.v1.ScoreDistribution
+ * @static
+ * @param {google.cloud.recaptchaenterprise.v1.IScoreDistribution=} [properties] Properties to set
+ * @returns {google.cloud.recaptchaenterprise.v1.ScoreDistribution} ScoreDistribution instance
+ */
+ ScoreDistribution.create = function create(properties) {
+ return new ScoreDistribution(properties);
+ };
+
+ /**
+ * Encodes the specified ScoreDistribution message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ScoreDistribution.verify|verify} messages.
+ * @function encode
+ * @memberof google.cloud.recaptchaenterprise.v1.ScoreDistribution
+ * @static
+ * @param {google.cloud.recaptchaenterprise.v1.IScoreDistribution} message ScoreDistribution message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ ScoreDistribution.encode = function encode(message, writer) {
+ if (!writer)
+ writer = $Writer.create();
+ if (message.scoreBuckets != null && Object.hasOwnProperty.call(message, "scoreBuckets"))
+ for (var keys = Object.keys(message.scoreBuckets), i = 0; i < keys.length; ++i)
+ writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.scoreBuckets[keys[i]]).ldelim();
+ return writer;
+ };
+
+ /**
+ * Encodes the specified ScoreDistribution message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ScoreDistribution.verify|verify} messages.
+ * @function encodeDelimited
+ * @memberof google.cloud.recaptchaenterprise.v1.ScoreDistribution
+ * @static
+ * @param {google.cloud.recaptchaenterprise.v1.IScoreDistribution} message ScoreDistribution message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ ScoreDistribution.encodeDelimited = function encodeDelimited(message, writer) {
+ return this.encode(message, writer).ldelim();
+ };
+
+ /**
+ * Decodes a ScoreDistribution message from the specified reader or buffer.
+ * @function decode
+ * @memberof google.cloud.recaptchaenterprise.v1.ScoreDistribution
+ * @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.ScoreDistribution} ScoreDistribution
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ ScoreDistribution.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.ScoreDistribution(), key, value;
+ while (reader.pos < end) {
+ var tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (message.scoreBuckets === $util.emptyObject)
+ message.scoreBuckets = {};
+ var end2 = reader.uint32() + reader.pos;
+ key = 0;
+ value = 0;
+ while (reader.pos < end2) {
+ var tag2 = reader.uint32();
+ switch (tag2 >>> 3) {
+ case 1:
+ key = reader.int32();
+ break;
+ case 2:
+ value = reader.int64();
+ break;
+ default:
+ reader.skipType(tag2 & 7);
+ break;
+ }
+ }
+ message.scoreBuckets[key] = value;
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Decodes a ScoreDistribution message from the specified reader or buffer, length delimited.
+ * @function decodeDelimited
+ * @memberof google.cloud.recaptchaenterprise.v1.ScoreDistribution
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @returns {google.cloud.recaptchaenterprise.v1.ScoreDistribution} ScoreDistribution
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ ScoreDistribution.decodeDelimited = function decodeDelimited(reader) {
+ if (!(reader instanceof $Reader))
+ reader = new $Reader(reader);
+ return this.decode(reader, reader.uint32());
+ };
+
+ /**
+ * Verifies a ScoreDistribution message.
+ * @function verify
+ * @memberof google.cloud.recaptchaenterprise.v1.ScoreDistribution
+ * @static
+ * @param {Object.} message Plain object to verify
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
+ */
+ ScoreDistribution.verify = function verify(message) {
+ if (typeof message !== "object" || message === null)
+ return "object expected";
+ if (message.scoreBuckets != null && message.hasOwnProperty("scoreBuckets")) {
+ if (!$util.isObject(message.scoreBuckets))
+ return "scoreBuckets: object expected";
+ var key = Object.keys(message.scoreBuckets);
+ for (var i = 0; i < key.length; ++i) {
+ if (!$util.key32Re.test(key[i]))
+ return "scoreBuckets: integer key{k:int32} expected";
+ if (!$util.isInteger(message.scoreBuckets[key[i]]) && !(message.scoreBuckets[key[i]] && $util.isInteger(message.scoreBuckets[key[i]].low) && $util.isInteger(message.scoreBuckets[key[i]].high)))
+ return "scoreBuckets: integer|Long{k:int32} expected";
+ }
+ }
+ return null;
+ };
+
+ /**
+ * Creates a ScoreDistribution message from a plain object. Also converts values to their respective internal types.
+ * @function fromObject
+ * @memberof google.cloud.recaptchaenterprise.v1.ScoreDistribution
+ * @static
+ * @param {Object.} object Plain object
+ * @returns {google.cloud.recaptchaenterprise.v1.ScoreDistribution} ScoreDistribution
+ */
+ ScoreDistribution.fromObject = function fromObject(object) {
+ if (object instanceof $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution)
+ return object;
+ var message = new $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution();
+ if (object.scoreBuckets) {
+ if (typeof object.scoreBuckets !== "object")
+ throw TypeError(".google.cloud.recaptchaenterprise.v1.ScoreDistribution.scoreBuckets: object expected");
+ message.scoreBuckets = {};
+ for (var keys = Object.keys(object.scoreBuckets), i = 0; i < keys.length; ++i)
+ if ($util.Long)
+ (message.scoreBuckets[keys[i]] = $util.Long.fromValue(object.scoreBuckets[keys[i]])).unsigned = false;
+ else if (typeof object.scoreBuckets[keys[i]] === "string")
+ message.scoreBuckets[keys[i]] = parseInt(object.scoreBuckets[keys[i]], 10);
+ else if (typeof object.scoreBuckets[keys[i]] === "number")
+ message.scoreBuckets[keys[i]] = object.scoreBuckets[keys[i]];
+ else if (typeof object.scoreBuckets[keys[i]] === "object")
+ message.scoreBuckets[keys[i]] = new $util.LongBits(object.scoreBuckets[keys[i]].low >>> 0, object.scoreBuckets[keys[i]].high >>> 0).toNumber();
+ }
+ return message;
+ };
+
+ /**
+ * Creates a plain object from a ScoreDistribution message. Also converts values to other types if specified.
+ * @function toObject
+ * @memberof google.cloud.recaptchaenterprise.v1.ScoreDistribution
+ * @static
+ * @param {google.cloud.recaptchaenterprise.v1.ScoreDistribution} message ScoreDistribution
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
+ * @returns {Object.} Plain object
+ */
+ ScoreDistribution.toObject = function toObject(message, options) {
+ if (!options)
+ options = {};
+ var object = {};
+ if (options.objects || options.defaults)
+ object.scoreBuckets = {};
+ var keys2;
+ if (message.scoreBuckets && (keys2 = Object.keys(message.scoreBuckets)).length) {
+ object.scoreBuckets = {};
+ for (var j = 0; j < keys2.length; ++j)
+ if (typeof message.scoreBuckets[keys2[j]] === "number")
+ object.scoreBuckets[keys2[j]] = options.longs === String ? String(message.scoreBuckets[keys2[j]]) : message.scoreBuckets[keys2[j]];
+ else
+ object.scoreBuckets[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.scoreBuckets[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.scoreBuckets[keys2[j]].low >>> 0, message.scoreBuckets[keys2[j]].high >>> 0).toNumber() : message.scoreBuckets[keys2[j]];
}
- if (message.allowAmpTraffic != null && message.hasOwnProperty("allowAmpTraffic"))
- object.allowAmpTraffic = message.allowAmpTraffic;
- if (message.allowAllDomains != null && message.hasOwnProperty("allowAllDomains"))
- object.allowAllDomains = message.allowAllDomains;
- if (message.integrationType != null && message.hasOwnProperty("integrationType"))
- object.integrationType = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType[message.integrationType] : message.integrationType;
- if (message.challengeSecurityPreference != null && message.hasOwnProperty("challengeSecurityPreference"))
- object.challengeSecurityPreference = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference[message.challengeSecurityPreference] : message.challengeSecurityPreference;
return object;
};
/**
- * Converts this WebKeySettings to JSON.
+ * Converts this ScoreDistribution to JSON.
* @function toJSON
- * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.ScoreDistribution
* @instance
* @returns {Object.} JSON object
*/
- WebKeySettings.prototype.toJSON = function toJSON() {
+ ScoreDistribution.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
- /**
- * IntegrationType enum.
- * @name google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType
- * @enum {number}
- * @property {number} INTEGRATION_TYPE_UNSPECIFIED=0 INTEGRATION_TYPE_UNSPECIFIED value
- * @property {number} SCORE=1 SCORE value
- * @property {number} CHECKBOX=2 CHECKBOX value
- * @property {number} INVISIBLE=3 INVISIBLE value
- */
- WebKeySettings.IntegrationType = (function() {
- var valuesById = {}, values = Object.create(valuesById);
- values[valuesById[0] = "INTEGRATION_TYPE_UNSPECIFIED"] = 0;
- values[valuesById[1] = "SCORE"] = 1;
- values[valuesById[2] = "CHECKBOX"] = 2;
- values[valuesById[3] = "INVISIBLE"] = 3;
- return values;
- })();
-
- /**
- * ChallengeSecurityPreference enum.
- * @name google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference
- * @enum {number}
- * @property {number} CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED=0 CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED value
- * @property {number} USABILITY=1 USABILITY value
- * @property {number} BALANCE=2 BALANCE value
- * @property {number} SECURITY=3 SECURITY value
- */
- WebKeySettings.ChallengeSecurityPreference = (function() {
- var valuesById = {}, values = Object.create(valuesById);
- values[valuesById[0] = "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED"] = 0;
- values[valuesById[1] = "USABILITY"] = 1;
- values[valuesById[2] = "BALANCE"] = 2;
- values[valuesById[3] = "SECURITY"] = 3;
- return values;
- })();
-
- return WebKeySettings;
+ return ScoreDistribution;
})();
- v1.AndroidKeySettings = (function() {
+ v1.ScoreMetrics = (function() {
/**
- * Properties of an AndroidKeySettings.
+ * Properties of a ScoreMetrics.
* @memberof google.cloud.recaptchaenterprise.v1
- * @interface IAndroidKeySettings
- * @property {Array.|null} [allowedPackageNames] AndroidKeySettings allowedPackageNames
+ * @interface IScoreMetrics
+ * @property {google.cloud.recaptchaenterprise.v1.IScoreDistribution|null} [overallMetrics] ScoreMetrics overallMetrics
+ * @property {Object.|null} [actionMetrics] ScoreMetrics actionMetrics
*/
/**
- * Constructs a new AndroidKeySettings.
+ * Constructs a new ScoreMetrics.
* @memberof google.cloud.recaptchaenterprise.v1
- * @classdesc Represents an AndroidKeySettings.
- * @implements IAndroidKeySettings
+ * @classdesc Represents a ScoreMetrics.
+ * @implements IScoreMetrics
* @constructor
- * @param {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings=} [properties] Properties to set
+ * @param {google.cloud.recaptchaenterprise.v1.IScoreMetrics=} [properties] Properties to set
*/
- function AndroidKeySettings(properties) {
- this.allowedPackageNames = [];
+ function ScoreMetrics(properties) {
+ this.actionMetrics = {};
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
@@ -4220,78 +6047,110 @@
}
/**
- * AndroidKeySettings allowedPackageNames.
- * @member {Array.} allowedPackageNames
- * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings
+ * ScoreMetrics overallMetrics.
+ * @member {google.cloud.recaptchaenterprise.v1.IScoreDistribution|null|undefined} overallMetrics
+ * @memberof google.cloud.recaptchaenterprise.v1.ScoreMetrics
* @instance
*/
- AndroidKeySettings.prototype.allowedPackageNames = $util.emptyArray;
+ ScoreMetrics.prototype.overallMetrics = null;
/**
- * Creates a new AndroidKeySettings instance using the specified properties.
+ * ScoreMetrics actionMetrics.
+ * @member {Object.} actionMetrics
+ * @memberof google.cloud.recaptchaenterprise.v1.ScoreMetrics
+ * @instance
+ */
+ ScoreMetrics.prototype.actionMetrics = $util.emptyObject;
+
+ /**
+ * Creates a new ScoreMetrics instance using the specified properties.
* @function create
- * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.ScoreMetrics
* @static
- * @param {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings=} [properties] Properties to set
- * @returns {google.cloud.recaptchaenterprise.v1.AndroidKeySettings} AndroidKeySettings instance
+ * @param {google.cloud.recaptchaenterprise.v1.IScoreMetrics=} [properties] Properties to set
+ * @returns {google.cloud.recaptchaenterprise.v1.ScoreMetrics} ScoreMetrics instance
*/
- AndroidKeySettings.create = function create(properties) {
- return new AndroidKeySettings(properties);
+ ScoreMetrics.create = function create(properties) {
+ return new ScoreMetrics(properties);
};
/**
- * Encodes the specified AndroidKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AndroidKeySettings.verify|verify} messages.
+ * Encodes the specified ScoreMetrics message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ScoreMetrics.verify|verify} messages.
* @function encode
- * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.ScoreMetrics
* @static
- * @param {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings} message AndroidKeySettings message or plain object to encode
+ * @param {google.cloud.recaptchaenterprise.v1.IScoreMetrics} message ScoreMetrics message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
- AndroidKeySettings.encode = function encode(message, writer) {
+ ScoreMetrics.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
- if (message.allowedPackageNames != null && message.allowedPackageNames.length)
- for (var i = 0; i < message.allowedPackageNames.length; ++i)
- writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedPackageNames[i]);
+ if (message.overallMetrics != null && Object.hasOwnProperty.call(message, "overallMetrics"))
+ $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution.encode(message.overallMetrics, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
+ if (message.actionMetrics != null && Object.hasOwnProperty.call(message, "actionMetrics"))
+ for (var keys = Object.keys(message.actionMetrics), i = 0; i < keys.length; ++i) {
+ writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
+ $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution.encode(message.actionMetrics[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
+ }
return writer;
};
/**
- * Encodes the specified AndroidKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AndroidKeySettings.verify|verify} messages.
+ * Encodes the specified ScoreMetrics message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ScoreMetrics.verify|verify} messages.
* @function encodeDelimited
- * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.ScoreMetrics
* @static
- * @param {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings} message AndroidKeySettings message or plain object to encode
+ * @param {google.cloud.recaptchaenterprise.v1.IScoreMetrics} message ScoreMetrics message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
- AndroidKeySettings.encodeDelimited = function encodeDelimited(message, writer) {
+ ScoreMetrics.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
- * Decodes an AndroidKeySettings message from the specified reader or buffer.
+ * Decodes a ScoreMetrics message from the specified reader or buffer.
* @function decode
- * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.ScoreMetrics
* @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.AndroidKeySettings} AndroidKeySettings
+ * @returns {google.cloud.recaptchaenterprise.v1.ScoreMetrics} ScoreMetrics
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
- AndroidKeySettings.decode = function decode(reader, length) {
+ ScoreMetrics.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.AndroidKeySettings();
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.ScoreMetrics(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
- if (!(message.allowedPackageNames && message.allowedPackageNames.length))
- message.allowedPackageNames = [];
- message.allowedPackageNames.push(reader.string());
+ message.overallMetrics = $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution.decode(reader, reader.uint32());
+ break;
+ case 2:
+ if (message.actionMetrics === $util.emptyObject)
+ message.actionMetrics = {};
+ var end2 = reader.uint32() + reader.pos;
+ key = "";
+ value = null;
+ while (reader.pos < end2) {
+ var tag2 = reader.uint32();
+ switch (tag2 >>> 3) {
+ case 1:
+ key = reader.string();
+ break;
+ case 2:
+ value = $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution.decode(reader, reader.uint32());
+ break;
+ default:
+ reader.skipType(tag2 & 7);
+ break;
+ }
+ }
+ message.actionMetrics[key] = value;
break;
default:
reader.skipType(tag & 7);
@@ -4302,120 +6161,143 @@
};
/**
- * Decodes an AndroidKeySettings message from the specified reader or buffer, length delimited.
+ * Decodes a ScoreMetrics message from the specified reader or buffer, length delimited.
* @function decodeDelimited
- * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.ScoreMetrics
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @returns {google.cloud.recaptchaenterprise.v1.AndroidKeySettings} AndroidKeySettings
+ * @returns {google.cloud.recaptchaenterprise.v1.ScoreMetrics} ScoreMetrics
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
- AndroidKeySettings.decodeDelimited = function decodeDelimited(reader) {
+ ScoreMetrics.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
- * Verifies an AndroidKeySettings message.
+ * Verifies a ScoreMetrics message.
* @function verify
- * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.ScoreMetrics
* @static
* @param {Object.} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
- AndroidKeySettings.verify = function verify(message) {
+ ScoreMetrics.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
- if (message.allowedPackageNames != null && message.hasOwnProperty("allowedPackageNames")) {
- if (!Array.isArray(message.allowedPackageNames))
- return "allowedPackageNames: array expected";
- for (var i = 0; i < message.allowedPackageNames.length; ++i)
- if (!$util.isString(message.allowedPackageNames[i]))
- return "allowedPackageNames: string[] expected";
+ if (message.overallMetrics != null && message.hasOwnProperty("overallMetrics")) {
+ var error = $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution.verify(message.overallMetrics);
+ if (error)
+ return "overallMetrics." + error;
+ }
+ if (message.actionMetrics != null && message.hasOwnProperty("actionMetrics")) {
+ if (!$util.isObject(message.actionMetrics))
+ return "actionMetrics: object expected";
+ var key = Object.keys(message.actionMetrics);
+ for (var i = 0; i < key.length; ++i) {
+ var error = $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution.verify(message.actionMetrics[key[i]]);
+ if (error)
+ return "actionMetrics." + error;
+ }
}
return null;
};
/**
- * Creates an AndroidKeySettings message from a plain object. Also converts values to their respective internal types.
+ * Creates a ScoreMetrics message from a plain object. Also converts values to their respective internal types.
* @function fromObject
- * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.ScoreMetrics
* @static
* @param {Object.} object Plain object
- * @returns {google.cloud.recaptchaenterprise.v1.AndroidKeySettings} AndroidKeySettings
+ * @returns {google.cloud.recaptchaenterprise.v1.ScoreMetrics} ScoreMetrics
*/
- AndroidKeySettings.fromObject = function fromObject(object) {
- if (object instanceof $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings)
+ ScoreMetrics.fromObject = function fromObject(object) {
+ if (object instanceof $root.google.cloud.recaptchaenterprise.v1.ScoreMetrics)
return object;
- var message = new $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings();
- if (object.allowedPackageNames) {
- if (!Array.isArray(object.allowedPackageNames))
- throw TypeError(".google.cloud.recaptchaenterprise.v1.AndroidKeySettings.allowedPackageNames: array expected");
- message.allowedPackageNames = [];
- for (var i = 0; i < object.allowedPackageNames.length; ++i)
- message.allowedPackageNames[i] = String(object.allowedPackageNames[i]);
+ var message = new $root.google.cloud.recaptchaenterprise.v1.ScoreMetrics();
+ if (object.overallMetrics != null) {
+ if (typeof object.overallMetrics !== "object")
+ throw TypeError(".google.cloud.recaptchaenterprise.v1.ScoreMetrics.overallMetrics: object expected");
+ message.overallMetrics = $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution.fromObject(object.overallMetrics);
+ }
+ if (object.actionMetrics) {
+ if (typeof object.actionMetrics !== "object")
+ throw TypeError(".google.cloud.recaptchaenterprise.v1.ScoreMetrics.actionMetrics: object expected");
+ message.actionMetrics = {};
+ for (var keys = Object.keys(object.actionMetrics), i = 0; i < keys.length; ++i) {
+ if (typeof object.actionMetrics[keys[i]] !== "object")
+ throw TypeError(".google.cloud.recaptchaenterprise.v1.ScoreMetrics.actionMetrics: object expected");
+ message.actionMetrics[keys[i]] = $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution.fromObject(object.actionMetrics[keys[i]]);
+ }
}
return message;
};
/**
- * Creates a plain object from an AndroidKeySettings message. Also converts values to other types if specified.
+ * Creates a plain object from a ScoreMetrics message. Also converts values to other types if specified.
* @function toObject
- * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.ScoreMetrics
* @static
- * @param {google.cloud.recaptchaenterprise.v1.AndroidKeySettings} message AndroidKeySettings
+ * @param {google.cloud.recaptchaenterprise.v1.ScoreMetrics} message ScoreMetrics
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.} Plain object
*/
- AndroidKeySettings.toObject = function toObject(message, options) {
+ ScoreMetrics.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
- if (options.arrays || options.defaults)
- object.allowedPackageNames = [];
- if (message.allowedPackageNames && message.allowedPackageNames.length) {
- object.allowedPackageNames = [];
- for (var j = 0; j < message.allowedPackageNames.length; ++j)
- object.allowedPackageNames[j] = message.allowedPackageNames[j];
+ if (options.objects || options.defaults)
+ object.actionMetrics = {};
+ if (options.defaults)
+ object.overallMetrics = null;
+ if (message.overallMetrics != null && message.hasOwnProperty("overallMetrics"))
+ object.overallMetrics = $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution.toObject(message.overallMetrics, options);
+ var keys2;
+ if (message.actionMetrics && (keys2 = Object.keys(message.actionMetrics)).length) {
+ object.actionMetrics = {};
+ for (var j = 0; j < keys2.length; ++j)
+ object.actionMetrics[keys2[j]] = $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution.toObject(message.actionMetrics[keys2[j]], options);
}
return object;
};
/**
- * Converts this AndroidKeySettings to JSON.
+ * Converts this ScoreMetrics to JSON.
* @function toJSON
- * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.ScoreMetrics
* @instance
* @returns {Object.} JSON object
*/
- AndroidKeySettings.prototype.toJSON = function toJSON() {
+ ScoreMetrics.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
- return AndroidKeySettings;
+ return ScoreMetrics;
})();
- v1.IOSKeySettings = (function() {
+ v1.ChallengeMetrics = (function() {
/**
- * Properties of a IOSKeySettings.
+ * Properties of a ChallengeMetrics.
* @memberof google.cloud.recaptchaenterprise.v1
- * @interface IIOSKeySettings
- * @property {Array.|null} [allowedBundleIds] IOSKeySettings allowedBundleIds
+ * @interface IChallengeMetrics
+ * @property {number|Long|null} [pageloadCount] ChallengeMetrics pageloadCount
+ * @property {number|Long|null} [nocaptchaCount] ChallengeMetrics nocaptchaCount
+ * @property {number|Long|null} [failedCount] ChallengeMetrics failedCount
+ * @property {number|Long|null} [passedCount] ChallengeMetrics passedCount
*/
/**
- * Constructs a new IOSKeySettings.
+ * Constructs a new ChallengeMetrics.
* @memberof google.cloud.recaptchaenterprise.v1
- * @classdesc Represents a IOSKeySettings.
- * @implements IIOSKeySettings
+ * @classdesc Represents a ChallengeMetrics.
+ * @implements IChallengeMetrics
* @constructor
- * @param {google.cloud.recaptchaenterprise.v1.IIOSKeySettings=} [properties] Properties to set
+ * @param {google.cloud.recaptchaenterprise.v1.IChallengeMetrics=} [properties] Properties to set
*/
- function IOSKeySettings(properties) {
- this.allowedBundleIds = [];
+ function ChallengeMetrics(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
@@ -4423,78 +6305,114 @@
}
/**
- * IOSKeySettings allowedBundleIds.
- * @member {Array.} allowedBundleIds
- * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings
+ * ChallengeMetrics pageloadCount.
+ * @member {number|Long} pageloadCount
+ * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics
* @instance
*/
- IOSKeySettings.prototype.allowedBundleIds = $util.emptyArray;
+ ChallengeMetrics.prototype.pageloadCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
- * Creates a new IOSKeySettings instance using the specified properties.
+ * ChallengeMetrics nocaptchaCount.
+ * @member {number|Long} nocaptchaCount
+ * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics
+ * @instance
+ */
+ ChallengeMetrics.prototype.nocaptchaCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
+
+ /**
+ * ChallengeMetrics failedCount.
+ * @member {number|Long} failedCount
+ * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics
+ * @instance
+ */
+ ChallengeMetrics.prototype.failedCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
+
+ /**
+ * ChallengeMetrics passedCount.
+ * @member {number|Long} passedCount
+ * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics
+ * @instance
+ */
+ ChallengeMetrics.prototype.passedCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
+
+ /**
+ * Creates a new ChallengeMetrics instance using the specified properties.
* @function create
- * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics
* @static
- * @param {google.cloud.recaptchaenterprise.v1.IIOSKeySettings=} [properties] Properties to set
- * @returns {google.cloud.recaptchaenterprise.v1.IOSKeySettings} IOSKeySettings instance
+ * @param {google.cloud.recaptchaenterprise.v1.IChallengeMetrics=} [properties] Properties to set
+ * @returns {google.cloud.recaptchaenterprise.v1.ChallengeMetrics} ChallengeMetrics instance
*/
- IOSKeySettings.create = function create(properties) {
- return new IOSKeySettings(properties);
+ ChallengeMetrics.create = function create(properties) {
+ return new ChallengeMetrics(properties);
};
/**
- * Encodes the specified IOSKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.IOSKeySettings.verify|verify} messages.
+ * Encodes the specified ChallengeMetrics message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ChallengeMetrics.verify|verify} messages.
* @function encode
- * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics
* @static
- * @param {google.cloud.recaptchaenterprise.v1.IIOSKeySettings} message IOSKeySettings message or plain object to encode
+ * @param {google.cloud.recaptchaenterprise.v1.IChallengeMetrics} message ChallengeMetrics message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
- IOSKeySettings.encode = function encode(message, writer) {
+ ChallengeMetrics.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
- if (message.allowedBundleIds != null && message.allowedBundleIds.length)
- for (var i = 0; i < message.allowedBundleIds.length; ++i)
- writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedBundleIds[i]);
+ if (message.pageloadCount != null && Object.hasOwnProperty.call(message, "pageloadCount"))
+ writer.uint32(/* id 1, wireType 0 =*/8).int64(message.pageloadCount);
+ if (message.nocaptchaCount != null && Object.hasOwnProperty.call(message, "nocaptchaCount"))
+ writer.uint32(/* id 2, wireType 0 =*/16).int64(message.nocaptchaCount);
+ if (message.failedCount != null && Object.hasOwnProperty.call(message, "failedCount"))
+ writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCount);
+ if (message.passedCount != null && Object.hasOwnProperty.call(message, "passedCount"))
+ writer.uint32(/* id 4, wireType 0 =*/32).int64(message.passedCount);
return writer;
};
/**
- * Encodes the specified IOSKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.IOSKeySettings.verify|verify} messages.
+ * Encodes the specified ChallengeMetrics message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ChallengeMetrics.verify|verify} messages.
* @function encodeDelimited
- * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics
* @static
- * @param {google.cloud.recaptchaenterprise.v1.IIOSKeySettings} message IOSKeySettings message or plain object to encode
+ * @param {google.cloud.recaptchaenterprise.v1.IChallengeMetrics} message ChallengeMetrics message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
- IOSKeySettings.encodeDelimited = function encodeDelimited(message, writer) {
+ ChallengeMetrics.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
- * Decodes a IOSKeySettings message from the specified reader or buffer.
+ * Decodes a ChallengeMetrics message from the specified reader or buffer.
* @function decode
- * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics
* @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.IOSKeySettings} IOSKeySettings
+ * @returns {google.cloud.recaptchaenterprise.v1.ChallengeMetrics} ChallengeMetrics
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
- IOSKeySettings.decode = function decode(reader, length) {
+ ChallengeMetrics.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.IOSKeySettings();
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.ChallengeMetrics();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
- if (!(message.allowedBundleIds && message.allowedBundleIds.length))
- message.allowedBundleIds = [];
- message.allowedBundleIds.push(reader.string());
+ message.pageloadCount = reader.int64();
+ break;
+ case 2:
+ message.nocaptchaCount = reader.int64();
+ break;
+ case 3:
+ message.failedCount = reader.int64();
+ break;
+ case 4:
+ message.passedCount = reader.int64();
break;
default:
reader.skipType(tag & 7);
@@ -4505,99 +6423,168 @@
};
/**
- * Decodes a IOSKeySettings message from the specified reader or buffer, length delimited.
+ * Decodes a ChallengeMetrics message from the specified reader or buffer, length delimited.
* @function decodeDelimited
- * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @returns {google.cloud.recaptchaenterprise.v1.IOSKeySettings} IOSKeySettings
+ * @returns {google.cloud.recaptchaenterprise.v1.ChallengeMetrics} ChallengeMetrics
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
- IOSKeySettings.decodeDelimited = function decodeDelimited(reader) {
+ ChallengeMetrics.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
- * Verifies a IOSKeySettings message.
+ * Verifies a ChallengeMetrics message.
* @function verify
- * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics
* @static
* @param {Object.} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
- IOSKeySettings.verify = function verify(message) {
+ ChallengeMetrics.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
- if (message.allowedBundleIds != null && message.hasOwnProperty("allowedBundleIds")) {
- if (!Array.isArray(message.allowedBundleIds))
- return "allowedBundleIds: array expected";
- for (var i = 0; i < message.allowedBundleIds.length; ++i)
- if (!$util.isString(message.allowedBundleIds[i]))
- return "allowedBundleIds: string[] expected";
- }
+ if (message.pageloadCount != null && message.hasOwnProperty("pageloadCount"))
+ if (!$util.isInteger(message.pageloadCount) && !(message.pageloadCount && $util.isInteger(message.pageloadCount.low) && $util.isInteger(message.pageloadCount.high)))
+ return "pageloadCount: integer|Long expected";
+ if (message.nocaptchaCount != null && message.hasOwnProperty("nocaptchaCount"))
+ if (!$util.isInteger(message.nocaptchaCount) && !(message.nocaptchaCount && $util.isInteger(message.nocaptchaCount.low) && $util.isInteger(message.nocaptchaCount.high)))
+ return "nocaptchaCount: integer|Long expected";
+ if (message.failedCount != null && message.hasOwnProperty("failedCount"))
+ if (!$util.isInteger(message.failedCount) && !(message.failedCount && $util.isInteger(message.failedCount.low) && $util.isInteger(message.failedCount.high)))
+ return "failedCount: integer|Long expected";
+ if (message.passedCount != null && message.hasOwnProperty("passedCount"))
+ if (!$util.isInteger(message.passedCount) && !(message.passedCount && $util.isInteger(message.passedCount.low) && $util.isInteger(message.passedCount.high)))
+ return "passedCount: integer|Long expected";
return null;
};
/**
- * Creates a IOSKeySettings message from a plain object. Also converts values to their respective internal types.
+ * Creates a ChallengeMetrics message from a plain object. Also converts values to their respective internal types.
* @function fromObject
- * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics
* @static
* @param {Object.} object Plain object
- * @returns {google.cloud.recaptchaenterprise.v1.IOSKeySettings} IOSKeySettings
+ * @returns {google.cloud.recaptchaenterprise.v1.ChallengeMetrics} ChallengeMetrics
*/
- IOSKeySettings.fromObject = function fromObject(object) {
- if (object instanceof $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings)
+ ChallengeMetrics.fromObject = function fromObject(object) {
+ if (object instanceof $root.google.cloud.recaptchaenterprise.v1.ChallengeMetrics)
return object;
- var message = new $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings();
- if (object.allowedBundleIds) {
- if (!Array.isArray(object.allowedBundleIds))
- throw TypeError(".google.cloud.recaptchaenterprise.v1.IOSKeySettings.allowedBundleIds: array expected");
- message.allowedBundleIds = [];
- for (var i = 0; i < object.allowedBundleIds.length; ++i)
- message.allowedBundleIds[i] = String(object.allowedBundleIds[i]);
- }
+ var message = new $root.google.cloud.recaptchaenterprise.v1.ChallengeMetrics();
+ if (object.pageloadCount != null)
+ if ($util.Long)
+ (message.pageloadCount = $util.Long.fromValue(object.pageloadCount)).unsigned = false;
+ else if (typeof object.pageloadCount === "string")
+ message.pageloadCount = parseInt(object.pageloadCount, 10);
+ else if (typeof object.pageloadCount === "number")
+ message.pageloadCount = object.pageloadCount;
+ else if (typeof object.pageloadCount === "object")
+ message.pageloadCount = new $util.LongBits(object.pageloadCount.low >>> 0, object.pageloadCount.high >>> 0).toNumber();
+ if (object.nocaptchaCount != null)
+ if ($util.Long)
+ (message.nocaptchaCount = $util.Long.fromValue(object.nocaptchaCount)).unsigned = false;
+ else if (typeof object.nocaptchaCount === "string")
+ message.nocaptchaCount = parseInt(object.nocaptchaCount, 10);
+ else if (typeof object.nocaptchaCount === "number")
+ message.nocaptchaCount = object.nocaptchaCount;
+ else if (typeof object.nocaptchaCount === "object")
+ message.nocaptchaCount = new $util.LongBits(object.nocaptchaCount.low >>> 0, object.nocaptchaCount.high >>> 0).toNumber();
+ if (object.failedCount != null)
+ if ($util.Long)
+ (message.failedCount = $util.Long.fromValue(object.failedCount)).unsigned = false;
+ else if (typeof object.failedCount === "string")
+ message.failedCount = parseInt(object.failedCount, 10);
+ else if (typeof object.failedCount === "number")
+ message.failedCount = object.failedCount;
+ else if (typeof object.failedCount === "object")
+ message.failedCount = new $util.LongBits(object.failedCount.low >>> 0, object.failedCount.high >>> 0).toNumber();
+ if (object.passedCount != null)
+ if ($util.Long)
+ (message.passedCount = $util.Long.fromValue(object.passedCount)).unsigned = false;
+ else if (typeof object.passedCount === "string")
+ message.passedCount = parseInt(object.passedCount, 10);
+ else if (typeof object.passedCount === "number")
+ message.passedCount = object.passedCount;
+ else if (typeof object.passedCount === "object")
+ message.passedCount = new $util.LongBits(object.passedCount.low >>> 0, object.passedCount.high >>> 0).toNumber();
return message;
};
/**
- * Creates a plain object from a IOSKeySettings message. Also converts values to other types if specified.
+ * Creates a plain object from a ChallengeMetrics message. Also converts values to other types if specified.
* @function toObject
- * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics
* @static
- * @param {google.cloud.recaptchaenterprise.v1.IOSKeySettings} message IOSKeySettings
+ * @param {google.cloud.recaptchaenterprise.v1.ChallengeMetrics} message ChallengeMetrics
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.} Plain object
*/
- IOSKeySettings.toObject = function toObject(message, options) {
+ ChallengeMetrics.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
- if (options.arrays || options.defaults)
- object.allowedBundleIds = [];
- if (message.allowedBundleIds && message.allowedBundleIds.length) {
- object.allowedBundleIds = [];
- for (var j = 0; j < message.allowedBundleIds.length; ++j)
- object.allowedBundleIds[j] = message.allowedBundleIds[j];
+ if (options.defaults) {
+ if ($util.Long) {
+ var long = new $util.Long(0, 0, false);
+ object.pageloadCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
+ } else
+ object.pageloadCount = options.longs === String ? "0" : 0;
+ if ($util.Long) {
+ var long = new $util.Long(0, 0, false);
+ object.nocaptchaCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
+ } else
+ object.nocaptchaCount = options.longs === String ? "0" : 0;
+ if ($util.Long) {
+ var long = new $util.Long(0, 0, false);
+ object.failedCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
+ } else
+ object.failedCount = options.longs === String ? "0" : 0;
+ if ($util.Long) {
+ var long = new $util.Long(0, 0, false);
+ object.passedCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
+ } else
+ object.passedCount = options.longs === String ? "0" : 0;
}
+ if (message.pageloadCount != null && message.hasOwnProperty("pageloadCount"))
+ if (typeof message.pageloadCount === "number")
+ object.pageloadCount = options.longs === String ? String(message.pageloadCount) : message.pageloadCount;
+ else
+ object.pageloadCount = options.longs === String ? $util.Long.prototype.toString.call(message.pageloadCount) : options.longs === Number ? new $util.LongBits(message.pageloadCount.low >>> 0, message.pageloadCount.high >>> 0).toNumber() : message.pageloadCount;
+ if (message.nocaptchaCount != null && message.hasOwnProperty("nocaptchaCount"))
+ if (typeof message.nocaptchaCount === "number")
+ object.nocaptchaCount = options.longs === String ? String(message.nocaptchaCount) : message.nocaptchaCount;
+ else
+ object.nocaptchaCount = options.longs === String ? $util.Long.prototype.toString.call(message.nocaptchaCount) : options.longs === Number ? new $util.LongBits(message.nocaptchaCount.low >>> 0, message.nocaptchaCount.high >>> 0).toNumber() : message.nocaptchaCount;
+ if (message.failedCount != null && message.hasOwnProperty("failedCount"))
+ if (typeof message.failedCount === "number")
+ object.failedCount = options.longs === String ? String(message.failedCount) : message.failedCount;
+ else
+ object.failedCount = options.longs === String ? $util.Long.prototype.toString.call(message.failedCount) : options.longs === Number ? new $util.LongBits(message.failedCount.low >>> 0, message.failedCount.high >>> 0).toNumber() : message.failedCount;
+ if (message.passedCount != null && message.hasOwnProperty("passedCount"))
+ if (typeof message.passedCount === "number")
+ object.passedCount = options.longs === String ? String(message.passedCount) : message.passedCount;
+ else
+ object.passedCount = options.longs === String ? $util.Long.prototype.toString.call(message.passedCount) : options.longs === Number ? new $util.LongBits(message.passedCount.low >>> 0, message.passedCount.high >>> 0).toNumber() : message.passedCount;
return object;
};
/**
- * Converts this IOSKeySettings to JSON.
+ * Converts this ChallengeMetrics to JSON.
* @function toJSON
- * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings
+ * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics
* @instance
* @returns {Object.} JSON object
*/
- IOSKeySettings.prototype.toJSON = function toJSON() {
+ ChallengeMetrics.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
- return IOSKeySettings;
+ return ChallengeMetrics;
})();
return v1;
diff --git a/protos/protos.json b/protos/protos.json
index cfe679b..a5dc952 100644
--- a/protos/protos.json
+++ b/protos/protos.json
@@ -137,6 +137,40 @@
}
}
]
+ },
+ "MigrateKey": {
+ "requestType": "MigrateKeyRequest",
+ "responseType": "Key",
+ "options": {
+ "(google.api.http).post": "/v1/{name=projects/*/keys/*}:migrate",
+ "(google.api.http).body": "*"
+ },
+ "parsedOptions": [
+ {
+ "(google.api.http)": {
+ "post": "/v1/{name=projects/*/keys/*}:migrate",
+ "body": "*"
+ }
+ }
+ ]
+ },
+ "GetMetrics": {
+ "requestType": "GetMetricsRequest",
+ "responseType": "Metrics",
+ "options": {
+ "(google.api.http).get": "/v1/{name=projects/*/keys/*/metrics}",
+ "(google.api.method_signature)": "name"
+ },
+ "parsedOptions": [
+ {
+ "(google.api.http)": {
+ "get": "/v1/{name=projects/*/keys/*/metrics}"
+ }
+ },
+ {
+ "(google.api.method_signature)": "name"
+ }
+ ]
}
}
},
@@ -173,7 +207,15 @@
"type": "Annotation",
"id": 2,
"options": {
- "(google.api.field_behavior)": "REQUIRED"
+ "(google.api.field_behavior)": "OPTIONAL"
+ }
+ },
+ "reasons": {
+ "rule": "repeated",
+ "type": "Reason",
+ "id": 3,
+ "options": {
+ "(google.api.field_behavior)": "OPTIONAL"
}
}
},
@@ -186,6 +228,18 @@
"PASSWORD_CORRECT": 3,
"PASSWORD_INCORRECT": 4
}
+ },
+ "Reason": {
+ "values": {
+ "REASON_UNSPECIFIED": 0,
+ "CHARGEBACK": 1,
+ "PAYMENT_HEURISTICS": 2,
+ "INITIATED_TWO_FACTOR": 7,
+ "PASSED_TWO_FACTOR": 3,
+ "FAILED_TWO_FACTOR": 4,
+ "CORRECT_PASSWORD": 5,
+ "INCORRECT_PASSWORD": 6
+ }
}
}
},
@@ -320,7 +374,8 @@
"MALFORMED": 2,
"EXPIRED": 3,
"DUPE": 4,
- "MISSING": 5
+ "MISSING": 5,
+ "BROWSER_ERROR": 6
}
}
}
@@ -425,6 +480,59 @@
}
}
},
+ "MigrateKeyRequest": {
+ "fields": {
+ "name": {
+ "type": "string",
+ "id": 1,
+ "options": {
+ "(google.api.field_behavior)": "REQUIRED",
+ "(google.api.resource_reference).type": "recaptchaenterprise.googleapis.com/Key"
+ }
+ }
+ }
+ },
+ "GetMetricsRequest": {
+ "fields": {
+ "name": {
+ "type": "string",
+ "id": 1,
+ "options": {
+ "(google.api.field_behavior)": "REQUIRED",
+ "(google.api.resource_reference).type": "recaptchaenterprise.googleapis.com/Metrics"
+ }
+ }
+ }
+ },
+ "Metrics": {
+ "options": {
+ "(google.api.resource).type": "recaptchaenterprise.googleapis.com/Metrics",
+ "(google.api.resource).pattern": "projects/{project}/keys/{key}/metrics"
+ },
+ "fields": {
+ "name": {
+ "type": "string",
+ "id": 4,
+ "options": {
+ "(google.api.field_behavior)": "OUTPUT_ONLY"
+ }
+ },
+ "startTime": {
+ "type": "google.protobuf.Timestamp",
+ "id": 1
+ },
+ "scoreMetrics": {
+ "rule": "repeated",
+ "type": "ScoreMetrics",
+ "id": 2
+ },
+ "challengeMetrics": {
+ "rule": "repeated",
+ "type": "ChallengeMetrics",
+ "id": 3
+ }
+ }
+ },
"Key": {
"options": {
"(google.api.resource).type": "recaptchaenterprise.googleapis.com/Key",
@@ -463,14 +571,36 @@
"labels": {
"keyType": "string",
"type": "string",
- "id": 6,
- "options": {
- "(google.api.field_behavior)": "OPTIONAL"
- }
+ "id": 6
},
"createTime": {
"type": "google.protobuf.Timestamp",
"id": 7
+ },
+ "testingOptions": {
+ "type": "TestingOptions",
+ "id": 9
+ }
+ }
+ },
+ "TestingOptions": {
+ "fields": {
+ "testingScore": {
+ "type": "float",
+ "id": 1
+ },
+ "testingChallenge": {
+ "type": "TestingChallenge",
+ "id": 2
+ }
+ },
+ "nested": {
+ "TestingChallenge": {
+ "values": {
+ "TESTING_CHALLENGE_UNSPECIFIED": 0,
+ "NOCAPTCHA": 1,
+ "UNSOLVABLE_CHALLENGE": 2
+ }
}
}
},
@@ -525,6 +655,10 @@
},
"AndroidKeySettings": {
"fields": {
+ "allowAllPackageNames": {
+ "type": "bool",
+ "id": 2
+ },
"allowedPackageNames": {
"rule": "repeated",
"type": "string",
@@ -534,12 +668,58 @@
},
"IOSKeySettings": {
"fields": {
+ "allowAllBundleIds": {
+ "type": "bool",
+ "id": 2
+ },
"allowedBundleIds": {
"rule": "repeated",
"type": "string",
"id": 1
}
}
+ },
+ "ScoreDistribution": {
+ "fields": {
+ "scoreBuckets": {
+ "keyType": "int32",
+ "type": "int64",
+ "id": 1
+ }
+ }
+ },
+ "ScoreMetrics": {
+ "fields": {
+ "overallMetrics": {
+ "type": "ScoreDistribution",
+ "id": 1
+ },
+ "actionMetrics": {
+ "keyType": "string",
+ "type": "ScoreDistribution",
+ "id": 2
+ }
+ }
+ },
+ "ChallengeMetrics": {
+ "fields": {
+ "pageloadCount": {
+ "type": "int64",
+ "id": 1
+ },
+ "nocaptchaCount": {
+ "type": "int64",
+ "id": 2
+ },
+ "failedCount": {
+ "type": "int64",
+ "id": 3
+ },
+ "passedCount": {
+ "type": "int64",
+ "id": 4
+ }
+ }
}
}
},
diff --git a/src/v1/gapic_metadata.json b/src/v1/gapic_metadata.json
index 182faf0..1663f25 100644
--- a/src/v1/gapic_metadata.json
+++ b/src/v1/gapic_metadata.json
@@ -40,6 +40,16 @@
"deleteKey"
]
},
+ "MigrateKey": {
+ "methods": [
+ "migrateKey"
+ ]
+ },
+ "GetMetrics": {
+ "methods": [
+ "getMetrics"
+ ]
+ },
"ListKeys": {
"methods": [
"listKeys",
@@ -82,6 +92,16 @@
"deleteKey"
]
},
+ "MigrateKey": {
+ "methods": [
+ "migrateKey"
+ ]
+ },
+ "GetMetrics": {
+ "methods": [
+ "getMetrics"
+ ]
+ },
"ListKeys": {
"methods": [
"listKeys",
diff --git a/src/v1/recaptcha_enterprise_service_client.ts b/src/v1/recaptcha_enterprise_service_client.ts
index ce4b941..92215b8 100644
--- a/src/v1/recaptcha_enterprise_service_client.ts
+++ b/src/v1/recaptcha_enterprise_service_client.ts
@@ -171,6 +171,9 @@ export class RecaptchaEnterpriseServiceClient {
keyPathTemplate: new this._gaxModule.PathTemplate(
'projects/{project}/keys/{key}'
),
+ metricsPathTemplate: new this._gaxModule.PathTemplate(
+ 'projects/{project}/keys/{key}/metrics'
+ ),
projectPathTemplate: new this._gaxModule.PathTemplate(
'projects/{project}'
),
@@ -245,6 +248,8 @@ export class RecaptchaEnterpriseServiceClient {
'getKey',
'updateKey',
'deleteKey',
+ 'migrateKey',
+ 'getMetrics',
];
for (const methodName of recaptchaEnterpriseServiceStubMethods) {
const callPromise = this.recaptchaEnterpriseServiceStub.then(
@@ -463,15 +468,19 @@ export class RecaptchaEnterpriseServiceClient {
): void;
/**
* Annotates a previously created Assessment to provide additional information
- * on whether the event turned out to be authentic or fradulent.
+ * on whether the event turned out to be authentic or fraudulent.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.name
* Required. The resource name of the Assessment, in the format
* "projects/{project}/assessments/{assessment}".
- * @param {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation} request.annotation
- * Required. The annotation that will be assigned to the Event.
+ * @param {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation} [request.annotation]
+ * Optional. The annotation that will be assigned to the Event. This field can be left
+ * empty to provide reasons that apply to an event without concluding whether
+ * the event is legitimate or fraudulent.
+ * @param {number[]} [request.reasons]
+ * Optional. Optional reasons for the annotation that will be assigned to the Event.
* @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.
@@ -753,7 +762,7 @@ export class RecaptchaEnterpriseServiceClient {
* @param {google.cloud.recaptchaenterprise.v1.Key} request.key
* Required. The key to update.
* @param {google.protobuf.FieldMask} [request.updateMask]
- * Optional. The mask to control which field of the key get updated. If the mask is not
+ * Optional. The mask to control which fields of the key get updated. If the mask is not
* present, all fields will be updated.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
@@ -900,6 +909,196 @@ export class RecaptchaEnterpriseServiceClient {
this.initialize();
return this.innerApiCalls.deleteKey(request, options, callback);
}
+ migrateKey(
+ request?: protos.google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest,
+ options?: CallOptions
+ ): Promise<
+ [
+ protos.google.cloud.recaptchaenterprise.v1.IKey,
+ protos.google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest | undefined,
+ {} | undefined
+ ]
+ >;
+ migrateKey(
+ request: protos.google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest,
+ options: CallOptions,
+ callback: Callback<
+ protos.google.cloud.recaptchaenterprise.v1.IKey,
+ | protos.google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest
+ | null
+ | undefined,
+ {} | null | undefined
+ >
+ ): void;
+ migrateKey(
+ request: protos.google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest,
+ callback: Callback<
+ protos.google.cloud.recaptchaenterprise.v1.IKey,
+ | protos.google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest
+ | null
+ | undefined,
+ {} | null | undefined
+ >
+ ): void;
+ /**
+ * Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise.
+ * Once a key is migrated, it can be used from either product. SiteVerify
+ * requests are billed as CreateAssessment calls. You must be
+ * authenticated as one of the current owners of the reCAPTCHA Site Key, and
+ * your user must have the reCAPTCHA Enterprise Admin IAM role in the
+ * destination project.
+ *
+ * @param {Object} request
+ * The request object that will be sent.
+ * @param {string} request.name
+ * Required. The name of the key to be migrated, in the format
+ * "projects/{project}/keys/{key}".
+ * @param {object} [options]
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
+ * @returns {Promise} - The promise which resolves to an array.
+ * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key}.
+ * Please see the
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
+ * for more details and examples.
+ * @example
+ * const [response] = await client.migrateKey(request);
+ */
+ migrateKey(
+ request?: protos.google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest,
+ optionsOrCallback?:
+ | CallOptions
+ | Callback<
+ protos.google.cloud.recaptchaenterprise.v1.IKey,
+ | protos.google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest
+ | null
+ | undefined,
+ {} | null | undefined
+ >,
+ callback?: Callback<
+ protos.google.cloud.recaptchaenterprise.v1.IKey,
+ | protos.google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest
+ | null
+ | undefined,
+ {} | null | undefined
+ >
+ ): Promise<
+ [
+ protos.google.cloud.recaptchaenterprise.v1.IKey,
+ protos.google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest | undefined,
+ {} | undefined
+ ]
+ > | void {
+ request = request || {};
+ let options: CallOptions;
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
+ callback = optionsOrCallback;
+ options = {};
+ } else {
+ options = optionsOrCallback as CallOptions;
+ }
+ options = options || {};
+ options.otherArgs = options.otherArgs || {};
+ options.otherArgs.headers = options.otherArgs.headers || {};
+ options.otherArgs.headers['x-goog-request-params'] =
+ gax.routingHeader.fromParams({
+ name: request.name || '',
+ });
+ this.initialize();
+ return this.innerApiCalls.migrateKey(request, options, callback);
+ }
+ getMetrics(
+ request?: protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest,
+ options?: CallOptions
+ ): Promise<
+ [
+ protos.google.cloud.recaptchaenterprise.v1.IMetrics,
+ protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest | undefined,
+ {} | undefined
+ ]
+ >;
+ getMetrics(
+ request: protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest,
+ options: CallOptions,
+ callback: Callback<
+ protos.google.cloud.recaptchaenterprise.v1.IMetrics,
+ | protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest
+ | null
+ | undefined,
+ {} | null | undefined
+ >
+ ): void;
+ getMetrics(
+ request: protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest,
+ callback: Callback<
+ protos.google.cloud.recaptchaenterprise.v1.IMetrics,
+ | protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest
+ | null
+ | undefined,
+ {} | null | undefined
+ >
+ ): void;
+ /**
+ * Get some aggregated metrics for a Key. This data can be used to build
+ * dashboards.
+ *
+ * @param {Object} request
+ * The request object that will be sent.
+ * @param {string} request.name
+ * Required. The name of the requested metrics, in the format
+ * "projects/{project}/keys/{key}/metrics".
+ * @param {object} [options]
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
+ * @returns {Promise} - The promise which resolves to an array.
+ * The first element of the array is an object representing [Metrics]{@link google.cloud.recaptchaenterprise.v1.Metrics}.
+ * Please see the
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
+ * for more details and examples.
+ * @example
+ * const [response] = await client.getMetrics(request);
+ */
+ getMetrics(
+ request?: protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest,
+ optionsOrCallback?:
+ | CallOptions
+ | Callback<
+ protos.google.cloud.recaptchaenterprise.v1.IMetrics,
+ | protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest
+ | null
+ | undefined,
+ {} | null | undefined
+ >,
+ callback?: Callback<
+ protos.google.cloud.recaptchaenterprise.v1.IMetrics,
+ | protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest
+ | null
+ | undefined,
+ {} | null | undefined
+ >
+ ): Promise<
+ [
+ protos.google.cloud.recaptchaenterprise.v1.IMetrics,
+ protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest | undefined,
+ {} | undefined
+ ]
+ > | void {
+ request = request || {};
+ let options: CallOptions;
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
+ callback = optionsOrCallback;
+ options = {};
+ } else {
+ options = optionsOrCallback as CallOptions;
+ }
+ options = options || {};
+ options.otherArgs = options.otherArgs || {};
+ options.otherArgs.headers = options.otherArgs.headers || {};
+ options.otherArgs.headers['x-goog-request-params'] =
+ gax.routingHeader.fromParams({
+ name: request.name || '',
+ });
+ this.initialize();
+ return this.innerApiCalls.getMetrics(request, options, callback);
+ }
listKeys(
request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest,
@@ -1179,6 +1378,42 @@ export class RecaptchaEnterpriseServiceClient {
return this.pathTemplates.keyPathTemplate.match(keyName).key;
}
+ /**
+ * Return a fully-qualified metrics resource name string.
+ *
+ * @param {string} project
+ * @param {string} key
+ * @returns {string} Resource name string.
+ */
+ metricsPath(project: string, key: string) {
+ return this.pathTemplates.metricsPathTemplate.render({
+ project: project,
+ key: key,
+ });
+ }
+
+ /**
+ * Parse the project from Metrics resource.
+ *
+ * @param {string} metricsName
+ * A fully-qualified path representing Metrics resource.
+ * @returns {string} A string representing the project.
+ */
+ matchProjectFromMetricsName(metricsName: string) {
+ return this.pathTemplates.metricsPathTemplate.match(metricsName).project;
+ }
+
+ /**
+ * Parse the key from Metrics resource.
+ *
+ * @param {string} metricsName
+ * A fully-qualified path representing Metrics resource.
+ * @returns {string} A string representing the key.
+ */
+ matchKeyFromMetricsName(metricsName: string) {
+ return this.pathTemplates.metricsPathTemplate.match(metricsName).key;
+ }
+
/**
* Return a fully-qualified project resource name string.
*
diff --git a/src/v1/recaptcha_enterprise_service_client_config.json b/src/v1/recaptcha_enterprise_service_client_config.json
index 20e3110..ec264c5 100644
--- a/src/v1/recaptcha_enterprise_service_client_config.json
+++ b/src/v1/recaptcha_enterprise_service_client_config.json
@@ -54,6 +54,14 @@
"timeout_millis": 600000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
+ },
+ "MigrateKey": {
+ "retry_codes_name": "non_idempotent",
+ "retry_params_name": "default"
+ },
+ "GetMetrics": {
+ "retry_codes_name": "non_idempotent",
+ "retry_params_name": "default"
}
}
}
diff --git a/test/gapic_recaptcha_enterprise_service_v1.ts b/test/gapic_recaptcha_enterprise_service_v1.ts
index 634f381..e2f0967 100644
--- a/test/gapic_recaptcha_enterprise_service_v1.ts
+++ b/test/gapic_recaptcha_enterprise_service_v1.ts
@@ -916,6 +916,246 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => {
});
});
+ describe('migrateKey', () => {
+ it('invokes migrateKey without error', async () => {
+ const client =
+ new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient(
+ {
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ }
+ );
+ client.initialize();
+ const request = generateSampleMessage(
+ new protos.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest()
+ );
+ request.name = '';
+ const expectedHeaderRequestParams = 'name=';
+ const expectedOptions = {
+ otherArgs: {
+ headers: {
+ 'x-goog-request-params': expectedHeaderRequestParams,
+ },
+ },
+ };
+ const expectedResponse = generateSampleMessage(
+ new protos.google.cloud.recaptchaenterprise.v1.Key()
+ );
+ client.innerApiCalls.migrateKey = stubSimpleCall(expectedResponse);
+ const [response] = await client.migrateKey(request);
+ assert.deepStrictEqual(response, expectedResponse);
+ assert(
+ (client.innerApiCalls.migrateKey as SinonStub)
+ .getCall(0)
+ .calledWith(request, expectedOptions, undefined)
+ );
+ });
+
+ it('invokes migrateKey without error using callback', async () => {
+ const client =
+ new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient(
+ {
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ }
+ );
+ client.initialize();
+ const request = generateSampleMessage(
+ new protos.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest()
+ );
+ request.name = '';
+ const expectedHeaderRequestParams = 'name=';
+ const expectedOptions = {
+ otherArgs: {
+ headers: {
+ 'x-goog-request-params': expectedHeaderRequestParams,
+ },
+ },
+ };
+ const expectedResponse = generateSampleMessage(
+ new protos.google.cloud.recaptchaenterprise.v1.Key()
+ );
+ client.innerApiCalls.migrateKey =
+ stubSimpleCallWithCallback(expectedResponse);
+ const promise = new Promise((resolve, reject) => {
+ client.migrateKey(
+ request,
+ (
+ err?: Error | null,
+ result?: protos.google.cloud.recaptchaenterprise.v1.IKey | null
+ ) => {
+ if (err) {
+ reject(err);
+ } else {
+ resolve(result);
+ }
+ }
+ );
+ });
+ const response = await promise;
+ assert.deepStrictEqual(response, expectedResponse);
+ assert(
+ (client.innerApiCalls.migrateKey as SinonStub)
+ .getCall(0)
+ .calledWith(request, expectedOptions /*, callback defined above */)
+ );
+ });
+
+ it('invokes migrateKey with error', async () => {
+ const client =
+ new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient(
+ {
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ }
+ );
+ client.initialize();
+ const request = generateSampleMessage(
+ new protos.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest()
+ );
+ request.name = '';
+ const expectedHeaderRequestParams = 'name=';
+ const expectedOptions = {
+ otherArgs: {
+ headers: {
+ 'x-goog-request-params': expectedHeaderRequestParams,
+ },
+ },
+ };
+ const expectedError = new Error('expected');
+ client.innerApiCalls.migrateKey = stubSimpleCall(
+ undefined,
+ expectedError
+ );
+ await assert.rejects(client.migrateKey(request), expectedError);
+ assert(
+ (client.innerApiCalls.migrateKey as SinonStub)
+ .getCall(0)
+ .calledWith(request, expectedOptions, undefined)
+ );
+ });
+ });
+
+ describe('getMetrics', () => {
+ it('invokes getMetrics without error', async () => {
+ const client =
+ new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient(
+ {
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ }
+ );
+ client.initialize();
+ const request = generateSampleMessage(
+ new protos.google.cloud.recaptchaenterprise.v1.GetMetricsRequest()
+ );
+ request.name = '';
+ const expectedHeaderRequestParams = 'name=';
+ const expectedOptions = {
+ otherArgs: {
+ headers: {
+ 'x-goog-request-params': expectedHeaderRequestParams,
+ },
+ },
+ };
+ const expectedResponse = generateSampleMessage(
+ new protos.google.cloud.recaptchaenterprise.v1.Metrics()
+ );
+ client.innerApiCalls.getMetrics = stubSimpleCall(expectedResponse);
+ const [response] = await client.getMetrics(request);
+ assert.deepStrictEqual(response, expectedResponse);
+ assert(
+ (client.innerApiCalls.getMetrics as SinonStub)
+ .getCall(0)
+ .calledWith(request, expectedOptions, undefined)
+ );
+ });
+
+ it('invokes getMetrics without error using callback', async () => {
+ const client =
+ new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient(
+ {
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ }
+ );
+ client.initialize();
+ const request = generateSampleMessage(
+ new protos.google.cloud.recaptchaenterprise.v1.GetMetricsRequest()
+ );
+ request.name = '';
+ const expectedHeaderRequestParams = 'name=';
+ const expectedOptions = {
+ otherArgs: {
+ headers: {
+ 'x-goog-request-params': expectedHeaderRequestParams,
+ },
+ },
+ };
+ const expectedResponse = generateSampleMessage(
+ new protos.google.cloud.recaptchaenterprise.v1.Metrics()
+ );
+ client.innerApiCalls.getMetrics =
+ stubSimpleCallWithCallback(expectedResponse);
+ const promise = new Promise((resolve, reject) => {
+ client.getMetrics(
+ request,
+ (
+ err?: Error | null,
+ result?: protos.google.cloud.recaptchaenterprise.v1.IMetrics | null
+ ) => {
+ if (err) {
+ reject(err);
+ } else {
+ resolve(result);
+ }
+ }
+ );
+ });
+ const response = await promise;
+ assert.deepStrictEqual(response, expectedResponse);
+ assert(
+ (client.innerApiCalls.getMetrics as SinonStub)
+ .getCall(0)
+ .calledWith(request, expectedOptions /*, callback defined above */)
+ );
+ });
+
+ it('invokes getMetrics with error', async () => {
+ const client =
+ new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient(
+ {
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ }
+ );
+ client.initialize();
+ const request = generateSampleMessage(
+ new protos.google.cloud.recaptchaenterprise.v1.GetMetricsRequest()
+ );
+ request.name = '';
+ const expectedHeaderRequestParams = 'name=';
+ const expectedOptions = {
+ otherArgs: {
+ headers: {
+ 'x-goog-request-params': expectedHeaderRequestParams,
+ },
+ },
+ };
+ const expectedError = new Error('expected');
+ client.innerApiCalls.getMetrics = stubSimpleCall(
+ undefined,
+ expectedError
+ );
+ await assert.rejects(client.getMetrics(request), expectedError);
+ assert(
+ (client.innerApiCalls.getMetrics as SinonStub)
+ .getCall(0)
+ .calledWith(request, expectedOptions, undefined)
+ );
+ });
+ });
+
describe('listKeys', () => {
it('invokes listKeys without error', async () => {
const client =
@@ -1342,6 +1582,58 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => {
});
});
+ describe('metrics', () => {
+ const fakePath = '/rendered/path/metrics';
+ const expectedParameters = {
+ project: 'projectValue',
+ key: 'keyValue',
+ };
+ const client =
+ new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient(
+ {
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ }
+ );
+ client.initialize();
+ client.pathTemplates.metricsPathTemplate.render = sinon
+ .stub()
+ .returns(fakePath);
+ client.pathTemplates.metricsPathTemplate.match = sinon
+ .stub()
+ .returns(expectedParameters);
+
+ it('metricsPath', () => {
+ const result = client.metricsPath('projectValue', 'keyValue');
+ assert.strictEqual(result, fakePath);
+ assert(
+ (client.pathTemplates.metricsPathTemplate.render as SinonStub)
+ .getCall(-1)
+ .calledWith(expectedParameters)
+ );
+ });
+
+ it('matchProjectFromMetricsName', () => {
+ const result = client.matchProjectFromMetricsName(fakePath);
+ assert.strictEqual(result, 'projectValue');
+ assert(
+ (client.pathTemplates.metricsPathTemplate.match as SinonStub)
+ .getCall(-1)
+ .calledWith(fakePath)
+ );
+ });
+
+ it('matchKeyFromMetricsName', () => {
+ const result = client.matchKeyFromMetricsName(fakePath);
+ assert.strictEqual(result, 'keyValue');
+ assert(
+ (client.pathTemplates.metricsPathTemplate.match as SinonStub)
+ .getCall(-1)
+ .calledWith(fakePath)
+ );
+ });
+ });
+
describe('project', () => {
const fakePath = '/rendered/path/project';
const expectedParameters = {