terminal-shop 1.6.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.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -1
  3. data/lib/terminal-shop/base_client.rb +36 -46
  4. data/lib/terminal-shop/base_model.rb +88 -128
  5. data/lib/terminal-shop/base_page.rb +18 -18
  6. data/lib/terminal-shop/client.rb +1 -3
  7. data/lib/terminal-shop/errors.rb +12 -17
  8. data/lib/terminal-shop/extern.rb +1 -4
  9. data/lib/terminal-shop/models/region.rb +15 -0
  10. data/lib/terminal-shop/models/subscription.rb +6 -0
  11. data/lib/terminal-shop/models/view_init_response.rb +3 -13
  12. data/lib/terminal-shop/pooled_net_requester.rb +19 -21
  13. data/lib/terminal-shop/request_options.rb +4 -11
  14. data/lib/terminal-shop/resources/address.rb +0 -5
  15. data/lib/terminal-shop/resources/app.rb +0 -5
  16. data/lib/terminal-shop/resources/card.rb +0 -6
  17. data/lib/terminal-shop/resources/cart.rb +0 -7
  18. data/lib/terminal-shop/resources/email.rb +0 -2
  19. data/lib/terminal-shop/resources/order.rb +0 -4
  20. data/lib/terminal-shop/resources/product.rb +0 -3
  21. data/lib/terminal-shop/resources/profile.rb +0 -3
  22. data/lib/terminal-shop/resources/subscription.rb +0 -5
  23. data/lib/terminal-shop/resources/token.rb +0 -5
  24. data/lib/terminal-shop/resources/view.rb +0 -2
  25. data/lib/terminal-shop/util.rb +44 -71
  26. data/lib/terminal-shop/version.rb +1 -1
  27. data/lib/terminal-shop.rb +2 -0
  28. data/manifest.yaml +1 -0
  29. data/rbi/lib/terminal-shop/base_client.rbi +23 -0
  30. data/rbi/lib/terminal-shop/base_model.rbi +178 -52
  31. data/rbi/lib/terminal-shop/base_page.rbi +1 -2
  32. data/rbi/lib/terminal-shop/client.rbi +11 -0
  33. data/rbi/lib/terminal-shop/errors.rbi +33 -0
  34. data/rbi/lib/terminal-shop/extern.rbi +1 -1
  35. data/rbi/lib/terminal-shop/models/address.rbi +10 -0
  36. data/rbi/lib/terminal-shop/models/address_create_params.rbi +8 -0
  37. data/rbi/lib/terminal-shop/models/address_create_response.rbi +1 -0
  38. data/rbi/lib/terminal-shop/models/address_get_response.rbi +1 -0
  39. data/rbi/lib/terminal-shop/models/address_list_response.rbi +1 -0
  40. data/rbi/lib/terminal-shop/models/app.rbi +5 -0
  41. data/rbi/lib/terminal-shop/models/app_create_response.rbi +2 -0
  42. data/rbi/lib/terminal-shop/models/app_get_response.rbi +1 -0
  43. data/rbi/lib/terminal-shop/models/app_list_response.rbi +1 -0
  44. data/rbi/lib/terminal-shop/models/card.rbi +8 -0
  45. data/rbi/lib/terminal-shop/models/card_collect_response.rbi +4 -0
  46. data/rbi/lib/terminal-shop/models/card_create_params.rbi +2 -0
  47. data/rbi/lib/terminal-shop/models/card_create_response.rbi +1 -0
  48. data/rbi/lib/terminal-shop/models/card_get_response.rbi +1 -0
  49. data/rbi/lib/terminal-shop/models/card_list_response.rbi +1 -0
  50. data/rbi/lib/terminal-shop/models/cart.rbi +19 -0
  51. data/rbi/lib/terminal-shop/models/cart_convert_response.rbi +1 -0
  52. data/rbi/lib/terminal-shop/models/cart_get_response.rbi +1 -0
  53. data/rbi/lib/terminal-shop/models/cart_set_address_params.rbi +1 -0
  54. data/rbi/lib/terminal-shop/models/cart_set_card_params.rbi +1 -0
  55. data/rbi/lib/terminal-shop/models/cart_set_item_params.rbi +2 -0
  56. data/rbi/lib/terminal-shop/models/cart_set_item_response.rbi +1 -0
  57. data/rbi/lib/terminal-shop/models/email_create_params.rbi +1 -0
  58. data/rbi/lib/terminal-shop/models/order.rbi +28 -0
  59. data/rbi/lib/terminal-shop/models/order_create_params.rbi +3 -0
  60. data/rbi/lib/terminal-shop/models/order_create_response.rbi +1 -0
  61. data/rbi/lib/terminal-shop/models/order_get_response.rbi +1 -0
  62. data/rbi/lib/terminal-shop/models/order_list_response.rbi +1 -0
  63. data/rbi/lib/terminal-shop/models/product.rbi +12 -6
  64. data/rbi/lib/terminal-shop/models/product_get_response.rbi +1 -0
  65. data/rbi/lib/terminal-shop/models/product_list_response.rbi +1 -0
  66. data/rbi/lib/terminal-shop/models/product_variant.rbi +4 -0
  67. data/rbi/lib/terminal-shop/models/profile.rbi +8 -0
  68. data/rbi/lib/terminal-shop/models/profile_me_response.rbi +1 -0
  69. data/rbi/lib/terminal-shop/models/profile_update_response.rbi +1 -0
  70. data/rbi/lib/terminal-shop/models/region.rbi +15 -0
  71. data/rbi/lib/terminal-shop/models/subscription.rbi +18 -11
  72. data/rbi/lib/terminal-shop/models/subscription_get_response.rbi +1 -0
  73. data/rbi/lib/terminal-shop/models/subscription_list_response.rbi +1 -0
  74. data/rbi/lib/terminal-shop/models/token.rbi +5 -0
  75. data/rbi/lib/terminal-shop/models/token_create_response.rbi +3 -0
  76. data/rbi/lib/terminal-shop/models/token_get_response.rbi +2 -0
  77. data/rbi/lib/terminal-shop/models/token_list_response.rbi +1 -0
  78. data/rbi/lib/terminal-shop/models/view_init_response.rbi +5 -13
  79. data/rbi/lib/terminal-shop/pooled_net_requester.rbi +10 -3
  80. data/rbi/lib/terminal-shop/request_options.rbi +21 -2
  81. data/rbi/lib/terminal-shop/resources/address.rbi +22 -2
  82. data/rbi/lib/terminal-shop/resources/app.rbi +14 -2
  83. data/rbi/lib/terminal-shop/resources/card.rbi +22 -3
  84. data/rbi/lib/terminal-shop/resources/cart.rbi +23 -3
  85. data/rbi/lib/terminal-shop/resources/email.rbi +6 -1
  86. data/rbi/lib/terminal-shop/resources/order.rbi +17 -2
  87. data/rbi/lib/terminal-shop/resources/product.rbi +7 -1
  88. data/rbi/lib/terminal-shop/resources/profile.rbi +2 -0
  89. data/rbi/lib/terminal-shop/resources/subscription.rbi +21 -2
  90. data/rbi/lib/terminal-shop/resources/token.rbi +14 -2
  91. data/rbi/lib/terminal-shop/resources/view.rbi +2 -0
  92. data/rbi/lib/terminal-shop/util.rbi +55 -8
  93. data/rbi/lib/terminal-shop/version.rbi +1 -1
  94. data/sig/terminal-shop/base_client.rbs +6 -1
  95. data/sig/terminal-shop/base_model.rbs +8 -6
  96. data/sig/terminal-shop/errors.rbs +4 -4
  97. data/sig/terminal-shop/models/region.rbs +12 -0
  98. data/sig/terminal-shop/models/subscription.rbs +1 -1
  99. data/sig/terminal-shop/models/view_init_response.rbs +3 -12
  100. data/sig/terminal-shop/pooled_net_requester.rbs +7 -2
  101. data/sig/terminal-shop/util.rbs +4 -4
  102. data/sig/terminal-shop/version.rbs +1 -1
  103. metadata +7 -4
