terminal-shop 0.1.0.pre.alpha.15 → 1.1.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 (171) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +27 -19
  3. data/lib/terminal-shop/base_client.rb +35 -55
  4. data/lib/terminal-shop/base_model.rb +457 -438
  5. data/lib/terminal-shop/base_page.rb +2 -2
  6. data/lib/terminal-shop/client.rb +1 -1
  7. data/lib/terminal-shop/errors.rb +3 -2
  8. data/lib/terminal-shop/models/address_get_params.rb +18 -0
  9. data/lib/terminal-shop/models/address_get_response.rb +20 -0
  10. data/lib/terminal-shop/models/app_create_params.rb +14 -2
  11. data/lib/terminal-shop/models/card_get_params.rb +18 -0
  12. data/lib/terminal-shop/models/card_get_response.rb +20 -0
  13. data/lib/terminal-shop/models/cart.rb +35 -2
  14. data/lib/terminal-shop/models/cart_convert_params.rb +11 -1
  15. data/lib/terminal-shop/models/cart_redeem_gift_card_params.rb +24 -0
  16. data/lib/terminal-shop/models/cart_redeem_gift_card_response.rb +48 -0
  17. data/lib/terminal-shop/models/cart_remove_gift_card_params.rb +18 -0
  18. data/lib/terminal-shop/models/cart_remove_gift_card_response.rb +19 -0
  19. data/lib/terminal-shop/models/product.rb +72 -46
  20. data/lib/terminal-shop/models/product_get_params.rb +18 -0
  21. data/lib/terminal-shop/models/product_get_response.rb +20 -0
  22. data/lib/terminal-shop/models/profile_update_params.rb +7 -9
  23. data/lib/terminal-shop/models/subscription.rb +0 -10
  24. data/lib/terminal-shop/models/subscription_get_params.rb +18 -0
  25. data/lib/terminal-shop/models/subscription_get_response.rb +20 -0
  26. data/lib/terminal-shop/pooled_net_requester.rb +14 -9
  27. data/lib/terminal-shop/resources/address.rb +19 -0
  28. data/lib/terminal-shop/resources/app.rb +2 -6
  29. data/lib/terminal-shop/resources/card.rb +19 -0
  30. data/lib/terminal-shop/resources/cart.rb +43 -1
  31. data/lib/terminal-shop/resources/product.rb +19 -0
  32. data/lib/terminal-shop/resources/profile.rb +3 -3
  33. data/lib/terminal-shop/resources/subscription.rb +19 -0
  34. data/lib/terminal-shop/util.rb +135 -1
  35. data/lib/terminal-shop/version.rb +1 -1
  36. data/lib/terminal-shop.rb +13 -1
  37. data/rbi/lib/terminal-shop/base_client.rbi +29 -35
  38. data/rbi/lib/terminal-shop/base_model.rbi +235 -217
  39. data/rbi/lib/terminal-shop/base_page.rbi +2 -2
  40. data/rbi/lib/terminal-shop/client.rbi +2 -2
  41. data/rbi/lib/terminal-shop/errors.rbi +11 -10
  42. data/rbi/lib/terminal-shop/models/address.rbi +2 -2
  43. data/rbi/lib/terminal-shop/models/address_create_params.rbi +3 -13
  44. data/rbi/lib/terminal-shop/models/address_create_response.rbi +2 -2
  45. data/rbi/lib/terminal-shop/models/address_delete_params.rbi +5 -2
  46. data/rbi/lib/terminal-shop/models/address_delete_response.rbi +2 -2
  47. data/rbi/lib/terminal-shop/models/address_get_params.rbi +21 -0
  48. data/rbi/lib/terminal-shop/models/address_get_response.rbi +23 -0
  49. data/rbi/lib/terminal-shop/models/address_list_params.rbi +5 -2
  50. data/rbi/lib/terminal-shop/models/address_list_response.rbi +2 -2
  51. data/rbi/lib/terminal-shop/models/app.rbi +2 -2
  52. data/rbi/lib/terminal-shop/models/app_create_params.rbi +29 -4
  53. data/rbi/lib/terminal-shop/models/app_create_response.rbi +4 -4
  54. data/rbi/lib/terminal-shop/models/app_delete_params.rbi +5 -2
  55. data/rbi/lib/terminal-shop/models/app_delete_response.rbi +2 -2
  56. data/rbi/lib/terminal-shop/models/app_get_params.rbi +5 -2
  57. data/rbi/lib/terminal-shop/models/app_get_response.rbi +2 -2
  58. data/rbi/lib/terminal-shop/models/app_list_params.rbi +5 -2
  59. data/rbi/lib/terminal-shop/models/app_list_response.rbi +2 -2
  60. data/rbi/lib/terminal-shop/models/card.rbi +4 -4
  61. data/rbi/lib/terminal-shop/models/card_collect_params.rbi +5 -2
  62. data/rbi/lib/terminal-shop/models/card_collect_response.rbi +4 -4
  63. data/rbi/lib/terminal-shop/models/card_create_params.rbi +2 -2
  64. data/rbi/lib/terminal-shop/models/card_create_response.rbi +2 -2
  65. data/rbi/lib/terminal-shop/models/card_delete_params.rbi +5 -2
  66. data/rbi/lib/terminal-shop/models/card_delete_response.rbi +2 -2
  67. data/rbi/lib/terminal-shop/models/card_get_params.rbi +21 -0
  68. data/rbi/lib/terminal-shop/models/card_get_response.rbi +23 -0
  69. data/rbi/lib/terminal-shop/models/card_list_params.rbi +5 -2
  70. data/rbi/lib/terminal-shop/models/card_list_response.rbi +2 -2
  71. data/rbi/lib/terminal-shop/models/cart.rbi +45 -9
  72. data/rbi/lib/terminal-shop/models/cart_convert_params.rbi +17 -3
  73. data/rbi/lib/terminal-shop/models/cart_convert_response.rbi +2 -2
  74. data/rbi/lib/terminal-shop/models/cart_get_params.rbi +5 -2
  75. data/rbi/lib/terminal-shop/models/cart_get_response.rbi +2 -2
  76. data/rbi/lib/terminal-shop/models/cart_redeem_gift_card_params.rbi +32 -0
  77. data/rbi/lib/terminal-shop/models/cart_redeem_gift_card_response.rbi +66 -0
  78. data/rbi/lib/terminal-shop/models/cart_remove_gift_card_params.rbi +21 -0
  79. data/rbi/lib/terminal-shop/models/cart_remove_gift_card_response.rbi +23 -0
  80. data/rbi/lib/terminal-shop/models/cart_set_address_params.rbi +2 -2
  81. data/rbi/lib/terminal-shop/models/cart_set_address_response.rbi +2 -2
  82. data/rbi/lib/terminal-shop/models/cart_set_card_params.rbi +2 -2
  83. data/rbi/lib/terminal-shop/models/cart_set_card_response.rbi +2 -2
  84. data/rbi/lib/terminal-shop/models/cart_set_item_params.rbi +2 -2
  85. data/rbi/lib/terminal-shop/models/cart_set_item_response.rbi +2 -2
  86. data/rbi/lib/terminal-shop/models/email_create_params.rbi +2 -2
  87. data/rbi/lib/terminal-shop/models/email_create_response.rbi +2 -2
  88. data/rbi/lib/terminal-shop/models/order.rbi +10 -10
  89. data/rbi/lib/terminal-shop/models/order_create_params.rbi +2 -2
  90. data/rbi/lib/terminal-shop/models/order_create_response.rbi +2 -2
  91. data/rbi/lib/terminal-shop/models/order_get_params.rbi +5 -2
  92. data/rbi/lib/terminal-shop/models/order_get_response.rbi +2 -2
  93. data/rbi/lib/terminal-shop/models/order_list_params.rbi +5 -2
  94. data/rbi/lib/terminal-shop/models/order_list_response.rbi +2 -2
  95. data/rbi/lib/terminal-shop/models/product.rbi +88 -27
  96. data/rbi/lib/terminal-shop/models/product_get_params.rbi +21 -0
  97. data/rbi/lib/terminal-shop/models/product_get_response.rbi +23 -0
  98. data/rbi/lib/terminal-shop/models/product_list_params.rbi +5 -2
  99. data/rbi/lib/terminal-shop/models/product_list_response.rbi +2 -2
  100. data/rbi/lib/terminal-shop/models/product_variant.rbi +2 -2
  101. data/rbi/lib/terminal-shop/models/profile.rbi +4 -4
  102. data/rbi/lib/terminal-shop/models/profile_me_params.rbi +5 -2
  103. data/rbi/lib/terminal-shop/models/profile_me_response.rbi +2 -2
  104. data/rbi/lib/terminal-shop/models/profile_update_params.rbi +9 -14
  105. data/rbi/lib/terminal-shop/models/profile_update_response.rbi +2 -2
  106. data/rbi/lib/terminal-shop/models/subscription.rbi +15 -13
  107. data/rbi/lib/terminal-shop/models/subscription_create_params.rbi +5 -2
  108. data/rbi/lib/terminal-shop/models/subscription_create_response.rbi +2 -2
  109. data/rbi/lib/terminal-shop/models/subscription_delete_params.rbi +5 -2
  110. data/rbi/lib/terminal-shop/models/subscription_delete_response.rbi +2 -2
  111. data/rbi/lib/terminal-shop/models/subscription_get_params.rbi +21 -0
  112. data/rbi/lib/terminal-shop/models/subscription_get_response.rbi +23 -0
  113. data/rbi/lib/terminal-shop/models/subscription_list_params.rbi +5 -2
  114. data/rbi/lib/terminal-shop/models/subscription_list_response.rbi +2 -2
  115. data/rbi/lib/terminal-shop/models/token.rbi +2 -2
  116. data/rbi/lib/terminal-shop/models/token_create_params.rbi +5 -2
  117. data/rbi/lib/terminal-shop/models/token_create_response.rbi +4 -4
  118. data/rbi/lib/terminal-shop/models/token_delete_params.rbi +5 -2
  119. data/rbi/lib/terminal-shop/models/token_delete_response.rbi +2 -2
  120. data/rbi/lib/terminal-shop/models/token_get_params.rbi +5 -2
  121. data/rbi/lib/terminal-shop/models/token_get_response.rbi +2 -2
  122. data/rbi/lib/terminal-shop/models/token_list_params.rbi +5 -2
  123. data/rbi/lib/terminal-shop/models/token_list_response.rbi +2 -2
  124. data/rbi/lib/terminal-shop/models/view_init_params.rbi +5 -2
  125. data/rbi/lib/terminal-shop/models/view_init_response.rbi +5 -15
  126. data/rbi/lib/terminal-shop/pooled_net_requester.rbi +12 -10
  127. data/rbi/lib/terminal-shop/request_options.rbi +4 -0
  128. data/rbi/lib/terminal-shop/resources/address.rbi +12 -2
  129. data/rbi/lib/terminal-shop/resources/app.rbi +3 -5
  130. data/rbi/lib/terminal-shop/resources/card.rbi +12 -2
  131. data/rbi/lib/terminal-shop/resources/cart.rbi +24 -4
  132. data/rbi/lib/terminal-shop/resources/email.rbi +2 -2
  133. data/rbi/lib/terminal-shop/resources/order.rbi +2 -2
  134. data/rbi/lib/terminal-shop/resources/product.rbi +12 -2
  135. data/rbi/lib/terminal-shop/resources/profile.rbi +5 -5
  136. data/rbi/lib/terminal-shop/resources/subscription.rbi +12 -2
  137. data/rbi/lib/terminal-shop/resources/token.rbi +2 -2
  138. data/rbi/lib/terminal-shop/resources/view.rbi +2 -2
  139. data/rbi/lib/terminal-shop/util.rbi +153 -104
  140. data/rbi/lib/terminal-shop/version.rbi +1 -1
  141. data/sig/terminal-shop/base_client.rbs +3 -7
  142. data/sig/terminal-shop/base_page.rbs +1 -1
  143. data/sig/terminal-shop/errors.rbs +2 -1
  144. data/sig/terminal-shop/models/address_get_params.rbs +19 -0
  145. data/sig/terminal-shop/models/address_get_response.rbs +18 -0
  146. data/sig/terminal-shop/models/app_create_params.rbs +12 -3
  147. data/sig/terminal-shop/models/card_get_params.rbs +18 -0
  148. data/sig/terminal-shop/models/card_get_response.rbs +18 -0
  149. data/sig/terminal-shop/models/cart.rbs +27 -2
  150. data/sig/terminal-shop/models/cart_convert_params.rbs +10 -2
  151. data/sig/terminal-shop/models/cart_redeem_gift_card_params.rbs +25 -0
  152. data/sig/terminal-shop/models/cart_redeem_gift_card_response.rbs +47 -0
  153. data/sig/terminal-shop/models/cart_remove_gift_card_params.rbs +19 -0
  154. data/sig/terminal-shop/models/cart_remove_gift_card_response.rbs +18 -0
  155. data/sig/terminal-shop/models/product.rbs +58 -17
  156. data/sig/terminal-shop/models/product_get_params.rbs +19 -0
  157. data/sig/terminal-shop/models/product_get_response.rbs +18 -0
  158. data/sig/terminal-shop/models/profile_update_params.rbs +5 -5
  159. data/sig/terminal-shop/models/subscription_get_params.rbs +19 -0
  160. data/sig/terminal-shop/models/subscription_get_response.rbs +19 -0
  161. data/sig/terminal-shop/request_options.rbs +4 -0
  162. data/sig/terminal-shop/resources/address.rbs +10 -0
  163. data/sig/terminal-shop/resources/app.rbs +0 -2
  164. data/sig/terminal-shop/resources/card.rbs +10 -0
  165. data/sig/terminal-shop/resources/cart.rbs +20 -0
  166. data/sig/terminal-shop/resources/product.rbs +10 -0
  167. data/sig/terminal-shop/resources/profile.rbs +3 -4
  168. data/sig/terminal-shop/resources/subscription.rbs +11 -0
  169. data/sig/terminal-shop/util.rbs +19 -0
  170. data/sig/terminal-shop/version.rbs +1 -1
  171. metadata +40 -4
