google-cloud-security-private_ca-v1beta1 0.9.0 → 0.10.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c148c59100a5a77400a87e79ff7d9de3993dacce1df516cef4c1e2075efc287e
4
- data.tar.gz: b4e5e6b331481f8aadc8a540baadfbabc57015617db589b74d7c1e0986197646
3
+ metadata.gz: 377edbc266fb1350f35b5877d9ac4766850b0204f912b1fb65d9b4d199424e01
4
+ data.tar.gz: 6507d61841ee8893ec9ffb38988ad12e6bd93322ac23b1538bcbdc3d9aca7061
5
5
  SHA512:
6
- metadata.gz: 703bf86a32ec78b550c32cab38a5881fc6f680e546026775d6c2a6820c70129490253186e4aac3851a9e8527e173339b206f055d96f49ba21a8beea8e084d7ce
7
- data.tar.gz: 1fea9c77889dd0f16fa6e18d0036a5a9f8b40a55052dcc3e2830ec187f3014064482aaece51d84f17b1a25e0e47f994534614a1d37671579c66ce09fa59ca0e1
6
+ metadata.gz: 86f385d2653fd963e777f0538c4aae6c85ba7687c7b79b2d31ffc06e48385566d1e36a6fab9ebe387a51401d1a88ac800642dff62e430c915e9a680055c02dd4
7
+ data.tar.gz: 0b09294c938b8a75c98d546009fd4e952f3346851a22785033e775f4b8625a39b50b22b8b8643df7c404b95d87981b9ae904384a0bc3cd0a76cc1f8ce6ec4061
data/README.md CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/certificate-authority-service/)
44
44
  for general usage information.
45
45
 
46
- ## Enabling Logging
47
-
48
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
-
54
- Configuring a Ruby stdlib logger:
46
+ ## Debug Logging
47
+
48
+ This library comes with opt-in Debug Logging that can help you troubleshoot
49
+ your application's integration with the API. When logging is activated, key
50
+ events such as requests and responses, along with data payloads and metadata
51
+ such as headers and client configuration, are logged to the standard error
52
+ stream.
53
+
54
+ **WARNING:** Client Library Debug Logging includes your data payloads in
55
+ plaintext, which could include sensitive data such as PII for yourself or your
56
+ customers, private keys, or other security data that could be compromising if
57
+ leaked. Always practice good data hygiene with your application logs, and follow
58
+ the principle of least access. Google also recommends that Client Library Debug
59
+ Logging be enabled only temporarily during active debugging, and not used
60
+ permanently in production.
61
+
62
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
63
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
64
+ list of client library gem names. This will select the default logging behavior,
65
+ which writes logs to the standard error stream. On a local workstation, this may
66
+ result in logs appearing on the console. When running on a Google Cloud hosting
67
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
68
+ results in logs appearing alongside your application logs in the
69
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
70
+
71
+ You can customize logging by modifying the `logger` configuration when
72
+ constructing a client object. For example:
55
73
 
56
74
  ```ruby
75
+ require "google/cloud/security/private_ca/v1beta1"
57
76
  require "logger"
58
77
 
59
- module MyLogger
60
- LOGGER = Logger.new $stderr, level: Logger::WARN
61
- def logger
62
- LOGGER
63
- end
64
- end
65
-
66
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
67
- module GRPC
68
- extend MyLogger
78
+ client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config|
79
+ config.logger = Logger.new "my-app.log"
69
80
  end
70
81
  ```
71
82
 
72
-
73
83
  ## Google Cloud Samples
74
84
 
75
85
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
@@ -32,6 +32,9 @@ module Google
32
32
  # certificate authorities and issued certificates.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
35
38
  # @private
36
39
  DEFAULT_ENDPOINT_TEMPLATE = "privateca.$UNIVERSE_DOMAIN$"
37
40
 
@@ -168,8 +171,19 @@ module Google
168
171
  universe_domain: @config.universe_domain,
169
172
  channel_args: @config.channel_args,
