danger-packwerk 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/danger-packwerk/packwerk_wrapper.rb +2 -2
- data/lib/danger-packwerk/version.rb +1 -1
- data/sorbet/config +1 -0
- data/sorbet/rbi/gems/actionview@7.0.4.rbi +11543 -0
- data/sorbet/rbi/gems/activesupport@7.0.4.rbi +12959 -0
- data/sorbet/rbi/gems/addressable@2.8.1.rbi +1505 -0
- data/sorbet/rbi/gems/ast@2.4.2.rbi +522 -0
- data/sorbet/rbi/gems/better_html@2.0.1.rbi +286 -0
- data/sorbet/rbi/gems/builder@3.2.4.rbi +8 -0
- data/sorbet/rbi/gems/claide-plugins@0.9.2.rbi +791 -0
- data/sorbet/rbi/gems/claide@1.1.0.rbi +1132 -0
- data/sorbet/rbi/gems/coderay@1.1.3.rbi +2256 -0
- data/sorbet/rbi/gems/colored2@3.1.2.rbi +130 -0
- data/sorbet/rbi/gems/concurrent-ruby@1.1.10.rbi +8695 -0
- data/sorbet/rbi/gems/cork@0.3.0.rbi +248 -0
- data/sorbet/rbi/gems/crass@1.0.6.rbi +436 -0
- data/sorbet/rbi/gems/danger-plugin-api@1.0.0.rbi +8 -0
- data/sorbet/rbi/gems/danger@9.0.0.rbi +4722 -0
- data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +862 -0
- data/sorbet/rbi/gems/erubi@1.11.0.rbi +102 -0
- data/sorbet/rbi/gems/faraday-em_http@1.0.0.rbi +266 -0
- data/sorbet/rbi/gems/faraday-em_synchrony@1.0.0.rbi +209 -0
- data/sorbet/rbi/gems/faraday-excon@1.1.0.rbi +212 -0
- data/sorbet/rbi/gems/faraday-http-cache@2.4.1.rbi +805 -0
- data/sorbet/rbi/gems/faraday-httpclient@1.0.1.rbi +221 -0
- data/sorbet/rbi/gems/faraday-multipart@1.0.4.rbi +266 -0
- data/sorbet/rbi/gems/faraday-net_http@1.0.1.rbi +216 -0
- data/sorbet/rbi/gems/faraday-net_http_persistent@1.2.0.rbi +206 -0
- data/sorbet/rbi/gems/faraday-patron@1.0.0.rbi +212 -0
- data/sorbet/rbi/gems/faraday-rack@1.0.0.rbi +225 -0
- data/sorbet/rbi/gems/faraday-retry@1.0.3.rbi +222 -0
- data/sorbet/rbi/gems/faraday@1.10.2.rbi +1862 -0
- data/sorbet/rbi/gems/git@1.12.0.rbi +1936 -0
- data/sorbet/rbi/gems/i18n@1.12.0.rbi +1643 -0
- data/sorbet/rbi/gems/json@2.6.2.rbi +1418 -0
- data/sorbet/rbi/gems/kramdown-parser-gfm@1.1.0.rbi +8 -0
- data/sorbet/rbi/gems/kramdown@2.4.0.rbi +2168 -0
- data/sorbet/rbi/gems/loofah@2.19.0.rbi +646 -0
- data/sorbet/rbi/gems/method_source@1.0.0.rbi +199 -0
- data/sorbet/rbi/gems/minitest@5.16.3.rbi +997 -0
- data/sorbet/rbi/gems/multipart-post@2.2.3.rbi +165 -0
- data/sorbet/rbi/gems/nap@1.1.0.rbi +351 -0
- data/sorbet/rbi/gems/no_proxy_fix@0.1.2.rbi +8 -0
- data/sorbet/rbi/gems/nokogiri@1.13.8.rbi +4916 -0
- data/sorbet/rbi/gems/octokit@5.6.1.rbi +8939 -0
- data/sorbet/rbi/gems/open4@1.3.4.rbi +8 -0
- data/sorbet/rbi/gems/{packwerk@2.1.1.rbi → packwerk@2.2.1.rbi} +602 -51
- data/sorbet/rbi/gems/parallel@1.22.1.rbi +163 -0
- data/sorbet/rbi/gems/parser@3.1.2.1.rbi +5988 -0
- data/sorbet/rbi/gems/pry@0.14.1.rbi +6969 -0
- data/sorbet/rbi/gems/public_suffix@5.0.0.rbi +779 -0
- data/sorbet/rbi/gems/racc@1.6.0.rbi +92 -0
- data/sorbet/rbi/gems/rails-dom-testing@2.0.3.rbi +8 -0
- data/sorbet/rbi/gems/rails-html-sanitizer@1.4.3.rbi +493 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +227 -0
- data/sorbet/rbi/gems/rake@13.0.6.rbi +1865 -0
- data/sorbet/rbi/gems/rbi@0.0.14.rbi +2337 -0
- data/sorbet/rbi/gems/rchardet@1.8.0.rbi +587 -0
- data/sorbet/rbi/gems/regexp_parser@2.5.0.rbi +1851 -0
- data/sorbet/rbi/gems/rexml@3.2.5.rbi +3852 -0
- data/sorbet/rbi/gems/rspec-core@3.11.0.rbi +7725 -0
- data/sorbet/rbi/gems/rspec-expectations@3.11.0.rbi +6201 -0
- data/sorbet/rbi/gems/rspec-mocks@3.11.1.rbi +3625 -0
- data/sorbet/rbi/gems/rspec-support@3.11.0.rbi +1176 -0
- data/sorbet/rbi/gems/rspec@3.11.0.rbi +40 -0
- data/sorbet/rbi/gems/rubocop-ast@1.21.0.rbi +4193 -0
- data/sorbet/rbi/gems/rubocop-sorbet@0.6.8.rbi +677 -0
- data/sorbet/rbi/gems/rubocop@1.36.0.rbi +37914 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +732 -0
- data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +8 -0
- data/sorbet/rbi/gems/sawyer@0.9.2.rbi +513 -0
- data/sorbet/rbi/gems/smart_properties@1.17.0.rbi +326 -0
- data/sorbet/rbi/gems/spoom@1.1.11.rbi +1600 -0
- data/sorbet/rbi/gems/tapioca@0.8.0.rbi +1959 -0
- data/sorbet/rbi/gems/terminal-table@3.0.2.rbi +438 -0
- data/sorbet/rbi/gems/thor@1.2.1.rbi +2921 -0
- data/sorbet/rbi/gems/tzinfo@2.0.5.rbi +4879 -0
- data/sorbet/rbi/gems/unicode-display_width@2.3.0.rbi +27 -0
- data/sorbet/rbi/gems/unparser@0.6.5.rbi +2789 -0
- data/sorbet/rbi/gems/webrick@1.7.0.rbi +1802 -0
- data/sorbet/rbi/gems/yard-sorbet@0.6.1.rbi +288 -0
- data/sorbet/rbi/gems/yard@0.9.27.rbi +12668 -0
- data/sorbet/rbi/todo.rbi +122 -0
- metadata +84 -7
- data/sorbet/rbi/gems/danger@8.5.0.rbi +0 -122
@@ -0,0 +1,1862 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `faraday` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem faraday`.
|
6
|
+
|
7
|
+
# This is the main namespace for Faraday.
|
8
|
+
#
|
9
|
+
# It provides methods to create {Connection} objects, and HTTP-related
|
10
|
+
# methods to use directly.
|
11
|
+
#
|
12
|
+
# @example Helpful class methods for easy usage
|
13
|
+
# Faraday.get "http://faraday.com"
|
14
|
+
# @example Helpful class method `.new` to create {Connection} objects.
|
15
|
+
# conn = Faraday.new "http://faraday.com"
|
16
|
+
# conn.get '/'
|
17
|
+
module Faraday
|
18
|
+
class << self
|
19
|
+
# @overload default_adapter
|
20
|
+
# @overload default_adapter=
|
21
|
+
def default_adapter; end
|
22
|
+
|
23
|
+
# Documented elsewhere, see default_adapter reader
|
24
|
+
def default_adapter=(adapter); end
|
25
|
+
|
26
|
+
# @overload default_connection
|
27
|
+
# @overload default_connection=
|
28
|
+
def default_connection; end
|
29
|
+
|
30
|
+
# Documented below, see default_connection
|
31
|
+
def default_connection=(_arg0); end
|
32
|
+
|
33
|
+
# Gets the default connection options used when calling {Faraday#new}.
|
34
|
+
#
|
35
|
+
# @return [Faraday::ConnectionOptions]
|
36
|
+
def default_connection_options; end
|
37
|
+
|
38
|
+
# Sets the default options used when calling {Faraday#new}.
|
39
|
+
#
|
40
|
+
# @param options [Hash, Faraday::ConnectionOptions]
|
41
|
+
def default_connection_options=(options); end
|
42
|
+
|
43
|
+
# Tells Faraday to ignore the environment proxy (http_proxy).
|
44
|
+
# Defaults to `false`.
|
45
|
+
#
|
46
|
+
# @return [Boolean]
|
47
|
+
def ignore_env_proxy; end
|
48
|
+
|
49
|
+
# Tells Faraday to ignore the environment proxy (http_proxy).
|
50
|
+
# Defaults to `false`.
|
51
|
+
#
|
52
|
+
# @return [Boolean]
|
53
|
+
def ignore_env_proxy=(_arg0); end
|
54
|
+
|
55
|
+
# Gets or sets the path that the Faraday libs are loaded from.
|
56
|
+
#
|
57
|
+
# @return [String]
|
58
|
+
def lib_path; end
|
59
|
+
|
60
|
+
# Gets or sets the path that the Faraday libs are loaded from.
|
61
|
+
#
|
62
|
+
# @return [String]
|
63
|
+
def lib_path=(_arg0); end
|
64
|
+
|
65
|
+
# Initializes a new {Connection}.
|
66
|
+
#
|
67
|
+
# @example With an URL argument
|
68
|
+
# Faraday.new 'http://faraday.com'
|
69
|
+
# # => Faraday::Connection to http://faraday.com
|
70
|
+
# @example With everything in an options hash
|
71
|
+
# Faraday.new url: 'http://faraday.com',
|
72
|
+
# params: { page: 1 }
|
73
|
+
# # => Faraday::Connection to http://faraday.com?page=1
|
74
|
+
# @example With an URL argument and an options hash
|
75
|
+
# Faraday.new 'http://faraday.com', params: { page: 1 }
|
76
|
+
# # => Faraday::Connection to http://faraday.com?page=1
|
77
|
+
# @option options
|
78
|
+
# @option options
|
79
|
+
# @option options
|
80
|
+
# @option options
|
81
|
+
# @option options
|
82
|
+
# @option options
|
83
|
+
# @param url [String, Hash] The optional String base URL to use as a prefix
|
84
|
+
# for all requests. Can also be the options Hash. Any of these
|
85
|
+
# values will be set on every request made, unless overridden
|
86
|
+
# for a specific request.
|
87
|
+
# @param options [Hash]
|
88
|
+
# @return [Faraday::Connection]
|
89
|
+
def new(url = T.unsafe(nil), options = T.unsafe(nil), &block); end
|
90
|
+
|
91
|
+
# Internal: Requires internal Faraday libraries.
|
92
|
+
#
|
93
|
+
# @param libs [Array] one or more relative String names to Faraday classes.
|
94
|
+
# @private
|
95
|
+
# @return [void]
|
96
|
+
def require_lib(*libs); end
|
97
|
+
|
98
|
+
# Internal: Requires internal Faraday libraries.
|
99
|
+
#
|
100
|
+
# @param libs [Array] one or more relative String names to Faraday classes.
|
101
|
+
# @private
|
102
|
+
# @return [void]
|
103
|
+
def require_libs(*libs); end
|
104
|
+
|
105
|
+
# @return [Boolean]
|
106
|
+
def respond_to_missing?(symbol, include_private = T.unsafe(nil)); end
|
107
|
+
|
108
|
+
# The root path that Faraday is being loaded from.
|
109
|
+
#
|
110
|
+
# This is the root from where the libraries are auto-loaded.
|
111
|
+
#
|
112
|
+
# @return [String]
|
113
|
+
def root_path; end
|
114
|
+
|
115
|
+
# The root path that Faraday is being loaded from.
|
116
|
+
#
|
117
|
+
# This is the root from where the libraries are auto-loaded.
|
118
|
+
#
|
119
|
+
# @return [String]
|
120
|
+
def root_path=(_arg0); end
|
121
|
+
|
122
|
+
private
|
123
|
+
|
124
|
+
# Internal: Proxies method calls on the Faraday constant to
|
125
|
+
# .default_connection.
|
126
|
+
def method_missing(name, *args, &block); end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
# Base class for all Faraday adapters. Adapters are
|
131
|
+
# responsible for fulfilling a Faraday request.
|
132
|
+
class Faraday::Adapter
|
133
|
+
extend ::Faraday::MiddlewareRegistry
|
134
|
+
extend ::Faraday::DependencyLoader
|
135
|
+
extend ::Faraday::Adapter::Parallelism
|
136
|
+
extend ::Faraday::AutoloadHelper
|
137
|
+
|
138
|
+
# @return [Adapter] a new instance of Adapter
|
139
|
+
def initialize(_app = T.unsafe(nil), opts = T.unsafe(nil), &block); end
|
140
|
+
|
141
|
+
def call(env); end
|
142
|
+
|
143
|
+
# Close any persistent connections. The adapter should still be usable
|
144
|
+
# after calling close.
|
145
|
+
def close; end
|
146
|
+
|
147
|
+
# Yields or returns an adapter's configured connection. Depends on
|
148
|
+
# #build_connection being defined on this adapter.
|
149
|
+
#
|
150
|
+
# @param env [Faraday::Env, Hash] The env object for a faraday request.
|
151
|
+
# @return The return value of the given block, or the HTTP connection object
|
152
|
+
# if no block is given.
|
153
|
+
# @yield [conn]
|
154
|
+
def connection(env); end
|
155
|
+
|
156
|
+
private
|
157
|
+
|
158
|
+
# Fetches either a read, write, or open timeout setting. Defaults to the
|
159
|
+
# :timeout value if a more specific one is not given.
|
160
|
+
#
|
161
|
+
# @param type [Symbol] Describes which timeout setting to get: :read,
|
162
|
+
# :write, or :open.
|
163
|
+
# @param options [Hash] Hash containing Symbol keys like :timeout,
|
164
|
+
# :read_timeout, :write_timeout, :open_timeout, or
|
165
|
+
# :timeout
|
166
|
+
# @return [Integer, nil] Timeout duration in seconds, or nil if no timeout
|
167
|
+
# has been set.
|
168
|
+
def request_timeout(type, options); end
|
169
|
+
|
170
|
+
def save_response(env, status, body, headers = T.unsafe(nil), reason_phrase = T.unsafe(nil)); end
|
171
|
+
end
|
172
|
+
|
173
|
+
Faraday::Adapter::CONTENT_LENGTH = T.let(T.unsafe(nil), String)
|
174
|
+
|
175
|
+
# This module marks an Adapter as supporting parallel requests.
|
176
|
+
module Faraday::Adapter::Parallelism
|
177
|
+
def inherited(subclass); end
|
178
|
+
|
179
|
+
# Sets the attribute supports_parallel
|
180
|
+
#
|
181
|
+
# @param value the value to set the attribute supports_parallel to.
|
182
|
+
def supports_parallel=(_arg0); end
|
183
|
+
|
184
|
+
# @return [Boolean]
|
185
|
+
def supports_parallel?; end
|
186
|
+
end
|
187
|
+
|
188
|
+
Faraday::Adapter::TIMEOUT_KEYS = T.let(T.unsafe(nil), Hash)
|
189
|
+
|
190
|
+
# @example
|
191
|
+
# test = Faraday::Connection.new do
|
192
|
+
# use Faraday::Adapter::Test do |stub|
|
193
|
+
# # Define matcher to match the request
|
194
|
+
# stub.get '/resource.json' do
|
195
|
+
# # return static content
|
196
|
+
# [200, {'Content-Type' => 'application/json'}, 'hi world']
|
197
|
+
# end
|
198
|
+
#
|
199
|
+
# # response with content generated based on request
|
200
|
+
# stub.get '/showget' do |env|
|
201
|
+
# [200, {'Content-Type' => 'text/plain'}, env[:method].to_s]
|
202
|
+
# end
|
203
|
+
#
|
204
|
+
# # A regular expression can be used as matching filter
|
205
|
+
# stub.get /\A\/items\/(\d+)\z/ do |env, meta|
|
206
|
+
# # in case regular expression is used, an instance of MatchData
|
207
|
+
# # can be received
|
208
|
+
# [200,
|
209
|
+
# {'Content-Type' => 'text/plain'},
|
210
|
+
# "showing item: #{meta[:match_data][1]}"
|
211
|
+
# ]
|
212
|
+
# end
|
213
|
+
#
|
214
|
+
# # You can set strict_mode to exactly match the stubbed requests.
|
215
|
+
# stub.strict_mode = true
|
216
|
+
# end
|
217
|
+
# end
|
218
|
+
#
|
219
|
+
# resp = test.get '/resource.json'
|
220
|
+
# resp.body # => 'hi world'
|
221
|
+
#
|
222
|
+
# resp = test.get '/showget'
|
223
|
+
# resp.body # => 'get'
|
224
|
+
#
|
225
|
+
# resp = test.get '/items/1'
|
226
|
+
# resp.body # => 'showing item: 1'
|
227
|
+
#
|
228
|
+
# resp = test.get '/items/2'
|
229
|
+
# resp.body # => 'showing item: 2'
|
230
|
+
class Faraday::Adapter::Test < ::Faraday::Adapter
|
231
|
+
# @return [Test] a new instance of Test
|
232
|
+
def initialize(app, stubs = T.unsafe(nil), &block); end
|
233
|
+
|
234
|
+
# @param env [Faraday::Env]
|
235
|
+
def call(env); end
|
236
|
+
|
237
|
+
# @yield [stubs]
|
238
|
+
def configure; end
|
239
|
+
|
240
|
+
# Returns the value of attribute stubs.
|
241
|
+
def stubs; end
|
242
|
+
|
243
|
+
# Sets the attribute stubs
|
244
|
+
#
|
245
|
+
# @param value the value to set the attribute stubs to.
|
246
|
+
def stubs=(_arg0); end
|
247
|
+
end
|
248
|
+
|
249
|
+
# Stub request
|
250
|
+
class Faraday::Adapter::Test::Stub < ::Struct
|
251
|
+
# @return [Boolean]
|
252
|
+
def headers_match?(request_headers); end
|
253
|
+
|
254
|
+
# @param env [Faraday::Env]
|
255
|
+
# @return [Boolean]
|
256
|
+
def matches?(env); end
|
257
|
+
|
258
|
+
# @param env [Faraday::Env]
|
259
|
+
# @return [Boolean]
|
260
|
+
def params_match?(env); end
|
261
|
+
|
262
|
+
# @return [Boolean]
|
263
|
+
def path_match?(request_path, meta); end
|
264
|
+
|
265
|
+
def to_s; end
|
266
|
+
end
|
267
|
+
|
268
|
+
# A stack of Stubs
|
269
|
+
class Faraday::Adapter::Test::Stubs
|
270
|
+
# @return [Stubs] a new instance of Stubs
|
271
|
+
# @yield [_self]
|
272
|
+
# @yieldparam _self [Faraday::Adapter::Test::Stubs] the object that the method was called on
|
273
|
+
def initialize(strict_mode: T.unsafe(nil)); end
|
274
|
+
|
275
|
+
def delete(path, headers = T.unsafe(nil), &block); end
|
276
|
+
|
277
|
+
# @return [Boolean]
|
278
|
+
def empty?; end
|
279
|
+
|
280
|
+
def get(path, headers = T.unsafe(nil), &block); end
|
281
|
+
def head(path, headers = T.unsafe(nil), &block); end
|
282
|
+
|
283
|
+
# @param env [Faraday::Env]
|
284
|
+
def match(env); end
|
285
|
+
|
286
|
+
def options(path, headers = T.unsafe(nil), &block); end
|
287
|
+
def patch(path, body = T.unsafe(nil), headers = T.unsafe(nil), &block); end
|
288
|
+
def post(path, body = T.unsafe(nil), headers = T.unsafe(nil), &block); end
|
289
|
+
def put(path, body = T.unsafe(nil), headers = T.unsafe(nil), &block); end
|
290
|
+
|
291
|
+
# Set strict_mode. If the value is true, this adapter tries to find matched requests strictly,
|
292
|
+
# which means that all of a path, parameters, and headers must be the same as an actual request.
|
293
|
+
def strict_mode=(value); end
|
294
|
+
|
295
|
+
# Raises an error if any of the stubbed calls have not been made.
|
296
|
+
def verify_stubbed_calls; end
|
297
|
+
|
298
|
+
protected
|
299
|
+
|
300
|
+
# @param stack [Hash]
|
301
|
+
# @param env [Faraday::Env]
|
302
|
+
# @return [Boolean]
|
303
|
+
def matches?(stack, env); end
|
304
|
+
|
305
|
+
def new_stub(request_method, path, headers = T.unsafe(nil), body = T.unsafe(nil), &block); end
|
306
|
+
end
|
307
|
+
|
308
|
+
class Faraday::Adapter::Test::Stubs::NotFound < ::StandardError; end
|
309
|
+
|
310
|
+
# Typhoeus adapter. This class is just a stub, the real adapter is in
|
311
|
+
# https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/adapters/faraday.rb
|
312
|
+
class Faraday::Adapter::Typhoeus < ::Faraday::Adapter
|
313
|
+
# Needs to define this method in order to support Typhoeus <= 1.3.0
|
314
|
+
def call; end
|
315
|
+
end
|
316
|
+
|
317
|
+
# AdapterRegistry registers adapter class names so they can be looked up by a
|
318
|
+
# String or Symbol name.
|
319
|
+
class Faraday::AdapterRegistry
|
320
|
+
# @return [AdapterRegistry] a new instance of AdapterRegistry
|
321
|
+
def initialize; end
|
322
|
+
|
323
|
+
def get(name); end
|
324
|
+
def set(klass, name = T.unsafe(nil)); end
|
325
|
+
end
|
326
|
+
|
327
|
+
# Adds the ability for other modules to manage autoloadable
|
328
|
+
# constants.
|
329
|
+
#
|
330
|
+
# @api private
|
331
|
+
module Faraday::AutoloadHelper
|
332
|
+
# Filters the module's contents with those that have been already
|
333
|
+
# autoloaded.
|
334
|
+
#
|
335
|
+
# @api private
|
336
|
+
# @return [Array<Class, Module>]
|
337
|
+
def all_loaded_constants; end
|
338
|
+
|
339
|
+
# Registers the constants to be auto loaded.
|
340
|
+
#
|
341
|
+
# @api private
|
342
|
+
# @example
|
343
|
+
#
|
344
|
+
# Faraday.autoload_all 'faraday/foo',
|
345
|
+
# Bar: 'bar'
|
346
|
+
#
|
347
|
+
# # requires faraday/foo/bar to load Faraday::Bar.
|
348
|
+
# Faraday::Bar
|
349
|
+
# @param prefix [String] The require prefix. If the path is inside Faraday,
|
350
|
+
# then it will be prefixed with the root path of this loaded
|
351
|
+
# Faraday version.
|
352
|
+
# @param options [{ Symbol => String }] library names.
|
353
|
+
# @return [void]
|
354
|
+
def autoload_all(prefix, options); end
|
355
|
+
|
356
|
+
# Loads each autoloaded constant. If thread safety is a concern,
|
357
|
+
# wrap this in a Mutex.
|
358
|
+
#
|
359
|
+
# @api private
|
360
|
+
# @return [void]
|
361
|
+
def load_autoloaded_constants; end
|
362
|
+
end
|
363
|
+
|
364
|
+
# Raised by Faraday::Response::RaiseError in case of a 400 response.
|
365
|
+
class Faraday::BadRequestError < ::Faraday::ClientError; end
|
366
|
+
|
367
|
+
Faraday::CONTENT_TYPE = T.let(T.unsafe(nil), String)
|
368
|
+
|
369
|
+
# Faraday client error class. Represents 4xx status responses.
|
370
|
+
class Faraday::ClientError < ::Faraday::Error; end
|
371
|
+
|
372
|
+
Faraday::CompositeReadIO = Faraday::Multipart::CompositeReadIO
|
373
|
+
|
374
|
+
# Raised by Faraday::Response::RaiseError in case of a 409 response.
|
375
|
+
class Faraday::ConflictError < ::Faraday::ClientError; end
|
376
|
+
|
377
|
+
# Connection objects manage the default properties and the middleware
|
378
|
+
# stack for fulfilling an HTTP request.
|
379
|
+
#
|
380
|
+
# @example
|
381
|
+
#
|
382
|
+
# conn = Faraday::Connection.new 'http://sushi.com'
|
383
|
+
#
|
384
|
+
# # GET http://sushi.com/nigiri
|
385
|
+
# conn.get 'nigiri'
|
386
|
+
# # => #<Faraday::Response>
|
387
|
+
class Faraday::Connection
|
388
|
+
extend ::Forwardable
|
389
|
+
extend ::Faraday::Deprecate
|
390
|
+
|
391
|
+
# Initializes a new Faraday::Connection.
|
392
|
+
#
|
393
|
+
# @option options
|
394
|
+
# @option options
|
395
|
+
# @option options
|
396
|
+
# @option options
|
397
|
+
# @option options
|
398
|
+
# @option options
|
399
|
+
# @option options
|
400
|
+
# @option options
|
401
|
+
# @option options
|
402
|
+
# @param url [URI, String] URI or String base URL to use as a prefix for all
|
403
|
+
# requests (optional).
|
404
|
+
# @param options [Hash, Faraday::ConnectionOptions]
|
405
|
+
# @return [Connection] a new instance of Connection
|
406
|
+
# @yield [self] after all setup has been done
|
407
|
+
def initialize(url = T.unsafe(nil), options = T.unsafe(nil)); end
|
408
|
+
|
409
|
+
def _deprecated_authorization(type, token); end
|
410
|
+
def _deprecated_basic_auth(login, pass); end
|
411
|
+
def _deprecated_token_auth(token, options = T.unsafe(nil)); end
|
412
|
+
def adapter(*args, &block); end
|
413
|
+
def app(*args, &block); end
|
414
|
+
|
415
|
+
# Sets up a custom Authorization header.
|
416
|
+
#
|
417
|
+
# @example
|
418
|
+
#
|
419
|
+
# conn.authorization :Bearer, 'mF_9.B5f-4.1JqM'
|
420
|
+
# conn.headers['Authorization']
|
421
|
+
# # => "Bearer mF_9.B5f-4.1JqM"
|
422
|
+
#
|
423
|
+
# conn.authorization :Token, token: 'abcdef', foo: 'bar'
|
424
|
+
# conn.headers['Authorization']
|
425
|
+
# # => "Token token=\"abcdef\",
|
426
|
+
# foo=\"bar\""
|
427
|
+
# @param type [String] authorization type
|
428
|
+
# @param token [String, Hash] token. A String value is taken literally, and
|
429
|
+
# a Hash is encoded into comma-separated key/value pairs.
|
430
|
+
# @return [void]
|
431
|
+
def authorization(*args, &block); end
|
432
|
+
|
433
|
+
# Sets up the Authorization header with these credentials, encoded
|
434
|
+
# with base64.
|
435
|
+
#
|
436
|
+
# @example
|
437
|
+
#
|
438
|
+
# conn.basic_auth 'Aladdin', 'open sesame'
|
439
|
+
# conn.headers['Authorization']
|
440
|
+
# # => "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=="
|
441
|
+
# @param login [String] The authentication login.
|
442
|
+
# @param pass [String] The authentication password.
|
443
|
+
# @return [void]
|
444
|
+
def basic_auth(*args, &block); end
|
445
|
+
|
446
|
+
def build(*args, &block); end
|
447
|
+
|
448
|
+
# Build an absolute URL based on url_prefix.
|
449
|
+
#
|
450
|
+
# of the resulting url (default: nil).
|
451
|
+
#
|
452
|
+
# @param url [String, URI]
|
453
|
+
# @param params [Faraday::Utils::ParamsHash] A Faraday::Utils::ParamsHash to
|
454
|
+
# replace the query values
|
455
|
+
# @return [URI]
|
456
|
+
def build_exclusive_url(url = T.unsafe(nil), params = T.unsafe(nil), params_encoder = T.unsafe(nil)); end
|
457
|
+
|
458
|
+
# Creates and configures the request object.
|
459
|
+
#
|
460
|
+
# @param method [Symbol]
|
461
|
+
# @return [Faraday::Request]
|
462
|
+
# @yield [Faraday::Request] if block given
|
463
|
+
def build_request(method); end
|
464
|
+
|
465
|
+
# Takes a relative url for a request and combines it with the defaults
|
466
|
+
# set on the connection instance.
|
467
|
+
#
|
468
|
+
# @example
|
469
|
+
# conn = Faraday::Connection.new { ... }
|
470
|
+
# conn.url_prefix = "https://sushi.com/api?token=abc"
|
471
|
+
# conn.scheme # => https
|
472
|
+
# conn.path_prefix # => "/api"
|
473
|
+
#
|
474
|
+
# conn.build_url("nigiri?page=2")
|
475
|
+
# # => https://sushi.com/api/nigiri?token=abc&page=2
|
476
|
+
#
|
477
|
+
# conn.build_url("nigiri", page: 2)
|
478
|
+
# # => https://sushi.com/api/nigiri?token=abc&page=2
|
479
|
+
# @param url [String]
|
480
|
+
# @param extra_params [Hash]
|
481
|
+
def build_url(url = T.unsafe(nil), extra_params = T.unsafe(nil)); end
|
482
|
+
|
483
|
+
# @return [Faraday::RackBuilder] Builder for this Connection.
|
484
|
+
def builder; end
|
485
|
+
|
486
|
+
# Closes the underlying resources and/or connections. In the case of
|
487
|
+
# persistent connections, this closes all currently open connections
|
488
|
+
# but does not prevent new connections from being made.
|
489
|
+
def close; end
|
490
|
+
|
491
|
+
# Check if the adapter is parallel-capable.
|
492
|
+
#
|
493
|
+
# @api private
|
494
|
+
# @return [Object, nil] a parallel manager or nil if yielded
|
495
|
+
# @yield if the adapter isn't parallel-capable, or if no adapter is set yet.
|
496
|
+
def default_parallel_manager; end
|
497
|
+
|
498
|
+
# Sets the default parallel manager for this connection.
|
499
|
+
def default_parallel_manager=(_arg0); end
|
500
|
+
|
501
|
+
def delete(url = T.unsafe(nil), params = T.unsafe(nil), headers = T.unsafe(nil)); end
|
502
|
+
|
503
|
+
# Creates a duplicate of this Faraday::Connection.
|
504
|
+
#
|
505
|
+
# @api private
|
506
|
+
# @return [Faraday::Connection]
|
507
|
+
def dup; end
|
508
|
+
|
509
|
+
def find_default_proxy; end
|
510
|
+
def get(url = T.unsafe(nil), params = T.unsafe(nil), headers = T.unsafe(nil)); end
|
511
|
+
def head(url = T.unsafe(nil), params = T.unsafe(nil), headers = T.unsafe(nil)); end
|
512
|
+
|
513
|
+
# @return [Hash] unencoded HTTP header key/value pairs.
|
514
|
+
def headers; end
|
515
|
+
|
516
|
+
# Sets the Hash of unencoded HTTP header key/value pairs.
|
517
|
+
#
|
518
|
+
# @param hash [Hash]
|
519
|
+
def headers=(hash); end
|
520
|
+
|
521
|
+
def host(*args, &block); end
|
522
|
+
def host=(*args, &block); end
|
523
|
+
|
524
|
+
# Sets up the parallel manager to make a set of requests.
|
525
|
+
#
|
526
|
+
# @param manager [Object] The parallel manager that this Connection's
|
527
|
+
# Adapter uses.
|
528
|
+
# @return [void]
|
529
|
+
# @yield a block to execute multiple requests.
|
530
|
+
def in_parallel(manager = T.unsafe(nil)); end
|
531
|
+
|
532
|
+
# Determine if this Faraday::Connection can make parallel requests.
|
533
|
+
#
|
534
|
+
# @return [Boolean]
|
535
|
+
def in_parallel?; end
|
536
|
+
|
537
|
+
def initialize_proxy(url, options); end
|
538
|
+
|
539
|
+
# @example
|
540
|
+
# conn.options '/items/1'
|
541
|
+
# @overload options
|
542
|
+
# @overload options
|
543
|
+
# @return [Faraday::Response]
|
544
|
+
# @yield [Faraday::Request] for further request customizations
|
545
|
+
def options(*args); end
|
546
|
+
|
547
|
+
# @return [Object] the parallel manager for this Connection.
|
548
|
+
def parallel_manager; end
|
549
|
+
|
550
|
+
# @return [Hash] URI query unencoded key/value pairs.
|
551
|
+
def params; end
|
552
|
+
|
553
|
+
# Sets the Hash of URI query unencoded key/value pairs.
|
554
|
+
#
|
555
|
+
# @param hash [Hash]
|
556
|
+
def params=(hash); end
|
557
|
+
|
558
|
+
def patch(url = T.unsafe(nil), body = T.unsafe(nil), headers = T.unsafe(nil), &block); end
|
559
|
+
def path_prefix(*args, &block); end
|
560
|
+
|
561
|
+
# Sets the path prefix and ensures that it always has a leading
|
562
|
+
# slash.
|
563
|
+
#
|
564
|
+
# @param value [String]
|
565
|
+
# @return [String] the new path prefix
|
566
|
+
def path_prefix=(value); end
|
567
|
+
|
568
|
+
def port(*args, &block); end
|
569
|
+
def port=(*args, &block); end
|
570
|
+
def post(url = T.unsafe(nil), body = T.unsafe(nil), headers = T.unsafe(nil), &block); end
|
571
|
+
|
572
|
+
# @return [Hash] proxy options.
|
573
|
+
def proxy; end
|
574
|
+
|
575
|
+
# Sets the Hash proxy options.
|
576
|
+
#
|
577
|
+
# @param new_value [Object]
|
578
|
+
def proxy=(new_value); end
|
579
|
+
|
580
|
+
def proxy_for_request(url); end
|
581
|
+
def proxy_from_env(url); end
|
582
|
+
def put(url = T.unsafe(nil), body = T.unsafe(nil), headers = T.unsafe(nil), &block); end
|
583
|
+
def request(*args, &block); end
|
584
|
+
def response(*args, &block); end
|
585
|
+
|
586
|
+
# Builds and runs the Faraday::Request.
|
587
|
+
#
|
588
|
+
# @param method [Symbol] HTTP method.
|
589
|
+
# @param url [String, URI] String or URI to access.
|
590
|
+
# @param body [Object] The request body that will eventually be converted to
|
591
|
+
# a string.
|
592
|
+
# @param headers [Hash] unencoded HTTP header key/value pairs.
|
593
|
+
# @return [Faraday::Response]
|
594
|
+
def run_request(method, url, body, headers); end
|
595
|
+
|
596
|
+
def scheme(*args, &block); end
|
597
|
+
def scheme=(*args, &block); end
|
598
|
+
def set_authorization_header(header_type, *args); end
|
599
|
+
def set_basic_auth(user, password); end
|
600
|
+
|
601
|
+
# @return [Hash] SSL options.
|
602
|
+
def ssl; end
|
603
|
+
|
604
|
+
# @return [Boolean]
|
605
|
+
def support_parallel?(adapter); end
|
606
|
+
|
607
|
+
# Sets up the Authorization header with the given token.
|
608
|
+
#
|
609
|
+
# @example
|
610
|
+
#
|
611
|
+
# conn.token_auth 'abcdef', foo: 'bar'
|
612
|
+
# conn.headers['Authorization']
|
613
|
+
# # => "Token token=\"abcdef\",
|
614
|
+
# foo=\"bar\""
|
615
|
+
# @param token [String]
|
616
|
+
# @param options [Hash] extra token options.
|
617
|
+
# @return [void]
|
618
|
+
def token_auth(*args, &block); end
|
619
|
+
|
620
|
+
def trace(url = T.unsafe(nil), params = T.unsafe(nil), headers = T.unsafe(nil)); end
|
621
|
+
|
622
|
+
# @return [String] a URI with the prefix used for all requests from this
|
623
|
+
# Connection. This includes a default host name, scheme, port, and path.
|
624
|
+
def url_prefix; end
|
625
|
+
|
626
|
+
# Parses the given URL with URI and stores the individual
|
627
|
+
# components in this connection. These components serve as defaults for
|
628
|
+
# requests made by this connection.
|
629
|
+
#
|
630
|
+
# @example
|
631
|
+
#
|
632
|
+
# conn = Faraday::Connection.new { ... }
|
633
|
+
# conn.url_prefix = "https://sushi.com/api"
|
634
|
+
# conn.scheme # => https
|
635
|
+
# conn.path_prefix # => "/api"
|
636
|
+
#
|
637
|
+
# conn.get("nigiri?page=2") # accesses https://sushi.com/api/nigiri
|
638
|
+
# @param url [String, URI]
|
639
|
+
# @param encoder [Object]
|
640
|
+
def url_prefix=(url, encoder = T.unsafe(nil)); end
|
641
|
+
|
642
|
+
def use(*args, &block); end
|
643
|
+
|
644
|
+
# Yields username and password extracted from a URI if they both exist.
|
645
|
+
#
|
646
|
+
# @api private
|
647
|
+
# @param uri [URI]
|
648
|
+
# @return [void]
|
649
|
+
# @yield [username, password] any username and password
|
650
|
+
# @yieldparam username [String] any username from URI
|
651
|
+
# @yieldparam password [String] any password from URI
|
652
|
+
def with_uri_credentials(uri); end
|
653
|
+
end
|
654
|
+
|
655
|
+
# A Set of allowed HTTP verbs.
|
656
|
+
Faraday::Connection::METHODS = T.let(T.unsafe(nil), Set)
|
657
|
+
|
658
|
+
Faraday::Connection::USER_AGENT = T.let(T.unsafe(nil), String)
|
659
|
+
|
660
|
+
# A unified error for failed connections.
|
661
|
+
class Faraday::ConnectionFailed < ::Faraday::Error; end
|
662
|
+
|
663
|
+
# ConnectionOptions contains the configurable properties for a Faraday
|
664
|
+
# connection object.
|
665
|
+
class Faraday::ConnectionOptions < ::Faraday::Options
|
666
|
+
def builder_class; end
|
667
|
+
def new_builder(block); end
|
668
|
+
def request; end
|
669
|
+
def ssl; end
|
670
|
+
end
|
671
|
+
|
672
|
+
# Sub-module for decoding query-string into parameters.
|
673
|
+
module Faraday::DecodeMethods
|
674
|
+
# @param query [nil, String]
|
675
|
+
# @raise [TypeError] if the nesting is incorrect
|
676
|
+
# @return [Array<Array, String>] the decoded params
|
677
|
+
def decode(query); end
|
678
|
+
|
679
|
+
protected
|
680
|
+
|
681
|
+
def add_to_context(is_array, context, value, subkey); end
|
682
|
+
def decode_pair(key, value, context); end
|
683
|
+
|
684
|
+
# Internal: convert a nested hash with purely numeric keys into an array.
|
685
|
+
# FIXME: this is not compatible with Rack::Utils.parse_nested_query
|
686
|
+
def dehash(hash, depth); end
|
687
|
+
|
688
|
+
def match_context(context, subkey); end
|
689
|
+
def new_context(subkey, is_array, context); end
|
690
|
+
def prepare_context(context, subkey, is_array, last_subkey); end
|
691
|
+
end
|
692
|
+
|
693
|
+
Faraday::DecodeMethods::SUBKEYS_REGEX = T.let(T.unsafe(nil), Regexp)
|
694
|
+
|
695
|
+
# DependencyLoader helps Faraday adapters and middleware load dependencies.
|
696
|
+
module Faraday::DependencyLoader
|
697
|
+
# Executes a block which should try to require and reference dependent
|
698
|
+
# libraries
|
699
|
+
def dependency(lib = T.unsafe(nil)); end
|
700
|
+
|
701
|
+
def inherited(subclass); end
|
702
|
+
|
703
|
+
# Returns the value of attribute load_error.
|
704
|
+
def load_error; end
|
705
|
+
|
706
|
+
# @return [Boolean]
|
707
|
+
def loaded?; end
|
708
|
+
|
709
|
+
def new(*_arg0); end
|
710
|
+
|
711
|
+
private
|
712
|
+
|
713
|
+
# Sets the attribute load_error
|
714
|
+
#
|
715
|
+
# @param value the value to set the attribute load_error to.
|
716
|
+
def load_error=(_arg0); end
|
717
|
+
end
|
718
|
+
|
719
|
+
# Deprecation using semver instead of date, based on Gem::Deprecate
|
720
|
+
# Provides a single method +deprecate+ to be used to declare when
|
721
|
+
# something is going away.
|
722
|
+
#
|
723
|
+
# class Legacy
|
724
|
+
# def self.klass_method
|
725
|
+
# # ...
|
726
|
+
# end
|
727
|
+
#
|
728
|
+
# def instance_method
|
729
|
+
# # ...
|
730
|
+
# end
|
731
|
+
#
|
732
|
+
# extend Faraday::Deprecate
|
733
|
+
# deprecate :instance_method, "X.z", '1.0'
|
734
|
+
#
|
735
|
+
# class << self
|
736
|
+
# extend Faraday::Deprecate
|
737
|
+
# deprecate :klass_method, :none, '1.0'
|
738
|
+
# end
|
739
|
+
# end
|
740
|
+
module Faraday::Deprecate
|
741
|
+
private
|
742
|
+
|
743
|
+
# Simple deprecation method that deprecates +name+ by wrapping it up
|
744
|
+
# in a dummy method. It warns on each call to the dummy method
|
745
|
+
# telling the user of +repl+ (unless +repl+ is :none) and the
|
746
|
+
# semver that it is planned to go away.
|
747
|
+
#
|
748
|
+
# @param name [Symbol] the method symbol to deprecate
|
749
|
+
# @param repl [#to_s, :none] the replacement to use, when `:none` it will
|
750
|
+
# alert the user that no replacement is present.
|
751
|
+
# @param ver [String] the semver the method will be removed.
|
752
|
+
def deprecate(name, repl, ver, custom_message = T.unsafe(nil)); end
|
753
|
+
|
754
|
+
# Temporarily turn off warnings. Intended for tests only.
|
755
|
+
def skip_during; end
|
756
|
+
|
757
|
+
class << self
|
758
|
+
# Simple deprecation method that deprecates +name+ by wrapping it up
|
759
|
+
# in a dummy method. It warns on each call to the dummy method
|
760
|
+
# telling the user of +repl+ (unless +repl+ is :none) and the
|
761
|
+
# semver that it is planned to go away.
|
762
|
+
#
|
763
|
+
# @param name [Symbol] the method symbol to deprecate
|
764
|
+
# @param repl [#to_s, :none] the replacement to use, when `:none` it will
|
765
|
+
# alert the user that no replacement is present.
|
766
|
+
# @param ver [String] the semver the method will be removed.
|
767
|
+
def deprecate(name, repl, ver, custom_message = T.unsafe(nil)); end
|
768
|
+
|
769
|
+
def skip; end
|
770
|
+
def skip=(value); end
|
771
|
+
|
772
|
+
# Temporarily turn off warnings. Intended for tests only.
|
773
|
+
def skip_during; end
|
774
|
+
end
|
775
|
+
end
|
776
|
+
|
777
|
+
# @param new_klass [Class] new Klass to use
|
778
|
+
# @return [Class] A modified version of new_klass that warns on
|
779
|
+
# usage about deprecation.
|
780
|
+
# @see Faraday::Deprecate
|
781
|
+
module Faraday::DeprecatedClass
|
782
|
+
class << self
|
783
|
+
def proxy_class(origclass, ver = T.unsafe(nil)); end
|
784
|
+
end
|
785
|
+
end
|
786
|
+
|
787
|
+
# Sub-module for encoding parameters into query-string.
|
788
|
+
module Faraday::EncodeMethods
|
789
|
+
# @param params [nil, Array, #to_hash] parameters to be encoded
|
790
|
+
# @raise [TypeError] if params can not be converted to a Hash
|
791
|
+
# @return [String] the encoded params
|
792
|
+
def encode(params); end
|
793
|
+
|
794
|
+
protected
|
795
|
+
|
796
|
+
def encode_array(parent, value); end
|
797
|
+
def encode_hash(parent, value); end
|
798
|
+
def encode_pair(parent, value); end
|
799
|
+
end
|
800
|
+
|
801
|
+
class Faraday::Env < ::Faraday::Options
|
802
|
+
extend ::Forwardable
|
803
|
+
|
804
|
+
# @param key [Object]
|
805
|
+
def [](key); end
|
806
|
+
|
807
|
+
# @param key [Object]
|
808
|
+
# @param value [Object]
|
809
|
+
def []=(key, value); end
|
810
|
+
|
811
|
+
# string.
|
812
|
+
#
|
813
|
+
# @return [String] The request body that will eventually be converted to a
|
814
|
+
def body; end
|
815
|
+
|
816
|
+
# string.
|
817
|
+
#
|
818
|
+
# @return [String] The request body that will eventually be converted to a
|
819
|
+
def body=(value); end
|
820
|
+
|
821
|
+
# Sets content length to zero and the body to the empty string.
|
822
|
+
def clear_body; end
|
823
|
+
|
824
|
+
def current_body; end
|
825
|
+
|
826
|
+
# @private
|
827
|
+
def custom_members; end
|
828
|
+
|
829
|
+
# @return [Boolean]
|
830
|
+
def in_member_set?(key); end
|
831
|
+
|
832
|
+
def inspect; end
|
833
|
+
|
834
|
+
# set of {MethodsWithBodies}.
|
835
|
+
#
|
836
|
+
# @return [Boolean] true if there's no body yet, and the method is in the
|
837
|
+
def needs_body?; end
|
838
|
+
|
839
|
+
# @return [Boolean] true if there is a parallel_manager
|
840
|
+
def parallel?; end
|
841
|
+
|
842
|
+
def params_encoder(*args, &block); end
|
843
|
+
|
844
|
+
# {StatusesWithoutBody}.
|
845
|
+
#
|
846
|
+
# @return [Boolean] true if the status isn't in the set of
|
847
|
+
def parse_body?; end
|
848
|
+
|
849
|
+
# @return [Boolean] true if status is in the set of {SuccessfulStatuses}.
|
850
|
+
def success?; end
|
851
|
+
|
852
|
+
class << self
|
853
|
+
# Build a new Env from given value. Respects and updates `custom_members`.
|
854
|
+
#
|
855
|
+
# @param value [Object] a value fitting Option.from(v).
|
856
|
+
# @return [Env] from given value
|
857
|
+
def from(value); end
|
858
|
+
|
859
|
+
# @private
|
860
|
+
def member_set; end
|
861
|
+
end
|
862
|
+
end
|
863
|
+
|
864
|
+
Faraday::Env::ContentLength = T.let(T.unsafe(nil), String)
|
865
|
+
|
866
|
+
# A Set of HTTP verbs that typically send a body. If no body is set for
|
867
|
+
# these requests, the Content-Length header is set to 0.
|
868
|
+
Faraday::Env::MethodsWithBodies = T.let(T.unsafe(nil), Set)
|
869
|
+
|
870
|
+
Faraday::Env::StatusesWithoutBody = T.let(T.unsafe(nil), Set)
|
871
|
+
Faraday::Env::SuccessfulStatuses = T.let(T.unsafe(nil), Range)
|
872
|
+
|
873
|
+
# Faraday error base class.
|
874
|
+
class Faraday::Error < ::StandardError
|
875
|
+
# @return [Error] a new instance of Error
|
876
|
+
def initialize(exc, response = T.unsafe(nil)); end
|
877
|
+
|
878
|
+
def backtrace; end
|
879
|
+
def inspect; end
|
880
|
+
|
881
|
+
# Returns the value of attribute response.
|
882
|
+
def response; end
|
883
|
+
|
884
|
+
def response_body; end
|
885
|
+
def response_headers; end
|
886
|
+
def response_status; end
|
887
|
+
|
888
|
+
# Returns the value of attribute wrapped_exception.
|
889
|
+
def wrapped_exception; end
|
890
|
+
|
891
|
+
protected
|
892
|
+
|
893
|
+
# Pulls out potential parent exception and response hash.
|
894
|
+
def exc_msg_and_response(exc, response = T.unsafe(nil)); end
|
895
|
+
|
896
|
+
# Pulls out potential parent exception and response hash, storing them in
|
897
|
+
# instance variables.
|
898
|
+
# exc - Either an Exception, a string message, or a response hash.
|
899
|
+
# response - Hash
|
900
|
+
# :status - Optional integer HTTP response status
|
901
|
+
# :headers - String key/value hash of HTTP response header
|
902
|
+
# values.
|
903
|
+
# :body - Optional string HTTP response body.
|
904
|
+
# :request - Hash
|
905
|
+
# :method - Symbol with the request HTTP method.
|
906
|
+
# :url_path - String with the url path requested.
|
907
|
+
# :params - String key/value hash of query params
|
908
|
+
# present in the request.
|
909
|
+
# :headers - String key/value hash of HTTP request
|
910
|
+
# header values.
|
911
|
+
# :body - String HTTP request body.
|
912
|
+
#
|
913
|
+
# If a subclass has to call this, then it should pass a string message
|
914
|
+
# to `super`. See NilStatusError.
|
915
|
+
def exc_msg_and_response!(exc, response = T.unsafe(nil)); end
|
916
|
+
end
|
917
|
+
|
918
|
+
Faraday::FilePart = Multipart::Post::UploadIO
|
919
|
+
|
920
|
+
# FlatParamsEncoder manages URI params as a flat hash. Any Array values repeat
|
921
|
+
# the parameter multiple times.
|
922
|
+
module Faraday::FlatParamsEncoder
|
923
|
+
class << self
|
924
|
+
# Decode converts the given URI querystring into a hash.
|
925
|
+
#
|
926
|
+
# @example
|
927
|
+
#
|
928
|
+
# decode('a=one&a=two&a=three&b=true&c=C')
|
929
|
+
# # => {"a"=>["one", "two", "three"], "b"=>"true", "c"=>"C"}
|
930
|
+
# @param query [String] query arguments to parse.
|
931
|
+
# @return [Hash] parsed keys and value strings from the querystring.
|
932
|
+
def decode(query); end
|
933
|
+
|
934
|
+
# Encode converts the given param into a URI querystring. Keys and values
|
935
|
+
# will converted to strings and appropriately escaped for the URI.
|
936
|
+
#
|
937
|
+
# @example
|
938
|
+
#
|
939
|
+
# encode({a: %w[one two three], b: true, c: "C"})
|
940
|
+
# # => 'a=one&a=two&a=three&b=true&c=C'
|
941
|
+
# @param params [Hash] query arguments to convert.
|
942
|
+
# @return [String] the URI querystring (without the leading '?')
|
943
|
+
def encode(params); end
|
944
|
+
|
945
|
+
def escape(*args, &block); end
|
946
|
+
|
947
|
+
# Returns the value of attribute sort_params.
|
948
|
+
def sort_params; end
|
949
|
+
|
950
|
+
# Sets the attribute sort_params
|
951
|
+
#
|
952
|
+
# @param value the value to set the attribute sort_params to.
|
953
|
+
def sort_params=(_arg0); end
|
954
|
+
|
955
|
+
def unescape(*args, &block); end
|
956
|
+
end
|
957
|
+
end
|
958
|
+
|
959
|
+
# Raised by Faraday::Response::RaiseError in case of a 403 response.
|
960
|
+
class Faraday::ForbiddenError < ::Faraday::ClientError; end
|
961
|
+
|
962
|
+
module Faraday::Logging; end
|
963
|
+
|
964
|
+
# Serves as an integration point to customize logging
|
965
|
+
class Faraday::Logging::Formatter
|
966
|
+
extend ::Forwardable
|
967
|
+
|
968
|
+
# @return [Formatter] a new instance of Formatter
|
969
|
+
def initialize(logger:, options:); end
|
970
|
+
|
971
|
+
def debug(*args, &block); end
|
972
|
+
def error(*args, &block); end
|
973
|
+
def fatal(*args, &block); end
|
974
|
+
def filter(filter_word, filter_replacement); end
|
975
|
+
def info(*args, &block); end
|
976
|
+
def request(env); end
|
977
|
+
def response(env); end
|
978
|
+
def warn(*args, &block); end
|
979
|
+
|
980
|
+
private
|
981
|
+
|
982
|
+
def apply_filters(output); end
|
983
|
+
def dump_body(body); end
|
984
|
+
def dump_headers(headers); end
|
985
|
+
def log_body(type, body); end
|
986
|
+
|
987
|
+
# @return [Boolean]
|
988
|
+
def log_body?(type); end
|
989
|
+
|
990
|
+
def log_headers(type, headers); end
|
991
|
+
|
992
|
+
# @return [Boolean]
|
993
|
+
def log_headers?(type); end
|
994
|
+
|
995
|
+
def log_level; end
|
996
|
+
def pretty_inspect(body); end
|
997
|
+
end
|
998
|
+
|
999
|
+
Faraday::Logging::Formatter::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
|
1000
|
+
Faraday::METHODS_WITH_BODY = T.let(T.unsafe(nil), Array)
|
1001
|
+
Faraday::METHODS_WITH_QUERY = T.let(T.unsafe(nil), Array)
|
1002
|
+
|
1003
|
+
# Middleware is the basic base class of any Faraday middleware.
|
1004
|
+
class Faraday::Middleware
|
1005
|
+
extend ::Faraday::MiddlewareRegistry
|
1006
|
+
extend ::Faraday::DependencyLoader
|
1007
|
+
|
1008
|
+
# @return [Middleware] a new instance of Middleware
|
1009
|
+
def initialize(app = T.unsafe(nil), options = T.unsafe(nil)); end
|
1010
|
+
|
1011
|
+
# Returns the value of attribute app.
|
1012
|
+
def app; end
|
1013
|
+
|
1014
|
+
def call(env); end
|
1015
|
+
def close; end
|
1016
|
+
|
1017
|
+
# Returns the value of attribute options.
|
1018
|
+
def options; end
|
1019
|
+
end
|
1020
|
+
|
1021
|
+
# Adds the ability for other modules to register and lookup
|
1022
|
+
# middleware classes.
|
1023
|
+
module Faraday::MiddlewareRegistry
|
1024
|
+
def fetch_middleware(key); end
|
1025
|
+
def load_middleware(key); end
|
1026
|
+
|
1027
|
+
# Lookup middleware class with a registered Symbol shortcut.
|
1028
|
+
#
|
1029
|
+
# @example
|
1030
|
+
#
|
1031
|
+
# module Faraday
|
1032
|
+
# class Whatever
|
1033
|
+
# register_middleware foo: Foo
|
1034
|
+
# end
|
1035
|
+
# end
|
1036
|
+
#
|
1037
|
+
# Faraday::Whatever.lookup_middleware(:foo)
|
1038
|
+
# # => Faraday::Whatever::Foo
|
1039
|
+
# @param key [Symbol] key for the registered middleware.
|
1040
|
+
# @raise [Faraday::Error] if given key is not registered
|
1041
|
+
# @return [Class] a middleware Class.
|
1042
|
+
def lookup_middleware(key); end
|
1043
|
+
|
1044
|
+
def middleware_mutex(&block); end
|
1045
|
+
|
1046
|
+
# Register middleware class(es) on the current module.
|
1047
|
+
#
|
1048
|
+
# }] Middleware mapping from a lookup symbol to a reference to the
|
1049
|
+
# middleware.
|
1050
|
+
# Classes can be expressed as:
|
1051
|
+
# - a fully qualified constant
|
1052
|
+
# - a Symbol
|
1053
|
+
# - a Proc that will be lazily called to return the former
|
1054
|
+
# - an array is given, its first element is the constant or symbol,
|
1055
|
+
# and its second is a file to `require`.
|
1056
|
+
#
|
1057
|
+
# @example Lookup by a constant
|
1058
|
+
#
|
1059
|
+
# module Faraday
|
1060
|
+
# class Whatever
|
1061
|
+
# # Middleware looked up by :foo returns Faraday::Whatever::Foo.
|
1062
|
+
# register_middleware foo: Foo
|
1063
|
+
# end
|
1064
|
+
# end
|
1065
|
+
# @example Lookup by a symbol
|
1066
|
+
#
|
1067
|
+
# module Faraday
|
1068
|
+
# class Whatever
|
1069
|
+
# # Middleware looked up by :bar returns
|
1070
|
+
# # Faraday::Whatever.const_get(:Bar)
|
1071
|
+
# register_middleware bar: :Bar
|
1072
|
+
# end
|
1073
|
+
# end
|
1074
|
+
# @example Lookup by a symbol and string in an array
|
1075
|
+
#
|
1076
|
+
# module Faraday
|
1077
|
+
# class Whatever
|
1078
|
+
# # Middleware looked up by :baz requires 'baz' and returns
|
1079
|
+
# # Faraday::Whatever.const_get(:Baz)
|
1080
|
+
# register_middleware baz: [:Baz, 'baz']
|
1081
|
+
# end
|
1082
|
+
# end
|
1083
|
+
# @param autoload_path [String] Middleware autoload path
|
1084
|
+
# @param mapping [Hash{
|
1085
|
+
# Symbol => Module,
|
1086
|
+
# Symbol => Array<Module, Symbol, String>,] apping [Hash{
|
1087
|
+
# Symbol => Module,
|
1088
|
+
# Symbol => Array<Module, Symbol, String>,
|
1089
|
+
# @return [void]
|
1090
|
+
def register_middleware(autoload_path = T.unsafe(nil), mapping = T.unsafe(nil)); end
|
1091
|
+
|
1092
|
+
# Unregister a previously registered middleware class.
|
1093
|
+
#
|
1094
|
+
# @param key [Symbol] key for the registered middleware.
|
1095
|
+
def unregister_middleware(key); end
|
1096
|
+
end
|
1097
|
+
|
1098
|
+
# This is the default encoder for Faraday requests.
|
1099
|
+
# Using this encoder, parameters will be encoded respecting their structure,
|
1100
|
+
# so you can send objects such as Arrays or Hashes as parameters
|
1101
|
+
# for your requests.
|
1102
|
+
module Faraday::NestedParamsEncoder
|
1103
|
+
extend ::Faraday::EncodeMethods
|
1104
|
+
extend ::Faraday::DecodeMethods
|
1105
|
+
|
1106
|
+
class << self
|
1107
|
+
def escape(*args, &block); end
|
1108
|
+
|
1109
|
+
# Returns the value of attribute sort_params.
|
1110
|
+
def sort_params; end
|
1111
|
+
|
1112
|
+
# Sets the attribute sort_params
|
1113
|
+
#
|
1114
|
+
# @param value the value to set the attribute sort_params to.
|
1115
|
+
def sort_params=(_arg0); end
|
1116
|
+
|
1117
|
+
def unescape(*args, &block); end
|
1118
|
+
end
|
1119
|
+
end
|
1120
|
+
|
1121
|
+
# Raised by Faraday::Response::RaiseError in case of a nil status in response.
|
1122
|
+
class Faraday::NilStatusError < ::Faraday::ServerError
|
1123
|
+
# @return [NilStatusError] a new instance of NilStatusError
|
1124
|
+
def initialize(exc, response = T.unsafe(nil)); end
|
1125
|
+
end
|
1126
|
+
|
1127
|
+
# Subclasses Struct with some special helpers for converting from a Hash to
|
1128
|
+
# a Struct.
|
1129
|
+
class Faraday::Options < ::Struct
|
1130
|
+
def [](key); end
|
1131
|
+
|
1132
|
+
# Public
|
1133
|
+
def clear; end
|
1134
|
+
|
1135
|
+
# Public
|
1136
|
+
def deep_dup; end
|
1137
|
+
|
1138
|
+
# Public
|
1139
|
+
def delete(key); end
|
1140
|
+
|
1141
|
+
# Public
|
1142
|
+
def each; end
|
1143
|
+
|
1144
|
+
# Public
|
1145
|
+
def each_key(&block); end
|
1146
|
+
|
1147
|
+
# Public
|
1148
|
+
def each_value(&block); end
|
1149
|
+
|
1150
|
+
# Public
|
1151
|
+
#
|
1152
|
+
# @return [Boolean]
|
1153
|
+
def empty?; end
|
1154
|
+
|
1155
|
+
# Public
|
1156
|
+
def fetch(key, *args); end
|
1157
|
+
|
1158
|
+
# Public
|
1159
|
+
#
|
1160
|
+
# @return [Boolean]
|
1161
|
+
def has_key?(key); end
|
1162
|
+
|
1163
|
+
# Public
|
1164
|
+
#
|
1165
|
+
# @return [Boolean]
|
1166
|
+
def has_value?(value); end
|
1167
|
+
|
1168
|
+
# Internal
|
1169
|
+
def inspect; end
|
1170
|
+
|
1171
|
+
# Public
|
1172
|
+
#
|
1173
|
+
# @return [Boolean]
|
1174
|
+
def key?(key); end
|
1175
|
+
|
1176
|
+
# Public
|
1177
|
+
def keys; end
|
1178
|
+
|
1179
|
+
# Public
|
1180
|
+
def merge(other); end
|
1181
|
+
|
1182
|
+
# Public
|
1183
|
+
def merge!(other); end
|
1184
|
+
|
1185
|
+
def symbolized_key_set; end
|
1186
|
+
|
1187
|
+
# Public
|
1188
|
+
def to_hash; end
|
1189
|
+
|
1190
|
+
# Public
|
1191
|
+
def update(obj); end
|
1192
|
+
|
1193
|
+
# Public
|
1194
|
+
#
|
1195
|
+
# @return [Boolean]
|
1196
|
+
def value?(value); end
|
1197
|
+
|
1198
|
+
# Public
|
1199
|
+
def values_at(*keys); end
|
1200
|
+
|
1201
|
+
class << self
|
1202
|
+
# Internal
|
1203
|
+
def attribute_options; end
|
1204
|
+
|
1205
|
+
def fetch_error_class; end
|
1206
|
+
|
1207
|
+
# Public
|
1208
|
+
def from(value); end
|
1209
|
+
|
1210
|
+
# @private
|
1211
|
+
def inherited(subclass); end
|
1212
|
+
|
1213
|
+
def memoized(key, &block); end
|
1214
|
+
def memoized_attributes; end
|
1215
|
+
|
1216
|
+
# Internal
|
1217
|
+
def options(mapping); end
|
1218
|
+
|
1219
|
+
# Internal
|
1220
|
+
def options_for(key); end
|
1221
|
+
end
|
1222
|
+
end
|
1223
|
+
|
1224
|
+
Faraday::ParamPart = Faraday::Multipart::ParamPart
|
1225
|
+
|
1226
|
+
# Raised by FaradayMiddleware::ResponseMiddleware
|
1227
|
+
class Faraday::ParsingError < ::Faraday::Error; end
|
1228
|
+
|
1229
|
+
Faraday::Parts = Multipart::Post::Parts
|
1230
|
+
|
1231
|
+
# Raised by Faraday::Response::RaiseError in case of a 407 response.
|
1232
|
+
class Faraday::ProxyAuthError < ::Faraday::ClientError; end
|
1233
|
+
|
1234
|
+
# ProxyOptions contains the configurable properties for the proxy
|
1235
|
+
# configuration used when making an HTTP request.
|
1236
|
+
class Faraday::ProxyOptions < ::Faraday::Options
|
1237
|
+
extend ::Forwardable
|
1238
|
+
|
1239
|
+
def host(*args, &block); end
|
1240
|
+
def host=(*args, &block); end
|
1241
|
+
def password; end
|
1242
|
+
def path(*args, &block); end
|
1243
|
+
def path=(*args, &block); end
|
1244
|
+
def port(*args, &block); end
|
1245
|
+
def port=(*args, &block); end
|
1246
|
+
def scheme(*args, &block); end
|
1247
|
+
def scheme=(*args, &block); end
|
1248
|
+
def user; end
|
1249
|
+
|
1250
|
+
class << self
|
1251
|
+
def from(value); end
|
1252
|
+
end
|
1253
|
+
end
|
1254
|
+
|
1255
|
+
# A Builder that processes requests into responses by passing through an inner
|
1256
|
+
# middleware stack (heavily inspired by Rack).
|
1257
|
+
#
|
1258
|
+
# @example
|
1259
|
+
# Faraday::Connection.new(url: 'http://sushi.com') do |builder|
|
1260
|
+
# builder.request :url_encoded # Faraday::Request::UrlEncoded
|
1261
|
+
# builder.adapter :net_http # Faraday::Adapter::NetHttp
|
1262
|
+
# end
|
1263
|
+
class Faraday::RackBuilder
|
1264
|
+
# @return [RackBuilder] a new instance of RackBuilder
|
1265
|
+
def initialize(handlers = T.unsafe(nil), adapter = T.unsafe(nil), &block); end
|
1266
|
+
|
1267
|
+
def ==(other); end
|
1268
|
+
def [](idx); end
|
1269
|
+
def adapter(klass = T.unsafe(nil), *args, &block); end
|
1270
|
+
|
1271
|
+
# The "rack app" wrapped in middleware. All requests are sent here.
|
1272
|
+
#
|
1273
|
+
# The builder is responsible for creating the app object. After this,
|
1274
|
+
# the builder gets locked to ensure no further modifications are made
|
1275
|
+
# to the middleware stack.
|
1276
|
+
#
|
1277
|
+
# Returns an object that responds to `call` and returns a Response.
|
1278
|
+
def app; end
|
1279
|
+
|
1280
|
+
# @yield [_self]
|
1281
|
+
# @yieldparam _self [Faraday::RackBuilder] the object that the method was called on
|
1282
|
+
def build(options = T.unsafe(nil)); end
|
1283
|
+
|
1284
|
+
# ENV Keys
|
1285
|
+
# :http_method - a symbolized request HTTP method (:get, :post)
|
1286
|
+
# :body - the request body that will eventually be converted to a string.
|
1287
|
+
# :url - URI instance for the current request.
|
1288
|
+
# :status - HTTP response status code
|
1289
|
+
# :request_headers - hash of HTTP Headers to be sent to the server
|
1290
|
+
# :response_headers - Hash of HTTP headers from the server
|
1291
|
+
# :parallel_manager - sent if the connection is in parallel mode
|
1292
|
+
# :request - Hash of options for configuring the request.
|
1293
|
+
# :timeout - open/read timeout Integer in seconds
|
1294
|
+
# :open_timeout - read timeout Integer in seconds
|
1295
|
+
# :proxy - Hash of proxy options
|
1296
|
+
# :uri - Proxy Server URI
|
1297
|
+
# :user - Proxy server username
|
1298
|
+
# :password - Proxy server password
|
1299
|
+
# :ssl - Hash of options for configuring SSL requests.
|
1300
|
+
def build_env(connection, request); end
|
1301
|
+
|
1302
|
+
# Processes a Request into a Response by passing it through this Builder's
|
1303
|
+
# middleware stack.
|
1304
|
+
#
|
1305
|
+
# @param connection [Faraday::Connection]
|
1306
|
+
# @param request [Faraday::Request]
|
1307
|
+
# @return [Faraday::Response]
|
1308
|
+
def build_response(connection, request); end
|
1309
|
+
|
1310
|
+
def delete(handler); end
|
1311
|
+
def dup; end
|
1312
|
+
|
1313
|
+
# Returns the value of attribute handlers.
|
1314
|
+
def handlers; end
|
1315
|
+
|
1316
|
+
# Sets the attribute handlers
|
1317
|
+
#
|
1318
|
+
# @param value the value to set the attribute handlers to.
|
1319
|
+
def handlers=(_arg0); end
|
1320
|
+
|
1321
|
+
# methods to push onto the various positions in the stack:
|
1322
|
+
def insert(index, *args, &block); end
|
1323
|
+
|
1324
|
+
def insert_after(index, *args, &block); end
|
1325
|
+
|
1326
|
+
# methods to push onto the various positions in the stack:
|
1327
|
+
def insert_before(index, *args, &block); end
|
1328
|
+
|
1329
|
+
# Locks the middleware stack to ensure no further modifications are made.
|
1330
|
+
def lock!; end
|
1331
|
+
|
1332
|
+
# @return [Boolean]
|
1333
|
+
def locked?; end
|
1334
|
+
|
1335
|
+
def request(key, *args, &block); end
|
1336
|
+
def response(key, *args, &block); end
|
1337
|
+
def swap(index, *args, &block); end
|
1338
|
+
def to_app; end
|
1339
|
+
def use(klass, *args, &block); end
|
1340
|
+
|
1341
|
+
private
|
1342
|
+
|
1343
|
+
# @return [Boolean]
|
1344
|
+
def adapter_set?; end
|
1345
|
+
|
1346
|
+
def assert_index(index); end
|
1347
|
+
|
1348
|
+
# @return [Boolean]
|
1349
|
+
def is_adapter?(klass); end
|
1350
|
+
|
1351
|
+
def raise_if_adapter(klass); end
|
1352
|
+
|
1353
|
+
# @raise [StackLocked]
|
1354
|
+
def raise_if_locked; end
|
1355
|
+
|
1356
|
+
def use_symbol(mod, key, *args, &block); end
|
1357
|
+
end
|
1358
|
+
|
1359
|
+
# borrowed from ActiveSupport::Dependencies::Reference &
|
1360
|
+
# ActionDispatch::MiddlewareStack::Middleware
|
1361
|
+
class Faraday::RackBuilder::Handler
|
1362
|
+
def initialize(klass, *args, &block); end
|
1363
|
+
|
1364
|
+
def ==(other); end
|
1365
|
+
def build(app = T.unsafe(nil)); end
|
1366
|
+
def inspect; end
|
1367
|
+
def klass; end
|
1368
|
+
|
1369
|
+
# Returns the value of attribute name.
|
1370
|
+
def name; end
|
1371
|
+
end
|
1372
|
+
|
1373
|
+
Faraday::RackBuilder::Handler::REGISTRY = T.let(T.unsafe(nil), Faraday::AdapterRegistry)
|
1374
|
+
Faraday::RackBuilder::LOCK_ERR = T.let(T.unsafe(nil), String)
|
1375
|
+
|
1376
|
+
# Used to detect missing arguments
|
1377
|
+
Faraday::RackBuilder::NO_ARGUMENT = T.let(T.unsafe(nil), Object)
|
1378
|
+
|
1379
|
+
# Error raised when trying to modify the stack after calling `lock!`
|
1380
|
+
class Faraday::RackBuilder::StackLocked < ::RuntimeError; end
|
1381
|
+
|
1382
|
+
# Used to setup URLs, params, headers, and the request body in a sane manner.
|
1383
|
+
#
|
1384
|
+
#
|
1385
|
+
# @example
|
1386
|
+
# @connection.post do |req|
|
1387
|
+
# req.url 'http://localhost', 'a' => '1' # 'http://localhost?a=1'
|
1388
|
+
# req.headers['b'] = '2' # Header
|
1389
|
+
# req.params['c'] = '3' # GET Param
|
1390
|
+
# req['b'] = '2' # also Header
|
1391
|
+
# req.body = 'abc'
|
1392
|
+
# end
|
1393
|
+
class Faraday::Request < ::Struct
|
1394
|
+
extend ::Faraday::MiddlewareRegistry
|
1395
|
+
extend ::Faraday::Deprecate
|
1396
|
+
extend ::Faraday::AutoloadHelper
|
1397
|
+
|
1398
|
+
# @param key [Object] key to look up in headers
|
1399
|
+
# @return [Object] value of the given header name
|
1400
|
+
def [](key); end
|
1401
|
+
|
1402
|
+
# @param key [Object] key of header to write
|
1403
|
+
# @param value [Object] value of header
|
1404
|
+
def []=(key, value); end
|
1405
|
+
|
1406
|
+
def _deprecated_method; end
|
1407
|
+
|
1408
|
+
# Replace request headers, preserving the existing hash type.
|
1409
|
+
#
|
1410
|
+
# @param hash [Hash] new headers
|
1411
|
+
def headers=(hash); end
|
1412
|
+
|
1413
|
+
# Marshal serialization support.
|
1414
|
+
#
|
1415
|
+
# @return [Hash] the hash ready to be serialized in Marshal.
|
1416
|
+
def marshal_dump; end
|
1417
|
+
|
1418
|
+
# Marshal serialization support.
|
1419
|
+
# Restores the instance variables according to the +serialised+.
|
1420
|
+
#
|
1421
|
+
# @param serialised [Hash] the serialised object.
|
1422
|
+
def marshal_load(serialised); end
|
1423
|
+
|
1424
|
+
def method(*args, &block); end
|
1425
|
+
|
1426
|
+
# Replace params, preserving the existing hash type.
|
1427
|
+
#
|
1428
|
+
# @param hash [Hash] new params
|
1429
|
+
def params=(hash); end
|
1430
|
+
|
1431
|
+
# @return [Env] the Env for this Request
|
1432
|
+
def to_env(connection); end
|
1433
|
+
|
1434
|
+
# Update path and params.
|
1435
|
+
#
|
1436
|
+
# @param path [URI, String]
|
1437
|
+
# @param params [Hash, nil]
|
1438
|
+
# @return [void]
|
1439
|
+
def url(path, params = T.unsafe(nil)); end
|
1440
|
+
|
1441
|
+
class << self
|
1442
|
+
# @param request_method [String]
|
1443
|
+
# @return [Request]
|
1444
|
+
# @yield [request] for block customization, if block given
|
1445
|
+
# @yieldparam request [Request]
|
1446
|
+
def create(request_method); end
|
1447
|
+
end
|
1448
|
+
end
|
1449
|
+
|
1450
|
+
# Request middleware for the Authorization HTTP header
|
1451
|
+
class Faraday::Request::Authorization < ::Faraday::Middleware
|
1452
|
+
# @param app [#call]
|
1453
|
+
# @param type [String, Symbol] Type of Authorization
|
1454
|
+
# @param param [String, Symbol, Hash, Proc] parameter to build the Authorization header.
|
1455
|
+
# This value can be a proc, in which case it will be invoked on each request.
|
1456
|
+
# @return [Authorization] a new instance of Authorization
|
1457
|
+
def initialize(app, type, param); end
|
1458
|
+
|
1459
|
+
# @param env [Faraday::Env]
|
1460
|
+
def on_request(env); end
|
1461
|
+
|
1462
|
+
class << self
|
1463
|
+
# @api private
|
1464
|
+
# @param type [String]
|
1465
|
+
# @param hash [Hash]
|
1466
|
+
# @return [String] type followed by comma-separated key=value pairs
|
1467
|
+
def build_hash(type, hash); end
|
1468
|
+
|
1469
|
+
# @param type [String, Symbol]
|
1470
|
+
# @param token [String, Symbol, Hash]
|
1471
|
+
# @return [String] a header value
|
1472
|
+
def header(type, token); end
|
1473
|
+
end
|
1474
|
+
end
|
1475
|
+
|
1476
|
+
Faraday::Request::Authorization::KEY = T.let(T.unsafe(nil), String)
|
1477
|
+
|
1478
|
+
# Authorization middleware for Basic Authentication.
|
1479
|
+
class Faraday::Request::BasicAuthentication < ::Faraday::Request::Authorization
|
1480
|
+
class << self
|
1481
|
+
# @param login [String]
|
1482
|
+
# @param pass [String]
|
1483
|
+
# @return [String] a Basic Authentication header line
|
1484
|
+
def header(login, pass); end
|
1485
|
+
end
|
1486
|
+
end
|
1487
|
+
|
1488
|
+
# Middleware for instrumenting Requests.
|
1489
|
+
class Faraday::Request::Instrumentation < ::Faraday::Middleware
|
1490
|
+
# Instruments requests using Active Support.
|
1491
|
+
#
|
1492
|
+
# Measures time spent only for synchronous requests.
|
1493
|
+
#
|
1494
|
+
# @example Using ActiveSupport::Notifications to measure time spent
|
1495
|
+
# for Faraday requests.
|
1496
|
+
# ActiveSupport::Notifications
|
1497
|
+
# .subscribe('request.faraday') do |name, starts, ends, _, env|
|
1498
|
+
# url = env[:url]
|
1499
|
+
# http_method = env[:method].to_s.upcase
|
1500
|
+
# duration = ends - starts
|
1501
|
+
# $stderr.puts '[%s] %s %s (%.3f s)' %
|
1502
|
+
# [url.host, http_method, url.request_uri, duration]
|
1503
|
+
# end
|
1504
|
+
# @option options
|
1505
|
+
# @option options
|
1506
|
+
# @param app [#call]
|
1507
|
+
# @param options [nil, Hash] Options hash
|
1508
|
+
# @return [Instrumentation] a new instance of Instrumentation
|
1509
|
+
def initialize(app, options = T.unsafe(nil)); end
|
1510
|
+
|
1511
|
+
# @param env [Faraday::Env]
|
1512
|
+
def call(env); end
|
1513
|
+
end
|
1514
|
+
|
1515
|
+
# Options class used in Request::Instrumentation class.
|
1516
|
+
class Faraday::Request::Instrumentation::Options < ::Faraday::Options
|
1517
|
+
# @return [Class]
|
1518
|
+
def instrumenter; end
|
1519
|
+
|
1520
|
+
# @return [String]
|
1521
|
+
def name; end
|
1522
|
+
end
|
1523
|
+
|
1524
|
+
Faraday::Request::Multipart = Faraday::Multipart::Middleware
|
1525
|
+
Faraday::Request::Retry = Faraday::Retry::Middleware
|
1526
|
+
|
1527
|
+
# TokenAuthentication is a middleware that adds a 'Token' header to a
|
1528
|
+
# Faraday request.
|
1529
|
+
class Faraday::Request::TokenAuthentication < ::Faraday::Request::Authorization
|
1530
|
+
# @return [TokenAuthentication] a new instance of TokenAuthentication
|
1531
|
+
def initialize(app, token, options = T.unsafe(nil)); end
|
1532
|
+
|
1533
|
+
class << self
|
1534
|
+
# Public
|
1535
|
+
def header(token, options = T.unsafe(nil)); end
|
1536
|
+
end
|
1537
|
+
end
|
1538
|
+
|
1539
|
+
# Middleware for supporting urlencoded requests.
|
1540
|
+
class Faraday::Request::UrlEncoded < ::Faraday::Middleware
|
1541
|
+
# Encodes as "application/x-www-form-urlencoded" if not already encoded or
|
1542
|
+
# of another type.
|
1543
|
+
#
|
1544
|
+
# @param env [Faraday::Env]
|
1545
|
+
def call(env); end
|
1546
|
+
|
1547
|
+
# @param env [Faraday::Env]
|
1548
|
+
# @yield [request_body] Body of the request
|
1549
|
+
def match_content_type(env); end
|
1550
|
+
|
1551
|
+
# @param env [Faraday::Env]
|
1552
|
+
# @return [Boolean] True if the request has a body and its Content-Type is
|
1553
|
+
# urlencoded.
|
1554
|
+
def process_request?(env); end
|
1555
|
+
|
1556
|
+
# @param env [Faraday::Env]
|
1557
|
+
# @return [String]
|
1558
|
+
def request_type(env); end
|
1559
|
+
|
1560
|
+
class << self
|
1561
|
+
# Returns the value of attribute mime_type.
|
1562
|
+
def mime_type; end
|
1563
|
+
|
1564
|
+
# Sets the attribute mime_type
|
1565
|
+
#
|
1566
|
+
# @param value the value to set the attribute mime_type to.
|
1567
|
+
def mime_type=(_arg0); end
|
1568
|
+
end
|
1569
|
+
end
|
1570
|
+
|
1571
|
+
Faraday::Request::UrlEncoded::CONTENT_TYPE = T.let(T.unsafe(nil), String)
|
1572
|
+
|
1573
|
+
# RequestOptions contains the configurable properties for a Faraday request.
|
1574
|
+
class Faraday::RequestOptions < ::Faraday::Options
|
1575
|
+
def []=(key, value); end
|
1576
|
+
|
1577
|
+
# @return [Boolean]
|
1578
|
+
def stream_response?; end
|
1579
|
+
end
|
1580
|
+
|
1581
|
+
# Raised by Faraday::Response::RaiseError in case of a 404 response.
|
1582
|
+
class Faraday::ResourceNotFound < ::Faraday::ClientError; end
|
1583
|
+
|
1584
|
+
# Response represents an HTTP response from making an HTTP request.
|
1585
|
+
class Faraday::Response
|
1586
|
+
extend ::Forwardable
|
1587
|
+
extend ::Faraday::MiddlewareRegistry
|
1588
|
+
extend ::Faraday::AutoloadHelper
|
1589
|
+
|
1590
|
+
# @return [Response] a new instance of Response
|
1591
|
+
def initialize(env = T.unsafe(nil)); end
|
1592
|
+
|
1593
|
+
def [](*args, &block); end
|
1594
|
+
|
1595
|
+
# Expand the env with more properties, without overriding existing ones.
|
1596
|
+
# Useful for applying request params after restoring a marshalled Response.
|
1597
|
+
def apply_request(request_env); end
|
1598
|
+
|
1599
|
+
def body; end
|
1600
|
+
|
1601
|
+
# Returns the value of attribute env.
|
1602
|
+
def env; end
|
1603
|
+
|
1604
|
+
def finish(env); end
|
1605
|
+
|
1606
|
+
# @return [Boolean]
|
1607
|
+
def finished?; end
|
1608
|
+
|
1609
|
+
def headers; end
|
1610
|
+
|
1611
|
+
# because @on_complete_callbacks cannot be marshalled
|
1612
|
+
def marshal_dump; end
|
1613
|
+
|
1614
|
+
def marshal_load(env); end
|
1615
|
+
def on_complete(&block); end
|
1616
|
+
def reason_phrase; end
|
1617
|
+
def status; end
|
1618
|
+
|
1619
|
+
# @return [Boolean]
|
1620
|
+
def success?; end
|
1621
|
+
|
1622
|
+
def to_hash; end
|
1623
|
+
end
|
1624
|
+
|
1625
|
+
# Logger is a middleware that logs internal events in the HTTP request
|
1626
|
+
# lifecycle to a given Logger object. By default, this logs to STDOUT. See
|
1627
|
+
# Faraday::Logging::Formatter to see specifically what is logged.
|
1628
|
+
class Faraday::Response::Logger < ::Faraday::Response::Middleware
|
1629
|
+
# @return [Logger] a new instance of Logger
|
1630
|
+
# @yield [@formatter]
|
1631
|
+
def initialize(app, logger = T.unsafe(nil), options = T.unsafe(nil)); end
|
1632
|
+
|
1633
|
+
def call(env); end
|
1634
|
+
def on_complete(env); end
|
1635
|
+
end
|
1636
|
+
|
1637
|
+
# Used for simple response middleware.
|
1638
|
+
class Faraday::Response::Middleware < ::Faraday::Middleware
|
1639
|
+
# Override this to modify the environment after the response has finished.
|
1640
|
+
# Calls the `parse` method if defined
|
1641
|
+
# `parse` method can be defined as private, public and protected
|
1642
|
+
def on_complete(env); end
|
1643
|
+
end
|
1644
|
+
|
1645
|
+
# RaiseError is a Faraday middleware that raises exceptions on common HTTP
|
1646
|
+
# client or server error responses.
|
1647
|
+
class Faraday::Response::RaiseError < ::Faraday::Response::Middleware
|
1648
|
+
def on_complete(env); end
|
1649
|
+
def response_values(env); end
|
1650
|
+
end
|
1651
|
+
|
1652
|
+
Faraday::Response::RaiseError::ClientErrorStatuses = T.let(T.unsafe(nil), Range)
|
1653
|
+
Faraday::Response::RaiseError::ServerErrorStatuses = T.let(T.unsafe(nil), Range)
|
1654
|
+
|
1655
|
+
# A unified client error for SSL errors.
|
1656
|
+
class Faraday::SSLError < ::Faraday::Error; end
|
1657
|
+
|
1658
|
+
# SSL-related options.
|
1659
|
+
class Faraday::SSLOptions < ::Faraday::Options
|
1660
|
+
# @return [Boolean] true if should not verify
|
1661
|
+
def disable?; end
|
1662
|
+
|
1663
|
+
# @return [Boolean] true if should verify
|
1664
|
+
def verify?; end
|
1665
|
+
end
|
1666
|
+
|
1667
|
+
# Faraday server error class. Represents 5xx status responses.
|
1668
|
+
class Faraday::ServerError < ::Faraday::Error; end
|
1669
|
+
|
1670
|
+
# A unified client error for timeouts.
|
1671
|
+
class Faraday::TimeoutError < ::Faraday::ServerError
|
1672
|
+
# @return [TimeoutError] a new instance of TimeoutError
|
1673
|
+
def initialize(exc = T.unsafe(nil), response = T.unsafe(nil)); end
|
1674
|
+
end
|
1675
|
+
|
1676
|
+
Faraday::Timer = Timeout
|
1677
|
+
|
1678
|
+
# Raised by Faraday::Response::RaiseError in case of a 401 response.
|
1679
|
+
class Faraday::UnauthorizedError < ::Faraday::ClientError; end
|
1680
|
+
|
1681
|
+
# Raised by Faraday::Response::RaiseError in case of a 422 response.
|
1682
|
+
class Faraday::UnprocessableEntityError < ::Faraday::ClientError; end
|
1683
|
+
|
1684
|
+
Faraday::UploadIO = Multipart::Post::UploadIO
|
1685
|
+
|
1686
|
+
# Utils contains various static helper methods.
|
1687
|
+
module Faraday::Utils
|
1688
|
+
private
|
1689
|
+
|
1690
|
+
# Normalize URI() behavior across Ruby versions
|
1691
|
+
#
|
1692
|
+
# url - A String or URI.
|
1693
|
+
#
|
1694
|
+
# Returns a parsed URI.
|
1695
|
+
def URI(url); end
|
1696
|
+
|
1697
|
+
def build_nested_query(params); end
|
1698
|
+
def build_query(params); end
|
1699
|
+
|
1700
|
+
# Recursive hash merge
|
1701
|
+
def deep_merge(source, hash); end
|
1702
|
+
|
1703
|
+
# Recursive hash update
|
1704
|
+
def deep_merge!(target, hash); end
|
1705
|
+
|
1706
|
+
def default_params_encoder; end
|
1707
|
+
def default_space_encoding; end
|
1708
|
+
def default_uri_parser; end
|
1709
|
+
def default_uri_parser=(parser); end
|
1710
|
+
def escape(str); end
|
1711
|
+
|
1712
|
+
# Receives a String or URI and returns just
|
1713
|
+
# the path with the query string sorted.
|
1714
|
+
def normalize_path(url); end
|
1715
|
+
|
1716
|
+
def parse_nested_query(query); end
|
1717
|
+
|
1718
|
+
# Adapted from Rack
|
1719
|
+
def parse_query(query); end
|
1720
|
+
|
1721
|
+
def sort_query_params(query); end
|
1722
|
+
def unescape(str); end
|
1723
|
+
|
1724
|
+
class << self
|
1725
|
+
# Normalize URI() behavior across Ruby versions
|
1726
|
+
#
|
1727
|
+
# url - A String or URI.
|
1728
|
+
#
|
1729
|
+
# Returns a parsed URI.
|
1730
|
+
def URI(url); end
|
1731
|
+
|
1732
|
+
def build_nested_query(params); end
|
1733
|
+
def build_query(params); end
|
1734
|
+
|
1735
|
+
# Recursive hash merge
|
1736
|
+
def deep_merge(source, hash); end
|
1737
|
+
|
1738
|
+
# Recursive hash update
|
1739
|
+
def deep_merge!(target, hash); end
|
1740
|
+
|
1741
|
+
def default_params_encoder; end
|
1742
|
+
|
1743
|
+
# Sets the attribute default_params_encoder
|
1744
|
+
#
|
1745
|
+
# @param value the value to set the attribute default_params_encoder to.
|
1746
|
+
def default_params_encoder=(_arg0); end
|
1747
|
+
|
1748
|
+
def default_space_encoding; end
|
1749
|
+
|
1750
|
+
# Sets the attribute default_space_encoding
|
1751
|
+
#
|
1752
|
+
# @param value the value to set the attribute default_space_encoding to.
|
1753
|
+
def default_space_encoding=(_arg0); end
|
1754
|
+
|
1755
|
+
def default_uri_parser; end
|
1756
|
+
def default_uri_parser=(parser); end
|
1757
|
+
def escape(str); end
|
1758
|
+
|
1759
|
+
# Receives a String or URI and returns just
|
1760
|
+
# the path with the query string sorted.
|
1761
|
+
def normalize_path(url); end
|
1762
|
+
|
1763
|
+
def parse_nested_query(query); end
|
1764
|
+
|
1765
|
+
# Adapted from Rack
|
1766
|
+
def parse_query(query); end
|
1767
|
+
|
1768
|
+
def sort_query_params(query); end
|
1769
|
+
def unescape(str); end
|
1770
|
+
end
|
1771
|
+
end
|
1772
|
+
|
1773
|
+
Faraday::Utils::DEFAULT_SEP = T.let(T.unsafe(nil), Regexp)
|
1774
|
+
Faraday::Utils::ESCAPE_RE = T.let(T.unsafe(nil), Regexp)
|
1775
|
+
|
1776
|
+
# A case-insensitive Hash that preserves the original case of a header
|
1777
|
+
# when set.
|
1778
|
+
#
|
1779
|
+
# Adapted from Rack::Utils::HeaderHash
|
1780
|
+
class Faraday::Utils::Headers < ::Hash
|
1781
|
+
# @return [Headers] a new instance of Headers
|
1782
|
+
def initialize(hash = T.unsafe(nil)); end
|
1783
|
+
|
1784
|
+
def [](key); end
|
1785
|
+
def []=(key, val); end
|
1786
|
+
def delete(key); end
|
1787
|
+
def fetch(key, *args, &block); end
|
1788
|
+
|
1789
|
+
# @return [Boolean]
|
1790
|
+
def has_key?(key); end
|
1791
|
+
|
1792
|
+
# @return [Boolean]
|
1793
|
+
def include?(key); end
|
1794
|
+
|
1795
|
+
def initialize_names; end
|
1796
|
+
|
1797
|
+
# @return [Boolean]
|
1798
|
+
def key?(key); end
|
1799
|
+
|
1800
|
+
# @return [Boolean]
|
1801
|
+
def member?(key); end
|
1802
|
+
|
1803
|
+
def merge(other); end
|
1804
|
+
def merge!(other); end
|
1805
|
+
def parse(header_string); end
|
1806
|
+
def replace(other); end
|
1807
|
+
def to_hash; end
|
1808
|
+
def update(other); end
|
1809
|
+
|
1810
|
+
protected
|
1811
|
+
|
1812
|
+
# Returns the value of attribute names.
|
1813
|
+
def names; end
|
1814
|
+
|
1815
|
+
private
|
1816
|
+
|
1817
|
+
# Join multiple values with a comma.
|
1818
|
+
def add_parsed(key, value); end
|
1819
|
+
|
1820
|
+
# on dup/clone, we need to duplicate @names hash
|
1821
|
+
def initialize_copy(other); end
|
1822
|
+
|
1823
|
+
class << self
|
1824
|
+
def allocate; end
|
1825
|
+
def from(value); end
|
1826
|
+
end
|
1827
|
+
end
|
1828
|
+
|
1829
|
+
# symbol -> string mapper + cache
|
1830
|
+
Faraday::Utils::Headers::KeyMap = T.let(T.unsafe(nil), Hash)
|
1831
|
+
|
1832
|
+
# A hash with stringified keys.
|
1833
|
+
class Faraday::Utils::ParamsHash < ::Hash
|
1834
|
+
def [](key); end
|
1835
|
+
def []=(key, value); end
|
1836
|
+
def delete(key); end
|
1837
|
+
|
1838
|
+
# @return [Boolean]
|
1839
|
+
def has_key?(key); end
|
1840
|
+
|
1841
|
+
# @return [Boolean]
|
1842
|
+
def include?(key); end
|
1843
|
+
|
1844
|
+
# @return [Boolean]
|
1845
|
+
def key?(key); end
|
1846
|
+
|
1847
|
+
# @return [Boolean]
|
1848
|
+
def member?(key); end
|
1849
|
+
|
1850
|
+
def merge(params); end
|
1851
|
+
def merge!(params); end
|
1852
|
+
def merge_query(query, encoder = T.unsafe(nil)); end
|
1853
|
+
def replace(other); end
|
1854
|
+
def to_query(encoder = T.unsafe(nil)); end
|
1855
|
+
def update(params); end
|
1856
|
+
|
1857
|
+
private
|
1858
|
+
|
1859
|
+
def convert_key(key); end
|
1860
|
+
end
|
1861
|
+
|
1862
|
+
Faraday::VERSION = T.let(T.unsafe(nil), String)
|