def middleware
      @middleware ||= proc do |builder|
        builder.request(:desk_encode_dates)
        builder.request(:desk_encode_json)
        builder.request(*authorize_request)
        builder.request(:desk_retry)

        builder.response(:desk_parse_dates)
        builder.response(:desk_follow_redirects)
        builder.response(:desk_raise_error, DeskApi::Error::ClientError)
        builder.response(:desk_raise_error, DeskApi::Error::ServerError)
        builder.response(:desk_parse_json)

        builder.adapter(Faraday.default_adapter)
      end
    end
def middleware
      @middleware ||= proc do |builder|
        builder.request(:desk_encode_dates)
        builder.request(:desk_encode_json)
        builder.request(*authorize_request)
        builder.request(:desk_retry)

        builder.response(:desk_parse_dates)
        builder.response(:desk_follow_redirects)
        builder.response(:desk_raise_error, DeskApi::Error::ClientError)
        builder.response(:desk_raise_error, DeskApi::Error::ServerError)
        builder.response(:desk_parse_json)

        builder.adapter(Faraday.default_adapter)
      end
    end
Returns the middleware proc to be used by Faraday

 @return [Proc]