@@ -33,8 +33,8 @@ module TerminalShop
33
33
  # # @param client [TerminalShop::BaseClient]
34
34
  # # @param req [Hash{Symbol=>Object}]
35
35
  # # @param headers [Hash{String=>String}, Net::HTTPHeader]
36
- # # @param unwrapped [Object]
36
+ # # @param page_data [Object]
37
37
  # #
38
- # def initialize(client:, req:, headers:, unwrapped:); end
38
+ # def initialize(client:, req:, headers:, page_data:); end
39
39
  end
40
40
  end
@@ -65,7 +65,7 @@ module TerminalShop
65
65
  private def auth_headers
66
66
  return {} if @bearer_token.nil?
67
67
 
68
- {"Authorization" => "Bearer #{@bearer_token}"}
68
+ {"authorization" => "Bearer #{@bearer_token}"}
69
69
  end
70
70
 
71
71
  # Creates and returns a new client for interacting with the API.
@@ -99,11 +99,12 @@ module TerminalShop
99
99
  # @param body [Object, nil]
100
100
  # @param request [nil]
101
101
  # @param response [nil]
102
+ # @param message [String, nil]
102
103
  #
103
104
  # @return [TerminalShop::APIStatusError]
104
105
  #
105
- def self.for(url:, status:, body:, request:, response:)
106
- kwargs = {url: url, status: status, body: body, request: request, response: response}
106
+ def self.for(url:, status:, body:, request:, response:, message: nil)
107
+ kwargs = {url: url, status: status, body: body, request: request, response: response, message: message}
107
108
 
