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
@@ -3,6 +3,7 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
module Resources
|
5
5
|
class Address
|
6
|
+
# Create and add a shipping address to the current user.
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
city: String,
|
@@ -13,48 +14,67 @@ module TerminalShop
|
|
13
14
|
phone: String,
|
14
15
|
province: String,
|
15
16
|
street2: String,
|
16
|
-
request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
17
|
+
request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
17
18
|
)
|
18
19
|
.returns(TerminalShop::Models::AddressCreateResponse)
|
19
20
|
end
|
20
21
|
def create(
|
22
|
+
# City of the address.
|
21
23
|
city:,
|
24
|
+
# ISO 3166-1 alpha-2 country code of the address.
|
22
25
|
country:,
|
26
|
+
# The recipient's name.
|
23
27
|
name:,
|
28
|
+
# Street of the address.
|
24
29
|
street1:,
|
30
|
+
# Zip code of the address.
|
25
31
|
zip:,
|
32
|
+
# Phone number of the recipient.
|
26
33
|
phone: nil,
|
34
|
+
# Province or state of the address.
|
27
35
|
province: nil,
|
36
|
+
# Apartment, suite, etc. of the address.
|
28
37
|
street2: nil,
|
29
38
|
request_options: {}
|
30
39
|
)
|
31
40
|
end
|
32
41
|
|
42
|
+
# Get the shipping addresses associated with the current user.
|
33
43
|
sig do
|
34
|
-
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
44
|
+
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash)))
|
35
45
|
.returns(TerminalShop::Models::AddressListResponse)
|
36
46
|
end
|
37
47
|
def list(request_options: {})
|
38
48
|
end
|
39
49
|
|
50
|
+
# Delete a shipping address from the current user.
|
40
51
|
sig do
|
41
52
|
params(
|
42
53
|
id: String,
|
43
|
-
request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
54
|
+
request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
44
55
|
)
|
45
56
|
.returns(TerminalShop::Models::AddressDeleteResponse)
|
46
57
|
end
|
47
|
-
def delete(
|
58
|
+
def delete(
|
59
|
+
# ID of the shipping address to delete.
|
60
|
+
id,
|
61
|
+
request_options: {}
|
62
|
+
)
|
48
63
|
end
|
49
64
|
|
65
|
+
# Get the shipping address with the given ID.
|
50
66
|
sig do
|
51
67
|
params(
|
52
68
|
id: String,
|
53
|
-
request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
69
|
+
request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
54
70
|
)
|
55
71
|
.returns(TerminalShop::Models::AddressGetResponse)
|
56
72
|
end
|
57
|
-
def get(
|
73
|
+
def get(
|
74
|
+
# ID of the shipping address to get.
|
75
|
+
id,
|
76
|
+
request_options: {}
|
77
|
+
)
|
58
78
|
end
|
59
79
|
|
60
80
|
sig { params(client: TerminalShop::Client).returns(T.attached_class) }
|
@@ -3,42 +3,54 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
module Resources
|
5
5
|
class App
|
6
|
+
# Create an app.
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
name: String,
|
9
10
|
redirect_uri: String,
|
10
|
-
request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
11
|
+
request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
11
12
|
)
|
12
13
|
.returns(TerminalShop::Models::AppCreateResponse)
|
13
14
|
end
|
14
15
|
def create(name:, redirect_uri:, request_options: {})
|
15
16
|
end
|
16
17
|
|
18
|
+
# List the current user's registered apps.
|
17
19
|
sig do
|
18
|
-
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
20
|
+
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash)))
|
19
21
|
.returns(TerminalShop::Models::AppListResponse)
|
20
22
|
end
|
21
23
|
def list(request_options: {})
|
22
24
|
end
|
23
25
|
|
26
|
+
# Delete the app with the given ID.
|
24
27
|
sig do
|
25
28
|
params(
|
26
29
|
id: String,
|
27
|
-
request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
30
|
+
request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
28
31
|
)
|
29
32
|
.returns(TerminalShop::Models::AppDeleteResponse)
|
30
33
|
end
|
31
|
-
def delete(
|
34
|
+
def delete(
|
35
|
+
# ID of the app to delete.
|
36
|
+
id,
|
37
|
+
request_options: {}
|
38
|
+
)
|
32
39
|
end
|
33
40
|
|
41
|
+
# Get the app with the given ID.
|
34
42
|
sig do
|
35
43
|
params(
|
36
44
|
id: String,
|
37
|
-
request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
45
|
+
request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
38
46
|
)
|
39
47
|
.returns(TerminalShop::Models::AppGetResponse)
|
40
48
|
end
|
41
|
-
def get(
|
49
|
+
def get(
|
50
|
+
# ID of the app to get.
|
51
|
+
id,
|
52
|
+
request_options: {}
|
53
|
+
)
|
42
54
|
end
|
43
55
|
|
44
56
|
sig { params(client: TerminalShop::Client).returns(T.attached_class) }
|
@@ -3,48 +3,67 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
module Resources
|
5
5
|
class Card
|
6
|
+
# Attach a credit card (tokenized via Stripe) to the current user.
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
token: String,
|
9
|
-
request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
10
|
+
request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
10
11
|
)
|
11
12
|
.returns(TerminalShop::Models::CardCreateResponse)
|
12
13
|
end
|
13
|
-
def create(
|
14
|
+
def create(
|
15
|
+
# Stripe card token. Learn how to
|
16
|
+
# [create one here](https://docs.stripe.com/api/tokens/create_card).
|
17
|
+
token:,
|
18
|
+
request_options: {}
|
19
|
+
)
|
14
20
|
end
|
15
21
|
|
22
|
+
# List the credit cards associated with the current user.
|
16
23
|
sig do
|
17
|
-
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
24
|
+
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash)))
|
18
25
|
.returns(TerminalShop::Models::CardListResponse)
|
19
26
|
end
|
20
27
|
def list(request_options: {})
|
21
28
|
end
|
22
29
|
|
30
|
+
# Delete a credit card associated with the current user.
|
23
31
|
sig do
|
24
32
|
params(
|
25
33
|
id: String,
|
26
|
-
request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
34
|
+
request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
27
35
|
)
|
28
36
|
.returns(TerminalShop::Models::CardDeleteResponse)
|
29
37
|
end
|
30
|
-
def delete(
|
38
|
+
def delete(
|
39
|
+
# ID of the card to delete.
|
40
|
+
id,
|
41
|
+
request_options: {}
|
42
|
+
)
|
31
43
|
end
|
32
44
|
|
45
|
+
# Create a temporary URL for collecting credit card information for the current
|
46
|
+
# user.
|
33
47
|
sig do
|
34
|
-
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
48
|
+
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash)))
|
35
49
|
.returns(TerminalShop::Models::CardCollectResponse)
|
36
50
|
end
|
37
51
|
def collect(request_options: {})
|
38
52
|
end
|
39
53
|
|
54
|
+
# Get a credit card by ID associated with the current user.
|
40
55
|
sig do
|
41
56
|
params(
|
42
57
|
id: String,
|
43
|
-
request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
58
|
+
request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
44
59
|
)
|
45
60
|
.returns(TerminalShop::Models::CardGetResponse)
|
46
61
|
end
|
47
|
-
def get(
|
62
|
+
def get(
|
63
|
+
# ID of the card to get.
|
64
|
+
id,
|
65
|
+
request_options: {}
|
66
|
+
)
|
48
67
|
end
|
49
68
|
|
50
69
|
sig { params(client: TerminalShop::Client).returns(T.attached_class) }
|
@@ -3,56 +3,76 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
module Resources
|
5
5
|
class Cart
|
6
|
+
# Clear the current user's cart.
|
6
7
|
sig do
|
7
|
-
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
8
|
+
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash)))
|
8
9
|
.returns(TerminalShop::Models::CartClearResponse)
|
9
10
|
end
|
10
11
|
def clear(request_options: {})
|
11
12
|
end
|
12
13
|
|
14
|
+
# Convert the current user's cart to an order.
|
13
15
|
sig do
|
14
|
-
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
16
|
+
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash)))
|
15
17
|
.returns(TerminalShop::Models::CartConvertResponse)
|
16
18
|
end
|
17
19
|
def convert(request_options: {})
|
18
20
|
end
|
19
21
|
|
22
|
+
# Get the current user's cart.
|
20
23
|
sig do
|
21
|
-
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
24
|
+
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash)))
|
22
25
|
.returns(TerminalShop::Models::CartGetResponse)
|
23
26
|
end
|
24
27
|
def get(request_options: {})
|
25
28
|
end
|
26
29
|
|
30
|
+
# Set the shipping address for the current user's cart.
|
27
31
|
sig do
|
28
32
|
params(
|
29
33
|
address_id: String,
|
30
|
-
request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
34
|
+
request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
31
35
|
)
|
32
36
|
.returns(TerminalShop::Models::CartSetAddressResponse)
|
33
37
|
end
|
34
|
-
def set_address(
|
38
|
+
def set_address(
|
39
|
+
# ID of the shipping address to set for the current user's cart.
|
40
|
+
address_id:,
|
41
|
+
request_options: {}
|
42
|
+
)
|
35
43
|
end
|
36
44
|
|
45
|
+
# Set the credit card for the current user's cart.
|
37
46
|
sig do
|
38
47
|
params(
|
39
48
|
card_id: String,
|
40
|
-
request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
49
|
+
request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
41
50
|
)
|
42
51
|
.returns(TerminalShop::Models::CartSetCardResponse)
|
43
52
|
end
|
44
|
-
def set_card(
|
53
|
+
def set_card(
|
54
|
+
# ID of the credit card to set for the current user's cart.
|
55
|
+
card_id:,
|
56
|
+
request_options: {}
|
57
|
+
)
|
45
58
|
end
|
46
59
|
|
60
|
+
# Add an item to the current user's cart.
|
47
61
|
sig do
|
48
62
|
params(
|
49
63
|
product_variant_id: String,
|
50
64
|
quantity: Integer,
|
51
|
-
request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
65
|
+
request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
52
66
|
)
|
53
67
|
.returns(TerminalShop::Models::CartSetItemResponse)
|
54
68
|
end
|
55
|
-
def set_item(
|
69
|
+
def set_item(
|
70
|
+
# ID of the product variant to add to the cart.
|
71
|
+
product_variant_id:,
|
72
|
+
# Quantity of the item to add to the cart.
|
73
|
+
quantity:,
|
74
|
+
request_options: {}
|
75
|
+
)
|
56
76
|
end
|
57
77
|
|
58
78
|
sig { params(client: TerminalShop::Client).returns(T.attached_class) }
|
@@ -3,14 +3,19 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
module Resources
|
5
5
|
class Email
|
6
|
+
# Subscribe to email updates from Terminal.
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
email: String,
|
9
|
-
request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
10
|
+
request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
10
11
|
)
|
11
12
|
.returns(TerminalShop::Models::EmailCreateResponse)
|
12
13
|
end
|
13
|
-
def create(
|
14
|
+
def create(
|
15
|
+
# Email address to subscribe to Terminal updates with.
|
16
|
+
email:,
|
17
|
+
request_options: {}
|
18
|
+
)
|
14
19
|
end
|
15
20
|
|
16
21
|
sig { params(client: TerminalShop::Client).returns(T.attached_class) }
|
@@ -3,33 +3,48 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
module Resources
|
5
5
|
class Order
|
6
|
+
# Create an order without a cart. The order will be placed immediately.
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
address_id: String,
|
9
10
|
card_id: String,
|
10
11
|
variants: T::Hash[Symbol, Integer],
|
11
|
-
request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
12
|
+
request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
12
13
|
)
|
13
14
|
.returns(TerminalShop::Models::OrderCreateResponse)
|
14
15
|
end
|
15
|
-
def create(
|
16
|
+
def create(
|
17
|
+
# Shipping address ID.
|
18
|
+
address_id:,
|
19
|
+
# Card ID.
|
20
|
+
card_id:,
|
21
|
+
# Product variants to include in the order, along with their quantities.
|
22
|
+
variants:,
|
23
|
+
request_options: {}
|
24
|
+
)
|
16
25
|
end
|
17
26
|
|
27
|
+
# List the orders associated with the current user.
|
18
28
|
sig do
|
19
|
-
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
29
|
+
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash)))
|
20
30
|
.returns(TerminalShop::Models::OrderListResponse)
|
21
31
|
end
|
22
32
|
def list(request_options: {})
|
23
33
|
end
|
24
34
|
|
35
|
+
# Get the order with the given ID.
|
25
36
|
sig do
|
26
37
|
params(
|
27
38
|
id: String,
|
28
|
-
request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
39
|
+
request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
29
40
|
)
|
30
41
|
.returns(TerminalShop::Models::OrderGetResponse)
|
31
42
|
end
|
32
|
-
def get(
|
43
|
+
def get(
|
44
|
+
# ID of the order to get.
|
45
|
+
id,
|
46
|
+
request_options: {}
|
47
|
+
)
|
33
48
|
end
|
34
49
|
|
35
50
|
sig { params(client: TerminalShop::Client).returns(T.attached_class) }
|
@@ -3,21 +3,27 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
module Resources
|
5
5
|
class Product
|
6
|
+
# List all products for sale in the Terminal shop.
|
6
7
|
sig do
|
7
|
-
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
8
|
+
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash)))
|
8
9
|
.returns(TerminalShop::Models::ProductListResponse)
|
9
10
|
end
|
10
11
|
def list(request_options: {})
|
11
12
|
end
|
12
13
|
|
14
|
+
# Get a product by ID from the Terminal shop.
|
13
15
|
sig do
|
14
16
|
params(
|
15
17
|
id: String,
|
16
|
-
request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
18
|
+
request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
17
19
|
)
|
18
20
|
.returns(TerminalShop::Models::ProductGetResponse)
|
19
21
|
end
|
20
|
-
def get(
|
22
|
+
def get(
|
23
|
+
# ID of the product to get.
|
24
|
+
id,
|
25
|
+
request_options: {}
|
26
|
+
)
|
21
27
|
end
|
22
28
|
|
23
29
|
sig { params(client: TerminalShop::Client).returns(T.attached_class) }
|
@@ -3,19 +3,21 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
module Resources
|
5
5
|
class Profile
|
6
|
+
# Update the current user's profile.
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
email: String,
|
9
10
|
name: String,
|
10
|
-
request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
11
|
+
request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
11
12
|
)
|
12
13
|
.returns(TerminalShop::Models::ProfileUpdateResponse)
|
13
14
|
end
|
14
15
|
def update(email:, name:, request_options: {})
|
15
16
|
end
|
16
17
|
|
18
|
+
# Get the current user's profile.
|
17
19
|
sig do
|
18
|
-
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
20
|
+
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash)))
|
19
21
|
.returns(TerminalShop::Models::ProfileMeResponse)
|
20
22
|
end
|
21
23
|
def me(request_options: {})
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
module Resources
|
5
5
|
class Subscription
|
6
|
+
# Create a subscription for the current user.
|
6
7
|
sig do
|
7
8
|
params(
|
8
9
|
id: String,
|
@@ -13,49 +14,68 @@ module TerminalShop
|
|
13
14
|
next_: String,
|
14
15
|
schedule: T.any(
|
15
16
|
TerminalShop::Models::SubscriptionAPI::Schedule::Fixed,
|
17
|
+
TerminalShop::Util::AnyHash,
|
16
18
|
TerminalShop::Models::SubscriptionAPI::Schedule::Weekly
|
17
19
|
),
|
18
|
-
request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
20
|
+
request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
19
21
|
)
|
20
22
|
.returns(TerminalShop::Models::SubscriptionCreateResponse)
|
21
23
|
end
|
22
24
|
def create(
|
25
|
+
# Unique object identifier. The format and length of IDs may change over time.
|
23
26
|
id:,
|
27
|
+
# ID of the shipping address used for the subscription.
|
24
28
|
address_id:,
|
29
|
+
# ID of the card used for the subscription.
|
25
30
|
card_id:,
|
31
|
+
# ID of the product variant being subscribed to.
|
26
32
|
product_variant_id:,
|
33
|
+
# Quantity of the subscription.
|
27
34
|
quantity:,
|
35
|
+
# Next shipment and billing date for the subscription.
|
28
36
|
next_: nil,
|
37
|
+
# Schedule of the subscription.
|
29
38
|
schedule: nil,
|
30
39
|
request_options: {}
|
31
40
|
)
|
32
41
|
end
|
33
42
|
|
43
|
+
# List the subscriptions associated with the current user.
|
34
44
|
sig do
|
35
|
-
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
45
|
+
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash)))
|
36
46
|
.returns(TerminalShop::Models::SubscriptionListResponse)
|
37
47
|
end
|
38
48
|
def list(request_options: {})
|
39
49
|
end
|
40
50
|
|
51
|
+
# Cancel a subscription for the current user.
|
41
52
|
sig do
|
42
53
|
params(
|
43
54
|
id: String,
|
44
|
-
request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
55
|
+
request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
45
56
|
)
|
46
57
|
.returns(TerminalShop::Models::SubscriptionDeleteResponse)
|
47
58
|
end
|
48
|
-
def delete(
|
59
|
+
def delete(
|
60
|
+
# ID of the subscription to cancel.
|
61
|
+
id,
|
62
|
+
request_options: {}
|
63
|
+
)
|
49
64
|
end
|
50
65
|
|
66
|
+
# Get the subscription with the given ID.
|
51
67
|
sig do
|
52
68
|
params(
|
53
69
|
id: String,
|
54
|
-
request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
70
|
+
request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
55
71
|
)
|
56
72
|
.returns(TerminalShop::Models::SubscriptionGetResponse)
|
57
73
|
end
|
58
|
-
def get(
|
74
|
+
def get(
|
75
|
+
# ID of the subscription to get.
|
76
|
+
id,
|
77
|
+
request_options: {}
|
78
|
+
)
|
59
79
|
end
|
60
80
|
|
61
81
|
sig { params(client: TerminalShop::Client).returns(T.attached_class) }
|
@@ -3,38 +3,50 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
module Resources
|
5
5
|
class Token
|
6
|
+
# Create a personal access token.
|
6
7
|
sig do
|
7
|
-
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
8
|
+
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash)))
|
8
9
|
.returns(TerminalShop::Models::TokenCreateResponse)
|
9
10
|
end
|
10
11
|
def create(request_options: {})
|
11
12
|
end
|
12
13
|
|
14
|
+
# List the current user's personal access tokens.
|
13
15
|
sig do
|
14
|
-
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
16
|
+
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash)))
|
15
17
|
.returns(TerminalShop::Models::TokenListResponse)
|
16
18
|
end
|
17
19
|
def list(request_options: {})
|
18
20
|
end
|
19
21
|
|
22
|
+
# Delete the personal access token with the given ID.
|
20
23
|
sig do
|
21
24
|
params(
|
22
25
|
id: String,
|
23
|
-
request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
26
|
+
request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
24
27
|
)
|
25
28
|
.returns(TerminalShop::Models::TokenDeleteResponse)
|
26
29
|
end
|
27
|
-
def delete(
|
30
|
+
def delete(
|
31
|
+
# ID of the personal token to delete.
|
32
|
+
id,
|
33
|
+
request_options: {}
|
34
|
+
)
|
28
35
|
end
|
29
36
|
|
37
|
+
# Get the personal access token with the given ID.
|
30
38
|
sig do
|
31
39
|
params(
|
32
40
|
id: String,
|
33
|
-
request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
41
|
+
request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash))
|
34
42
|
)
|
35
43
|
.returns(TerminalShop::Models::TokenGetResponse)
|
36
44
|
end
|
37
|
-
def get(
|
45
|
+
def get(
|
46
|
+
# ID of the personal token to get.
|
47
|
+
id,
|
48
|
+
request_options: {}
|
49
|
+
)
|
38
50
|
end
|
39
51
|
|
40
52
|
sig { params(client: TerminalShop::Client).returns(T.attached_class) }
|
@@ -3,8 +3,10 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
module Resources
|
5
5
|
class View
|
6
|
+
# Get initial app data, including user, products, cart, addresses, cards,
|
7
|
+
# subscriptions, and orders.
|
6
8
|
sig do
|
7
|
-
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions,
|
9
|
+
params(request_options: T.nilable(T.any(TerminalShop::RequestOptions, TerminalShop::Util::AnyHash)))
|
8
10
|
.returns(TerminalShop::Models::ViewInitResponse)
|
9
11
|
end
|
10
12
|
def init(request_options: {})
|