170
173
  interceptors: @config.interceptors,
171
- channel_pool_config: @config.channel_pool
174
+ channel_pool_config: @config.channel_pool,
175
+ logger: @config.logger
172
176
  )
177
+
178
+ @certificate_authority_service_stub.stub_logger&.info do |entry|
179
+ entry.set_system_name
180
+ entry.set_service
181
+ entry.message = "Created client for #{entry.service}"
182
+ entry.set_credentials_fields credentials
183
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
184
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
185
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
186
+ end
173
187
  end
174
188
 
175
189
  ##
@@ -179,6 +193,15 @@ module Google
179
193
  #
180
194
  attr_reader :operations_client
181
195
 
196
+ ##
197
+ # The logger used for request/response debug logging.
198
+ #
199
+ # @return [Logger]
200
+ #
201
+ def logger
202
+ @certificate_authority_service_stub.logger
203
+ end
204
+
182
205
  # Service calls
183
206
 
184
207
  ##
@@ -260,10 +283,11 @@ module Google
260
283
  # Customize the options with defaults
261
284
  metadata = @config.rpcs.create_certificate.metadata.to_h
262
285
 
263
- # Set x-goog-api-client and x-goog-user-project headers
286
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
264
287
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
265
288
  lib_name: @config.lib_name, lib_version: @config.lib_version,
266
289
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
290
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
267
291
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
268
292
 
269
293
  header_params = {}
@@ -284,7 +308,6 @@ module Google
284
308
 
285
309
  @certificate_authority_service_stub.call_rpc :create_certificate, request, options: options do |response, operation|
286
310
  yield response, operation if block_given?
287
- return response
288
311
  end
289
312
  rescue ::GRPC::BadStatus => e
290
313
  raise ::Google::Cloud::Error.from_error(e)
@@ -345,10 +368,11 @@ module Google
345
368
  # Customize the options with defaults
346
369
  metadata = @config.rpcs.get_certificate.metadata.to_h
347
370
 
348
- # Set x-goog-api-client and x-goog-user-project headers
371
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
349
372
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
350
373
  lib_name: @config.lib_name, lib_version: @config.lib_version,
351
374
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
375
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
352
376
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
353
377
 
354
378
  header_params = {}
@@ -369,7 +393,6 @@ module Google
369
393
 
370
394
  @certificate_authority_service_stub.call_rpc :get_certificate, request, options: options do |response, operation|
371
395
  yield response, operation if block_given?
372
- return response
373
396
  end
374
397
  rescue ::GRPC::BadStatus => e
375
398
  raise ::Google::Cloud::Error.from_error(e)
@@ -454,10 +477,11 @@ module Google
454
477
  # Customize the options with defaults
455
478
  metadata = @config.rpcs.list_certificates.metadata.to_h
456
479
 
457
- # Set x-goog-api-client and x-goog-user-project headers
480
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
458
481
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
459
482
  lib_name: @config.lib_name, lib_version: @config.lib_version,
460
483
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
484
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
461
485
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
462
486
 
463
487
  header_params = {}
@@ -479,7 +503,7 @@ module Google
479
503
  @certificate_authority_service_stub.call_rpc :list_certificates, request, options: options do |response, operation|
480
504
  response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_certificates, request, response, operation, options
481
505
  yield response, operation if block_given?
482
- return response
506
+ throw :response, response
483
507
  end
484
508
  rescue ::GRPC::BadStatus => e
485
509
  raise ::Google::Cloud::Error.from_error(e)
@@ -557,10 +581,11 @@ module Google
557
581
  # Customize the options with defaults
558
582
  metadata = @config.rpcs.revoke_certificate.metadata.to_h
559
583
 
560
- # Set x-goog-api-client and x-goog-user-project headers
584
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
561
585
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
562
586
  lib_name: @config.lib_name, lib_version: @config.lib_version,
563
587
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
588
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
564
589
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
565
590
 
566
591
  header_params = {}
@@ -581,7 +606,6 @@ module Google
581
606
 
