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.
@@ -210,14 +210,26 @@ module Google
210
210
  universe_domain: @config.universe_domain,
211
211
  channel_args: @config.channel_args,
212
212
  interceptors: @config.interceptors,
213
- channel_pool_config: @config.channel_pool
213
+ channel_pool_config: @config.channel_pool,
214
+ logger: @config.logger
214
215
  )
215
216
 
217
+ @secure_source_manager_stub.stub_logger&.info do |entry|
218
+ entry.set_system_name
219
+ entry.set_service
220
+ entry.message = "Created client for #{entry.service}"
221
+ entry.set_credentials_fields credentials
222
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
223
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
224
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
225
+ end
226
+
216
227
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
217
228
  config.credentials = credentials
218
229
  config.quota_project = @quota_project_id
219
230
  config.endpoint = @secure_source_manager_stub.endpoint
220
231
  config.universe_domain = @secure_source_manager_stub.universe_domain
232
+ config.logger = @secure_source_manager_stub.logger if config.respond_to? :logger=
221
233
  end
222
234
 
223
235
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
@@ -225,6 +237,7 @@ module Google
225
237
  config.quota_project = @quota_project_id
226
238
  config.endpoint = @secure_source_manager_stub.endpoint
227
239
  config.universe_domain = @secure_source_manager_stub.universe_domain
240
+ config.logger = @secure_source_manager_stub.logger if config.respond_to? :logger=
228
241
  end
229
242
  end
230
243
 
@@ -249,6 +262,15 @@ module Google
249
262
  #
250
263
  attr_reader :iam_policy_client
251
264
 
265
+ ##
266
+ # The logger used for request/response debug logging.
267
+ #
268
+ # @return [Logger]
269
+ #
270
+ def logger
271
+ @secure_source_manager_stub.logger
272
+ end
273
+
252
274
  # Service calls
253
275
 
254
276
  ##
@@ -345,7 +367,7 @@ module Google
345
367
  @secure_source_manager_stub.call_rpc :list_instances, request, options: options do |response, operation|
346
368
  response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :list_instances, request, response, operation, options
347
369
  yield response, operation if block_given?
348
- return response
370
+ throw :response, response
349
371
  end
350
372
  rescue ::GRPC::BadStatus => e
351
373
  raise ::Google::Cloud::Error.from_error(e)
@@ -431,7 +453,6 @@ module Google
431
453
 
432
454
  @secure_source_manager_stub.call_rpc :get_instance, request, options: options do |response, operation|
433
455
  yield response, operation if block_given?
434
- return response
435
456
  end
436
457
  rescue ::GRPC::BadStatus => e
437
458
  raise ::Google::Cloud::Error.from_error(e)
@@ -543,7 +564,7 @@ module Google
543
564
  @secure_source_manager_stub.call_rpc :create_instance, request, options: options do |response, operation|
544
565
  response = ::Gapic::Operation.new response, @operations_client, options: options
545
566
  yield response, operation if block_given?
546
- return response
567
+ throw :response, response
547
568
  end
548
569
  rescue ::GRPC::BadStatus => e
549
570
  raise ::Google::Cloud::Error.from_error(e)
@@ -651,7 +672,7 @@ module Google
651
672
  @secure_source_manager_stub.call_rpc :delete_instance, request, options: options do |response, operation|
652
673
  response = ::Gapic::Operation.new response, @operations_client, options: options
653
674
  yield response, operation if block_given?
654
- return response
675
+ throw :response, response
655
676
  end
656
677
  rescue ::GRPC::BadStatus => e
657
678
  raise ::Google::Cloud::Error.from_error(e)
@@ -672,7 +693,7 @@ module Google
672
693
  # @param options [::Gapic::CallOptions, ::Hash]
673
694
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
674
695
  #
675
- # @overload list_repositories(parent: nil, page_size: nil, page_token: nil, filter: nil)
696
+ # @overload list_repositories(parent: nil, page_size: nil, page_token: nil, filter: nil, instance: nil)
676
697
  # Pass arguments to `list_repositories` via keyword arguments. Note that at
677
698
  # least one keyword argument is required. To specify no parameters, or to keep all
678
699
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -686,6 +707,14 @@ module Google
686
707
  # A token identifying a page of results the server should return.
687
708
  # @param filter [::String]
688
709
  # Optional. Filter results.
