lib/google/cloud/api_hub/v1/provisioning/rest/operations.rb in google-cloud-api_hub-v1-0.2.0 vs lib/google/cloud/api_hub/v1/provisioning/rest/operations.rb in google-cloud-api_hub-v1-0.3.0
- old
+ new
@@ -113,18 +113,10 @@
##
# Lists operations that match the specified filter in the request. If the
# server doesn't support this method, it returns `UNIMPLEMENTED`.
#
- # NOTE: the `name` binding allows API services to override the binding
- # to use different resource name schemes, such as `users/*/operations`. To
- # override the binding, API services can add a binding such as
- # `"/v1/{name=users/*}/operations"` to their service configuration.
- # For backwards compatibility, the default name includes the operations
- # collection id, however overriding users must ensure the name binding
- # is the parent resource, without the operations collection id.
- #
# @overload list_operations(request, options = nil)
# Pass arguments to `list_operations` via a request object, either of type
# {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
#
# @param request [::Google::Longrunning::ListOperationsRequest, ::Hash]
@@ -202,11 +194,11 @@
retry_policy: @config.retry_policy
@operations_stub.list_operations request, options do |result, operation|
result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
yield result, operation if block_given?
- return result
+ throw :response, result
end
rescue ::Gapic::Rest::Error => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -291,11 +283,11 @@
retry_policy: @config.retry_policy
@operations_stub.get_operation request, options do |result, operation|
result = ::Gapic::Operation.new result, @operations_client, options: options
yield result, operation if block_given?
- return result
+ throw :response, result
end
rescue ::Gapic::Rest::Error => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -373,11 +365,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@operations_stub.delete_operation request, options do |result, operation|
yield result, operation if block_given?
- return result
end
rescue ::Gapic::Rest::Error => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -388,12 +379,13 @@
# `google.rpc.Code.UNIMPLEMENTED`. Clients can use
# Operations.GetOperation or
# other methods to check whether the cancellation succeeded or whether the
# operation completed despite cancellation. On successful cancellation,
# the operation is not deleted; instead, it becomes an operation with
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
- # corresponding to `Code.CANCELLED`.
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
+ # `Code.CANCELLED`.
#
# @overload cancel_operation(request, options = nil)
# Pass arguments to `cancel_operation` via a request object, either of type
# {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash.
#
@@ -461,11 +453,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@operations_stub.cancel_operation request, options do |result, operation|
yield result, operation if block_given?
- return result
end
rescue ::Gapic::Rest::Error => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -541,10 +532,15 @@
# @!attribute [rw] universe_domain
# The universe domain within which to make requests. This determines the
# default endpoint URL. The default value of nil uses the environment
# universe (usually the default "googleapis.com" universe).
# @return [::String,nil]
+ # @!attribute [rw] logger
+ # A custom logger to use for request/response debug logging, or the value
+ # `:default` (the default) to construct a default logger, or `nil` to
+ # explicitly disable logging.
+ # @return [::Logger,:default,nil]
#
class Configuration
extend ::Gapic::Config
# @private
@@ -562,10 +558,11 @@
config_attr :timeout, nil, ::Numeric, nil
config_attr :metadata, nil, ::Hash, nil
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
config_attr :quota_project, nil, ::String, nil
config_attr :universe_domain, nil, ::String, nil
+ config_attr :logger, :default, ::Logger, nil, :default
# @private
def initialize parent_config = nil
@parent_config = parent_config unless parent_config.nil?
@@ -681,20 +678,22 @@
{}
end
response = @client_stub.make_http_request(
verb,
- uri: uri,
- body: body || "",
- params: query_string_params,
+ uri: uri,
+ body: body || "",
+ params: query_string_params,
+ method_name: "list_operations",
options: options
)
operation = ::Gapic::Rest::TransportOperation.new response
result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
-
- yield result, operation if block_given?
- result
+ catch :response do
+ yield result, operation if block_given?
+ result
+ end
end
##
# Baseline implementation for the get_operation REST call
#
@@ -719,20 +718,22 @@
{}
end
response = @client_stub.make_http_request(
verb,
- uri: uri,
- body: body || "",
- params: query_string_params,
+ uri: uri,
+ body: body || "",
+ params: query_string_params,
+ method_name: "get_operation",
options: options
)
operation = ::Gapic::Rest::TransportOperation.new response
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
-
- yield result, operation if block_given?
- result
+ catch :response do
+ yield result, operation if block_given?
+ result
+ end
end
##
# Baseline implementation for the delete_operation REST call
#
@@ -757,20 +758,22 @@
{}
end
response = @client_stub.make_http_request(
verb,
- uri: uri,
- body: body || "",
- params: query_string_params,
+ uri: uri,
+ body: body || "",
+ params: query_string_params,
+ method_name: "delete_operation",
options: options
)
operation = ::Gapic::Rest::TransportOperation.new response
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
-
- yield result, operation if block_given?
- result
+ catch :response do
+ yield result, operation if block_given?
+ result
+ end
end
##
# Baseline implementation for the cancel_operation REST call
#
@@ -795,19 +798,21 @@
{}
end
response = @client_stub.make_http_request(
verb,
- uri: uri,
- body: body || "",
- params: query_string_params,
+ uri: uri,
+ body: body || "",
+ params: query_string_params,
+ method_name: "cancel_operation",
options: options
)
operation = ::Gapic::Rest::TransportOperation.new response
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
-
- yield result, operation if block_given?
- result
+ catch :response do
+ yield result, operation if block_given?
+ result
+ end
end
##
# @private
#