lib/google/cloud/dataform/v1beta1/dataform/client.rb in google-cloud-dataform-v1beta1-0.7.1 vs lib/google/cloud/dataform/v1beta1/dataform/client.rb in google-cloud-dataform-v1beta1-0.8.0
- old
+ new
@@ -158,25 +158,38 @@
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
)
+ @dataform_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
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
config.credentials = credentials
config.quota_project = @quota_project_id
config.endpoint = @dataform_stub.endpoint
config.universe_domain = @dataform_stub.universe_domain
+ config.logger = @dataform_stub.logger if config.respond_to? :logger=
end
@iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
config.credentials = credentials
config.quota_project = @quota_project_id
config.endpoint = @dataform_stub.endpoint
config.universe_domain = @dataform_stub.universe_domain
+ config.logger = @dataform_stub.logger if config.respond_to? :logger=
end
end
##
# Get the associated client for mix-in of the Locations.
@@ -190,10 +203,19 @@
#
# @return [Google::Iam::V1::IAMPolicy::Client]
#
attr_reader :iam_policy_client
+ ##
+ # The logger used for request/response debug logging.
+ #
+ # @return [Logger]
+ #
+ def logger
+ @dataform_stub.logger
+ end
+
# Service calls
##
# Lists Repositories in a given project and location.
#
@@ -294,11 +316,11 @@
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :list_repositories, request, options: options do |response, operation|
response = ::Gapic::PagedEnumerable.new @dataform_stub, :list_repositories, 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
@@ -380,11 +402,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :get_repository, 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
@@ -472,11 +493,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :create_repository, 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
@@ -561,11 +581,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :update_repository, 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
@@ -651,11 +670,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :delete_repository, 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
@@ -747,11 +765,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :commit_repository_changes, 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
@@ -839,11 +856,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :read_repository_file, 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
@@ -949,11 +965,11 @@
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :query_repository_directory_contents, request, options: options do |response, operation|
response = ::Gapic::PagedEnumerable.new @dataform_stub, :query_repository_directory_contents, 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
@@ -1051,11 +1067,11 @@
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :fetch_repository_history, request, options: options do |response, operation|
response = ::Gapic::PagedEnumerable.new @dataform_stub, :fetch_repository_history, 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
@@ -1137,11 +1153,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :compute_repository_access_token_status, 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
@@ -1223,11 +1238,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :fetch_remote_branches, 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
@@ -1331,11 +1345,11 @@
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :list_workspaces, request, options: options do |response, operation|
response = ::Gapic::PagedEnumerable.new @dataform_stub, :list_workspaces, 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
@@ -1417,11 +1431,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :get_workspace, 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
@@ -1509,11 +1522,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :create_workspace, 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
@@ -1595,11 +1607,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :delete_workspace, 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
@@ -1681,11 +1692,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :install_npm_packages, 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
@@ -1773,11 +1783,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :pull_git_commits, 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
@@ -1863,11 +1872,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :push_git_commits, 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
@@ -1949,11 +1957,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :fetch_file_git_statuses, 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
@@ -2039,11 +2046,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :fetch_git_ahead_behind, 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
@@ -2132,11 +2138,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :commit_workspace_changes, 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
@@ -2223,11 +2228,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :reset_workspace_changes, 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
@@ -2312,11 +2316,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :fetch_file_diff, 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
@@ -2417,11 +2420,11 @@
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :query_directory_contents, request, options: options do |response, operation|
response = ::Gapic::PagedEnumerable.new @dataform_stub, :query_directory_contents, 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
@@ -2506,11 +2509,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :make_directory, 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
@@ -2595,11 +2597,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :remove_directory, 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
@@ -2688,11 +2689,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :move_directory, 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
@@ -2777,11 +2777,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :read_file, 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
@@ -2866,11 +2865,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :remove_file, 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
@@ -2958,11 +2956,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :move_file, 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
@@ -3048,11 +3045,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :write_file, 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
@@ -3150,11 +3146,11 @@
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :list_release_configs, request, options: options do |response, operation|
response = ::Gapic::PagedEnumerable.new @dataform_stub, :list_release_configs, 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
@@ -3236,11 +3232,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :get_release_config, 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
@@ -3328,11 +3323,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :create_release_config, 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
@@ -3417,11 +3411,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :update_release_config, 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
@@ -3503,11 +3496,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :delete_release_config, 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
@@ -3605,11 +3597,11 @@
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :list_compilation_results, request, options: options do |response, operation|
response = ::Gapic::PagedEnumerable.new @dataform_stub, :list_compilation_results, 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
@@ -3691,11 +3683,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :get_compilation_result, 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
@@ -3780,11 +3771,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :create_compilation_result, 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
@@ -3886,11 +3876,11 @@
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :query_compilation_result_actions, request, options: options do |response, operation|
response = ::Gapic::PagedEnumerable.new @dataform_stub, :query_compilation_result_actions, 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
@@ -3988,11 +3978,11 @@
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :list_workflow_configs, request, options: options do |response, operation|
response = ::Gapic::PagedEnumerable.new @dataform_stub, :list_workflow_configs, 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
@@ -4074,11 +4064,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :get_workflow_config, 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
@@ -4166,11 +4155,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :create_workflow_config, 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
@@ -4255,11 +4243,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :update_workflow_config, 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
@@ -4341,11 +4328,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :delete_workflow_config, 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
@@ -4449,11 +4435,11 @@
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :list_workflow_invocations, request, options: options do |response, operation|
response = ::Gapic::PagedEnumerable.new @dataform_stub, :list_workflow_invocations, 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
@@ -4535,11 +4521,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :get_workflow_invocation, 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
@@ -4624,11 +4609,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :create_workflow_invocation, 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
@@ -4710,11 +4694,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :delete_workflow_invocation, 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
@@ -4796,11 +4779,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :cancel_workflow_invocation, 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
@@ -4899,11 +4881,11 @@
retry_policy: @config.retry_policy
@dataform_stub.call_rpc :query_workflow_invocation_actions, request, options: options do |response, operation|
response = ::Gapic::PagedEnumerable.new @dataform_stub, :query_workflow_invocation_actions, 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
@@ -4988,10 +4970,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
@@ -5012,9 +4999,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?