710
+ # @param instance [::String]
711
+ # Optional. The name of the instance in which the repository is hosted,
712
+ # formatted as
713
+ # `projects/{project_number}/locations/{location_id}/instances/{instance_id}`.
714
+ # When listing repositories via
715
+ # securesourcemanager.googleapis.com (Control Plane API), this field is
716
+ # required. When listing repositories via *.sourcemanager.dev (Data Plane
717
+ # API), this field is ignored.
689
718
  #
690
719
  # @yield [response, operation] Access the result along with the RPC operation
691
720
  # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Repository>]
@@ -751,7 +780,7 @@ module Google
751
780
  @secure_source_manager_stub.call_rpc :list_repositories, request, options: options do |response, operation|
752
781
  response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :list_repositories, request, response, operation, options
753
782
  yield response, operation if block_given?
754
- return response
783
+ throw :response, response
755
784
  end
756
785
  rescue ::GRPC::BadStatus => e
757
786
  raise ::Google::Cloud::Error.from_error(e)
@@ -841,7 +870,6 @@ module Google
841
870
 
842
871
  @secure_source_manager_stub.call_rpc :get_repository, request, options: options do |response, operation|
843
872
  yield response, operation if block_given?
844
- return response
845
873
  end
846
874
  rescue ::GRPC::BadStatus => e
847
875
  raise ::Google::Cloud::Error.from_error(e)
@@ -944,7 +972,7 @@ module Google
944
972
  @secure_source_manager_stub.call_rpc :create_repository, request, options: options do |response, operation|
945
973
  response = ::Gapic::Operation.new response, @operations_client, options: options
946
974
  yield response, operation if block_given?
947
- return response
975
+ throw :response, response
948
976
  end
949
977
  rescue ::GRPC::BadStatus => e
950
978
  raise ::Google::Cloud::Error.from_error(e)
@@ -1045,7 +1073,7 @@ module Google
1045
1073
  @secure_source_manager_stub.call_rpc :delete_repository, request, options: options do |response, operation|
1046
1074
  response = ::Gapic::Operation.new response, @operations_client, options: options
1047
1075
  yield response, operation if block_given?
1048
- return response
1076
+ throw :response, response
1049
1077
  end
1050
1078
  rescue ::GRPC::BadStatus => e
1051
1079
  raise ::Google::Cloud::Error.from_error(e)
@@ -1135,7 +1163,6 @@ module Google
1135
1163
 
1136
1164
  @secure_source_manager_stub.call_rpc :get_iam_policy_repo, request, options: options do |response, operation|
1137
1165
  yield response, operation if block_given?
1138
- return response
1139
1166
  end
1140
1167
  rescue ::GRPC::BadStatus => e
1141
1168
  raise ::Google::Cloud::Error.from_error(e)
@@ -1233,7 +1260,6 @@ module Google
1233
1260
 
1234
1261
  @secure_source_manager_stub.call_rpc :set_iam_policy_repo, request, options: options do |response, operation|
1235
1262
  yield response, operation if block_given?
1236
- return response
1237
1263
  end
1238
1264
  rescue ::GRPC::BadStatus => e
1239
1265
  raise ::Google::Cloud::Error.from_error(e)
@@ -1326,7 +1352,478 @@ module Google
1326
1352
 
1327
1353
  @secure_source_manager_stub.call_rpc :test_iam_permissions_repo, request, options: options do |response, operation|
1328
1354
  yield response, operation if block_given?
