terminal-shop 3.7.0 → 3.8.1
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/CHANGELOG.md +42 -0
- data/README.md +81 -53
- data/SECURITY.md +2 -2
- data/lib/terminal_shop/client.rb +4 -4
- data/lib/terminal_shop/internal/transport/pooled_net_requester.rb +3 -1
- data/lib/terminal_shop/internal/type/array_of.rb +8 -0
- data/lib/terminal_shop/internal/type/base_model.rb +15 -0
- data/lib/terminal_shop/internal/type/boolean.rb +8 -0
- data/lib/terminal_shop/internal/type/enum.rb +12 -0
- data/lib/terminal_shop/internal/type/file_input.rb +7 -0
- data/lib/terminal_shop/internal/type/hash_of.rb +8 -0
- data/lib/terminal_shop/internal/type/union.rb +12 -0
- data/lib/terminal_shop/internal/type/unknown.rb +8 -0
- data/lib/terminal_shop/internal/util.rb +50 -1
- data/lib/terminal_shop/internal.rb +3 -0
- data/lib/terminal_shop/models/address.rb +2 -2
- data/lib/terminal_shop/models/address_get_response.rb +2 -2
- data/lib/terminal_shop/models/address_list_response.rb +2 -2
- data/lib/terminal_shop/models/app.rb +2 -2
- data/lib/terminal_shop/models/app_get_response.rb +2 -2
- data/lib/terminal_shop/models/app_list_response.rb +2 -2
- data/lib/terminal_shop/models/card.rb +5 -5
- data/lib/terminal_shop/models/card_get_response.rb +2 -2
- data/lib/terminal_shop/models/card_list_response.rb +2 -2
- data/lib/terminal_shop/models/cart.rb +9 -9
- data/lib/terminal_shop/models/cart_convert_response.rb +2 -2
- data/lib/terminal_shop/models/cart_get_response.rb +2 -2
- data/lib/terminal_shop/models/cart_set_item_response.rb +2 -2
- data/lib/terminal_shop/models/order.rb +17 -17
- data/lib/terminal_shop/models/order_get_response.rb +2 -2
- data/lib/terminal_shop/models/order_list_response.rb +2 -2
- data/lib/terminal_shop/models/product.rb +10 -10
- data/lib/terminal_shop/models/product_get_response.rb +2 -2
- data/lib/terminal_shop/models/product_list_response.rb +2 -2
- data/lib/terminal_shop/models/product_variant.rb +4 -4
- data/lib/terminal_shop/models/profile.rb +4 -4
- data/lib/terminal_shop/models/profile_me_response.rb +2 -2
- data/lib/terminal_shop/models/profile_update_response.rb +2 -2
- data/lib/terminal_shop/models/subscription.rb +5 -14
- data/lib/terminal_shop/models/subscription_get_response.rb +2 -2
- data/lib/terminal_shop/models/subscription_list_response.rb +2 -2
- data/lib/terminal_shop/models/subscription_update_params.rb +3 -12
- data/lib/terminal_shop/models/subscription_update_response.rb +2 -2
- data/lib/terminal_shop/models/token.rb +2 -2
- data/lib/terminal_shop/models/token_get_response.rb +2 -2
- data/lib/terminal_shop/models/token_list_response.rb +2 -2
- data/lib/terminal_shop/models/view_init_response.rb +20 -20
- data/lib/terminal_shop/models.rb +30 -19
- data/lib/terminal_shop/resources/subscription.rb +2 -2
- data/lib/terminal_shop/version.rb +1 -1
- data/rbi/terminal_shop/internal/transport/pooled_net_requester.rbi +5 -1
- data/rbi/terminal_shop/internal/type/array_of.rbi +6 -0
- data/rbi/terminal_shop/internal/type/base_model.rbi +5 -0
- data/rbi/terminal_shop/internal/type/boolean.rbi +6 -0
- data/rbi/terminal_shop/internal/type/enum.rbi +5 -0
- data/rbi/terminal_shop/internal/type/file_input.rbi +5 -0
- data/rbi/terminal_shop/internal/type/hash_of.rbi +6 -0
- data/rbi/terminal_shop/internal/type/union.rbi +5 -0
- data/rbi/terminal_shop/internal/type/unknown.rbi +6 -0
- data/rbi/terminal_shop/internal/util.rbi +34 -0
- data/rbi/terminal_shop/internal.rbi +5 -0
- data/rbi/terminal_shop/models/subscription.rbi +2 -13
- data/sig/terminal_shop/internal/transport/pooled_net_requester.rbs +2 -0
- data/sig/terminal_shop/internal/type/array_of.rbs +3 -0
- data/sig/terminal_shop/internal/type/base_model.rbs +2 -0
- data/sig/terminal_shop/internal/type/boolean.rbs +3 -0
- data/sig/terminal_shop/internal/type/enum.rbs +2 -0
- data/sig/terminal_shop/internal/type/file_input.rbs +2 -0
- data/sig/terminal_shop/internal/type/hash_of.rbs +3 -0
- data/sig/terminal_shop/internal/type/union.rbs +2 -0
- data/sig/terminal_shop/internal/type/unknown.rbs +3 -0
- data/sig/terminal_shop/internal/util.rbs +12 -0
- data/sig/terminal_shop/internal.rbs +2 -0
- data/sig/terminal_shop/models/address.rbs +13 -0
- data/sig/terminal_shop/models/address_create_params.rbs +12 -0
- data/sig/terminal_shop/models/address_create_response.rbs +2 -0
- data/sig/terminal_shop/models/address_delete_params.rbs +2 -0
- data/sig/terminal_shop/models/address_delete_response.rbs +2 -0
- data/sig/terminal_shop/models/address_get_params.rbs +2 -0
- data/sig/terminal_shop/models/address_get_response.rbs +2 -0
- data/sig/terminal_shop/models/address_list_params.rbs +2 -0
- data/sig/terminal_shop/models/address_list_response.rbs +2 -0
- data/sig/terminal_shop/models/app.rbs +7 -0
- data/sig/terminal_shop/models/app_create_params.rbs +6 -0
- data/sig/terminal_shop/models/app_create_response.rbs +4 -0
- data/sig/terminal_shop/models/app_delete_params.rbs +2 -0
- data/sig/terminal_shop/models/app_delete_response.rbs +2 -0
- data/sig/terminal_shop/models/app_get_params.rbs +2 -0
- data/sig/terminal_shop/models/app_get_response.rbs +2 -0
- data/sig/terminal_shop/models/app_list_params.rbs +2 -0
- data/sig/terminal_shop/models/app_list_response.rbs +2 -0
- data/sig/terminal_shop/models/card.rbs +10 -0
- data/sig/terminal_shop/models/card_collect_params.rbs +2 -0
- data/sig/terminal_shop/models/card_collect_response.rbs +4 -0
- data/sig/terminal_shop/models/card_create_params.rbs +5 -0
- data/sig/terminal_shop/models/card_create_response.rbs +2 -0
- data/sig/terminal_shop/models/card_delete_params.rbs +2 -0
- data/sig/terminal_shop/models/card_delete_response.rbs +2 -0
- data/sig/terminal_shop/models/card_get_params.rbs +2 -0
- data/sig/terminal_shop/models/card_get_response.rbs +2 -0
- data/sig/terminal_shop/models/card_list_params.rbs +2 -0
- data/sig/terminal_shop/models/card_list_response.rbs +2 -0
- data/sig/terminal_shop/models/cart.rbs +20 -0
- data/sig/terminal_shop/models/cart_clear_params.rbs +2 -0
- data/sig/terminal_shop/models/cart_clear_response.rbs +2 -0
- data/sig/terminal_shop/models/cart_convert_params.rbs +2 -0
- data/sig/terminal_shop/models/cart_convert_response.rbs +2 -0
- data/sig/terminal_shop/models/cart_get_params.rbs +2 -0
- data/sig/terminal_shop/models/cart_get_response.rbs +2 -0
- data/sig/terminal_shop/models/cart_set_address_params.rbs +5 -0
- data/sig/terminal_shop/models/cart_set_address_response.rbs +2 -0
- data/sig/terminal_shop/models/cart_set_card_params.rbs +5 -0
- data/sig/terminal_shop/models/cart_set_card_response.rbs +2 -0
- data/sig/terminal_shop/models/cart_set_item_params.rbs +6 -0
- data/sig/terminal_shop/models/cart_set_item_response.rbs +2 -0
- data/sig/terminal_shop/models/email_create_params.rbs +5 -0
- data/sig/terminal_shop/models/email_create_response.rbs +2 -0
- data/sig/terminal_shop/models/order.rbs +46 -6
- data/sig/terminal_shop/models/order_create_params.rbs +7 -0
- data/sig/terminal_shop/models/order_create_response.rbs +2 -0
- data/sig/terminal_shop/models/order_get_params.rbs +2 -0
- data/sig/terminal_shop/models/order_get_response.rbs +2 -0
- data/sig/terminal_shop/models/order_list_params.rbs +2 -0
- data/sig/terminal_shop/models/order_list_response.rbs +2 -0
- data/sig/terminal_shop/models/product.rbs +25 -6
- data/sig/terminal_shop/models/product_get_params.rbs +2 -0
- data/sig/terminal_shop/models/product_get_response.rbs +2 -0
- data/sig/terminal_shop/models/product_list_params.rbs +2 -0
- data/sig/terminal_shop/models/product_list_response.rbs +2 -0
- data/sig/terminal_shop/models/product_variant.rbs +15 -0
- data/sig/terminal_shop/models/profile.rbs +10 -0
- data/sig/terminal_shop/models/profile_me_params.rbs +2 -0
- data/sig/terminal_shop/models/profile_me_response.rbs +2 -0
- data/sig/terminal_shop/models/profile_update_params.rbs +6 -0
- data/sig/terminal_shop/models/profile_update_response.rbs +2 -0
- data/sig/terminal_shop/models/subscription.rbs +22 -6
- data/sig/terminal_shop/models/subscription_create_params.rbs +2 -0
- data/sig/terminal_shop/models/subscription_create_response.rbs +2 -0
- data/sig/terminal_shop/models/subscription_delete_params.rbs +2 -0
- data/sig/terminal_shop/models/subscription_delete_response.rbs +2 -0
- data/sig/terminal_shop/models/subscription_get_params.rbs +2 -0
- data/sig/terminal_shop/models/subscription_get_response.rbs +2 -0
- data/sig/terminal_shop/models/subscription_list_params.rbs +2 -0
- data/sig/terminal_shop/models/subscription_list_response.rbs +2 -0
- data/sig/terminal_shop/models/subscription_update_params.rbs +11 -0
- data/sig/terminal_shop/models/subscription_update_response.rbs +2 -0
- data/sig/terminal_shop/models/token.rbs +2 -0
- data/sig/terminal_shop/models/token_create_params.rbs +2 -0
- data/sig/terminal_shop/models/token_create_response.rbs +4 -0
- data/sig/terminal_shop/models/token_delete_params.rbs +2 -0
- data/sig/terminal_shop/models/token_delete_response.rbs +2 -0
- data/sig/terminal_shop/models/token_get_params.rbs +2 -0
- data/sig/terminal_shop/models/token_get_response.rbs +2 -0
- data/sig/terminal_shop/models/token_list_params.rbs +2 -0
- data/sig/terminal_shop/models/token_list_response.rbs +2 -0
- data/sig/terminal_shop/models/view_init_params.rbs +2 -0
- data/sig/terminal_shop/models/view_init_response.rbs +15 -0
- metadata +2 -2
@@ -7,11 +7,11 @@ module TerminalShop
|
|
7
7
|
# @!attribute data
|
8
8
|
# Subscription to a Terminal shop product.
|
9
9
|
#
|
10
|
-
# @return [TerminalShop::SubscriptionAPI]
|
10
|
+
# @return [TerminalShop::Models::SubscriptionAPI]
|
11
11
|
required :data, -> { TerminalShop::SubscriptionAPI }
|
12
12
|
|
13
13
|
# @!method initialize(data:)
|
14
|
-
# @param data [TerminalShop::SubscriptionAPI] Subscription to a Terminal shop product.
|
14
|
+
# @param data [TerminalShop::Models::SubscriptionAPI] Subscription to a Terminal shop product.
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -22,8 +22,8 @@ module TerminalShop
|
|
22
22
|
required :created, String
|
23
23
|
|
24
24
|
# @!method initialize(id:, token:, created:)
|
25
|
-
# Some parameter documentations has been truncated, see
|
26
|
-
# for more details.
|
25
|
+
# Some parameter documentations has been truncated, see
|
26
|
+
# {TerminalShop::Models::TokenAPI} for more details.
|
27
27
|
#
|
28
28
|
# A personal access token used to access the Terminal API. If you leak this,
|
29
29
|
# expect large sums of coffee to be ordered on your credit card.
|
@@ -8,14 +8,14 @@ module TerminalShop
|
|
8
8
|
# A personal access token used to access the Terminal API. If you leak this,
|
9
9
|
# expect large sums of coffee to be ordered on your credit card.
|
10
10
|
#
|
11
|
-
# @return [TerminalShop::TokenAPI]
|
11
|
+
# @return [TerminalShop::Models::TokenAPI]
|
12
12
|
required :data, -> { TerminalShop::TokenAPI }
|
13
13
|
|
14
14
|
# @!method initialize(data:)
|
15
15
|
# Some parameter documentations has been truncated, see
|
16
16
|
# {TerminalShop::Models::TokenGetResponse} for more details.
|
17
17
|
#
|
18
|
-
# @param data [TerminalShop::TokenAPI] A personal access token used to access the Terminal API. If you leak this, expec
|
18
|
+
# @param data [TerminalShop::Models::TokenAPI] A personal access token used to access the Terminal API. If you leak this, expec
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -7,11 +7,11 @@ module TerminalShop
|
|
7
7
|
# @!attribute data
|
8
8
|
# List of personal access tokens.
|
9
9
|
#
|
10
|
-
# @return [Array<TerminalShop::TokenAPI>]
|
10
|
+
# @return [Array<TerminalShop::Models::TokenAPI>]
|
11
11
|
required :data, -> { TerminalShop::Internal::Type::ArrayOf[TerminalShop::TokenAPI] }
|
12
12
|
|
13
13
|
# @!method initialize(data:)
|
14
|
-
# @param data [Array<TerminalShop::TokenAPI>] List of personal access tokens.
|
14
|
+
# @param data [Array<TerminalShop::Models::TokenAPI>] List of personal access tokens.
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -17,79 +17,79 @@ module TerminalShop
|
|
17
17
|
class Data < TerminalShop::Internal::Type::BaseModel
|
18
18
|
# @!attribute addresses
|
19
19
|
#
|
20
|
-
# @return [Array<TerminalShop::AddressAPI>]
|
20
|
+
# @return [Array<TerminalShop::Models::AddressAPI>]
|
21
21
|
required :addresses, -> { TerminalShop::Internal::Type::ArrayOf[TerminalShop::AddressAPI] }
|
22
22
|
|
23
23
|
# @!attribute apps
|
24
24
|
#
|
25
|
-
# @return [Array<TerminalShop::AppAPI>]
|
25
|
+
# @return [Array<TerminalShop::Models::AppAPI>]
|
26
26
|
required :apps, -> { TerminalShop::Internal::Type::ArrayOf[TerminalShop::AppAPI] }
|
27
27
|
|
28
28
|
# @!attribute cards
|
29
29
|
#
|
30
|
-
# @return [Array<TerminalShop::CardAPI>]
|
30
|
+
# @return [Array<TerminalShop::Models::CardAPI>]
|
31
31
|
required :cards, -> { TerminalShop::Internal::Type::ArrayOf[TerminalShop::CardAPI] }
|
32
32
|
|
33
33
|
# @!attribute cart
|
34
34
|
# The current Terminal shop user's cart.
|
35
35
|
#
|
36
|
-
# @return [TerminalShop::CartAPI]
|
36
|
+
# @return [TerminalShop::Models::CartAPI]
|
37
37
|
required :cart, -> { TerminalShop::CartAPI }
|
38
38
|
|
39
39
|
# @!attribute orders
|
40
40
|
#
|
41
|
-
# @return [Array<TerminalShop::OrderAPI>]
|
41
|
+
# @return [Array<TerminalShop::Models::OrderAPI>]
|
42
42
|
required :orders, -> { TerminalShop::Internal::Type::ArrayOf[TerminalShop::OrderAPI] }
|
43
43
|
|
44
44
|
# @!attribute products
|
45
45
|
#
|
46
|
-
# @return [Array<TerminalShop::ProductAPI>]
|
46
|
+
# @return [Array<TerminalShop::Models::ProductAPI>]
|
47
47
|
required :products, -> { TerminalShop::Internal::Type::ArrayOf[TerminalShop::ProductAPI] }
|
48
48
|
|
49
49
|
# @!attribute profile
|
50
50
|
# A Terminal shop user's profile. (We have users, btw.)
|
51
51
|
#
|
52
|
-
# @return [TerminalShop::ProfileAPI]
|
52
|
+
# @return [TerminalShop::Models::ProfileAPI]
|
53
53
|
required :profile, -> { TerminalShop::ProfileAPI }
|
54
54
|
|
55
55
|
# @!attribute region
|
56
56
|
# A Terminal shop user's region.
|
57
57
|
#
|
58
|
-
# @return [Symbol, TerminalShop::Region]
|
58
|
+
# @return [Symbol, TerminalShop::Models::Region]
|
59
59
|
required :region, enum: -> { TerminalShop::Region }
|
60
60
|
|
61
61
|
# @!attribute subscriptions
|
62
62
|
#
|
63
|
-
# @return [Array<TerminalShop::SubscriptionAPI>]
|
63
|
+
# @return [Array<TerminalShop::Models::SubscriptionAPI>]
|
64
64
|
required :subscriptions, -> { TerminalShop::Internal::Type::ArrayOf[TerminalShop::SubscriptionAPI] }
|
65
65
|
|
66
66
|
# @!attribute tokens
|
67
67
|
#
|
68
|
-
# @return [Array<TerminalShop::TokenAPI>]
|
68
|
+
# @return [Array<TerminalShop::Models::TokenAPI>]
|
69
69
|
required :tokens, -> { TerminalShop::Internal::Type::ArrayOf[TerminalShop::TokenAPI] }
|
70
70
|
|
71
71
|
# @!method initialize(addresses:, apps:, cards:, cart:, orders:, products:, profile:, region:, subscriptions:, tokens:)
|
72
72
|
# Initial app data.
|
73
73
|
#
|
74
|
-
# @param addresses [Array<TerminalShop::AddressAPI>]
|
74
|
+
# @param addresses [Array<TerminalShop::Models::AddressAPI>]
|
75
75
|
#
|
76
|
-
# @param apps [Array<TerminalShop::AppAPI>]
|
76
|
+
# @param apps [Array<TerminalShop::Models::AppAPI>]
|
77
77
|
#
|
78
|
-
# @param cards [Array<TerminalShop::CardAPI>]
|
78
|
+
# @param cards [Array<TerminalShop::Models::CardAPI>]
|
79
79
|
#
|
80
|
-
# @param cart [TerminalShop::CartAPI] The current Terminal shop user's cart.
|
80
|
+
# @param cart [TerminalShop::Models::CartAPI] The current Terminal shop user's cart.
|
81
81
|
#
|
82
|
-
# @param orders [Array<TerminalShop::OrderAPI>]
|
82
|
+
# @param orders [Array<TerminalShop::Models::OrderAPI>]
|
83
83
|
#
|
84
|
-
# @param products [Array<TerminalShop::ProductAPI>]
|
84
|
+
# @param products [Array<TerminalShop::Models::ProductAPI>]
|
85
85
|
#
|
86
|
-
# @param profile [TerminalShop::ProfileAPI] A Terminal shop user's profile. (We have users, btw.)
|
86
|
+
# @param profile [TerminalShop::Models::ProfileAPI] A Terminal shop user's profile. (We have users, btw.)
|
87
87
|
#
|
88
|
-
# @param region [Symbol, TerminalShop::Region] A Terminal shop user's region.
|
88
|
+
# @param region [Symbol, TerminalShop::Models::Region] A Terminal shop user's region.
|
89
89
|
#
|
90
|
-
# @param subscriptions [Array<TerminalShop::SubscriptionAPI>]
|
90
|
+
# @param subscriptions [Array<TerminalShop::Models::SubscriptionAPI>]
|
91
91
|
#
|
92
|
-
# @param tokens [Array<TerminalShop::TokenAPI>]
|
92
|
+
# @param tokens [Array<TerminalShop::Models::TokenAPI>]
|
93
93
|
end
|
94
94
|
end
|
95
95
|
end
|
data/lib/terminal_shop/models.rb
CHANGED
@@ -5,29 +5,40 @@ module TerminalShop
|
|
5
5
|
cls.define_sorbet_constant!(:OrHash) { T.type_alias { T.any(cls, TerminalShop::Internal::AnyHash) } }
|
6
6
|
end
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
8
|
+
TerminalShop::Internal::Util.walk_namespaces(TerminalShop::Models).each do |mod|
|
9
|
+
case mod
|
10
|
+
in TerminalShop::Internal::Type::Enum | TerminalShop::Internal::Type::Union
|
11
|
+
mod.constants.each do |name|
|
12
|
+
case mod.const_get(name)
|
13
|
+
in true | false
|
14
|
+
mod.define_sorbet_constant!(:TaggedBoolean) { T.type_alias { T.all(T::Boolean, mod) } }
|
15
|
+
mod.define_sorbet_constant!(:OrBoolean) { T.type_alias { T::Boolean } }
|
16
|
+
in Integer
|
17
|
+
mod.define_sorbet_constant!(:TaggedInteger) { T.type_alias { T.all(Integer, mod) } }
|
18
|
+
mod.define_sorbet_constant!(:OrInteger) { T.type_alias { Integer } }
|
19
|
+
in Float
|
20
|
+
mod.define_sorbet_constant!(:TaggedFloat) { T.type_alias { T.all(Float, mod) } }
|
21
|
+
mod.define_sorbet_constant!(:OrFloat) { T.type_alias { Float } }
|
22
|
+
in Symbol
|
23
|
+
mod.define_sorbet_constant!(:TaggedSymbol) { T.type_alias { T.all(Symbol, mod) } }
|
24
|
+
mod.define_sorbet_constant!(:OrSymbol) { T.type_alias { T.any(Symbol, String) } }
|
25
|
+
else
|
26
|
+
end
|
27
27
|
end
|
28
|
+
else
|
28
29
|
end
|
29
30
|
end
|
30
31
|
|
32
|
+
TerminalShop::Internal::Util.walk_namespaces(TerminalShop::Models)
|
33
|
+
.lazy
|
34
|
+
.grep(TerminalShop::Internal::Type::Union)
|
35
|
+
.each do |mod|
|
36
|
+
const = :Variants
|
37
|
+
next if mod.sorbet_constant_defined?(const)
|
38
|
+
|
39
|
+
mod.define_sorbet_constant!(const) { T.type_alias { mod.to_sorbet_type } }
|
40
|
+
end
|
41
|
+
|
31
42
|
AddressAPI = TerminalShop::Models::AddressAPI
|
32
43
|
|
33
44
|
AddressCreateParams = TerminalShop::Models::AddressCreateParams
|
@@ -26,7 +26,7 @@ module TerminalShop
|
|
26
26
|
#
|
27
27
|
# @param next_ [String] Next shipment and billing date for the subscription.
|
28
28
|
#
|
29
|
-
# @param schedule [TerminalShop::SubscriptionAPI::Schedule::Fixed, TerminalShop::SubscriptionAPI::Schedule::Weekly] Schedule of the subscription.
|
29
|
+
# @param schedule [TerminalShop::Models::SubscriptionAPI::Schedule::Fixed, TerminalShop::Models::SubscriptionAPI::Schedule::Weekly] Schedule of the subscription.
|
30
30
|
#
|
31
31
|
# @param request_options [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil]
|
32
32
|
#
|
@@ -54,7 +54,7 @@ module TerminalShop
|
|
54
54
|
#
|
55
55
|
# @param card_id [String] New payment method ID for the subscription.
|
56
56
|
#
|
57
|
-
# @param schedule [TerminalShop::SubscriptionUpdateParams::Schedule::Fixed, TerminalShop::SubscriptionUpdateParams::Schedule::Weekly] New schedule for the subscription.
|
57
|
+
# @param schedule [TerminalShop::Models::SubscriptionUpdateParams::Schedule::Fixed, TerminalShop::Models::SubscriptionUpdateParams::Schedule::Weekly] New schedule for the subscription.
|
58
58
|
#
|
59
59
|
# @param request_options [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil]
|
60
60
|
#
|
@@ -22,6 +22,8 @@ module TerminalShop
|
|
22
22
|
# https://github.com/golang/go/blob/c8eced8580028328fde7c03cbfcb720ce15b2358/src/net/http/transport.go#L49
|
23
23
|
KEEP_ALIVE_TIMEOUT = 30
|
24
24
|
|
25
|
+
DEFAULT_MAX_CONNECTIONS = T.let(T.unsafe(nil), Integer)
|
26
|
+
|
25
27
|
class << self
|
26
28
|
# @api private
|
27
29
|
sig { params(url: URI::Generic).returns(Net::HTTP) }
|
@@ -68,7 +70,9 @@ module TerminalShop
|
|
68
70
|
|
69
71
|
# @api private
|
70
72
|
sig { params(size: Integer).returns(T.attached_class) }
|
71
|
-
def self.new(
|
73
|
+
def self.new(
|
74
|
+
size: TerminalShop::Internal::Transport::PooledNetRequester::DEFAULT_MAX_CONNECTIONS
|
75
|
+
)
|
72
76
|
end
|
73
77
|
end
|
74
78
|
end
|
@@ -8,6 +8,7 @@ module TerminalShop
|
|
8
8
|
# Array of items of a given type.
|
9
9
|
class ArrayOf
|
10
10
|
include TerminalShop::Internal::Type::Converter
|
11
|
+
include TerminalShop::Internal::Util::SorbetRuntimeSupport
|
11
12
|
|
12
13
|
abstract!
|
13
14
|
|
@@ -63,6 +64,11 @@ module TerminalShop
|
|
63
64
|
def dump(value, state:)
|
64
65
|
end
|
65
66
|
|
67
|
+
# @api private
|
68
|
+
sig { returns(T.anything) }
|
69
|
+
def to_sorbet_type
|
70
|
+
end
|
71
|
+
|
66
72
|
# @api private
|
67
73
|
sig { returns(Elem) }
|
68
74
|
protected def item_type
|
@@ -8,6 +8,7 @@ module TerminalShop
|
|
8
8
|
# Ruby has no Boolean class; this is something for models to refer to.
|
9
9
|
class Boolean
|
10
10
|
extend TerminalShop::Internal::Type::Converter
|
11
|
+
extend TerminalShop::Internal::Util::SorbetRuntimeSupport
|
11
12
|
|
12
13
|
abstract!
|
13
14
|
|
@@ -43,6 +44,11 @@ module TerminalShop
|
|
43
44
|
end
|
44
45
|
def dump(value, state:)
|
45
46
|
end
|
47
|
+
|
48
|
+
# @api private
|
49
|
+
sig { returns(T.anything) }
|
50
|
+
def to_sorbet_type
|
51
|
+
end
|
46
52
|
end
|
47
53
|
end
|
48
54
|
end
|
@@ -8,6 +8,7 @@ module TerminalShop
|
|
8
8
|
# Hash of items of a given type.
|
9
9
|
class HashOf
|
10
10
|
include TerminalShop::Internal::Type::Converter
|
11
|
+
include TerminalShop::Internal::Util::SorbetRuntimeSupport
|
11
12
|
|
12
13
|
abstract!
|
13
14
|
|
@@ -63,6 +64,11 @@ module TerminalShop
|
|
63
64
|
def dump(value, state:)
|
64
65
|
end
|
65
66
|
|
67
|
+
# @api private
|
68
|
+
sig { returns(T.anything) }
|
69
|
+
def to_sorbet_type
|
70
|
+
end
|
71
|
+
|
66
72
|
# @api private
|
67
73
|
sig { returns(Elem) }
|
68
74
|
protected def item_type
|
@@ -8,6 +8,7 @@ module TerminalShop
|
|
8
8
|
# When we don't know what to expect for the value.
|
9
9
|
class Unknown
|
10
10
|
extend TerminalShop::Internal::Type::Converter
|
11
|
+
extend TerminalShop::Internal::Util::SorbetRuntimeSupport
|
11
12
|
|
12
13
|
abstract!
|
13
14
|
|
@@ -43,6 +44,11 @@ module TerminalShop
|
|
43
44
|
end
|
44
45
|
def dump(value, state:)
|
45
46
|
end
|
47
|
+
|
48
|
+
# @api private
|
49
|
+
sig { returns(T.anything) }
|
50
|
+
def to_sorbet_type
|
51
|
+
end
|
46
52
|
end
|
47
53
|
end
|
48
54
|
end
|
@@ -11,6 +11,15 @@ module TerminalShop
|
|
11
11
|
def self.monotonic_secs
|
12
12
|
end
|
13
13
|
|
14
|
+
# @api private
|
15
|
+
sig do
|
16
|
+
params(ns: T.any(Module, T::Class[T.anything])).returns(
|
17
|
+
T::Enumerable[T.any(Module, T::Class[T.anything])]
|
18
|
+
)
|
19
|
+
end
|
20
|
+
def self.walk_namespaces(ns)
|
21
|
+
end
|
22
|
+
|
14
23
|
class << self
|
15
24
|
# @api private
|
16
25
|
sig { returns(String) }
|
@@ -441,10 +450,35 @@ module TerminalShop
|
|
441
450
|
def const_missing(name)
|
442
451
|
end
|
443
452
|
|
453
|
+
# @api private
|
454
|
+
sig { params(name: Symbol).returns(T::Boolean) }
|
455
|
+
def sorbet_constant_defined?(name)
|
456
|
+
end
|
457
|
+
|
444
458
|
# @api private
|
445
459
|
sig { params(name: Symbol, blk: T.proc.returns(T.anything)).void }
|
446
460
|
def define_sorbet_constant!(name, &blk)
|
447
461
|
end
|
462
|
+
|
463
|
+
# @api private
|
464
|
+
sig { returns(T.anything) }
|
465
|
+
def to_sorbet_type
|
466
|
+
end
|
467
|
+
|
468
|
+
class << self
|
469
|
+
# @api private
|
470
|
+
sig do
|
471
|
+
params(
|
472
|
+
type:
|
473
|
+
T.any(
|
474
|
+
TerminalShop::Internal::Util::SorbetRuntimeSupport,
|
475
|
+
T.anything
|
476
|
+
)
|
477
|
+
).returns(T.anything)
|
478
|
+
end
|
479
|
+
def to_sorbet_type(type)
|
480
|
+
end
|
481
|
+
end
|
448
482
|
end
|
449
483
|
end
|
450
484
|
end
|
@@ -8,6 +8,11 @@ module TerminalShop
|
|
8
8
|
# this alias might be refined in the future.
|
9
9
|
AnyHash = T.type_alias { T::Hash[Symbol, T.anything] }
|
10
10
|
|
11
|
+
FileInput =
|
12
|
+
T.type_alias do
|
13
|
+
T.any(Pathname, StringIO, IO, String, TerminalShop::FilePart)
|
14
|
+
end
|
15
|
+
|
11
16
|
OMIT = T.let(Object.new.freeze, T.anything)
|
12
17
|
end
|
13
18
|
end
|
@@ -45,14 +45,7 @@ module TerminalShop
|
|
45
45
|
|
46
46
|
# Schedule of the subscription.
|
47
47
|
sig do
|
48
|
-
returns(
|
49
|
-
T.nilable(
|
50
|
-
T.any(
|
51
|
-
TerminalShop::SubscriptionAPI::Schedule::Fixed,
|
52
|
-
TerminalShop::SubscriptionAPI::Schedule::Weekly
|
53
|
-
)
|
54
|
-
)
|
55
|
-
)
|
48
|
+
returns(T.nilable(TerminalShop::SubscriptionAPI::Schedule::Variants))
|
56
49
|
end
|
57
50
|
attr_reader :schedule
|
58
51
|
|
@@ -118,11 +111,7 @@ module TerminalShop
|
|
118
111
|
product_variant_id: String,
|
119
112
|
quantity: Integer,
|
120
113
|
next_: String,
|
121
|
-
schedule:
|
122
|
-
T.any(
|
123
|
-
TerminalShop::SubscriptionAPI::Schedule::Fixed,
|
124
|
-
TerminalShop::SubscriptionAPI::Schedule::Weekly
|
125
|
-
)
|
114
|
+
schedule: TerminalShop::SubscriptionAPI::Schedule::Variants
|
126
115
|
}
|
127
116
|
)
|
128
117
|
end
|
@@ -3,6 +3,7 @@ module TerminalShop
|
|
3
3
|
module Type
|
4
4
|
class ArrayOf[Elem]
|
5
5
|
include TerminalShop::Internal::Type::Converter
|
6
|
+
include TerminalShop::Internal::Util::SorbetRuntimeSupport
|
6
7
|
|
7
8
|
def self.[]: (
|
8
9
|
::Hash[Symbol, top]
|
@@ -27,6 +28,8 @@ module TerminalShop
|
|
27
28
|
state: TerminalShop::Internal::Type::Converter::dump_state
|
28
29
|
) -> (::Array[top] | top)
|
29
30
|
|
31
|
+
def to_sorbet_type: -> top
|
32
|
+
|
30
33
|
def item_type: -> Elem
|
31
34
|
|
32
35
|
def nilable?: -> bool
|
@@ -3,6 +3,7 @@ module TerminalShop
|
|
3
3
|
module Type
|
4
4
|
class Boolean
|
5
5
|
extend TerminalShop::Internal::Type::Converter
|
6
|
+
extend TerminalShop::Internal::Util::SorbetRuntimeSupport
|
6
7
|
|
7
8
|
def self.===: (top other) -> bool
|
8
9
|
|
@@ -17,6 +18,8 @@ module TerminalShop
|
|
17
18
|
bool | top value,
|
18
19
|
state: TerminalShop::Internal::Type::Converter::dump_state
|
19
20
|
) -> (bool | top)
|
21
|
+
|
22
|
+
def self.to_sorbet_type: -> top
|
20
23
|
end
|
21
24
|
end
|
22
25
|
end
|
@@ -3,6 +3,7 @@ module TerminalShop
|
|
3
3
|
module Type
|
4
4
|
class HashOf[Elem]
|
5
5
|
include TerminalShop::Internal::Type::Converter
|
6
|
+
include TerminalShop::Internal::Util::SorbetRuntimeSupport
|
6
7
|
|
7
8
|
def self.[]: (
|
8
9
|
::Hash[Symbol, top]
|
@@ -27,6 +28,8 @@ module TerminalShop
|
|
27
28
|
state: TerminalShop::Internal::Type::Converter::dump_state
|
28
29
|
) -> (::Hash[Symbol, top] | top)
|
29
30
|
|
31
|
+
def to_sorbet_type: -> top
|
32
|
+
|
30
33
|
def item_type: -> Elem
|
31
34
|
|
32
35
|
def nilable?: -> bool
|
@@ -3,6 +3,7 @@ module TerminalShop
|
|
3
3
|
module Type
|
4
4
|
class Unknown
|
5
5
|
extend TerminalShop::Internal::Type::Converter
|
6
|
+
extend TerminalShop::Internal::Util::SorbetRuntimeSupport
|
6
7
|
|
7
8
|
def self.===: (top other) -> bool
|
8
9
|
|
@@ -17,6 +18,8 @@ module TerminalShop
|
|
17
18
|
top value,
|
18
19
|
state: TerminalShop::Internal::Type::Converter::dump_state
|
19
20
|
) -> top
|
21
|
+
|
22
|
+
def self.to_sorbet_type: -> top
|
20
23
|
end
|
21
24
|
end
|
22
25
|
end
|
@@ -5,6 +5,10 @@ module TerminalShop
|
|
5
5
|
|
6
6
|
def self?.monotonic_secs: -> Float
|
7
7
|
|
8
|
+
def self?.walk_namespaces: (
|
9
|
+
Module | Class ns
|
10
|
+
) -> Enumerable[(Module | Class)]
|
11
|
+
|
8
12
|
def self?.arch: -> String
|
9
13
|
|
10
14
|
def self?.os: -> String
|
@@ -166,7 +170,15 @@ module TerminalShop
|
|
166
170
|
|
167
171
|
def const_missing: (Symbol name) -> void
|
168
172
|
|
173
|
+
def sorbet_constant_defined?: (Symbol name) -> bool
|
174
|
+
|
169
175
|
def define_sorbet_constant!: (Symbol name) { -> top } -> void
|
176
|
+
|
177
|
+
def to_sorbet_type: -> top
|
178
|
+
|
179
|
+
def self.to_sorbet_type: (
|
180
|
+
TerminalShop::Internal::Util::SorbetRuntimeSupport | top `type`
|
181
|
+
) -> top
|
170
182
|
end
|
171
183
|
end
|
172
184
|
end
|