terminal-shop 0.1.0.pre.alpha.5

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 (276) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +127 -0
  3. data/lib/terminal-shop/base_client.rb +452 -0
  4. data/lib/terminal-shop/base_model.rb +1189 -0
  5. data/lib/terminal-shop/base_page.rb +44 -0
  6. data/lib/terminal-shop/client.rb +135 -0
  7. data/lib/terminal-shop/errors.rb +187 -0
  8. data/lib/terminal-shop/extern.rb +10 -0
  9. data/lib/terminal-shop/models/address.rb +101 -0
  10. data/lib/terminal-shop/models/address_create_params.rb +86 -0
  11. data/lib/terminal-shop/models/address_create_response.rb +26 -0
  12. data/lib/terminal-shop/models/address_delete_params.rb +18 -0
  13. data/lib/terminal-shop/models/address_delete_response.rb +25 -0
  14. data/lib/terminal-shop/models/address_list_params.rb +18 -0
  15. data/lib/terminal-shop/models/address_list_response.rb +26 -0
  16. data/lib/terminal-shop/models/app.rb +44 -0
  17. data/lib/terminal-shop/models/app_create_params.rb +18 -0
  18. data/lib/terminal-shop/models/app_create_response.rb +54 -0
  19. data/lib/terminal-shop/models/app_delete_params.rb +18 -0
  20. data/lib/terminal-shop/models/app_delete_response.rb +25 -0
  21. data/lib/terminal-shop/models/app_get_params.rb +18 -0
  22. data/lib/terminal-shop/models/app_get_response.rb +26 -0
  23. data/lib/terminal-shop/models/app_list_params.rb +18 -0
  24. data/lib/terminal-shop/models/app_list_response.rb +26 -0
  25. data/lib/terminal-shop/models/card.rb +83 -0
  26. data/lib/terminal-shop/models/card_collect_params.rb +18 -0
  27. data/lib/terminal-shop/models/card_collect_response.rb +50 -0
  28. data/lib/terminal-shop/models/card_create_params.rb +26 -0
  29. data/lib/terminal-shop/models/card_create_response.rb +26 -0
  30. data/lib/terminal-shop/models/card_delete_params.rb +18 -0
  31. data/lib/terminal-shop/models/card_delete_response.rb +25 -0
  32. data/lib/terminal-shop/models/card_list_params.rb +18 -0
  33. data/lib/terminal-shop/models/card_list_response.rb +26 -0
  34. data/lib/terminal-shop/models/cart.rb +200 -0
  35. data/lib/terminal-shop/models/cart_convert_params.rb +18 -0
  36. data/lib/terminal-shop/models/cart_convert_response.rb +26 -0
  37. data/lib/terminal-shop/models/cart_get_params.rb +18 -0
  38. data/lib/terminal-shop/models/cart_get_response.rb +26 -0
  39. data/lib/terminal-shop/models/cart_set_address_params.rb +25 -0
  40. data/lib/terminal-shop/models/cart_set_address_response.rb +25 -0
  41. data/lib/terminal-shop/models/cart_set_card_params.rb +25 -0
  42. data/lib/terminal-shop/models/cart_set_card_response.rb +25 -0
  43. data/lib/terminal-shop/models/cart_set_item_params.rb +32 -0
  44. data/lib/terminal-shop/models/cart_set_item_response.rb +26 -0
  45. data/lib/terminal-shop/models/email_create_params.rb +25 -0
  46. data/lib/terminal-shop/models/email_create_response.rb +25 -0
  47. data/lib/terminal-shop/models/order.rb +303 -0
  48. data/lib/terminal-shop/models/order_get_params.rb +18 -0
  49. data/lib/terminal-shop/models/order_get_response.rb +26 -0
  50. data/lib/terminal-shop/models/order_list_params.rb +18 -0
  51. data/lib/terminal-shop/models/order_list_response.rb +26 -0
  52. data/lib/terminal-shop/models/product.rb +141 -0
  53. data/lib/terminal-shop/models/product_list_params.rb +18 -0
  54. data/lib/terminal-shop/models/product_list_response.rb +26 -0
  55. data/lib/terminal-shop/models/product_variant.rb +44 -0
  56. data/lib/terminal-shop/models/profile.rb +83 -0
  57. data/lib/terminal-shop/models/profile_me_params.rb +18 -0
  58. data/lib/terminal-shop/models/profile_me_response.rb +26 -0
  59. data/lib/terminal-shop/models/profile_update_params.rb +32 -0
  60. data/lib/terminal-shop/models/profile_update_response.rb +26 -0
  61. data/lib/terminal-shop/models/subscription.rb +113 -0
  62. data/lib/terminal-shop/models/subscription_create_params.rb +18 -0
  63. data/lib/terminal-shop/models/subscription_create_response.rb +25 -0
  64. data/lib/terminal-shop/models/subscription_delete_params.rb +18 -0
  65. data/lib/terminal-shop/models/subscription_delete_response.rb +25 -0
  66. data/lib/terminal-shop/models/subscription_list_params.rb +18 -0
  67. data/lib/terminal-shop/models/subscription_list_response.rb +26 -0
  68. data/lib/terminal-shop/models/token.rb +68 -0
  69. data/lib/terminal-shop/models/token_create_params.rb +18 -0
  70. data/lib/terminal-shop/models/token_create_response.rb +55 -0
  71. data/lib/terminal-shop/models/token_delete_params.rb +18 -0
  72. data/lib/terminal-shop/models/token_delete_response.rb +25 -0
  73. data/lib/terminal-shop/models/token_get_params.rb +18 -0
  74. data/lib/terminal-shop/models/token_get_response.rb +27 -0
  75. data/lib/terminal-shop/models/token_list_params.rb +18 -0
  76. data/lib/terminal-shop/models/token_list_response.rb +26 -0
  77. data/lib/terminal-shop/models/view_init_params.rb +18 -0
  78. data/lib/terminal-shop/models/view_init_response.rb +103 -0
  79. data/lib/terminal-shop/pooled_net_requester.rb +94 -0
  80. data/lib/terminal-shop/request_options.rb +115 -0
  81. data/lib/terminal-shop/resources/address.rb +84 -0
  82. data/lib/terminal-shop/resources/app.rb +93 -0
  83. data/lib/terminal-shop/resources/card.rb +89 -0
  84. data/lib/terminal-shop/resources/cart.rb +112 -0
  85. data/lib/terminal-shop/resources/email.rb +34 -0
  86. data/lib/terminal-shop/resources/order.rb +49 -0
  87. data/lib/terminal-shop/resources/product.rb +30 -0
  88. data/lib/terminal-shop/resources/profile.rb +53 -0
  89. data/lib/terminal-shop/resources/subscription.rb +82 -0
  90. data/lib/terminal-shop/resources/token.rb +85 -0
  91. data/lib/terminal-shop/resources/view.rb +31 -0
  92. data/lib/terminal-shop/util.rb +460 -0
  93. data/lib/terminal-shop/version.rb +5 -0
  94. data/lib/terminal-shop.rb +110 -0
  95. data/manifest.yaml +12 -0
  96. data/rbi/lib/terminal-shop/base_client.rbi +145 -0
  97. data/rbi/lib/terminal-shop/base_model.rbi +514 -0
  98. data/rbi/lib/terminal-shop/base_page.rbi +38 -0
  99. data/rbi/lib/terminal-shop/client.rbi +80 -0
  100. data/rbi/lib/terminal-shop/errors.rbi +133 -0
  101. data/rbi/lib/terminal-shop/extern.rbi +7 -0
  102. data/rbi/lib/terminal-shop/models/address.rbi +77 -0
  103. data/rbi/lib/terminal-shop/models/address_create_params.rbi +87 -0
  104. data/rbi/lib/terminal-shop/models/address_create_response.rbi +18 -0
  105. data/rbi/lib/terminal-shop/models/address_delete_params.rbi +18 -0
  106. data/rbi/lib/terminal-shop/models/address_delete_response.rbi +18 -0
  107. data/rbi/lib/terminal-shop/models/address_list_params.rbi +18 -0
  108. data/rbi/lib/terminal-shop/models/address_list_response.rbi +18 -0
  109. data/rbi/lib/terminal-shop/models/app.rbi +24 -0
  110. data/rbi/lib/terminal-shop/models/app_create_params.rbi +18 -0
  111. data/rbi/lib/terminal-shop/models/app_create_response.rbi +34 -0
  112. data/rbi/lib/terminal-shop/models/app_delete_params.rbi +18 -0
  113. data/rbi/lib/terminal-shop/models/app_delete_response.rbi +18 -0
  114. data/rbi/lib/terminal-shop/models/app_get_params.rbi +18 -0
  115. data/rbi/lib/terminal-shop/models/app_get_response.rbi +18 -0
  116. data/rbi/lib/terminal-shop/models/app_list_params.rbi +18 -0
  117. data/rbi/lib/terminal-shop/models/app_list_response.rbi +18 -0
  118. data/rbi/lib/terminal-shop/models/card.rbi +59 -0
  119. data/rbi/lib/terminal-shop/models/card_collect_params.rbi +18 -0
  120. data/rbi/lib/terminal-shop/models/card_collect_response.rbi +31 -0
  121. data/rbi/lib/terminal-shop/models/card_create_params.rbi +26 -0
  122. data/rbi/lib/terminal-shop/models/card_create_response.rbi +18 -0
  123. data/rbi/lib/terminal-shop/models/card_delete_params.rbi +18 -0
  124. data/rbi/lib/terminal-shop/models/card_delete_response.rbi +18 -0
  125. data/rbi/lib/terminal-shop/models/card_list_params.rbi +18 -0
  126. data/rbi/lib/terminal-shop/models/card_list_response.rbi +18 -0
  127. data/rbi/lib/terminal-shop/models/cart.rbi +127 -0
  128. data/rbi/lib/terminal-shop/models/cart_convert_params.rbi +18 -0
  129. data/rbi/lib/terminal-shop/models/cart_convert_response.rbi +18 -0
  130. data/rbi/lib/terminal-shop/models/cart_get_params.rbi +18 -0
  131. data/rbi/lib/terminal-shop/models/cart_get_response.rbi +18 -0
  132. data/rbi/lib/terminal-shop/models/cart_set_address_params.rbi +26 -0
  133. data/rbi/lib/terminal-shop/models/cart_set_address_response.rbi +18 -0
  134. data/rbi/lib/terminal-shop/models/cart_set_card_params.rbi +26 -0
  135. data/rbi/lib/terminal-shop/models/cart_set_card_response.rbi +18 -0
  136. data/rbi/lib/terminal-shop/models/cart_set_item_params.rbi +38 -0
  137. data/rbi/lib/terminal-shop/models/cart_set_item_response.rbi +18 -0
  138. data/rbi/lib/terminal-shop/models/email_create_params.rbi +26 -0
  139. data/rbi/lib/terminal-shop/models/email_create_response.rbi +18 -0
  140. data/rbi/lib/terminal-shop/models/order.rbi +216 -0
  141. data/rbi/lib/terminal-shop/models/order_get_params.rbi +18 -0
  142. data/rbi/lib/terminal-shop/models/order_get_response.rbi +18 -0
  143. data/rbi/lib/terminal-shop/models/order_list_params.rbi +18 -0
  144. data/rbi/lib/terminal-shop/models/order_list_response.rbi +18 -0
  145. data/rbi/lib/terminal-shop/models/product.rbi +94 -0
  146. data/rbi/lib/terminal-shop/models/product_list_params.rbi +18 -0
  147. data/rbi/lib/terminal-shop/models/product_list_response.rbi +18 -0
  148. data/rbi/lib/terminal-shop/models/product_variant.rbi +24 -0
  149. data/rbi/lib/terminal-shop/models/profile.rbi +61 -0
  150. data/rbi/lib/terminal-shop/models/profile_me_params.rbi +18 -0
  151. data/rbi/lib/terminal-shop/models/profile_me_response.rbi +18 -0
  152. data/rbi/lib/terminal-shop/models/profile_update_params.rbi +38 -0
  153. data/rbi/lib/terminal-shop/models/profile_update_response.rbi +18 -0
  154. data/rbi/lib/terminal-shop/models/subscription.rbi +75 -0
  155. data/rbi/lib/terminal-shop/models/subscription_create_params.rbi +18 -0
  156. data/rbi/lib/terminal-shop/models/subscription_create_response.rbi +18 -0
  157. data/rbi/lib/terminal-shop/models/subscription_delete_params.rbi +18 -0
  158. data/rbi/lib/terminal-shop/models/subscription_delete_response.rbi +18 -0
  159. data/rbi/lib/terminal-shop/models/subscription_list_params.rbi +18 -0
  160. data/rbi/lib/terminal-shop/models/subscription_list_response.rbi +18 -0
  161. data/rbi/lib/terminal-shop/models/token.rbi +37 -0
  162. data/rbi/lib/terminal-shop/models/token_create_params.rbi +18 -0
  163. data/rbi/lib/terminal-shop/models/token_create_response.rbi +34 -0
  164. data/rbi/lib/terminal-shop/models/token_delete_params.rbi +18 -0
  165. data/rbi/lib/terminal-shop/models/token_delete_response.rbi +18 -0
  166. data/rbi/lib/terminal-shop/models/token_get_params.rbi +18 -0
  167. data/rbi/lib/terminal-shop/models/token_get_response.rbi +18 -0
  168. data/rbi/lib/terminal-shop/models/token_list_params.rbi +18 -0
  169. data/rbi/lib/terminal-shop/models/token_list_response.rbi +18 -0
  170. data/rbi/lib/terminal-shop/models/view_init_params.rbi +18 -0
  171. data/rbi/lib/terminal-shop/models/view_init_response.rbi +91 -0
  172. data/rbi/lib/terminal-shop/request_options.rbi +40 -0
  173. data/rbi/lib/terminal-shop/resources/address.rbi +60 -0
  174. data/rbi/lib/terminal-shop/resources/app.rbi +54 -0
  175. data/rbi/lib/terminal-shop/resources/card.rbi +57 -0
  176. data/rbi/lib/terminal-shop/resources/cart.rbi +67 -0
  177. data/rbi/lib/terminal-shop/resources/email.rbi +20 -0
  178. data/rbi/lib/terminal-shop/resources/order.rbi +34 -0
  179. data/rbi/lib/terminal-shop/resources/product.rbi +25 -0
  180. data/rbi/lib/terminal-shop/resources/profile.rbi +35 -0
  181. data/rbi/lib/terminal-shop/resources/subscription.rbi +58 -0
  182. data/rbi/lib/terminal-shop/resources/token.rbi +57 -0
  183. data/rbi/lib/terminal-shop/resources/view.rbi +25 -0
  184. data/rbi/lib/terminal-shop/util.rbi +128 -0
  185. data/rbi/lib/terminal-shop/version.rbi +5 -0
  186. data/sig/terminal-shop/base_client.rbs +100 -0
  187. data/sig/terminal-shop/base_model.rbs +246 -0
  188. data/sig/terminal-shop/base_page.rbs +20 -0
  189. data/sig/terminal-shop/client.rbs +52 -0
  190. data/sig/terminal-shop/errors.rbs +98 -0
  191. data/sig/terminal-shop/extern.rbs +4 -0
  192. data/sig/terminal-shop/models/address.rbs +60 -0
  193. data/sig/terminal-shop/models/address_create_params.rbs +62 -0
  194. data/sig/terminal-shop/models/address_create_response.rbs +18 -0
  195. data/sig/terminal-shop/models/address_delete_params.rbs +19 -0
  196. data/sig/terminal-shop/models/address_delete_response.rbs +18 -0
  197. data/sig/terminal-shop/models/address_list_params.rbs +19 -0
  198. data/sig/terminal-shop/models/address_list_response.rbs +19 -0
  199. data/sig/terminal-shop/models/app.rbs +21 -0
  200. data/sig/terminal-shop/models/app_create_params.rbs +19 -0
  201. data/sig/terminal-shop/models/app_create_response.rbs +36 -0
  202. data/sig/terminal-shop/models/app_delete_params.rbs +19 -0
  203. data/sig/terminal-shop/models/app_delete_response.rbs +18 -0
  204. data/sig/terminal-shop/models/app_get_params.rbs +18 -0
  205. data/sig/terminal-shop/models/app_get_response.rbs +17 -0
  206. data/sig/terminal-shop/models/app_list_params.rbs +18 -0
  207. data/sig/terminal-shop/models/app_list_response.rbs +18 -0
  208. data/sig/terminal-shop/models/card.rbs +51 -0
  209. data/sig/terminal-shop/models/card_collect_params.rbs +19 -0
  210. data/sig/terminal-shop/models/card_collect_response.rbs +34 -0
  211. data/sig/terminal-shop/models/card_create_params.rbs +22 -0
  212. data/sig/terminal-shop/models/card_create_response.rbs +18 -0
  213. data/sig/terminal-shop/models/card_delete_params.rbs +19 -0
  214. data/sig/terminal-shop/models/card_delete_response.rbs +18 -0
  215. data/sig/terminal-shop/models/card_list_params.rbs +18 -0
  216. data/sig/terminal-shop/models/card_list_response.rbs +18 -0
  217. data/sig/terminal-shop/models/cart.rbs +119 -0
  218. data/sig/terminal-shop/models/cart_convert_params.rbs +19 -0
  219. data/sig/terminal-shop/models/cart_convert_response.rbs +18 -0
  220. data/sig/terminal-shop/models/cart_get_params.rbs +18 -0
  221. data/sig/terminal-shop/models/cart_get_response.rbs +18 -0
  222. data/sig/terminal-shop/models/cart_set_address_params.rbs +25 -0
  223. data/sig/terminal-shop/models/cart_set_address_response.rbs +18 -0
  224. data/sig/terminal-shop/models/cart_set_card_params.rbs +22 -0
  225. data/sig/terminal-shop/models/cart_set_card_response.rbs +18 -0
  226. data/sig/terminal-shop/models/cart_set_item_params.rbs +29 -0
  227. data/sig/terminal-shop/models/cart_set_item_response.rbs +18 -0
  228. data/sig/terminal-shop/models/email_create_params.rbs +22 -0
  229. data/sig/terminal-shop/models/email_create_response.rbs +18 -0
  230. data/sig/terminal-shop/models/order.rbs +179 -0
  231. data/sig/terminal-shop/models/order_get_params.rbs +18 -0
  232. data/sig/terminal-shop/models/order_get_response.rbs +18 -0
  233. data/sig/terminal-shop/models/order_list_params.rbs +19 -0
  234. data/sig/terminal-shop/models/order_list_response.rbs +18 -0
  235. data/sig/terminal-shop/models/product.rbs +76 -0
  236. data/sig/terminal-shop/models/product_list_params.rbs +19 -0
  237. data/sig/terminal-shop/models/product_list_response.rbs +19 -0
  238. data/sig/terminal-shop/models/product_variant.rbs +21 -0
  239. data/sig/terminal-shop/models/profile.rbs +53 -0
  240. data/sig/terminal-shop/models/profile_me_params.rbs +19 -0
  241. data/sig/terminal-shop/models/profile_me_response.rbs +18 -0
  242. data/sig/terminal-shop/models/profile_update_params.rbs +28 -0
  243. data/sig/terminal-shop/models/profile_update_response.rbs +18 -0
  244. data/sig/terminal-shop/models/subscription.rbs +60 -0
  245. data/sig/terminal-shop/models/subscription_create_params.rbs +19 -0
  246. data/sig/terminal-shop/models/subscription_create_response.rbs +18 -0
  247. data/sig/terminal-shop/models/subscription_delete_params.rbs +19 -0
  248. data/sig/terminal-shop/models/subscription_delete_response.rbs +18 -0
  249. data/sig/terminal-shop/models/subscription_list_params.rbs +19 -0
  250. data/sig/terminal-shop/models/subscription_list_response.rbs +19 -0
  251. data/sig/terminal-shop/models/token.rbs +40 -0
  252. data/sig/terminal-shop/models/token_create_params.rbs +19 -0
  253. data/sig/terminal-shop/models/token_create_response.rbs +36 -0
  254. data/sig/terminal-shop/models/token_delete_params.rbs +19 -0
  255. data/sig/terminal-shop/models/token_delete_response.rbs +18 -0
  256. data/sig/terminal-shop/models/token_get_params.rbs +18 -0
  257. data/sig/terminal-shop/models/token_get_response.rbs +18 -0
  258. data/sig/terminal-shop/models/token_list_params.rbs +19 -0
  259. data/sig/terminal-shop/models/token_list_response.rbs +18 -0
  260. data/sig/terminal-shop/models/view_init_params.rbs +18 -0
  261. data/sig/terminal-shop/models/view_init_response.rbs +71 -0
  262. data/sig/terminal-shop/request_options.rbs +42 -0
  263. data/sig/terminal-shop/resources/address.rbs +41 -0
  264. data/sig/terminal-shop/resources/app.rbs +46 -0
  265. data/sig/terminal-shop/resources/card.rbs +42 -0
  266. data/sig/terminal-shop/resources/cart.rbs +51 -0
  267. data/sig/terminal-shop/resources/email.rbs +16 -0
  268. data/sig/terminal-shop/resources/order.rbs +25 -0
  269. data/sig/terminal-shop/resources/product.rbs +15 -0
  270. data/sig/terminal-shop/resources/profile.rbs +25 -0
  271. data/sig/terminal-shop/resources/subscription.rbs +43 -0
  272. data/sig/terminal-shop/resources/token.rbs +43 -0
  273. data/sig/terminal-shop/resources/view.rbs +15 -0
  274. data/sig/terminal-shop/util.rbs +85 -0
  275. data/sig/terminal-shop/version.rbs +3 -0
  276. metadata +333 -0
