hearth 1.0.0.pre1 → 1.0.0.pre3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -4
- data/VERSION +1 -1
- data/lib/hearth/anonymous_auth_resolver.rb +11 -0
- data/lib/hearth/api_error.rb +15 -1
- data/lib/hearth/auth_option.rb +21 -0
- data/lib/hearth/auth_schemes/anonymous.rb +21 -0
- data/lib/hearth/auth_schemes/http_api_key.rb +16 -0
- data/lib/hearth/auth_schemes/http_basic.rb +16 -0
- data/lib/hearth/auth_schemes/http_bearer.rb +16 -0
- data/lib/hearth/auth_schemes/http_digest.rb +16 -0
- data/lib/hearth/auth_schemes.rb +32 -0
- data/lib/hearth/checksums.rb +31 -0
- data/lib/hearth/client.rb +66 -0
- data/lib/hearth/client_stubs.rb +128 -0
- data/lib/hearth/config/env_provider.rb +53 -0
- data/lib/hearth/config/resolver.rb +53 -0
- data/lib/hearth/configuration.rb +15 -0
- data/lib/hearth/connection_pool.rb +77 -0
- data/lib/hearth/context.rb +29 -4
- data/lib/hearth/dns/host_address.rb +27 -0
- data/lib/hearth/dns/host_resolver.rb +92 -0
- data/lib/hearth/dns.rb +48 -0
- data/lib/hearth/endpoint_rules.rb +154 -0
- data/lib/hearth/http/api_error.rb +4 -8
- data/lib/hearth/http/client.rb +206 -59
- data/lib/hearth/http/error_inspector.rb +85 -0
- data/lib/hearth/http/error_parser.rb +18 -20
- data/lib/hearth/http/field.rb +49 -0
- data/lib/hearth/http/fields.rb +117 -0
- data/lib/hearth/http/header_list_builder.rb +42 -0
- data/lib/hearth/http/header_list_parser.rb +92 -0
- data/lib/hearth/http/middleware/content_length.rb +7 -4
- data/lib/hearth/http/middleware/content_md5.rb +30 -0
- data/lib/hearth/http/middleware/request_compression.rb +154 -0
- data/lib/hearth/http/middleware.rb +12 -0
- data/lib/hearth/http/networking_error.rb +1 -14
- data/lib/hearth/http/request.rb +83 -56
- data/lib/hearth/http/response.rb +42 -13
- data/lib/hearth/http.rb +16 -5
- data/lib/hearth/identities/anonymous.rb +8 -0
- data/lib/hearth/identities/http_api_key.rb +16 -0
- data/lib/hearth/identities/http_bearer.rb +16 -0
- data/lib/hearth/identities/http_login.rb +20 -0
- data/lib/hearth/identities.rb +21 -0
- data/lib/hearth/identity_provider.rb +17 -0
- data/lib/hearth/interceptor.rb +506 -0
- data/lib/hearth/interceptor_context.rb +40 -0
- data/lib/hearth/interceptor_list.rb +48 -0
- data/lib/hearth/interceptors.rb +76 -0
- data/lib/hearth/json.rb +4 -4
- data/lib/hearth/middleware/auth.rb +103 -0
- data/lib/hearth/middleware/build.rb +32 -1
- data/lib/hearth/middleware/endpoint.rb +79 -0
- data/lib/hearth/middleware/host_prefix.rb +11 -8
- data/lib/hearth/middleware/initialize.rb +57 -0
- data/lib/hearth/middleware/parse.rb +45 -7
- data/lib/hearth/middleware/retry.rb +105 -24
- data/lib/hearth/middleware/send.rb +137 -26
- data/lib/hearth/middleware/sign.rb +65 -0
- data/lib/hearth/middleware/validate.rb +11 -1
- data/lib/hearth/middleware.rb +20 -8
- data/lib/hearth/middleware_stack.rb +2 -44
- data/lib/hearth/networking_error.rb +18 -0
- data/lib/hearth/number_helper.rb +3 -3
- data/lib/hearth/output.rb +8 -4
- data/lib/hearth/plugin_list.rb +53 -0
- data/lib/hearth/query/param.rb +56 -0
- data/lib/hearth/query/param_list.rb +54 -0
- data/lib/hearth/query/param_matcher.rb +31 -0
- data/lib/hearth/refreshing_identity_provider.rb +63 -0
- data/lib/hearth/request.rb +22 -0
- data/lib/hearth/response.rb +36 -0
- data/lib/hearth/retry/adaptive.rb +60 -0
- data/lib/hearth/retry/capacity_not_available_error.rb +9 -0
- data/lib/hearth/retry/client_rate_limiter.rb +145 -0
- data/lib/hearth/retry/exponential_backoff.rb +15 -0
- data/lib/hearth/retry/retry_quota.rb +56 -0
- data/lib/hearth/retry/standard.rb +46 -0
- data/lib/hearth/retry.rb +29 -0
- data/lib/hearth/signers/anonymous.rb +16 -0
- data/lib/hearth/signers/http_api_key.rb +29 -0
- data/lib/hearth/signers/http_basic.rb +23 -0
- data/lib/hearth/signers/http_bearer.rb +19 -0
- data/lib/hearth/signers/http_digest.rb +19 -0
- data/lib/hearth/signers.rb +23 -0
- data/lib/hearth/structure.rb +7 -3
- data/lib/hearth/stubs.rb +38 -0
- data/lib/hearth/time_helper.rb +6 -5
- data/lib/hearth/validator.rb +60 -5
- data/lib/hearth/waiters/poller.rb +10 -9
- data/lib/hearth/waiters/waiter.rb +23 -9
- data/lib/hearth/xml/formatter.rb +11 -2
- data/lib/hearth/xml/node.rb +2 -3
- data/lib/hearth/xml/node_matcher.rb +0 -1
- data/lib/hearth.rb +37 -6
- data/sig/lib/hearth/aliases.rbs +6 -0
- data/sig/lib/hearth/anonymous_auth_resolver.rbs +5 -0
- data/sig/lib/hearth/api_error.rbs +13 -0
- data/sig/lib/hearth/auth_option.rbs +11 -0
- data/sig/lib/hearth/auth_schemes/anonymous.rbs +7 -0
- data/sig/lib/hearth/auth_schemes/http_api_key.rbs +7 -0
- data/sig/lib/hearth/auth_schemes/http_basic.rbs +7 -0
- data/sig/lib/hearth/auth_schemes/http_bearer.rbs +7 -0
- data/sig/lib/hearth/auth_schemes/http_digest.rbs +7 -0
- data/sig/lib/hearth/auth_schemes.rbs +13 -0
- data/sig/lib/hearth/block_io.rbs +9 -0
- data/sig/lib/hearth/client.rbs +9 -0
- data/sig/lib/hearth/client_stubs.rbs +5 -0
- data/sig/lib/hearth/configuration.rbs +7 -0
- data/sig/lib/hearth/dns/host_address.rbs +11 -0
- data/sig/lib/hearth/dns/host_resolver.rbs +19 -0
- data/sig/lib/hearth/endpoint_rules.rbs +17 -0
- data/sig/lib/hearth/http/api_error.rbs +13 -0
- data/sig/lib/hearth/http/client.rbs +9 -0
- data/sig/lib/hearth/http/field.rbs +19 -0
- data/sig/lib/hearth/http/fields.rbs +43 -0
- data/sig/lib/hearth/http/header_list_builder.rbs +15 -0
- data/sig/lib/hearth/http/header_list_parser.rbs +19 -0
- data/sig/lib/hearth/http/networking_error.rbs +6 -0
- data/sig/lib/hearth/http/request.rbs +25 -0
- data/sig/lib/hearth/http/response.rbs +21 -0
- data/sig/lib/hearth/identities/anonymous.rbs +6 -0
- data/sig/lib/hearth/identities/http_api_key.rbs +9 -0
- data/sig/lib/hearth/identities/http_bearer.rbs +9 -0
- data/sig/lib/hearth/identities/http_login.rbs +11 -0
- data/sig/lib/hearth/identities.rbs +9 -0
- data/sig/lib/hearth/identity_provider.rbs +7 -0
- data/sig/lib/hearth/interceptor.rbs +9 -0
- data/sig/lib/hearth/interceptor_context.rbs +17 -0
- data/sig/lib/hearth/interceptor_list.rbs +16 -0
- data/sig/lib/hearth/interfaces.rbs +87 -0
- data/sig/lib/hearth/json/parse_error.rbs +9 -0
- data/sig/lib/hearth/networking_error.rbs +7 -0
- data/sig/lib/hearth/output.rbs +11 -0
- data/sig/lib/hearth/plugin_list.rbs +13 -0
- data/sig/lib/hearth/query/param.rbs +17 -0
- data/sig/lib/hearth/query/param_list.rbs +25 -0
- data/sig/lib/hearth/refreshing_identity_provider.rbs +10 -0
- data/sig/lib/hearth/request.rbs +9 -0
- data/sig/lib/hearth/response.rbs +11 -0
- data/sig/lib/hearth/retry/adaptive.rbs +13 -0
- data/sig/lib/hearth/retry/exponential_backoff.rbs +7 -0
- data/sig/lib/hearth/retry/standard.rbs +13 -0
- data/sig/lib/hearth/retry/strategy.rbs +11 -0
- data/sig/lib/hearth/retry.rbs +9 -0
- data/sig/lib/hearth/signers/anonymous.rbs +9 -0
- data/sig/lib/hearth/signers/http_api_key.rbs +9 -0
- data/sig/lib/hearth/signers/http_basic.rbs +9 -0
- data/sig/lib/hearth/signers/http_bearer.rbs +9 -0
- data/sig/lib/hearth/signers/http_digest.rbs +9 -0
- data/sig/lib/hearth/signers.rbs +9 -0
- data/sig/lib/hearth/structure.rbs +6 -0
- data/sig/lib/hearth/stubs.rbs +9 -0
- data/sig/lib/hearth/union.rbs +5 -0
- data/sig/lib/hearth/waiters/waiter.rbs +17 -0
- data/sig/lib/hearth/xml/parse_error.rbs +9 -0
- metadata +151 -25
- data/lib/hearth/http/headers.rb +0 -70
- data/lib/hearth/middleware/around_handler.rb +0 -24
- data/lib/hearth/middleware/request_handler.rb +0 -24
- data/lib/hearth/middleware/response_handler.rb +0 -25
- data/lib/hearth/middleware_builder.rb +0 -246
- data/lib/hearth/stubbing/client_stubs.rb +0 -115
- data/lib/hearth/stubbing/stubs.rb +0 -32
- data/lib/hearth/waiters/errors.rb +0 -15
- data/sig/lib/seahorse/api_error.rbs +0 -10
- data/sig/lib/seahorse/document.rbs +0 -2
- data/sig/lib/seahorse/http/api_error.rbs +0 -21
- data/sig/lib/seahorse/http/headers.rbs +0 -47
- data/sig/lib/seahorse/http/response.rbs +0 -21
- data/sig/lib/seahorse/simple_delegator.rbs +0 -3
- data/sig/lib/seahorse/structure.rbs +0 -18
- data/sig/lib/seahorse/stubbing/client_stubs.rbs +0 -103
- data/sig/lib/seahorse/stubbing/stubs.rbs +0 -14
- data/sig/lib/seahorse/union.rbs +0 -6
@@ -0,0 +1,17 @@
|
|
1
|
+
module Hearth
|
2
|
+
module EndpointRules
|
3
|
+
class AuthScheme < Struct[untyped]
|
4
|
+
attr_accessor scheme_id: String
|
5
|
+
|
6
|
+
attr_accessor properties: Hash[String, untyped]
|
7
|
+
end
|
8
|
+
|
9
|
+
class Endpoint < Struct[untyped]
|
10
|
+
attr_accessor uri: String
|
11
|
+
|
12
|
+
attr_accessor auth_schemes: Array[AuthScheme]
|
13
|
+
|
14
|
+
attr_accessor headers: Hash[String, String | Array[String]]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Hearth
|
2
|
+
module HTTP
|
3
|
+
class ApiError < Hearth::ApiError
|
4
|
+
def initialize: (http_resp: Response, error_code: String, ?metadata: Hash[Symbol, untyped], ?message: String?) -> void
|
5
|
+
|
6
|
+
attr_reader http_status: Integer
|
7
|
+
|
8
|
+
attr_reader http_fields: Fields
|
9
|
+
|
10
|
+
attr_reader http_body: IO
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Hearth
|
2
|
+
module HTTP
|
3
|
+
class Field
|
4
|
+
def initialize: (String name, ?(_ToS)? value, ?kind: Symbol) -> void
|
5
|
+
|
6
|
+
attr_reader name: String
|
7
|
+
|
8
|
+
attr_reader kind: Symbol
|
9
|
+
|
10
|
+
def value: (?String? encoding) -> String
|
11
|
+
|
12
|
+
def header?: () -> bool
|
13
|
+
|
14
|
+
def trailer?: () -> bool
|
15
|
+
|
16
|
+
def to_h: () -> Hash[String, String]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module Hearth
|
2
|
+
module HTTP
|
3
|
+
class Fields
|
4
|
+
include Enumerable[Field]
|
5
|
+
|
6
|
+
def initialize: (?Array[Field] fields, ?encoding: String) -> void
|
7
|
+
|
8
|
+
attr_reader encoding: String
|
9
|
+
|
10
|
+
def []: (String key) -> Field
|
11
|
+
|
12
|
+
def []=: (String key, Field value) -> Field
|
13
|
+
|
14
|
+
def key?: (String key) -> bool
|
15
|
+
|
16
|
+
def delete: (String key) -> (Field | nil)
|
17
|
+
|
18
|
+
def each: () { (Field) -> void } -> void
|
19
|
+
|
20
|
+
def size: () -> Integer
|
21
|
+
|
22
|
+
def clear: () -> void
|
23
|
+
|
24
|
+
class Proxy
|
25
|
+
include Enumerable[Hash[String, String]]
|
26
|
+
|
27
|
+
def initialize: (Array[Field] fields, Symbol kind) -> void
|
28
|
+
|
29
|
+
def []: (String key) -> (String | nil)
|
30
|
+
|
31
|
+
def []=: (String, String) -> Field
|
32
|
+
|
33
|
+
def key?: (String) -> bool
|
34
|
+
|
35
|
+
def delete: (String key) -> (String | nil)
|
36
|
+
|
37
|
+
def each: () { (Hash[String, String]) -> void } -> void
|
38
|
+
|
39
|
+
alias each_pair each
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Hearth
|
2
|
+
module HTTP
|
3
|
+
module HeaderListBuilder
|
4
|
+
def self.build_list: (Array[untyped] value) -> String
|
5
|
+
|
6
|
+
def self.build_string_list: (Array[String] value ) -> String
|
7
|
+
|
8
|
+
def self.build_http_date_list: (Array[Time] value) -> String
|
9
|
+
|
10
|
+
def self.build_date_time_list: (Array[Time] value) -> String
|
11
|
+
|
12
|
+
def self.build_epoch_seconds_list: (Array[Time] value) -> String
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Hearth
|
2
|
+
module HTTP
|
3
|
+
module HeaderListParser
|
4
|
+
def self.parse_boolean_list: (String value) -> Array[bool]
|
5
|
+
|
6
|
+
def self.parse_integer_list: (String value) -> Array[Integer]
|
7
|
+
|
8
|
+
def self.parse_float_list: (String value) -> Array[Float]
|
9
|
+
|
10
|
+
def self.build_string_list: (String value ) -> Array[String]
|
11
|
+
|
12
|
+
def self.build_http_date_list: (String value ) -> Array[Time]
|
13
|
+
|
14
|
+
def self.build_date_time_list: (String value ) -> Array[Time]
|
15
|
+
|
16
|
+
def self.build_epoch_seconds_list: (String value ) -> Array[Time]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Hearth
|
2
|
+
module HTTP
|
3
|
+
class Request < Hearth::Request
|
4
|
+
def initialize: (?http_method: Symbol?, ?fields: Fields, ?uri: URI, ?body: IO) -> void
|
5
|
+
|
6
|
+
attr_accessor http_method: Symbol
|
7
|
+
|
8
|
+
attr_reader fields: Fields
|
9
|
+
|
10
|
+
attr_reader headers: Fields::Proxy
|
11
|
+
|
12
|
+
attr_reader trailers: Fields::Proxy
|
13
|
+
|
14
|
+
def append_path: (String path) -> void
|
15
|
+
|
16
|
+
def append_query_param: (String name, String? value) -> void
|
17
|
+
|
18
|
+
def append_query_param_list: (Query::ParamList param_list) -> void
|
19
|
+
|
20
|
+
def remove_query_param: (String name) -> void
|
21
|
+
|
22
|
+
def prefix_host: (String prefix) -> void
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Hearth
|
2
|
+
module HTTP
|
3
|
+
class Response < Hearth::Response
|
4
|
+
def initialize: (?status: Integer, ?reason: String?, ?fields: Fields, ?body: _WritableIO) -> void
|
5
|
+
|
6
|
+
attr_accessor status: Integer
|
7
|
+
|
8
|
+
attr_accessor reason: (String | nil)
|
9
|
+
|
10
|
+
attr_reader fields: Fields
|
11
|
+
|
12
|
+
attr_reader headers: Fields::Proxy
|
13
|
+
|
14
|
+
attr_reader trailers: Fields::Proxy
|
15
|
+
|
16
|
+
def replace: (Response other) -> self
|
17
|
+
|
18
|
+
def reset: () -> void
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Hearth
|
2
|
+
class InterceptorContext
|
3
|
+
def initialize: (input: Structure, request: Request, response: Response, output: Output[Structure], logger: Logger) -> void
|
4
|
+
|
5
|
+
attr_reader input: Structure
|
6
|
+
|
7
|
+
attr_reader request: Request
|
8
|
+
|
9
|
+
attr_reader response: Response
|
10
|
+
|
11
|
+
attr_reader output: Output[Structure]
|
12
|
+
|
13
|
+
attr_reader logger: Logger
|
14
|
+
|
15
|
+
attr_reader attributes: Hash[Symbol, untyped]
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Hearth
|
2
|
+
class InterceptorList
|
3
|
+
include Enumerable[_Interceptor]
|
4
|
+
|
5
|
+
def initialize: (?Array[_Interceptor] interceptors) -> void
|
6
|
+
|
7
|
+
def append: (_Interceptor interceptor) -> void
|
8
|
+
alias << append
|
9
|
+
|
10
|
+
def concat: (InterceptorList other) -> self
|
11
|
+
|
12
|
+
def dup: () -> InterceptorList
|
13
|
+
|
14
|
+
def each: () { (_Interceptor) -> untyped } -> untyped
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# Hack - https://github.com/ruby/delegate/issues/8
|
2
|
+
class SimpleDelegator
|
3
|
+
end
|
4
|
+
|
5
|
+
# Hack - https://github.com/ruby/rbs/issues/1481
|
6
|
+
class URI
|
7
|
+
end
|
8
|
+
|
9
|
+
# Hack - https://github.com/ruby/rbs/issues/1482
|
10
|
+
class Logger
|
11
|
+
end
|
12
|
+
|
13
|
+
module Hearth
|
14
|
+
interface _Plugin[ServiceConfig]
|
15
|
+
def call: (ServiceConfig) -> void
|
16
|
+
end
|
17
|
+
|
18
|
+
interface _Interceptor
|
19
|
+
def read_before_execution: (InterceptorContext) -> void
|
20
|
+
|
21
|
+
def modify_before_serialization: (InterceptorContext) -> void
|
22
|
+
|
23
|
+
def read_before_serialization: (InterceptorContext) -> void
|
24
|
+
|
25
|
+
def read_after_serialization: (InterceptorContext) -> void
|
26
|
+
|
27
|
+
def modify_before_retry_loop: (InterceptorContext) -> void
|
28
|
+
|
29
|
+
def read_before_attempt: (InterceptorContext) -> void
|
30
|
+
|
31
|
+
def modify_before_signing: (InterceptorContext) -> void
|
32
|
+
|
33
|
+
def read_before_signing: (InterceptorContext) -> void
|
34
|
+
|
35
|
+
def read_after_signing: (InterceptorContext) -> void
|
36
|
+
|
37
|
+
def modify_before_transmit: (InterceptorContext) -> void
|
38
|
+
|
39
|
+
def read_before_transmit: (InterceptorContext) -> void
|
40
|
+
|
41
|
+
def read_after_transmit: (InterceptorContext) -> void
|
42
|
+
|
43
|
+
def modify_before_deserialization: (InterceptorContext) -> void
|
44
|
+
|
45
|
+
def read_before_deserialization: (InterceptorContext) -> void
|
46
|
+
|
47
|
+
def read_after_deserialization: (InterceptorContext) -> void
|
48
|
+
|
49
|
+
def modify_before_attempt_completion: (InterceptorContext) -> void
|
50
|
+
|
51
|
+
def read_after_attempt: (InterceptorContext) -> void
|
52
|
+
|
53
|
+
def modify_before_completion: (InterceptorContext) -> void
|
54
|
+
|
55
|
+
def read_after_execution: (InterceptorContext) -> void
|
56
|
+
end
|
57
|
+
|
58
|
+
interface _ErrorInspector
|
59
|
+
def initialize: (ApiError, Response) -> void
|
60
|
+
|
61
|
+
def retryable?: () -> bool
|
62
|
+
|
63
|
+
def error_type: () -> String
|
64
|
+
|
65
|
+
def hints: () -> Hash[Symbol, untyped]
|
66
|
+
end
|
67
|
+
|
68
|
+
interface _RetryStrategy
|
69
|
+
def acquire_initial_retry_token: (?String? _token_scope) -> Retry::Token
|
70
|
+
|
71
|
+
def refresh_retry_token: (Retry::Token _retry_token, _ErrorInspector _error_info) -> Retry::Token?
|
72
|
+
|
73
|
+
def record_success: (Retry::Token _retry_token) -> Retry::Token
|
74
|
+
end
|
75
|
+
|
76
|
+
interface _AuthResolver[Params]
|
77
|
+
def resolve: (Params) -> AuthSchemes::Base
|
78
|
+
end
|
79
|
+
|
80
|
+
interface _EndpointResolver[Params]
|
81
|
+
def resolve: (Params) -> EndpointRules::Endpoint
|
82
|
+
end
|
83
|
+
|
84
|
+
interface _WritableIO
|
85
|
+
def write: (*_ToS) -> Integer
|
86
|
+
end
|
87
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Hearth
|
2
|
+
class Output[DATA]
|
3
|
+
def initialize: (?error: ApiError?, ?data: Structure?, ?metadata: Hash[Symbol, untyped]) -> void
|
4
|
+
|
5
|
+
attr_accessor error: ApiError?
|
6
|
+
|
7
|
+
attr_accessor data: DATA?
|
8
|
+
|
9
|
+
attr_accessor metadata: Hash[Symbol, untyped]
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Hearth
|
2
|
+
class PluginList[ServiceConfig]
|
3
|
+
def initialize: (?Array[_Plugin[ServiceConfig]] plugins) -> void
|
4
|
+
|
5
|
+
def add: (_Plugin[ServiceConfig] plugin) -> void
|
6
|
+
|
7
|
+
alias << add
|
8
|
+
|
9
|
+
def apply: (ServiceConfig) -> void
|
10
|
+
|
11
|
+
def each: () ?{ (_Plugin[ServiceConfig]) -> void } -> void
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Hearth
|
2
|
+
module Query
|
3
|
+
class Param
|
4
|
+
def initialize: (String name, ?(String | Array[String])? value) -> void
|
5
|
+
|
6
|
+
attr_reader name: String
|
7
|
+
|
8
|
+
attr_reader value: (String | Array[String])?
|
9
|
+
|
10
|
+
def to_s: () -> String
|
11
|
+
|
12
|
+
def ==: (Param other) -> bool
|
13
|
+
|
14
|
+
def <=>: (Param other) -> Integer
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Hearth
|
2
|
+
module Query
|
3
|
+
class ParamList
|
4
|
+
include Enumerable[String]
|
5
|
+
|
6
|
+
def initialize: () -> void
|
7
|
+
|
8
|
+
def set: (String param_name, ?String? param_value) -> Param
|
9
|
+
|
10
|
+
alias []= set
|
11
|
+
|
12
|
+
def []: (Param param_name) -> (Param | nil)
|
13
|
+
|
14
|
+
def delete: (Param param_name) -> (Param | nil)
|
15
|
+
|
16
|
+
def each: () { (String) -> void } -> void
|
17
|
+
|
18
|
+
def empty?: () -> bool
|
19
|
+
|
20
|
+
def to_a: () -> Array[Param]
|
21
|
+
|
22
|
+
def to_s: () -> String
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Hearth
|
2
|
+
module Retry
|
3
|
+
class Adaptive < Strategy
|
4
|
+
def initialize: (?backoff: ExponentialBackoff, ?max_attempts: Integer, ?wait_to_fill: bool) -> void
|
5
|
+
|
6
|
+
def acquire_initial_retry_token: (?String? _token_scope) -> Token
|
7
|
+
|
8
|
+
def refresh_retry_token: (Token retry_token, _ErrorInspector error_info) -> (nil | Token)
|
9
|
+
|
10
|
+
def record_success: (Token retry_token) -> Token
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Hearth
|
2
|
+
module Retry
|
3
|
+
class Standard < Strategy
|
4
|
+
def initialize: (?backoff: ExponentialBackoff, ?max_attempts: Integer) -> void
|
5
|
+
|
6
|
+
def acquire_initial_retry_token: (?String? _token_scope) -> Token
|
7
|
+
|
8
|
+
def refresh_retry_token: (Token retry_token, _ErrorInspector error_info) -> (nil | Token)
|
9
|
+
|
10
|
+
def record_success: (Token retry_token) -> Token
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Hearth
|
2
|
+
module Retry
|
3
|
+
class Strategy
|
4
|
+
def acquire_initial_retry_token: (?String? _token_scope) -> Token
|
5
|
+
|
6
|
+
def refresh_retry_token: (Token _retry_token, _ErrorInspector _error_info) -> (nil | Token)
|
7
|
+
|
8
|
+
def record_success: (Token _retry_token) -> Token
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module Hearth
|
2
|
+
module Signers
|
3
|
+
class Anonymous < Signers::Base
|
4
|
+
def sign: (request: Request, identity: Identities::Anonymous, ?properties: Hash[Symbol, untyped]) -> void
|
5
|
+
|
6
|
+
def reset: (request: Request, ?properties: Hash[Symbol, untyped]) -> void
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module Hearth
|
2
|
+
module Signers
|
3
|
+
class HTTPApiKey < Signers::Base
|
4
|
+
def sign: (request: HTTP::Request, identity: Identities::HTTPApiKey, ?properties: Hash[Symbol, untyped]) -> void
|
5
|
+
|
6
|
+
def reset: (request: HTTP::Request, ?properties: Hash[Symbol, untyped]) -> void
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module Hearth
|
2
|
+
module Signers
|
3
|
+
class HTTPBasic < Signers::Base
|
4
|
+
def sign: (request: HTTP::Request, identity: Identities::HTTPLogin, ?properties: Hash[Symbol, untyped]) -> void
|
5
|
+
|
6
|
+
def reset: (request: HTTP::Request, ?properties: Hash[Symbol, untyped]) -> void
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module Hearth
|
2
|
+
module Signers
|
3
|
+
class HTTPBearer < Signers::Base
|
4
|
+
def sign: (request: HTTP::Request, identity: Identities::HTTPBearer, ?properties: Hash[Symbol, untyped]) -> void
|
5
|
+
|
6
|
+
def reset: (request: HTTP::Request, ?properties: Hash[Symbol, untyped]) -> void
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module Hearth
|
2
|
+
module Signers
|
3
|
+
class HTTPDigest < Signers::Base
|
4
|
+
def sign: (request: HTTP::Request, identity: Identities::HTTPLogin, ?properties: Hash[Symbol, untyped]) -> void
|
5
|
+
|
6
|
+
def reset: (request: HTTP::Request, ?properties: Hash[Symbol, untyped]) -> void
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|