terminal-shop 1.7.0 → 1.8.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 +3 -1
- data/lib/terminal-shop/base_client.rb +36 -46
- data/lib/terminal-shop/base_model.rb +65 -130
- data/lib/terminal-shop/base_page.rb +18 -18
- data/lib/terminal-shop/client.rb +1 -3
- data/lib/terminal-shop/errors.rb +12 -17
- data/lib/terminal-shop/extern.rb +1 -4
- data/lib/terminal-shop/models/subscription.rb +6 -0
- data/lib/terminal-shop/pooled_net_requester.rb +19 -21
- data/lib/terminal-shop/request_options.rb +4 -11
- 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 +44 -71
- data/lib/terminal-shop/version.rb +1 -1
- data/lib/terminal-shop.rb +1 -0
- data/manifest.yaml +1 -0
- data/rbi/lib/terminal-shop/base_client.rbi +23 -0
- data/rbi/lib/terminal-shop/base_model.rbi +178 -52
- data/rbi/lib/terminal-shop/base_page.rbi +1 -2
- data/rbi/lib/terminal-shop/client.rbi +11 -0
- data/rbi/lib/terminal-shop/errors.rbi +33 -0
- data/rbi/lib/terminal-shop/extern.rbi +1 -1
- data/rbi/lib/terminal-shop/models/address.rbi +10 -0
- data/rbi/lib/terminal-shop/models/address_create_params.rbi +8 -0
- data/rbi/lib/terminal-shop/models/address_create_response.rbi +1 -0
- data/rbi/lib/terminal-shop/models/address_get_response.rbi +1 -0
- data/rbi/lib/terminal-shop/models/address_list_response.rbi +1 -0
- data/rbi/lib/terminal-shop/models/app.rbi +5 -0
- data/rbi/lib/terminal-shop/models/app_create_response.rbi +2 -0
- data/rbi/lib/terminal-shop/models/app_get_response.rbi +1 -0
- data/rbi/lib/terminal-shop/models/app_list_response.rbi +1 -0
- data/rbi/lib/terminal-shop/models/card.rbi +8 -0
- data/rbi/lib/terminal-shop/models/card_collect_response.rbi +4 -0
- data/rbi/lib/terminal-shop/models/card_create_params.rbi +2 -0
- data/rbi/lib/terminal-shop/models/card_create_response.rbi +1 -0
- data/rbi/lib/terminal-shop/models/card_get_response.rbi +1 -0
- data/rbi/lib/terminal-shop/models/card_list_response.rbi +1 -0
- data/rbi/lib/terminal-shop/models/cart.rbi +19 -0
- data/rbi/lib/terminal-shop/models/cart_convert_response.rbi +1 -0
- data/rbi/lib/terminal-shop/models/cart_get_response.rbi +1 -0
- data/rbi/lib/terminal-shop/models/cart_set_address_params.rbi +1 -0
- data/rbi/lib/terminal-shop/models/cart_set_card_params.rbi +1 -0
- data/rbi/lib/terminal-shop/models/cart_set_item_params.rbi +2 -0
- data/rbi/lib/terminal-shop/models/cart_set_item_response.rbi +1 -0
- data/rbi/lib/terminal-shop/models/email_create_params.rbi +1 -0
- data/rbi/lib/terminal-shop/models/order.rbi +28 -0
- data/rbi/lib/terminal-shop/models/order_create_params.rbi +3 -0
- data/rbi/lib/terminal-shop/models/order_create_response.rbi +1 -0
- data/rbi/lib/terminal-shop/models/order_get_response.rbi +1 -0
- data/rbi/lib/terminal-shop/models/order_list_response.rbi +1 -0
- data/rbi/lib/terminal-shop/models/product.rbi +12 -6
- data/rbi/lib/terminal-shop/models/product_get_response.rbi +1 -0
- data/rbi/lib/terminal-shop/models/product_list_response.rbi +1 -0
- data/rbi/lib/terminal-shop/models/product_variant.rbi +4 -0
- data/rbi/lib/terminal-shop/models/profile.rbi +8 -0
- data/rbi/lib/terminal-shop/models/profile_me_response.rbi +1 -0
- data/rbi/lib/terminal-shop/models/profile_update_response.rbi +1 -0
- data/rbi/lib/terminal-shop/models/region.rbi +3 -6
- data/rbi/lib/terminal-shop/models/subscription.rbi +18 -11
- data/rbi/lib/terminal-shop/models/subscription_get_response.rbi +1 -0
- data/rbi/lib/terminal-shop/models/subscription_list_response.rbi +1 -0
- data/rbi/lib/terminal-shop/models/token.rbi +5 -0
- data/rbi/lib/terminal-shop/models/token_create_response.rbi +3 -0
- data/rbi/lib/terminal-shop/models/token_get_response.rbi +2 -0
- data/rbi/lib/terminal-shop/models/token_list_response.rbi +1 -0
- data/rbi/lib/terminal-shop/models/view_init_response.rbi +5 -0
- data/rbi/lib/terminal-shop/pooled_net_requester.rbi +10 -3
- data/rbi/lib/terminal-shop/request_options.rbi +21 -2
- data/rbi/lib/terminal-shop/resources/address.rbi +22 -2
- data/rbi/lib/terminal-shop/resources/app.rbi +14 -2
- data/rbi/lib/terminal-shop/resources/card.rbi +22 -3
- data/rbi/lib/terminal-shop/resources/cart.rbi +23 -3
- data/rbi/lib/terminal-shop/resources/email.rbi +6 -1
- data/rbi/lib/terminal-shop/resources/order.rbi +17 -2
- data/rbi/lib/terminal-shop/resources/product.rbi +7 -1
- data/rbi/lib/terminal-shop/resources/profile.rbi +2 -0
- data/rbi/lib/terminal-shop/resources/subscription.rbi +21 -2
- data/rbi/lib/terminal-shop/resources/token.rbi +14 -2
- data/rbi/lib/terminal-shop/resources/view.rbi +2 -0
- data/rbi/lib/terminal-shop/util.rbi +55 -8
- data/rbi/lib/terminal-shop/version.rbi +1 -1
- data/sig/terminal-shop/base_client.rbs +6 -1
- data/sig/terminal-shop/base_model.rbs +8 -6
- data/sig/terminal-shop/errors.rbs +4 -4
- data/sig/terminal-shop/models/subscription.rbs +1 -1
- data/sig/terminal-shop/pooled_net_requester.rbs +7 -2
- data/sig/terminal-shop/util.rbs +4 -4
- data/sig/terminal-shop/version.rbs +1 -1
- metadata +4 -4
@@ -3,6 +3,7 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
module Models
|
5
5
|
class AddressAPI < TerminalShop::BaseModel
|
6
|
+
# Unique object identifier. The format and length of IDs may change over time.
|
6
7
|
sig { returns(String) }
|
7
8
|
def id
|
8
9
|
end
|
@@ -11,6 +12,7 @@ module TerminalShop
|
|
11
12
|
def id=(_)
|
12
13
|
end
|
13
14
|
|
15
|
+
# City of the address.
|
14
16
|
sig { returns(String) }
|
15
17
|
def city
|
16
18
|
end
|
@@ -19,6 +21,7 @@ module TerminalShop
|
|
19
21
|
def city=(_)
|
20
22
|
end
|
21
23
|
|
24
|
+
# ISO 3166-1 alpha-2 country code of the address.
|
22
25
|
sig { returns(String) }
|
23
26
|
def country
|
24
27
|
end
|
@@ -27,6 +30,7 @@ module TerminalShop
|
|
27
30
|
def country=(_)
|
28
31
|
end
|
29
32
|
|
33
|
+
# The recipient's name.
|
30
34
|
sig { returns(String) }
|
31
35
|
def name
|
32
36
|
end
|
@@ -35,6 +39,7 @@ module TerminalShop
|
|
35
39
|
def name=(_)
|
36
40
|
end
|
37
41
|
|
42
|
+
# Street of the address.
|
38
43
|
sig { returns(String) }
|
39
44
|
def street1
|
40
45
|
end
|
@@ -43,6 +48,7 @@ module TerminalShop
|
|
43
48
|
def street1=(_)
|
44
49
|
end
|
45
50
|
|
51
|
+
# Zip code of the address.
|
46
52
|
sig { returns(String) }
|
47
53
|
def zip
|
48
54
|
end
|
@@ -51,6 +57,7 @@ module TerminalShop
|
|
51
57
|
def zip=(_)
|
52
58
|
end
|
53
59
|
|
60
|
+
# Phone number of the recipient.
|
54
61
|
sig { returns(T.nilable(String)) }
|
55
62
|
def phone
|
56
63
|
end
|
@@ -59,6 +66,7 @@ module TerminalShop
|
|
59
66
|
def phone=(_)
|
60
67
|
end
|
61
68
|
|
69
|
+
# Province or state of the address.
|
62
70
|
sig { returns(T.nilable(String)) }
|
63
71
|
def province
|
64
72
|
end
|
@@ -67,6 +75,7 @@ module TerminalShop
|
|
67
75
|
def province=(_)
|
68
76
|
end
|
69
77
|
|
78
|
+
# Apartment, suite, etc. of the address.
|
70
79
|
sig { returns(T.nilable(String)) }
|
71
80
|
def street2
|
72
81
|
end
|
@@ -75,6 +84,7 @@ module TerminalShop
|
|
75
84
|
def street2=(_)
|
76
85
|
end
|
77
86
|
|
87
|
+
# Physical address associated with a Terminal shop user.
|
78
88
|
sig do
|
79
89
|
params(
|
80
90
|
id: String,
|
@@ -6,6 +6,7 @@ module TerminalShop
|
|
6
6
|
extend TerminalShop::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
|
+
# City of the address.
|
9
10
|
sig { returns(String) }
|
10
11
|
def city
|
11
12
|
end
|
@@ -14,6 +15,7 @@ module TerminalShop
|
|
14
15
|
def city=(_)
|
15
16
|
end
|
16
17
|
|
18
|
+
# ISO 3166-1 alpha-2 country code of the address.
|
17
19
|
sig { returns(String) }
|
18
20
|
def country
|
19
21
|
end
|
@@ -22,6 +24,7 @@ module TerminalShop
|
|
22
24
|
def country=(_)
|
23
25
|
end
|
24
26
|
|
27
|
+
# The recipient's name.
|
25
28
|
sig { returns(String) }
|
26
29
|
def name
|
27
30
|
end
|
@@ -30,6 +33,7 @@ module TerminalShop
|
|
30
33
|
def name=(_)
|
31
34
|
end
|
32
35
|
|
36
|
+
# Street of the address.
|
33
37
|
sig { returns(String) }
|
34
38
|
def street1
|
35
39
|
end
|
@@ -38,6 +42,7 @@ module TerminalShop
|
|
38
42
|
def street1=(_)
|
39
43
|
end
|
40
44
|
|
45
|
+
# Zip code of the address.
|
41
46
|
sig { returns(String) }
|
42
47
|
def zip
|
43
48
|
end
|
@@ -46,6 +51,7 @@ module TerminalShop
|
|
46
51
|
def zip=(_)
|
47
52
|
end
|
48
53
|
|
54
|
+
# Phone number of the recipient.
|
49
55
|
sig { returns(T.nilable(String)) }
|
50
56
|
def phone
|
51
57
|
end
|
@@ -54,6 +60,7 @@ module TerminalShop
|
|
54
60
|
def phone=(_)
|
55
61
|
end
|
56
62
|
|
63
|
+
# Province or state of the address.
|
57
64
|
sig { returns(T.nilable(String)) }
|
58
65
|
def province
|
59
66
|
end
|
@@ -62,6 +69,7 @@ module TerminalShop
|
|
62
69
|
def province=(_)
|
63
70
|
end
|
64
71
|
|
72
|
+
# Apartment, suite, etc. of the address.
|
65
73
|
sig { returns(T.nilable(String)) }
|
66
74
|
def street2
|
67
75
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
module Models
|
5
5
|
class AppAPI < TerminalShop::BaseModel
|
6
|
+
# Unique object identifier. The format and length of IDs may change over time.
|
6
7
|
sig { returns(String) }
|
7
8
|
def id
|
8
9
|
end
|
@@ -11,6 +12,7 @@ module TerminalShop
|
|
11
12
|
def id=(_)
|
12
13
|
end
|
13
14
|
|
15
|
+
# Name of the app.
|
14
16
|
sig { returns(String) }
|
15
17
|
def name
|
16
18
|
end
|
@@ -19,6 +21,7 @@ module TerminalShop
|
|
19
21
|
def name=(_)
|
20
22
|
end
|
21
23
|
|
24
|
+
# Redirect URI of the app.
|
22
25
|
sig { returns(String) }
|
23
26
|
def redirect_uri
|
24
27
|
end
|
@@ -27,6 +30,7 @@ module TerminalShop
|
|
27
30
|
def redirect_uri=(_)
|
28
31
|
end
|
29
32
|
|
33
|
+
# OAuth 2.0 client secret of the app (obfuscated).
|
30
34
|
sig { returns(String) }
|
31
35
|
def secret
|
32
36
|
end
|
@@ -35,6 +39,7 @@ module TerminalShop
|
|
35
39
|
def secret=(_)
|
36
40
|
end
|
37
41
|
|
42
|
+
# A Terminal App used for configuring an OAuth 2.0 client.
|
38
43
|
sig { params(id: String, name: String, redirect_uri: String, secret: String).returns(T.attached_class) }
|
39
44
|
def self.new(id:, name:, redirect_uri:, secret:)
|
40
45
|
end
|
@@ -23,6 +23,7 @@ module TerminalShop
|
|
23
23
|
end
|
24
24
|
|
25
25
|
class Data < TerminalShop::BaseModel
|
26
|
+
# OAuth 2.0 client ID.
|
26
27
|
sig { returns(String) }
|
27
28
|
def id
|
28
29
|
end
|
@@ -31,6 +32,7 @@ module TerminalShop
|
|
31
32
|
def id=(_)
|
32
33
|
end
|
33
34
|
|
35
|
+
# OAuth 2.0 client secret.
|
34
36
|
sig { returns(String) }
|
35
37
|
def secret
|
36
38
|
end
|
@@ -3,6 +3,7 @@
|
|
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
|
def id
|
8
9
|
end
|
@@ -11,6 +12,7 @@ module TerminalShop
|
|
11
12
|
def id=(_)
|
12
13
|
end
|
13
14
|
|
15
|
+
# Brand of the card.
|
14
16
|
sig { returns(String) }
|
15
17
|
def brand
|
16
18
|
end
|
@@ -19,6 +21,7 @@ module TerminalShop
|
|
19
21
|
def brand=(_)
|
20
22
|
end
|
21
23
|
|
24
|
+
# Expiration of the card.
|
22
25
|
sig { returns(TerminalShop::Models::CardAPI::Expiration) }
|
23
26
|
def expiration
|
24
27
|
end
|
@@ -27,6 +30,7 @@ module TerminalShop
|
|
27
30
|
def expiration=(_)
|
28
31
|
end
|
29
32
|
|
33
|
+
# Last four digits of the card.
|
30
34
|
sig { returns(String) }
|
31
35
|
def last4
|
32
36
|
end
|
@@ -35,6 +39,7 @@ module TerminalShop
|
|
35
39
|
def last4=(_)
|
36
40
|
end
|
37
41
|
|
42
|
+
# Credit card used for payments in the Terminal shop.
|
38
43
|
sig do
|
39
44
|
params(id: String, brand: String, expiration: TerminalShop::Models::CardAPI::Expiration, last4: String)
|
40
45
|
.returns(T.attached_class)
|
@@ -50,6 +55,7 @@ module TerminalShop
|
|
50
55
|
end
|
51
56
|
|
52
57
|
class Expiration < TerminalShop::BaseModel
|
58
|
+
# Expiration month of the card.
|
53
59
|
sig { returns(Integer) }
|
54
60
|
def month
|
55
61
|
end
|
@@ -58,6 +64,7 @@ module TerminalShop
|
|
58
64
|
def month=(_)
|
59
65
|
end
|
60
66
|
|
67
|
+
# Expiration year of the card.
|
61
68
|
sig { returns(Integer) }
|
62
69
|
def year
|
63
70
|
end
|
@@ -66,6 +73,7 @@ module TerminalShop
|
|
66
73
|
def year=(_)
|
67
74
|
end
|
68
75
|
|
76
|
+
# Expiration of the card.
|
69
77
|
sig { params(month: Integer, year: Integer).returns(T.attached_class) }
|
70
78
|
def self.new(month:, year:)
|
71
79
|
end
|
@@ -3,6 +3,7 @@
|
|
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
|
def data
|
8
9
|
end
|
@@ -23,6 +24,8 @@ module TerminalShop
|
|
23
24
|
end
|
24
25
|
|
25
26
|
class Data < TerminalShop::BaseModel
|
27
|
+
# Temporary URL that allows a user to enter credit card details over https at
|
28
|
+
# terminal.shop.
|
26
29
|
sig { returns(String) }
|
27
30
|
def url
|
28
31
|
end
|
@@ -31,6 +34,7 @@ module TerminalShop
|
|
31
34
|
def url=(_)
|
32
35
|
end
|
33
36
|
|
37
|
+
# URL for collecting card information.
|
34
38
|
sig { params(url: String).returns(T.attached_class) }
|
35
39
|
def self.new(url:)
|
36
40
|
end
|
@@ -6,6 +6,8 @@ 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
12
|
def token
|
11
13
|
end
|
@@ -3,6 +3,7 @@
|
|
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
|
def amount
|
8
9
|
end
|
@@ -11,6 +12,7 @@ module TerminalShop
|
|
11
12
|
def amount=(_)
|
12
13
|
end
|
13
14
|
|
15
|
+
# An array of items in the current user's cart.
|
14
16
|
sig { returns(T::Array[TerminalShop::Models::CartAPI::Item]) }
|
15
17
|
def items
|
16
18
|
end
|
@@ -22,6 +24,7 @@ module TerminalShop
|
|
22
24
|
def items=(_)
|
23
25
|
end
|
24
26
|
|
27
|
+
# The subtotal of all items in the current user's cart, in cents (USD).
|
25
28
|
sig { returns(Integer) }
|
26
29
|
def subtotal
|
27
30
|
end
|
@@ -30,6 +33,7 @@ module TerminalShop
|
|
30
33
|
def subtotal=(_)
|
31
34
|
end
|
32
35
|
|
36
|
+
# ID of the shipping address selected on the current user's cart.
|
33
37
|
sig { returns(T.nilable(String)) }
|
34
38
|
def address_id
|
35
39
|
end
|
@@ -38,6 +42,7 @@ module TerminalShop
|
|
38
42
|
def address_id=(_)
|
39
43
|
end
|
40
44
|
|
45
|
+
# ID of the card selected on the current user's cart.
|
41
46
|
sig { returns(T.nilable(String)) }
|
42
47
|
def card_id
|
43
48
|
end
|
@@ -46,6 +51,7 @@ module TerminalShop
|
|
46
51
|
def card_id=(_)
|
47
52
|
end
|
48
53
|
|
54
|
+
# Shipping information for the current user's cart.
|
49
55
|
sig { returns(T.nilable(TerminalShop::Models::CartAPI::Shipping)) }
|
50
56
|
def shipping
|
51
57
|
end
|
@@ -54,6 +60,7 @@ module TerminalShop
|
|
54
60
|
def shipping=(_)
|
55
61
|
end
|
56
62
|
|
63
|
+
# The current Terminal shop user's cart.
|
57
64
|
sig do
|
58
65
|
params(
|
59
66
|
amount: TerminalShop::Models::CartAPI::Amount,
|
@@ -85,6 +92,7 @@ module TerminalShop
|
|
85
92
|
end
|
86
93
|
|
87
94
|
class Amount < TerminalShop::BaseModel
|
95
|
+
# Subtotal of the current user's cart, in cents (USD).
|
88
96
|
sig { returns(Integer) }
|
89
97
|
def subtotal
|
90
98
|
end
|
@@ -93,6 +101,7 @@ module TerminalShop
|
|
93
101
|
def subtotal=(_)
|
94
102
|
end
|
95
103
|
|
104
|
+
# Shipping amount of the current user's cart, in cents (USD).
|
96
105
|
sig { returns(T.nilable(Integer)) }
|
97
106
|
def shipping
|
98
107
|
end
|
@@ -101,6 +110,7 @@ module TerminalShop
|
|
101
110
|
def shipping=(_)
|
102
111
|
end
|
103
112
|
|
113
|
+
# Total amount after any discounts, in cents (USD).
|
104
114
|
sig { returns(T.nilable(Integer)) }
|
105
115
|
def total
|
106
116
|
end
|
@@ -109,6 +119,7 @@ module TerminalShop
|
|
109
119
|
def total=(_)
|
110
120
|
end
|
111
121
|
|
122
|
+
# The subtotal and shipping amounts for the current user's cart.
|
112
123
|
sig { params(subtotal: Integer, shipping: Integer, total: Integer).returns(T.attached_class) }
|
113
124
|
def self.new(subtotal:, shipping: nil, total: nil)
|
114
125
|
end
|
@@ -119,6 +130,7 @@ module TerminalShop
|
|
119
130
|
end
|
120
131
|
|
121
132
|
class Item < TerminalShop::BaseModel
|
133
|
+
# Unique object identifier. The format and length of IDs may change over time.
|
122
134
|
sig { returns(String) }
|
123
135
|
def id
|
124
136
|
end
|
@@ -127,6 +139,7 @@ module TerminalShop
|
|
127
139
|
def id=(_)
|
128
140
|
end
|
129
141
|
|
142
|
+
# ID of the product variant for this item in the current user's cart.
|
130
143
|
sig { returns(String) }
|
131
144
|
def product_variant_id
|
132
145
|
end
|
@@ -135,6 +148,7 @@ module TerminalShop
|
|
135
148
|
def product_variant_id=(_)
|
136
149
|
end
|
137
150
|
|
151
|
+
# Quantity of the item in the current user's cart.
|
138
152
|
sig { returns(Integer) }
|
139
153
|
def quantity
|
140
154
|
end
|
@@ -143,6 +157,7 @@ module TerminalShop
|
|
143
157
|
def quantity=(_)
|
144
158
|
end
|
145
159
|
|
160
|
+
# Subtotal of the item in the current user's cart, in cents (USD).
|
146
161
|
sig { returns(Integer) }
|
147
162
|
def subtotal
|
148
163
|
end
|
@@ -151,6 +166,7 @@ module TerminalShop
|
|
151
166
|
def subtotal=(_)
|
152
167
|
end
|
153
168
|
|
169
|
+
# An item in the current Terminal shop user's cart.
|
154
170
|
sig do
|
155
171
|
params(id: String, product_variant_id: String, quantity: Integer, subtotal: Integer)
|
156
172
|
.returns(T.attached_class)
|
@@ -166,6 +182,7 @@ module TerminalShop
|
|
166
182
|
end
|
167
183
|
|
168
184
|
class Shipping < TerminalShop::BaseModel
|
185
|
+
# Shipping service name.
|
169
186
|
sig { returns(T.nilable(String)) }
|
170
187
|
def service
|
171
188
|
end
|
@@ -174,6 +191,7 @@ module TerminalShop
|
|
174
191
|
def service=(_)
|
175
192
|
end
|
176
193
|
|
194
|
+
# Shipping timeframe provided by the shipping carrier.
|
177
195
|
sig { returns(T.nilable(String)) }
|
178
196
|
def timeframe
|
179
197
|
end
|
@@ -182,6 +200,7 @@ module TerminalShop
|
|
182
200
|
def timeframe=(_)
|
183
201
|
end
|
184
202
|
|
203
|
+
# Shipping information for the current user's cart.
|
185
204
|
sig { params(service: String, timeframe: String).returns(T.attached_class) }
|
186
205
|
def self.new(service: nil, timeframe: nil)
|
187
206
|
end
|
@@ -6,6 +6,7 @@ module TerminalShop
|
|
6
6
|
extend TerminalShop::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
|
+
# ID of the product variant to add to the cart.
|
9
10
|
sig { returns(String) }
|
10
11
|
def product_variant_id
|
11
12
|
end
|
@@ -14,6 +15,7 @@ module TerminalShop
|
|
14
15
|
def product_variant_id=(_)
|
15
16
|
end
|
16
17
|
|
18
|
+
# Quantity of the item to add to the cart.
|
17
19
|
sig { returns(Integer) }
|
18
20
|
def quantity
|
19
21
|
end
|