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 Rest
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
 
@@ -113,14 +116,6 @@ module Google
113
116
  # Lists operations that match the specified filter in the request. If the
114
117
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
115
118
  #
116
- # NOTE: the `name` binding allows API services to override the binding
117
- # to use different resource name schemes, such as `users/*/operations`. To
118
- # override the binding, API services can add a binding such as
119
- # `"/v1/{name=users/*}/operations"` to their service configuration.
120
- # For backwards compatibility, the default name includes the operations
121
- # collection id, however overriding users must ensure the name binding
122
- # is the parent resource, without the operations collection id.
123
- #
124
119
  # @overload list_operations(request, options = nil)
125
120
  # Pass arguments to `list_operations` via a request object, either of type
126
121
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -182,12 +177,13 @@ module Google
182
177
  # Customize the options with defaults
183
178
  call_metadata = @config.rpcs.list_operations.metadata.to_h
184
179
 
185
- # Set x-goog-api-client and x-goog-user-project headers
180
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
186
181
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
187
182
  lib_name: @config.lib_name, lib_version: @config.lib_version,
188
183
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION,
189
184
  transports_version_send: [:rest]
190
185
 
186
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
191
187
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
192
188
 
193
189
  options.apply_defaults timeout: @config.rpcs.list_operations.timeout,
@@ -201,7 +197,7 @@ module Google
201
197
  @operations_stub.list_operations request, options do |result, operation|
202
198
  result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
203
199
  yield result, operation if block_given?
204
- return result
200
+ throw :response, result
205
201
  end
206
202
  rescue ::Gapic::Rest::Error => e
207
203
  raise ::Google::Cloud::Error.from_error(e)
@@ -270,12 +266,13 @@ module Google
270
266
  # Customize the options with defaults
271
267
  call_metadata = @config.rpcs.get_operation.metadata.to_h
272
268
 
273
- # Set x-goog-api-client and x-goog-user-project headers
269
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
274
270
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
275
271
  lib_name: @config.lib_name, lib_version: @config.lib_version,
276
272
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION,
277
273
  transports_version_send: [:rest]
278
274
 
275
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
279
276
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
280
277
 
281
278
  options.apply_defaults timeout: @config.rpcs.get_operation.timeout,
@@ -289,7 +286,7 @@ module Google
289
286
  @operations_stub.get_operation request, options do |result, operation|
290
287
  result = ::Gapic::Operation.new result, @operations_client, options: options
291
288
  yield result, operation if block_given?
292
- return result
289
+ throw :response, result
293
290
  end
294
291
  rescue ::Gapic::Rest::Error => e
295
292
  raise ::Google::Cloud::Error.from_error(e)
@@ -352,12 +349,13 @@ module Google
352
349
  # Customize the options with defaults
353
350
  call_metadata = @config.rpcs.delete_operation.metadata.to_h
354
351
 
355
- # Set x-goog-api-client and x-goog-user-project headers
352
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
356
353
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
357
354
  lib_name: @config.lib_name, lib_version: @config.lib_version,
358
355
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION,
359
356
  transports_version_send: [:rest]
360
357
 
358
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
361
359
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
362
360
 
363
361
  options.apply_defaults timeout: @config.rpcs.delete_operation.timeout,
@@ -370,7 +368,6 @@ module Google
370
368
 
371
369
  @operations_stub.delete_operation request, options do |result, operation|
372
370
  yield result, operation if block_given?
373
- return result
374
371
  end
375
372
  rescue ::Gapic::Rest::Error => e
376
373
  raise ::Google::Cloud::Error.from_error(e)
@@ -385,8 +382,9 @@ module Google
385
382
  # other methods to check whether the cancellation succeeded or whether the
386
383
  # operation completed despite cancellation. On successful cancellation,
387
384
  # the operation is not deleted; instead, it becomes an operation with
388
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
389
- # corresponding to `Code.CANCELLED`.
385
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
386
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
387
+ # `Code.CANCELLED`.
390
388
  #
391
389
  # @overload cancel_operation(request, options = nil)
392
390
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -439,12 +437,13 @@ module Google
439
437
  # Customize the options with defaults
440
438
  call_metadata = @config.rpcs.cancel_operation.metadata.to_h
441
439
 