108
109
  case status
109
110
  in 400
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ class AddressGetParams < TerminalShop::BaseModel
6
+ # @!parse
7
+ # extend TerminalShop::RequestParameters::Converter
8
+ include TerminalShop::RequestParameters
9
+
10
+ # @!parse
11
+ # # @param request_options [TerminalShop::RequestOptions, Hash{Symbol=>Object}]
12
+ # #
13
+ # def initialize(request_options: {}, **) = super
14
+
15
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ class AddressGetResponse < TerminalShop::BaseModel
6
+ # @!attribute data
7
+ # Physical address associated with a Terminal shop user.
8
+ #
9
+ # @return [TerminalShop::Models::AddressAPI]
10
+ required :data, -> { TerminalShop::Models::AddressAPI }
11
+
12
+ # @!parse
13
+ # # @param data [TerminalShop::Models::AddressAPI]
14
+ # #
15
+ # def initialize(data:, **) = super
16
+
17
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
18
+ end
19
+ end
20
+ end
@@ -2,15 +2,27 @@
2
2
 
3
3
  module TerminalShop
4
4
  module Models
5
- class AppCreateParams < TerminalShop::Models::AppAPI
5
+ class AppCreateParams < TerminalShop::BaseModel
6
6
  # @!parse
7
7
  # extend TerminalShop::RequestParameters::Converter
