terminal-shop 2.0.0 → 2.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 +4 -4
- data/README.md +2 -8
- data/lib/terminal-shop/client.rb +1 -1
- data/lib/terminal-shop/models/address_create_params.rb +1 -1
- data/lib/terminal-shop/models/address_delete_params.rb +1 -1
- data/lib/terminal-shop/models/address_get_params.rb +1 -1
- data/lib/terminal-shop/models/address_list_params.rb +1 -1
- data/lib/terminal-shop/models/app_create_params.rb +1 -1
- data/lib/terminal-shop/models/app_delete_params.rb +1 -1
- data/lib/terminal-shop/models/app_get_params.rb +1 -1
- data/lib/terminal-shop/models/app_list_params.rb +1 -1
- data/lib/terminal-shop/models/card_collect_params.rb +1 -1
- data/lib/terminal-shop/models/card_create_params.rb +1 -1
- data/lib/terminal-shop/models/card_delete_params.rb +1 -1
- data/lib/terminal-shop/models/card_get_params.rb +1 -1
- data/lib/terminal-shop/models/card_list_params.rb +1 -1
- data/lib/terminal-shop/models/cart_clear_params.rb +1 -1
- data/lib/terminal-shop/models/cart_convert_params.rb +1 -1
- data/lib/terminal-shop/models/cart_get_params.rb +1 -1
- data/lib/terminal-shop/models/cart_set_address_params.rb +1 -1
- data/lib/terminal-shop/models/cart_set_card_params.rb +1 -1
- data/lib/terminal-shop/models/cart_set_item_params.rb +1 -1
- data/lib/terminal-shop/models/email_create_params.rb +1 -1
- data/lib/terminal-shop/models/order_create_params.rb +1 -1
- data/lib/terminal-shop/models/order_get_params.rb +1 -1
- data/lib/terminal-shop/models/order_list_params.rb +1 -1
- data/lib/terminal-shop/models/product_get_params.rb +1 -1
- data/lib/terminal-shop/models/product_list_params.rb +1 -1
- data/lib/terminal-shop/models/profile_me_params.rb +1 -1
- data/lib/terminal-shop/models/profile_update_params.rb +1 -1
- data/lib/terminal-shop/models/subscription_create_params.rb +1 -1
- data/lib/terminal-shop/models/subscription_delete_params.rb +1 -1
- data/lib/terminal-shop/models/subscription_get_params.rb +1 -1
- data/lib/terminal-shop/models/subscription_list_params.rb +1 -1
- data/lib/terminal-shop/models/token_create_params.rb +1 -1
- data/lib/terminal-shop/models/token_delete_params.rb +1 -1
- data/lib/terminal-shop/models/token_get_params.rb +1 -1
- data/lib/terminal-shop/models/token_list_params.rb +1 -1
- data/lib/terminal-shop/models/view_init_params.rb +1 -1
- data/lib/terminal-shop/request_options.rb +0 -33
- data/lib/terminal-shop/transport/base_client.rb +459 -0
- data/lib/terminal-shop/transport/pooled_net_requester.rb +182 -0
- data/lib/terminal-shop/type/array_of.rb +110 -0
- data/lib/terminal-shop/type/base_model.rb +362 -0
- data/lib/terminal-shop/type/base_page.rb +61 -0
- data/lib/terminal-shop/type/boolean_model.rb +52 -0
- data/lib/terminal-shop/type/converter.rb +217 -0
- data/lib/terminal-shop/type/enum.rb +101 -0
- data/lib/terminal-shop/type/hash_of.rb +136 -0
- data/lib/terminal-shop/type/request_parameters.rb +38 -0
- data/lib/terminal-shop/type/union.rb +183 -0
- data/lib/terminal-shop/type/unknown.rb +56 -0
- data/lib/terminal-shop/type.rb +23 -0
- data/lib/terminal-shop/util.rb +3 -5
- data/lib/terminal-shop/version.rb +1 -1
- data/lib/terminal-shop.rb +14 -6
- data/rbi/lib/terminal-shop/client.rbi +1 -1
- data/rbi/lib/terminal-shop/models/address_create_params.rbi +12 -2
- data/rbi/lib/terminal-shop/models/address_delete_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/address_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/address_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/app_create_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/app_delete_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/app_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/app_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/card_collect_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/card_create_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/card_delete_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/card_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/card_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/cart_clear_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/cart_convert_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/cart_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/cart_set_address_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/cart_set_card_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/cart_set_item_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/email_create_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/order_create_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/order_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/order_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/product_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/product_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/profile_me_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/profile_update_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/subscription_create_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/subscription_delete_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/subscription_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/subscription_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/token_create_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/token_delete_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/token_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/token_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/view_init_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/view_init_response.rbi +12 -1
- data/rbi/lib/terminal-shop/request_options.rbi +0 -15
- data/rbi/lib/terminal-shop/transport/base_client.rbi +208 -0
- data/rbi/lib/terminal-shop/transport/pooled_net_requester.rbi +64 -0
- data/rbi/lib/terminal-shop/type/array_of.rbi +82 -0
- data/rbi/lib/terminal-shop/type/base_model.rbi +194 -0
- data/rbi/lib/terminal-shop/type/base_page.rbi +38 -0
- data/rbi/lib/terminal-shop/type/boolean_model.rbi +41 -0
- data/rbi/lib/terminal-shop/type/converter.rbi +101 -0
- data/rbi/lib/terminal-shop/type/enum.rbi +58 -0
- data/rbi/lib/terminal-shop/type/hash_of.rbi +85 -0
- data/rbi/lib/terminal-shop/type/request_parameters.rbi +20 -0
- data/rbi/lib/terminal-shop/type/union.rbi +68 -0
- data/rbi/lib/terminal-shop/type/unknown.rbi +37 -0
- data/rbi/lib/terminal-shop/type.rbi +23 -0
- data/rbi/lib/terminal-shop/version.rbi +1 -1
- data/sig/terminal-shop/client.rbs +1 -1
- data/sig/terminal-shop/models/address_create_params.rbs +1 -1
- data/sig/terminal-shop/models/address_delete_params.rbs +1 -1
- data/sig/terminal-shop/models/address_get_params.rbs +1 -1
- data/sig/terminal-shop/models/address_list_params.rbs +1 -1
- data/sig/terminal-shop/models/app_create_params.rbs +1 -1
- data/sig/terminal-shop/models/app_delete_params.rbs +1 -1
- data/sig/terminal-shop/models/app_get_params.rbs +1 -1
- data/sig/terminal-shop/models/app_list_params.rbs +1 -1
- data/sig/terminal-shop/models/card_collect_params.rbs +1 -1
- data/sig/terminal-shop/models/card_create_params.rbs +1 -1
- data/sig/terminal-shop/models/card_delete_params.rbs +1 -1
- data/sig/terminal-shop/models/card_get_params.rbs +1 -1
- data/sig/terminal-shop/models/card_list_params.rbs +1 -1
- data/sig/terminal-shop/models/cart_clear_params.rbs +1 -1
- data/sig/terminal-shop/models/cart_convert_params.rbs +1 -1
- data/sig/terminal-shop/models/cart_get_params.rbs +1 -1
- data/sig/terminal-shop/models/cart_set_address_params.rbs +1 -1
- data/sig/terminal-shop/models/cart_set_card_params.rbs +1 -1
- data/sig/terminal-shop/models/cart_set_item_params.rbs +1 -1
- data/sig/terminal-shop/models/email_create_params.rbs +1 -1
- data/sig/terminal-shop/models/order_create_params.rbs +1 -1
- data/sig/terminal-shop/models/order_get_params.rbs +1 -1
- data/sig/terminal-shop/models/order_list_params.rbs +1 -1
- data/sig/terminal-shop/models/product_get_params.rbs +1 -1
- data/sig/terminal-shop/models/product_list_params.rbs +1 -1
- data/sig/terminal-shop/models/profile_me_params.rbs +1 -1
- data/sig/terminal-shop/models/profile_update_params.rbs +1 -1
- data/sig/terminal-shop/models/subscription_create_params.rbs +1 -1
- data/sig/terminal-shop/models/subscription_delete_params.rbs +1 -1
- data/sig/terminal-shop/models/subscription_get_params.rbs +1 -1
- data/sig/terminal-shop/models/subscription_list_params.rbs +1 -1
- data/sig/terminal-shop/models/token_create_params.rbs +1 -1
- data/sig/terminal-shop/models/token_delete_params.rbs +1 -1
- data/sig/terminal-shop/models/token_get_params.rbs +1 -1
- data/sig/terminal-shop/models/token_list_params.rbs +1 -1
- data/sig/terminal-shop/models/view_init_params.rbs +1 -1
- data/sig/terminal-shop/request_options.rbs +0 -10
- data/sig/terminal-shop/transport/base_client.rbs +110 -0
- data/sig/terminal-shop/transport/pooled_net_requester.rbs +39 -0
- data/sig/terminal-shop/type/array_of.rbs +36 -0
- data/sig/terminal-shop/type/base_model.rbs +73 -0
- data/sig/terminal-shop/type/base_page.rbs +22 -0
- data/sig/terminal-shop/type/boolean_model.rbs +18 -0
- data/sig/terminal-shop/type/converter.rbs +42 -0
- data/sig/terminal-shop/type/enum.rbs +22 -0
- data/sig/terminal-shop/type/hash_of.rbs +36 -0
- data/sig/terminal-shop/type/request_parameters.rbs +13 -0
- data/sig/terminal-shop/type/union.rbs +40 -0
- data/sig/terminal-shop/type/unknown.rbs +18 -0
- data/sig/terminal-shop/type.rbs +22 -0
- data/sig/terminal-shop/version.rbs +1 -1
- metadata +41 -17
- data/lib/terminal-shop/base_client.rb +0 -457
- data/lib/terminal-shop/base_model.rb +0 -1201
- data/lib/terminal-shop/base_page.rb +0 -59
- data/lib/terminal-shop/extern.rb +0 -7
- data/lib/terminal-shop/pooled_net_requester.rb +0 -180
- data/rbi/lib/terminal-shop/base_client.rbi +0 -197
- data/rbi/lib/terminal-shop/base_model.rbi +0 -645
- data/rbi/lib/terminal-shop/base_page.rbi +0 -36
- data/rbi/lib/terminal-shop/extern.rbi +0 -7
- data/rbi/lib/terminal-shop/pooled_net_requester.rbi +0 -59
- data/sig/terminal-shop/base_client.rbs +0 -108
- data/sig/terminal-shop/base_model.rbs +0 -262
- data/sig/terminal-shop/base_page.rbs +0 -20
- data/sig/terminal-shop/extern.rbs +0 -4
- data/sig/terminal-shop/pooled_net_requester.rbs +0 -37
@@ -0,0 +1,101 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module TerminalShop
|
4
|
+
module Type
|
5
|
+
# @api private
|
6
|
+
module Converter
|
7
|
+
Input = T.type_alias { T.any(TerminalShop::Type::Converter, T::Class[T.anything]) }
|
8
|
+
|
9
|
+
State =
|
10
|
+
T.type_alias do
|
11
|
+
{
|
12
|
+
strictness: T.any(T::Boolean, Symbol),
|
13
|
+
exactness: {yes: Integer, no: Integer, maybe: Integer},
|
14
|
+
branched: Integer
|
15
|
+
}
|
16
|
+
end
|
17
|
+
|
18
|
+
# @api private
|
19
|
+
sig do
|
20
|
+
overridable.params(value: T.anything, state: TerminalShop::Type::Converter::State).returns(T.anything)
|
21
|
+
end
|
22
|
+
def coerce(value, state:)
|
23
|
+
end
|
24
|
+
|
25
|
+
# @api private
|
26
|
+
sig { overridable.params(value: T.anything).returns(T.anything) }
|
27
|
+
def dump(value)
|
28
|
+
end
|
29
|
+
|
30
|
+
class << self
|
31
|
+
# @api private
|
32
|
+
sig do
|
33
|
+
params(
|
34
|
+
spec: T.any(
|
35
|
+
{
|
36
|
+
const: T.nilable(T.any(NilClass, T::Boolean, Integer, Float, Symbol)),
|
37
|
+
enum: T.nilable(T.proc.returns(TerminalShop::Type::Converter::Input)),
|
38
|
+
union: T.nilable(T.proc.returns(TerminalShop::Type::Converter::Input))
|
39
|
+
},
|
40
|
+
T.proc.returns(TerminalShop::Type::Converter::Input),
|
41
|
+
TerminalShop::Type::Converter::Input
|
42
|
+
)
|
43
|
+
)
|
44
|
+
.returns(T.proc.returns(T.anything))
|
45
|
+
end
|
46
|
+
def self.type_info(spec)
|
47
|
+
end
|
48
|
+
|
49
|
+
# @api private
|
50
|
+
#
|
51
|
+
# Based on `target`, transform `value` into `target`, to the extent possible:
|
52
|
+
#
|
53
|
+
# 1. if the given `value` conforms to `target` already, return the given `value`
|
54
|
+
# 2. if it's possible and safe to convert the given `value` to `target`, then the
|
55
|
+
# converted value
|
56
|
+
# 3. otherwise, the given `value` unaltered
|
57
|
+
#
|
58
|
+
# The coercion process is subject to improvement between minor release versions.
|
59
|
+
# See https://docs.pydantic.dev/latest/concepts/unions/#smart-mode
|
60
|
+
sig do
|
61
|
+
params(
|
62
|
+
target: TerminalShop::Type::Converter::Input,
|
63
|
+
value: T.anything,
|
64
|
+
state: TerminalShop::Type::Converter::State
|
65
|
+
)
|
66
|
+
.returns(T.anything)
|
67
|
+
end
|
68
|
+
def self.coerce(
|
69
|
+
target,
|
70
|
+
value,
|
71
|
+
# The `strictness` is one of `true`, `false`, or `:strong`. This informs the
|
72
|
+
# coercion strategy when we have to decide between multiple possible conversion
|
73
|
+
# targets:
|
74
|
+
#
|
75
|
+
# - `true`: the conversion must be exact, with minimum coercion.
|
76
|
+
# - `false`: the conversion can be approximate, with some coercion.
|
77
|
+
# - `:strong`: the conversion must be exact, with no coercion, and raise an error
|
78
|
+
# if not possible.
|
79
|
+
#
|
80
|
+
# The `exactness` is `Hash` with keys being one of `yes`, `no`, or `maybe`. For
|
81
|
+
# any given conversion attempt, the exactness will be updated based on how closely
|
82
|
+
# the value recursively matches the target type:
|
83
|
+
#
|
84
|
+
# - `yes`: the value can be converted to the target type with minimum coercion.
|
85
|
+
# - `maybe`: the value can be converted to the target type with some reasonable
|
86
|
+
# coercion.
|
87
|
+
# - `no`: the value cannot be converted to the target type.
|
88
|
+
#
|
89
|
+
# See implementation below for more details.
|
90
|
+
state: {strictness: true, exactness: {yes: 0, no: 0, maybe: 0}, branched: 0}
|
91
|
+
)
|
92
|
+
end
|
93
|
+
|
94
|
+
# @api private
|
95
|
+
sig { params(target: TerminalShop::Type::Converter::Input, value: T.anything).returns(T.anything) }
|
96
|
+
def self.dump(target, value)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module TerminalShop
|
4
|
+
module Type
|
5
|
+
# @api private
|
6
|
+
#
|
7
|
+
# A value from among a specified list of options. OpenAPI enum values map to Ruby
|
8
|
+
# values in the SDK as follows:
|
9
|
+
#
|
10
|
+
# 1. boolean => true | false
|
11
|
+
# 2. integer => Integer
|
12
|
+
# 3. float => Float
|
13
|
+
# 4. string => Symbol
|
14
|
+
#
|
15
|
+
# We can therefore convert string values to Symbols, but can't convert other
|
16
|
+
# values safely.
|
17
|
+
module Enum
|
18
|
+
include TerminalShop::Type::Converter
|
19
|
+
|
20
|
+
# All of the valid Symbol values for this enum.
|
21
|
+
sig { overridable.returns(T::Array[T.any(NilClass, T::Boolean, Integer, Float, Symbol)]) }
|
22
|
+
def values
|
23
|
+
end
|
24
|
+
|
25
|
+
# @api private
|
26
|
+
#
|
27
|
+
# Guard against thread safety issues by instantiating `@values`.
|
28
|
+
sig { void }
|
29
|
+
private def finalize!
|
30
|
+
end
|
31
|
+
|
32
|
+
sig { params(other: T.anything).returns(T::Boolean) }
|
33
|
+
def ===(other)
|
34
|
+
end
|
35
|
+
|
36
|
+
sig { params(other: T.anything).returns(T::Boolean) }
|
37
|
+
def ==(other)
|
38
|
+
end
|
39
|
+
|
40
|
+
# @api private
|
41
|
+
#
|
42
|
+
# Unlike with primitives, `Enum` additionally validates that the value is a member
|
43
|
+
# of the enum.
|
44
|
+
sig do
|
45
|
+
override
|
46
|
+
.params(value: T.any(String, Symbol, T.anything), state: TerminalShop::Type::Converter::State)
|
47
|
+
.returns(T.any(Symbol, T.anything))
|
48
|
+
end
|
49
|
+
def coerce(value, state:)
|
50
|
+
end
|
51
|
+
|
52
|
+
# @api private
|
53
|
+
sig { override.params(value: T.any(Symbol, T.anything)).returns(T.any(Symbol, T.anything)) }
|
54
|
+
def dump(value)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module TerminalShop
|
4
|
+
module Type
|
5
|
+
# @api private
|
6
|
+
#
|
7
|
+
# Hash of items of a given type.
|
8
|
+
class HashOf
|
9
|
+
include TerminalShop::Type::Converter
|
10
|
+
|
11
|
+
abstract!
|
12
|
+
final!
|
13
|
+
|
14
|
+
Elem = type_member(:out)
|
15
|
+
|
16
|
+
sig(:final) do
|
17
|
+
params(
|
18
|
+
type_info: T.any(
|
19
|
+
TerminalShop::Util::AnyHash,
|
20
|
+
T.proc.returns(TerminalShop::Type::Converter::Input),
|
21
|
+
TerminalShop::Type::Converter::Input
|
22
|
+
),
|
23
|
+
spec: TerminalShop::Util::AnyHash
|
24
|
+
)
|
25
|
+
.returns(T.attached_class)
|
26
|
+
end
|
27
|
+
def self.[](type_info, spec = {})
|
28
|
+
end
|
29
|
+
|
30
|
+
sig(:final) { params(other: T.anything).returns(T::Boolean) }
|
31
|
+
def ===(other)
|
32
|
+
end
|
33
|
+
|
34
|
+
sig(:final) { params(other: T.anything).returns(T::Boolean) }
|
35
|
+
def ==(other)
|
36
|
+
end
|
37
|
+
|
38
|
+
# @api private
|
39
|
+
sig(:final) do
|
40
|
+
override
|
41
|
+
.params(
|
42
|
+
value: T.any(T::Hash[T.anything, T.anything], T.anything),
|
43
|
+
state: TerminalShop::Type::Converter::State
|
44
|
+
)
|
45
|
+
.returns(T.any(TerminalShop::Util::AnyHash, T.anything))
|
46
|
+
end
|
47
|
+
def coerce(value, state:)
|
48
|
+
end
|
49
|
+
|
50
|
+
# @api private
|
51
|
+
sig(:final) do
|
52
|
+
override
|
53
|
+
.params(value: T.any(T::Hash[T.anything, T.anything], T.anything))
|
54
|
+
.returns(T.any(TerminalShop::Util::AnyHash, T.anything))
|
55
|
+
end
|
56
|
+
def dump(value)
|
57
|
+
end
|
58
|
+
|
59
|
+
# @api private
|
60
|
+
sig(:final) { returns(Elem) }
|
61
|
+
protected def item_type
|
62
|
+
end
|
63
|
+
|
64
|
+
# @api private
|
65
|
+
sig(:final) { returns(T::Boolean) }
|
66
|
+
protected def nilable?
|
67
|
+
end
|
68
|
+
|
69
|
+
# @api private
|
70
|
+
sig(:final) do
|
71
|
+
params(
|
72
|
+
type_info: T.any(
|
73
|
+
TerminalShop::Util::AnyHash,
|
74
|
+
T.proc.returns(TerminalShop::Type::Converter::Input),
|
75
|
+
TerminalShop::Type::Converter::Input
|
76
|
+
),
|
77
|
+
spec: TerminalShop::Util::AnyHash
|
78
|
+
)
|
79
|
+
.void
|
80
|
+
end
|
81
|
+
def initialize(type_info, spec = {})
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module TerminalShop
|
4
|
+
module Type
|
5
|
+
# @api private
|
6
|
+
module RequestParameters
|
7
|
+
# Options to specify HTTP behaviour for this request.
|
8
|
+
sig { returns(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash)) }
|
9
|
+
attr_accessor :request_options
|
10
|
+
|
11
|
+
# @api private
|
12
|
+
module Converter
|
13
|
+
# @api private
|
14
|
+
sig { params(params: T.anything).returns([T.anything, TerminalShop::Util::AnyHash]) }
|
15
|
+
def dump_request(params)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module TerminalShop
|
4
|
+
module Type
|
5
|
+
# @api private
|
6
|
+
module Union
|
7
|
+
include TerminalShop::Type::Converter
|
8
|
+
|
9
|
+
# @api private
|
10
|
+
#
|
11
|
+
# All of the specified variant info for this union.
|
12
|
+
sig { returns(T::Array[[T.nilable(Symbol), T.proc.returns(TerminalShop::Type::Converter::Input)]]) }
|
13
|
+
private def known_variants
|
14
|
+
end
|
15
|
+
|
16
|
+
# @api private
|
17
|
+
sig { returns(T::Array[[T.nilable(Symbol), T.anything]]) }
|
18
|
+
protected def derefed_variants
|
19
|
+
end
|
20
|
+
|
21
|
+
# All of the specified variants for this union.
|
22
|
+
sig { overridable.returns(T::Array[T.anything]) }
|
23
|
+
def variants
|
24
|
+
end
|
25
|
+
|
26
|
+
# @api private
|
27
|
+
sig { params(property: Symbol).void }
|
28
|
+
private def discriminator(property)
|
29
|
+
end
|
30
|
+
|
31
|
+
# @api private
|
32
|
+
sig do
|
33
|
+
params(
|
34
|
+
key: T.any(Symbol, TerminalShop::Util::AnyHash, T.proc.returns(T.anything), T.anything),
|
35
|
+
spec: T.any(TerminalShop::Util::AnyHash, T.proc.returns(T.anything), T.anything)
|
36
|
+
)
|
37
|
+
.void
|
38
|
+
end
|
39
|
+
private def variant(key, spec = nil)
|
40
|
+
end
|
41
|
+
|
42
|
+
# @api private
|
43
|
+
sig { params(value: T.anything).returns(T.nilable(T.anything)) }
|
44
|
+
private def resolve_variant(value)
|
45
|
+
end
|
46
|
+
|
47
|
+
sig { params(other: T.anything).returns(T::Boolean) }
|
48
|
+
def ===(other)
|
49
|
+
end
|
50
|
+
|
51
|
+
sig { params(other: T.anything).returns(T::Boolean) }
|
52
|
+
def ==(other)
|
53
|
+
end
|
54
|
+
|
55
|
+
# @api private
|
56
|
+
sig do
|
57
|
+
override.params(value: T.anything, state: TerminalShop::Type::Converter::State).returns(T.anything)
|
58
|
+
end
|
59
|
+
def coerce(value, state:)
|
60
|
+
end
|
61
|
+
|
62
|
+
# @api private
|
63
|
+
sig { override.params(value: T.anything).returns(T.anything) }
|
64
|
+
def dump(value)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module TerminalShop
|
4
|
+
module Type
|
5
|
+
# @api private
|
6
|
+
#
|
7
|
+
# When we don't know what to expect for the value.
|
8
|
+
class Unknown
|
9
|
+
extend TerminalShop::Type::Converter
|
10
|
+
|
11
|
+
abstract!
|
12
|
+
final!
|
13
|
+
|
14
|
+
sig(:final) { params(other: T.anything).returns(T::Boolean) }
|
15
|
+
def self.===(other)
|
16
|
+
end
|
17
|
+
|
18
|
+
sig(:final) { params(other: T.anything).returns(T::Boolean) }
|
19
|
+
def self.==(other)
|
20
|
+
end
|
21
|
+
|
22
|
+
class << self
|
23
|
+
# @api private
|
24
|
+
sig(:final) do
|
25
|
+
override.params(value: T.anything, state: TerminalShop::Type::Converter::State).returns(T.anything)
|
26
|
+
end
|
27
|
+
def coerce(value, state:)
|
28
|
+
end
|
29
|
+
|
30
|
+
# @api private
|
31
|
+
sig(:final) { override.params(value: T.anything).returns(T.anything) }
|
32
|
+
def dump(value)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module TerminalShop
|
4
|
+
Unknown = TerminalShop::Type::Unknown
|
5
|
+
|
6
|
+
BooleanModel = TerminalShop::Type::BooleanModel
|
7
|
+
|
8
|
+
Enum = TerminalShop::Type::Enum
|
9
|
+
|
10
|
+
Union = TerminalShop::Type::Union
|
11
|
+
|
12
|
+
ArrayOf = TerminalShop::Type::ArrayOf
|
13
|
+
|
14
|
+
HashOf = TerminalShop::Type::HashOf
|
15
|
+
|
16
|
+
BaseModel = TerminalShop::Type::BaseModel
|
17
|
+
|
18
|
+
RequestParameters = TerminalShop::Type::RequestParameters
|
19
|
+
|
20
|
+
# This module contains various type declarations.
|
21
|
+
module Type
|
22
|
+
end
|
23
|
+
end
|
@@ -14,7 +14,7 @@ module TerminalShop
|
|
14
14
|
& TerminalShop::request_parameters
|
15
15
|
|
16
16
|
class AddressCreateParams < TerminalShop::BaseModel
|
17
|
-
extend TerminalShop::RequestParameters::Converter
|
17
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
18
18
|
include TerminalShop::RequestParameters
|
19
19
|
|
20
20
|
attr_accessor city: String
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type address_delete_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class AddressDeleteParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type address_get_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class AddressGetParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type address_list_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class AddressListParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -4,7 +4,7 @@ module TerminalShop
|
|
4
4
|
{ name: String, redirect_uri: String } & TerminalShop::request_parameters
|
5
5
|
|
6
6
|
class AppCreateParams < TerminalShop::BaseModel
|
7
|
-
extend TerminalShop::RequestParameters::Converter
|
7
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
8
8
|
include TerminalShop::RequestParameters
|
9
9
|
|
10
10
|
attr_accessor name: String
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type app_delete_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class AppDeleteParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type app_get_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class AppGetParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type app_list_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class AppListParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type card_collect_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class CardCollectParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -4,7 +4,7 @@ module TerminalShop
|
|
4
4
|
{ token: String } & TerminalShop::request_parameters
|
5
5
|
|
6
6
|
class CardCreateParams < TerminalShop::BaseModel
|
7
|
-
extend TerminalShop::RequestParameters::Converter
|
7
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
8
8
|
include TerminalShop::RequestParameters
|
9
9
|
|
10
10
|
attr_accessor token: String
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type card_delete_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class CardDeleteParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type card_get_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class CardGetParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type card_list_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class CardListParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type cart_clear_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class CartClearParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type cart_convert_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class CartConvertParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type cart_get_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class CartGetParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -4,7 +4,7 @@ module TerminalShop
|
|
4
4
|
{ address_id: String } & TerminalShop::request_parameters
|
5
5
|
|
6
6
|
class CartSetAddressParams < TerminalShop::BaseModel
|
7
|
-
extend TerminalShop::RequestParameters::Converter
|
7
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
8
8
|
include TerminalShop::RequestParameters
|
9
9
|
|
10
10
|
attr_accessor address_id: String
|
@@ -4,7 +4,7 @@ module TerminalShop
|
|
4
4
|
{ card_id: String } & TerminalShop::request_parameters
|
5
5
|
|
6
6
|
class CartSetCardParams < TerminalShop::BaseModel
|
7
|
-
extend TerminalShop::RequestParameters::Converter
|
7
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
8
8
|
include TerminalShop::RequestParameters
|
9
9
|
|
10
10
|
attr_accessor card_id: String
|
@@ -5,7 +5,7 @@ module TerminalShop
|
|
5
5
|
& TerminalShop::request_parameters
|
6
6
|
|
7
7
|
class CartSetItemParams < TerminalShop::BaseModel
|
8
|
-
extend TerminalShop::RequestParameters::Converter
|
8
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
9
9
|
include TerminalShop::RequestParameters
|
10
10
|
|
11
11
|
attr_accessor product_variant_id: String
|
@@ -4,7 +4,7 @@ module TerminalShop
|
|
4
4
|
{ email: String } & TerminalShop::request_parameters
|
5
5
|
|
6
6
|
class EmailCreateParams < TerminalShop::BaseModel
|
7
|
-
extend TerminalShop::RequestParameters::Converter
|
7
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
8
8
|
include TerminalShop::RequestParameters
|
9
9
|
|
10
10
|
attr_accessor email: String
|
@@ -5,7 +5,7 @@ module TerminalShop
|
|
5
5
|
& TerminalShop::request_parameters
|
6
6
|
|
7
7
|
class OrderCreateParams < TerminalShop::BaseModel
|
8
|
-
extend TerminalShop::RequestParameters::Converter
|
8
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
9
9
|
include TerminalShop::RequestParameters
|
10
10
|
|
11
11
|
attr_accessor address_id: String
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type order_get_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class OrderGetParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type order_list_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class OrderListParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type product_get_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class ProductGetParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type product_list_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class ProductListParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|