google-cloud-recaptcha_enterprise-v1 0.15.0 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -179,7 +179,7 @@ module Google
179
179
  #
180
180
  # @param parent [::String]
181
181
  # Required. The name of the project in which the assessment will be created,
182
- # in the format "projects/\\{project}".
182
+ # in the format `projects/{project}`.
183
183
  # @param assessment [::Google::Cloud::RecaptchaEnterprise::V1::Assessment, ::Hash]
184
184
  # Required. The assessment details.
185
185
  #
@@ -261,27 +261,29 @@ module Google
261
261
  # @param options [::Gapic::CallOptions, ::Hash]
262
262
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
263
263
  #
264
- # @overload annotate_assessment(name: nil, annotation: nil, reasons: nil, hashed_account_id: nil, transaction_event: nil)
264
+ # @overload annotate_assessment(name: nil, annotation: nil, reasons: nil, account_id: nil, hashed_account_id: nil, transaction_event: nil)
265
265
  # Pass arguments to `annotate_assessment` via keyword arguments. Note that at
266
266
  # least one keyword argument is required. To specify no parameters, or to keep all
267
267
  # the default parameter values, pass an empty Hash as a request object (see above).
268
268
  #
269
269
  # @param name [::String]
270
270
  # Required. The resource name of the Assessment, in the format
271
- # "projects/\\{project}/assessments/\\{assessment}".
271
+ # `projects/{project}/assessments/{assessment}`.
272
272
  # @param annotation [::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest::Annotation]
273
273
  # Optional. The annotation that will be assigned to the Event. This field can
274
274
  # be left empty to provide reasons that apply to an event without concluding
275
275
  # whether the event is legitimate or fraudulent.
276
276
  # @param reasons [::Array<::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest::Reason>]
277
- # Optional. Optional reasons for the annotation that will be assigned to the
278
- # Event.
277
+ # Optional. Reasons for the annotation that are assigned to the event.
278
+ # @param account_id [::String]
279
+ # Optional. A stable account identifier to apply to the assessment. This is
280
+ # an alternative to setting `account_id` in `CreateAssessment`, for example
281
+ # when a stable account identifier is not yet known in the initial request.
279
282
  # @param hashed_account_id [::String]
280
- # Optional. Unique stable hashed user identifier to apply to the assessment.
281
- # This is an alternative to setting the hashed_account_id in
282
- # CreateAssessment, for example when the account identifier is not yet known
283
- # in the initial request. It is recommended that the identifier is hashed
284
- # using hmac-sha256 with stable secret.
283
+ # Optional. A stable hashed account identifier to apply to the assessment.
284
+ # This is an alternative to setting `hashed_account_id` in
285
+ # `CreateAssessment`, for example when a stable account identifier is not yet
286
+ # known in the initial request.
285
287
  # @param transaction_event [::Google::Cloud::RecaptchaEnterprise::V1::TransactionEvent, ::Hash]
286
288
  # Optional. If the assessment is part of a payment transaction, provide
287
289
  # details on payment lifecycle events that occur in the transaction.
@@ -370,7 +372,7 @@ module Google
370
372
  #
371
373
  # @param parent [::String]
372
374
  # Required. The name of the project in which the key will be created, in the
373
- # format "projects/\\{project}".
375
+ # format `projects/{project}`.
374
376
  # @param key [::Google::Cloud::RecaptchaEnterprise::V1::Key, ::Hash]
375
377
  # Required. Information to create a reCAPTCHA Enterprise key.
376
378
  #
@@ -458,7 +460,7 @@ module Google
458
460
  #
459
461
  # @param parent [::String]
460
462
  # Required. The name of the project that contains the keys that will be
461
- # listed, in the format "projects/\\{project}".
463
+ # listed, in the format `projects/{project}`.
462
464
  # @param page_size [::Integer]
463
465
  # Optional. The maximum number of keys to return. Default is 10. Max limit is
464
466
  # 1000.
@@ -557,7 +559,7 @@ module Google
557
559
  #
558
560
  # @param key [::String]
559
561
  # Required. The public key name linked to the requested secret key in the
560
- # format "projects/\\{project}/keys/\\{key}".
562
+ # format `projects/{project}/keys/{key}`.
561
563
  #
562
564
  # @yield [response, operation] Access the result along with the RPC operation
563
565
  # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyResponse]