8
8
  include TerminalShop::RequestParameters
9
9
 
10
+ # @!attribute name
11
+ #
12
+ # @return [String]
13
+ required :name, String
14
+
15
+ # @!attribute redirect_uri
16
+ #
17
+ # @return [String]
18
+ required :redirect_uri, String, api_name: :redirectURI
19
+
10
20
  # @!parse
21
+ # # @param name [String]
22
+ # # @param redirect_uri [String]
11
23
  # # @param request_options [TerminalShop::RequestOptions, Hash{Symbol=>Object}]
12
24
  # #
13
- # def initialize(request_options: {}, **) = super
25
+ # def initialize(name:, redirect_uri:, request_options: {}, **) = super
14
26
 
15
27
  # def initialize: (Hash | TerminalShop::BaseModel) -> void
16
28
  end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ class CardGetParams < TerminalShop::BaseModel
6
+ # @!parse
7
+ # extend TerminalShop::RequestParameters::Converter
8
+ include TerminalShop::RequestParameters
9
+
10
+ # @!parse
11
+ # # @param request_options [TerminalShop::RequestOptions, Hash{Symbol=>Object}]
12
+ # #
13
+ # def initialize(request_options: {}, **) = super
14
+
15
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ class CardGetResponse < TerminalShop::BaseModel
6
+ # @!attribute data
7
+ # Credit card used for payments in the Terminal shop.
8
+ #
9
+ # @return [TerminalShop::Models::CardAPI]
10
+ required :data, -> { TerminalShop::Models::CardAPI }
11
+
12
+ # @!parse
13
+ # # @param data [TerminalShop::Models::CardAPI]
14
+ # #
15
+ # def initialize(data:, **) = super
16
+
17
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
18
+ end
19
+ end
20
+ end
@@ -41,6 +41,16 @@ module TerminalShop
41
41
  # # @return [String]
