google-cloud-secure_source_manager-v1 1.0.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -203,15 +203,27 @@ module Google
203
203
  endpoint: @config.endpoint,
204
204
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
205
205
  universe_domain: @config.universe_domain,
206
- credentials: credentials
206
+ credentials: credentials,
207
+ logger: @config.logger
207
208
  )
208
209
 
210
+ @secure_source_manager_stub.logger(stub: true)&.info do |entry|
211
+ entry.set_system_name
212
+ entry.set_service
213
+ entry.message = "Created client for #{entry.service}"
214
+ entry.set_credentials_fields credentials
215
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
216
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
217
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
218
+ end
219
+
209
220
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
210
221
  config.credentials = credentials
211
222
  config.quota_project = @quota_project_id
212
223
  config.endpoint = @secure_source_manager_stub.endpoint
213
224
  config.universe_domain = @secure_source_manager_stub.universe_domain
214
225
  config.bindings_override = @config.bindings_override
226
+ config.logger = @secure_source_manager_stub.logger if config.respond_to? :logger=
215
227
  end
216
228
 
217
229
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
@@ -220,6 +232,7 @@ module Google
220
232
  config.endpoint = @secure_source_manager_stub.endpoint
221
233
  config.universe_domain = @secure_source_manager_stub.universe_domain
222
234
  config.bindings_override = @config.bindings_override
235
+ config.logger = @secure_source_manager_stub.logger if config.respond_to? :logger=
223
236
  end
224
237
  end
225
238
 
@@ -244,6 +257,15 @@ module Google
244
257
  #
245
258
  attr_reader :iam_policy_client
246
259
 
260
+ ##
261
+ # The logger used for request/response debug logging.
262
+ #
263
+ # @return [Logger]
264
+ #
265
+ def logger
266
+ @secure_source_manager_stub.logger
267
+ end
268
+
247
269
  # Service calls
248
270
 
249
271
  ##
@@ -332,7 +354,6 @@ module Google
332
354
 
333
355
  @secure_source_manager_stub.list_instances request, options do |result, operation|
334
356
  yield result, operation if block_given?
335
- return result
336
357
  end
337
358
  rescue ::Gapic::Rest::Error => e
338
359
  raise ::Google::Cloud::Error.from_error(e)
@@ -411,7 +432,6 @@ module Google
411
432
 
412
433
  @secure_source_manager_stub.get_instance request, options do |result, operation|
413
434
  yield result, operation if block_given?
414
- return result
415
435
  end
416
436
  rescue ::Gapic::Rest::Error => e
417
437
  raise ::Google::Cloud::Error.from_error(e)
@@ -516,7 +536,7 @@ module Google
516
536
  @secure_source_manager_stub.create_instance request, options do |result, operation|
517
537
  result = ::Gapic::Operation.new result, @operations_client, options: options
518
538
  yield result, operation if block_given?
519
- return result
539
+ throw :response, result
520
540
  end
521
541
  rescue ::Gapic::Rest::Error => e
522
542
  raise ::Google::Cloud::Error.from_error(e)
@@ -617,7 +637,7 @@ module Google
617
637
  @secure_source_manager_stub.delete_instance request, options do |result, operation|
618
638
  result = ::Gapic::Operation.new result, @operations_client, options: options
619
639
  yield result, operation if block_given?
620
- return result
640
+ throw :response, result
621
641
  end
622
642
  rescue ::Gapic::Rest::Error => e
623
643
  raise ::Google::Cloud::Error.from_error(e)
@@ -638,7 +658,7 @@ module Google
638
658
  # @param options [::Gapic::CallOptions, ::Hash]
639
659
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
640
660
  #
641
- # @overload list_repositories(parent: nil, page_size: nil, page_token: nil, filter: nil)
661
+ # @overload list_repositories(parent: nil, page_size: nil, page_token: nil, filter: nil, instance: nil)
642
662
  # Pass arguments to `list_repositories` via keyword arguments. Note that at
643
663
  # least one keyword argument is required. To specify no parameters, or to keep all
644
664
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -652,6 +672,14 @@ module Google
652
672
  # A token identifying a page of results the server should return.
653
673
  # @param filter [::String]
654
674
  # Optional. Filter results.