1329
- return response
1355
+ end
1356
+ rescue ::GRPC::BadStatus => e
1357
+ raise ::Google::Cloud::Error.from_error(e)
1358
+ end
1359
+
1360
+ ##
1361
+ # CreateBranchRule creates a branch rule in a given repository.
1362
+ #
1363
+ # @overload create_branch_rule(request, options = nil)
1364
+ # Pass arguments to `create_branch_rule` via a request object, either of type
1365
+ # {::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest} or an equivalent Hash.
1366
+ #
1367
+ # @param request [::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest, ::Hash]
1368
+ # A request object representing the call parameters. Required. To specify no
1369
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1370
+ # @param options [::Gapic::CallOptions, ::Hash]
1371
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1372
+ #
1373
+ # @overload create_branch_rule(parent: nil, branch_rule: nil, branch_rule_id: nil)
1374
+ # Pass arguments to `create_branch_rule` via keyword arguments. Note that at
1375
+ # least one keyword argument is required. To specify no parameters, or to keep all
1376
+ # the default parameter values, pass an empty Hash as a request object (see above).
1377
+ #
1378
+ # @param parent [::String]
1379
+ # @param branch_rule [::Google::Cloud::SecureSourceManager::V1::BranchRule, ::Hash]
1380
+ # @param branch_rule_id [::String]
1381
+ #
1382
+ # @yield [response, operation] Access the result along with the RPC operation
1383
+ # @yieldparam response [::Gapic::Operation]
1384
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1385
+ #
1386
+ # @return [::Gapic::Operation]
1387
+ #
1388
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1389
+ #
1390
+ # @example Basic example
1391
+ # require "google/cloud/secure_source_manager/v1"
1392
+ #
1393
+ # # Create a client object. The client can be reused for multiple calls.
1394
+ # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new
1395
+ #
1396
+ # # Create a request. To set request fields, pass in keyword arguments.
1397
+ # request = Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest.new
1398
+ #
1399
+ # # Call the create_branch_rule method.
1400
+ # result = client.create_branch_rule request
1401
+ #
1402
+ # # The returned object is of type Gapic::Operation. You can use it to
1403
+ # # check the status of an operation, cancel it, or wait for results.
1404
+ # # Here is how to wait for a response.
1405
+ # result.wait_until_done! timeout: 60
1406
+ # if result.response?
1407
+ # p result.response
1408
+ # else
1409
+ # puts "No response received."
1410
+ # end
1411
+ #
1412
+ def create_branch_rule 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::CreateBranchRuleRequest
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
+ metadata = @config.rpcs.create_branch_rule.metadata.to_h
1422
+
1423
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1424
+ 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
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1428
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1429
+
1430
+ header_params = {}
1431
+ if request.parent
1432
+ header_params["parent"] = request.parent
1433
+ end
1434
+
1435
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1436
+ metadata[:"x-goog-request-params"] ||= request_params_header
1437
+
1438
+ options.apply_defaults timeout: @config.rpcs.create_branch_rule.timeout,
1439
+ metadata: metadata,
1440
+ retry_policy: @config.rpcs.create_branch_rule.retry_policy
1441
+
1442
+ options.apply_defaults timeout: @config.timeout,
1443
+ metadata: @config.metadata,
1444
+ retry_policy: @config.retry_policy
1445
+
1446
+ @secure_source_manager_stub.call_rpc :create_branch_rule, request, options: options do |response, operation|
1447
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1448
+ yield response, operation if block_given?
1449
+ throw :response, response
1450
+ end
1451
+ rescue ::GRPC::BadStatus => e
1452
+ raise ::Google::Cloud::Error.from_error(e)
1453
+ end
1454
+
1455
+ ##
1456
+ # ListBranchRules lists branch rules in a given repository.
1457
+ #
1458
+ # @overload list_branch_rules(request, options = nil)
1459
+ # Pass arguments to `list_branch_rules` via a request object, either of type
1460
+ # {::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest} or an equivalent Hash.
1461
+ #
1462
+ # @param request [::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest, ::Hash]
1463
+ # A request object representing the call parameters. Required. To specify no
1464
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1465
+ # @param options [::Gapic::CallOptions, ::Hash]
1466
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1467
+ #
1468
+ # @overload list_branch_rules(parent: nil, page_size: nil, page_token: nil)
1469
+ # Pass arguments to `list_branch_rules` via keyword arguments. Note that at
1470
+ # least one keyword argument is required. To specify no parameters, or to keep all
1471
+ # the default parameter values, pass an empty Hash as a request object (see above).
1472
+ #
1473
+ # @param parent [::String]
1474
+ # @param page_size [::Integer]
1475
+ # @param page_token [::String]
1476
+ #
1477
+ # @yield [response, operation] Access the result along with the RPC operation
1478
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::BranchRule>]
1479
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1480
+ #
1481
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::BranchRule>]
1482
+ #
1483
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1484
+ #
1485
+ # @example Basic example
1486
+ # require "google/cloud/secure_source_manager/v1"
1487
+ #
1488
+ # # Create a client object. The client can be reused for multiple calls.
1489
+ # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new
1490
+ #
1491
+ # # Create a request. To set request fields, pass in keyword arguments.
1492
+ # request = Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest.new
1493
+ #
1494
+ # # Call the list_branch_rules method.
1495
+ # result = client.list_branch_rules request
1496
+ #
1497
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1498
+ # # over elements, and API calls will be issued to fetch pages as needed.
1499
+ # result.each do |item|
1500
+ # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::BranchRule.
1501
+ # p item
1502
+ # end
1503
+ #
1504
+ def list_branch_rules request, options = nil
1505
+ raise ::ArgumentError, "request must be provided" if request.nil?
1506
+
1507
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest
1508
+
1509
+ # Converts hash and nil to an options object
1510
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1511
+
1512
+ # Customize the options with defaults
1513
+ metadata = @config.rpcs.list_branch_rules.metadata.to_h
1514
+
1515
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1516
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1517
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1518
+ gapic_version: ::Google::Cloud::SecureSourceManager::V1::VERSION
1519
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1520
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1521
+
1522
+ header_params = {}
1523
+ if request.parent
1524
+ header_params["parent"] = request.parent
1525
+ end
1526
+
1527
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1528
+ metadata[:"x-goog-request-params"] ||= request_params_header
1529
+
1530
+ options.apply_defaults timeout: @config.rpcs.list_branch_rules.timeout,
1531
+ metadata: metadata,
1532
+ retry_policy: @config.rpcs.list_branch_rules.retry_policy
1533
+
1534
+ options.apply_defaults timeout: @config.timeout,
1535
+ metadata: @config.metadata,
1536
+ retry_policy: @config.retry_policy
1537
+
1538
+ @secure_source_manager_stub.call_rpc :list_branch_rules, request, options: options do |response, operation|
1539
+ response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :list_branch_rules, request, response, operation, options
1540
+ yield response, operation if block_given?
1541
+ throw :response, response
1542
+ end
1543
+ rescue ::GRPC::BadStatus => e
1544
+ raise ::Google::Cloud::Error.from_error(e)
1545
+ end
1546
+
1547
+ ##
1548
+ # GetBranchRule gets a branch rule.
1549
+ #
1550
+ # @overload get_branch_rule(request, options = nil)
1551
+ # Pass arguments to `get_branch_rule` via a request object, either of type
1552
+ # {::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest} or an equivalent Hash.
1553
+ #
1554
+ # @param request [::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest, ::Hash]
1555
+ # A request object representing the call parameters. Required. To specify no
1556
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1557
+ # @param options [::Gapic::CallOptions, ::Hash]
1558
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1559
+ #
1560
+ # @overload get_branch_rule(name: nil)
1561
+ # Pass arguments to `get_branch_rule` via keyword arguments. Note that at
1562
+ # least one keyword argument is required. To specify no parameters, or to keep all
1563
+ # the default parameter values, pass an empty Hash as a request object (see above).
1564
+ #
1565
+ # @param name [::String]
1566
+ # Required. Name of the repository to retrieve.
1567
+ # The format is
1568
+ # `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}`.
1569
+ #
1570
+ # @yield [response, operation] Access the result along with the RPC operation
1571
+ # @yieldparam response [::Google::Cloud::SecureSourceManager::V1::BranchRule]
1572
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1573
+ #
1574
+ # @return [::Google::Cloud::SecureSourceManager::V1::BranchRule]
1575
+ #
1576
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1577
+ #
1578
+ # @example Basic example
1579
+ # require "google/cloud/secure_source_manager/v1"
1580
+ #
1581
+ # # Create a client object. The client can be reused for multiple calls.
1582
+ # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new
1583
+ #
1584
+ # # Create a request. To set request fields, pass in keyword arguments.
1585
+ # request = Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest.new
1586
+ #
1587
+ # # Call the get_branch_rule method.
1588
+ # result = client.get_branch_rule request
1589
+ #
1590
+ # # The returned object is of type Google::Cloud::SecureSourceManager::V1::BranchRule.
1591
+ # p result
1592
+ #
1593
+ def get_branch_rule request, options = nil
1594
+ raise ::ArgumentError, "request must be provided" if request.nil?
1595
+
1596
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest
1597
+
1598
+ # Converts hash and nil to an options object
1599
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1600
+
1601
+ # Customize the options with defaults
1602
+ metadata = @config.rpcs.get_branch_rule.metadata.to_h
1603
+
1604
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1605
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1606
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1607
+ gapic_version: ::Google::Cloud::SecureSourceManager::V1::VERSION
1608
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1609
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1610
+
1611
+ header_params = {}
1612
+ if request.name
1613
+ header_params["name"] = request.name
1614
+ end
1615
+
1616
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1617
+ metadata[:"x-goog-request-params"] ||= request_params_header
1618
+
1619
+ options.apply_defaults timeout: @config.rpcs.get_branch_rule.timeout,
1620
+ metadata: metadata,
1621
+ retry_policy: @config.rpcs.get_branch_rule.retry_policy
1622
+
1623
+ options.apply_defaults timeout: @config.timeout,
1624
+ metadata: @config.metadata,
1625
+ retry_policy: @config.retry_policy
1626
+
1627
+ @secure_source_manager_stub.call_rpc :get_branch_rule, request, options: options do |response, operation|
1628
+ yield response, operation if block_given?
1629
+ end
1630
+ rescue ::GRPC::BadStatus => e
1631
+ raise ::Google::Cloud::Error.from_error(e)
1632
+ end
1633
+
1634
+ ##
1635
+ # UpdateBranchRule updates a branch rule.
1636
+ #
1637
+ # @overload update_branch_rule(request, options = nil)
1638
+ # Pass arguments to `update_branch_rule` via a request object, either of type
1639
+ # {::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest} or an equivalent Hash.
1640
+ #
1641
+ # @param request [::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest, ::Hash]
1642
+ # A request object representing the call parameters. Required. To specify no
1643
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1644
+ # @param options [::Gapic::CallOptions, ::Hash]
1645
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1646
+ #
1647
+ # @overload update_branch_rule(branch_rule: nil, validate_only: nil, update_mask: nil)
1648
+ # Pass arguments to `update_branch_rule` via keyword arguments. Note that at
1649
+ # least one keyword argument is required. To specify no parameters, or to keep all
1650
+ # the default parameter values, pass an empty Hash as a request object (see above).
1651
+ #
1652
+ # @param branch_rule [::Google::Cloud::SecureSourceManager::V1::BranchRule, ::Hash]
1653
+ # @param validate_only [::Boolean]
1654
+ # Optional. If set, validate the request and preview the review, but do not
1655
+ # actually post it. (https://google.aip.dev/163, for declarative friendly)
1656
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1657
+ # Required. Field mask is used to specify the fields to be overwritten in the
1658
+ # branchRule resource by the update.
1659
+ # The fields specified in the update_mask are relative to the resource, not
1660
+ # the full request. A field will be overwritten if it is in the mask.
1661
+ # The special value "*" means full replacement.
1662
+ #
1663
+ # @yield [response, operation] Access the result along with the RPC operation
1664
+ # @yieldparam response [::Gapic::Operation]
1665
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1666
+ #
1667
+ # @return [::Gapic::Operation]
1668
+ #
1669
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1670
+ #
1671
+ # @example Basic example
1672
+ # require "google/cloud/secure_source_manager/v1"
1673
+ #
1674
+ # # Create a client object. The client can be reused for multiple calls.
1675
+ # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new
1676
+ #
1677
+ # # Create a request. To set request fields, pass in keyword arguments.
1678
+ # request = Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest.new
1679
+ #
1680
+ # # Call the update_branch_rule method.
1681
+ # result = client.update_branch_rule request
1682
+ #
1683
+ # # The returned object is of type Gapic::Operation. You can use it to
1684
+ # # check the status of an operation, cancel it, or wait for results.
1685
+ # # Here is how to wait for a response.
1686
+ # result.wait_until_done! timeout: 60
1687
+ # if result.response?
1688
+ # p result.response
1689
+ # else
1690
+ # puts "No response received."
1691
+ # end
1692
+ #
1693
+ def update_branch_rule request, options = nil
1694
+ raise ::ArgumentError, "request must be provided" if request.nil?
1695
+
1696
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest
1697
+
1698
+ # Converts hash and nil to an options object
1699
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1700
+
1701
+ # Customize the options with defaults
1702
+ metadata = @config.rpcs.update_branch_rule.metadata.to_h
1703
+
1704
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1705
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1706
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1707
+ gapic_version: ::Google::Cloud::SecureSourceManager::V1::VERSION
1708
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1709
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1710
+
1711
+ header_params = {}
1712
+ if request.branch_rule&.name
1713
+ header_params["branch_rule.name"] = request.branch_rule.name
1714
+ end
1715
+
1716
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1717
+ metadata[:"x-goog-request-params"] ||= request_params_header
1718
+
1719
+ options.apply_defaults timeout: @config.rpcs.update_branch_rule.timeout,
1720
+ metadata: metadata,
1721
+ retry_policy: @config.rpcs.update_branch_rule.retry_policy
1722
+
1723
+ options.apply_defaults timeout: @config.timeout,
1724
+ metadata: @config.metadata,
1725
+ retry_policy: @config.retry_policy
1726
+
1727
+ @secure_source_manager_stub.call_rpc :update_branch_rule, request, options: options do |response, operation|
1728
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1729
+ yield response, operation if block_given?
1730
+ throw :response, response
1731
+ end
1732
+ rescue ::GRPC::BadStatus => e
1733
+ raise ::Google::Cloud::Error.from_error(e)
1734
+ end
1735
+
1736
+ ##
1737
+ # DeleteBranchRule deletes a branch rule.
1738
+ #
1739
+ # @overload delete_branch_rule(request, options = nil)
1740
+ # Pass arguments to `delete_branch_rule` via a request object, either of type
1741
+ # {::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest} or an equivalent Hash.
1742
+ #
1743
+ # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest, ::Hash]
1744
+ # A request object representing the call parameters. Required. To specify no
1745
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1746
+ # @param options [::Gapic::CallOptions, ::Hash]
1747
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1748
+ #
1749
+ # @overload delete_branch_rule(name: nil, allow_missing: nil)
1750
+ # Pass arguments to `delete_branch_rule` via keyword arguments. Note that at
1751
+ # least one keyword argument is required. To specify no parameters, or to keep all
1752
+ # the default parameter values, pass an empty Hash as a request object (see above).
1753
+ #
1754
+ # @param name [::String]
1755
+ # @param allow_missing [::Boolean]
1756
+ # Optional. If set to true, and the branch rule is not found, the request
1757
+ # will succeed but no action will be taken on the server.
1758
+ #
1759
+ # @yield [response, operation] Access the result along with the RPC operation
1760
+ # @yieldparam response [::Gapic::Operation]
1761
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1762
+ #
1763
+ # @return [::Gapic::Operation]
1764
+ #
1765
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1766
+ #
1767
+ # @example Basic example
1768
+ # require "google/cloud/secure_source_manager/v1"
1769
+ #
1770
+ # # Create a client object. The client can be reused for multiple calls.
1771
+ # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new
1772
+ #
1773
+ # # Create a request. To set request fields, pass in keyword arguments.
1774
+ # request = Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest.new
1775
+ #
1776
+ # # Call the delete_branch_rule method.
1777
+ # result = client.delete_branch_rule request
1778
+ #
1779
+ # # The returned object is of type Gapic::Operation. You can use it to
1780
+ # # check the status of an operation, cancel it, or wait for results.
1781
+ # # Here is how to wait for a response.
1782
+ # result.wait_until_done! timeout: 60
1783
+ # if result.response?
1784
+ # p result.response
1785
+ # else
1786
+ # puts "No response received."
1787
+ # end
1788
+ #
1789
+ def delete_branch_rule request, options = nil
1790
+ raise ::ArgumentError, "request must be provided" if request.nil?
1791
+
1792
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest
1793
+
1794
+ # Converts hash and nil to an options object
1795
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1796
+
1797
+ # Customize the options with defaults
1798
+ metadata = @config.rpcs.delete_branch_rule.metadata.to_h
1799
+
1800
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1801
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1802
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1803
+ gapic_version: ::Google::Cloud::SecureSourceManager::V1::VERSION
1804
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1805
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1806
+
1807
+ header_params = {}
1808
+ if request.name
1809
+ header_params["name"] = request.name
1810
+ end
1811
+
1812
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1813
+ metadata[:"x-goog-request-params"] ||= request_params_header
1814
+
1815
+ options.apply_defaults timeout: @config.rpcs.delete_branch_rule.timeout,
1816
+ metadata: metadata,
1817
+ retry_policy: @config.rpcs.delete_branch_rule.retry_policy
1818
+
1819
+ options.apply_defaults timeout: @config.timeout,
1820
+ metadata: @config.metadata,
1821
+ retry_policy: @config.retry_policy
1822
+
1823
+ @secure_source_manager_stub.call_rpc :delete_branch_rule, request, options: options do |response, operation|
1824
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1825
+ yield response, operation if block_given?
1826
+ throw :response, response
1330
1827
  end