582
607
  @certificate_authority_service_stub.call_rpc :revoke_certificate, request, options: options do |response, operation|
583
608
  yield response, operation if block_given?
584
- return response
585
609
  end
586
610
  rescue ::GRPC::BadStatus => e
587
611
  raise ::Google::Cloud::Error.from_error(e)
@@ -659,10 +683,11 @@ module Google
659
683
  # Customize the options with defaults
660
684
  metadata = @config.rpcs.update_certificate.metadata.to_h
661
685
 
662
- # Set x-goog-api-client and x-goog-user-project headers
686
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
663
687
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
664
688
  lib_name: @config.lib_name, lib_version: @config.lib_version,
665
689
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
690
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
666
691
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
667
692
 
668
693
  header_params = {}
@@ -683,7 +708,6 @@ module Google
683
708
 
684
709
  @certificate_authority_service_stub.call_rpc :update_certificate, request, options: options do |response, operation|
685
710
  yield response, operation if block_given?
686
- return response
687
711
  end
688
712
  rescue ::GRPC::BadStatus => e
689
713
  raise ::Google::Cloud::Error.from_error(e)
@@ -777,10 +801,11 @@ module Google
777
801
  # Customize the options with defaults
778
802
  metadata = @config.rpcs.activate_certificate_authority.metadata.to_h
779
803
 
780
- # Set x-goog-api-client and x-goog-user-project headers
804
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
781
805
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
782
806
  lib_name: @config.lib_name, lib_version: @config.lib_version,
783
807
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
808
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
784
809
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
785
810
 
786
811
  header_params = {}
@@ -802,7 +827,7 @@ module Google
802
827
  @certificate_authority_service_stub.call_rpc :activate_certificate_authority, request, options: options do |response, operation|
803
828
  response = ::Gapic::Operation.new response, @operations_client, options: options
804
829
  yield response, operation if block_given?
805
- return response
830
+ throw :response, response
806
831
  end
807
832
  rescue ::GRPC::BadStatus => e
808
833
  raise ::Google::Cloud::Error.from_error(e)
@@ -891,10 +916,11 @@ module Google
891
916
  # Customize the options with defaults
892
917
  metadata = @config.rpcs.create_certificate_authority.metadata.to_h
893
918
 
894
- # Set x-goog-api-client and x-goog-user-project headers
919
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
895
920
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
896
921
  lib_name: @config.lib_name, lib_version: @config.lib_version,
897
922
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
923
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
898
924
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
899
925
 
900
926
  header_params = {}
@@ -916,7 +942,7 @@ module Google
916
942
  @certificate_authority_service_stub.call_rpc :create_certificate_authority, request, options: options do |response, operation|
917
943
  response = ::Gapic::Operation.new response, @operations_client, options: options
918
944
  yield response, operation if block_given?
919
- return response
945
+ throw :response, response
920
946
  end
921
947
  rescue ::GRPC::BadStatus => e
922
948
  raise ::Google::Cloud::Error.from_error(e)
@@ -999,10 +1025,11 @@ module Google
999
1025
  # Customize the options with defaults
1000
1026
  metadata = @config.rpcs.disable_certificate_authority.metadata.to_h
1001
1027
 
1002
- # Set x-goog-api-client and x-goog-user-project headers
1028
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1003
1029
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1004
1030
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1005
1031
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
1032
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1006
1033
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1007
1034
 
1008
1035
  header_params = {}
@@ -1024,7 +1051,7 @@ module Google
1024
1051
  @certificate_authority_service_stub.call_rpc :disable_certificate_authority, request, options: options do |response, operation|
1025
1052
  response = ::Gapic::Operation.new response, @operations_client, options: options
1026
1053
  yield response, operation if block_given?
1027
- return response
1054
+ throw :response, response
1028
1055
  end
1029
1056
  rescue ::GRPC::BadStatus => e
1030
1057
  raise ::Google::Cloud::Error.from_error(e)
@@ -1107,10 +1134,11 @@ module Google
1107
1134
  # Customize the options with defaults