675
+ # @param instance [::String]
676
+ # Optional. The name of the instance in which the repository is hosted,
677
+ # formatted as
678
+ # `projects/{project_number}/locations/{location_id}/instances/{instance_id}`.
679
+ # When listing repositories via
680
+ # securesourcemanager.googleapis.com (Control Plane API), this field is
681
+ # required. When listing repositories via *.sourcemanager.dev (Data Plane
682
+ # API), this field is ignored.
655
683
  # @yield [result, operation] Access the result along with the TransportOperation object
656
684
  # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Repository>]
657
685
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -710,7 +738,7 @@ module Google
710
738
  @secure_source_manager_stub.list_repositories request, options do |result, operation|
711
739
  result = ::Gapic::Rest::PagedEnumerable.new @secure_source_manager_stub, :list_repositories, "repositories", request, result, options
712
740
  yield result, operation if block_given?
713
- return result
741
+ throw :response, result
714
742
  end
715
743
  rescue ::Gapic::Rest::Error => e
716
744
  raise ::Google::Cloud::Error.from_error(e)
@@ -793,7 +821,6 @@ module Google
793
821
 
794
822
  @secure_source_manager_stub.get_repository request, options do |result, operation|
795
823
  yield result, operation if block_given?
796
- return result
797
824
  end
798
825
  rescue ::Gapic::Rest::Error => e
799
826
  raise ::Google::Cloud::Error.from_error(e)
@@ -889,7 +916,7 @@ module Google
889
916
  @secure_source_manager_stub.create_repository request, options do |result, operation|
890
917
  result = ::Gapic::Operation.new result, @operations_client, options: options
891
918
  yield result, operation if block_given?
892
- return result
919
+ throw :response, result
893
920
  end
894
921
  rescue ::Gapic::Rest::Error => e
895
922
  raise ::Google::Cloud::Error.from_error(e)
@@ -983,7 +1010,7 @@ module Google
983
1010
  @secure_source_manager_stub.delete_repository request, options do |result, operation|
984
1011
  result = ::Gapic::Operation.new result, @operations_client, options: options
985
1012
  yield result, operation if block_given?
986
- return result
1013
+ throw :response, result
987
1014
  end
988
1015
  rescue ::Gapic::Rest::Error => e
989
1016
  raise ::Google::Cloud::Error.from_error(e)
@@ -1066,7 +1093,6 @@ module Google
1066
1093
 
1067
1094
  @secure_source_manager_stub.get_iam_policy_repo request, options do |result, operation|
1068
1095
  yield result, operation if block_given?
1069
- return result
1070
1096
  end
1071
1097
  rescue ::Gapic::Rest::Error => e
1072
1098
  raise ::Google::Cloud::Error.from_error(e)
@@ -1157,7 +1183,6 @@ module Google
1157
1183
 
1158
1184
  @secure_source_manager_stub.set_iam_policy_repo request, options do |result, operation|
1159
1185
  yield result, operation if block_given?
1160
- return result
1161
1186
  end
1162
1187
  rescue ::Gapic::Rest::Error => e
1163
1188
  raise ::Google::Cloud::Error.from_error(e)
@@ -1243,7 +1268,443 @@ module Google
1243
1268
 
1244
1269
  @secure_source_manager_stub.test_iam_permissions_repo request, options do |result, operation|
1245
1270
  yield result, operation if block_given?