@@ -643,7 +645,7 @@ module Google
643
645
  #
644
646
  # @param name [::String]
645
647
  # Required. The name of the requested key, in the format
646
- # "projects/\\{project}/keys/\\{key}".
648
+ # `projects/{project}/keys/{key}`.
647
649
  #
648
650
  # @yield [response, operation] Access the result along with the RPC operation
649
651
  # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::Key]
@@ -817,7 +819,7 @@ module Google
817
819
  #
818
820
  # @param name [::String]
819
821
  # Required. The name of the key to be deleted, in the format
820
- # "projects/\\{project}/keys/\\{key}".
822
+ # `projects/{project}/keys/{key}`.
821
823
  #
822
824
  # @yield [response, operation] Access the result along with the RPC operation
823
825
  # @yieldparam response [::Google::Protobuf::Empty]
@@ -887,7 +889,7 @@ module Google
887
889
  # Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise.
888
890
  # Once a key is migrated, it can be used from either product. SiteVerify
889
891
  # requests are billed as CreateAssessment calls. You must be
890
- # authenticated as one of the current owners of the reCAPTCHA Site Key, and
892
+ # authenticated as one of the current owners of the reCAPTCHA Key, and
891
893
  # your user must have the reCAPTCHA Enterprise Admin IAM role in the
892
894
  # destination project.
893
895
  #
@@ -908,7 +910,7 @@ module Google
908
910
  #
909
911
  # @param name [::String]
910
912
  # Required. The name of the key to be migrated, in the format
911
- # "projects/\\{project}/keys/\\{key}".
913
+ # `projects/{project}/keys/{key}`.
912
914
  # @param skip_billing_check [::Boolean]
913
915
  # Optional. If true, skips the billing check.
914
916
  # A reCAPTCHA Enterprise key or migrated key behaves differently than a
@@ -1004,7 +1006,7 @@ module Google
1004
1006
  #
1005
1007
  # @param name [::String]
1006
1008
  # Required. The name of the requested metrics, in the format
1007
- # "projects/\\{project}/keys/\\{key}/metrics".
1009
+ # `projects/{project}/keys/{key}/metrics`.
1008
1010
  #
1009
1011
  # @yield [response, operation] Access the result along with the RPC operation
1010
1012
  # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::Metrics]
@@ -1070,6 +1072,453 @@ module Google
1070
1072
  raise ::Google::Cloud::Error.from_error(e)
1071
1073
  end
1072
1074
 
