terminal-shop 1.8.0 → 2.0.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 +14 -0
- data/lib/terminal-shop/base_client.rb +11 -10
- data/lib/terminal-shop/base_model.rb +257 -244
- data/lib/terminal-shop/base_page.rb +19 -20
- data/lib/terminal-shop/client.rb +1 -0
- data/lib/terminal-shop/models/product.rb +7 -3
- data/lib/terminal-shop/models/region.rb +7 -3
- data/lib/terminal-shop/models/subscription.rb +5 -7
- data/lib/terminal-shop/pooled_net_requester.rb +12 -1
- data/lib/terminal-shop/request_options.rb +1 -1
- data/lib/terminal-shop/util.rb +16 -7
- data/lib/terminal-shop/version.rb +1 -1
- data/lib/terminal-shop.rb +15 -0
- data/rbi/lib/terminal-shop/base_client.rbi +40 -41
- data/rbi/lib/terminal-shop/base_model.rbi +139 -116
- data/rbi/lib/terminal-shop/base_page.rbi +0 -2
- data/rbi/lib/terminal-shop/client.rbi +18 -30
- data/rbi/lib/terminal-shop/errors.rbi +7 -42
- data/rbi/lib/terminal-shop/models/address.rbi +15 -51
- data/rbi/lib/terminal-shop/models/address_create_params.rbi +15 -46
- data/rbi/lib/terminal-shop/models/address_create_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/address_delete_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/address_delete_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/address_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/address_get_response.rbi +7 -6
- data/rbi/lib/terminal-shop/models/address_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/address_list_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/app.rbi +4 -24
- data/rbi/lib/terminal-shop/models/app_create_params.rbi +3 -13
- data/rbi/lib/terminal-shop/models/app_create_response.rbi +8 -20
- data/rbi/lib/terminal-shop/models/app_delete_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/app_delete_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/app_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/app_get_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/app_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/app_list_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/card.rbi +14 -36
- data/rbi/lib/terminal-shop/models/card_collect_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/card_collect_response.rbi +7 -14
- data/rbi/lib/terminal-shop/models/card_create_params.rbi +2 -7
- data/rbi/lib/terminal-shop/models/card_create_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/card_delete_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/card_delete_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/card_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/card_get_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/card_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/card_list_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/cart.rbi +34 -88
- data/rbi/lib/terminal-shop/models/cart_clear_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/cart_clear_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/cart_convert_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/cart_convert_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/cart_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/cart_get_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/cart_set_address_params.rbi +2 -7
- data/rbi/lib/terminal-shop/models/cart_set_address_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/cart_set_card_params.rbi +2 -7
- data/rbi/lib/terminal-shop/models/cart_set_card_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/cart_set_item_params.rbi +3 -13
- data/rbi/lib/terminal-shop/models/cart_set_item_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/email_create_params.rbi +2 -7
- data/rbi/lib/terminal-shop/models/email_create_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/order.rbi +52 -139
- data/rbi/lib/terminal-shop/models/order_create_params.rbi +4 -19
- data/rbi/lib/terminal-shop/models/order_create_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/order_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/order_get_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/order_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/order_list_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/product.rbi +43 -77
- data/rbi/lib/terminal-shop/models/product_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/product_get_response.rbi +7 -6
- data/rbi/lib/terminal-shop/models/product_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/product_list_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/product_variant.rbi +3 -18
- data/rbi/lib/terminal-shop/models/profile.rbi +12 -36
- data/rbi/lib/terminal-shop/models/profile_me_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/profile_me_response.rbi +7 -6
- data/rbi/lib/terminal-shop/models/profile_update_params.rbi +3 -13
- data/rbi/lib/terminal-shop/models/profile_update_response.rbi +7 -6
- data/rbi/lib/terminal-shop/models/region.rbi +10 -5
- data/rbi/lib/terminal-shop/models/subscription.rbi +28 -75
- data/rbi/lib/terminal-shop/models/subscription_create_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/subscription_create_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/subscription_delete_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/subscription_delete_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/subscription_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/subscription_get_response.rbi +7 -6
- data/rbi/lib/terminal-shop/models/subscription_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/subscription_list_response.rbi +3 -8
- data/rbi/lib/terminal-shop/models/token.rbi +3 -18
- data/rbi/lib/terminal-shop/models/token_create_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/token_create_response.rbi +8 -20
- data/rbi/lib/terminal-shop/models/token_delete_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/token_delete_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/token_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/token_get_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/token_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/token_list_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/view_init_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/view_init_response.rbi +32 -81
- data/rbi/lib/terminal-shop/pooled_net_requester.rbi +14 -3
- data/rbi/lib/terminal-shop/request_options.rbi +11 -55
- data/rbi/lib/terminal-shop/resources/address.rbi +4 -4
- data/rbi/lib/terminal-shop/resources/app.rbi +4 -4
- data/rbi/lib/terminal-shop/resources/card.rbi +5 -5
- data/rbi/lib/terminal-shop/resources/cart.rbi +6 -6
- data/rbi/lib/terminal-shop/resources/email.rbi +1 -1
- data/rbi/lib/terminal-shop/resources/order.rbi +3 -3
- data/rbi/lib/terminal-shop/resources/product.rbi +2 -2
- data/rbi/lib/terminal-shop/resources/profile.rbi +2 -2
- data/rbi/lib/terminal-shop/resources/subscription.rbi +5 -4
- data/rbi/lib/terminal-shop/resources/token.rbi +4 -4
- data/rbi/lib/terminal-shop/resources/view.rbi +1 -1
- data/rbi/lib/terminal-shop/util.rbi +24 -13
- data/rbi/lib/terminal-shop/version.rbi +1 -1
- data/sig/terminal-shop/base_client.rbs +14 -14
- data/sig/terminal-shop/base_model.rbs +34 -18
- data/sig/terminal-shop/client.rbs +8 -8
- data/sig/terminal-shop/errors.rbs +17 -17
- data/sig/terminal-shop/models/address.rbs +11 -15
- data/sig/terminal-shop/models/address_create_params.rbs +11 -16
- data/sig/terminal-shop/models/address_create_response.rbs +1 -6
- data/sig/terminal-shop/models/address_delete_params.rbs +1 -6
- data/sig/terminal-shop/models/address_delete_response.rbs +1 -6
- data/sig/terminal-shop/models/address_get_params.rbs +1 -6
- data/sig/terminal-shop/models/address_get_response.rbs +1 -6
- data/sig/terminal-shop/models/address_list_params.rbs +1 -6
- data/sig/terminal-shop/models/address_list_response.rbs +1 -6
- data/sig/terminal-shop/models/app.rbs +6 -5
- data/sig/terminal-shop/models/app_create_params.rbs +5 -10
- data/sig/terminal-shop/models/app_create_response.rbs +4 -12
- data/sig/terminal-shop/models/app_delete_params.rbs +1 -6
- data/sig/terminal-shop/models/app_delete_response.rbs +1 -6
- data/sig/terminal-shop/models/app_get_params.rbs +1 -5
- data/sig/terminal-shop/models/app_get_response.rbs +1 -5
- data/sig/terminal-shop/models/app_list_params.rbs +1 -5
- data/sig/terminal-shop/models/app_list_response.rbs +1 -6
- data/sig/terminal-shop/models/card.rbs +7 -16
- data/sig/terminal-shop/models/card_collect_params.rbs +1 -6
- data/sig/terminal-shop/models/card_collect_response.rbs +4 -12
- data/sig/terminal-shop/models/card_create_params.rbs +4 -6
- data/sig/terminal-shop/models/card_create_response.rbs +1 -6
- data/sig/terminal-shop/models/card_delete_params.rbs +1 -6
- data/sig/terminal-shop/models/card_delete_response.rbs +1 -6
- data/sig/terminal-shop/models/card_get_params.rbs +1 -5
- data/sig/terminal-shop/models/card_get_response.rbs +1 -6
- data/sig/terminal-shop/models/card_list_params.rbs +1 -5
- data/sig/terminal-shop/models/card_list_response.rbs +1 -6
- data/sig/terminal-shop/models/cart.rbs +20 -34
- data/sig/terminal-shop/models/cart_clear_params.rbs +1 -6
- data/sig/terminal-shop/models/cart_clear_response.rbs +1 -6
- data/sig/terminal-shop/models/cart_convert_params.rbs +1 -6
- data/sig/terminal-shop/models/cart_convert_response.rbs +1 -6
- data/sig/terminal-shop/models/cart_get_params.rbs +1 -5
- data/sig/terminal-shop/models/cart_get_response.rbs +1 -6
- data/sig/terminal-shop/models/cart_set_address_params.rbs +4 -9
- data/sig/terminal-shop/models/cart_set_address_response.rbs +1 -6
- data/sig/terminal-shop/models/cart_set_card_params.rbs +4 -6
- data/sig/terminal-shop/models/cart_set_card_response.rbs +1 -6
- data/sig/terminal-shop/models/cart_set_item_params.rbs +5 -10
- data/sig/terminal-shop/models/cart_set_item_response.rbs +1 -6
- data/sig/terminal-shop/models/email_create_params.rbs +4 -6
- data/sig/terminal-shop/models/email_create_response.rbs +1 -6
- data/sig/terminal-shop/models/order.rbs +31 -50
- data/sig/terminal-shop/models/order_create_params.rbs +6 -11
- data/sig/terminal-shop/models/order_create_response.rbs +1 -6
- data/sig/terminal-shop/models/order_get_params.rbs +1 -5
- data/sig/terminal-shop/models/order_get_response.rbs +1 -6
- data/sig/terminal-shop/models/order_list_params.rbs +1 -6
- data/sig/terminal-shop/models/order_list_response.rbs +1 -6
- data/sig/terminal-shop/models/product.rbs +20 -27
- data/sig/terminal-shop/models/product_get_params.rbs +1 -6
- data/sig/terminal-shop/models/product_get_response.rbs +1 -6
- data/sig/terminal-shop/models/product_list_params.rbs +1 -6
- data/sig/terminal-shop/models/product_list_response.rbs +1 -6
- data/sig/terminal-shop/models/product_variant.rbs +1 -5
- data/sig/terminal-shop/models/profile.rbs +8 -17
- data/sig/terminal-shop/models/profile_me_params.rbs +1 -6
- data/sig/terminal-shop/models/profile_me_response.rbs +1 -6
- data/sig/terminal-shop/models/profile_update_params.rbs +5 -10
- data/sig/terminal-shop/models/profile_update_response.rbs +1 -6
- data/sig/terminal-shop/models/region.rbs +4 -2
- data/sig/terminal-shop/models/subscription.rbs +15 -27
- data/sig/terminal-shop/models/subscription_create_params.rbs +1 -6
- data/sig/terminal-shop/models/subscription_create_response.rbs +1 -6
- data/sig/terminal-shop/models/subscription_delete_params.rbs +1 -6
- data/sig/terminal-shop/models/subscription_delete_response.rbs +1 -6
- data/sig/terminal-shop/models/subscription_get_params.rbs +1 -6
- data/sig/terminal-shop/models/subscription_get_response.rbs +1 -6
- data/sig/terminal-shop/models/subscription_list_params.rbs +1 -6
- data/sig/terminal-shop/models/subscription_list_response.rbs +3 -6
- data/sig/terminal-shop/models/token.rbs +1 -5
- data/sig/terminal-shop/models/token_create_params.rbs +1 -6
- data/sig/terminal-shop/models/token_create_response.rbs +4 -12
- data/sig/terminal-shop/models/token_delete_params.rbs +1 -6
- data/sig/terminal-shop/models/token_delete_response.rbs +1 -6
- data/sig/terminal-shop/models/token_get_params.rbs +1 -5
- data/sig/terminal-shop/models/token_get_response.rbs +1 -6
- data/sig/terminal-shop/models/token_list_params.rbs +1 -6
- data/sig/terminal-shop/models/token_list_response.rbs +1 -6
- data/sig/terminal-shop/models/view_init_params.rbs +1 -5
- data/sig/terminal-shop/models/view_init_response.rbs +15 -23
- data/sig/terminal-shop/pooled_net_requester.rbs +3 -1
- data/sig/terminal-shop/request_options.rbs +2 -2
- data/sig/terminal-shop/resources/address.rbs +22 -41
- data/sig/terminal-shop/resources/app.rbs +16 -34
- data/sig/terminal-shop/resources/card.rbs +18 -40
- data/sig/terminal-shop/resources/cart.rbs +22 -47
- data/sig/terminal-shop/resources/email.rbs +4 -8
- data/sig/terminal-shop/resources/order.rbs +13 -26
- data/sig/terminal-shop/resources/product.rbs +7 -16
- data/sig/terminal-shop/resources/profile.rbs +8 -16
- data/sig/terminal-shop/resources/subscription.rbs +21 -43
- data/sig/terminal-shop/resources/token.rbs +14 -32
- data/sig/terminal-shop/resources/view.rbs +3 -7
- data/sig/terminal-shop/util.rbs +5 -5
- data/sig/terminal-shop/version.rbs +1 -1
- metadata +2 -2
@@ -5,30 +5,15 @@ module TerminalShop
|
|
5
5
|
class ProductVariant < TerminalShop::BaseModel
|
6
6
|
# Unique object identifier. The format and length of IDs may change over time.
|
7
7
|
sig { returns(String) }
|
8
|
-
|
9
|
-
end
|
10
|
-
|
11
|
-
sig { params(_: String).returns(String) }
|
12
|
-
def id=(_)
|
13
|
-
end
|
8
|
+
attr_accessor :id
|
14
9
|
|
15
10
|
# Name of the product variant.
|
16
11
|
sig { returns(String) }
|
17
|
-
|
18
|
-
end
|
19
|
-
|
20
|
-
sig { params(_: String).returns(String) }
|
21
|
-
def name=(_)
|
22
|
-
end
|
12
|
+
attr_accessor :name
|
23
13
|
|
24
14
|
# Price of the product variant in cents (USD).
|
25
15
|
sig { returns(Integer) }
|
26
|
-
|
27
|
-
end
|
28
|
-
|
29
|
-
sig { params(_: Integer).returns(Integer) }
|
30
|
-
def price=(_)
|
31
|
-
end
|
16
|
+
attr_accessor :price
|
32
17
|
|
33
18
|
# Variant of a product in the Terminal shop.
|
34
19
|
sig { params(id: String, name: String, price: Integer).returns(T.attached_class) }
|
@@ -5,15 +5,16 @@ module TerminalShop
|
|
5
5
|
class ProfileAPI < TerminalShop::BaseModel
|
6
6
|
# A Terminal shop user. (We have users, btw.)
|
7
7
|
sig { returns(TerminalShop::Models::ProfileAPI::User) }
|
8
|
-
|
9
|
-
end
|
8
|
+
attr_reader :user
|
10
9
|
|
11
|
-
sig { params(
|
12
|
-
|
13
|
-
end
|
10
|
+
sig { params(user: T.any(TerminalShop::Models::ProfileAPI::User, TerminalShop::Util::AnyHash)).void }
|
11
|
+
attr_writer :user
|
14
12
|
|
15
13
|
# A Terminal shop user's profile. (We have users, btw.)
|
16
|
-
sig
|
14
|
+
sig do
|
15
|
+
params(user: T.any(TerminalShop::Models::ProfileAPI::User, TerminalShop::Util::AnyHash))
|
16
|
+
.returns(T.attached_class)
|
17
|
+
end
|
17
18
|
def self.new(user:)
|
18
19
|
end
|
19
20
|
|
@@ -24,48 +25,23 @@ module TerminalShop
|
|
24
25
|
class User < TerminalShop::BaseModel
|
25
26
|
# Unique object identifier. The format and length of IDs may change over time.
|
26
27
|
sig { returns(String) }
|
27
|
-
|
28
|
-
end
|
29
|
-
|
30
|
-
sig { params(_: String).returns(String) }
|
31
|
-
def id=(_)
|
32
|
-
end
|
28
|
+
attr_accessor :id
|
33
29
|
|
34
30
|
# Email address of the user.
|
35
31
|
sig { returns(T.nilable(String)) }
|
36
|
-
|
37
|
-
end
|
38
|
-
|
39
|
-
sig { params(_: T.nilable(String)).returns(T.nilable(String)) }
|
40
|
-
def email=(_)
|
41
|
-
end
|
32
|
+
attr_accessor :email
|
42
33
|
|
43
34
|
# The user's fingerprint, derived from their public SSH key.
|
44
35
|
sig { returns(T.nilable(String)) }
|
45
|
-
|
46
|
-
end
|
47
|
-
|
48
|
-
sig { params(_: T.nilable(String)).returns(T.nilable(String)) }
|
49
|
-
def fingerprint=(_)
|
50
|
-
end
|
36
|
+
attr_accessor :fingerprint
|
51
37
|
|
52
38
|
# Name of the user.
|
53
39
|
sig { returns(T.nilable(String)) }
|
54
|
-
|
55
|
-
end
|
56
|
-
|
57
|
-
sig { params(_: T.nilable(String)).returns(T.nilable(String)) }
|
58
|
-
def name=(_)
|
59
|
-
end
|
40
|
+
attr_accessor :name
|
60
41
|
|
61
42
|
# Stripe customer ID of the user.
|
62
43
|
sig { returns(String) }
|
63
|
-
|
64
|
-
end
|
65
|
-
|
66
|
-
sig { params(_: String).returns(String) }
|
67
|
-
def stripe_customer_id=(_)
|
68
|
-
end
|
44
|
+
attr_accessor :stripe_customer_id
|
69
45
|
|
70
46
|
# A Terminal shop user. (We have users, btw.)
|
71
47
|
sig do
|
@@ -7,7 +7,7 @@ module TerminalShop
|
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
sig do
|
10
|
-
params(request_options: T.any(TerminalShop::RequestOptions,
|
10
|
+
params(request_options: T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
11
11
|
.returns(T.attached_class)
|
12
12
|
end
|
13
13
|
def self.new(request_options: {})
|
@@ -5,14 +5,15 @@ module TerminalShop
|
|
5
5
|
class ProfileMeResponse < TerminalShop::BaseModel
|
6
6
|
# A Terminal shop user's profile. (We have users, btw.)
|
7
7
|
sig { returns(TerminalShop::Models::ProfileAPI) }
|
8
|
-
|
9
|
-
end
|
8
|
+
attr_reader :data
|
10
9
|
|
11
|
-
sig { params(
|
12
|
-
|
13
|
-
end
|
10
|
+
sig { params(data: T.any(TerminalShop::Models::ProfileAPI, TerminalShop::Util::AnyHash)).void }
|
11
|
+
attr_writer :data
|
14
12
|
|
15
|
-
sig
|
13
|
+
sig do
|
14
|
+
params(data: T.any(TerminalShop::Models::ProfileAPI, TerminalShop::Util::AnyHash))
|
15
|
+
.returns(T.attached_class)
|
16
|
+
end
|
16
17
|
def self.new(data:)
|
17
18
|
end
|
18
19
|
|
@@ -7,26 +7,16 @@ module TerminalShop
|
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
sig { returns(String) }
|
10
|
-
|
11
|
-
end
|
12
|
-
|
13
|
-
sig { params(_: String).returns(String) }
|
14
|
-
def email=(_)
|
15
|
-
end
|
10
|
+
attr_accessor :email
|
16
11
|
|
17
12
|
sig { returns(String) }
|
18
|
-
|
19
|
-
end
|
20
|
-
|
21
|
-
sig { params(_: String).returns(String) }
|
22
|
-
def name=(_)
|
23
|
-
end
|
13
|
+
attr_accessor :name
|
24
14
|
|
25
15
|
sig do
|
26
16
|
params(
|
27
17
|
email: String,
|
28
18
|
name: String,
|
29
|
-
request_options: T.any(TerminalShop::RequestOptions,
|
19
|
+
request_options: T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash)
|
30
20
|
)
|
31
21
|
.returns(T.attached_class)
|
32
22
|
end
|
@@ -5,14 +5,15 @@ module TerminalShop
|
|
5
5
|
class ProfileUpdateResponse < TerminalShop::BaseModel
|
6
6
|
# A Terminal shop user's profile. (We have users, btw.)
|
7
7
|
sig { returns(TerminalShop::Models::ProfileAPI) }
|
8
|
-
|
9
|
-
end
|
8
|
+
attr_reader :data
|
10
9
|
|
11
|
-
sig { params(
|
12
|
-
|
13
|
-
end
|
10
|
+
sig { params(data: T.any(TerminalShop::Models::ProfileAPI, TerminalShop::Util::AnyHash)).void }
|
11
|
+
attr_writer :data
|
14
12
|
|
15
|
-
sig
|
13
|
+
sig do
|
14
|
+
params(data: T.any(TerminalShop::Models::ProfileAPI, TerminalShop::Util::AnyHash))
|
15
|
+
.returns(T.attached_class)
|
16
|
+
end
|
16
17
|
def self.new(data:)
|
17
18
|
end
|
18
19
|
|
@@ -3,13 +3,18 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
module Models
|
5
5
|
# A Terminal shop user's region.
|
6
|
-
|
7
|
-
|
6
|
+
module Region
|
7
|
+
extend TerminalShop::Enum
|
8
8
|
|
9
|
-
|
9
|
+
TaggedSymbol = T.type_alias { T.all(Symbol, TerminalShop::Models::Region) }
|
10
|
+
OrSymbol = T.type_alias { T.any(Symbol, TerminalShop::Models::Region::TaggedSymbol) }
|
10
11
|
|
11
|
-
EU = :eu
|
12
|
-
NA = :na
|
12
|
+
EU = T.let(:eu, TerminalShop::Models::Region::TaggedSymbol)
|
13
|
+
NA = T.let(:na, TerminalShop::Models::Region::TaggedSymbol)
|
14
|
+
|
15
|
+
sig { override.returns(T::Array[TerminalShop::Models::Region::TaggedSymbol]) }
|
16
|
+
def self.values
|
17
|
+
end
|
13
18
|
end
|
14
19
|
end
|
15
20
|
end
|
@@ -5,57 +5,30 @@ module TerminalShop
|
|
5
5
|
class SubscriptionAPI < TerminalShop::BaseModel
|
6
6
|
# Unique object identifier. The format and length of IDs may change over time.
|
7
7
|
sig { returns(String) }
|
8
|
-
|
9
|
-
end
|
10
|
-
|
11
|
-
sig { params(_: String).returns(String) }
|
12
|
-
def id=(_)
|
13
|
-
end
|
8
|
+
attr_accessor :id
|
14
9
|
|
15
10
|
# ID of the shipping address used for the subscription.
|
16
11
|
sig { returns(String) }
|
17
|
-
|
18
|
-
end
|
19
|
-
|
20
|
-
sig { params(_: String).returns(String) }
|
21
|
-
def address_id=(_)
|
22
|
-
end
|
12
|
+
attr_accessor :address_id
|
23
13
|
|
24
14
|
# ID of the card used for the subscription.
|
25
15
|
sig { returns(String) }
|
26
|
-
|
27
|
-
end
|
28
|
-
|
29
|
-
sig { params(_: String).returns(String) }
|
30
|
-
def card_id=(_)
|
31
|
-
end
|
16
|
+
attr_accessor :card_id
|
32
17
|
|
33
18
|
# ID of the product variant being subscribed to.
|
34
19
|
sig { returns(String) }
|
35
|
-
|
36
|
-
end
|
37
|
-
|
38
|
-
sig { params(_: String).returns(String) }
|
39
|
-
def product_variant_id=(_)
|
40
|
-
end
|
20
|
+
attr_accessor :product_variant_id
|
41
21
|
|
42
22
|
# Quantity of the subscription.
|
43
23
|
sig { returns(Integer) }
|
44
|
-
|
45
|
-
end
|
46
|
-
|
47
|
-
sig { params(_: Integer).returns(Integer) }
|
48
|
-
def quantity=(_)
|
49
|
-
end
|
24
|
+
attr_accessor :quantity
|
50
25
|
|
51
26
|
# Next shipment and billing date for the subscription.
|
52
27
|
sig { returns(T.nilable(String)) }
|
53
|
-
|
54
|
-
end
|
28
|
+
attr_reader :next_
|
55
29
|
|
56
|
-
sig { params(
|
57
|
-
|
58
|
-
end
|
30
|
+
sig { params(next_: String).void }
|
31
|
+
attr_writer :next_
|
59
32
|
|
60
33
|
# Schedule of the subscription.
|
61
34
|
sig do
|
@@ -68,25 +41,19 @@ module TerminalShop
|
|
68
41
|
)
|
69
42
|
)
|
70
43
|
end
|
71
|
-
|
72
|
-
end
|
44
|
+
attr_reader :schedule
|
73
45
|
|
74
46
|
sig do
|
75
47
|
params(
|
76
|
-
|
48
|
+
schedule: T.any(
|
77
49
|
TerminalShop::Models::SubscriptionAPI::Schedule::Fixed,
|
50
|
+
TerminalShop::Util::AnyHash,
|
78
51
|
TerminalShop::Models::SubscriptionAPI::Schedule::Weekly
|
79
52
|
)
|
80
53
|
)
|
81
|
-
.
|
82
|
-
T.any(
|
83
|
-
TerminalShop::Models::SubscriptionAPI::Schedule::Fixed,
|
84
|
-
TerminalShop::Models::SubscriptionAPI::Schedule::Weekly
|
85
|
-
)
|
86
|
-
)
|
87
|
-
end
|
88
|
-
def schedule=(_)
|
54
|
+
.void
|
89
55
|
end
|
56
|
+
attr_writer :schedule
|
90
57
|
|
91
58
|
# Subscription to a Terminal shop product.
|
92
59
|
sig do
|
@@ -99,6 +66,7 @@ module TerminalShop
|
|
99
66
|
next_: String,
|
100
67
|
schedule: T.any(
|
101
68
|
TerminalShop::Models::SubscriptionAPI::Schedule::Fixed,
|
69
|
+
TerminalShop::Util::AnyHash,
|
102
70
|
TerminalShop::Models::SubscriptionAPI::Schedule::Weekly
|
103
71
|
)
|
104
72
|
)
|
@@ -128,26 +96,12 @@ module TerminalShop
|
|
128
96
|
end
|
129
97
|
|
130
98
|
# Schedule of the subscription.
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
Variants = type_template(:out) do
|
135
|
-
{
|
136
|
-
fixed: T.any(
|
137
|
-
TerminalShop::Models::SubscriptionAPI::Schedule::Fixed,
|
138
|
-
TerminalShop::Models::SubscriptionAPI::Schedule::Weekly
|
139
|
-
)
|
140
|
-
}
|
141
|
-
end
|
99
|
+
module Schedule
|
100
|
+
extend TerminalShop::Union
|
142
101
|
|
143
102
|
class Fixed < TerminalShop::BaseModel
|
144
103
|
sig { returns(Symbol) }
|
145
|
-
|
146
|
-
end
|
147
|
-
|
148
|
-
sig { params(_: Symbol).returns(Symbol) }
|
149
|
-
def type=(_)
|
150
|
-
end
|
104
|
+
attr_accessor :type
|
151
105
|
|
152
106
|
sig { params(type: Symbol).returns(T.attached_class) }
|
153
107
|
def self.new(type: :fixed)
|
@@ -160,20 +114,10 @@ module TerminalShop
|
|
160
114
|
|
161
115
|
class Weekly < TerminalShop::BaseModel
|
162
116
|
sig { returns(Integer) }
|
163
|
-
|
164
|
-
end
|
165
|
-
|
166
|
-
sig { params(_: Integer).returns(Integer) }
|
167
|
-
def interval=(_)
|
168
|
-
end
|
117
|
+
attr_accessor :interval
|
169
118
|
|
170
119
|
sig { returns(Symbol) }
|
171
|
-
|
172
|
-
end
|
173
|
-
|
174
|
-
sig { params(_: Symbol).returns(Symbol) }
|
175
|
-
def type=(_)
|
176
|
-
end
|
120
|
+
attr_accessor :type
|
177
121
|
|
178
122
|
sig { params(interval: Integer, type: Symbol).returns(T.attached_class) }
|
179
123
|
def self.new(interval:, type: :weekly)
|
@@ -183,6 +127,15 @@ module TerminalShop
|
|
183
127
|
def to_hash
|
184
128
|
end
|
185
129
|
end
|
130
|
+
|
131
|
+
sig do
|
132
|
+
override
|
133
|
+
.returns(
|
134
|
+
[TerminalShop::Models::SubscriptionAPI::Schedule::Fixed, TerminalShop::Models::SubscriptionAPI::Schedule::Weekly]
|
135
|
+
)
|
136
|
+
end
|
137
|
+
def self.variants
|
138
|
+
end
|
186
139
|
end
|
187
140
|
end
|
188
141
|
end
|
@@ -7,7 +7,7 @@ module TerminalShop
|
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
sig do
|
10
|
-
params(request_options: T.any(TerminalShop::RequestOptions,
|
10
|
+
params(request_options: T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
11
11
|
.returns(T.attached_class)
|
12
12
|
end
|
13
13
|
def self.new(request_options: {})
|
@@ -4,12 +4,7 @@ module TerminalShop
|
|
4
4
|
module Models
|
5
5
|
class SubscriptionCreateResponse < TerminalShop::BaseModel
|
6
6
|
sig { returns(Symbol) }
|
7
|
-
|
8
|
-
end
|
9
|
-
|
10
|
-
sig { params(_: Symbol).returns(Symbol) }
|
11
|
-
def data=(_)
|
12
|
-
end
|
7
|
+
attr_accessor :data
|
13
8
|
|
14
9
|
sig { params(data: Symbol).returns(T.attached_class) }
|
15
10
|
def self.new(data: :ok)
|
@@ -7,7 +7,7 @@ module TerminalShop
|
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
sig do
|
10
|
-
params(request_options: T.any(TerminalShop::RequestOptions,
|
10
|
+
params(request_options: T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
11
11
|
.returns(T.attached_class)
|
12
12
|
end
|
13
13
|
def self.new(request_options: {})
|
@@ -4,12 +4,7 @@ module TerminalShop
|
|
4
4
|
module Models
|
5
5
|
class SubscriptionDeleteResponse < TerminalShop::BaseModel
|
6
6
|
sig { returns(Symbol) }
|
7
|
-
|
8
|
-
end
|
9
|
-
|
10
|
-
sig { params(_: Symbol).returns(Symbol) }
|
11
|
-
def data=(_)
|
12
|
-
end
|
7
|
+
attr_accessor :data
|
13
8
|
|
14
9
|
sig { params(data: Symbol).returns(T.attached_class) }
|
15
10
|
def self.new(data: :ok)
|
@@ -7,7 +7,7 @@ module TerminalShop
|
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
sig do
|
10
|
-
params(request_options: T.any(TerminalShop::RequestOptions,
|
10
|
+
params(request_options: T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
11
11
|
.returns(T.attached_class)
|
12
12
|
end
|
13
13
|
def self.new(request_options: {})
|
@@ -5,14 +5,15 @@ module TerminalShop
|
|
5
5
|
class SubscriptionGetResponse < TerminalShop::BaseModel
|
6
6
|
# Subscription to a Terminal shop product.
|
7
7
|
sig { returns(TerminalShop::Models::SubscriptionAPI) }
|
8
|
-
|
9
|
-
end
|
8
|
+
attr_reader :data
|
10
9
|
|
11
|
-
sig { params(
|
12
|
-
|
13
|
-
end
|
10
|
+
sig { params(data: T.any(TerminalShop::Models::SubscriptionAPI, TerminalShop::Util::AnyHash)).void }
|
11
|
+
attr_writer :data
|
14
12
|
|
15
|
-
sig
|
13
|
+
sig do
|
14
|
+
params(data: T.any(TerminalShop::Models::SubscriptionAPI, TerminalShop::Util::AnyHash))
|
15
|
+
.returns(T.attached_class)
|
16
|
+
end
|
16
17
|
def self.new(data:)
|
17
18
|
end
|
18
19
|
|
@@ -7,7 +7,7 @@ module TerminalShop
|
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
sig do
|
10
|
-
params(request_options: T.any(TerminalShop::RequestOptions,
|
10
|
+
params(request_options: T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
11
11
|
.returns(T.attached_class)
|
12
12
|
end
|
13
13
|
def self.new(request_options: {})
|
@@ -5,17 +5,12 @@ module TerminalShop
|
|
5
5
|
class SubscriptionListResponse < TerminalShop::BaseModel
|
6
6
|
# List of subscriptions.
|
7
7
|
sig { returns(T::Array[TerminalShop::Models::SubscriptionAPI]) }
|
8
|
-
|
9
|
-
end
|
8
|
+
attr_accessor :data
|
10
9
|
|
11
10
|
sig do
|
12
|
-
params(
|
13
|
-
.returns(T
|
14
|
-
end
|
15
|
-
def data=(_)
|
11
|
+
params(data: T::Array[T.any(TerminalShop::Models::SubscriptionAPI, TerminalShop::Util::AnyHash)])
|
12
|
+
.returns(T.attached_class)
|
16
13
|
end
|
17
|
-
|
18
|
-
sig { params(data: T::Array[TerminalShop::Models::SubscriptionAPI]).returns(T.attached_class) }
|
19
14
|
def self.new(data:)
|
20
15
|
end
|
21
16
|
|
@@ -5,30 +5,15 @@ module TerminalShop
|
|
5
5
|
class TokenAPI < TerminalShop::BaseModel
|
6
6
|
# Unique object identifier. The format and length of IDs may change over time.
|
7
7
|
sig { returns(String) }
|
8
|
-
|
9
|
-
end
|
10
|
-
|
11
|
-
sig { params(_: String).returns(String) }
|
12
|
-
def id=(_)
|
13
|
-
end
|
8
|
+
attr_accessor :id
|
14
9
|
|
15
10
|
# Personal access token (obfuscated).
|
16
11
|
sig { returns(String) }
|
17
|
-
|
18
|
-
end
|
19
|
-
|
20
|
-
sig { params(_: String).returns(String) }
|
21
|
-
def token=(_)
|
22
|
-
end
|
12
|
+
attr_accessor :token
|
23
13
|
|
24
14
|
# The created time for the token.
|
25
15
|
sig { returns(String) }
|
26
|
-
|
27
|
-
end
|
28
|
-
|
29
|
-
sig { params(_: String).returns(String) }
|
30
|
-
def created=(_)
|
31
|
-
end
|
16
|
+
attr_accessor :created
|
32
17
|
|
33
18
|
# A personal access token used to access the Terminal API. If you leak this,
|
34
19
|
# expect large sums of coffee to be ordered on your credit card.
|
@@ -7,7 +7,7 @@ module TerminalShop
|
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
sig do
|
10
|
-
params(request_options: T.any(TerminalShop::RequestOptions,
|
10
|
+
params(request_options: T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
11
11
|
.returns(T.attached_class)
|
12
12
|
end
|
13
13
|
def self.new(request_options: {})
|
@@ -4,17 +4,15 @@ module TerminalShop
|
|
4
4
|
module Models
|
5
5
|
class TokenCreateResponse < TerminalShop::BaseModel
|
6
6
|
sig { returns(TerminalShop::Models::TokenCreateResponse::Data) }
|
7
|
-
|
8
|
-
|
7
|
+
attr_reader :data
|
8
|
+
|
9
|
+
sig { params(data: T.any(TerminalShop::Models::TokenCreateResponse::Data, TerminalShop::Util::AnyHash)).void }
|
10
|
+
attr_writer :data
|
9
11
|
|
10
12
|
sig do
|
11
|
-
params(
|
12
|
-
.returns(
|
13
|
-
end
|
14
|
-
def data=(_)
|
13
|
+
params(data: T.any(TerminalShop::Models::TokenCreateResponse::Data, TerminalShop::Util::AnyHash))
|
14
|
+
.returns(T.attached_class)
|
15
15
|
end
|
16
|
-
|
17
|
-
sig { params(data: TerminalShop::Models::TokenCreateResponse::Data).returns(T.attached_class) }
|
18
16
|
def self.new(data:)
|
19
17
|
end
|
20
18
|
|
@@ -25,22 +23,12 @@ module TerminalShop
|
|
25
23
|
class Data < TerminalShop::BaseModel
|
26
24
|
# Personal token ID.
|
27
25
|
sig { returns(String) }
|
28
|
-
|
29
|
-
end
|
30
|
-
|
31
|
-
sig { params(_: String).returns(String) }
|
32
|
-
def id=(_)
|
33
|
-
end
|
26
|
+
attr_accessor :id
|
34
27
|
|
35
28
|
# Personal access token. Include this in the Authorization header
|
36
29
|
# (`Bearer <token>`) when accessing the Terminal API.
|
37
30
|
sig { returns(String) }
|
38
|
-
|
39
|
-
end
|
40
|
-
|
41
|
-
sig { params(_: String).returns(String) }
|
42
|
-
def token=(_)
|
43
|
-
end
|
31
|
+
attr_accessor :token
|
44
32
|
|
45
33
|
sig { params(id: String, token: String).returns(T.attached_class) }
|
46
34
|
def self.new(id:, token:)
|
@@ -7,7 +7,7 @@ module TerminalShop
|
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
sig do
|
10
|
-
params(request_options: T.any(TerminalShop::RequestOptions,
|
10
|
+
params(request_options: T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
11
11
|
.returns(T.attached_class)
|
12
12
|
end
|
13
13
|
def self.new(request_options: {})
|
@@ -4,12 +4,7 @@ module TerminalShop
|
|
4
4
|
module Models
|
5
5
|
class TokenDeleteResponse < TerminalShop::BaseModel
|
6
6
|
sig { returns(Symbol) }
|
7
|
-
|
8
|
-
end
|
9
|
-
|
10
|
-
sig { params(_: Symbol).returns(Symbol) }
|
11
|
-
def data=(_)
|
12
|
-
end
|
7
|
+
attr_accessor :data
|
13
8
|
|
14
9
|
sig { params(data: Symbol).returns(T.attached_class) }
|
15
10
|
def self.new(data: :ok)
|
@@ -7,7 +7,7 @@ module TerminalShop
|
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
sig do
|
10
|
-
params(request_options: T.any(TerminalShop::RequestOptions,
|
10
|
+
params(request_options: T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
11
11
|
.returns(T.attached_class)
|
12
12
|
end
|
13
13
|
def self.new(request_options: {})
|
@@ -6,14 +6,12 @@ module TerminalShop
|
|
6
6
|
# A personal access token used to access the Terminal API. If you leak this,
|
7
7
|
# expect large sums of coffee to be ordered on your credit card.
|
8
8
|
sig { returns(TerminalShop::Models::TokenAPI) }
|
9
|
-
|
10
|
-
end
|
9
|
+
attr_reader :data
|
11
10
|
|
12
|
-
sig { params(
|
13
|
-
|
14
|
-
end
|
11
|
+
sig { params(data: T.any(TerminalShop::Models::TokenAPI, TerminalShop::Util::AnyHash)).void }
|
12
|
+
attr_writer :data
|
15
13
|
|
16
|
-
sig { params(data: TerminalShop::Models::TokenAPI).returns(T.attached_class) }
|
14
|
+
sig { params(data: T.any(TerminalShop::Models::TokenAPI, TerminalShop::Util::AnyHash)).returns(T.attached_class) }
|
17
15
|
def self.new(data:)
|
18
16
|
end
|
19
17
|
|
@@ -7,7 +7,7 @@ module TerminalShop
|
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
sig do
|
10
|
-
params(request_options: T.any(TerminalShop::RequestOptions,
|
10
|
+
params(request_options: T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
11
11
|
.returns(T.attached_class)
|
12
12
|
end
|
13
13
|
def self.new(request_options: {})
|