method-ruby 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.ignore +2 -0
- data/CHANGELOG.md +11 -0
- data/README.md +244 -0
- data/SECURITY.md +27 -0
- data/lib/method_ruby/client.rb +114 -0
- data/lib/method_ruby/errors.rb +228 -0
- data/lib/method_ruby/file_part.rb +58 -0
- data/lib/method_ruby/internal/transport/base_client.rb +595 -0
- data/lib/method_ruby/internal/transport/pooled_net_requester.rb +210 -0
- data/lib/method_ruby/internal/type/array_of.rb +168 -0
- data/lib/method_ruby/internal/type/base_model.rb +531 -0
- data/lib/method_ruby/internal/type/base_page.rb +55 -0
- data/lib/method_ruby/internal/type/boolean.rb +77 -0
- data/lib/method_ruby/internal/type/converter.rb +327 -0
- data/lib/method_ruby/internal/type/enum.rb +131 -0
- data/lib/method_ruby/internal/type/file_input.rb +111 -0
- data/lib/method_ruby/internal/type/hash_of.rb +188 -0
- data/lib/method_ruby/internal/type/request_parameters.rb +42 -0
- data/lib/method_ruby/internal/type/union.rb +237 -0
- data/lib/method_ruby/internal/type/unknown.rb +81 -0
- data/lib/method_ruby/internal/util.rb +951 -0
- data/lib/method_ruby/internal.rb +20 -0
- data/lib/method_ruby/models/address.rb +45 -0
- data/lib/method_ruby/models/entity.rb +102 -0
- data/lib/method_ruby/models/entity_corporation.rb +33 -0
- data/lib/method_ruby/models/entity_corporation_owner.rb +45 -0
- data/lib/method_ruby/models/entity_create_params.rb +188 -0
- data/lib/method_ruby/models/entity_create_response.rb +32 -0
- data/lib/method_ruby/models/entity_individual.rb +39 -0
- data/lib/method_ruby/models/entity_list_params.rb +61 -0
- data/lib/method_ruby/models/entity_list_response.rb +32 -0
- data/lib/method_ruby/models/entity_retrieve_params.rb +37 -0
- data/lib/method_ruby/models/entity_retrieve_response.rb +32 -0
- data/lib/method_ruby/models/entity_update_params.rb +75 -0
- data/lib/method_ruby/models/entity_update_response.rb +32 -0
- data/lib/method_ruby/models/ping_check_params.rb +14 -0
- data/lib/method_ruby/models/ping_check_response.rb +49 -0
- data/lib/method_ruby/models/resource_error.rb +33 -0
- data/lib/method_ruby/models.rb +63 -0
- data/lib/method_ruby/request_options.rb +77 -0
- data/lib/method_ruby/resources/entities.rb +141 -0
- data/lib/method_ruby/resources/ping.rb +34 -0
- data/lib/method_ruby/version.rb +5 -0
- data/lib/method_ruby.rb +73 -0
- data/manifest.yaml +17 -0
- data/rbi/method_ruby/client.rbi +85 -0
- data/rbi/method_ruby/errors.rbi +205 -0
- data/rbi/method_ruby/file_part.rbi +37 -0
- data/rbi/method_ruby/internal/transport/base_client.rbi +303 -0
- data/rbi/method_ruby/internal/transport/pooled_net_requester.rbi +84 -0
- data/rbi/method_ruby/internal/type/array_of.rbi +104 -0
- data/rbi/method_ruby/internal/type/base_model.rbi +308 -0
- data/rbi/method_ruby/internal/type/base_page.rbi +42 -0
- data/rbi/method_ruby/internal/type/boolean.rbi +58 -0
- data/rbi/method_ruby/internal/type/converter.rbi +216 -0
- data/rbi/method_ruby/internal/type/enum.rbi +82 -0
- data/rbi/method_ruby/internal/type/file_input.rbi +59 -0
- data/rbi/method_ruby/internal/type/hash_of.rbi +104 -0
- data/rbi/method_ruby/internal/type/request_parameters.rbi +29 -0
- data/rbi/method_ruby/internal/type/union.rbi +128 -0
- data/rbi/method_ruby/internal/type/unknown.rbi +58 -0
- data/rbi/method_ruby/internal/util.rbi +507 -0
- data/rbi/method_ruby/internal.rbi +18 -0
- data/rbi/method_ruby/models/address.rbi +63 -0
- data/rbi/method_ruby/models/entity.rbi +151 -0
- data/rbi/method_ruby/models/entity_corporation.rbi +61 -0
- data/rbi/method_ruby/models/entity_corporation_owner.rbi +86 -0
- data/rbi/method_ruby/models/entity_create_params.rbi +408 -0
- data/rbi/method_ruby/models/entity_create_response.rbi +84 -0
- data/rbi/method_ruby/models/entity_individual.rbi +65 -0
- data/rbi/method_ruby/models/entity_list_params.rbi +132 -0
- data/rbi/method_ruby/models/entity_list_response.rbi +84 -0
- data/rbi/method_ruby/models/entity_retrieve_params.rbi +93 -0
- data/rbi/method_ruby/models/entity_retrieve_response.rbi +89 -0
- data/rbi/method_ruby/models/entity_update_params.rbi +141 -0
- data/rbi/method_ruby/models/entity_update_response.rbi +84 -0
- data/rbi/method_ruby/models/ping_check_params.rbi +27 -0
- data/rbi/method_ruby/models/ping_check_response.rbi +118 -0
- data/rbi/method_ruby/models/resource_error.rbi +55 -0
- data/rbi/method_ruby/models.rbi +25 -0
- data/rbi/method_ruby/request_options.rbi +59 -0
- data/rbi/method_ruby/resources/entities.rbi +119 -0
- data/rbi/method_ruby/resources/ping.rbi +22 -0
- data/rbi/method_ruby/version.rbi +5 -0
- data/sig/method_ruby/client.rbs +39 -0
- data/sig/method_ruby/errors.rbs +117 -0
- data/sig/method_ruby/file_part.rbs +21 -0
- data/sig/method_ruby/internal/transport/base_client.rbs +135 -0
- data/sig/method_ruby/internal/transport/pooled_net_requester.rbs +48 -0
- data/sig/method_ruby/internal/type/array_of.rbs +48 -0
- data/sig/method_ruby/internal/type/base_model.rbs +102 -0
- data/sig/method_ruby/internal/type/base_page.rbs +24 -0
- data/sig/method_ruby/internal/type/boolean.rbs +26 -0
- data/sig/method_ruby/internal/type/converter.rbs +79 -0
- data/sig/method_ruby/internal/type/enum.rbs +32 -0
- data/sig/method_ruby/internal/type/file_input.rbs +25 -0
- data/sig/method_ruby/internal/type/hash_of.rbs +48 -0
- data/sig/method_ruby/internal/type/request_parameters.rbs +19 -0
- data/sig/method_ruby/internal/type/union.rbs +52 -0
- data/sig/method_ruby/internal/type/unknown.rbs +26 -0
- data/sig/method_ruby/internal/util.rbs +195 -0
- data/sig/method_ruby/internal.rbs +9 -0
- data/sig/method_ruby/models/address.rbs +40 -0
- data/sig/method_ruby/models/entity.rbs +94 -0
- data/sig/method_ruby/models/entity_corporation.rbs +43 -0
- data/sig/method_ruby/models/entity_corporation_owner.rbs +57 -0
- data/sig/method_ruby/models/entity_create_params.rbs +215 -0
- data/sig/method_ruby/models/entity_create_response.rbs +41 -0
- data/sig/method_ruby/models/entity_individual.rbs +44 -0
- data/sig/method_ruby/models/entity_list_params.rbs +77 -0
- data/sig/method_ruby/models/entity_list_response.rbs +41 -0
- data/sig/method_ruby/models/entity_retrieve_params.rbs +47 -0
- data/sig/method_ruby/models/entity_retrieve_response.rbs +41 -0
- data/sig/method_ruby/models/entity_update_params.rbs +84 -0
- data/sig/method_ruby/models/entity_update_response.rbs +41 -0
- data/sig/method_ruby/models/ping_check_params.rbs +15 -0
- data/sig/method_ruby/models/ping_check_response.rbs +59 -0
- data/sig/method_ruby/models/resource_error.rbs +38 -0
- data/sig/method_ruby/models.rbs +23 -0
- data/sig/method_ruby/request_options.rbs +36 -0
- data/sig/method_ruby/resources/entities.rbs +41 -0
- data/sig/method_ruby/resources/ping.rbs +11 -0
- data/sig/method_ruby/version.rbs +3 -0
- metadata +196 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
module MethodRuby
|
|
2
|
+
module Internal
|
|
3
|
+
module Transport
|
|
4
|
+
class BaseClient
|
|
5
|
+
extend MethodRuby::Internal::Util::SorbetRuntimeSupport
|
|
6
|
+
|
|
7
|
+
type request_components =
|
|
8
|
+
{
|
|
9
|
+
method: Symbol,
|
|
10
|
+
path: String | ::Array[String],
|
|
11
|
+
query: ::Hash[String, (::Array[String] | String)?]?,
|
|
12
|
+
headers: ::Hash[String, (String
|
|
13
|
+
| Integer
|
|
14
|
+
| ::Array[(String | Integer)?])?]?,
|
|
15
|
+
body: top?,
|
|
16
|
+
unwrap: (Symbol
|
|
17
|
+
| Integer
|
|
18
|
+
| ::Array[(Symbol | Integer)]
|
|
19
|
+
| (^(top arg0) -> top))?,
|
|
20
|
+
page: Class?,
|
|
21
|
+
stream: Class?,
|
|
22
|
+
model: MethodRuby::Internal::Type::Converter::input?,
|
|
23
|
+
security: { bearer_auth: bool }?,
|
|
24
|
+
options: MethodRuby::request_opts?
|
|
25
|
+
}
|
|
26
|
+
type request_input =
|
|
27
|
+
{
|
|
28
|
+
method: Symbol,
|
|
29
|
+
url: URI::Generic,
|
|
30
|
+
headers: ::Hash[String, String],
|
|
31
|
+
body: top,
|
|
32
|
+
max_retries: Integer,
|
|
33
|
+
timeout: Float
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
MAX_REDIRECTS: 20
|
|
37
|
+
|
|
38
|
+
PLATFORM_HEADERS: ::Hash[String, String]
|
|
39
|
+
|
|
40
|
+
def self.validate!: (
|
|
41
|
+
MethodRuby::Internal::Transport::BaseClient::request_components req
|
|
42
|
+
) -> void
|
|
43
|
+
|
|
44
|
+
def self.should_retry?: (
|
|
45
|
+
Integer status,
|
|
46
|
+
headers: ::Hash[String, String]
|
|
47
|
+
) -> bool
|
|
48
|
+
|
|
49
|
+
def self.follow_redirect: (
|
|
50
|
+
MethodRuby::Internal::Transport::BaseClient::request_input request,
|
|
51
|
+
status: Integer,
|
|
52
|
+
response_headers: ::Hash[String, String]
|
|
53
|
+
) -> MethodRuby::Internal::Transport::BaseClient::request_input
|
|
54
|
+
|
|
55
|
+
def self.reap_connection!: (
|
|
56
|
+
Integer | MethodRuby::Errors::APIConnectionError status,
|
|
57
|
+
stream: Enumerable[String]?
|
|
58
|
+
) -> void
|
|
59
|
+
|
|
60
|
+
attr_reader base_url: URI::Generic
|
|
61
|
+
|
|
62
|
+
attr_reader timeout: Float
|
|
63
|
+
|
|
64
|
+
attr_reader max_retries: Integer
|
|
65
|
+
|
|
66
|
+
attr_reader initial_retry_delay: Float
|
|
67
|
+
|
|
68
|
+
attr_reader max_retry_delay: Float
|
|
69
|
+
|
|
70
|
+
attr_reader headers: ::Hash[String, String]
|
|
71
|
+
|
|
72
|
+
attr_reader idempotency_header: String?
|
|
73
|
+
|
|
74
|
+
# @api private
|
|
75
|
+
attr_reader requester: MethodRuby::Internal::Transport::PooledNetRequester
|
|
76
|
+
|
|
77
|
+
def initialize: (
|
|
78
|
+
base_url: String,
|
|
79
|
+
?timeout: Float,
|
|
80
|
+
?max_retries: Integer,
|
|
81
|
+
?initial_retry_delay: Float,
|
|
82
|
+
?max_retry_delay: Float,
|
|
83
|
+
?headers: ::Hash[String, (String
|
|
84
|
+
| Integer
|
|
85
|
+
| ::Array[(String | Integer)?])?],
|
|
86
|
+
?idempotency_header: String?
|
|
87
|
+
) -> void
|
|
88
|
+
|
|
89
|
+
private def auth_headers: -> ::Hash[String, String]
|
|
90
|
+
|
|
91
|
+
private def user_agent: -> String
|
|
92
|
+
|
|
93
|
+
private def generate_idempotency_key: -> String
|
|
94
|
+
|
|
95
|
+
private def build_request: (
|
|
96
|
+
MethodRuby::Internal::Transport::BaseClient::request_components req,
|
|
97
|
+
MethodRuby::request_options opts
|
|
98
|
+
) -> MethodRuby::Internal::Transport::BaseClient::request_input
|
|
99
|
+
|
|
100
|
+
private def retry_delay: (
|
|
101
|
+
::Hash[String, String] headers,
|
|
102
|
+
retry_count: Integer
|
|
103
|
+
) -> Float
|
|
104
|
+
|
|
105
|
+
def send_request: (
|
|
106
|
+
MethodRuby::Internal::Transport::BaseClient::request_input request,
|
|
107
|
+
redirect_count: Integer,
|
|
108
|
+
retry_count: Integer,
|
|
109
|
+
send_retry_header: bool
|
|
110
|
+
) -> [Integer, top, Enumerable[String]]
|
|
111
|
+
|
|
112
|
+
def request: (
|
|
113
|
+
Symbol method,
|
|
114
|
+
String | ::Array[String] path,
|
|
115
|
+
?query: ::Hash[String, (::Array[String] | String)?]?,
|
|
116
|
+
?headers: ::Hash[String, (String
|
|
117
|
+
| Integer
|
|
118
|
+
| ::Array[(String | Integer)?])?]?,
|
|
119
|
+
?body: top?,
|
|
120
|
+
?unwrap: (Symbol
|
|
121
|
+
| Integer
|
|
122
|
+
| ::Array[(Symbol | Integer)]
|
|
123
|
+
| (^(top arg0) -> top))?,
|
|
124
|
+
?page: Class?,
|
|
125
|
+
?stream: Class?,
|
|
126
|
+
?model: MethodRuby::Internal::Type::Converter::input?,
|
|
127
|
+
?security: { bearer_auth: bool }?,
|
|
128
|
+
?options: MethodRuby::request_opts?
|
|
129
|
+
) -> top
|
|
130
|
+
|
|
131
|
+
def inspect: -> String
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
module MethodRuby
|
|
2
|
+
module Internal
|
|
3
|
+
module Transport
|
|
4
|
+
class PooledNetRequester
|
|
5
|
+
extend MethodRuby::Internal::Util::SorbetRuntimeSupport
|
|
6
|
+
|
|
7
|
+
type request =
|
|
8
|
+
{
|
|
9
|
+
method: Symbol,
|
|
10
|
+
url: URI::Generic,
|
|
11
|
+
headers: ::Hash[String, String],
|
|
12
|
+
body: top,
|
|
13
|
+
deadline: Float
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
KEEP_ALIVE_TIMEOUT: 30
|
|
17
|
+
|
|
18
|
+
DEFAULT_MAX_CONNECTIONS: Integer
|
|
19
|
+
|
|
20
|
+
def self.connect: (
|
|
21
|
+
cert_store: OpenSSL::X509::Store,
|
|
22
|
+
url: URI::Generic
|
|
23
|
+
) -> top
|
|
24
|
+
|
|
25
|
+
def self.calibrate_socket_timeout: (top conn, Float deadline) -> void
|
|
26
|
+
|
|
27
|
+
def self.build_request: (
|
|
28
|
+
MethodRuby::Internal::Transport::PooledNetRequester::request request
|
|
29
|
+
) {
|
|
30
|
+
(String arg0) -> void
|
|
31
|
+
} -> [top, (^-> void)]
|
|
32
|
+
|
|
33
|
+
private def with_pool: (
|
|
34
|
+
URI::Generic url,
|
|
35
|
+
deadline: Float
|
|
36
|
+
) {
|
|
37
|
+
(top arg0) -> void
|
|
38
|
+
} -> void
|
|
39
|
+
|
|
40
|
+
def execute: (
|
|
41
|
+
MethodRuby::Internal::Transport::PooledNetRequester::request request
|
|
42
|
+
) -> [Integer, top, Enumerable[String]]
|
|
43
|
+
|
|
44
|
+
def initialize: (?size: Integer) -> void
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
module MethodRuby
|
|
2
|
+
module Internal
|
|
3
|
+
module Type
|
|
4
|
+
class ArrayOf[Elem]
|
|
5
|
+
include MethodRuby::Internal::Type::Converter
|
|
6
|
+
include MethodRuby::Internal::Util::SorbetRuntimeSupport
|
|
7
|
+
|
|
8
|
+
def self.[]: (
|
|
9
|
+
::Hash[Symbol, top]
|
|
10
|
+
| ^-> MethodRuby::Internal::Type::Converter::input
|
|
11
|
+
| MethodRuby::Internal::Type::Converter::input type_info,
|
|
12
|
+
?::Hash[Symbol, top] spec
|
|
13
|
+
) -> instance
|
|
14
|
+
|
|
15
|
+
def ===: (top other) -> bool
|
|
16
|
+
|
|
17
|
+
def ==: (top other) -> bool
|
|
18
|
+
|
|
19
|
+
def hash: -> Integer
|
|
20
|
+
|
|
21
|
+
def coerce: (
|
|
22
|
+
::Array[top] | top value,
|
|
23
|
+
state: MethodRuby::Internal::Type::Converter::coerce_state
|
|
24
|
+
) -> (::Array[top] | top)
|
|
25
|
+
|
|
26
|
+
def dump: (
|
|
27
|
+
::Array[top] | top value,
|
|
28
|
+
state: MethodRuby::Internal::Type::Converter::dump_state
|
|
29
|
+
) -> (::Array[top] | top)
|
|
30
|
+
|
|
31
|
+
def to_sorbet_type: -> top
|
|
32
|
+
|
|
33
|
+
def item_type: -> Elem
|
|
34
|
+
|
|
35
|
+
def nilable?: -> bool
|
|
36
|
+
|
|
37
|
+
def initialize: (
|
|
38
|
+
::Hash[Symbol, top]
|
|
39
|
+
| ^-> MethodRuby::Internal::Type::Converter::input
|
|
40
|
+
| MethodRuby::Internal::Type::Converter::input type_info,
|
|
41
|
+
?::Hash[Symbol, top] spec
|
|
42
|
+
) -> void
|
|
43
|
+
|
|
44
|
+
def inspect: (?depth: Integer) -> String
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
module MethodRuby
|
|
2
|
+
module Internal
|
|
3
|
+
module Type
|
|
4
|
+
class BaseModel
|
|
5
|
+
extend MethodRuby::Internal::Type::Converter
|
|
6
|
+
extend MethodRuby::Internal::Util::SorbetRuntimeSupport
|
|
7
|
+
|
|
8
|
+
type known_field =
|
|
9
|
+
{ mode: (:coerce | :dump)?, required: bool, nilable: bool }
|
|
10
|
+
|
|
11
|
+
def self.inherited: (self child) -> void
|
|
12
|
+
|
|
13
|
+
def self.known_fields: -> ::Hash[Symbol, (MethodRuby::Internal::Type::BaseModel::known_field
|
|
14
|
+
& { type_fn: (^-> MethodRuby::Internal::Type::Converter::input) })]
|
|
15
|
+
|
|
16
|
+
def self.fields: -> ::Hash[Symbol, (MethodRuby::Internal::Type::BaseModel::known_field
|
|
17
|
+
& { type: MethodRuby::Internal::Type::Converter::input })]
|
|
18
|
+
|
|
19
|
+
private def self.add_field: (
|
|
20
|
+
Symbol name_sym,
|
|
21
|
+
required: bool,
|
|
22
|
+
type_info: {
|
|
23
|
+
const: (nil | bool | Integer | Float | Symbol)?,
|
|
24
|
+
enum: ^-> MethodRuby::Internal::Type::Converter::input?,
|
|
25
|
+
union: ^-> MethodRuby::Internal::Type::Converter::input?,
|
|
26
|
+
api_name: Symbol
|
|
27
|
+
}
|
|
28
|
+
| ^-> MethodRuby::Internal::Type::Converter::input
|
|
29
|
+
| MethodRuby::Internal::Type::Converter::input,
|
|
30
|
+
spec: ::Hash[Symbol, top]
|
|
31
|
+
) -> void
|
|
32
|
+
|
|
33
|
+
def self.required: (
|
|
34
|
+
Symbol name_sym,
|
|
35
|
+
::Hash[Symbol, top]
|
|
36
|
+
| ^-> MethodRuby::Internal::Type::Converter::input
|
|
37
|
+
| MethodRuby::Internal::Type::Converter::input type_info,
|
|
38
|
+
?::Hash[Symbol, top] spec
|
|
39
|
+
) -> void
|
|
40
|
+
|
|
41
|
+
def self.optional: (
|
|
42
|
+
Symbol name_sym,
|
|
43
|
+
::Hash[Symbol, top]
|
|
44
|
+
| ^-> MethodRuby::Internal::Type::Converter::input
|
|
45
|
+
| MethodRuby::Internal::Type::Converter::input type_info,
|
|
46
|
+
?::Hash[Symbol, top] spec
|
|
47
|
+
) -> void
|
|
48
|
+
|
|
49
|
+
private def self.request_only: { -> void } -> void
|
|
50
|
+
|
|
51
|
+
private def self.response_only: { -> void } -> void
|
|
52
|
+
|
|
53
|
+
def self.==: (top other) -> bool
|
|
54
|
+
|
|
55
|
+
def self.hash: -> Integer
|
|
56
|
+
|
|
57
|
+
def ==: (top other) -> bool
|
|
58
|
+
|
|
59
|
+
def hash: -> Integer
|
|
60
|
+
|
|
61
|
+
def self.coerce: (
|
|
62
|
+
MethodRuby::Internal::Type::BaseModel | ::Hash[top, top] | top value,
|
|
63
|
+
state: MethodRuby::Internal::Type::Converter::coerce_state
|
|
64
|
+
) -> (instance | top)
|
|
65
|
+
|
|
66
|
+
def self.dump: (
|
|
67
|
+
instance | top value,
|
|
68
|
+
state: MethodRuby::Internal::Type::Converter::dump_state
|
|
69
|
+
) -> (::Hash[top, top] | top)
|
|
70
|
+
|
|
71
|
+
def self.to_sorbet_type: -> top
|
|
72
|
+
|
|
73
|
+
def self.recursively_to_h: (
|
|
74
|
+
MethodRuby::Internal::Type::BaseModel model,
|
|
75
|
+
convert: bool
|
|
76
|
+
) -> ::Hash[Symbol, top]
|
|
77
|
+
|
|
78
|
+
def []: (Symbol key) -> top?
|
|
79
|
+
|
|
80
|
+
def to_h: -> ::Hash[Symbol, top]
|
|
81
|
+
|
|
82
|
+
alias to_hash to_h
|
|
83
|
+
|
|
84
|
+
def deep_to_h: -> ::Hash[Symbol, top]
|
|
85
|
+
|
|
86
|
+
def deconstruct_keys: (::Array[Symbol]? keys) -> ::Hash[Symbol, top]
|
|
87
|
+
|
|
88
|
+
def to_json: (*top a) -> String
|
|
89
|
+
|
|
90
|
+
def to_yaml: (*top a) -> String
|
|
91
|
+
|
|
92
|
+
def initialize: (?::Hash[Symbol, top] | instance data) -> void
|
|
93
|
+
|
|
94
|
+
def self.inspect: (?depth: Integer) -> String
|
|
95
|
+
|
|
96
|
+
def to_s: -> String
|
|
97
|
+
|
|
98
|
+
def inspect: -> String
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module MethodRuby
|
|
2
|
+
module Internal
|
|
3
|
+
module Type
|
|
4
|
+
module BasePage[Elem]
|
|
5
|
+
def next_page?: -> bool
|
|
6
|
+
|
|
7
|
+
def next_page: -> instance
|
|
8
|
+
|
|
9
|
+
def auto_paging_each: { (Elem arg0) -> void } -> void
|
|
10
|
+
|
|
11
|
+
def to_enum: -> Enumerable[Elem]
|
|
12
|
+
|
|
13
|
+
alias enum_for to_enum
|
|
14
|
+
|
|
15
|
+
def initialize: (
|
|
16
|
+
client: MethodRuby::Internal::Transport::BaseClient,
|
|
17
|
+
req: MethodRuby::Internal::Transport::BaseClient::request_components,
|
|
18
|
+
headers: ::Hash[String, String],
|
|
19
|
+
page_data: top
|
|
20
|
+
) -> void
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module MethodRuby
|
|
2
|
+
module Internal
|
|
3
|
+
module Type
|
|
4
|
+
class Boolean
|
|
5
|
+
extend MethodRuby::Internal::Type::Converter
|
|
6
|
+
extend MethodRuby::Internal::Util::SorbetRuntimeSupport
|
|
7
|
+
|
|
8
|
+
def self.===: (top other) -> bool
|
|
9
|
+
|
|
10
|
+
def self.==: (top other) -> bool
|
|
11
|
+
|
|
12
|
+
def self.coerce: (
|
|
13
|
+
bool | top value,
|
|
14
|
+
state: MethodRuby::Internal::Type::Converter::coerce_state
|
|
15
|
+
) -> (bool | top)
|
|
16
|
+
|
|
17
|
+
def self.dump: (
|
|
18
|
+
bool | top value,
|
|
19
|
+
state: MethodRuby::Internal::Type::Converter::dump_state
|
|
20
|
+
) -> (bool | top)
|
|
21
|
+
|
|
22
|
+
def self.to_sorbet_type: -> top
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
module MethodRuby
|
|
2
|
+
module Internal
|
|
3
|
+
module Type
|
|
4
|
+
module Converter
|
|
5
|
+
extend MethodRuby::Internal::Util::SorbetRuntimeSupport
|
|
6
|
+
|
|
7
|
+
type input = MethodRuby::Internal::Type::Converter | Class
|
|
8
|
+
|
|
9
|
+
type coerce_state =
|
|
10
|
+
{
|
|
11
|
+
translate_names: bool,
|
|
12
|
+
strictness: bool,
|
|
13
|
+
exactness: { yes: Integer, no: Integer, maybe: Integer },
|
|
14
|
+
error: Class,
|
|
15
|
+
branched: Integer
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type dump_state = { can_retry: bool }
|
|
19
|
+
|
|
20
|
+
def coerce: (
|
|
21
|
+
top value,
|
|
22
|
+
state: MethodRuby::Internal::Type::Converter::coerce_state
|
|
23
|
+
) -> top
|
|
24
|
+
|
|
25
|
+
def dump: (
|
|
26
|
+
top value,
|
|
27
|
+
state: MethodRuby::Internal::Type::Converter::dump_state
|
|
28
|
+
) -> top
|
|
29
|
+
|
|
30
|
+
def inspect: (?depth: Integer) -> String
|
|
31
|
+
|
|
32
|
+
def self.type_info: (
|
|
33
|
+
{
|
|
34
|
+
const: (nil | bool | Integer | Float | Symbol)?,
|
|
35
|
+
enum: ^-> MethodRuby::Internal::Type::Converter::input?,
|
|
36
|
+
union: ^-> MethodRuby::Internal::Type::Converter::input?
|
|
37
|
+
}
|
|
38
|
+
| ^-> MethodRuby::Internal::Type::Converter::input
|
|
39
|
+
| MethodRuby::Internal::Type::Converter::input spec
|
|
40
|
+
) -> (^-> top)
|
|
41
|
+
|
|
42
|
+
def self.meta_info: (
|
|
43
|
+
{
|
|
44
|
+
const: (nil | bool | Integer | Float | Symbol)?,
|
|
45
|
+
enum: ^-> MethodRuby::Internal::Type::Converter::input?,
|
|
46
|
+
union: ^-> MethodRuby::Internal::Type::Converter::input?
|
|
47
|
+
}
|
|
48
|
+
| ^-> MethodRuby::Internal::Type::Converter::input
|
|
49
|
+
| MethodRuby::Internal::Type::Converter::input type_info,
|
|
50
|
+
{
|
|
51
|
+
const: (nil | bool | Integer | Float | Symbol)?,
|
|
52
|
+
enum: ^-> MethodRuby::Internal::Type::Converter::input?,
|
|
53
|
+
union: ^-> MethodRuby::Internal::Type::Converter::input?
|
|
54
|
+
}
|
|
55
|
+
| ^-> MethodRuby::Internal::Type::Converter::input
|
|
56
|
+
| MethodRuby::Internal::Type::Converter::input spec
|
|
57
|
+
) -> ::Hash[Symbol, top]
|
|
58
|
+
|
|
59
|
+
def self.new_coerce_state: (
|
|
60
|
+
?translate_names: bool
|
|
61
|
+
) -> MethodRuby::Internal::Type::Converter::coerce_state
|
|
62
|
+
|
|
63
|
+
def self.coerce: (
|
|
64
|
+
MethodRuby::Internal::Type::Converter::input target,
|
|
65
|
+
top value,
|
|
66
|
+
?state: MethodRuby::Internal::Type::Converter::coerce_state
|
|
67
|
+
) -> top
|
|
68
|
+
|
|
69
|
+
def self.dump: (
|
|
70
|
+
MethodRuby::Internal::Type::Converter::input target,
|
|
71
|
+
top value,
|
|
72
|
+
?state: MethodRuby::Internal::Type::Converter::dump_state
|
|
73
|
+
) -> top
|
|
74
|
+
|
|
75
|
+
def self.inspect: (top target, depth: Integer) -> String
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module MethodRuby
|
|
2
|
+
module Internal
|
|
3
|
+
module Type
|
|
4
|
+
module Enum
|
|
5
|
+
include MethodRuby::Internal::Type::Converter
|
|
6
|
+
include MethodRuby::Internal::Util::SorbetRuntimeSupport
|
|
7
|
+
|
|
8
|
+
def self.values: -> ::Array[(nil | bool | Integer | Float | Symbol)]
|
|
9
|
+
|
|
10
|
+
def ===: (top other) -> bool
|
|
11
|
+
|
|
12
|
+
def ==: (top other) -> bool
|
|
13
|
+
|
|
14
|
+
def hash: -> Integer
|
|
15
|
+
|
|
16
|
+
def coerce: (
|
|
17
|
+
String | Symbol | top value,
|
|
18
|
+
state: MethodRuby::Internal::Type::Converter::coerce_state
|
|
19
|
+
) -> (Symbol | top)
|
|
20
|
+
|
|
21
|
+
def dump: (
|
|
22
|
+
Symbol | top value,
|
|
23
|
+
state: MethodRuby::Internal::Type::Converter::dump_state
|
|
24
|
+
) -> (Symbol | top)
|
|
25
|
+
|
|
26
|
+
def to_sorbet_type: -> top
|
|
27
|
+
|
|
28
|
+
def inspect: (?depth: Integer) -> String
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module MethodRuby
|
|
2
|
+
module Internal
|
|
3
|
+
module Type
|
|
4
|
+
class FileInput
|
|
5
|
+
extend MethodRuby::Internal::Type::Converter
|
|
6
|
+
|
|
7
|
+
def self.===: (top other) -> bool
|
|
8
|
+
|
|
9
|
+
def self.==: (top other) -> bool
|
|
10
|
+
|
|
11
|
+
def self.coerce: (
|
|
12
|
+
StringIO | String | top value,
|
|
13
|
+
state: MethodRuby::Internal::Type::Converter::coerce_state
|
|
14
|
+
) -> (StringIO | top)
|
|
15
|
+
|
|
16
|
+
def self.dump: (
|
|
17
|
+
Pathname | StringIO | IO | String | top value,
|
|
18
|
+
state: MethodRuby::Internal::Type::Converter::dump_state
|
|
19
|
+
) -> (Pathname | StringIO | IO | String | top)
|
|
20
|
+
|
|
21
|
+
def self.to_sorbet_type: -> top
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
module MethodRuby
|
|
2
|
+
module Internal
|
|
3
|
+
module Type
|
|
4
|
+
class HashOf[Elem]
|
|
5
|
+
include MethodRuby::Internal::Type::Converter
|
|
6
|
+
include MethodRuby::Internal::Util::SorbetRuntimeSupport
|
|
7
|
+
|
|
8
|
+
def self.[]: (
|
|
9
|
+
::Hash[Symbol, top]
|
|
10
|
+
| ^-> MethodRuby::Internal::Type::Converter::input
|
|
11
|
+
| MethodRuby::Internal::Type::Converter::input type_info,
|
|
12
|
+
?::Hash[Symbol, top] spec
|
|
13
|
+
) -> instance
|
|
14
|
+
|
|
15
|
+
def ===: (top other) -> bool
|
|
16
|
+
|
|
17
|
+
def ==: (top other) -> bool
|
|
18
|
+
|
|
19
|
+
def hash: -> Integer
|
|
20
|
+
|
|
21
|
+
def coerce: (
|
|
22
|
+
::Hash[top, top] | top value,
|
|
23
|
+
state: MethodRuby::Internal::Type::Converter::coerce_state
|
|
24
|
+
) -> (::Hash[Symbol, top] | top)
|
|
25
|
+
|
|
26
|
+
def dump: (
|
|
27
|
+
::Hash[top, top] | top value,
|
|
28
|
+
state: MethodRuby::Internal::Type::Converter::dump_state
|
|
29
|
+
) -> (::Hash[Symbol, top] | top)
|
|
30
|
+
|
|
31
|
+
def to_sorbet_type: -> top
|
|
32
|
+
|
|
33
|
+
def item_type: -> Elem
|
|
34
|
+
|
|
35
|
+
def nilable?: -> bool
|
|
36
|
+
|
|
37
|
+
def initialize: (
|
|
38
|
+
::Hash[Symbol, top]
|
|
39
|
+
| ^-> MethodRuby::Internal::Type::Converter::input
|
|
40
|
+
| MethodRuby::Internal::Type::Converter::input type_info,
|
|
41
|
+
?::Hash[Symbol, top] spec
|
|
42
|
+
) -> void
|
|
43
|
+
|
|
44
|
+
def inspect: (?depth: Integer) -> String
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module MethodRuby
|
|
2
|
+
module Internal
|
|
3
|
+
module Type
|
|
4
|
+
type request_parameters = { request_options: MethodRuby::request_opts }
|
|
5
|
+
|
|
6
|
+
module RequestParameters
|
|
7
|
+
attr_reader request_options: MethodRuby::request_opts
|
|
8
|
+
|
|
9
|
+
def request_options=: (
|
|
10
|
+
MethodRuby::request_opts
|
|
11
|
+
) -> MethodRuby::request_opts
|
|
12
|
+
|
|
13
|
+
module Converter
|
|
14
|
+
def dump_request: (top params) -> [top, ::Hash[Symbol, top]]
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
module MethodRuby
|
|
2
|
+
module Internal
|
|
3
|
+
module Type
|
|
4
|
+
module Union
|
|
5
|
+
include MethodRuby::Internal::Type::Converter
|
|
6
|
+
include MethodRuby::Internal::Util::SorbetRuntimeSupport
|
|
7
|
+
|
|
8
|
+
private def self.known_variants: -> ::Array[[Symbol?, (^-> MethodRuby::Internal::Type::Converter::input), ::Hash[Symbol, top]]]
|
|
9
|
+
|
|
10
|
+
def self.derefed_variants: -> ::Array[[Symbol?, top, ::Hash[Symbol, top]]]
|
|
11
|
+
|
|
12
|
+
def self.variants: -> ::Array[top]
|
|
13
|
+
|
|
14
|
+
private def self.discriminator: (Symbol property) -> void
|
|
15
|
+
|
|
16
|
+
private def self.variant: (
|
|
17
|
+
Symbol
|
|
18
|
+
| ::Hash[Symbol, top]
|
|
19
|
+
| ^-> MethodRuby::Internal::Type::Converter::input
|
|
20
|
+
| MethodRuby::Internal::Type::Converter::input key,
|
|
21
|
+
?::Hash[Symbol, top]
|
|
22
|
+
| ^-> MethodRuby::Internal::Type::Converter::input
|
|
23
|
+
| MethodRuby::Internal::Type::Converter::input spec
|
|
24
|
+
) -> void
|
|
25
|
+
|
|
26
|
+
private def self.resolve_variant: (
|
|
27
|
+
top value
|
|
28
|
+
) -> MethodRuby::Internal::Type::Converter::input?
|
|
29
|
+
|
|
30
|
+
def ===: (top other) -> bool
|
|
31
|
+
|
|
32
|
+
def ==: (top other) -> bool
|
|
33
|
+
|
|
34
|
+
def hash: -> Integer
|
|
35
|
+
|
|
36
|
+
def coerce: (
|
|
37
|
+
top value,
|
|
38
|
+
state: MethodRuby::Internal::Type::Converter::coerce_state
|
|
39
|
+
) -> top
|
|
40
|
+
|
|
41
|
+
def dump: (
|
|
42
|
+
top value,
|
|
43
|
+
state: MethodRuby::Internal::Type::Converter::dump_state
|
|
44
|
+
) -> top
|
|
45
|
+
|
|
46
|
+
def to_sorbet_type: -> top
|
|
47
|
+
|
|
48
|
+
def inspect: (?depth: Integer) -> String
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module MethodRuby
|
|
2
|
+
module Internal
|
|
3
|
+
module Type
|
|
4
|
+
class Unknown
|
|
5
|
+
extend MethodRuby::Internal::Type::Converter
|
|
6
|
+
extend MethodRuby::Internal::Util::SorbetRuntimeSupport
|
|
7
|
+
|
|
8
|
+
def self.===: (top other) -> bool
|
|
9
|
+
|
|
10
|
+
def self.==: (top other) -> bool
|
|
11
|
+
|
|
12
|
+
def self.coerce: (
|
|
13
|
+
top value,
|
|
14
|
+
state: MethodRuby::Internal::Type::Converter::coerce_state
|
|
15
|
+
) -> top
|
|
16
|
+
|
|
17
|
+
def self.dump: (
|
|
18
|
+
top value,
|
|
19
|
+
state: MethodRuby::Internal::Type::Converter::dump_state
|
|
20
|
+
) -> top
|
|
21
|
+
|
|
22
|
+
def self.to_sorbet_type: -> top
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|