442
- # Set x-goog-api-client and x-goog-user-project headers
440
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
443
441
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
444
442
  lib_name: @config.lib_name, lib_version: @config.lib_version,
445
443
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION,
446
444
  transports_version_send: [:rest]
447
445
 
446
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
448
447
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
449
448
 
450
449
  options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout,
@@ -457,7 +456,6 @@ module Google
457
456
 
458
457
  @operations_stub.cancel_operation request, options do |result, operation|
459
458
  yield result, operation if block_given?
460
- return result
461
459
  end
462
460
  rescue ::Gapic::Rest::Error => e
463
461
  raise ::Google::Cloud::Error.from_error(e)
@@ -537,6 +535,11 @@ module Google
537
535
  # default endpoint URL. The default value of nil uses the environment
538
536
  # universe (usually the default "googleapis.com" universe).
539
537
  # @return [::String,nil]
538
+ # @!attribute [rw] logger
539
+ # A custom logger to use for request/response debug logging, or the value
540
+ # `:default` (the default) to construct a default logger, or `nil` to
541
+ # explicitly disable logging.
542
+ # @return [::Logger,:default,nil]
540
543
  #
541
544
  class Configuration
542
545
  extend ::Gapic::Config
@@ -558,6 +561,7 @@ module Google
558
561
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
559
562
  config_attr :quota_project, nil, ::String, nil
560
563
  config_attr :universe_domain, nil, ::String, nil
564
+ config_attr :logger, :default, ::Logger, nil, :default
561
565
 
562
566
  # @private
563
567
  def initialize parent_config = nil
@@ -677,16 +681,18 @@ module Google
677
681
 
678
682
  response = @client_stub.make_http_request(
679
683
  verb,
680
- uri: uri,
681
- body: body || "",
682
- params: query_string_params,
684
+ uri: uri,
685
+ body: body || "",
686
+ params: query_string_params,
687
+ method_name: "list_operations",
683
688
  options: options
684
689
  )
685
690
  operation = ::Gapic::Rest::TransportOperation.new response
686
691
  result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
687
-
688
- yield result, operation if block_given?
689
- result
692
+ catch :response do
693
+ yield result, operation if block_given?
694
+ result
695
+ end
690
696
  end
691
697
 
692
698
  ##
@@ -715,16 +721,18 @@ module Google
715
721
 
716
722
  response = @client_stub.make_http_request(
717
723
  verb,
718
- uri: uri,
719
- body: body || "",
720
- params: query_string_params,
724
+ uri: uri,
725
+ body: body || "",
726
+ params: query_string_params,
727
+ method_name: "get_operation",
721
728
  options: options
722
729
  )
723
730
  operation = ::Gapic::Rest::TransportOperation.new response
724
731
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
725
-
726
- yield result, operation if block_given?
727
- result
732
+ catch :response do
733
+ yield result, operation if block_given?
734
+ result
735
+ end
728
736
  end
729
737
 
730
738
  ##
@@ -753,16 +761,18 @@ module Google
753
761
 
754
762
  response = @client_stub.make_http_request(
755
763
  verb,
756
- uri: uri,
757
- body: body || "",
758
- params: query_string_params,
764
+ uri: uri,
765
+ body: body || "",
766
+ params: query_string_params,
767
+ method_name: "delete_operation",
759
768
  options: options
760
769
  )
761
770
  operation = ::Gapic::Rest::TransportOperation.new response
762
771
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
763
-
764
- yield result, operation if block_given?
765
- result
772
+ catch :response do
773
+ yield result, operation if block_given?
774
+ result
775
+ end
766
776
  end
767
777
 
768
778
  ##
@@ -791,16 +801,18 @@ module Google
791
801
 
792
802
  response = @client_stub.make_http_request(
793
803
  verb,
794
- uri: uri,
795
- body: body || "",
796
- params: query_string_params,
804
+ uri: uri,
805
+ body: body || "",
806
+ params: query_string_params,
807
+ method_name: "cancel_operation",
797
808
  options: options
798
809
  )
799
810
  operation = ::Gapic::Rest::TransportOperation.new response
800
811
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
801
-
802
- yield result, operation if block_given?
803
- result
812
+ catch :response do
813
+ yield result, operation if block_given?
814
+ result
815
+ end
804
816
  end
805
817
 
806
818
  ##