lib/google/iam/v1beta/workload_identity_pools/client.rb in google-iam-v1beta-0.8.2 vs lib/google/iam/v1beta/workload_identity_pools/client.rb in google-iam-v1beta-0.9.0
- old
+ new
@@ -221,21 +221,41 @@
endpoint: @config.endpoint,
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
universe_domain: @config.universe_domain,
channel_args: @config.channel_args,
interceptors: @config.interceptors,
- channel_pool_config: @config.channel_pool
+ channel_pool_config: @config.channel_pool,
+ logger: @config.logger
)
+
+ @workload_identity_pools_stub.stub_logger&.info do |entry|
+ entry.set_system_name
+ entry.set_service
+ entry.message = "Created client for #{entry.service}"
+ entry.set_credentials_fields credentials
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
+ end
end
##
# Get the associated client for long-running operations.
#
# @return [::Google::Iam::V1beta::WorkloadIdentityPools::Operations]
#
attr_reader :operations_client
+ ##
+ # The logger used for request/response debug logging.
+ #
+ # @return [Logger]
+ #
+ def logger
+ @workload_identity_pools_stub.logger
+ end
+
# Service calls
##
# Lists all non-deleted
# {::Google::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}s in a
@@ -331,11 +351,11 @@
retry_policy: @config.retry_policy
@workload_identity_pools_stub.call_rpc :list_workload_identity_pools, request, options: options do |response, operation|
response = ::Gapic::PagedEnumerable.new @workload_identity_pools_stub, :list_workload_identity_pools, request, response, operation, options
yield response, operation if block_given?
- return response
+ throw :response, response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -418,11 +438,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@workload_identity_pools_stub.call_rpc :get_workload_identity_pool, request, options: options do |response, operation|
yield response, operation if block_given?
- return response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -523,11 +542,11 @@
retry_policy: @config.retry_policy
@workload_identity_pools_stub.call_rpc :create_workload_identity_pool, request, options: options do |response, operation|
response = ::Gapic::Operation.new response, @operations_client, options: options
yield response, operation if block_given?
- return response
+ throw :response, response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -620,11 +639,11 @@
retry_policy: @config.retry_policy
@workload_identity_pools_stub.call_rpc :update_workload_identity_pool, request, options: options do |response, operation|
response = ::Gapic::Operation.new response, @operations_client, options: options
yield response, operation if block_given?
- return response
+ throw :response, response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -725,11 +744,11 @@
retry_policy: @config.retry_policy
@workload_identity_pools_stub.call_rpc :delete_workload_identity_pool, request, options: options do |response, operation|
response = ::Gapic::Operation.new response, @operations_client, options: options
yield response, operation if block_given?
- return response
+ throw :response, response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -820,11 +839,11 @@
retry_policy: @config.retry_policy
@workload_identity_pools_stub.call_rpc :undelete_workload_identity_pool, request, options: options do |response, operation|
response = ::Gapic::Operation.new response, @operations_client, options: options
yield response, operation if block_given?
- return response
+ throw :response, response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -924,11 +943,11 @@
retry_policy: @config.retry_policy
@workload_identity_pools_stub.call_rpc :list_workload_identity_pool_providers, request, options: options do |response, operation|
response = ::Gapic::PagedEnumerable.new @workload_identity_pools_stub, :list_workload_identity_pool_providers, request, response, operation, options
yield response, operation if block_given?
- return response
+ throw :response, response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -1011,11 +1030,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@workload_identity_pools_stub.call_rpc :get_workload_identity_pool_provider, request, options: options do |response, operation|
yield response, operation if block_given?
- return response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -1117,11 +1135,11 @@
retry_policy: @config.retry_policy
@workload_identity_pools_stub.call_rpc :create_workload_identity_pool_provider, request, options: options do |response, operation|
response = ::Gapic::Operation.new response, @operations_client, options: options
yield response, operation if block_given?
- return response
+ throw :response, response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -1214,11 +1232,11 @@
retry_policy: @config.retry_policy
@workload_identity_pools_stub.call_rpc :update_workload_identity_pool_provider, request, options: options do |response, operation|
response = ::Gapic::Operation.new response, @operations_client, options: options
yield response, operation if block_given?
- return response
+ throw :response, response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -1314,11 +1332,11 @@
retry_policy: @config.retry_policy
@workload_identity_pools_stub.call_rpc :delete_workload_identity_pool_provider, request, options: options do |response, operation|
response = ::Gapic::Operation.new response, @operations_client, options: options
yield response, operation if block_given?
- return response
+ throw :response, response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -1410,11 +1428,11 @@
retry_policy: @config.retry_policy
@workload_identity_pools_stub.call_rpc :undelete_workload_identity_pool_provider, request, options: options do |response, operation|
response = ::Gapic::Operation.new response, @operations_client, options: options
yield response, operation if block_given?
- return response
+ throw :response, response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -1499,10 +1517,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
@@ -1523,9 +1546,10 @@
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?