1246
- return result
1271
+ end
1272
+ rescue ::Gapic::Rest::Error => e
1273
+ raise ::Google::Cloud::Error.from_error(e)
1274
+ end
1275
+
1276
+ ##
1277
+ # CreateBranchRule creates a branch rule in a given repository.
1278
+ #
1279
+ # @overload create_branch_rule(request, options = nil)
1280
+ # Pass arguments to `create_branch_rule` via a request object, either of type
1281
+ # {::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest} or an equivalent Hash.
1282
+ #
1283
+ # @param request [::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest, ::Hash]
1284
+ # A request object representing the call parameters. Required. To specify no
1285
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1286
+ # @param options [::Gapic::CallOptions, ::Hash]
1287
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1288
+ #
1289
+ # @overload create_branch_rule(parent: nil, branch_rule: nil, branch_rule_id: nil)
1290
+ # Pass arguments to `create_branch_rule` via keyword arguments. Note that at
1291
+ # least one keyword argument is required. To specify no parameters, or to keep all
1292
+ # the default parameter values, pass an empty Hash as a request object (see above).
1293
+ #
1294
+ # @param parent [::String]
1295
+ # @param branch_rule [::Google::Cloud::SecureSourceManager::V1::BranchRule, ::Hash]
1296
+ # @param branch_rule_id [::String]
1297
+ # @yield [result, operation] Access the result along with the TransportOperation object
1298
+ # @yieldparam result [::Gapic::Operation]
1299
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1300
+ #
1301
+ # @return [::Gapic::Operation]
1302
+ #
1303
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1304
+ #
1305
+ # @example Basic example
1306
+ # require "google/cloud/secure_source_manager/v1"
1307
+ #
1308
+ # # Create a client object. The client can be reused for multiple calls.
1309
+ # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new
1310
+ #
1311
+ # # Create a request. To set request fields, pass in keyword arguments.
1312
+ # request = Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest.new
1313
+ #
1314
+ # # Call the create_branch_rule method.
1315
+ # result = client.create_branch_rule request
1316
+ #
1317
+ # # The returned object is of type Gapic::Operation. You can use it to
1318
+ # # check the status of an operation, cancel it, or wait for results.
1319
+ # # Here is how to wait for a response.
1320
+ # result.wait_until_done! timeout: 60
1321
+ # if result.response?
1322
+ # p result.response
1323
+ # else
1324
+ # puts "No response received."
1325
+ # end
1326
+ #
1327
+ def create_branch_rule request, options = nil
1328
+ raise ::ArgumentError, "request must be provided" if request.nil?
1329
+
1330
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest
1331
+
1332
+ # Converts hash and nil to an options object
1333
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1334
+
1335
+ # Customize the options with defaults
1336
+ call_metadata = @config.rpcs.create_branch_rule.metadata.to_h
1337
+
1338
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1339
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1340
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1341
+ gapic_version: ::Google::Cloud::SecureSourceManager::V1::VERSION,
1342
+ transports_version_send: [:rest]
1343
+
1344
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1345
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1346
+
1347
+ options.apply_defaults timeout: @config.rpcs.create_branch_rule.timeout,
1348
+ metadata: call_metadata,
1349
+ retry_policy: @config.rpcs.create_branch_rule.retry_policy
1350
+
1351
+ options.apply_defaults timeout: @config.timeout,
1352
+ metadata: @config.metadata,
1353
+ retry_policy: @config.retry_policy
1354
+
1355
+ @secure_source_manager_stub.create_branch_rule request, options do |result, operation|
1356
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1357
+ yield result, operation if block_given?
1358
+ throw :response, result
1359
+ end
1360
+ rescue ::Gapic::Rest::Error => e
1361
+ raise ::Google::Cloud::Error.from_error(e)
1362
+ end
1363
+
1364
+ ##
1365
+ # ListBranchRules lists branch rules in a given repository.
1366
+ #
1367
+ # @overload list_branch_rules(request, options = nil)
1368
+ # Pass arguments to `list_branch_rules` via a request object, either of type
1369
+ # {::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest} or an equivalent Hash.
1370
+ #
1371
+ # @param request [::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest, ::Hash]
1372
+ # A request object representing the call parameters. Required. To specify no
1373
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1374
+ # @param options [::Gapic::CallOptions, ::Hash]
1375
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1376
+ #
1377
+ # @overload list_branch_rules(parent: nil, page_size: nil, page_token: nil)
1378
+ # Pass arguments to `list_branch_rules` via keyword arguments. Note that at
1379
+ # least one keyword argument is required. To specify no parameters, or to keep all
1380
+ # the default parameter values, pass an empty Hash as a request object (see above).
1381
+ #
1382
+ # @param parent [::String]
1383
+ # @param page_size [::Integer]
1384
+ # @param page_token [::String]
1385
+ # @yield [result, operation] Access the result along with the TransportOperation object
1386
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::BranchRule>]
1387
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1388
+ #
1389
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::BranchRule>]
1390
+ #
1391
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1392
+ #
1393
+ # @example Basic example
1394
+ # require "google/cloud/secure_source_manager/v1"
1395
+ #
1396
+ # # Create a client object. The client can be reused for multiple calls.
1397
+ # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new
1398
+ #
1399
+ # # Create a request. To set request fields, pass in keyword arguments.
1400
+ # request = Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest.new
1401
+ #
1402
+ # # Call the list_branch_rules method.
1403
+ # result = client.list_branch_rules request
1404
+ #
1405
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1406
+ # # over elements, and API calls will be issued to fetch pages as needed.
1407
+ # result.each do |item|
1408
+ # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::BranchRule.
1409
+ # p item
1410
+ # end
1411
+ #
1412
+ def list_branch_rules request, options = nil
1413
+ raise ::ArgumentError, "request must be provided" if request.nil?
1414
+
1415
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest
1416
+
1417
+ # Converts hash and nil to an options object
1418
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1419
+
1420
+ # Customize the options with defaults
1421
+ call_metadata = @config.rpcs.list_branch_rules.metadata.to_h
1422
+
1423
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1424
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1425
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1426
+ gapic_version: ::Google::Cloud::SecureSourceManager::V1::VERSION,
1427
+ transports_version_send: [:rest]
1428
+
1429
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1430
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1431
+
1432
+ options.apply_defaults timeout: @config.rpcs.list_branch_rules.timeout,
1433
+ metadata: call_metadata,
1434
+ retry_policy: @config.rpcs.list_branch_rules.retry_policy
1435
+
1436
+ options.apply_defaults timeout: @config.timeout,
1437
+ metadata: @config.metadata,
1438
+ retry_policy: @config.retry_policy
1439
+
1440
+ @secure_source_manager_stub.list_branch_rules request, options do |result, operation|
1441
+ result = ::Gapic::Rest::PagedEnumerable.new @secure_source_manager_stub, :list_branch_rules, "branch_rules", request, result, options
1442
+ yield result, operation if block_given?
1443
+ throw :response, result
1444
+ end
1445
+ rescue ::Gapic::Rest::Error => e
1446
+ raise ::Google::Cloud::Error.from_error(e)
1447
+ end
1448
+
1449
+ ##
1450
+ # GetBranchRule gets a branch rule.
1451
+ #
1452
+ # @overload get_branch_rule(request, options = nil)
1453
+ # Pass arguments to `get_branch_rule` via a request object, either of type
1454
+ # {::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest} or an equivalent Hash.
1455
+ #
1456
+ # @param request [::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest, ::Hash]
1457
+ # A request object representing the call parameters. Required. To specify no
1458
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1459
+ # @param options [::Gapic::CallOptions, ::Hash]
1460
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1461
+ #
1462
+ # @overload get_branch_rule(name: nil)
1463
+ # Pass arguments to `get_branch_rule` via keyword arguments. Note that at
1464
+ # least one keyword argument is required. To specify no parameters, or to keep all
1465
+ # the default parameter values, pass an empty Hash as a request object (see above).
1466
+ #
1467
+ # @param name [::String]
1468
+ # Required. Name of the repository to retrieve.
1469
+ # The format is
1470
+ # `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}`.
1471
+ # @yield [result, operation] Access the result along with the TransportOperation object
1472
+ # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::BranchRule]
1473
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1474
+ #
1475
+ # @return [::Google::Cloud::SecureSourceManager::V1::BranchRule]
1476
+ #
1477
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1478
+ #
1479
+ # @example Basic example
1480
+ # require "google/cloud/secure_source_manager/v1"
1481
+ #
1482
+ # # Create a client object. The client can be reused for multiple calls.
1483
+ # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new
1484
+ #
1485
+ # # Create a request. To set request fields, pass in keyword arguments.
1486
+ # request = Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest.new
1487
+ #
1488
+ # # Call the get_branch_rule method.
1489
+ # result = client.get_branch_rule request
1490
+ #
1491
+ # # The returned object is of type Google::Cloud::SecureSourceManager::V1::BranchRule.
1492
+ # p result
1493
+ #
1494
+ def get_branch_rule request, options = nil
1495
+ raise ::ArgumentError, "request must be provided" if request.nil?
1496
+
1497
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest
1498
+
1499
+ # Converts hash and nil to an options object
1500
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1501
+
1502
+ # Customize the options with defaults
1503
+ call_metadata = @config.rpcs.get_branch_rule.metadata.to_h
1504
+
1505
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1506
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1507
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1508
+ gapic_version: ::Google::Cloud::SecureSourceManager::V1::VERSION,
1509
+ transports_version_send: [:rest]
1510
+
1511
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1512
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1513
+
1514
+ options.apply_defaults timeout: @config.rpcs.get_branch_rule.timeout,
1515
+ metadata: call_metadata,
1516
+ retry_policy: @config.rpcs.get_branch_rule.retry_policy
1517
+
1518
+ options.apply_defaults timeout: @config.timeout,
1519
+ metadata: @config.metadata,
1520
+ retry_policy: @config.retry_policy
1521
+
1522
+ @secure_source_manager_stub.get_branch_rule request, options do |result, operation|
1523
+ yield result, operation if block_given?
1524
+ end
1525
+ rescue ::Gapic::Rest::Error => e
1526
+ raise ::Google::Cloud::Error.from_error(e)
1527
+ end
1528
+
1529
+ ##
1530
+ # UpdateBranchRule updates a branch rule.
1531
+ #
1532
+ # @overload update_branch_rule(request, options = nil)
1533
+ # Pass arguments to `update_branch_rule` via a request object, either of type
1534
+ # {::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest} or an equivalent Hash.
1535
+ #
1536
+ # @param request [::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest, ::Hash]
1537
+ # A request object representing the call parameters. Required. To specify no
1538
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1539
+ # @param options [::Gapic::CallOptions, ::Hash]
1540
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1541
+ #
1542
+ # @overload update_branch_rule(branch_rule: nil, validate_only: nil, update_mask: nil)
1543
+ # Pass arguments to `update_branch_rule` via keyword arguments. Note that at
1544
+ # least one keyword argument is required. To specify no parameters, or to keep all
1545
+ # the default parameter values, pass an empty Hash as a request object (see above).
1546
+ #
1547
+ # @param branch_rule [::Google::Cloud::SecureSourceManager::V1::BranchRule, ::Hash]
1548
+ # @param validate_only [::Boolean]
1549
+ # Optional. If set, validate the request and preview the review, but do not
1550
+ # actually post it. (https://google.aip.dev/163, for declarative friendly)
1551
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1552
+ # Required. Field mask is used to specify the fields to be overwritten in the
1553
+ # branchRule resource by the update.
1554
+ # The fields specified in the update_mask are relative to the resource, not
1555
+ # the full request. A field will be overwritten if it is in the mask.
1556
+ # The special value "*" means full replacement.
1557
+ # @yield [result, operation] Access the result along with the TransportOperation object
1558
+ # @yieldparam result [::Gapic::Operation]
1559
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1560
+ #
1561
+ # @return [::Gapic::Operation]
1562
+ #
1563
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1564
+ #
1565
+ # @example Basic example
1566
+ # require "google/cloud/secure_source_manager/v1"
1567
+ #
1568
+ # # Create a client object. The client can be reused for multiple calls.
1569
+ # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new
1570
+ #
1571
+ # # Create a request. To set request fields, pass in keyword arguments.
1572
+ # request = Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest.new
1573
+ #
1574
+ # # Call the update_branch_rule method.
1575
+ # result = client.update_branch_rule request
1576
+ #
1577
+ # # The returned object is of type Gapic::Operation. You can use it to
1578
+ # # check the status of an operation, cancel it, or wait for results.
1579
+ # # Here is how to wait for a response.
1580
+ # result.wait_until_done! timeout: 60
1581
+ # if result.response?
1582
+ # p result.response
1583
+ # else
1584
+ # puts "No response received."
1585
+ # end
1586
+ #
1587
+ def update_branch_rule request, options = nil
1588
+ raise ::ArgumentError, "request must be provided" if request.nil?
1589
+
1590
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest
1591
+
1592
+ # Converts hash and nil to an options object
1593
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1594
+
1595
+ # Customize the options with defaults
1596
+ call_metadata = @config.rpcs.update_branch_rule.metadata.to_h
1597
+
1598
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1599
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1600
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1601
+ gapic_version: ::Google::Cloud::SecureSourceManager::V1::VERSION,
1602
+ transports_version_send: [:rest]
1603
+
1604
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1605
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1606
+
1607
+ options.apply_defaults timeout: @config.rpcs.update_branch_rule.timeout,
1608
+ metadata: call_metadata,
1609
+ retry_policy: @config.rpcs.update_branch_rule.retry_policy
1610
+
1611
+ options.apply_defaults timeout: @config.timeout,
1612
+ metadata: @config.metadata,
1613
+ retry_policy: @config.retry_policy
1614
+
1615
+ @secure_source_manager_stub.update_branch_rule request, options do |result, operation|
1616
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1617
+ yield result, operation if block_given?
1618
+ throw :response, result
1619
+ end
1620
+ rescue ::Gapic::Rest::Error => e
1621
+ raise ::Google::Cloud::Error.from_error(e)
1622
+ end
1623
+
1624
+ ##
1625
+ # DeleteBranchRule deletes a branch rule.
1626
+ #
1627
+ # @overload delete_branch_rule(request, options = nil)
1628
+ # Pass arguments to `delete_branch_rule` via a request object, either of type
1629
+ # {::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest} or an equivalent Hash.
1630
+ #
1631
+ # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest, ::Hash]
1632
+ # A request object representing the call parameters. Required. To specify no
1633
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1634
+ # @param options [::Gapic::CallOptions, ::Hash]
1635
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1636
+ #
1637
+ # @overload delete_branch_rule(name: nil, allow_missing: nil)
1638
+ # Pass arguments to `delete_branch_rule` via keyword arguments. Note that at
1639
+ # least one keyword argument is required. To specify no parameters, or to keep all
1640
+ # the default parameter values, pass an empty Hash as a request object (see above).
1641
+ #
1642
+ # @param name [::String]
1643
+ # @param allow_missing [::Boolean]
1644
+ # Optional. If set to true, and the branch rule is not found, the request
1645
+ # will succeed but no action will be taken on the server.
1646
+ # @yield [result, operation] Access the result along with the TransportOperation object
1647
+ # @yieldparam result [::Gapic::Operation]
1648
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1649
+ #
1650
+ # @return [::Gapic::Operation]
1651
+ #
1652
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1653
+ #
1654
+ # @example Basic example
1655
+ # require "google/cloud/secure_source_manager/v1"
1656
+ #
1657
+ # # Create a client object. The client can be reused for multiple calls.
1658
+ # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new
1659
+ #
1660
+ # # Create a request. To set request fields, pass in keyword arguments.
1661
+ # request = Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest.new
1662
+ #
1663
+ # # Call the delete_branch_rule method.
1664
+ # result = client.delete_branch_rule request
1665
+ #
1666
+ # # The returned object is of type Gapic::Operation. You can use it to
1667
+ # # check the status of an operation, cancel it, or wait for results.
1668
+ # # Here is how to wait for a response.
1669
+ # result.wait_until_done! timeout: 60
1670
+ # if result.response?
1671
+ # p result.response
1672
+ # else
1673
+ # puts "No response received."
1674
+ # end
1675
+ #
1676
+ def delete_branch_rule request, options = nil
1677
+ raise ::ArgumentError, "request must be provided" if request.nil?
1678
+
1679
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest
1680
+
1681
+ # Converts hash and nil to an options object
1682
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1683
+
1684
+ # Customize the options with defaults
1685
+ call_metadata = @config.rpcs.delete_branch_rule.metadata.to_h
1686
+
1687
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1688
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1689
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1690
+ gapic_version: ::Google::Cloud::SecureSourceManager::V1::VERSION,
1691
+ transports_version_send: [:rest]
1692
+
1693
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1694
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1695
+
1696
+ options.apply_defaults timeout: @config.rpcs.delete_branch_rule.timeout,
1697
+ metadata: call_metadata,
1698
+ retry_policy: @config.rpcs.delete_branch_rule.retry_policy
1699
+
1700
+ options.apply_defaults timeout: @config.timeout,
1701
+ metadata: @config.metadata,
1702
+ retry_policy: @config.retry_policy
1703
+
1704
+ @secure_source_manager_stub.delete_branch_rule request, options do |result, operation|
1705
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1706
+ yield result, operation if block_given?
1707
+ throw :response, result
1247
1708
  end