42
42
  # attr_writer :card_id
43
43
 
44
+ # @!attribute [r] gift_card_id
45
+ # ID of the gift card applied to the current user's cart.
46
+ #
47
+ # @return [String, nil]
48
+ optional :gift_card_id, String, api_name: :giftCardID
49
+
50
+ # @!parse
51
+ # # @return [String]
52
+ # attr_writer :gift_card_id
53
+
44
54
  # @!attribute [r] shipping
45
55
  # Shipping information for the current user's cart.
46
56
  #
@@ -59,9 +69,10 @@ module TerminalShop
59
69
  # # @param subtotal [Integer]
60
70
  # # @param address_id [String]
61
71
  # # @param card_id [String]
72
+ # # @param gift_card_id [String]
62
73
  # # @param shipping [TerminalShop::Models::CartAPI::Shipping]
63
74
  # #
64
- # def initialize(amount:, items:, subtotal:, address_id: nil, card_id: nil, shipping: nil, **) = super
75
+ # def initialize(amount:, items:, subtotal:, address_id: nil, card_id: nil, gift_card_id: nil, shipping: nil, **) = super
65
76
 
66
77
  # def initialize: (Hash | TerminalShop::BaseModel) -> void
67
78
 
@@ -72,6 +83,16 @@ module TerminalShop
72
83
  # @return [Integer]
73
84
  required :subtotal, Integer
74
85
 
86
+ # @!attribute [r] gift_card
87
+ # Amount applied from gift card on the current user's cart, in cents (USD).
88
+ #
89
+ # @return [Integer, nil]
90
+ optional :gift_card, Integer, api_name: :giftCard
91
+
92
+ # @!parse
93
+ # # @return [Integer]
94
+ # attr_writer :gift_card
95
+
75
96
  # @!attribute [r] shipping
76
97
  # Shipping amount of the current user's cart, in cents (USD).
77
98
  #
@@ -82,13 +103,25 @@ module TerminalShop
82
103
  # # @return [Integer]
83
104
  # attr_writer :shipping
84
105
 
106
+ # @!attribute [r] total
107
+ # Total amount after gift card applied, in cents (USD).
108
+ #
109
+ # @return [Integer, nil]
110
+ optional :total, Integer
111
+
112
+ # @!parse
113
+ # # @return [Integer]
114
+ # attr_writer :total
115
+
85
116
  # @!parse
86
117
  # # The subtotal and shipping amounts for the current user's cart.
87
118
  # #
88
119
  # # @param subtotal [Integer]
120
+ # # @param gift_card [Integer]
89
121
  # # @param shipping [Integer]
122
+ # # @param total [Integer]
90
123
  # #
91
- # def initialize(subtotal:, shipping: nil, **) = super
124
+ # def initialize(subtotal:, gift_card: nil, shipping: nil, total: nil, **) = super
92
125
 