1075
+ ##
1076
+ # Creates a new FirewallPolicy, specifying conditions at which reCAPTCHA
1077
+ # Enterprise actions can be executed.
1078
+ # A project may have a maximum of 1000 policies.
1079
+ #
1080
+ # @overload create_firewall_policy(request, options = nil)
1081
+ # Pass arguments to `create_firewall_policy` via a request object, either of type
1082
+ # {::Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest} or an equivalent Hash.
1083
+ #
1084
+ # @param request [::Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest, ::Hash]
1085
+ # A request object representing the call parameters. Required. To specify no
1086
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1087
+ # @param options [::Gapic::CallOptions, ::Hash]
1088
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1089
+ #
1090
+ # @overload create_firewall_policy(parent: nil, firewall_policy: nil)
1091
+ # Pass arguments to `create_firewall_policy` via keyword arguments. Note that at
1092
+ # least one keyword argument is required. To specify no parameters, or to keep all
1093
+ # the default parameter values, pass an empty Hash as a request object (see above).
1094
+ #
1095
+ # @param parent [::String]
1096
+ # Required. The name of the project this policy will apply to, in the format
1097
+ # `projects/{project}`.
1098
+ # @param firewall_policy [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy, ::Hash]
1099
+ # Required. Information to create the policy.
1100
+ #
1101
+ # @yield [response, operation] Access the result along with the RPC operation
1102
+ # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy]
1103
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1104
+ #
1105
+ # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy]
1106
+ #
1107
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1108
+ #
1109
+ # @example Basic example
1110
+ # require "google/cloud/recaptcha_enterprise/v1"
1111
+ #
1112
+ # # Create a client object. The client can be reused for multiple calls.
1113
+ # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new
1114
+ #
1115
+ # # Create a request. To set request fields, pass in keyword arguments.
1116
+ # request = Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest.new
1117
+ #
1118
+ # # Call the create_firewall_policy method.
1119
+ # result = client.create_firewall_policy request
1120
+ #
1121
+ # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy.
1122
+ # p result
1123
+ #
1124
+ def create_firewall_policy request, options = nil
1125
+ raise ::ArgumentError, "request must be provided" if request.nil?
1126
+
1127
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest
1128
+
1129
+ # Converts hash and nil to an options object
1130
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1131
+
1132
+ # Customize the options with defaults
1133
+ metadata = @config.rpcs.create_firewall_policy.metadata.to_h
1134
+
1135
+ # Set x-goog-api-client and x-goog-user-project headers
1136
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1137
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1138
+ gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
1139
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1140
+
1141
+ header_params = {}
1142
+ if request.parent
1143
+ header_params["parent"] = request.parent
1144
+ end
1145
+
1146
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1147
+ metadata[:"x-goog-request-params"] ||= request_params_header
1148
+
1149
+ options.apply_defaults timeout: @config.rpcs.create_firewall_policy.timeout,
1150
+ metadata: metadata,
1151
+ retry_policy: @config.rpcs.create_firewall_policy.retry_policy
1152
+
1153
+ options.apply_defaults timeout: @config.timeout,
1154
+ metadata: @config.metadata,
1155
+ retry_policy: @config.retry_policy
1156
+
1157
+ @recaptcha_enterprise_service_stub.call_rpc :create_firewall_policy, request, options: options do |response, operation|
1158
+ yield response, operation if block_given?
1159
+ return response
1160
+ end
1161
+ rescue ::GRPC::BadStatus => e
1162
+ raise ::Google::Cloud::Error.from_error(e)
1163
+ end
1164
+
1165
+ ##
1166
+ # Returns the list of all firewall policies that belong to a project.
1167
+ #
1168
+ # @overload list_firewall_policies(request, options = nil)
1169
+ # Pass arguments to `list_firewall_policies` via a request object, either of type
1170
+ # {::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest} or an equivalent Hash.
1171
+ #
1172
+ # @param request [::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest, ::Hash]
1173
+ # A request object representing the call parameters. Required. To specify no
1174
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1175
+ # @param options [::Gapic::CallOptions, ::Hash]
1176
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1177
+ #
1178
+ # @overload list_firewall_policies(parent: nil, page_size: nil, page_token: nil)
1179
+ # Pass arguments to `list_firewall_policies` via keyword arguments. Note that at
1180
+ # least one keyword argument is required. To specify no parameters, or to keep all
1181
+ # the default parameter values, pass an empty Hash as a request object (see above).
1182
+ #
1183
+ # @param parent [::String]
1184
+ # Required. The name of the project to list the policies for, in the format
1185
+ # `projects/{project}`.
1186
+ # @param page_size [::Integer]
1187
+ # Optional. The maximum number of policies to return. Default is 10. Max
1188
+ # limit is 1000.
1189
+ # @param page_token [::String]
1190
+ # Optional. The next_page_token value returned from a previous.
1191
+ # ListFirewallPoliciesRequest, if any.
1192
+ #
1193
+ # @yield [response, operation] Access the result along with the RPC operation
1194
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy>]
1195
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1196
+ #
1197
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy>]
1198
+ #
1199
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1200
+ #
1201
+ # @example Basic example
1202
+ # require "google/cloud/recaptcha_enterprise/v1"
1203
+ #
1204
+ # # Create a client object. The client can be reused for multiple calls.
1205
+ # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new
1206
+ #
1207
+ # # Create a request. To set request fields, pass in keyword arguments.
1208
+ # request = Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest.new
1209
+ #
1210
+ # # Call the list_firewall_policies method.
1211
+ # result = client.list_firewall_policies request
1212
+ #
1213
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1214
+ # # over elements, and API calls will be issued to fetch pages as needed.
1215
+ # result.each do |item|
1216
+ # # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy.
1217
+ # p item
1218
+ # end
1219
+ #
1220
+ def list_firewall_policies request, options = nil
1221
+ raise ::ArgumentError, "request must be provided" if request.nil?
1222
+
1223
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest
1224
+
1225
+ # Converts hash and nil to an options object
1226
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1227
+
1228
+ # Customize the options with defaults
1229
+ metadata = @config.rpcs.list_firewall_policies.metadata.to_h
1230
+
1231
+ # Set x-goog-api-client and x-goog-user-project headers
1232
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1233
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1234
+ gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
1235
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1236
+
1237
+ header_params = {}
1238
+ if request.parent
1239
+ header_params["parent"] = request.parent
1240
+ end
1241
+
1242
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1243
+ metadata[:"x-goog-request-params"] ||= request_params_header
1244
+
1245
+ options.apply_defaults timeout: @config.rpcs.list_firewall_policies.timeout,
1246
+ metadata: metadata,
1247
+ retry_policy: @config.rpcs.list_firewall_policies.retry_policy
1248
+
1249
+ options.apply_defaults timeout: @config.timeout,
1250
+ metadata: @config.metadata,
1251
+ retry_policy: @config.retry_policy
1252
+
1253
+ @recaptcha_enterprise_service_stub.call_rpc :list_firewall_policies, request, options: options do |response, operation|
1254
+ response = ::Gapic::PagedEnumerable.new @recaptcha_enterprise_service_stub, :list_firewall_policies, request, response, operation, options
1255
+ yield response, operation if block_given?
1256
+ return response
1257
+ end
1258
+ rescue ::GRPC::BadStatus => e
1259
+ raise ::Google::Cloud::Error.from_error(e)
1260
+ end
1261
+
1262
+ ##
1263
+ # Returns the specified firewall policy.
1264
+ #
1265
+ # @overload get_firewall_policy(request, options = nil)
1266
+ # Pass arguments to `get_firewall_policy` via a request object, either of type
1267
+ # {::Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest} or an equivalent Hash.
1268
+ #
1269
+ # @param request [::Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest, ::Hash]
1270
+ # A request object representing the call parameters. Required. To specify no
1271
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1272
+ # @param options [::Gapic::CallOptions, ::Hash]
1273
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1274
+ #
1275
+ # @overload get_firewall_policy(name: nil)
1276
+ # Pass arguments to `get_firewall_policy` via keyword arguments. Note that at
1277
+ # least one keyword argument is required. To specify no parameters, or to keep all
1278
+ # the default parameter values, pass an empty Hash as a request object (see above).
1279
+ #
1280
+ # @param name [::String]
1281
+ # Required. The name of the requested policy, in the format
1282
+ # `projects/{project}/firewallpolicies/{firewallpolicy}`.
1283
+ #
1284
+ # @yield [response, operation] Access the result along with the RPC operation
1285
+ # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy]
1286
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1287
+ #
1288
+ # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy]
1289
+ #
1290
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1291
+ #
1292
+ # @example Basic example
1293
+ # require "google/cloud/recaptcha_enterprise/v1"
1294
+ #
1295
+ # # Create a client object. The client can be reused for multiple calls.
1296
+ # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new
1297
+ #
1298
+ # # Create a request. To set request fields, pass in keyword arguments.
1299
+ # request = Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest.new
1300
+ #
1301
+ # # Call the get_firewall_policy method.
1302
+ # result = client.get_firewall_policy request
1303
+ #
1304
+ # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy.
1305
+ # p result
1306
+ #
1307
+ def get_firewall_policy request, options = nil
1308
+ raise ::ArgumentError, "request must be provided" if request.nil?
1309
+
1310
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest
1311
+
1312
+ # Converts hash and nil to an options object
1313
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1314
+
1315
+ # Customize the options with defaults
1316
+ metadata = @config.rpcs.get_firewall_policy.metadata.to_h
1317
+
1318
+ # Set x-goog-api-client and x-goog-user-project headers
1319
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1320
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1321
+ gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
1322
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1323
+
1324
+ header_params = {}
1325
+ if request.name
1326
+ header_params["name"] = request.name
1327
+ end
1328
+
1329
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1330
+ metadata[:"x-goog-request-params"] ||= request_params_header
1331
+
1332
+ options.apply_defaults timeout: @config.rpcs.get_firewall_policy.timeout,
1333
+ metadata: metadata,
1334
+ retry_policy: @config.rpcs.get_firewall_policy.retry_policy
1335
+
1336
+ options.apply_defaults timeout: @config.timeout,
1337
+ metadata: @config.metadata,
1338
+ retry_policy: @config.retry_policy
1339
+
1340
+ @recaptcha_enterprise_service_stub.call_rpc :get_firewall_policy, request, options: options do |response, operation|
1341
+ yield response, operation if block_given?
1342
+ return response
1343
+ end
1344
+ rescue ::GRPC::BadStatus => e
1345
+ raise ::Google::Cloud::Error.from_error(e)
1346
+ end
1347
+
1348
+ ##
1349
+ # Updates the specified firewall policy.
1350
+ #
1351
+ # @overload update_firewall_policy(request, options = nil)
1352
+ # Pass arguments to `update_firewall_policy` via a request object, either of type
1353
+ # {::Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest} or an equivalent Hash.
1354
+ #
1355
+ # @param request [::Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest, ::Hash]
1356
+ # A request object representing the call parameters. Required. To specify no
1357
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1358
+ # @param options [::Gapic::CallOptions, ::Hash]
1359
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1360
+ #
1361
+ # @overload update_firewall_policy(firewall_policy: nil, update_mask: nil)
1362
+ # Pass arguments to `update_firewall_policy` via keyword arguments. Note that at
1363
+ # least one keyword argument is required. To specify no parameters, or to keep all
1364
+ # the default parameter values, pass an empty Hash as a request object (see above).
1365
+ #
1366
+ # @param firewall_policy [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy, ::Hash]
1367
+ # Required. The policy to update.
1368
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1369
+ # Optional. The mask to control which fields of the policy get updated. If
1370
+ # the mask is not present, all fields will be updated.
1371
+ #
1372
+ # @yield [response, operation] Access the result along with the RPC operation
1373
+ # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy]
1374
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1375
+ #
1376
+ # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy]
1377
+ #
1378
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1379
+ #
1380
+ # @example Basic example
1381
+ # require "google/cloud/recaptcha_enterprise/v1"
1382
+ #
1383
+ # # Create a client object. The client can be reused for multiple calls.
1384
+ # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new
1385
+ #
1386
+ # # Create a request. To set request fields, pass in keyword arguments.
1387
+ # request = Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest.new
1388
+ #
1389
+ # # Call the update_firewall_policy method.
1390
+ # result = client.update_firewall_policy request
1391
+ #
1392
+ # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy.
1393
+ # p result
1394
+ #
1395
+ def update_firewall_policy request, options = nil
1396
+ raise ::ArgumentError, "request must be provided" if request.nil?
1397
+
1398
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest
1399
+
1400
+ # Converts hash and nil to an options object
1401
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1402
+
1403
+ # Customize the options with defaults
1404
+ metadata = @config.rpcs.update_firewall_policy.metadata.to_h
1405
+
1406
+ # Set x-goog-api-client and x-goog-user-project headers
1407
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1408
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1409
+ gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
1410
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1411
+
1412
+ header_params = {}
1413
+ if request.firewall_policy&.name
1414
+ header_params["firewall_policy.name"] = request.firewall_policy.name
1415
+ end
1416
+
1417
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1418
+ metadata[:"x-goog-request-params"] ||= request_params_header
1419
+
1420
+ options.apply_defaults timeout: @config.rpcs.update_firewall_policy.timeout,
1421
+ metadata: metadata,
1422
+ retry_policy: @config.rpcs.update_firewall_policy.retry_policy
1423
+
1424
+ options.apply_defaults timeout: @config.timeout,
1425
+ metadata: @config.metadata,
1426
+ retry_policy: @config.retry_policy
1427
+
1428
+ @recaptcha_enterprise_service_stub.call_rpc :update_firewall_policy, request, options: options do |response, operation|
1429
+ yield response, operation if block_given?
1430
+ return response
1431
+ end
1432
+ rescue ::GRPC::BadStatus => e
1433
+ raise ::Google::Cloud::Error.from_error(e)
1434
+ end
1435
+
1436
+ ##
1437
+ # Deletes the specified firewall policy.
1438
+ #
1439
+ # @overload delete_firewall_policy(request, options = nil)
1440
+ # Pass arguments to `delete_firewall_policy` via a request object, either of type
1441
+ # {::Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest} or an equivalent Hash.
1442
+ #
1443
+ # @param request [::Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest, ::Hash]
1444
+ # A request object representing the call parameters. Required. To specify no
1445
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1446
+ # @param options [::Gapic::CallOptions, ::Hash]
1447
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1448
+ #
1449
+ # @overload delete_firewall_policy(name: nil)
1450
+ # Pass arguments to `delete_firewall_policy` via keyword arguments. Note that at
1451
+ # least one keyword argument is required. To specify no parameters, or to keep all
1452
+ # the default parameter values, pass an empty Hash as a request object (see above).
1453
+ #
1454
+ # @param name [::String]
1455
+ # Required. The name of the policy to be deleted, in the format
1456
+ # `projects/{project}/firewallpolicies/{firewallpolicy}`.
1457
+ #
1458
+ # @yield [response, operation] Access the result along with the RPC operation
1459
+ # @yieldparam response [::Google::Protobuf::Empty]
1460
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1461
+ #
1462
+ # @return [::Google::Protobuf::Empty]
1463
+ #
1464
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1465
+ #
1466
+ # @example Basic example
1467
+ # require "google/cloud/recaptcha_enterprise/v1"
1468
+ #
1469
+ # # Create a client object. The client can be reused for multiple calls.
1470
+ # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new
1471
+ #
1472
+ # # Create a request. To set request fields, pass in keyword arguments.
1473
+ # request = Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest.new
1474
+ #
1475
+ # # Call the delete_firewall_policy method.
1476
+ # result = client.delete_firewall_policy request
1477
+ #
1478
+ # # The returned object is of type Google::Protobuf::Empty.
1479
+ # p result
1480
+ #
1481
+ def delete_firewall_policy request, options = nil
1482
+ raise ::ArgumentError, "request must be provided" if request.nil?
1483
+
1484
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest
1485
+
1486
+ # Converts hash and nil to an options object
1487
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1488
+
1489
+ # Customize the options with defaults
1490
+ metadata = @config.rpcs.delete_firewall_policy.metadata.to_h
1491
+
1492
+ # Set x-goog-api-client and x-goog-user-project headers
1493
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1494
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1495
+ gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
1496
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1497
+
1498
+ header_params = {}
1499
+ if request.name
1500
+ header_params["name"] = request.name
1501
+ end
1502
+
1503
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1504
+ metadata[:"x-goog-request-params"] ||= request_params_header
1505
+
1506
+ options.apply_defaults timeout: @config.rpcs.delete_firewall_policy.timeout,
1507
+ metadata: metadata,
1508
+ retry_policy: @config.rpcs.delete_firewall_policy.retry_policy
1509
+
1510
+ options.apply_defaults timeout: @config.timeout,
1511
+ metadata: @config.metadata,
1512
+ retry_policy: @config.retry_policy
1513
+
1514
+ @recaptcha_enterprise_service_stub.call_rpc :delete_firewall_policy, request, options: options do |response, operation|
1515
+ yield response, operation if block_given?
1516
+ return response
1517
+ end
1518
+ rescue ::GRPC::BadStatus => e
1519
+ raise ::Google::Cloud::Error.from_error(e)
1520
+ end
1521
+
1073
1522
  ##
