# typed: true # DO NOT EDIT MANUALLY # This is an autogenerated file for types exported from the `faraday` gem. # Please instead update this file by running `bin/tapioca gem faraday`. # Public: This is the main namespace for Faraday. You can either use it to # create Faraday::Connection objects, or access it directly. # # Examples # # Faraday.get "http://faraday.com" # # conn = Faraday.new "http://faraday.com" # conn.get '/' # # source://faraday//lib/faraday/connection.rb#1 module Faraday class << self # source://faraday//lib/faraday.rb#231 def const_missing(name); end # Public: Gets or sets the Symbol key identifying a default Adapter to use # for the default Faraday::Connection. # # source://faraday//lib/faraday.rb#29 def default_adapter; end # Public: Updates default adapter while resetting # #default_connection. # # Returns the new default_adapter. # # source://faraday//lib/faraday.rb#88 def default_adapter=(adapter); end # Gets the default connection used for simple scripts. # # Returns a Faraday::Connection, configured with the #default_adapter. # # source://faraday//lib/faraday.rb#110 def default_connection; end # Public: Sets the default Faraday::Connection for simple scripts that # access the Faraday constant directly. # # Faraday.get "https://faraday.com" # # source://faraday//lib/faraday.rb#35 def default_connection=(_arg0); end # Gets the default connection options used when calling Faraday#new. # # Returns a Faraday::ConnectionOptions. # # source://faraday//lib/faraday.rb#117 def default_connection_options; end # Public: Sets the default options used when calling Faraday#new. # # source://faraday//lib/faraday.rb#38 def default_connection_options=(_arg0); end # Public: Gets or sets the path that the Faraday libs are loaded from. # # source://faraday//lib/faraday.rb#25 def lib_path; end # Public: Gets or sets the path that the Faraday libs are loaded from. # # source://faraday//lib/faraday.rb#25 def lib_path=(_arg0); end # Public: Initializes a new Faraday::Connection. # # url - The optional String base URL to use as a prefix for all # requests. Can also be the options Hash. # options - The optional Hash used to configure this Faraday::Connection. # Any of these values will be set on every request made, unless # overridden for a specific request. # :url - String base URL. # :params - Hash of URI query unencoded key/value pairs. # :headers - Hash of unencoded HTTP header key/value pairs. # :request - Hash of request options. # :ssl - Hash of SSL options. # :proxy - Hash of Proxy options. # # Examples # # Faraday.new 'http://faraday.com' # # # http://faraday.com?page=1 # Faraday.new 'http://faraday.com', :params => {:page => 1} # # # same # # Faraday.new :url => 'http://faraday.com', # :params => {:page => 1} # # Returns a Faraday::Connection. # # source://faraday//lib/faraday.rb#67 def new(url = T.unsafe(nil), options = T.unsafe(nil)); end # Internal: Requires internal Faraday libraries. # # *libs - One or more relative String names to Faraday classes. # # Returns nothing. # # source://faraday//lib/faraday.rb#78 def require_lib(*libs); end # Internal: Requires internal Faraday libraries. # # *libs - One or more relative String names to Faraday classes. # # Returns nothing. # # source://faraday//lib/faraday.rb#78 def require_libs(*libs); end # Public: Gets or sets the root path that Faraday is being loaded from. # This is the root from where the libraries are auto-loaded from. # # source://faraday//lib/faraday.rb#22 def root_path; end # Public: Gets or sets the root path that Faraday is being loaded from. # This is the root from where the libraries are auto-loaded from. # # source://faraday//lib/faraday.rb#22 def root_path=(_arg0); end private # Internal: Proxies method calls on the Faraday constant to # #default_connection. # # source://faraday//lib/faraday.rb#98 def method_missing(name, *args, &block); end end end # Public: Connection objects manage the default properties and the middleware # stack for fulfilling an HTTP request. # # Examples # # conn = Faraday::Connection.new 'http://sushi.com' # # # GET http://sushi.com/nigiri # conn.get 'nigiri' # # => # # # source://faraday//lib/faraday/connection.rb#13 class Faraday::Connection extend ::Forwardable # Public: Initializes a new Faraday::Connection. # # url - URI or String base URL to use as a prefix for all # requests (optional). # options - Hash or Faraday::ConnectionOptions. # :url - URI or String base URL (default: "http:/"). # :params - Hash of URI query unencoded key/value pairs. # :headers - Hash of unencoded HTTP header key/value pairs. # :request - Hash of request options. # :ssl - Hash of SSL options. # :proxy - URI, String or Hash of HTTP proxy options # (default: "http_proxy" environment variable). # :uri - URI or String # :user - String (optional) # :password - String (optional) # # @return [Connection] a new instance of Connection # @yield [_self] # @yieldparam _self [Faraday::Connection] the object that the method was called on # # source://faraday//lib/faraday/connection.rb#57 def initialize(url = T.unsafe(nil), options = T.unsafe(nil)); end # source://forwardable/1.3.2/forwardable.rb#229 def adapter(*args, **_arg1, &block); end # source://forwardable/1.3.2/forwardable.rb#229 def app(*args, **_arg1, &block); end # Public: Sets up a custom Authorization header. # # type - The String authorization type. # token - The String or Hash token. A String value is taken literally, and # a Hash is encoded into comma separated key/value pairs. # # Examples # # conn.authorization :Bearer, 'mF_9.B5f-4.1JqM' # conn.headers['Authorization'] # # => "Bearer mF_9.B5f-4.1JqM" # # conn.authorization :Token, :token => 'abcdef', :foo => 'bar' # conn.headers['Authorization'] # # => "Token token=\"abcdef\", # foo=\"bar\"" # # Returns nothing. # # source://faraday//lib/faraday/connection.rb#234 def authorization(type, token); end # Public: Sets up the Authorization header with these credentials, encoded # with base64. # # login - The authentication login. # pass - The authentication password. # # Examples # # conn.basic_auth 'Aladdin', 'open sesame' # conn.headers['Authorization'] # # => "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" # # Returns nothing. # # source://faraday//lib/faraday/connection.rb#195 def basic_auth(login, pass); end # source://forwardable/1.3.2/forwardable.rb#229 def build(*args, **_arg1, &block); end # Internal: Build an absolute URL based on url_prefix. # # url - A String or URI-like object # params - A Faraday::Utils::ParamsHash to replace the query values # of the resulting url (default: nil). # # Returns the resulting URI instance. # # source://faraday//lib/faraday/connection.rb#399 def build_exclusive_url(url = T.unsafe(nil), params = T.unsafe(nil), params_encoder = T.unsafe(nil)); end # Creates and configures the request object. # # Returns the new Request. # # source://faraday//lib/faraday/connection.rb#383 def build_request(method); end # Public: Takes a relative url for a request and combines it with the defaults # set on the connection instance. # # conn = Faraday::Connection.new { ... } # conn.url_prefix = "https://sushi.com/api?token=abc" # conn.scheme # => https # conn.path_prefix # => "/api" # # conn.build_url("nigiri?page=2") # => https://sushi.com/api/nigiri?token=abc&page=2 # conn.build_url("nigiri", :page => 2) # => https://sushi.com/api/nigiri?token=abc&page=2 # # source://faraday//lib/faraday/connection.rb#347 def build_url(url = T.unsafe(nil), extra_params = T.unsafe(nil)); end # Public: Returns the Faraday::Builder for this Connection. # # source://faraday//lib/faraday/connection.rb#28 def builder; end # Internal: Traverse the middleware stack in search of a # parallel-capable adapter. # # Yields in case of not found. # # Returns a parallel manager or nil if not found. # # source://faraday//lib/faraday/connection.rb#244 def default_parallel_manager; end # Public: Sets the default parallel manager for this connection. # # source://faraday//lib/faraday/connection.rb#40 def default_parallel_manager=(_arg0); end # source://faraday//lib/faraday/connection.rb#139 def delete(url = T.unsafe(nil), params = T.unsafe(nil), headers = T.unsafe(nil)); end # Internal: Creates a duplicate of this Faraday::Connection. # # Returns a Faraday::Connection. # # source://faraday//lib/faraday/connection.rb#415 def dup; end # source://faraday//lib/faraday/connection.rb#139 def get(url = T.unsafe(nil), params = T.unsafe(nil), headers = T.unsafe(nil)); end # source://faraday//lib/faraday/connection.rb#139 def head(url = T.unsafe(nil), params = T.unsafe(nil), headers = T.unsafe(nil)); end # Public: Returns a Hash of unencoded HTTP header key/value pairs. # # source://faraday//lib/faraday/connection.rb#21 def headers; end # Public: Sets the Hash of unencoded HTTP header key/value pairs. # # source://faraday//lib/faraday/connection.rb#102 def headers=(hash); end # source://forwardable/1.3.2/forwardable.rb#229 def host(*args, **_arg1, &block); end # source://forwardable/1.3.2/forwardable.rb#229 def host=(*args, **_arg1, &block); end # Public: Sets up the parallel manager to make a set of requests. # # manager - The parallel manager that this Connection's Adapter uses. # # Yields a block to execute multiple requests. # Returns nothing. # # source://faraday//lib/faraday/connection.rb#271 def in_parallel(manager = T.unsafe(nil)); end # Public: Determine if this Faraday::Connection can make parallel requests. # # Returns true or false. # # @return [Boolean] # # source://faraday//lib/faraday/connection.rb#261 def in_parallel?; end # Public: Returns a Hash of the request options. # # source://faraday//lib/faraday/connection.rb#31 def options; end # Public: Returns the parallel manager for this Connection. # # source://faraday//lib/faraday/connection.rb#37 def parallel_manager; end # Public: Returns a Hash of URI query unencoded key/value pairs. # # source://faraday//lib/faraday/connection.rb#18 def params; end # Public: Sets the Hash of URI query unencoded key/value pairs. # # source://faraday//lib/faraday/connection.rb#97 def params=(hash); end # source://faraday//lib/faraday/connection.rb#176 def patch(url = T.unsafe(nil), body = T.unsafe(nil), headers = T.unsafe(nil), &block); end # source://forwardable/1.3.2/forwardable.rb#229 def path_prefix(*args, **_arg1, &block); end # Public: Sets the path prefix and ensures that it always has a leading # slash. # # value - A String. # # Returns the new String path prefix. # # source://faraday//lib/faraday/connection.rb#329 def path_prefix=(value); end # source://forwardable/1.3.2/forwardable.rb#229 def port(*args, **_arg1, &block); end # source://forwardable/1.3.2/forwardable.rb#229 def port=(*args, **_arg1, &block); end # source://faraday//lib/faraday/connection.rb#176 def post(url = T.unsafe(nil), body = T.unsafe(nil), headers = T.unsafe(nil), &block); end # Public: Gets or Sets the Hash proxy options. # # source://faraday//lib/faraday/connection.rb#284 def proxy(arg = T.unsafe(nil)); end # source://faraday//lib/faraday/connection.rb#176 def put(url = T.unsafe(nil), body = T.unsafe(nil), headers = T.unsafe(nil), &block); end # source://forwardable/1.3.2/forwardable.rb#229 def request(*args, **_arg1, &block); end # source://forwardable/1.3.2/forwardable.rb#229 def response(*args, **_arg1, &block); end # Builds and runs the Faraday::Request. # # method - The Symbol HTTP method. # url - The String or URI to access. # body - The String body # headers - Hash of unencoded HTTP header key/value pairs. # # Returns a Faraday::Response. # # source://faraday//lib/faraday/connection.rb#365 def run_request(method, url, body, headers); end # source://forwardable/1.3.2/forwardable.rb#229 def scheme(*args, **_arg1, &block); end # source://forwardable/1.3.2/forwardable.rb#229 def scheme=(*args, **_arg1, &block); end # source://faraday//lib/faraday/connection.rb#431 def set_authorization_header(header_type, *args); end # Public: Returns a Hash of the SSL options. # # source://faraday//lib/faraday/connection.rb#34 def ssl; end # Public: Sets up the Authorization header with the given token. # # token - The String token. # options - Optional Hash of extra token options. # # Examples # # conn.token_auth 'abcdef', :foo => 'bar' # conn.headers['Authorization'] # # => "Token token=\"abcdef\", # foo=\"bar\"" # # Returns nothing. # # source://faraday//lib/faraday/connection.rb#212 def token_auth(token, options = T.unsafe(nil)); end # Public: Returns a URI with the prefix used for all requests from this # Connection. This includes a default host name, scheme, port, and path. # # source://faraday//lib/faraday/connection.rb#25 def url_prefix; end # Public: Parses the giving url with URI and stores the individual # components in this connection. These components serve as defaults for # requests made by this connection. # # url - A String or URI. # # Examples # # conn = Faraday::Connection.new { ... } # conn.url_prefix = "https://sushi.com/api" # conn.scheme # => https # conn.path_prefix # => "/api" # # conn.get("nigiri?page=2") # accesses https://sushi.com/api/nigiri # # Returns the parsed URI from teh given input.. # # source://faraday//lib/faraday/connection.rb#308 def url_prefix=(url, encoder = T.unsafe(nil)); end # source://forwardable/1.3.2/forwardable.rb#229 def use(*args, **_arg1, &block); end # Internal: Yields username and password extracted from a URI if they both exist. # # source://faraday//lib/faraday/connection.rb#425 def with_uri_credentials(uri); end end # A Set of allowed HTTP verbs. # # source://faraday//lib/faraday/connection.rb#15 Faraday::Connection::METHODS = T.let(T.unsafe(nil), Set) # Public: Adds the ability for other modules to register and lookup # middleware classes. # # source://faraday//lib/faraday.rb#137 module Faraday::MiddlewareRegistry # source://faraday//lib/faraday.rb#200 def fetch_middleware(key); end # source://faraday//lib/faraday.rb#204 def load_middleware(key); end # Public: Lookup middleware class with a registered Symbol shortcut. # # key - The Symbol key for the registered middleware. # # Examples # # module Faraday # class Whatever # register_middleware :foo => Foo # end # end # # Faraday::Whatever.lookup_middleware(:foo) # # => Faraday::Whatever::Foo # # Returns a middleware Class. # # source://faraday//lib/faraday.rb#187 def lookup_middleware(key); end # source://faraday//lib/faraday.rb#192 def middleware_mutex(&block); end # Public: Register middleware class(es) on the current module. # # mapping - A Hash mapping Symbol keys to classes. Classes can be expressed # as fully qualified constant, or a Proc that will be lazily # called to return the former. # # Examples # # module Faraday # class Whatever # # Middleware looked up by :foo returns Faraday::Whatever::Foo. # register_middleware :foo => Foo # # # Middleware looked up by :bar returns Faraday::Whatever.const_get(:Bar) # register_middleware :bar => :Bar # # # Middleware looked up by :baz requires 'baz' and returns Faraday::Whatever.const_get(:Baz) # register_middleware :baz => [:Baz, 'baz'] # end # end # # Returns nothing. # # source://faraday//lib/faraday.rb#160 def register_middleware(autoload_path = T.unsafe(nil), mapping = T.unsafe(nil)); end end # Subclasses Struct with some special helpers for converting from a Hash to # a Struct. # # source://faraday//lib/faraday/options.rb#5 class Faraday::Options < ::Struct # source://faraday//lib/faraday/options.rb#163 def [](key); end # Public # # source://faraday//lib/faraday/options.rb#46 def clear; end # Public # # source://faraday//lib/faraday/options.rb#39 def delete(key); end # Public # # source://faraday//lib/faraday/options.rb#11 def each; end # Public # # source://faraday//lib/faraday/options.rb#86 def each_key; end # Public # # source://faraday//lib/faraday/options.rb#101 def each_value; end # Public # # @return [Boolean] # # source://faraday//lib/faraday/options.rb#81 def empty?; end # Public # # source://faraday//lib/faraday/options.rb#56 def fetch(key, *args); end # Public # # @return [Boolean] # # source://faraday//lib/faraday/options.rb#94 def has_key?(key); end # Public # # @return [Boolean] # # source://faraday//lib/faraday/options.rb#109 def has_value?(value); end # Internal # # source://faraday//lib/faraday/options.rb#126 def inspect; end # Public # # @return [Boolean] # # source://faraday//lib/faraday/options.rb#94 def key?(key); end # Public # # source://faraday//lib/faraday/options.rb#76 def keys; end # Public # # source://faraday//lib/faraday/options.rb#51 def merge(value); end # Public # # source://faraday//lib/faraday/options.rb#19 def merge!(obj); end # source://faraday//lib/faraday/options.rb#172 def symbolized_key_set; end # Public # # source://faraday//lib/faraday/options.rb#116 def to_hash; end # Public # # source://faraday//lib/faraday/options.rb#19 def update(obj); end # Public # # @return [Boolean] # # source://faraday//lib/faraday/options.rb#109 def value?(value); end # Public # # source://faraday//lib/faraday/options.rb#71 def values_at(*keys); end class << self # Internal # # source://faraday//lib/faraday/options.rb#148 def attribute_options; end # source://faraday//lib/faraday/options.rb#182 def fetch_error_class; end # Public # # source://faraday//lib/faraday/options.rb#6 def from(value); end # @private # # source://faraday//lib/faraday/options.rb#176 def inherited(subclass); end # source://faraday//lib/faraday/options.rb#152 def memoized(key); end # source://faraday//lib/faraday/options.rb#159 def memoized_attributes; end # Internal # # source://faraday//lib/faraday/options.rb#138 def options(mapping); end # Internal # # source://faraday//lib/faraday/options.rb#143 def options_for(key); end end end # source://faraday//lib/faraday/options.rb#216 class Faraday::ProxyOptions < ::Faraday::Options extend ::Forwardable # source://forwardable/1.3.2/forwardable.rb#229 def host(*args, **_arg1, &block); end # source://forwardable/1.3.2/forwardable.rb#229 def host=(*args, **_arg1, &block); end # source://forwardable/1.3.2/forwardable.rb#229 def path(*args, **_arg1, &block); end # source://forwardable/1.3.2/forwardable.rb#229 def path=(*args, **_arg1, &block); end # source://forwardable/1.3.2/forwardable.rb#229 def port(*args, **_arg1, &block); end # source://forwardable/1.3.2/forwardable.rb#229 def port=(*args, **_arg1, &block); end # source://forwardable/1.3.2/forwardable.rb#229 def scheme(*args, **_arg1, &block); end # source://forwardable/1.3.2/forwardable.rb#229 def scheme=(*args, **_arg1, &block); end class << self # source://faraday//lib/faraday/options.rb#220 def from(value); end end end # source://faraday//lib/faraday/options.rb#193 class Faraday::RequestOptions < ::Faraday::Options # source://faraday//lib/faraday/options.rb#195 def []=(key, value); end end # source://faraday//lib/faraday/options.rb#205 class Faraday::SSLOptions < ::Faraday::Options # @return [Boolean] # # source://faraday//lib/faraday/options.rb#211 def disable?; end # @return [Boolean] # # source://faraday//lib/faraday/options.rb#207 def verify?; end end # source://faraday//lib/faraday.rb#132 Faraday::Timer = Timeout # source://faraday//lib/faraday/utils.rb#4 module Faraday::Utils extend ::Faraday::Utils # Normalize URI() behavior across Ruby versions # # url - A String or URI. # # Returns a parsed URI. # # source://faraday//lib/faraday/utils.rb#254 def URI(url); end # source://faraday//lib/faraday/utils.rb#179 def build_nested_query(params); end # source://faraday//lib/faraday/utils.rb#175 def build_query(params); end # Recursive hash merge # # source://faraday//lib/faraday/utils.rb#299 def deep_merge(source, hash); end # Recursive hash update # # source://faraday//lib/faraday/utils.rb#287 def deep_merge!(target, hash); end # source://faraday//lib/faraday/utils.rb#204 def default_params_encoder; end # source://faraday//lib/faraday/utils.rb#264 def default_uri_parser; end # source://faraday//lib/faraday/utils.rb#271 def default_uri_parser=(parser); end # source://faraday//lib/faraday/utils.rb#185 def escape(s); end # Stolen from Rack # # source://faraday//lib/faraday/utils.rb#213 def normalize_params(params, name, v = T.unsafe(nil)); end # Receives a String or URI and returns just the path with the query string sorted. # # source://faraday//lib/faraday/utils.rb#280 def normalize_path(url); end # source://faraday//lib/faraday/utils.rb#200 def parse_nested_query(query); end # Adapted from Rack # # source://faraday//lib/faraday/utils.rb#196 def parse_query(query); end # source://faraday//lib/faraday/utils.rb#191 def unescape(s); end protected # source://faraday//lib/faraday/utils.rb#305 def sort_query_params(query); end class << self # Sets the attribute default_params_encoder # # @param value the value to set the attribute default_params_encoder to. # # source://faraday//lib/faraday/utils.rb#209 def default_params_encoder=(_arg0); end end end # source://faraday//lib/faraday/utils.rb#193 Faraday::Utils::DEFAULT_SEP = T.let(T.unsafe(nil), Regexp) # source://faraday//lib/faraday/utils.rb#183 Faraday::Utils::ESCAPE_RE = T.let(T.unsafe(nil), Regexp) # Adapted from Rack::Utils::HeaderHash # # source://faraday//lib/faraday/utils.rb#8 class Faraday::Utils::Headers < ::Hash # @return [Headers] a new instance of Headers # # source://faraday//lib/faraday/utils.rb#13 def initialize(hash = T.unsafe(nil)); end # source://faraday//lib/faraday/utils.rb#41 def [](k); end # source://faraday//lib/faraday/utils.rb#46 def []=(k, v); end # source://faraday//lib/faraday/utils.rb#60 def delete(k); end # source://faraday//lib/faraday/utils.rb#54 def fetch(k, *args, &block); end # @return [Boolean] # # source://faraday//lib/faraday/utils.rb#68 def has_key?(k); end # @return [Boolean] # # source://faraday//lib/faraday/utils.rb#68 def include?(k); end # @return [Boolean] # # source://faraday//lib/faraday/utils.rb#68 def key?(k); end # @return [Boolean] # # source://faraday//lib/faraday/utils.rb#68 def member?(k); end # source://faraday//lib/faraday/utils.rb#82 def merge(other); end # source://faraday//lib/faraday/utils.rb#76 def merge!(other); end # source://faraday//lib/faraday/utils.rb#96 def parse(header_string); end # source://faraday//lib/faraday/utils.rb#87 def replace(other); end # source://faraday//lib/faraday/utils.rb#94 def to_hash; end # source://faraday//lib/faraday/utils.rb#76 def update(other); end protected # source://faraday//lib/faraday/utils.rb#113 def names; end private # on dup/clone, we need to duplicate @names hash # # source://faraday//lib/faraday/utils.rb#20 def initialize_copy(other); end class << self # source://faraday//lib/faraday/utils.rb#9 def from(value); end end end # symbol -> string mapper + cache # # source://faraday//lib/faraday/utils.rb#29 Faraday::Utils::Headers::KeyMap = T.let(T.unsafe(nil), Hash) # hash with stringified keys # # source://faraday//lib/faraday/utils.rb#119 class Faraday::Utils::ParamsHash < ::Hash # source://faraday//lib/faraday/utils.rb#120 def [](key); end # source://faraday//lib/faraday/utils.rb#124 def []=(key, value); end # source://faraday//lib/faraday/utils.rb#128 def delete(key); end # @return [Boolean] # # source://faraday//lib/faraday/utils.rb#132 def has_key?(key); end # @return [Boolean] # # source://faraday//lib/faraday/utils.rb#132 def include?(key); end # @return [Boolean] # # source://faraday//lib/faraday/utils.rb#132 def key?(key); end # @return [Boolean] # # source://faraday//lib/faraday/utils.rb#132 def member?(key); end # source://faraday//lib/faraday/utils.rb#148 def merge(params); end # source://faraday//lib/faraday/utils.rb#140 def merge!(params); end # source://faraday//lib/faraday/utils.rb#157 def merge_query(query, encoder = T.unsafe(nil)); end # source://faraday//lib/faraday/utils.rb#152 def replace(other); end # source://faraday//lib/faraday/utils.rb#164 def to_query(encoder = T.unsafe(nil)); end # source://faraday//lib/faraday/utils.rb#140 def update(params); end private # source://faraday//lib/faraday/utils.rb#170 def convert_key(key); end end # source://faraday//lib/faraday.rb#17 Faraday::VERSION = T.let(T.unsafe(nil), String)