google-cloud-security-private_ca-v1beta1 0.9.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -27,6 +27,9 @@ module Google
27
27
  module CertificateAuthorityService
28
28
  # Service that implements Longrunning Operations API.
29
29
  class Operations
30
+ # @private
31
+ API_VERSION = ""
32
+
30
33
  # @private
31
34
  DEFAULT_ENDPOINT_TEMPLATE = "privateca.$UNIVERSE_DOMAIN$"
32
35
 
@@ -122,14 +125,6 @@ module Google
122
125
  # Lists operations that match the specified filter in the request. If the
123
126
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
124
127
  #
125
- # NOTE: the `name` binding allows API services to override the binding
126
- # to use different resource name schemes, such as `users/*/operations`. To
127
- # override the binding, API services can add a binding such as
128
- # `"/v1/{name=users/*}/operations"` to their service configuration.
129
- # For backwards compatibility, the default name includes the operations
130
- # collection id, however overriding users must ensure the name binding
131
- # is the parent resource, without the operations collection id.
132
- #
133
128
  # @overload list_operations(request, options = nil)
134
129
  # Pass arguments to `list_operations` via a request object, either of type
135
130
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -192,10 +187,11 @@ module Google
192
187
  # Customize the options with defaults
193
188
  metadata = @config.rpcs.list_operations.metadata.to_h
194
189
 
195
- # Set x-goog-api-client and x-goog-user-project headers
190
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
196
191
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
197
192
  lib_name: @config.lib_name, lib_version: @config.lib_version,
198
193
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
194
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
199
195
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
200
196
 
201
197
  header_params = {}
@@ -218,7 +214,7 @@ module Google
218
214
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
219
215
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
220
216
  yield response, operation if block_given?
221
- return response
217
+ throw :response, response
222
218
  end
223
219
  rescue ::GRPC::BadStatus => e
224
220
  raise ::Google::Cloud::Error.from_error(e)
@@ -288,10 +284,11 @@ module Google
288
284
  # Customize the options with defaults
289
285
  metadata = @config.rpcs.get_operation.metadata.to_h
290
286
 
291
- # Set x-goog-api-client and x-goog-user-project headers
287
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
292
288
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
293
289
  lib_name: @config.lib_name, lib_version: @config.lib_version,
294
290
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
291
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
295
292
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
296
293
 
297
294
  header_params = {}
@@ -313,7 +310,7 @@ module Google
313
310
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
314
311
  response = ::Gapic::Operation.new response, @operations_client, options: options
315
312
  yield response, operation if block_given?
316
- return response
313
+ throw :response, response
317
314
  end
318
315
  rescue ::GRPC::BadStatus => e
319
316
  raise ::Google::Cloud::Error.from_error(e)
@@ -377,10 +374,11 @@ module Google
377
374
  # Customize the options with defaults
378
375
  metadata = @config.rpcs.delete_operation.metadata.to_h
379
376
 
380
- # Set x-goog-api-client and x-goog-user-project headers
377
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
381
378
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
382
379
  lib_name: @config.lib_name, lib_version: @config.lib_version,
383
380
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
381
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
384
382
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
385
383
 
386
384
  header_params = {}
@@ -401,7 +399,6 @@ module Google
401
399
 
402
400
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
403
401
  yield response, operation if block_given?
404
- return response
405
402
  end
406
403
  rescue ::GRPC::BadStatus => e
407
404
  raise ::Google::Cloud::Error.from_error(e)
@@ -416,8 +413,9 @@ module Google
416
413
  # other methods to check whether the cancellation succeeded or whether the
417
414
  # operation completed despite cancellation. On successful cancellation,
418
415
  # the operation is not deleted; instead, it becomes an operation with
419
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
420
- # corresponding to `Code.CANCELLED`.
416
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
417
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
418
+ # `Code.CANCELLED`.
421
419
  #
422
420
  # @overload cancel_operation(request, options = nil)
423
421
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -471,10 +469,11 @@ module Google
471
469
  # Customize the options with defaults
472
470
  metadata = @config.rpcs.cancel_operation.metadata.to_h
473
471
 
474
- # Set x-goog-api-client and x-goog-user-project headers
472
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
475
473
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
476
474
  lib_name: @config.lib_name, lib_version: @config.lib_version,
477
475
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
476
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
478
477
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
479
478
 
480
479
  header_params = {}
@@ -495,7 +494,6 @@ module Google
495
494
 
496
495
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
497
496
  yield response, operation if block_given?
498
- return response
499
497
  end
500
498
  rescue ::GRPC::BadStatus => e
501
499
  raise ::Google::Cloud::Error.from_error(e)
@@ -575,10 +573,11 @@ module Google
575
573
  # Customize the options with defaults
576
574
  metadata = @config.rpcs.wait_operation.metadata.to_h
577
575
 
578
- # Set x-goog-api-client and x-goog-user-project headers
576
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
579
577
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
580
578
  lib_name: @config.lib_name, lib_version: @config.lib_version,
581
579
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
580
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
582
581
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
583
582
 
584
583
  options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
@@ -592,7 +591,7 @@ module Google
592
591
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
593
592
  response = ::Gapic::Operation.new response, @operations_client, options: options
594
593
  yield response, operation if block_given?
595
- return response
594
+ throw :response, response
596
595
  end
597
596
  rescue ::GRPC::BadStatus => e
598
597
  raise ::Google::Cloud::Error.from_error(e)
@@ -681,6 +680,11 @@ module Google
681
680
  # default endpoint URL. The default value of nil uses the environment
682
681
  # universe (usually the default "googleapis.com" universe).
683
682
  # @return [::String,nil]
683
+ # @!attribute [rw] logger
684
+ # A custom logger to use for request/response debug logging, or the value
685
+ # `:default` (the default) to construct a default logger, or `nil` to
686
+ # explicitly disable logging.
687
+ # @return [::Logger,:default,nil]
684
688
  #
685
689
  class Configuration
686
690
  extend ::Gapic::Config
@@ -705,6 +709,7 @@ module Google
705
709
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
706
710
  config_attr :quota_project, nil, ::String, nil
707
711
  config_attr :universe_domain, nil, ::String, nil
712
+ config_attr :logger, :default, ::Logger, nil, :default
708
713
 
709
714
  # @private
710
715
  def initialize parent_config = nil