1074
1523
  # List groups of related accounts.
1075
1524
  #
@@ -1090,7 +1539,7 @@ module Google
1090
1539
  #
1091
1540
  # @param parent [::String]
1092
1541
  # Required. The name of the project to list related account groups from, in
1093
- # the format "projects/\\{project}".
1542
+ # the format `projects/{project}`.
1094
1543
  # @param page_size [::Integer]
1095
1544
  # Optional. The maximum number of groups to return. The service might return
1096
1545
  # fewer than this value. If unspecified, at most 50 groups are returned. The
@@ -1287,7 +1736,7 @@ module Google
1287
1736
  # @param options [::Gapic::CallOptions, ::Hash]
1288
1737
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1289
1738
  #
1290
- # @overload search_related_account_group_memberships(project: nil, hashed_account_id: nil, page_size: nil, page_token: nil)
1739
+ # @overload search_related_account_group_memberships(project: nil, account_id: nil, hashed_account_id: nil, page_size: nil, page_token: nil)
1291
1740
  # Pass arguments to `search_related_account_group_memberships` via keyword arguments. Note that at
1292
1741
  # least one keyword argument is required. To specify no parameters, or to keep all
1293
1742
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -1295,11 +1744,18 @@ module Google
1295
1744
  # @param project [::String]