@@ -5,6 +5,10 @@ module TerminalShop
5
5
  sig { returns(T.nilable(StandardError)) }
6
6
  def cause
7
7
  end
8
+
9
+ sig { params(_: T.nilable(StandardError)).returns(T.nilable(StandardError)) }
10
+ def cause=(_)
11
+ end
8
12
  end
9
13
 
10
14
  class ConversionError < TerminalShop::Error
@@ -15,14 +19,27 @@ module TerminalShop
15
19
  def url
16
20
  end
17
21
 
22
+ sig { params(_: URI::Generic).returns(URI::Generic) }
23
+ def url=(_)
24
+ end
25
+
18
26
  sig { returns(T.nilable(Integer)) }
19
27
  def status
20
28
  end
21
29
 
30
+ sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) }
31
+ def status=(_)
32
+ end
33
+
22
34
  sig { returns(T.nilable(T.anything)) }
23
35
  def body
24
36
  end
25
37
 
38
+ sig { params(_: T.nilable(T.anything)).returns(T.nilable(T.anything)) }
39
+ def body=(_)
40
+ end
41
+
42
+ # @api private
26
43
  sig do
27
44
  params(
28
45
  url: URI::Generic,
@@ -43,10 +60,19 @@ module TerminalShop
43
60
  def status
44
61
  end
45
62
 
63
+ sig { params(_: NilClass).void }
64
+ def status=(_)
65
+ end
66
+
46
67
  sig { void }
47
68
  def body
48
69
  end
49
70
 
71
+ sig { params(_: NilClass).void }
72
+ def body=(_)
73
+ end
74
+
75
+ # @api private
50
76
  sig do
51
77
  params(
52
78
  url: URI::Generic,
@@ -63,6 +89,7 @@ module TerminalShop
63
89
  end
64
90
 
65
91
  class APITimeoutError < TerminalShop::APIConnectionError
92
+ # @api private
66
93
  sig do
67
94
  params(
68
95
  url: URI::Generic,
@@ -79,6 +106,7 @@ module TerminalShop
79
106
  end
80
107
 
81
108
  class APIStatusError < TerminalShop::APIError
109
+ # @api private
82
110
  sig do
83
111
  params(
84
112
  url: URI::Generic,
@@ -97,6 +125,11 @@ module TerminalShop
97
125
  def status
98
126
  end
99
127
 
128
+ sig { params(_: Integer).returns(Integer) }
129
+ def status=(_)
130
+ end
131
+
132
+ # @api private
100
133
  sig do
101
134
  params(
102
135
  url: URI::Generic,
@@ -1,7 +1,7 @@
1
1
  # typed: strong
2
2
 
3
3
  module TerminalShop
4
+ # @api private
4
5
  module Extern
5
- abstract!
6
6
  end
7
7
  end
@@ -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 AddressCreateResponse < TerminalShop::BaseModel
6
+ # Shipping address ID.
6
7
  sig { returns(String) }
7
8
  def data
8
9
  end
@@ -3,6 +3,7 @@
3
3
  module TerminalShop
4
4
  module Models
5
5
  class AddressGetResponse < TerminalShop::BaseModel
6
+ # Physical address associated with a Terminal shop user.
6
7
  sig { returns(TerminalShop::Models::AddressAPI) }
7
8
  def data
8
9
  end
@@ -3,6 +3,7 @@
3
3
  module TerminalShop
4
4
  module Models
5
5
  class AddressListResponse < TerminalShop::BaseModel
6
+ # Shipping addresses.
6
7
  sig { returns(T::Array[TerminalShop::Models::AddressAPI]) }
7
8
  def data
8
9
  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 AppGetResponse < TerminalShop::BaseModel
6
+ # A Terminal App used for configuring an OAuth 2.0 client.
6
7
  sig { returns(TerminalShop::Models::AppAPI) }
7
8
  def data
8
9
  end
@@ -3,6 +3,7 @@
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
  def data
8
9
  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 CardCreateResponse < TerminalShop::BaseModel
6
+ # ID of the card.
6
7
  sig { returns(String) }
7
8
  def data
8
9
  end
@@ -3,6 +3,7 @@
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
  def data
8
9
  end
@@ -3,6 +3,7 @@
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
  def data
8
9
  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
@@ -3,6 +3,7 @@
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
  def data
8
9
  end
@@ -3,6 +3,7 @@
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
  def data
8
9
  end
@@ -6,6 +6,7 @@ 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
  def address_id
11
12
  end
@@ -6,6 +6,7 @@ module TerminalShop
6
6
  extend TerminalShop::RequestParameters::Converter
7
7
  include TerminalShop::RequestParameters
8
8
 
9
+ # ID of the credit card to set for the current user's cart.
9
10
  sig { returns(String) }
10
11
  def card_id
11
12
  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
@@ -3,6 +3,7 @@
3
3
  module TerminalShop
4
4
  module Models
5
5
  class CartSetItemResponse < TerminalShop::BaseModel
6
+ # The current Terminal shop user's cart.
6
7
  sig { returns(TerminalShop::Models::CartAPI) }
7
8
  def data
8
9
  end
@@ -6,6 +6,7 @@ module TerminalShop
6
6
  extend TerminalShop::RequestParameters::Converter
7
7
  include TerminalShop::RequestParameters
8
8
 
9
+ # Email address to subscribe to Terminal updates with.
9
10
  sig { returns(String) }
10
11
  def email
11
12
  end