lib/google/cloud/tasks/v2/cloud_tasks/client.rb in google-cloud-tasks-v2-0.1.0 vs lib/google/cloud/tasks/v2/cloud_tasks/client.rb in google-cloud-tasks-v2-0.2.0

- old
+ new

@@ -209,11 +209,12 @@ credentials = @config.credentials credentials ||= Credentials.default scope: @config.scope if credentials.is_a?(String) || credentials.is_a?(Hash) credentials = Credentials.new credentials, scope: @config.scope end - @quota_project_id = credentials.respond_to?(:quota_project_id) ? credentials.quota_project_id : nil + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @cloud_tasks_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Tasks::V2::CloudTasks::Stub, credentials: credentials, endpoint: @config.endpoint, @@ -1663,27 +1664,31 @@ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should # trigger a retry. # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] # class Configuration extend ::Gapic::Config - config_attr :endpoint, "cloudtasks.googleapis.com", String - config_attr :credentials, nil do |value| + config_attr :endpoint, "cloudtasks.googleapis.com", ::String + config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC allowed.any? { |klass| klass === value } end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, Proc, nil + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + 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 # @private def initialize parent_config = nil @parent_config = parent_config unless parent_config.nil?