1296
1745
  # Required. The name of the project to search related account group
1297
1746
  # memberships from. Specify the project name in the following format:
1298
- # "projects/\\{project}".
1747
+ # `projects/{project}`.
1748
+ # @param account_id [::String]
1749
+ # Optional. The unique stable account identifier used to search connections.
1750
+ # The identifier should correspond to an `account_id` provided in a previous
1751
+ # `CreateAssessment` or `AnnotateAssessment` call. Either hashed_account_id
1752
+ # or account_id must be set, but not both.
1299
1753
  # @param hashed_account_id [::String]
1300
- # Optional. The unique stable hashed user identifier we should search
1301
- # connections to. The identifier should correspond to a `hashed_account_id`
1302
- # provided in a previous `CreateAssessment` or `AnnotateAssessment` call.
1754
+ # Optional. Deprecated: use `account_id` instead.
1755
+ # The unique stable hashed account identifier used to search connections. The
1756
+ # identifier should correspond to a `hashed_account_id` provided in a
1757
+ # previous `CreateAssessment` or `AnnotateAssessment` call. Either
1758
+ # hashed_account_id or account_id must be set, but not both.
1303
1759
  # @param page_size [::Integer]
1304
1760
  # Optional. The maximum number of groups to return. The service might return
1305
1761
  # fewer than this value. If unspecified, at most 50 groups are returned. The
