lib/google/cloud/bigquery/service.rb in google-cloud-bigquery-1.22.0 vs lib/google/cloud/bigquery/service.rb in google-cloud-bigquery-1.23.0
- old
+ new
@@ -41,16 +41,17 @@
# @private
attr_reader :retries, :timeout, :host
##
# Creates a new Service instance.
- def initialize project, credentials, retries: nil, timeout: nil, host: nil
+ def initialize project, credentials, retries: nil, timeout: nil, host: nil, quota_project: nil
@project = project
@credentials = credentials
@retries = retries
@timeout = timeout
@host = host
+ @quota_project = quota_project
end
def service
return mocked_service if mocked_service
@service ||= begin
@@ -62,9 +63,10 @@
service.client_options.send_timeout_sec = timeout
service.request_options.retries = 0 # handle retries in #execute
service.request_options.header ||= {}
service.request_options.header["x-goog-api-client"] = \
"gl-ruby/#{RUBY_VERSION} gccl/#{Google::Cloud::Bigquery::VERSION}"
+ service.request_options.quota_project = @quota_project if @quota_project
service.authorization = @credentials.client
service.root_url = host if host
service
end
end