terminal-shop 1.7.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 +17 -1
- data/lib/terminal-shop/base_client.rb +47 -56
- data/lib/terminal-shop/base_model.rb +300 -352
- data/lib/terminal-shop/base_page.rb +30 -31
- data/lib/terminal-shop/client.rb +2 -3
- data/lib/terminal-shop/errors.rb +12 -17
- data/lib/terminal-shop/extern.rb +1 -4
- 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 +7 -3
- data/lib/terminal-shop/pooled_net_requester.rb +30 -21
- data/lib/terminal-shop/request_options.rb +5 -12
- data/lib/terminal-shop/resources/address.rb +0 -5
- data/lib/terminal-shop/resources/app.rb +0 -5
- data/lib/terminal-shop/resources/card.rb +0 -6
- data/lib/terminal-shop/resources/cart.rb +0 -7
- data/lib/terminal-shop/resources/email.rb +0 -2
- data/lib/terminal-shop/resources/order.rb +0 -4
- data/lib/terminal-shop/resources/product.rb +0 -3
- data/lib/terminal-shop/resources/profile.rb +0 -3
- data/lib/terminal-shop/resources/subscription.rb +0 -5
- data/lib/terminal-shop/resources/token.rb +0 -5
- data/lib/terminal-shop/resources/view.rb +0 -2
- data/lib/terminal-shop/util.rb +59 -77
- data/lib/terminal-shop/version.rb +1 -1
- data/lib/terminal-shop.rb +16 -0
- data/manifest.yaml +1 -0
- data/rbi/lib/terminal-shop/base_client.rbi +63 -41
- data/rbi/lib/terminal-shop/base_model.rbi +278 -129
- data/rbi/lib/terminal-shop/base_page.rbi +1 -4
- data/rbi/lib/terminal-shop/client.rbi +29 -30
- data/rbi/lib/terminal-shop/errors.rbi +12 -14
- data/rbi/lib/terminal-shop/extern.rbi +1 -1
- data/rbi/lib/terminal-shop/models/address.rbi +25 -51
- data/rbi/lib/terminal-shop/models/address_create_params.rbi +23 -46
- data/rbi/lib/terminal-shop/models/address_create_response.rbi +2 -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 +8 -6
- data/rbi/lib/terminal-shop/models/address_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/address_list_response.rbi +5 -6
- data/rbi/lib/terminal-shop/models/app.rbi +9 -24
- data/rbi/lib/terminal-shop/models/app_create_params.rbi +3 -13
- data/rbi/lib/terminal-shop/models/app_create_response.rbi +10 -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 +5 -6
- data/rbi/lib/terminal-shop/models/app_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/app_list_response.rbi +5 -6
- data/rbi/lib/terminal-shop/models/card.rbi +22 -36
- data/rbi/lib/terminal-shop/models/card_collect_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/card_collect_response.rbi +11 -14
- data/rbi/lib/terminal-shop/models/card_create_params.rbi +4 -7
- data/rbi/lib/terminal-shop/models/card_create_response.rbi +2 -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 +5 -6
- data/rbi/lib/terminal-shop/models/card_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/card_list_response.rbi +5 -6
- data/rbi/lib/terminal-shop/models/cart.rbi +53 -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 +5 -6
- data/rbi/lib/terminal-shop/models/cart_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/cart_get_response.rbi +5 -6
- data/rbi/lib/terminal-shop/models/cart_set_address_params.rbi +3 -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 +3 -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 +5 -13
- data/rbi/lib/terminal-shop/models/cart_set_item_response.rbi +5 -6
- data/rbi/lib/terminal-shop/models/email_create_params.rbi +3 -7
- data/rbi/lib/terminal-shop/models/email_create_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/order.rbi +80 -139
- data/rbi/lib/terminal-shop/models/order_create_params.rbi +7 -19
- data/rbi/lib/terminal-shop/models/order_create_response.rbi +2 -6
- data/rbi/lib/terminal-shop/models/order_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/order_get_response.rbi +5 -6
- data/rbi/lib/terminal-shop/models/order_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/order_list_response.rbi +5 -6
- data/rbi/lib/terminal-shop/models/product.rbi +52 -80
- data/rbi/lib/terminal-shop/models/product_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/product_get_response.rbi +8 -6
- data/rbi/lib/terminal-shop/models/product_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/product_list_response.rbi +5 -6
- data/rbi/lib/terminal-shop/models/product_variant.rbi +7 -18
- data/rbi/lib/terminal-shop/models/profile.rbi +20 -36
- data/rbi/lib/terminal-shop/models/profile_me_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/profile_me_response.rbi +8 -6
- data/rbi/lib/terminal-shop/models/profile_update_params.rbi +3 -13
- data/rbi/lib/terminal-shop/models/profile_update_response.rbi +8 -6
- data/rbi/lib/terminal-shop/models/region.rbi +10 -8
- data/rbi/lib/terminal-shop/models/subscription.rbi +35 -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 +8 -6
- data/rbi/lib/terminal-shop/models/subscription_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/subscription_list_response.rbi +4 -8
- data/rbi/lib/terminal-shop/models/token.rbi +8 -18
- data/rbi/lib/terminal-shop/models/token_create_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/token_create_response.rbi +11 -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 +6 -6
- data/rbi/lib/terminal-shop/models/token_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/token_list_response.rbi +5 -6
- data/rbi/lib/terminal-shop/models/view_init_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/view_init_response.rbi +37 -81
- data/rbi/lib/terminal-shop/pooled_net_requester.rbi +24 -6
- data/rbi/lib/terminal-shop/request_options.rbi +32 -57
- data/rbi/lib/terminal-shop/resources/address.rbi +26 -6
- data/rbi/lib/terminal-shop/resources/app.rbi +18 -6
- data/rbi/lib/terminal-shop/resources/card.rbi +27 -8
- data/rbi/lib/terminal-shop/resources/cart.rbi +29 -9
- data/rbi/lib/terminal-shop/resources/email.rbi +7 -2
- data/rbi/lib/terminal-shop/resources/order.rbi +20 -5
- data/rbi/lib/terminal-shop/resources/product.rbi +9 -3
- data/rbi/lib/terminal-shop/resources/profile.rbi +4 -2
- data/rbi/lib/terminal-shop/resources/subscription.rbi +26 -6
- data/rbi/lib/terminal-shop/resources/token.rbi +18 -6
- data/rbi/lib/terminal-shop/resources/view.rbi +3 -1
- data/rbi/lib/terminal-shop/util.rbi +78 -20
- data/rbi/lib/terminal-shop/version.rbi +1 -1
- data/sig/terminal-shop/base_client.rbs +20 -15
- data/sig/terminal-shop/base_model.rbs +36 -18
- data/sig/terminal-shop/client.rbs +8 -8
- data/sig/terminal-shop/errors.rbs +21 -21
- 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 +10 -3
- 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 +9 -9
- data/sig/terminal-shop/version.rbs +1 -1
- metadata +4 -4
@@ -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: {})
|
@@ -3,15 +3,14 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
module Models
|
5
5
|
class AppGetResponse < TerminalShop::BaseModel
|
6
|
+
# A Terminal App used for configuring an OAuth 2.0 client.
|
6
7
|
sig { returns(TerminalShop::Models::AppAPI) }
|
7
|
-
|
8
|
-
end
|
8
|
+
attr_reader :data
|
9
9
|
|
10
|
-
sig { params(
|
11
|
-
|
12
|
-
end
|
10
|
+
sig { params(data: T.any(TerminalShop::Models::AppAPI, TerminalShop::Util::AnyHash)).void }
|
11
|
+
attr_writer :data
|
13
12
|
|
14
|
-
sig { params(data: TerminalShop::Models::AppAPI).returns(T.attached_class) }
|
13
|
+
sig { params(data: T.any(TerminalShop::Models::AppAPI, TerminalShop::Util::AnyHash)).returns(T.attached_class) }
|
15
14
|
def self.new(data:)
|
16
15
|
end
|
17
16
|
|
@@ -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: {})
|
@@ -3,15 +3,14 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
module Models
|
5
5
|
class AppListResponse < TerminalShop::BaseModel
|
6
|
+
# List of apps.
|
6
7
|
sig { returns(T::Array[TerminalShop::Models::AppAPI]) }
|
7
|
-
|
8
|
-
end
|
8
|
+
attr_accessor :data
|
9
9
|
|
10
|
-
sig
|
11
|
-
|
10
|
+
sig do
|
11
|
+
params(data: T::Array[T.any(TerminalShop::Models::AppAPI, TerminalShop::Util::AnyHash)])
|
12
|
+
.returns(T.attached_class)
|
12
13
|
end
|
13
|
-
|
14
|
-
sig { params(data: T::Array[TerminalShop::Models::AppAPI]).returns(T.attached_class) }
|
15
14
|
def self.new(data:)
|
16
15
|
end
|
17
16
|
|
@@ -3,40 +3,33 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
module Models
|
5
5
|
class CardAPI < TerminalShop::BaseModel
|
6
|
+
# Unique object identifier. The format and length of IDs may change over time.
|
6
7
|
sig { returns(String) }
|
7
|
-
|
8
|
-
end
|
9
|
-
|
10
|
-
sig { params(_: String).returns(String) }
|
11
|
-
def id=(_)
|
12
|
-
end
|
8
|
+
attr_accessor :id
|
13
9
|
|
10
|
+
# Brand of the card.
|
14
11
|
sig { returns(String) }
|
15
|
-
|
16
|
-
end
|
17
|
-
|
18
|
-
sig { params(_: String).returns(String) }
|
19
|
-
def brand=(_)
|
20
|
-
end
|
12
|
+
attr_accessor :brand
|
21
13
|
|
14
|
+
# Expiration of the card.
|
22
15
|
sig { returns(TerminalShop::Models::CardAPI::Expiration) }
|
23
|
-
|
24
|
-
end
|
16
|
+
attr_reader :expiration
|
25
17
|
|
26
|
-
sig { params(
|
27
|
-
|
28
|
-
end
|
18
|
+
sig { params(expiration: T.any(TerminalShop::Models::CardAPI::Expiration, TerminalShop::Util::AnyHash)).void }
|
19
|
+
attr_writer :expiration
|
29
20
|
|
21
|
+
# Last four digits of the card.
|
30
22
|
sig { returns(String) }
|
31
|
-
|
32
|
-
end
|
33
|
-
|
34
|
-
sig { params(_: String).returns(String) }
|
35
|
-
def last4=(_)
|
36
|
-
end
|
23
|
+
attr_accessor :last4
|
37
24
|
|
25
|
+
# Credit card used for payments in the Terminal shop.
|
38
26
|
sig do
|
39
|
-
params(
|
27
|
+
params(
|
28
|
+
id: String,
|
29
|
+
brand: String,
|
30
|
+
expiration: T.any(TerminalShop::Models::CardAPI::Expiration, TerminalShop::Util::AnyHash),
|
31
|
+
last4: String
|
32
|
+
)
|
40
33
|
.returns(T.attached_class)
|
41
34
|
end
|
42
35
|
def self.new(id:, brand:, expiration:, last4:)
|
@@ -50,22 +43,15 @@ module TerminalShop
|
|
50
43
|
end
|
51
44
|
|
52
45
|
class Expiration < TerminalShop::BaseModel
|
46
|
+
# Expiration month of the card.
|
53
47
|
sig { returns(Integer) }
|
54
|
-
|
55
|
-
end
|
56
|
-
|
57
|
-
sig { params(_: Integer).returns(Integer) }
|
58
|
-
def month=(_)
|
59
|
-
end
|
48
|
+
attr_accessor :month
|
60
49
|
|
50
|
+
# Expiration year of the card.
|
61
51
|
sig { returns(Integer) }
|
62
|
-
|
63
|
-
end
|
64
|
-
|
65
|
-
sig { params(_: Integer).returns(Integer) }
|
66
|
-
def year=(_)
|
67
|
-
end
|
52
|
+
attr_accessor :year
|
68
53
|
|
54
|
+
# Expiration of the card.
|
69
55
|
sig { params(month: Integer, year: Integer).returns(T.attached_class) }
|
70
56
|
def self.new(month:, year:)
|
71
57
|
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: {})
|
@@ -3,18 +3,17 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
module Models
|
5
5
|
class CardCollectResponse < TerminalShop::BaseModel
|
6
|
+
# URL for collecting card information.
|
6
7
|
sig { returns(TerminalShop::Models::CardCollectResponse::Data) }
|
7
|
-
|
8
|
-
|
8
|
+
attr_reader :data
|
9
|
+
|
10
|
+
sig { params(data: T.any(TerminalShop::Models::CardCollectResponse::Data, TerminalShop::Util::AnyHash)).void }
|
11
|
+
attr_writer :data
|
9
12
|
|
10
13
|
sig do
|
11
|
-
params(
|
12
|
-
.returns(
|
14
|
+
params(data: T.any(TerminalShop::Models::CardCollectResponse::Data, TerminalShop::Util::AnyHash))
|
15
|
+
.returns(T.attached_class)
|
13
16
|
end
|
14
|
-
def data=(_)
|
15
|
-
end
|
16
|
-
|
17
|
-
sig { params(data: TerminalShop::Models::CardCollectResponse::Data).returns(T.attached_class) }
|
18
17
|
def self.new(data:)
|
19
18
|
end
|
20
19
|
|
@@ -23,14 +22,12 @@ module TerminalShop
|
|
23
22
|
end
|
24
23
|
|
25
24
|
class Data < TerminalShop::BaseModel
|
25
|
+
# Temporary URL that allows a user to enter credit card details over https at
|
26
|
+
# terminal.shop.
|
26
27
|
sig { returns(String) }
|
27
|
-
|
28
|
-
end
|
29
|
-
|
30
|
-
sig { params(_: String).returns(String) }
|
31
|
-
def url=(_)
|
32
|
-
end
|
28
|
+
attr_accessor :url
|
33
29
|
|
30
|
+
# URL for collecting card information.
|
34
31
|
sig { params(url: String).returns(T.attached_class) }
|
35
32
|
def self.new(url:)
|
36
33
|
end
|
@@ -6,20 +6,17 @@ module TerminalShop
|
|
6
6
|
extend TerminalShop::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
|
+
# Stripe card token. Learn how to
|
10
|
+
# [create one here](https://docs.stripe.com/api/tokens/create_card).
|
9
11
|
sig { returns(String) }
|
10
|
-
|
11
|
-
end
|
12
|
-
|
13
|
-
sig { params(_: String).returns(String) }
|
14
|
-
def token=(_)
|
15
|
-
end
|
12
|
+
attr_accessor :token
|
16
13
|
|
17
14
|
sig do
|
18
15
|
params(
|
19
16
|
token: String,
|
20
17
|
request_options: T.any(
|
21
18
|
TerminalShop::RequestOptions,
|
22
|
-
|
19
|
+
TerminalShop::Util::AnyHash
|
23
20
|
)
|
24
21
|
)
|
25
22
|
.returns(T.attached_class)
|
@@ -3,13 +3,9 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
module Models
|
5
5
|
class CardCreateResponse < TerminalShop::BaseModel
|
6
|
+
# ID of the card.
|
6
7
|
sig { returns(String) }
|
7
|
-
|
8
|
-
end
|
9
|
-
|
10
|
-
sig { params(_: String).returns(String) }
|
11
|
-
def data=(_)
|
12
|
-
end
|
8
|
+
attr_accessor :data
|
13
9
|
|
14
10
|
sig { params(data: String).returns(T.attached_class) }
|
15
11
|
def self.new(data:)
|
@@ -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 CardDeleteResponse < 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: {})
|
@@ -3,15 +3,14 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
module Models
|
5
5
|
class CardGetResponse < TerminalShop::BaseModel
|
6
|
+
# Credit card used for payments in the Terminal shop.
|
6
7
|
sig { returns(TerminalShop::Models::CardAPI) }
|
7
|
-
|
8
|
-
end
|
8
|
+
attr_reader :data
|
9
9
|
|
10
|
-
sig { params(
|
11
|
-
|
12
|
-
end
|
10
|
+
sig { params(data: T.any(TerminalShop::Models::CardAPI, TerminalShop::Util::AnyHash)).void }
|
11
|
+
attr_writer :data
|
13
12
|
|
14
|
-
sig { params(data: TerminalShop::Models::CardAPI).returns(T.attached_class) }
|
13
|
+
sig { params(data: T.any(TerminalShop::Models::CardAPI, TerminalShop::Util::AnyHash)).returns(T.attached_class) }
|
15
14
|
def self.new(data:)
|
16
15
|
end
|
17
16
|
|
@@ -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: {})
|
@@ -3,15 +3,14 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
module Models
|
5
5
|
class CardListResponse < TerminalShop::BaseModel
|
6
|
+
# List of cards associated with the user.
|
6
7
|
sig { returns(T::Array[TerminalShop::Models::CardAPI]) }
|
7
|
-
|
8
|
-
end
|
8
|
+
attr_accessor :data
|
9
9
|
|
10
|
-
sig
|
11
|
-
|
10
|
+
sig do
|
11
|
+
params(data: T::Array[T.any(TerminalShop::Models::CardAPI, TerminalShop::Util::AnyHash)])
|
12
|
+
.returns(T.attached_class)
|
12
13
|
end
|
13
|
-
|
14
|
-
sig { params(data: T::Array[TerminalShop::Models::CardAPI]).returns(T.attached_class) }
|
15
14
|
def self.new(data:)
|
16
15
|
end
|
17
16
|
|
@@ -3,65 +3,51 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
module Models
|
5
5
|
class CartAPI < TerminalShop::BaseModel
|
6
|
+
# The subtotal and shipping amounts for the current user's cart.
|
6
7
|
sig { returns(TerminalShop::Models::CartAPI::Amount) }
|
7
|
-
|
8
|
-
end
|
8
|
+
attr_reader :amount
|
9
9
|
|
10
|
-
sig { params(
|
11
|
-
|
12
|
-
end
|
10
|
+
sig { params(amount: T.any(TerminalShop::Models::CartAPI::Amount, TerminalShop::Util::AnyHash)).void }
|
11
|
+
attr_writer :amount
|
13
12
|
|
13
|
+
# An array of items in the current user's cart.
|
14
14
|
sig { returns(T::Array[TerminalShop::Models::CartAPI::Item]) }
|
15
|
-
|
16
|
-
end
|
17
|
-
|
18
|
-
sig do
|
19
|
-
params(_: T::Array[TerminalShop::Models::CartAPI::Item])
|
20
|
-
.returns(T::Array[TerminalShop::Models::CartAPI::Item])
|
21
|
-
end
|
22
|
-
def items=(_)
|
23
|
-
end
|
15
|
+
attr_accessor :items
|
24
16
|
|
17
|
+
# The subtotal of all items in the current user's cart, in cents (USD).
|
25
18
|
sig { returns(Integer) }
|
26
|
-
|
27
|
-
end
|
28
|
-
|
29
|
-
sig { params(_: Integer).returns(Integer) }
|
30
|
-
def subtotal=(_)
|
31
|
-
end
|
19
|
+
attr_accessor :subtotal
|
32
20
|
|
21
|
+
# ID of the shipping address selected on the current user's cart.
|
33
22
|
sig { returns(T.nilable(String)) }
|
34
|
-
|
35
|
-
end
|
23
|
+
attr_reader :address_id
|
36
24
|
|
37
|
-
sig { params(
|
38
|
-
|
39
|
-
end
|
25
|
+
sig { params(address_id: String).void }
|
26
|
+
attr_writer :address_id
|
40
27
|
|
28
|
+
# ID of the card selected on the current user's cart.
|
41
29
|
sig { returns(T.nilable(String)) }
|
42
|
-
|
43
|
-
end
|
30
|
+
attr_reader :card_id
|
44
31
|
|
45
|
-
sig { params(
|
46
|
-
|
47
|
-
end
|
32
|
+
sig { params(card_id: String).void }
|
33
|
+
attr_writer :card_id
|
48
34
|
|
35
|
+
# Shipping information for the current user's cart.
|
49
36
|
sig { returns(T.nilable(TerminalShop::Models::CartAPI::Shipping)) }
|
50
|
-
|
51
|
-
end
|
37
|
+
attr_reader :shipping
|
52
38
|
|
53
|
-
sig { params(
|
54
|
-
|
55
|
-
end
|
39
|
+
sig { params(shipping: T.any(TerminalShop::Models::CartAPI::Shipping, TerminalShop::Util::AnyHash)).void }
|
40
|
+
attr_writer :shipping
|
56
41
|
|
42
|
+
# The current Terminal shop user's cart.
|
57
43
|
sig do
|
58
44
|
params(
|
59
|
-
amount: TerminalShop::Models::CartAPI::Amount,
|
60
|
-
items: T::Array[TerminalShop::Models::CartAPI::Item],
|
45
|
+
amount: T.any(TerminalShop::Models::CartAPI::Amount, TerminalShop::Util::AnyHash),
|
46
|
+
items: T::Array[T.any(TerminalShop::Models::CartAPI::Item, TerminalShop::Util::AnyHash)],
|
61
47
|
subtotal: Integer,
|
62
48
|
address_id: String,
|
63
49
|
card_id: String,
|
64
|
-
shipping: TerminalShop::Models::CartAPI::Shipping
|
50
|
+
shipping: T.any(TerminalShop::Models::CartAPI::Shipping, TerminalShop::Util::AnyHash)
|
65
51
|
)
|
66
52
|
.returns(T.attached_class)
|
67
53
|
end
|
@@ -85,30 +71,25 @@ module TerminalShop
|
|
85
71
|
end
|
86
72
|
|
87
73
|
class Amount < TerminalShop::BaseModel
|
74
|
+
# Subtotal of the current user's cart, in cents (USD).
|
88
75
|
sig { returns(Integer) }
|
89
|
-
|
90
|
-
end
|
91
|
-
|
92
|
-
sig { params(_: Integer).returns(Integer) }
|
93
|
-
def subtotal=(_)
|
94
|
-
end
|
76
|
+
attr_accessor :subtotal
|
95
77
|
|
78
|
+
# Shipping amount of the current user's cart, in cents (USD).
|
96
79
|
sig { returns(T.nilable(Integer)) }
|
97
|
-
|
98
|
-
end
|
80
|
+
attr_reader :shipping
|
99
81
|
|
100
|
-
sig { params(
|
101
|
-
|
102
|
-
end
|
82
|
+
sig { params(shipping: Integer).void }
|
83
|
+
attr_writer :shipping
|
103
84
|
|
85
|
+
# Total amount after any discounts, in cents (USD).
|
104
86
|
sig { returns(T.nilable(Integer)) }
|
105
|
-
|
106
|
-
end
|
87
|
+
attr_reader :total
|
107
88
|
|
108
|
-
sig { params(
|
109
|
-
|
110
|
-
end
|
89
|
+
sig { params(total: Integer).void }
|
90
|
+
attr_writer :total
|
111
91
|
|
92
|
+
# The subtotal and shipping amounts for the current user's cart.
|
112
93
|
sig { params(subtotal: Integer, shipping: Integer, total: Integer).returns(T.attached_class) }
|
113
94
|
def self.new(subtotal:, shipping: nil, total: nil)
|
114
95
|
end
|
@@ -119,38 +100,23 @@ module TerminalShop
|
|
119
100
|
end
|
120
101
|
|
121
102
|
class Item < TerminalShop::BaseModel
|
103
|
+
# Unique object identifier. The format and length of IDs may change over time.
|
122
104
|
sig { returns(String) }
|
123
|
-
|
124
|
-
end
|
125
|
-
|
126
|
-
sig { params(_: String).returns(String) }
|
127
|
-
def id=(_)
|
128
|
-
end
|
105
|
+
attr_accessor :id
|
129
106
|
|
107
|
+
# ID of the product variant for this item in the current user's cart.
|
130
108
|
sig { returns(String) }
|
131
|
-
|
132
|
-
end
|
133
|
-
|
134
|
-
sig { params(_: String).returns(String) }
|
135
|
-
def product_variant_id=(_)
|
136
|
-
end
|
109
|
+
attr_accessor :product_variant_id
|
137
110
|
|
111
|
+
# Quantity of the item in the current user's cart.
|
138
112
|
sig { returns(Integer) }
|
139
|
-
|
140
|
-
end
|
141
|
-
|
142
|
-
sig { params(_: Integer).returns(Integer) }
|
143
|
-
def quantity=(_)
|
144
|
-
end
|
113
|
+
attr_accessor :quantity
|
145
114
|
|
115
|
+
# Subtotal of the item in the current user's cart, in cents (USD).
|
146
116
|
sig { returns(Integer) }
|
147
|
-
|
148
|
-
end
|
149
|
-
|
150
|
-
sig { params(_: Integer).returns(Integer) }
|
151
|
-
def subtotal=(_)
|
152
|
-
end
|
117
|
+
attr_accessor :subtotal
|
153
118
|
|
119
|
+
# An item in the current Terminal shop user's cart.
|
154
120
|
sig do
|
155
121
|
params(id: String, product_variant_id: String, quantity: Integer, subtotal: Integer)
|
156
122
|
.returns(T.attached_class)
|
@@ -166,22 +132,21 @@ module TerminalShop
|
|
166
132
|
end
|
167
133
|
|
168
134
|
class Shipping < TerminalShop::BaseModel
|
135
|
+
# Shipping service name.
|
169
136
|
sig { returns(T.nilable(String)) }
|
170
|
-
|
171
|
-
end
|
137
|
+
attr_reader :service
|
172
138
|
|
173
|
-
sig { params(
|
174
|
-
|
175
|
-
end
|
139
|
+
sig { params(service: String).void }
|
140
|
+
attr_writer :service
|
176
141
|
|
142
|
+
# Shipping timeframe provided by the shipping carrier.
|
177
143
|
sig { returns(T.nilable(String)) }
|
178
|
-
|
179
|
-
end
|
144
|
+
attr_reader :timeframe
|
180
145
|
|
181
|
-
sig { params(
|
182
|
-
|
183
|
-
end
|
146
|
+
sig { params(timeframe: String).void }
|
147
|
+
attr_writer :timeframe
|
184
148
|
|
149
|
+
# Shipping information for the current user's cart.
|
185
150
|
sig { params(service: String, timeframe: String).returns(T.attached_class) }
|
186
151
|
def self.new(service: nil, timeframe: nil)
|
187
152
|
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 CartClearResponse < 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: {})
|
@@ -3,15 +3,14 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
module Models
|
5
5
|
class CartConvertResponse < TerminalShop::BaseModel
|
6
|
+
# An order from the Terminal shop.
|
6
7
|
sig { returns(TerminalShop::Models::OrderAPI) }
|
7
|
-
|
8
|
-
end
|
8
|
+
attr_reader :data
|
9
9
|
|
10
|
-
sig { params(
|
11
|
-
|
12
|
-
end
|
10
|
+
sig { params(data: T.any(TerminalShop::Models::OrderAPI, TerminalShop::Util::AnyHash)).void }
|
11
|
+
attr_writer :data
|
13
12
|
|
14
|
-
sig { params(data: TerminalShop::Models::OrderAPI).returns(T.attached_class) }
|
13
|
+
sig { params(data: T.any(TerminalShop::Models::OrderAPI, TerminalShop::Util::AnyHash)).returns(T.attached_class) }
|
15
14
|
def self.new(data:)
|
16
15
|
end
|
17
16
|
|
@@ -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: {})
|
@@ -3,15 +3,14 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
module Models
|
5
5
|
class CartGetResponse < TerminalShop::BaseModel
|
6
|
+
# The current Terminal shop user's cart.
|
6
7
|
sig { returns(TerminalShop::Models::CartAPI) }
|
7
|
-
|
8
|
-
end
|
8
|
+
attr_reader :data
|
9
9
|
|
10
|
-
sig { params(
|
11
|
-
|
12
|
-
end
|
10
|
+
sig { params(data: T.any(TerminalShop::Models::CartAPI, TerminalShop::Util::AnyHash)).void }
|
11
|
+
attr_writer :data
|
13
12
|
|
14
|
-
sig { params(data: TerminalShop::Models::CartAPI).returns(T.attached_class) }
|
13
|
+
sig { params(data: T.any(TerminalShop::Models::CartAPI, TerminalShop::Util::AnyHash)).returns(T.attached_class) }
|
15
14
|
def self.new(data:)
|
16
15
|
end
|
17
16
|
|
@@ -6,18 +6,14 @@ module TerminalShop
|
|
6
6
|
extend TerminalShop::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
|
+
# ID of the shipping address to set for the current user's cart.
|
9
10
|
sig { returns(String) }
|
10
|
-
|
11
|
-
end
|
12
|
-
|
13
|
-
sig { params(_: String).returns(String) }
|
14
|
-
def address_id=(_)
|
15
|
-
end
|
11
|
+
attr_accessor :address_id
|
16
12
|
|
17
13
|
sig do
|
18
14
|
params(
|
19
15
|
address_id: String,
|
20
|
-
request_options: T.any(TerminalShop::RequestOptions,
|
16
|
+
request_options: T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash)
|
21
17
|
)
|
22
18
|
.returns(T.attached_class)
|
23
19
|
end
|