1108
1135
  metadata = @config.rpcs.enable_certificate_authority.metadata.to_h
1109
1136
 
1110
- # Set x-goog-api-client and x-goog-user-project headers
1137
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1111
1138
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1112
1139
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1113
1140
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
1141
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1114
1142
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1115
1143
 
1116
1144
  header_params = {}
@@ -1132,7 +1160,7 @@ module Google
1132
1160
  @certificate_authority_service_stub.call_rpc :enable_certificate_authority, request, options: options do |response, operation|
1133
1161
  response = ::Gapic::Operation.new response, @operations_client, options: options
1134
1162
  yield response, operation if block_given?
1135
- return response
1163
+ throw :response, response
1136
1164
  end
1137
1165
  rescue ::GRPC::BadStatus => e
1138
1166
  raise ::Google::Cloud::Error.from_error(e)
@@ -1200,10 +1228,11 @@ module Google
1200
1228
  # Customize the options with defaults
1201
1229
  metadata = @config.rpcs.fetch_certificate_authority_csr.metadata.to_h
1202
1230
 
1203
- # Set x-goog-api-client and x-goog-user-project headers
1231
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1204
1232
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1205
1233
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1206
1234
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
1235
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1207
1236
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1208
1237
 
1209
1238
  header_params = {}
@@ -1224,7 +1253,6 @@ module Google
1224
1253
 
1225
1254
  @certificate_authority_service_stub.call_rpc :fetch_certificate_authority_csr, request, options: options do |response, operation|
1226
1255
  yield response, operation if block_given?
1227
- return response
1228
1256
  end
1229
1257
  rescue ::GRPC::BadStatus => e
1230
1258
  raise ::Google::Cloud::Error.from_error(e)
@@ -1286,10 +1314,11 @@ module Google
1286
1314
  # Customize the options with defaults
1287
1315
  metadata = @config.rpcs.get_certificate_authority.metadata.to_h
1288
1316
 
1289
- # Set x-goog-api-client and x-goog-user-project headers
1317
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1290
1318
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1291
1319
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1292
1320
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
1321
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1293
1322
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1294
1323
 
1295
1324
  header_params = {}
@@ -1310,7 +1339,6 @@ module Google
1310
1339
 
1311
1340
  @certificate_authority_service_stub.call_rpc :get_certificate_authority, request, options: options do |response, operation|
1312
1341
  yield response, operation if block_given?
1313
- return response
1314
1342
  end
1315
1343
  rescue ::GRPC::BadStatus => e
1316
1344
  raise ::Google::Cloud::Error.from_error(e)
@@ -1391,10 +1419,11 @@ module Google
1391
1419
  # Customize the options with defaults
1392
1420
  metadata = @config.rpcs.list_certificate_authorities.metadata.to_h
1393
1421
 
1394
- # Set x-goog-api-client and x-goog-user-project headers
1422
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1395
1423
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1396
1424
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1397
1425
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
1426
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1398
1427
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1399
1428
 
1400
1429
  header_params = {}
@@ -1416,7 +1445,7 @@ module Google
1416
1445
  @certificate_authority_service_stub.call_rpc :list_certificate_authorities, request, options: options do |response, operation|
1417
1446
  response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_certificate_authorities, request, response, operation, options
1418
1447
  yield response, operation if block_given?
1419
- return response
1448
+ throw :response, response
1420
1449
  end
1421
1450
  rescue ::GRPC::BadStatus => e
1422
1451
  raise ::Google::Cloud::Error.from_error(e)
@@ -1499,10 +1528,11 @@ module Google
1499
1528
  # Customize the options with defaults
1500
1529
  metadata = @config.rpcs.restore_certificate_authority.metadata.to_h
1501
1530
 
1502
- # Set x-goog-api-client and x-goog-user-project headers
1531
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1503
1532
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1504
1533
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1505
1534
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
1535
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1506
1536
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1507
1537
 
1508
1538
  header_params = {}