93
126
  # def initialize: (Hash | TerminalShop::BaseModel) -> void
94
127
  end
@@ -7,10 +7,20 @@ module TerminalShop
7
7
  # extend TerminalShop::RequestParameters::Converter
8
8
  include TerminalShop::RequestParameters
9
9
 
10
+ # @!attribute [r] recipient_email
11
+ #
12
+ # @return [String, nil]
13
+ optional :recipient_email, String, api_name: :recipientEmail
14
+
15
+ # @!parse
16
+ # # @return [String]
17
+ # attr_writer :recipient_email
18
+
10
19
  # @!parse
20
+ # # @param recipient_email [String]
11
21
  # # @param request_options [TerminalShop::RequestOptions, Hash{Symbol=>Object}]
12
22
  # #
13
- # def initialize(request_options: {}, **) = super
23
+ # def initialize(recipient_email: nil, request_options: {}, **) = super
14
24
 
15
25
  # def initialize: (Hash | TerminalShop::BaseModel) -> void
16
26
  end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ class CartRedeemGiftCardParams < TerminalShop::BaseModel
6
+ # @!parse
7
+ # extend TerminalShop::RequestParameters::Converter
8
+ include TerminalShop::RequestParameters
9
+
10
+ # @!attribute gift_card_id
11
+ #
12
+ # @return [String]
13
+ required :gift_card_id, String, api_name: :giftCardID
14
+
15
+ # @!parse
16
+ # # @param gift_card_id [String]
17
+ # # @param request_options [TerminalShop::RequestOptions, Hash{Symbol=>Object}]
18
+ # #
19
+ # def initialize(gift_card_id:, request_options: {}, **) = super
20
+
21
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ class CartRedeemGiftCardResponse < TerminalShop::BaseModel
6
+ # @!attribute data
7
+ # Gift card redemption result
8
+ #
9
+ # @return [TerminalShop::Models::CartRedeemGiftCardResponse::Data]
10
+ required :data, -> { TerminalShop::Models::CartRedeemGiftCardResponse::Data }
11
+
12
+ # @!parse
13
+ # # @param data [TerminalShop::Models::CartRedeemGiftCardResponse::Data]
14
+ # #
15
+ # def initialize(data:, **) = super
16
+
17
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
18
+
19
+ class Data < TerminalShop::BaseModel
20
+ # @!attribute applied_amount
21
+ #
22
+ # @return [Integer]
23
+ required :applied_amount, Integer, api_name: :appliedAmount
24
+
25
+ # @!attribute gift_card_id
26
+ #
27
+ # @return [String]
28
+ required :gift_card_id, String, api_name: :giftCardID
29
+
30
+ # @!attribute remaining_balance
31
+ #
32
+ # @return [Integer]
33
+ required :remaining_balance, Integer, api_name: :remainingBalance
34
+
35
+ # @!parse
36
+ # # Gift card redemption result
37
+ # #
38
+ # # @param applied_amount [Integer]
39
+ # # @param gift_card_id [String]
40
+ # # @param remaining_balance [Integer]
41
+ # #
42
+ # def initialize(applied_amount:, gift_card_id:, remaining_balance:, **) = super
43
+
44
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ class CartRemoveGiftCardParams < TerminalShop::BaseModel
6
+ # @!parse
7
+ # extend TerminalShop::RequestParameters::Converter
8
+ include TerminalShop::RequestParameters
9
+
10
+ # @!parse
11
+ # # @param request_options [TerminalShop::RequestOptions, Hash{Symbol=>Object}]
12
+ # #
13
+ # def initialize(request_options: {}, **) = super
14
+
15
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ class CartRemoveGiftCardResponse < TerminalShop::BaseModel
6
+ # @!attribute data
7
+ #
8
+ # @return [Symbol, :ok]
9
+ required :data, const: :ok
10
+
11
+ # @!parse
12
+ # # @param data [Symbol, :ok]
13
+ # #
14
+ # def initialize(data: :ok, **) = super
15
+
16
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
17
+ end
18
+ end
19
+ end
@@ -15,11 +15,6 @@ module TerminalShop
15
15
  # @return [String]
16
16
  required :description, String
17
17
 
18
- # @!attribute filters
19
- #
20
- # @return [Array<Symbol, TerminalShop::Models::ProductAPI::Filter>]
21
- required :filters, -> { TerminalShop::ArrayOf[enum: TerminalShop::Models::ProductAPI::Filter] }
22
-
23
18
  # @!attribute name
