lib/zendesk_api/client.rb
# Called by {#connection} to build a connection. Can be overwritten in a
# subclass to add additional middleware and make other configuration
# changes.
#
# Uses middleware according to configuration options.
#
# Request logger if logger is not nil
# 
# Retry middleware if retry is true
Called by {#connection} to build a connection. Can be overwritten in a
subclass to add additional middleware and make other configuration
changes.

Uses middleware according to configuration options.

Request logger if logger is not nil

Retry middleware if retry is true
Called by { #connection } to build a connection . Can be overwritten in a subclass to add additional middleware and make other configuration changes . Uses middleware according to configuration options . Request logger if logger is not nil Retry middleware if retry is true
def build_connection
      Faraday.new(config.options) do |builder|
        builder.use Faraday::Request::BasicAuthentication, config.username, config.password
        builder.use Faraday::Response::RaiseError
        builder.use ZendeskAPI::Middleware::Response::Callback, self
        builder.use Faraday::Response::Logger, config.logger if config.logger
        builder.use ZendeskAPI::Middleware::Response::ParseIsoDates
        builder.response :json, :content_type => 'application/json'
        builder.use ZendeskAPI::Middleware::Response::Gzip
        builder.use ZendeskAPI::Middleware::Response::Deflate
        builder.use ZendeskAPI::Middleware::Request::EtagCache, :cache => config.cache
        builder.use ZendeskAPI::Middleware::Request::Upload
        builder.request :multipart
        builder.request :json
        builder.use ZendeskAPI::Middleware::Request::Retry, :logger => config.logger if config.retry 
        builder.adapter *config.adapter || Faraday.default_adapter
      end
    end
def build_connection Faraday . new ( config . options ) do | builder | builder . use Faraday :: Request :: BasicAuthentication , config . username , config . password builder . use Faraday :: Response :: RaiseError builder . use ZendeskAPI :: Middleware :: Response :: Callback , self builder . use Faraday :: Response :: Logger , config . logger if config . logger builder . use ZendeskAPI :: Middleware :: Response :: ParseIsoDates builder . response :json , :content_type => 'application/json' builder . use ZendeskAPI :: Middleware :: Response :: Gzip builder . use ZendeskAPI :: Middleware :: Response :: Deflate builder . use ZendeskAPI :: Middleware :: Request :: EtagCache , :cache => config . cache builder . use ZendeskAPI :: Middleware :: Request :: Upload builder . request :multipart builder . request :json builder . use ZendeskAPI :: Middleware :: Request :: Retry , :logger => config . logger if config . retry builder . adapter * config . adapter || Faraday . default_adapter end end
Called by {#connection} to build a connection.
Called by { #connection } to build a connection .
# response # request # Should always be first in the stack