1248
1709
  rescue ::Gapic::Rest::Error => e
1249
1710
  raise ::Google::Cloud::Error.from_error(e)
@@ -1323,6 +1784,11 @@ module Google
1323
1784
  # default endpoint URL. The default value of nil uses the environment
1324
1785
  # universe (usually the default "googleapis.com" universe).
1325
1786
  # @return [::String,nil]
1787
+ # @!attribute [rw] logger
1788
+ # A custom logger to use for request/response debug logging, or the value
1789
+ # `:default` (the default) to construct a default logger, or `nil` to
1790
+ # explicitly disable logging.
1791
+ # @return [::Logger,:default,nil]
1326
1792
  #
1327
1793
  class Configuration
1328
1794
  extend ::Gapic::Config
@@ -1351,6 +1817,7 @@ module Google
1351
1817
  # by the host service.
1352
1818
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
1353
1819
  config_attr :bindings_override, {}, ::Hash, nil
1820
+ config_attr :logger, :default, ::Logger, nil, :default
1354
1821
 
1355
1822
  # @private
1356
1823
  def initialize parent_config = nil
@@ -1444,6 +1911,31 @@ module Google
1444
1911
  # @return [::Gapic::Config::Method]
1445
1912
  #
1446
1913
  attr_reader :test_iam_permissions_repo