@@ -1578,6 +2034,31 @@ module Google
1578
2034
  #
1579
2035
  attr_reader :get_metrics
1580
2036
  ##
2037
+ # RPC-specific configuration for `create_firewall_policy`
2038
+ # @return [::Gapic::Config::Method]
2039
+ #
2040
+ attr_reader :create_firewall_policy
2041
+ ##
2042
+ # RPC-specific configuration for `list_firewall_policies`
2043
+ # @return [::Gapic::Config::Method]
2044
+ #
2045
+ attr_reader :list_firewall_policies
2046
+ ##
2047
+ # RPC-specific configuration for `get_firewall_policy`
2048
+ # @return [::Gapic::Config::Method]
2049
+ #
2050
+ attr_reader :get_firewall_policy
2051
+ ##
2052
+ # RPC-specific configuration for `update_firewall_policy`
2053
+ # @return [::Gapic::Config::Method]
2054
+ #
2055
+ attr_reader :update_firewall_policy
2056
+ ##
2057
+ # RPC-specific configuration for `delete_firewall_policy`
2058
+ # @return [::Gapic::Config::Method]
2059
+ #
2060
+ attr_reader :delete_firewall_policy
2061
+ ##
1581
2062
  # RPC-specific configuration for `list_related_account_groups`
1582
2063
  # @return [::Gapic::Config::Method]