24
19
  # Name of the product.
25
20
  #
@@ -55,11 +50,11 @@ module TerminalShop
55
50
  # @!attribute [r] tags
56
51
  # Tags for the product.
57
52
  #
58
- # @return [Hash{Symbol=>String}, nil]
59
- optional :tags, TerminalShop::HashOf[String]
53
+ # @return [TerminalShop::Models::ProductAPI::Tags, nil]
54
+ optional :tags, -> { TerminalShop::Models::ProductAPI::Tags }
60
55
 
61
56
  # @!parse
62
- # # @return [Hash{Symbol=>String}]
57
+ # # @return [TerminalShop::Models::ProductAPI::Tags]
63
58
  # attr_writer :tags
64
59
 
65
60
  # @!parse
@@ -67,63 +62,94 @@ module TerminalShop
67
62
  # #
68
63
  # # @param id [String]
69
64
  # # @param description [String]
70
- # # @param filters [Array<Symbol, TerminalShop::Models::ProductAPI::Filter>]
71
65
  # # @param name [String]
72
66
  # # @param variants [Array<TerminalShop::Models::ProductVariant>]
73
67
  # # @param order [Integer]
74
68
  # # @param subscription [Symbol, TerminalShop::Models::ProductAPI::Subscription]
75
- # # @param tags [Hash{Symbol=>String}]
69
+ # # @param tags [TerminalShop::Models::ProductAPI::Tags]
76
70
  # #
77
- # def initialize(id:, description:, filters:, name:, variants:, order: nil, subscription: nil, tags: nil, **) = super
71
+ # def initialize(id:, description:, name:, variants:, order: nil, subscription: nil, tags: nil, **) = super
78
72
 
79
73
  # def initialize: (Hash | TerminalShop::BaseModel) -> void
80
74
 
81
- # @abstract
82
- #
83
- # @example
84
- # ```ruby
85
- # case filter
86
- # in :eu
87
- # # ...
88
- # in :na
89
- # # ...
90
- # end
91
- # ```
92
- class Filter < TerminalShop::Enum
93
- EU = :eu
94
- NA = :na
95
-
96
- finalize!
97
-
98
- # @!parse
99
- # # @return [Array<Symbol>]
100
- # #
101
- # def self.values; end
102
- end
103
-
104
75
  # @abstract
105
76
  #
106
77
  # Whether the product must be or can be subscribed to.
107
- #
108
- # @example
109
- # ```ruby
110
- # case subscription
111
- # in :allowed
112
- # # ...
113
- # in :required
114
- # # ...
115
- # end
116
- # ```
117
78
  class Subscription < TerminalShop::Enum
118
79
  ALLOWED = :allowed
119
80
  REQUIRED = :required
120
81
 
121
82
  finalize!
83
+ end
84
+
85
+ class Tags < TerminalShop::BaseModel
86
+ # @!attribute [r] app
87
+ #
88
+ # @return [String, nil]
89
+ optional :app, String
90
+
91
+ # @!parse
92
+ # # @return [String]
93
+ # attr_writer :app
94
+
95
+ # @!attribute [r] color
96
+ #
97
+ # @return [String, nil]
98
+ optional :color, String
122
99
 
123
100
  # @!parse
124
- # # @return [Array<Symbol>]
101
+ # # @return [String]
102
+ # attr_writer :color
103
+
104
+ # @!attribute [r] featured
105
+ #
106
+ # @return [Boolean, nil]
107
+ optional :featured, TerminalShop::BooleanModel
108
+
109
+ # @!parse
110
+ # # @return [Boolean]
111
+ # attr_writer :featured
112
+
113
+ # @!attribute [r] market_eu
114
+ #
115
+ # @return [Boolean, nil]
116
+ optional :market_eu, TerminalShop::BooleanModel
117
+
118
+ # @!parse
119
+ # # @return [Boolean]
120
+ # attr_writer :market_eu
121
+
122
+ # @!attribute [r] market_na
123
+ #
124
+ # @return [Boolean, nil]
125
+ optional :market_na, TerminalShop::BooleanModel
126
+
127
+ # @!parse
128
+ # # @return [Boolean]
129
+ # attr_writer :market_na
130
+
131
+ # @!attribute [r] type
132
+ #
133
+ # @return [String, nil]
134
+ optional :type, String
135
+
136
+ # @!parse
137
+ # # @return [String]
138
+ # attr_writer :type
139
+
140
+ # @!parse
141
+ # # Tags for the product.
125
142
  # #
