diff --git a/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto b/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto index 1be736a..7cf8073 100644 --- a/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto +++ b/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -135,10 +135,10 @@ service RecaptchaEnterpriseService { // Search group memberships related to a given account. rpc SearchRelatedAccountGroupMemberships(SearchRelatedAccountGroupMembershipsRequest) returns (SearchRelatedAccountGroupMembershipsResponse) { option (google.api.http) = { - post: "/v1/{parent=projects/*}/relatedaccountgroupmemberships:search" + post: "/v1/{project=projects/*}/relatedaccountgroupmemberships:search" body: "*" }; - option (google.api.method_signature) = "parent,hashed_account_id"; + option (google.api.method_signature) = "project,hashed_account_id"; } } @@ -186,18 +186,18 @@ message AnnotateAssessmentRequest { // Default unspecified reason. REASON_UNSPECIFIED = 0; - // Indicates a chargeback was issued for the transaction associated with the - // assessment, with no other details. When possible, specify the type by - // using CHARGEBACK_FRAUD or CHARGEBACK_DISPUTE instead. + // Indicates a chargeback issued for the transaction with no other details. + // When possible, specify the type by using CHARGEBACK_FRAUD or + // CHARGEBACK_DISPUTE instead. CHARGEBACK = 1; // Indicates a chargeback related to an alleged unauthorized transaction - // from the perspective of the cardholder (for example, the card number was + // from the cardholder's perspective (for example, the card number was // stolen). CHARGEBACK_FRAUD = 8; // Indicates a chargeback related to the cardholder having provided their - // card but allegedly not being satisfied with the purchase + // card details but allegedly not being satisfied with the purchase // (for example, misrepresentation, attempted cancellation). CHARGEBACK_DISPUTE = 9; @@ -578,6 +578,9 @@ message Key { // Options for user acceptance testing. TestingOptions testing_options = 9; + + // Settings for WAF + WafSettings waf_settings = 10; } // Options for user acceptance testing. @@ -802,7 +805,7 @@ message ListRelatedAccountGroupsResponse { message SearchRelatedAccountGroupMembershipsRequest { // Required. The name of the project to search related account group memberships from, // in the format "projects/{project}". - string parent = 1 [ + string project = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { child_type: "recaptchaenterprise.googleapis.com/RelatedAccountGroupMembership" @@ -878,3 +881,39 @@ message RelatedAccountGroup { } ]; } + +// Settings specific to keys that can be used for WAF (Web Application +// Firewall). +message WafSettings { + // Supported WAF features. For more information, see + // https://cloud.google.com/recaptcha-enterprise/docs/usecase#comparison_of_features. + enum WafFeature { + // Undefined feature. + WAF_FEATURE_UNSPECIFIED = 0; + + // Redirects suspicious traffic to reCAPTCHA. + CHALLENGE_PAGE = 1; + + // Use reCAPTCHA session-tokens to protect the whole user session on the + // site's domain. + SESSION_TOKEN = 2; + + // Use reCAPTCHA action-tokens to protect user actions. + ACTION_TOKEN = 3; + } + + // Web Application Firewalls supported by reCAPTCHA Enterprise. + enum WafService { + // Undefined WAF + WAF_SERVICE_UNSPECIFIED = 0; + + // Cloud Armor + CA = 1; + } + + // Required. The WAF service that uses this key. + WafService waf_service = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The WAF feature for which this key is enabled. + WafFeature waf_feature = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/protos/protos.d.ts b/protos/protos.d.ts index ab69c80..8f8090d 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -2073,6 +2073,9 @@ export namespace google { /** Key testingOptions */ testingOptions?: (google.cloud.recaptchaenterprise.v1.ITestingOptions|null); + + /** Key wafSettings */ + wafSettings?: (google.cloud.recaptchaenterprise.v1.IWafSettings|null); } /** Represents a Key. */ @@ -2108,6 +2111,9 @@ export namespace google { /** Key testingOptions. */ public testingOptions?: (google.cloud.recaptchaenterprise.v1.ITestingOptions|null); + /** Key wafSettings. */ + public wafSettings?: (google.cloud.recaptchaenterprise.v1.IWafSettings|null); + /** Key platformSettings. */ public platformSettings?: ("webSettings"|"androidSettings"|"iosSettings"); @@ -3306,8 +3312,8 @@ export namespace google { /** Properties of a SearchRelatedAccountGroupMembershipsRequest. */ interface ISearchRelatedAccountGroupMembershipsRequest { - /** SearchRelatedAccountGroupMembershipsRequest parent */ - parent?: (string|null); + /** SearchRelatedAccountGroupMembershipsRequest project */ + project?: (string|null); /** SearchRelatedAccountGroupMembershipsRequest hashedAccountId */ hashedAccountId?: (Uint8Array|string|null); @@ -3328,8 +3334,8 @@ export namespace google { */ constructor(properties?: google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest); - /** SearchRelatedAccountGroupMembershipsRequest parent. */ - public parent: string; + /** SearchRelatedAccountGroupMembershipsRequest project. */ + public project: string; /** SearchRelatedAccountGroupMembershipsRequest hashedAccountId. */ public hashedAccountId: (Uint8Array|string); @@ -3692,6 +3698,119 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } + + /** Properties of a WafSettings. */ + interface IWafSettings { + + /** WafSettings wafService */ + wafService?: (google.cloud.recaptchaenterprise.v1.WafSettings.WafService|keyof typeof google.cloud.recaptchaenterprise.v1.WafSettings.WafService|null); + + /** WafSettings wafFeature */ + wafFeature?: (google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature|keyof typeof google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature|null); + } + + /** Represents a WafSettings. */ + class WafSettings implements IWafSettings { + + /** + * Constructs a new WafSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IWafSettings); + + /** WafSettings wafService. */ + public wafService: (google.cloud.recaptchaenterprise.v1.WafSettings.WafService|keyof typeof google.cloud.recaptchaenterprise.v1.WafSettings.WafService); + + /** WafSettings wafFeature. */ + public wafFeature: (google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature|keyof typeof google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature); + + /** + * Creates a new WafSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns WafSettings instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IWafSettings): google.cloud.recaptchaenterprise.v1.WafSettings; + + /** + * Encodes the specified WafSettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.WafSettings.verify|verify} messages. + * @param message WafSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IWafSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WafSettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.WafSettings.verify|verify} messages. + * @param message WafSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IWafSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WafSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WafSettings + * @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.WafSettings; + + /** + * Decodes a WafSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WafSettings + * @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.WafSettings; + + /** + * Verifies a WafSettings 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 WafSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WafSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.WafSettings; + + /** + * Creates a plain object from a WafSettings message. Also converts values to other types if specified. + * @param message WafSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.WafSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WafSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace WafSettings { + + /** WafFeature enum. */ + enum WafFeature { + WAF_FEATURE_UNSPECIFIED = 0, + CHALLENGE_PAGE = 1, + SESSION_TOKEN = 2, + ACTION_TOKEN = 3 + } + + /** WafService enum. */ + enum WafService { + WAF_SERVICE_UNSPECIFIED = 0, + CA = 1 + } + } } /** Namespace v1beta1. */ diff --git a/protos/protos.js b/protos/protos.js index b798ec9..ee43780 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -4754,6 +4754,7 @@ * @property {Object.|null} [labels] Key labels * @property {google.protobuf.ITimestamp|null} [createTime] Key createTime * @property {google.cloud.recaptchaenterprise.v1.ITestingOptions|null} [testingOptions] Key testingOptions + * @property {google.cloud.recaptchaenterprise.v1.IWafSettings|null} [wafSettings] Key wafSettings */ /** @@ -4836,6 +4837,14 @@ */ Key.prototype.testingOptions = null; + /** + * Key wafSettings. + * @member {google.cloud.recaptchaenterprise.v1.IWafSettings|null|undefined} wafSettings + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + */ + Key.prototype.wafSettings = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -4891,6 +4900,8 @@ $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.testingOptions != null && Object.hasOwnProperty.call(message, "testingOptions")) $root.google.cloud.recaptchaenterprise.v1.TestingOptions.encode(message.testingOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.wafSettings != null && Object.hasOwnProperty.call(message, "wafSettings")) + $root.google.cloud.recaptchaenterprise.v1.WafSettings.encode(message.wafSettings, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; @@ -4968,6 +4979,9 @@ case 9: message.testingOptions = $root.google.cloud.recaptchaenterprise.v1.TestingOptions.decode(reader, reader.uint32()); break; + case 10: + message.wafSettings = $root.google.cloud.recaptchaenterprise.v1.WafSettings.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -5056,6 +5070,11 @@ if (error) return "testingOptions." + error; } + if (message.wafSettings != null && message.hasOwnProperty("wafSettings")) { + var error = $root.google.cloud.recaptchaenterprise.v1.WafSettings.verify(message.wafSettings); + if (error) + return "wafSettings." + error; + } return null; }; @@ -5107,6 +5126,11 @@ throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.testingOptions: object expected"); message.testingOptions = $root.google.cloud.recaptchaenterprise.v1.TestingOptions.fromObject(object.testingOptions); } + if (object.wafSettings != null) { + if (typeof object.wafSettings !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.wafSettings: object expected"); + message.wafSettings = $root.google.cloud.recaptchaenterprise.v1.WafSettings.fromObject(object.wafSettings); + } return message; }; @@ -5130,6 +5154,7 @@ object.displayName = ""; object.createTime = null; object.testingOptions = null; + object.wafSettings = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -5160,6 +5185,8 @@ object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.testingOptions != null && message.hasOwnProperty("testingOptions")) object.testingOptions = $root.google.cloud.recaptchaenterprise.v1.TestingOptions.toObject(message.testingOptions, options); + if (message.wafSettings != null && message.hasOwnProperty("wafSettings")) + object.wafSettings = $root.google.cloud.recaptchaenterprise.v1.WafSettings.toObject(message.wafSettings, options); return object; }; @@ -7982,7 +8009,7 @@ * Properties of a SearchRelatedAccountGroupMembershipsRequest. * @memberof google.cloud.recaptchaenterprise.v1 * @interface ISearchRelatedAccountGroupMembershipsRequest - * @property {string|null} [parent] SearchRelatedAccountGroupMembershipsRequest parent + * @property {string|null} [project] SearchRelatedAccountGroupMembershipsRequest project * @property {Uint8Array|null} [hashedAccountId] SearchRelatedAccountGroupMembershipsRequest hashedAccountId * @property {number|null} [pageSize] SearchRelatedAccountGroupMembershipsRequest pageSize * @property {string|null} [pageToken] SearchRelatedAccountGroupMembershipsRequest pageToken @@ -8004,12 +8031,12 @@ } /** - * SearchRelatedAccountGroupMembershipsRequest parent. - * @member {string} parent + * SearchRelatedAccountGroupMembershipsRequest project. + * @member {string} project * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest * @instance */ - SearchRelatedAccountGroupMembershipsRequest.prototype.parent = ""; + SearchRelatedAccountGroupMembershipsRequest.prototype.project = ""; /** * SearchRelatedAccountGroupMembershipsRequest hashedAccountId. @@ -8059,8 +8086,8 @@ SearchRelatedAccountGroupMembershipsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); if (message.hashedAccountId != null && Object.hasOwnProperty.call(message, "hashedAccountId")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.hashedAccountId); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) @@ -8102,7 +8129,7 @@ var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.project = reader.string(); break; case 2: message.hashedAccountId = reader.bytes(); @@ -8148,9 +8175,9 @@ SearchRelatedAccountGroupMembershipsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) if (!(message.hashedAccountId && typeof message.hashedAccountId.length === "number" || $util.isString(message.hashedAccountId))) return "hashedAccountId: buffer expected"; @@ -8175,8 +8202,8 @@ if (object instanceof $root.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest) return object; var message = new $root.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest(); - if (object.parent != null) - message.parent = String(object.parent); + if (object.project != null) + message.project = String(object.project); if (object.hashedAccountId != null) if (typeof object.hashedAccountId === "string") $util.base64.decode(object.hashedAccountId, message.hashedAccountId = $util.newBuffer($util.base64.length(object.hashedAccountId)), 0); @@ -8203,7 +8230,7 @@ options = {}; var object = {}; if (options.defaults) { - object.parent = ""; + object.project = ""; if (options.bytes === String) object.hashedAccountId = ""; else { @@ -8214,8 +8241,8 @@ object.pageSize = 0; object.pageToken = ""; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) object.hashedAccountId = options.bytes === String ? $util.base64.encode(message.hashedAccountId, 0, message.hashedAccountId.length) : options.bytes === Array ? Array.prototype.slice.call(message.hashedAccountId) : message.hashedAccountId; if (message.pageSize != null && message.hasOwnProperty("pageSize")) @@ -8876,6 +8903,284 @@ return RelatedAccountGroup; })(); + v1.WafSettings = (function() { + + /** + * Properties of a WafSettings. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IWafSettings + * @property {google.cloud.recaptchaenterprise.v1.WafSettings.WafService|null} [wafService] WafSettings wafService + * @property {google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature|null} [wafFeature] WafSettings wafFeature + */ + + /** + * Constructs a new WafSettings. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a WafSettings. + * @implements IWafSettings + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IWafSettings=} [properties] Properties to set + */ + function WafSettings(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]]; + } + + /** + * WafSettings wafService. + * @member {google.cloud.recaptchaenterprise.v1.WafSettings.WafService} wafService + * @memberof google.cloud.recaptchaenterprise.v1.WafSettings + * @instance + */ + WafSettings.prototype.wafService = 0; + + /** + * WafSettings wafFeature. + * @member {google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature} wafFeature + * @memberof google.cloud.recaptchaenterprise.v1.WafSettings + * @instance + */ + WafSettings.prototype.wafFeature = 0; + + /** + * Creates a new WafSettings instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.WafSettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IWafSettings=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.WafSettings} WafSettings instance + */ + WafSettings.create = function create(properties) { + return new WafSettings(properties); + }; + + /** + * Encodes the specified WafSettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.WafSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.WafSettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IWafSettings} message WafSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WafSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.wafService != null && Object.hasOwnProperty.call(message, "wafService")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.wafService); + if (message.wafFeature != null && Object.hasOwnProperty.call(message, "wafFeature")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.wafFeature); + return writer; + }; + + /** + * Encodes the specified WafSettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.WafSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.WafSettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IWafSettings} message WafSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WafSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WafSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.WafSettings + * @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.WafSettings} WafSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WafSettings.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.WafSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.wafService = reader.int32(); + break; + case 2: + message.wafFeature = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WafSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.WafSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.WafSettings} WafSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WafSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WafSettings message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.WafSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WafSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.wafService != null && message.hasOwnProperty("wafService")) + switch (message.wafService) { + default: + return "wafService: enum value expected"; + case 0: + case 1: + break; + } + if (message.wafFeature != null && message.hasOwnProperty("wafFeature")) + switch (message.wafFeature) { + default: + return "wafFeature: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a WafSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.WafSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.WafSettings} WafSettings + */ + WafSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.WafSettings) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.WafSettings(); + switch (object.wafService) { + case "WAF_SERVICE_UNSPECIFIED": + case 0: + message.wafService = 0; + break; + case "CA": + case 1: + message.wafService = 1; + break; + } + switch (object.wafFeature) { + case "WAF_FEATURE_UNSPECIFIED": + case 0: + message.wafFeature = 0; + break; + case "CHALLENGE_PAGE": + case 1: + message.wafFeature = 1; + break; + case "SESSION_TOKEN": + case 2: + message.wafFeature = 2; + break; + case "ACTION_TOKEN": + case 3: + message.wafFeature = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a WafSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.WafSettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.WafSettings} message WafSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WafSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.wafService = options.enums === String ? "WAF_SERVICE_UNSPECIFIED" : 0; + object.wafFeature = options.enums === String ? "WAF_FEATURE_UNSPECIFIED" : 0; + } + if (message.wafService != null && message.hasOwnProperty("wafService")) + object.wafService = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.WafSettings.WafService[message.wafService] : message.wafService; + if (message.wafFeature != null && message.hasOwnProperty("wafFeature")) + object.wafFeature = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature[message.wafFeature] : message.wafFeature; + return object; + }; + + /** + * Converts this WafSettings to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.WafSettings + * @instance + * @returns {Object.} JSON object + */ + WafSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * WafFeature enum. + * @name google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature + * @enum {number} + * @property {number} WAF_FEATURE_UNSPECIFIED=0 WAF_FEATURE_UNSPECIFIED value + * @property {number} CHALLENGE_PAGE=1 CHALLENGE_PAGE value + * @property {number} SESSION_TOKEN=2 SESSION_TOKEN value + * @property {number} ACTION_TOKEN=3 ACTION_TOKEN value + */ + WafSettings.WafFeature = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WAF_FEATURE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CHALLENGE_PAGE"] = 1; + values[valuesById[2] = "SESSION_TOKEN"] = 2; + values[valuesById[3] = "ACTION_TOKEN"] = 3; + return values; + })(); + + /** + * WafService enum. + * @name google.cloud.recaptchaenterprise.v1.WafSettings.WafService + * @enum {number} + * @property {number} WAF_SERVICE_UNSPECIFIED=0 WAF_SERVICE_UNSPECIFIED value + * @property {number} CA=1 CA value + */ + WafSettings.WafService = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WAF_SERVICE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CA"] = 1; + return values; + })(); + + return WafSettings; + })(); + return v1; })(); diff --git a/protos/protos.json b/protos/protos.json index 6b0daf1..cc2b5b0 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -212,19 +212,19 @@ "requestType": "SearchRelatedAccountGroupMembershipsRequest", "responseType": "SearchRelatedAccountGroupMembershipsResponse", "options": { - "(google.api.http).post": "/v1/{parent=projects/*}/relatedaccountgroupmemberships:search", + "(google.api.http).post": "/v1/{project=projects/*}/relatedaccountgroupmemberships:search", "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,hashed_account_id" + "(google.api.method_signature)": "project,hashed_account_id" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v1/{parent=projects/*}/relatedaccountgroupmemberships:search", + "post": "/v1/{project=projects/*}/relatedaccountgroupmemberships:search", "body": "*" } }, { - "(google.api.method_signature)": "parent,hashed_account_id" + "(google.api.method_signature)": "project,hashed_account_id" } ] } @@ -676,6 +676,10 @@ "testingOptions": { "type": "TestingOptions", "id": 9 + }, + "wafSettings": { + "type": "WafSettings", + "id": 10 } } }, @@ -894,7 +898,7 @@ }, "SearchRelatedAccountGroupMembershipsRequest": { "fields": { - "parent": { + "project": { "type": "string", "id": 1, "options": { @@ -973,6 +977,40 @@ } } } + }, + "WafSettings": { + "fields": { + "wafService": { + "type": "WafService", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "wafFeature": { + "type": "WafFeature", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "WafFeature": { + "values": { + "WAF_FEATURE_UNSPECIFIED": 0, + "CHALLENGE_PAGE": 1, + "SESSION_TOKEN": 2, + "ACTION_TOKEN": 3 + } + }, + "WafService": { + "values": { + "WAF_SERVICE_UNSPECIFIED": 0, + "CA": 1 + } + } + } } } }, diff --git a/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js b/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js index 4c02dc4..863ac5b 100644 --- a/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js +++ b/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js @@ -20,7 +20,7 @@ 'use strict'; -function main(parent) { +function main(project) { // [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_SearchRelatedAccountGroupMemberships_async] /** * TODO(developer): Uncomment these variables before running the sample. @@ -29,7 +29,7 @@ function main(parent) { * Required. The name of the project to search related account group memberships from, * in the format "projects/{project}". */ - // const parent = 'abc123' + // const project = 'my-project' /** * Optional. The unique stable hashed user identifier we should search connections to. * The identifier should correspond to a `hashed_account_id` provided in a @@ -62,7 +62,7 @@ function main(parent) { async function callSearchRelatedAccountGroupMemberships() { // Construct request const request = { - parent, + project, }; // Run request diff --git a/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json b/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json index 4427fd0..578b6b4 100644 --- a/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json +++ b/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json @@ -520,7 +520,7 @@ "async": true, "parameters": [ { - "name": "parent", + "name": "project", "type": "TYPE_STRING" }, { diff --git a/src/v1/recaptcha_enterprise_service_client.ts b/src/v1/recaptcha_enterprise_service_client.ts index c0be33b..b4ed5ed 100644 --- a/src/v1/recaptcha_enterprise_service_client.ts +++ b/src/v1/recaptcha_enterprise_service_client.ts @@ -1776,7 +1776,7 @@ export class RecaptchaEnterpriseServiceClient { * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent + * @param {string} request.project * Required. The name of the project to search related account group memberships from, * in the format "projects/{project}". * @param {Buffer} [request.hashedAccountId] @@ -1878,7 +1878,7 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ - parent: request.parent || '', + project: request.project || '', }); this.initialize(); return this.innerApiCalls.searchRelatedAccountGroupMemberships( @@ -1892,7 +1892,7 @@ export class RecaptchaEnterpriseServiceClient { * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. - * @param {string} request.parent + * @param {string} request.project * Required. The name of the project to search related account group memberships from, * in the format "projects/{project}". * @param {Buffer} [request.hashedAccountId] @@ -1934,7 +1934,7 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ - parent: request.parent || '', + project: request.project || '', }); const defaultCallSettings = this._defaults['searchRelatedAccountGroupMemberships']; @@ -1953,7 +1953,7 @@ export class RecaptchaEnterpriseServiceClient { * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. - * @param {string} request.parent + * @param {string} request.project * Required. The name of the project to search related account group memberships from, * in the format "projects/{project}". * @param {Buffer} [request.hashedAccountId] @@ -1996,7 +1996,7 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ - parent: request.parent || '', + project: request.project || '', }); const defaultCallSettings = this._defaults['searchRelatedAccountGroupMemberships']; diff --git a/test/gapic_recaptcha_enterprise_service_v1.ts b/test/gapic_recaptcha_enterprise_service_v1.ts index 3f4a957..eb80d91 100644 --- a/test/gapic_recaptcha_enterprise_service_v1.ts +++ b/test/gapic_recaptcha_enterprise_service_v1.ts @@ -2363,8 +2363,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.project = ''; + const expectedHeaderRequestParams = 'project='; const expectedOptions = { otherArgs: { headers: { @@ -2408,8 +2408,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.project = ''; + const expectedHeaderRequestParams = 'project='; const expectedOptions = { otherArgs: { headers: { @@ -2468,8 +2468,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.project = ''; + const expectedHeaderRequestParams = 'project='; const expectedOptions = { otherArgs: { headers: { @@ -2503,8 +2503,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.project = ''; + const expectedHeaderRequestParams = 'project='; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() @@ -2571,8 +2571,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.project = ''; + const expectedHeaderRequestParams = 'project='; const expectedError = new Error('expected'); client.descriptors.page.searchRelatedAccountGroupMemberships.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2628,8 +2628,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.project = ''; + const expectedHeaderRequestParams = 'project='; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() @@ -2679,8 +2679,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.project = ''; + const expectedHeaderRequestParams = 'project='; const expectedError = new Error('expected'); client.descriptors.page.searchRelatedAccountGroupMemberships.asyncIterate = stubAsyncIterationCall(undefined, expectedError);