@@ -1524,7 +1554,7 @@ module Google
1524
1554
  @certificate_authority_service_stub.call_rpc :restore_certificate_authority, request, options: options do |response, operation|
1525
1555
  response = ::Gapic::Operation.new response, @operations_client, options: options
1526
1556
  yield response, operation if block_given?
1527
- return response
1557
+ throw :response, response
1528
1558
  end
1529
1559
  rescue ::GRPC::BadStatus => e
1530
1560
  raise ::Google::Cloud::Error.from_error(e)
@@ -1607,10 +1637,11 @@ module Google
1607
1637
  # Customize the options with defaults
1608
1638
  metadata = @config.rpcs.schedule_delete_certificate_authority.metadata.to_h
1609
1639
 
1610
- # Set x-goog-api-client and x-goog-user-project headers
1640
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1611
1641
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1612
1642
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1613
1643
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
1644
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1614
1645
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1615
1646
 
1616
1647
  header_params = {}
@@ -1632,7 +1663,7 @@ module Google
1632
1663
  @certificate_authority_service_stub.call_rpc :schedule_delete_certificate_authority, request, options: options do |response, operation|
1633
1664
  response = ::Gapic::Operation.new response, @operations_client, options: options
1634
1665
  yield response, operation if block_given?
1635
- return response
1666
+ throw :response, response
1636
1667
  end
1637
1668
  rescue ::GRPC::BadStatus => e
1638
1669
  raise ::Google::Cloud::Error.from_error(e)
@@ -1716,10 +1747,11 @@ module Google
1716
1747
  # Customize the options with defaults
1717
1748
  metadata = @config.rpcs.update_certificate_authority.metadata.to_h
1718
1749
 
1719
- # Set x-goog-api-client and x-goog-user-project headers
1750
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1720
1751
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1721
1752
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1722
1753
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
1754
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1723
1755
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1724
1756
 
1725
1757
  header_params = {}
@@ -1741,7 +1773,7 @@ module Google
1741
1773
  @certificate_authority_service_stub.call_rpc :update_certificate_authority, request, options: options do |response, operation|
1742
1774
  response = ::Gapic::Operation.new response, @operations_client, options: options
1743
1775
  yield response, operation if block_given?
1744
- return response
1776
+ throw :response, response
1745
1777
  end
1746
1778
  rescue ::GRPC::BadStatus => e
1747
1779
  raise ::Google::Cloud::Error.from_error(e)
@@ -1803,10 +1835,11 @@ module Google
1803
1835
  # Customize the options with defaults
1804
1836
  metadata = @config.rpcs.get_certificate_revocation_list.metadata.to_h
1805
1837
 
1806
- # Set x-goog-api-client and x-goog-user-project headers
1838
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1807
1839
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1808
1840
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1809
1841
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
1842
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1810
1843
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1811
1844
 
1812
1845
  header_params = {}
@@ -1827,7 +1860,6 @@ module Google
1827
1860
 
1828
1861
  @certificate_authority_service_stub.call_rpc :get_certificate_revocation_list, request, options: options do |response, operation|
1829
1862
  yield response, operation if block_given?
1830
- return response
1831
1863
  end
1832
1864
  rescue ::GRPC::BadStatus => e
1833
1865
  raise ::Google::Cloud::Error.from_error(e)
@@ -1908,10 +1940,11 @@ module Google
1908
1940
  # Customize the options with defaults
1909
1941
  metadata = @config.rpcs.list_certificate_revocation_lists.metadata.to_h
1910
1942
 
1911
- # Set x-goog-api-client and x-goog-user-project headers
1943
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1912
1944
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1913
1945
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1914
1946
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
1947
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1915
1948
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1916
1949
 
1917
1950
  header_params = {}
@@ -1933,7 +1966,7 @@ module Google
1933
1966
  @certificate_authority_service_stub.call_rpc :list_certificate_revocation_lists, request, options: options do |response, operation|
1934
1967
  response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_certificate_revocation_lists, request, response, operation, options
