<%- assert_locals service -%> <%- method_service ||= service -%> ## # Configuration class for the <%= service.name %> REST API. # # This class represents the configuration for <%= service.name %> REST, # providing control over credentials, timeouts, retry behavior, logging. # # Configuration can be applied globally to all clients, or to a single client # on construction. # <%- unless method_service.methods.empty? -%> # # Examples # # To modify the global config, setting the timeout for all calls to 10 seconds: # # <%= service.client_name_full %>.configure do |config| # config.timeout = 10.0 # end # # To apply the above configuration only to a new client: # # client = <%= service.client_name_full %>.new do |config| # config.timeout = 10.0 # end # <%- end -%> # @!attribute [rw] endpoint # The hostname or hostname:port of the service endpoint. # Defaults to `<%= service.client_endpoint.inspect %>`. # @return [::String] # @!attribute [rw] credentials # Credentials to send with calls. You may provide any of the following types: # * (`String`) The path to a service account key file in JSON format # * (`Hash`) A service account key as a Hash # * (`Google::Auth::Credentials`) A googleauth credentials object # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html)) # * (`Signet::OAuth2::Client`) A signet oauth2 client object # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html)) # * (`nil`) indicating no credentials # @return [::Object] # @!attribute [rw] scope # The OAuth scopes # @return [::Array<::String>] # @!attribute [rw] lib_name # The library name as recorded in instrumentation and logging # @return [::String] # @!attribute [rw] lib_version # The library version as recorded in instrumentation and logging # @return [::String] # @!attribute [rw] timeout # The call timeout in seconds. # @return [::Numeric] # class Configuration extend ::Gapic::Config config_attr :endpoint, <%= service.client_endpoint.inspect %>, ::String config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] 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 :timeout, nil, ::Numeric, nil # @private def initialize parent_config = nil @parent_config = parent_config unless parent_config.nil? yield self if block_given? end end