1583
2064
  #
@@ -1615,6 +2096,16 @@ module Google
1615
2096
  @migrate_key = ::Gapic::Config::Method.new migrate_key_config
1616
2097
  get_metrics_config = parent_rpcs.get_metrics if parent_rpcs.respond_to? :get_metrics
1617
2098
  @get_metrics = ::Gapic::Config::Method.new get_metrics_config
2099
+ create_firewall_policy_config = parent_rpcs.create_firewall_policy if parent_rpcs.respond_to? :create_firewall_policy
2100
+ @create_firewall_policy = ::Gapic::Config::Method.new create_firewall_policy_config
2101
+ list_firewall_policies_config = parent_rpcs.list_firewall_policies if parent_rpcs.respond_to? :list_firewall_policies
2102
+ @list_firewall_policies = ::Gapic::Config::Method.new list_firewall_policies_config
2103
+ get_firewall_policy_config = parent_rpcs.get_firewall_policy if parent_rpcs.respond_to? :get_firewall_policy
2104
+ @get_firewall_policy = ::Gapic::Config::Method.new get_firewall_policy_config
2105
+ update_firewall_policy_config = parent_rpcs.update_firewall_policy if parent_rpcs.respond_to? :update_firewall_policy
2106
+ @update_firewall_policy = ::Gapic::Config::Method.new update_firewall_policy_config
2107
+ delete_firewall_policy_config = parent_rpcs.delete_firewall_policy if parent_rpcs.respond_to? :delete_firewall_policy
2108
+ @delete_firewall_policy = ::Gapic::Config::Method.new delete_firewall_policy_config
1618
2109
  list_related_account_groups_config = parent_rpcs.list_related_account_groups if parent_rpcs.respond_to? :list_related_account_groups
1619
2110
  @list_related_account_groups = ::Gapic::Config::Method.new list_related_account_groups_config
1620
2111
  list_related_account_group_memberships_config = parent_rpcs.list_related_account_group_memberships if parent_rpcs.respond_to? :list_related_account_group_memberships