1331
1828
  rescue ::GRPC::BadStatus => e
1332
1829
  raise ::Google::Cloud::Error.from_error(e)
@@ -1415,6 +1912,11 @@ module Google
1415
1912
  # default endpoint URL. The default value of nil uses the environment
1416
1913
  # universe (usually the default "googleapis.com" universe).
1417
1914
  # @return [::String,nil]
1915
+ # @!attribute [rw] logger
1916
+ # A custom logger to use for request/response debug logging, or the value
1917
+ # `:default` (the default) to construct a default logger, or `nil` to
1918
+ # explicitly disable logging.
1919
+ # @return [::Logger,:default,nil]
1418
1920
  #
1419
1921
  class Configuration
1420
1922
  extend ::Gapic::Config
@@ -1439,6 +1941,7 @@ module Google
1439
1941
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1440
1942
  config_attr :quota_project, nil, ::String, nil
1441
1943
  config_attr :universe_domain, nil, ::String, nil
1944
+ config_attr :logger, :default, ::Logger, nil, :default
1442
1945
 
1443
1946
  # @private
1444
1947
  def initialize parent_config = nil
@@ -1540,6 +2043,31 @@ module Google
1540
2043
  # @return [::Gapic::Config::Method]
1541
2044
  #
1542
2045
  attr_reader :test_iam_permissions_repo