1914
+ ##
1915
+ # RPC-specific configuration for `create_branch_rule`
1916
+ # @return [::Gapic::Config::Method]
1917
+ #
1918
+ attr_reader :create_branch_rule
1919
+ ##
1920
+ # RPC-specific configuration for `list_branch_rules`
1921
+ # @return [::Gapic::Config::Method]
1922
+ #
1923
+ attr_reader :list_branch_rules
1924
+ ##
1925
+ # RPC-specific configuration for `get_branch_rule`
1926
+ # @return [::Gapic::Config::Method]
1927
+ #
1928
+ attr_reader :get_branch_rule
1929
+ ##
1930
+ # RPC-specific configuration for `update_branch_rule`
1931
+ # @return [::Gapic::Config::Method]
1932
+ #
1933
+ attr_reader :update_branch_rule
1934
+ ##
1935
+ # RPC-specific configuration for `delete_branch_rule`
1936
+ # @return [::Gapic::Config::Method]
1937
+ #
1938
+ attr_reader :delete_branch_rule
1447
1939
 
1448
1940
  # @private
1449
1941
  def initialize parent_rpcs = nil
@@ -1469,6 +1961,16 @@ module Google
1469
1961
  @set_iam_policy_repo = ::Gapic::Config::Method.new set_iam_policy_repo_config