@@ -0,0 +1,303 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ # @example
6
+ # ```ruby
7
+ # order_api => {
8
+ # id: String,
9
+ # amount: TerminalShop::Models::OrderAPI::Amount,
10
+ # items: -> { TerminalShop::ArrayOf[TerminalShop::Models::OrderAPI::Item] === _1 },
11
+ # shipping: TerminalShop::Models::OrderAPI::Shipping,
12
+ # tracking: TerminalShop::Models::OrderAPI::Tracking
13
+ # }
14
+ # ```
15
+ class OrderAPI < TerminalShop::BaseModel
16
+ # @!attribute id
17
+ # Unique object identifier. The format and length of IDs may change over time.
18
+ #
19
+ # @return [String]
20
+ required :id, String
21
+
22
+ # @!attribute amount
23
+ # The subtotal and shipping amounts of the order.
24
+ #
25
+ # @return [TerminalShop::Models::OrderAPI::Amount]
26
+ required :amount, -> { TerminalShop::Models::OrderAPI::Amount }
27
+
28
+ # @!attribute items
29
+ # Items in the order.
30
+ #
31
+ # @return [Array<TerminalShop::Models::OrderAPI::Item>]
32
+ required :items, -> { TerminalShop::ArrayOf[TerminalShop::Models::OrderAPI::Item] }
33
+
34
+ # @!attribute shipping
35
+ # Shipping address of the order.
36
+ #
37
+ # @return [TerminalShop::Models::OrderAPI::Shipping]
38
+ required :shipping, -> { TerminalShop::Models::OrderAPI::Shipping }
39
+
40
+ # @!attribute tracking
41
+ # Tracking information of the order.
42
+ #
43
+ # @return [TerminalShop::Models::OrderAPI::Tracking]
44
+ required :tracking, -> { TerminalShop::Models::OrderAPI::Tracking }
45
+
46
+ # @!attribute [r] index
47
+ # Zero-based index of the order for this user only.
48
+ #
49
+ # @return [Integer, nil]
50
+ optional :index, Integer
51
+
52
+ # @!parse
53
+ # # @return [Integer]
54
+ # attr_writer :index
55
+
56
+ # @!parse
57
+ # # An order from the Terminal shop.
58
+ # #
59
+ # # @param id [String]
60
+ # # @param amount [TerminalShop::Models::OrderAPI::Amount]
61
+ # # @param items [Array<TerminalShop::Models::OrderAPI::Item>]
62
+ # # @param shipping [TerminalShop::Models::OrderAPI::Shipping]
63
+ # # @param tracking [TerminalShop::Models::OrderAPI::Tracking]
64
+ # # @param index [Integer]
65
+ # #
66
+ # def initialize(id:, amount:, items:, shipping:, tracking:, index: nil, **) = super
67
+
68
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
69
+
70
+ # @example
71
+ # ```ruby
72
+ # amount => {
73
+ # shipping: Integer,
74
+ # subtotal: Integer
75
+ # }
76
+ # ```
77
+ class Amount < TerminalShop::BaseModel
78
+ # @!attribute shipping
79
+ # Shipping amount of the order, in cents (USD).
80
+ #
81
+ # @return [Integer]
82
+ required :shipping, Integer
83
+
84
+ # @!attribute subtotal
85
+ # Subtotal amount of the order, in cents (USD).
86
+ #
87
+ # @return [Integer]
88
+ required :subtotal, Integer
89
+
90
+ # @!parse
91
+ # # The subtotal and shipping amounts of the order.
92
+ # #
93
+ # # @param shipping [Integer]
94
+ # # @param subtotal [Integer]
95
+ # #
96
+ # def initialize(shipping:, subtotal:, **) = super
97
+
98
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
99
+ end
100
+
101
+ # @example
102
+ # ```ruby
103
+ # item => {
104
+ # id: String,
105
+ # amount: Integer,
106
+ # quantity: Integer,
107
+ # description: String,
108
+ # product_variant_id: String
109
+ # }
110
+ # ```
111
+ class Item < TerminalShop::BaseModel
112
+ # @!attribute id
113
+ # Unique object identifier. The format and length of IDs may change over time.
114
+ #
115
+ # @return [String]
116
+ required :id, String
117
+
118
+ # @!attribute amount
119
+ # Amount of the item in the order, in cents (USD).
120
+ #
121
+ # @return [Integer]
122
+ required :amount, Integer
123
+
124
+ # @!attribute quantity
125
+ # Quantity of the item in the order.
126
+ #
127
+ # @return [Integer]
128
+ required :quantity, Integer
129
+
130
+ # @!attribute [r] description
131
+ # Description of the item in the order.
132
+ #
133
+ # @return [String, nil]
134
+ optional :description, String
135
+
136
+ # @!parse
137
+ # # @return [String]
138
+ # attr_writer :description
139
+
140
+ # @!attribute [r] product_variant_id
141
+ # ID of the product variant of the item in the order.
142
+ #
143
+ # @return [String, nil]
144
+ optional :product_variant_id, String, api_name: :productVariantID
145
+
146
+ # @!parse
147
+ # # @return [String]
148
+ # attr_writer :product_variant_id
149
+
150
+ # @!parse
151
+ # # @param id [String]
152
+ # # @param amount [Integer]
153
+ # # @param quantity [Integer]
154
+ # # @param description [String]
155
+ # # @param product_variant_id [String]
156
+ # #
157
+ # def initialize(id:, amount:, quantity:, description: nil, product_variant_id: nil, **) = super
158
+
159
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
160
+ end
161
+
162
+ # @example
163
+ # ```ruby
164
+ # shipping => {
165
+ # city: String,
166
+ # country: String,
167
+ # name: String,
168
+ # street1: String,
169
+ # zip: String,
170
+ # **_
171
+ # }
172
+ # ```
173
+ class Shipping < TerminalShop::BaseModel
174
+ # @!attribute city
175
+ # City of the address.
176
+ #
177
+ # @return [String]
178
+ required :city, String
179
+
180
+ # @!attribute country
181
+ # ISO 3166-1 alpha-2 country code of the address.
182
+ #
183
+ # @return [String]
184
+ required :country, String
185
+
186
+ # @!attribute name
187
+ # The recipient's name.
188
+ #
189
+ # @return [String]
190
+ required :name, String
191
+
192
+ # @!attribute street1
193
+ # Street of the address.
194
+ #
195
+ # @return [String]
196
+ required :street1, String
197
+
198
+ # @!attribute zip
199
+ # Zip code of the address.
200
+ #
201
+ # @return [String]
202
+ required :zip, String
203
+
204
+ # @!attribute [r] phone
205
+ # Phone number of the recipient.
206
+ #
207
+ # @return [String, nil]
208
+ optional :phone, String
209
+
210
+ # @!parse
211
+ # # @return [String]
212
+ # attr_writer :phone
213
+
214
+ # @!attribute [r] province
215
+ # Province or state of the address.
216
+ #
217
+ # @return [String, nil]
218
+ optional :province, String
219
+
220
+ # @!parse
221
+ # # @return [String]
222
+ # attr_writer :province
223
+
224
+ # @!attribute [r] street2
225
+ # Apartment, suite, etc. of the address.
226
+ #
227
+ # @return [String, nil]
228
+ optional :street2, String
229
+
230
+ # @!parse
231
+ # # @return [String]
232
+ # attr_writer :street2
233
+
234
+ # @!parse
235
+ # # Shipping address of the order.
236
+ # #
237
+ # # @param city [String]
238
+ # # @param country [String]
239
+ # # @param name [String]
240
+ # # @param street1 [String]
241
+ # # @param zip [String]
242
+ # # @param phone [String]
243
+ # # @param province [String]
244
+ # # @param street2 [String]
245
+ # #
246
+ # def initialize(city:, country:, name:, street1:, zip:, phone: nil, province: nil, street2: nil, **) = super
247
+
248
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
249
+ end
250
+
251
+ # @example
252
+ # ```ruby
253
+ # tracking => {
254
+ # number: String,
255
+ # service: String,
256
+ # url: String
257
+ # }
258
+ # ```
259
+ class Tracking < TerminalShop::BaseModel
260
+ # @!attribute [r] number
261
+ # Tracking number of the order.
262
+ #
263
+ # @return [String, nil]
264
+ optional :number, String
265
+
266
+ # @!parse
267
+ # # @return [String]
268
+ # attr_writer :number
269
+
270
+ # @!attribute [r] service
271
+ # Shipping service of the order.
272
+ #
273
+ # @return [String, nil]
274
+ optional :service, String
275
+
276
+ # @!parse
277
+ # # @return [String]
278
+ # attr_writer :service
279
+
280
+ # @!attribute [r] url
281
+ # Tracking URL of the order.
282
+ #
283
+ # @return [String, nil]
284
+ optional :url, String
285
+
286
+ # @!parse
287
+ # # @return [String]
288
+ # attr_writer :url
289
+
290
+ # @!parse
291
+ # # Tracking information of the order.
292
+ # #
293
+ # # @param number [String]
294
+ # # @param service [String]
295
+ # # @param url [String]
296
+ # #
297
+ # def initialize(number: nil, service: nil, url: nil, **) = super
298
+
299
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
300
+ end
301
+ end
302
+ end
303
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ class OrderGetParams < 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,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ # @example
6
+ # ```ruby
7
+ # order_get_response => {
8
+ # data: TerminalShop::Models::OrderAPI
9
+ # }
10
+ # ```
11
+ class OrderGetResponse < TerminalShop::BaseModel
12
+ # @!attribute data
13
+ # An order from the Terminal shop.
14
+ #
15
+ # @return [TerminalShop::Models::OrderAPI]
16
+ required :data, -> { TerminalShop::Models::OrderAPI }
17
+
18
+ # @!parse
19
+ # # @param data [TerminalShop::Models::OrderAPI]
20
+ # #
21
+ # def initialize(data:, **) = super
22
+
23
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ class OrderListParams < 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,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ # @example
6
+ # ```ruby
7
+ # order_list_response => {
8
+ # data: -> { TerminalShop::ArrayOf[TerminalShop::Models::OrderAPI] === _1 }
9
+ # }
10
+ # ```
11
+ class OrderListResponse < TerminalShop::BaseModel
12
+ # @!attribute data
13
+ # List of orders.
14
+ #
15
+ # @return [Array<TerminalShop::Models::OrderAPI>]
16
+ required :data, -> { TerminalShop::ArrayOf[TerminalShop::Models::OrderAPI] }
17
+
18
+ # @!parse
19
+ # # @param data [Array<TerminalShop::Models::OrderAPI>]
20
+ # #
21
+ # def initialize(data:, **) = super
22
+
23
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,141 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ # @example
6
+ # ```ruby
7
+ # product_api => {
8
+ # id: String,
9
+ # description: String,
10
+ # filters: -> { TerminalShop::ArrayOf[enum: TerminalShop::Models::ProductAPI::Filter] === _1 },
11
+ # name: String,
12
+ # variants: -> { TerminalShop::ArrayOf[TerminalShop::Models::ProductVariant] === _1 },
13
+ # **_
14
+ # }
15
+ # ```
16
+ class ProductAPI < TerminalShop::BaseModel
17
+ # @!attribute id
18
+ # Unique object identifier. The format and length of IDs may change over time.
19
+ #
20
+ # @return [String]
21
+ required :id, String
22
+
23
+ # @!attribute description
24
+ # Description of the product.
25
+ #
26
+ # @return [String]
27
+ required :description, String
28
+
29
+ # @!attribute filters
30
+ #
31
+ # @return [Array<Symbol, TerminalShop::Models::ProductAPI::Filter>]
32
+ required :filters, -> { TerminalShop::ArrayOf[enum: TerminalShop::Models::ProductAPI::Filter] }
33
+
34
+ # @!attribute name
35
+ # Name of the product.
36
+ #
37
+ # @return [String]
38
+ required :name, String
39
+
40
+ # @!attribute variants
41
+ # List of variants of the product.
42
+ #
43
+ # @return [Array<TerminalShop::Models::ProductVariant>]
44
+ required :variants, -> { TerminalShop::ArrayOf[TerminalShop::Models::ProductVariant] }
45
+
46
+ # @!attribute [r] order
47
+ # Order of the product used when displaying a sorted list of products.
48
+ #
49
+ # @return [Integer, nil]
50
+ optional :order, Integer
51
+
52
+ # @!parse
53
+ # # @return [Integer]
54
+ # attr_writer :order
55
+
56
+ # @!attribute [r] subscription
57
+ # Whether the product must be or can be subscribed to.
58
+ #
59
+ # @return [Symbol, TerminalShop::Models::ProductAPI::Subscription, nil]
60
+ optional :subscription, enum: -> { TerminalShop::Models::ProductAPI::Subscription }
61
+
62
+ # @!parse
63
+ # # @return [Symbol, TerminalShop::Models::ProductAPI::Subscription]
64
+ # attr_writer :subscription
65
+
66
+ # @!attribute [r] tags
67
+ # Tags for the product.
68
+ #
69
+ # @return [Hash{Symbol=>String}, nil]
70
+ optional :tags, TerminalShop::HashOf[String]
71
+
72
+ # @!parse
73
+ # # @return [Hash{Symbol=>String}]
74
+ # attr_writer :tags
75
+
76
+ # @!parse
77
+ # # Product sold in the Terminal shop.
78
+ # #
79
+ # # @param id [String]
80
+ # # @param description [String]
81
+ # # @param filters [Array<Symbol, TerminalShop::Models::ProductAPI::Filter>]
82
+ # # @param name [String]
83
+ # # @param variants [Array<TerminalShop::Models::ProductVariant>]
84
+ # # @param order [Integer]
85
+ # # @param subscription [Symbol, TerminalShop::Models::ProductAPI::Subscription]
86
+ # # @param tags [Hash{Symbol=>String}]
87
+ # #
88
+ # def initialize(id:, description:, filters:, name:, variants:, order: nil, subscription: nil, tags: nil, **) = super
89
+
90
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
91
+
92
+ # @abstract
93
+ #
94
+ # @example
95
+ # ```ruby
96
+ # case filter
97
+ # in :eu
98
+ # # ...
99
+ # in :na
100
+ # # ...
101
+ # end
102
+ # ```
103
+ class Filter < TerminalShop::Enum
104
+ EU = :eu
105
+ NA = :na
106
+
107
+ finalize!
108
+
109
+ # @!parse
110
+ # # @return [Array<Symbol>]
111
+ # #
112
+ # def self.values; end
113
+ end
114
+
115
+ # @abstract
116
+ #
117
+ # Whether the product must be or can be subscribed to.
118
+ #
119
+ # @example
120
+ # ```ruby
121
+ # case subscription
122
+ # in :allowed
123
+ # # ...
124
+ # in :required
125
+ # # ...
126
+ # end
127
+ # ```
128
+ class Subscription < TerminalShop::Enum
129
+ ALLOWED = :allowed
130
+ REQUIRED = :required
131
+
132
+ finalize!
133
+
134
+ # @!parse
135
+ # # @return [Array<Symbol>]
136
+ # #
137
+ # def self.values; end
138
+ end
139
+ end
140
+ end
141
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ class ProductListParams < 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,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ # @example
6
+ # ```ruby
7
+ # product_list_response => {
8
+ # data: -> { TerminalShop::ArrayOf[TerminalShop::Models::ProductAPI] === _1 }
9
+ # }
10
+ # ```
11
+ class ProductListResponse < TerminalShop::BaseModel
12
+ # @!attribute data
13
+ # A list of products.
14
+ #
15
+ # @return [Array<TerminalShop::Models::ProductAPI>]
16
+ required :data, -> { TerminalShop::ArrayOf[TerminalShop::Models::ProductAPI] }
17
+
18
+ # @!parse
19
+ # # @param data [Array<TerminalShop::Models::ProductAPI>]
20
+ # #
21
+ # def initialize(data:, **) = super
22
+
23
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ # @example
6
+ # ```ruby
7
+ # product_variant => {
8
+ # id: String,
9
+ # name: String,
10
+ # price: Integer
11
+ # }
12
+ # ```
13
+ class ProductVariant < TerminalShop::BaseModel
14
+ # @!attribute id
15
+ # Unique object identifier. The format and length of IDs may change over time.
16
+ #
17
+ # @return [String]
18
+ required :id, String
19
+
20
+ # @!attribute name
21
+ # Name of the product variant.
22
+ #
23
+ # @return [String]
24
+ required :name, String
25
+
26
+ # @!attribute price
27
+ # Price of the product variant in cents (USD).
28
+ #
29
+ # @return [Integer]
30
+ required :price, Integer
31
+
32
+ # @!parse
33
+ # # Variant of a product in the Terminal shop.
34
+ # #
35
+ # # @param id [String]
36
+ # # @param name [String]
37
+ # # @param price [Integer]
38
+ # #
39
+ # def initialize(id:, name:, price:, **) = super
40
+
41
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,83 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ # @example
6
+ # ```ruby
7
+ # profile_api => {
8
+ # user: TerminalShop::Models::ProfileAPI::User
9
+ # }
10
+ # ```
11
+ class ProfileAPI < TerminalShop::BaseModel
12
+ # @!attribute user
13
+ # A Terminal shop user. (We have users, btw.)
14
+ #
15
+ # @return [TerminalShop::Models::ProfileAPI::User]
16
+ required :user, -> { TerminalShop::Models::ProfileAPI::User }
17
+
18
+ # @!parse
19
+ # # A Terminal shop user's profile. (We have users, btw.)
20
+ # #
21
+ # # @param user [TerminalShop::Models::ProfileAPI::User]
22
+ # #
23
+ # def initialize(user:, **) = super
24
+
25
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
26
+
27
+ # @example
28
+ # ```ruby
29
+ # user => {
30
+ # id: String,
31
+ # email: String,
32
+ # fingerprint: String,
33
+ # name: String,
34
+ # stripe_customer_id: String
35
+ # }
36
+ # ```
37
+ class User < TerminalShop::BaseModel
38
+ # @!attribute id
39
+ # Unique object identifier. The format and length of IDs may change over time.
40
+ #
41
+ # @return [String]
42
+ required :id, String
43
+
44
+ # @!attribute email
45
+ # Email address of the user.
46
+ #
47
+ # @return [String, nil]
48
+ required :email, String, nil?: true
49
+
50
+ # @!attribute fingerprint
51
+ # The user's fingerprint, derived from their public SSH key.
52
+ #
53
+ # @return [String, nil]
54
+ required :fingerprint, String, nil?: true
55
+
56
+ # @!attribute name
57
+ # Name of the user.
58
+ #
59
+ # @return [String, nil]
60
+ required :name, String, nil?: true
61
+
62
+ # @!attribute stripe_customer_id
63
+ # Stripe customer ID of the user.
64
+ #
65
+ # @return [String]
66
+ required :stripe_customer_id, String, api_name: :stripeCustomerID
67
+
68
+ # @!parse
69
+ # # A Terminal shop user. (We have users, btw.)
70
+ # #
71
+ # # @param id [String]
72
+ # # @param email [String, nil]
73
+ # # @param fingerprint [String, nil]
74
+ # # @param name [String, nil]
75
+ # # @param stripe_customer_id [String]
76
+ # #
77
+ # def initialize(id:, email:, fingerprint:, name:, stripe_customer_id:, **) = super
78
+
79
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
80
+ end
81
+ end
82
+ end
83
+ end