2046
+ ##
2047
+ # RPC-specific configuration for `create_branch_rule`
2048
+ # @return [::Gapic::Config::Method]
2049
+ #
2050
+ attr_reader :create_branch_rule
2051
+ ##
2052
+ # RPC-specific configuration for `list_branch_rules`
2053
+ # @return [::Gapic::Config::Method]
2054
+ #
2055
+ attr_reader :list_branch_rules
2056
+ ##
2057
+ # RPC-specific configuration for `get_branch_rule`
2058
+ # @return [::Gapic::Config::Method]
2059
+ #
2060
+ attr_reader :get_branch_rule
2061
+ ##
2062
+ # RPC-specific configuration for `update_branch_rule`
2063
+ # @return [::Gapic::Config::Method]
2064
+ #
2065
+ attr_reader :update_branch_rule
2066
+ ##
2067
+ # RPC-specific configuration for `delete_branch_rule`
2068
+ # @return [::Gapic::Config::Method]
2069
+ #
2070
+ attr_reader :delete_branch_rule
1543
2071
 
1544
2072
  # @private
1545
2073
  def initialize parent_rpcs = nil
@@ -1565,6 +2093,16 @@ module Google
1565
2093
  @set_iam_policy_repo = ::Gapic::Config::Method.new set_iam_policy_repo_config