1470
1962
  test_iam_permissions_repo_config = parent_rpcs.test_iam_permissions_repo if parent_rpcs.respond_to? :test_iam_permissions_repo
1471
1963
  @test_iam_permissions_repo = ::Gapic::Config::Method.new test_iam_permissions_repo_config
1964
+ create_branch_rule_config = parent_rpcs.create_branch_rule if parent_rpcs.respond_to? :create_branch_rule
1965
+ @create_branch_rule = ::Gapic::Config::Method.new create_branch_rule_config
1966
+ list_branch_rules_config = parent_rpcs.list_branch_rules if parent_rpcs.respond_to? :list_branch_rules
1967
+ @list_branch_rules = ::Gapic::Config::Method.new list_branch_rules_config
1968
+ get_branch_rule_config = parent_rpcs.get_branch_rule if parent_rpcs.respond_to? :get_branch_rule
1969
+ @get_branch_rule = ::Gapic::Config::Method.new get_branch_rule_config
1970
+ update_branch_rule_config = parent_rpcs.update_branch_rule if parent_rpcs.respond_to? :update_branch_rule
1971
+ @update_branch_rule = ::Gapic::Config::Method.new update_branch_rule_config
1972
+ delete_branch_rule_config = parent_rpcs.delete_branch_rule if parent_rpcs.respond_to? :delete_branch_rule
1973
+ @delete_branch_rule = ::Gapic::Config::Method.new delete_branch_rule_config
1472
1974
 
1473
1975
  yield self if block_given?
1474
1976
  end