class ZendeskAPI::Configuration
Holds the configuration options for the client and connection
Attributes
@return [String] OAuth2 access_token
@return [Symbol] Faraday adapter
@return [Proc] Faraday adapter proc
@return [Boolean] Whether to allow non-HTTPS connections for development purposes.
Use this cache instead of default ZendeskAPI::LRUCache.new
-
must respond to read/write/fetch e.g. ActiveSupport::Cache::MemoryStore.new)
-
pass false to disable caching
@return [ZendeskAPI::LRUCache]
@return [Hash] Client
configurations (eg ssh config) to pass to Faraday
@return [Logger] Logger to use when logging requests.
@return [String] The basic auth password.
@return [Boolean] Whether to raise error when rate-limited (http status: 429).
@return [Boolean] Whether to attempt to retry when rate-limited (http status: 429).
specify the server error codes in which you want a retry to be attempted
specify if you want a (network layer) exception to elicit a retry
@return [String] The basic auth token.
@return [String] The API url. Must be https unless {#allow_http} is set.
@return [Boolean] Whether to use resource_cache or not
@return [String] The basic auth username.
Public Class Methods
# File lib/zendesk_api/configuration.rb, line 57 def initialize @client_options = {} @use_resource_cache = true self.cache = ZendeskAPI::LRUCache.new(1000) end
Public Instance Methods
Sets accept and user_agent headers, and url.
@return [Hash] Faraday-formatted hash of options.
# File lib/zendesk_api/configuration.rb, line 67 def options { :headers => { :accept => 'application/json', :accept_encoding => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', :user_agent => "ZendeskAPI Ruby #{ZendeskAPI::VERSION}" }, :request => { :open_timeout => 10, :timeout => 60 }, :url => @url }.merge(client_options) end