1566
2094
  test_iam_permissions_repo_config = parent_rpcs.test_iam_permissions_repo if parent_rpcs.respond_to? :test_iam_permissions_repo
1567
2095
  @test_iam_permissions_repo = ::Gapic::Config::Method.new test_iam_permissions_repo_config
2096
+ create_branch_rule_config = parent_rpcs.create_branch_rule if parent_rpcs.respond_to? :create_branch_rule
2097
+ @create_branch_rule = ::Gapic::Config::Method.new create_branch_rule_config
2098
+ list_branch_rules_config = parent_rpcs.list_branch_rules if parent_rpcs.respond_to? :list_branch_rules
2099
+ @list_branch_rules = ::Gapic::Config::Method.new list_branch_rules_config
2100
+ get_branch_rule_config = parent_rpcs.get_branch_rule if parent_rpcs.respond_to? :get_branch_rule
2101
+ @get_branch_rule = ::Gapic::Config::Method.new get_branch_rule_config
2102
+ update_branch_rule_config = parent_rpcs.update_branch_rule if parent_rpcs.respond_to? :update_branch_rule
2103
+ @update_branch_rule = ::Gapic::Config::Method.new update_branch_rule_config
2104
+ delete_branch_rule_config = parent_rpcs.delete_branch_rule if parent_rpcs.respond_to? :delete_branch_rule
2105
+ @delete_branch_rule = ::Gapic::Config::Method.new delete_branch_rule_config
1568
2106
 
1569
2107
  yield self if block_given?
1570
2108
  end