1935
1968
  yield response, operation if block_given?
1936
- return response
1969
+ throw :response, response
1937
1970
  end
1938
1971
  rescue ::GRPC::BadStatus => e
1939
1972
  raise ::Google::Cloud::Error.from_error(e)
@@ -2017,10 +2050,11 @@ module Google
2017
2050
  # Customize the options with defaults
2018
2051
  metadata = @config.rpcs.update_certificate_revocation_list.metadata.to_h
2019
2052
 
2020
- # Set x-goog-api-client and x-goog-user-project headers
2053
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2021
2054
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2022
2055
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2023
2056
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
2057
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2024
2058
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2025
2059
 
2026
2060
  header_params = {}
@@ -2042,7 +2076,7 @@ module Google
2042
2076
  @certificate_authority_service_stub.call_rpc :update_certificate_revocation_list, request, options: options do |response, operation|
2043
2077
  response = ::Gapic::Operation.new response, @operations_client, options: options
2044
2078
  yield response, operation if block_given?
2045
- return response
2079
+ throw :response, response
2046
2080
  end
2047
2081
  rescue ::GRPC::BadStatus => e
2048
2082
  raise ::Google::Cloud::Error.from_error(e)
@@ -2103,10 +2137,11 @@ module Google
2103
2137
  # Customize the options with defaults
2104
2138
  metadata = @config.rpcs.get_reusable_config.metadata.to_h
2105
2139
 
2106
- # Set x-goog-api-client and x-goog-user-project headers
2140
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2107
2141
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2108
2142
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2109
2143
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
2144
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2110
2145
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2111
2146
 
2112
2147
  header_params = {}
@@ -2127,7 +2162,6 @@ module Google
2127
2162
 
2128
2163
  @certificate_authority_service_stub.call_rpc :get_reusable_config, request, options: options do |response, operation|
2129
2164
  yield response, operation if block_given?
2130
- return response
2131
2165
  end
2132
2166
  rescue ::GRPC::BadStatus => e
2133
2167
  raise ::Google::Cloud::Error.from_error(e)
@@ -2208,10 +2242,11 @@ module Google
2208
2242
  # Customize the options with defaults
2209
2243
  metadata = @config.rpcs.list_reusable_configs.metadata.to_h
2210
2244
 
2211
- # Set x-goog-api-client and x-goog-user-project headers
2245
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2212
2246
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2213
2247
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2214
2248
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
2249
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2215
2250
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2216
2251
 
2217
2252
  header_params = {}
@@ -2233,7 +2268,7 @@ module Google
2233
2268
  @certificate_authority_service_stub.call_rpc :list_reusable_configs, request, options: options do |response, operation|
2234
2269
  response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_reusable_configs, request, response, operation, options
2235
2270
  yield response, operation if block_given?
2236
- return response
2271
+ throw :response, response
2237
2272
  end
2238
2273
  rescue ::GRPC::BadStatus => e
2239
2274
  raise ::Google::Cloud::Error.from_error(e)
@@ -2322,6 +2357,11 @@ module Google
2322
2357
  # default endpoint URL. The default value of nil uses the environment
2323
2358
  # universe (usually the default "googleapis.com" universe).
2324
2359
  # @return [::String,nil]
2360
+ # @!attribute [rw] logger
2361
+ # A custom logger to use for request/response debug logging, or the value
2362
+ # `:default` (the default) to construct a default logger, or `nil` to
2363
+ # explicitly disable logging.
2364
+ # @return [::Logger,:default,nil]
2325
2365
  #
2326
2366
  class Configuration
2327
2367
  extend ::Gapic::Config
@@ -2346,6 +2386,7 @@ module Google
2346
2386
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2347
2387
  config_attr :quota_project, nil, ::String, nil
2348
2388
  config_attr :universe_domain, nil, ::String, nil
2389
+ config_attr :logger, :default, ::Logger, nil, :default
2349
2390
 
2350
2391
  # @private
2351
2392
  def initialize parent_config = nil