126
- # def self.values; end
143
+ # # @param app [String]
144
+ # # @param color [String]
145
+ # # @param featured [Boolean]
146
+ # # @param market_eu [Boolean]
147
+ # # @param market_na [Boolean]
148
+ # # @param type [String]
149
+ # #
150
+ # def initialize(app: nil, color: nil, featured: nil, market_eu: nil, market_na: nil, type: nil, **) = super
151
+
152
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
127
153
  end
128
154
  end
129
155
  end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ class ProductGetParams < TerminalShop::BaseModel
6
+ # @!parse
7
+ # extend TerminalShop::RequestParameters::Converter
8
+ include TerminalShop::RequestParameters
9
+
10
+ # @!parse
11
+ # # @param request_options [TerminalShop::RequestOptions, Hash{Symbol=>Object}]
12
+ # #
13
+ # def initialize(request_options: {}, **) = super
14
+
15
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ class ProductGetResponse < TerminalShop::BaseModel
6
+ # @!attribute data
7
+ # Product sold in the Terminal shop.
8
+ #
9
+ # @return [TerminalShop::Models::ProductAPI]
10
+ required :data, -> { TerminalShop::Models::ProductAPI }
11
+
12
+ # @!parse
13
+ # # @param data [TerminalShop::Models::ProductAPI]
14
+ # #
15
+ # def initialize(data:, **) = super
16
+
17
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
18
+ end
19
+ end
20
+ end
@@ -8,23 +8,21 @@ module TerminalShop
8
8
  include TerminalShop::RequestParameters
9
9
 
10
10
  # @!attribute email
11
- # Email address of the user.
12
11
  #
13
- # @return [String, nil]
14
- optional :email, String, nil?: true
12
+ # @return [String]
13
+ required :email, String
15
14
 
16
15
  # @!attribute name
17
- # Name of the user.
18
16
  #
19
- # @return [String, nil]
20
- optional :name, String, nil?: true
17
+ # @return [String]
18
+ required :name, String
21
19
 
22
20
  # @!parse
23
- # # @param email [String, nil]
24
- # # @param name [String, nil]
21
+ # # @param email [String]
22
+ # # @param name [String]
25
23
  # # @param request_options [TerminalShop::RequestOptions, Hash{Symbol=>Object}]
26
24
  # #
27
- # def initialize(email: nil, name: nil, request_options: {}, **) = super
25
+ # def initialize(email:, name:, request_options: {}, **) = super
28
26
 
29
27
  # def initialize: (Hash | TerminalShop::BaseModel) -> void
30
28
  end
@@ -71,16 +71,6 @@ module TerminalShop
71
71
  # @abstract
72
72
  #
73
73
  # Schedule of the subscription.
74
- #
75
- # @example
76
- # ```ruby
77
- # case schedule
78
- # in TerminalShop::Models::SubscriptionAPI::Schedule::Fixed
79
- # # ...
80
- # in TerminalShop::Models::SubscriptionAPI::Schedule::Weekly
81
- # # ...
82
- # end
83
- # ```
84
74
  class Schedule < TerminalShop::Union
85
75
  variant -> { TerminalShop::Models::SubscriptionAPI::Schedule::Fixed }
86
76
 
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ class SubscriptionGetParams < TerminalShop::BaseModel
6
+ # @!parse
7
+ # extend TerminalShop::RequestParameters::Converter
8
+ include TerminalShop::RequestParameters
9
+
10
+ # @!parse
11
+ # # @param request_options [TerminalShop::RequestOptions, Hash{Symbol=>Object}]
12
+ # #
13
+ # def initialize(request_options: {}, **) = super
14
+
15
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ class SubscriptionGetResponse < TerminalShop::BaseModel
6
+ # @!attribute data
7
+ # Subscription to a Terminal shop product.
8
+ #
9
+ # @return [TerminalShop::Models::SubscriptionAPI]
10
+ required :data, -> { TerminalShop::Models::SubscriptionAPI }
11
+
12
+ # @!parse
13
+ # # @param data [TerminalShop::Models::SubscriptionAPI]
14
+ # #
15
+ # def initialize(data:, **) = super
16
+
17
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
18
+ end
19
+ end
20
+ end