straddle 0.2.0 → 0.4.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 (284) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +97 -0
  3. data/README.md +10 -1
  4. data/lib/straddle/client.rb +34 -0
  5. data/lib/straddle/internal/transport/base_client.rb +7 -1
  6. data/lib/straddle/internal/transport/pooled_net_requester.rb +39 -27
  7. data/lib/straddle/internal/util.rb +44 -8
  8. data/lib/straddle/models/bridge/link_bank_account_params.rb +31 -2
  9. data/lib/straddle/models/bridge/link_create_paykey_params.rb +31 -2
  10. data/lib/straddle/models/bridge/link_create_paykey_response.rb +39 -2
  11. data/lib/straddle/models/bridge/link_create_tan_params.rb +30 -2
  12. data/lib/straddle/models/bridge/link_create_tan_response.rb +39 -2
  13. data/lib/straddle/models/bridge/link_plaid_params.rb +30 -2
  14. data/lib/straddle/models/bridge_initialize_params.rb +30 -2
  15. data/lib/straddle/models/charge_cancel_params.rb +8 -1
  16. data/lib/straddle/models/charge_create_params.rb +20 -4
  17. data/lib/straddle/models/charge_get_params.rb +7 -1
  18. data/lib/straddle/models/charge_hold_params.rb +8 -1
  19. data/lib/straddle/models/charge_release_params.rb +8 -1
  20. data/lib/straddle/models/charge_unmask_params.rb +7 -1
  21. data/lib/straddle/models/charge_unmask_response.rb +59 -5
  22. data/lib/straddle/models/charge_update_params.rb +11 -4
  23. data/lib/straddle/models/charge_v1.rb +59 -5
  24. data/lib/straddle/models/customer_delete_params.rb +7 -1
  25. data/lib/straddle/models/customer_get_params.rb +7 -1
  26. data/lib/straddle/models/customer_unmasked_params.rb +7 -1
  27. data/lib/straddle/models/customer_update_params.rb +8 -1
  28. data/lib/straddle/models/customers/review_decision_params.rb +8 -1
  29. data/lib/straddle/models/customers/review_get_params.rb +7 -1
  30. data/lib/straddle/models/customers/review_refresh_review_params.rb +46 -0
  31. data/lib/straddle/models/embed/account_get_params.rb +11 -1
  32. data/lib/straddle/models/embed/account_onboard_params.rb +7 -1
  33. data/lib/straddle/models/embed/account_paged_v1.rb +4 -0
  34. data/lib/straddle/models/embed/account_simulate_params.rb +7 -1
  35. data/lib/straddle/models/embed/account_update_params.rb +8 -1
  36. data/lib/straddle/models/embed/account_v1.rb +4 -0
  37. data/lib/straddle/models/embed/accounts/capability_request_create_params.rb +8 -1
  38. data/lib/straddle/models/embed/accounts/capability_request_list_params.rb +8 -1
  39. data/lib/straddle/models/embed/accounts/capability_request_paged_v1.rb +9 -1
  40. data/lib/straddle/models/embed/address_v1.rb +14 -38
  41. data/lib/straddle/models/embed/linked_bank_account_cancel_params.rb +7 -1
  42. data/lib/straddle/models/embed/linked_bank_account_get_params.rb +7 -1
  43. data/lib/straddle/models/embed/linked_bank_account_list_params.rb +51 -1
  44. data/lib/straddle/models/embed/linked_bank_account_unmask_params.rb +7 -1
  45. data/lib/straddle/models/embed/linked_bank_account_update_params.rb +8 -1
  46. data/lib/straddle/models/embed/organization_get_params.rb +7 -1
  47. data/lib/straddle/models/embed/representative_get_params.rb +7 -1
  48. data/lib/straddle/models/embed/representative_unmask_params.rb +7 -1
  49. data/lib/straddle/models/embed/representative_update_params.rb +8 -1
  50. data/lib/straddle/models/funding_event_get_params.rb +7 -1
  51. data/lib/straddle/models/funding_event_list_params.rb +113 -1
  52. data/lib/straddle/models/funding_event_summary_item_v1.rb +152 -1
  53. data/lib/straddle/models/funding_event_summary_paged_v1.rb +152 -1
  54. data/lib/straddle/models/paykey_cancel_params.rb +7 -1
  55. data/lib/straddle/models/paykey_get_params.rb +7 -1
  56. data/lib/straddle/models/paykey_list_params.rb +24 -1
  57. data/lib/straddle/models/paykey_reveal_params.rb +7 -1
  58. data/lib/straddle/models/paykey_reveal_response.rb +39 -2
  59. data/lib/straddle/models/paykey_summary_paged_v1.rb +48 -2
  60. data/lib/straddle/models/paykey_unmasked_params.rb +7 -1
  61. data/lib/straddle/models/paykey_unmasked_v1.rb +38 -2
  62. data/lib/straddle/models/{customer_refresh_review_params.rb → paykey_update_balance_params.rb} +9 -3
  63. data/lib/straddle/models/paykey_v1.rb +48 -2
  64. data/lib/straddle/models/paykeys/review_decision_params.rb +62 -0
  65. data/lib/straddle/models/paykeys/review_get_params.rb +40 -0
  66. data/lib/straddle/models/paykeys/review_get_response.rb +657 -0
  67. data/lib/straddle/models/paykeys/review_refresh_review_params.rb +46 -0
  68. data/lib/straddle/models/payment_list_params.rb +17 -1
  69. data/lib/straddle/models/payment_summary_paged_v1.rb +21 -4
  70. data/lib/straddle/models/payout_cancel_params.rb +8 -1
  71. data/lib/straddle/models/payout_create_params.rb +20 -4
  72. data/lib/straddle/models/payout_get_params.rb +7 -1
  73. data/lib/straddle/models/payout_hold_params.rb +8 -1
  74. data/lib/straddle/models/payout_release_params.rb +8 -1
  75. data/lib/straddle/models/payout_unmask_params.rb +7 -1
  76. data/lib/straddle/models/payout_unmask_response.rb +59 -5
  77. data/lib/straddle/models/payout_update_params.rb +11 -4
  78. data/lib/straddle/models/payout_v1.rb +59 -5
  79. data/lib/straddle/models/status_details_v1.rb +7 -0
  80. data/lib/straddle/models.rb +3 -3
  81. data/lib/straddle/resources/bridge/link.rb +24 -10
  82. data/lib/straddle/resources/bridge.rb +16 -2
  83. data/lib/straddle/resources/charges.rb +13 -8
  84. data/lib/straddle/resources/customers/review.rb +44 -1
  85. data/lib/straddle/resources/customers.rb +23 -47
  86. data/lib/straddle/resources/embed/accounts/capability_requests.rb +9 -4
  87. data/lib/straddle/resources/embed/accounts.rb +25 -14
  88. data/lib/straddle/resources/embed/linked_bank_accounts.rb +25 -7
  89. data/lib/straddle/resources/embed/organizations.rb +7 -2
  90. data/lib/straddle/resources/embed/representatives.rb +15 -8
  91. data/lib/straddle/resources/embed.rb +19 -0
  92. data/lib/straddle/resources/funding_events.rb +25 -3
  93. data/lib/straddle/resources/paykeys/review.rb +133 -0
  94. data/lib/straddle/resources/paykeys.rb +72 -50
  95. data/lib/straddle/resources/payments.rb +12 -6
  96. data/lib/straddle/resources/payouts.rb +11 -7
  97. data/lib/straddle/version.rb +1 -1
  98. data/lib/straddle.rb +9 -2
  99. data/manifest.yaml +2 -0
  100. data/rbi/straddle/client.rbi +34 -0
  101. data/rbi/straddle/internal/transport/base_client.rbi +5 -0
  102. data/rbi/straddle/internal/transport/pooled_net_requester.rbi +6 -2
  103. data/rbi/straddle/internal/type/base_model.rbi +8 -4
  104. data/rbi/straddle/internal/util.rbi +21 -1
  105. data/rbi/straddle/models/bridge/link_bank_account_params.rbi +76 -1
  106. data/rbi/straddle/models/bridge/link_create_paykey_params.rbi +76 -1
  107. data/rbi/straddle/models/bridge/link_create_paykey_response.rbi +116 -1
  108. data/rbi/straddle/models/bridge/link_create_tan_params.rbi +76 -1
  109. data/rbi/straddle/models/bridge/link_create_tan_response.rbi +116 -1
  110. data/rbi/straddle/models/bridge/link_plaid_params.rbi +76 -1
  111. data/rbi/straddle/models/bridge_initialize_params.rbi +76 -1
  112. data/rbi/straddle/models/charge_cancel_params.rbi +6 -0
  113. data/rbi/straddle/models/charge_create_params.rbi +19 -3
  114. data/rbi/straddle/models/charge_get_params.rbi +6 -0
  115. data/rbi/straddle/models/charge_hold_params.rbi +6 -0
  116. data/rbi/straddle/models/charge_release_params.rbi +6 -0
  117. data/rbi/straddle/models/charge_unmask_params.rbi +6 -0
  118. data/rbi/straddle/models/charge_unmask_response.rbi +143 -6
  119. data/rbi/straddle/models/charge_update_params.rbi +9 -3
  120. data/rbi/straddle/models/charge_v1.rbi +135 -6
  121. data/rbi/straddle/models/customer_delete_params.rbi +6 -0
  122. data/rbi/straddle/models/customer_get_params.rbi +6 -0
  123. data/rbi/straddle/models/customer_unmasked_params.rbi +6 -0
  124. data/rbi/straddle/models/customer_update_params.rbi +6 -0
  125. data/rbi/straddle/models/customers/review_decision_params.rbi +6 -0
  126. data/rbi/straddle/models/customers/review_get_params.rbi +6 -0
  127. data/rbi/straddle/models/customers/review_refresh_review_params.rbi +82 -0
  128. data/rbi/straddle/models/embed/account_get_params.rbi +13 -1
  129. data/rbi/straddle/models/embed/account_onboard_params.rbi +6 -0
  130. data/rbi/straddle/models/embed/account_paged_v1.rbi +20 -0
  131. data/rbi/straddle/models/embed/account_simulate_params.rbi +6 -0
  132. data/rbi/straddle/models/embed/account_update_params.rbi +6 -0
  133. data/rbi/straddle/models/embed/account_v1.rbi +20 -0
  134. data/rbi/straddle/models/embed/accounts/capability_request_create_params.rbi +6 -0
  135. data/rbi/straddle/models/embed/accounts/capability_request_list_params.rbi +6 -0
  136. data/rbi/straddle/models/embed/accounts/capability_request_paged_v1.rbi +8 -0
  137. data/rbi/straddle/models/embed/address_v1.rbi +18 -42
  138. data/rbi/straddle/models/embed/linked_bank_account_cancel_params.rbi +6 -0
  139. data/rbi/straddle/models/embed/linked_bank_account_get_params.rbi +11 -1
  140. data/rbi/straddle/models/embed/linked_bank_account_list_params.rbi +149 -0
  141. data/rbi/straddle/models/embed/linked_bank_account_unmask_params.rbi +11 -1
  142. data/rbi/straddle/models/embed/linked_bank_account_update_params.rbi +6 -0
  143. data/rbi/straddle/models/embed/organization_get_params.rbi +11 -1
  144. data/rbi/straddle/models/embed/representative_get_params.rbi +11 -1
  145. data/rbi/straddle/models/embed/representative_unmask_params.rbi +11 -1
  146. data/rbi/straddle/models/embed/representative_update_params.rbi +6 -0
  147. data/rbi/straddle/models/funding_event_get_params.rbi +6 -0
  148. data/rbi/straddle/models/funding_event_list_params.rbi +341 -0
  149. data/rbi/straddle/models/funding_event_summary_item_v1.rbi +416 -0
  150. data/rbi/straddle/models/funding_event_summary_paged_v1.rbi +417 -0
  151. data/rbi/straddle/models/paykey_cancel_params.rbi +6 -0
  152. data/rbi/straddle/models/paykey_get_params.rbi +6 -0
  153. data/rbi/straddle/models/paykey_list_params.rbi +30 -0
  154. data/rbi/straddle/models/paykey_reveal_params.rbi +6 -0
  155. data/rbi/straddle/models/paykey_reveal_response.rbi +116 -1
  156. data/rbi/straddle/models/paykey_summary_paged_v1.rbi +131 -4
  157. data/rbi/straddle/models/paykey_unmasked_params.rbi +6 -0
  158. data/rbi/straddle/models/paykey_unmasked_v1.rbi +116 -1
  159. data/rbi/straddle/models/{customer_refresh_review_params.rbi → paykey_update_balance_params.rbi} +8 -2
  160. data/rbi/straddle/models/paykey_v1.rbi +128 -4
  161. data/rbi/straddle/models/paykeys/review_decision_params.rbi +121 -0
  162. data/rbi/straddle/models/paykeys/review_get_params.rbi +73 -0
  163. data/rbi/straddle/models/paykeys/review_get_response.rbi +1561 -0
  164. data/rbi/straddle/models/paykeys/review_refresh_review_params.rbi +82 -0
  165. data/rbi/straddle/models/payment_list_params.rbi +51 -0
  166. data/rbi/straddle/models/payment_summary_paged_v1.rbi +24 -3
  167. data/rbi/straddle/models/payout_cancel_params.rbi +6 -0
  168. data/rbi/straddle/models/payout_create_params.rbi +19 -3
  169. data/rbi/straddle/models/payout_get_params.rbi +6 -0
  170. data/rbi/straddle/models/payout_hold_params.rbi +6 -0
  171. data/rbi/straddle/models/payout_release_params.rbi +6 -0
  172. data/rbi/straddle/models/payout_unmask_params.rbi +6 -0
  173. data/rbi/straddle/models/payout_unmask_response.rbi +140 -3
  174. data/rbi/straddle/models/payout_update_params.rbi +9 -3
  175. data/rbi/straddle/models/payout_v1.rbi +132 -3
  176. data/rbi/straddle/models/status_details_v1.rbi +29 -0
  177. data/rbi/straddle/models.rbi +3 -3
  178. data/rbi/straddle/resources/bridge/link.rbi +28 -6
  179. data/rbi/straddle/resources/bridge.rbi +17 -1
  180. data/rbi/straddle/resources/charges.rbi +13 -8
  181. data/rbi/straddle/resources/customers/review.rbi +34 -1
  182. data/rbi/straddle/resources/customers.rbi +20 -35
  183. data/rbi/straddle/resources/embed/accounts/capability_requests.rbi +6 -2
  184. data/rbi/straddle/resources/embed/accounts.rbi +19 -10
  185. data/rbi/straddle/resources/embed/linked_bank_accounts.rbi +18 -4
  186. data/rbi/straddle/resources/embed/organizations.rbi +4 -0
  187. data/rbi/straddle/resources/embed/representatives.rbi +12 -6
  188. data/rbi/straddle/resources/embed.rbi +19 -0
  189. data/rbi/straddle/resources/funding_events.rbi +30 -0
  190. data/rbi/straddle/resources/paykeys/review.rbi +99 -0
  191. data/rbi/straddle/resources/paykeys.rbi +45 -29
  192. data/rbi/straddle/resources/payments.rbi +8 -3
  193. data/rbi/straddle/resources/payouts.rbi +11 -7
  194. data/sig/straddle/internal/transport/base_client.rbs +2 -0
  195. data/sig/straddle/internal/transport/pooled_net_requester.rbs +4 -1
  196. data/sig/straddle/internal/util.rbs +10 -0
  197. data/sig/straddle/models/bridge/link_bank_account_params.rbs +28 -1
  198. data/sig/straddle/models/bridge/link_create_paykey_params.rbs +28 -1
  199. data/sig/straddle/models/bridge/link_create_paykey_response.rbs +45 -2
  200. data/sig/straddle/models/bridge/link_create_tan_params.rbs +28 -1
  201. data/sig/straddle/models/bridge/link_create_tan_response.rbs +45 -2
  202. data/sig/straddle/models/bridge/link_plaid_params.rbs +28 -1
  203. data/sig/straddle/models/bridge_initialize_params.rbs +28 -1
  204. data/sig/straddle/models/charge_cancel_params.rbs +5 -0
  205. data/sig/straddle/models/charge_create_params.rbs +14 -4
  206. data/sig/straddle/models/charge_get_params.rbs +5 -0
  207. data/sig/straddle/models/charge_hold_params.rbs +5 -0
  208. data/sig/straddle/models/charge_release_params.rbs +5 -0
  209. data/sig/straddle/models/charge_unmask_params.rbs +5 -0
  210. data/sig/straddle/models/charge_unmask_response.rbs +57 -7
  211. data/sig/straddle/models/charge_update_params.rbs +9 -4
  212. data/sig/straddle/models/charge_v1.rbs +57 -7
  213. data/sig/straddle/models/customer_delete_params.rbs +5 -0
  214. data/sig/straddle/models/customer_get_params.rbs +5 -0
  215. data/sig/straddle/models/customer_unmasked_params.rbs +5 -0
  216. data/sig/straddle/models/customer_update_params.rbs +5 -0
  217. data/sig/straddle/models/customers/review_decision_params.rbs +5 -0
  218. data/sig/straddle/models/customers/review_get_params.rbs +5 -0
  219. data/sig/straddle/models/customers/review_refresh_review_params.rbs +56 -0
  220. data/sig/straddle/models/embed/account_get_params.rbs +5 -1
  221. data/sig/straddle/models/embed/account_onboard_params.rbs +5 -0
  222. data/sig/straddle/models/embed/account_paged_v1.rbs +18 -2
  223. data/sig/straddle/models/embed/account_simulate_params.rbs +5 -0
  224. data/sig/straddle/models/embed/account_update_params.rbs +5 -0
  225. data/sig/straddle/models/embed/account_v1.rbs +18 -2
  226. data/sig/straddle/models/embed/accounts/capability_request_create_params.rbs +5 -0
  227. data/sig/straddle/models/embed/accounts/capability_request_list_params.rbs +5 -0
  228. data/sig/straddle/models/embed/accounts/capability_request_paged_v1.rbs +5 -0
  229. data/sig/straddle/models/embed/address_v1.rbs +12 -27
  230. data/sig/straddle/models/embed/linked_bank_account_cancel_params.rbs +10 -1
  231. data/sig/straddle/models/embed/linked_bank_account_get_params.rbs +9 -1
  232. data/sig/straddle/models/embed/linked_bank_account_list_params.rbs +46 -0
  233. data/sig/straddle/models/embed/linked_bank_account_unmask_params.rbs +9 -1
  234. data/sig/straddle/models/embed/linked_bank_account_update_params.rbs +5 -0
  235. data/sig/straddle/models/embed/organization_get_params.rbs +5 -1
  236. data/sig/straddle/models/embed/representative_get_params.rbs +9 -1
  237. data/sig/straddle/models/embed/representative_unmask_params.rbs +9 -1
  238. data/sig/straddle/models/embed/representative_update_params.rbs +5 -0
  239. data/sig/straddle/models/funding_event_get_params.rbs +5 -0
  240. data/sig/straddle/models/funding_event_list_params.rbs +130 -0
  241. data/sig/straddle/models/funding_event_summary_item_v1.rbs +179 -0
  242. data/sig/straddle/models/funding_event_summary_paged_v1.rbs +179 -0
  243. data/sig/straddle/models/paykey_cancel_params.rbs +5 -0
  244. data/sig/straddle/models/paykey_get_params.rbs +5 -0
  245. data/sig/straddle/models/paykey_list_params.rbs +17 -1
  246. data/sig/straddle/models/paykey_reveal_params.rbs +5 -0
  247. data/sig/straddle/models/paykey_reveal_response.rbs +45 -2
  248. data/sig/straddle/models/paykey_summary_paged_v1.rbs +53 -5
  249. data/sig/straddle/models/paykey_unmasked_params.rbs +5 -0
  250. data/sig/straddle/models/paykey_unmasked_v1.rbs +45 -2
  251. data/sig/straddle/models/{customer_refresh_review_params.rbs → paykey_update_balance_params.rbs} +7 -2
  252. data/sig/straddle/models/paykey_v1.rbs +53 -5
  253. data/sig/straddle/models/paykeys/review_decision_params.rbs +72 -0
  254. data/sig/straddle/models/paykeys/review_get_params.rbs +49 -0
  255. data/sig/straddle/models/paykeys/review_get_response.rbs +645 -0
  256. data/sig/straddle/models/paykeys/review_refresh_review_params.rbs +56 -0
  257. data/sig/straddle/models/payment_list_params.rbs +23 -0
  258. data/sig/straddle/models/payment_summary_paged_v1.rbs +16 -4
  259. data/sig/straddle/models/payout_cancel_params.rbs +5 -0
  260. data/sig/straddle/models/payout_create_params.rbs +14 -4
  261. data/sig/straddle/models/payout_get_params.rbs +5 -0
  262. data/sig/straddle/models/payout_hold_params.rbs +5 -0
  263. data/sig/straddle/models/payout_release_params.rbs +5 -0
  264. data/sig/straddle/models/payout_unmask_params.rbs +5 -0
  265. data/sig/straddle/models/payout_unmask_response.rbs +54 -4
  266. data/sig/straddle/models/payout_update_params.rbs +9 -4
  267. data/sig/straddle/models/payout_v1.rbs +54 -4
  268. data/sig/straddle/models/status_details_v1.rbs +14 -0
  269. data/sig/straddle/models.rbs +3 -3
  270. data/sig/straddle/resources/bridge/link.rbs +4 -0
  271. data/sig/straddle/resources/bridge.rbs +1 -0
  272. data/sig/straddle/resources/charges.rbs +2 -2
  273. data/sig/straddle/resources/customers/review.rbs +9 -0
  274. data/sig/straddle/resources/customers.rbs +0 -9
  275. data/sig/straddle/resources/embed/linked_bank_accounts.rbs +2 -0
  276. data/sig/straddle/resources/funding_events.rbs +5 -0
  277. data/sig/straddle/resources/paykeys/review.rbs +36 -0
  278. data/sig/straddle/resources/paykeys.rbs +9 -6
  279. data/sig/straddle/resources/payments.rbs +1 -0
  280. data/sig/straddle/resources/payouts.rbs +2 -2
  281. metadata +37 -8
  282. data/lib/straddle/models/paykey_review_params.rb +0 -54
  283. data/rbi/straddle/models/paykey_review_params.rbi +0 -98
  284. data/sig/straddle/models/paykey_review_params.rbs +0 -65
@@ -2,14 +2,27 @@
2
2
 
3
3
  module Straddle
4
4
  module Resources
5
+ # Paykeys are secure tokens that link verified customer identities to their bank
6
+ # accounts. Each Paykey includes built-in balance checking, fraud detection
7
+ # through LSTM machine learning models, and can be reused for subscriptions and
8
+ # recurring payments without storing sensitive data. Paykeys eliminate fraud by
9
+ # ensuring the person initiating payment owns the funding account.
5
10
  class Paykeys
11
+ # Paykeys are secure tokens that link verified customer identities to their bank
12
+ # accounts. Each Paykey includes built-in balance checking, fraud detection
13
+ # through LSTM machine learning models, and can be reused for subscriptions and
14
+ # recurring payments without storing sensitive data. Paykeys eliminate fraud by
15
+ # ensuring the person initiating payment owns the funding account.
16
+ # @return [Straddle::Resources::Paykeys::Review]
17
+ attr_reader :review
18
+
6
19
  # Some parameter documentations has been truncated, see
7
20
  # {Straddle::Models::PaykeyListParams} for more details.
8
21
  #
9
22
  # Returns a list of paykeys associated with a Straddle account. This endpoint
10
23
  # supports advanced sorting and filtering options.
11
24
  #
12
- # @overload list(customer_id: nil, page_number: nil, page_size: nil, sort_by: nil, sort_order: nil, source: nil, status: nil, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {})
25
+ # @overload list(customer_id: nil, page_number: nil, page_size: nil, search_text: nil, sort_by: nil, sort_order: nil, source: nil, status: nil, unblock_eligible: nil, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {})
13
26
  #
14
27
  # @param customer_id [String] Query param: Filter paykeys by related customer ID.
15
28
  #
@@ -17,14 +30,18 @@ module Straddle
17
30
  #
18
31
  # @param page_size [Integer] Query param: Number of results per page. Maximum: 1000.
19
32
  #
20
- # @param sort_by [Symbol, Straddle::Models::PaykeyListParams::SortBy] Query param:
33
+ # @param search_text [String] Query param: General search term to filter paykeys.
34
+ #
35
+ # @param sort_by [Symbol, Straddle::Models::PaykeyListParams::SortBy] Query param
21
36
  #
22
- # @param sort_order [Symbol, Straddle::Models::PaykeyListParams::SortOrder] Query param:
37
+ # @param sort_order [Symbol, Straddle::Models::PaykeyListParams::SortOrder] Query param
23
38
  #
24
39
  # @param source [Array<Symbol, Straddle::Models::PaykeyListParams::Source>] Query param: Filter paykeys by their source.
25
40
  #
26
41
  # @param status [Array<Symbol, Straddle::Models::PaykeyListParams::Status>] Query param: Filter paykeys by their current status.
27
42
  #
43
+ # @param unblock_eligible [Boolean] Query param: Filter paykeys by unblock eligibility. When true, returns only bloc
44
+ #
28
45
  # @param correlation_id [String] Header param: Optional client generated identifier to trace and debug a series o
29
46
  #
30
47
  # @param request_id [String] Header param: Optional client generated identifier to trace and debug a request.
@@ -37,12 +54,24 @@ module Straddle
37
54
  #
38
55
  # @see Straddle::Models::PaykeyListParams
39
56
  def list(params = {})
57
+ query_params =
58
+ [
59
+ :customer_id,
60
+ :page_number,
61
+ :page_size,
62
+ :search_text,
63
+ :sort_by,
64
+ :sort_order,
65
+ :source,
66
+ :status,
67
+ :unblock_eligible
68
+ ]
40
69
  parsed, options = Straddle::PaykeyListParams.dump_request(params)
41
- query_params = [:customer_id, :page_number, :page_size, :sort_by, :sort_order, :source, :status]
70
+ query = Straddle::Internal::Util.encode_query_params(parsed.slice(*query_params))
42
71
  @client.request(
43
72
  method: :get,
44
73
  path: "v1/paykeys",
45
- query: parsed.slice(*query_params),
74
+ query: query,
46
75
  headers: parsed.except(*query_params).transform_keys(
47
76
  correlation_id: "correlation-id",
48
77
  request_id: "request-id",
@@ -59,9 +88,9 @@ module Straddle
59
88
  #
60
89
  # @overload cancel(id, reason: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {})
61
90
  #
62
- # @param id [String] Path param:
91
+ # @param id [String] Path param
63
92
  #
64
- # @param reason [String, nil] Body param:
93
+ # @param reason [String, nil] Body param
65
94
  #
66
95
  # @param correlation_id [String] Header param: Optional client generated identifier to trace and debug a series o
67
96
  #
@@ -129,10 +158,9 @@ module Straddle
129
158
  )
130
159
  end
131
160
 
132
- # Retrieves the details of a paykey that has previously been created, including
133
- # unmasked bank account fields. Supply the unique paykey ID that was returned from
134
- # your previous request, and Straddle will return the corresponding paykey
135
- # information.
161
+ # Retrieves the details of a paykey that has previously been created. Supply the
162
+ # unique paykey ID that was returned from your previous request, and Straddle will
163
+ # return the corresponding paykey information including the unmasked token.
136
164
  #
137
165
  # @overload reveal(id, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {})
138
166
  #
@@ -164,80 +192,73 @@ module Straddle
164
192
  )
165
193
  end
166
194
 
167
- # Some parameter documentations has been truncated, see
168
- # {Straddle::Models::PaykeyReviewParams} for more details.
169
- #
170
- # Update the status of a paykey when in review status
171
- #
172
- # @overload review(id, status:, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {})
173
- #
174
- # @param id [String] Path param:
195
+ # Retrieves the unmasked details of an existing paykey. Supply the unique paykey
196
+ # `id` and Straddle will return the corresponding paykey record, including the
197
+ # unmasked bank account details. This endpoint needs to be enabled by Straddle for
198
+ # your account and should only be used when absolutely necessary.
175
199
  #
176
- # @param status [Symbol, Straddle::Models::PaykeyReviewParams::Status] Body param:
200
+ # @overload unmasked(id, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {})
177
201
  #
178
- # @param correlation_id [String] Header param: Optional client generated identifier to trace and debug a series o
202
+ # @param id [String]
179
203
  #
180
- # @param idempotency_key [String] Header param: Optional client generated value to use for idempotent requests.
204
+ # @param correlation_id [String] Optional client generated identifier to trace and debug a series of requests.
181
205
  #
182
- # @param request_id [String] Header param: Optional client generated identifier to trace and debug a request.
206
+ # @param request_id [String] Optional client generated identifier to trace and debug a request.
183
207
  #
184
- # @param straddle_account_id [String] Header param: For use by platforms to specify an account id and set scope of a r
208
+ # @param straddle_account_id [String] For use by platforms to specify an account id and set scope of a request.
185
209
  #
186
210
  # @param request_options [Straddle::RequestOptions, Hash{Symbol=>Object}, nil]
187
211
  #
188
- # @return [Straddle::Models::PaykeyV1]
212
+ # @return [Straddle::Models::PaykeyUnmaskedV1]
189
213
  #
190
- # @see Straddle::Models::PaykeyReviewParams
191
- def review(id, params)
192
- parsed, options = Straddle::PaykeyReviewParams.dump_request(params)
193
- header_params =
194
- {
214
+ # @see Straddle::Models::PaykeyUnmaskedParams
215
+ def unmasked(id, params = {})
216
+ parsed, options = Straddle::PaykeyUnmaskedParams.dump_request(params)
217
+ @client.request(
218
+ method: :get,
219
+ path: ["v1/paykeys/%1$s/unmasked", id],
220
+ headers: parsed.transform_keys(
195
221
  correlation_id: "correlation-id",
196
- idempotency_key: "idempotency-key",
197
222
  request_id: "request-id",
198
223
  straddle_account_id: "straddle-account-id"
199
- }
200
- @client.request(
201
- method: :patch,
202
- path: ["v1/paykeys/%1$s/review", id],
203
- headers: parsed.slice(*header_params.keys).transform_keys(header_params),
204
- body: parsed.except(*header_params.keys),
205
- model: Straddle::PaykeyV1,
224
+ ),
225
+ model: Straddle::PaykeyUnmaskedV1,
206
226
  options: options
207
227
  )
208
228
  end
209
229
 
210
- # Retrieves the unmasked details of an existing paykey. Supply the unique paykey
211
- # `id` and Straddle will return the corresponding paykey record, including the
212
- # unmasked bank account details. This endpoint needs to be enabled by Straddle for
213
- # your account and should only be used when absolutely necessary.
230
+ # Updates the balance of a paykey. This endpoint allows you to refresh the balance
231
+ # of a paykey.
214
232
  #
215
- # @overload unmasked(id, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {})
233
+ # @overload update_balance(id, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {})
216
234
  #
217
235
  # @param id [String]
218
236
  #
219
237
  # @param correlation_id [String] Optional client generated identifier to trace and debug a series of requests.
220
238
  #
239
+ # @param idempotency_key [String] Optional client generated value to use for idempotent requests.
240
+ #
221
241
  # @param request_id [String] Optional client generated identifier to trace and debug a request.
222
242
  #
223
243
  # @param straddle_account_id [String] For use by platforms to specify an account id and set scope of a request.
224
244
  #
225
245
  # @param request_options [Straddle::RequestOptions, Hash{Symbol=>Object}, nil]
226
246
  #
227
- # @return [Straddle::Models::PaykeyUnmaskedV1]
247
+ # @return [Straddle::Models::PaykeyV1]
228
248
  #
229
- # @see Straddle::Models::PaykeyUnmaskedParams
230
- def unmasked(id, params = {})
231
- parsed, options = Straddle::PaykeyUnmaskedParams.dump_request(params)
249
+ # @see Straddle::Models::PaykeyUpdateBalanceParams
250
+ def update_balance(id, params = {})
251
+ parsed, options = Straddle::PaykeyUpdateBalanceParams.dump_request(params)
232
252
  @client.request(
233
- method: :get,
234
- path: ["v1/paykeys/%1$s/unmasked", id],
253
+ method: :put,
254
+ path: ["v1/paykeys/%1$s/refresh_balance", id],
235
255
  headers: parsed.transform_keys(
236
256
  correlation_id: "correlation-id",
257
+ idempotency_key: "idempotency-key",
237
258
  request_id: "request-id",
238
259
  straddle_account_id: "straddle-account-id"
239
260
  ),
240
- model: Straddle::PaykeyUnmaskedV1,
261
+ model: Straddle::PaykeyV1,
241
262
  options: options
242
263
  )
243
264
  end
@@ -247,6 +268,7 @@ module Straddle
247
268
  # @param client [Straddle::Client]
248
269
  def initialize(client:)
249
270
  @client = client
271
+ @review = Straddle::Resources::Paykeys::Review.new(client: client)
250
272
  end
251
273
  end
252
274
  end
@@ -2,6 +2,8 @@
2
2
 
3
3
  module Straddle
4
4
  module Resources
5
+ # Payments provide endpoints to filter both Charges and Payouts with multiple
6
+ # different parameters.
5
7
  class Payments
6
8
  # Some parameter documentations has been truncated, see
7
9
  # {Straddle::Models::PaymentListParams} for more details.
@@ -9,20 +11,22 @@ module Straddle
9
11
  # Search for payments, including `charges` and `payouts`, using a variety of
10
12
  # criteria. This endpoint supports advanced sorting and filtering options.
11
13
  #
12
- # @overload list(customer_id: nil, default_page_size: nil, default_sort: nil, default_sort_order: nil, external_id: nil, funding_id: nil, max_amount: nil, max_created_at: nil, max_effective_at: nil, max_payment_date: nil, min_amount: nil, min_created_at: nil, min_effective_at: nil, min_payment_date: nil, page_number: nil, page_size: nil, paykey: nil, paykey_id: nil, payment_id: nil, payment_status: nil, payment_type: nil, search_text: nil, sort_by: nil, sort_order: nil, status_reason: nil, status_source: nil, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {})
14
+ # @overload list(customer_id: nil, default_page_size: nil, default_sort: nil, default_sort_order: nil, external_id: nil, funding_id: nil, include_metadata: nil, max_amount: nil, max_created_at: nil, max_effective_at: nil, max_payment_date: nil, min_amount: nil, min_created_at: nil, min_effective_at: nil, min_payment_date: nil, page_number: nil, page_size: nil, paykey: nil, paykey_id: nil, payment_id: nil, payment_status: nil, payment_type: nil, search_text: nil, sort_by: nil, sort_order: nil, status_reason: nil, status_source: nil, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {})
13
15
  #
14
16
  # @param customer_id [String] Query param: Search using the `customer_id` of a `charge` or `payout`.
15
17
  #
16
- # @param default_page_size [Integer] Query param:
18
+ # @param default_page_size [Integer] Query param
17
19
  #
18
20
  # @param default_sort [Symbol, Straddle::Models::PaymentListParams::DefaultSort] Query param: The field to sort the results by.
19
21
  #
20
- # @param default_sort_order [Symbol, Straddle::Models::PaymentListParams::DefaultSortOrder] Query param:
22
+ # @param default_sort_order [Symbol, Straddle::Models::PaymentListParams::DefaultSortOrder] Query param
21
23
  #
22
24
  # @param external_id [String] Query param: Search using the `external_id` of a `charge` or `payout`.
23
25
  #
24
26
  # @param funding_id [String] Query param: Search using the `funding_id` of a `charge` or `payout`.
25
27
  #
28
+ # @param include_metadata [Boolean] Query param: Include the metadata for payments in the returned data.
29
+ #
26
30
  # @param max_amount [Integer] Query param: Search using a maximum `amount` of a `charge` or `payout`.
27
31
  #
28
32
  # @param max_created_at [Time] Query param: Search using the latest `created_at` date of a `charge` or `payout`
@@ -57,7 +61,7 @@ module Straddle
57
61
  #
58
62
  # @param sort_by [Symbol, Straddle::Models::PaymentListParams::SortBy] Query param: The field to sort the results by.
59
63
  #
60
- # @param sort_order [Symbol, Straddle::Models::PaymentListParams::SortOrder] Query param:
64
+ # @param sort_order [Symbol, Straddle::Models::PaymentListParams::SortOrder] Query param
61
65
  #
62
66
  # @param status_reason [Array<Symbol, Straddle::Models::PaymentListParams::StatusReason>] Query param: Reason for latest payment status change.
63
67
  #
@@ -75,7 +79,6 @@ module Straddle
75
79
  #
76
80
  # @see Straddle::Models::PaymentListParams
77
81
  def list(params = {})
78
- parsed, options = Straddle::PaymentListParams.dump_request(params)
79
82
  query_params =
80
83
  [
81
84
  :customer_id,
@@ -84,6 +87,7 @@ module Straddle
84
87
  :default_sort_order,
85
88
  :external_id,
86
89
  :funding_id,
90
+ :include_metadata,
87
91
  :max_amount,
88
92
  :max_created_at,
89
93
  :max_effective_at,
@@ -105,10 +109,12 @@ module Straddle
105
109
  :status_reason,
106
110
  :status_source
107
111
  ]
112
+ parsed, options = Straddle::PaymentListParams.dump_request(params)
113
+ query = Straddle::Internal::Util.encode_query_params(parsed.slice(*query_params))
108
114
  @client.request(
109
115
  method: :get,
110
116
  path: "v1/payments",
111
- query: parsed.slice(*query_params),
117
+ query: query,
112
118
  headers: parsed.except(*query_params).transform_keys(
113
119
  correlation_id: "correlation-id",
114
120
  request_id: "request-id",
@@ -2,6 +2,10 @@
2
2
 
3
3
  module Straddle
4
4
  module Resources
5
+ # Payouts represent transfers from Straddle to customer bank accounts. Create
6
+ # payouts to handle disbursements, process refunds, or manage marketplace
7
+ # settlements. Use payouts to send money quickly and securely with the most
8
+ # cost-effective rail automatically selected.
5
9
  class Payouts
6
10
  # Some parameter documentations has been truncated, see
7
11
  # {Straddle::Models::PayoutCreateParams} for more details.
@@ -14,7 +18,7 @@ module Straddle
14
18
  #
15
19
  # @param currency [String] Body param: The currency of the payout. Only USD is supported.
16
20
  #
17
- # @param description [String] Body param: An arbitrary description for the payout.
21
+ # @param description [String, nil] Body param: An arbitrary description for the payout.
18
22
  #
19
23
  # @param device [Straddle::Models::DeviceInfoV1] Body param: Information about the device used when the customer authorized the p
20
24
  #
@@ -24,7 +28,7 @@ module Straddle
24
28
  #
25
29
  # @param payment_date [Date] Body param: The desired date on which the payout should be occur. For payouts, t
26
30
  #
27
- # @param config [Straddle::Models::PayoutCreateParams::Config] Body param:
31
+ # @param config [Straddle::Models::PayoutCreateParams::Config] Body param
28
32
  #
29
33
  # @param metadata [Hash{Symbol=>String}, nil] Body param: Up to 20 additional user-defined key-value pairs. Useful for storing
30
34
  #
@@ -68,11 +72,11 @@ module Straddle
68
72
  #
69
73
  # @overload update(id, amount:, description:, payment_date:, metadata: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {})
70
74
  #
71
- # @param id [String] Path param:
75
+ # @param id [String] Path param
72
76
  #
73
77
  # @param amount [Integer] Body param: The amount of the payout in cents.
74
78
  #
75
- # @param description [String] Body param: An arbitrary description for the payout.
79
+ # @param description [String, nil] Body param: An arbitrary description for the payout.
76
80
  #
77
81
  # @param payment_date [Date] Body param: The desired date on which the payment should be occur. For payouts,
78
82
  #
@@ -118,7 +122,7 @@ module Straddle
118
122
  #
119
123
  # @overload cancel(id, reason:, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {})
120
124
  #
121
- # @param id [String] Path param:
125
+ # @param id [String] Path param
122
126
  #
123
127
  # @param reason [String] Body param: Details about why the payout status was updated.
124
128
  #
@@ -195,7 +199,7 @@ module Straddle
195
199
  #
196
200
  # @overload hold(id, reason:, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {})
197
201
  #
198
- # @param id [String] Path param:
202
+ # @param id [String] Path param
199
203
  #
200
204
  # @param reason [String] Body param: Details about why the payout status was updated.
201
205
  #
@@ -239,7 +243,7 @@ module Straddle
239
243
  #
240
244
  # @overload release(id, reason:, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {})
241
245
  #
242
- # @param id [String] Path param:
246
+ # @param id [String] Path param
243
247
  #
244
248
  # @param reason [String] Body param: Details about why the payout status was updated.
245
249
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Straddle
4
- VERSION = "0.2.0"
4
+ VERSION = "0.4.0"
5
5
  end
data/lib/straddle.rb CHANGED
@@ -3,12 +3,14 @@
3
3
  # Standard libraries.
4
4
  # rubocop:disable Lint/RedundantRequireStatement
5
5
  require "English"
6
+ require "base64"
6
7
  require "cgi"
7
8
  require "date"
8
9
  require "erb"
9
10
  require "etc"
10
11
  require "json"
11
12
  require "net/http"
13
+ require "openssl"
12
14
  require "pathname"
13
15
  require "rbconfig"
14
16
  require "securerandom"
@@ -74,11 +76,11 @@ require_relative "straddle/models/customer_delete_params"
74
76
  require_relative "straddle/models/customer_details_v1"
75
77
  require_relative "straddle/models/customer_get_params"
76
78
  require_relative "straddle/models/customer_list_params"
77
- require_relative "straddle/models/customer_refresh_review_params"
78
79
  require_relative "straddle/models/customers/customer_review_v1"
79
80
  require_relative "straddle/models/customers/identity_verification_breakdown_v1"
80
81
  require_relative "straddle/models/customers/review_decision_params"
81
82
  require_relative "straddle/models/customers/review_get_params"
83
+ require_relative "straddle/models/customers/review_refresh_review_params"
82
84
  require_relative "straddle/models/customer_summary_paged_v1"
83
85
  require_relative "straddle/models/customer_unmasked_params"
84
86
  require_relative "straddle/models/customer_unmasked_v1"
@@ -135,10 +137,14 @@ require_relative "straddle/models/paykey_get_params"
135
137
  require_relative "straddle/models/paykey_list_params"
136
138
  require_relative "straddle/models/paykey_reveal_params"
137
139
  require_relative "straddle/models/paykey_reveal_response"
138
- require_relative "straddle/models/paykey_review_params"
140
+ require_relative "straddle/models/paykeys/review_decision_params"
141
+ require_relative "straddle/models/paykeys/review_get_params"
142
+ require_relative "straddle/models/paykeys/review_get_response"
143
+ require_relative "straddle/models/paykeys/review_refresh_review_params"
139
144
  require_relative "straddle/models/paykey_summary_paged_v1"
140
145
  require_relative "straddle/models/paykey_unmasked_params"
141
146
  require_relative "straddle/models/paykey_unmasked_v1"
147
+ require_relative "straddle/models/paykey_update_balance_params"
142
148
  require_relative "straddle/models/paykey_v1"
143
149
  require_relative "straddle/models/payment_list_params"
144
150
  require_relative "straddle/models/payment_summary_paged_v1"
@@ -169,6 +175,7 @@ require_relative "straddle/resources/embed/organizations"
169
175
  require_relative "straddle/resources/embed/representatives"
170
176
  require_relative "straddle/resources/funding_events"
171
177
  require_relative "straddle/resources/paykeys"
178
+ require_relative "straddle/resources/paykeys/review"
172
179
  require_relative "straddle/resources/payments"
173
180
  require_relative "straddle/resources/payouts"
174
181
  require_relative "straddle/resources/reports"
data/manifest.yaml CHANGED
@@ -1,11 +1,13 @@
1
1
  dependencies:
2
2
  - English
3
+ - base64
3
4
  - cgi
4
5
  - date
5
6
  - erb
6
7
  - etc
7
8
  - json
8
9
  - net/http
10
+ - openssl
9
11
  - pathname
10
12
  - rbconfig
11
13
  - securerandom
@@ -27,24 +27,58 @@ module Straddle
27
27
  sig { returns(Straddle::Resources::Embed) }
28
28
  attr_reader :embed
29
29
 
30
+ # Bridge provides a comprehensive suite of tools for connecting customer bank
31
+ # accounts. Use it to generate secure widget sessions for instant account
32
+ # verification, accept tokens from major providers like Plaid and Finicity, or
33
+ # verify accounts directly via our API. Bridge handles all sensitive banking
34
+ # credentials and ensures secure, compliant connections with support for 90% of US
35
+ # bank accounts.
30
36
  sig { returns(Straddle::Resources::Bridge) }
31
37
  attr_reader :bridge
32
38
 
39
+ # Customers represent the end users who send or receive payments through your
40
+ # integration. Each customer undergoes automatic identity verification and fraud
41
+ # screening upon creation. Use customers to track payment history, manage bank
42
+ # account connections, and maintain a secure record of all transactions associated
43
+ # with a user. Customers can be either individuals or businesses with appropriate
44
+ # compliance checks for each type.
33
45
  sig { returns(Straddle::Resources::Customers) }
34
46
  attr_reader :customers
35
47
 
48
+ # Paykeys are secure tokens that link verified customer identities to their bank
49
+ # accounts. Each Paykey includes built-in balance checking, fraud detection
50
+ # through LSTM machine learning models, and can be reused for subscriptions and
51
+ # recurring payments without storing sensitive data. Paykeys eliminate fraud by
52
+ # ensuring the person initiating payment owns the funding account.
36
53
  sig { returns(Straddle::Resources::Paykeys) }
37
54
  attr_reader :paykeys
38
55
 
56
+ # Charges represent attempts to debit money from a customer's bank account using a
57
+ # Paykey. Each charge includes automatic balance verification, real-time fraud
58
+ # screening, and multi-rail optimization and detailed status tracking throughout
59
+ # the payment lifecycle. Use charges to accept bank payments with confidence
60
+ # knowing every transaction is protected.
39
61
  sig { returns(Straddle::Resources::Charges) }
40
62
  attr_reader :charges
41
63
 
64
+ # Funding events represent all money movement between Straddle and an Account's
65
+ # external bank accounts. They are automatically generated when charges settle or
66
+ # payouts are initiated. Each event provides detailed tracking of settlement
67
+ # status, fee breakdowns, and reconciliation data across both incoming and
68
+ # outgoing transfers. Use funding events to monitor your platform's entire money
69
+ # movement lifecycle.
42
70
  sig { returns(Straddle::Resources::FundingEvents) }
43
71
  attr_reader :funding_events
44
72
 
73
+ # Payments provide endpoints to filter both Charges and Payouts with multiple
74
+ # different parameters.
45
75
  sig { returns(Straddle::Resources::Payments) }
46
76
  attr_reader :payments
47
77
 
78
+ # Payouts represent transfers from Straddle to customer bank accounts. Create
79
+ # payouts to handle disbursements, process refunds, or manage marketplace
80
+ # settlements. Use payouts to send money quickly and securely with the most
81
+ # cost-effective rail automatically selected.
48
82
  sig { returns(Straddle::Resources::Payouts) }
49
83
  attr_reader :payouts
50
84
 
@@ -176,6 +176,11 @@ module Straddle
176
176
  private def auth_headers
177
177
  end
178
178
 
179
+ # @api private
180
+ sig { returns(String) }
181
+ private def user_agent
182
+ end
183
+
179
184
  # @api private
180
185
  sig { returns(String) }
181
186
  private def generate_idempotency_key
@@ -26,8 +26,12 @@ module Straddle
26
26
 
27
27
  class << self
28
28
  # @api private
29
- sig { params(url: URI::Generic).returns(Net::HTTP) }
30
- def connect(url)
29
+ sig do
30
+ params(cert_store: OpenSSL::X509::Store, url: URI::Generic).returns(
31
+ Net::HTTP
32
+ )
33
+ end
34
+ def connect(cert_store:, url:)
31
35
  end
32
36
 
33
37
  # @api private
@@ -31,7 +31,7 @@ module Straddle
31
31
  #
32
32
  # Assumes superclass fields are totally defined before fields are accessed /
33
33
  # defined on subclasses.
34
- sig { params(child: T.self_type).void }
34
+ sig { params(child: Straddle::Internal::Type::BaseModel).void }
35
35
  def inherited(child)
36
36
  end
37
37
 
@@ -274,9 +274,13 @@ module Straddle
274
274
 
275
275
  # Create a new instance of a model.
276
276
  sig do
277
- params(data: T.any(T::Hash[Symbol, T.anything], T.self_type)).returns(
278
- T.attached_class
279
- )
277
+ params(
278
+ data:
279
+ T.any(
280
+ T::Hash[Symbol, T.anything],
281
+ Straddle::Internal::Type::BaseModel
282
+ )
283
+ ).returns(T.attached_class)
280
284
  end
281
285
  def self.new(data = {})
282
286
  end
@@ -296,11 +296,31 @@ module Straddle
296
296
  end
297
297
 
298
298
  JSON_CONTENT =
299
- T.let(%r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)}, Regexp)
299
+ T.let(%r{^application/(?:[a-zA-Z0-9.-]+\+)?json(?!l)}, Regexp)
300
300
  JSONL_CONTENT =
301
301
  T.let(%r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}, Regexp)
302
302
 
303
303
  class << self
304
+ # @api private
305
+ sig do
306
+ params(query: Straddle::Internal::AnyHash).returns(
307
+ Straddle::Internal::AnyHash
308
+ )
309
+ end
310
+ def encode_query_params(query)
311
+ end
312
+
313
+ # @api private
314
+ sig do
315
+ params(
316
+ collection: Straddle::Internal::AnyHash,
317
+ key: String,
318
+ element: T.anything
319
+ ).void
320
+ end
321
+ private def write_query_param_element!(collection, key, element)
322
+ end
323
+
304
324
  # @api private
305
325
  sig do
306
326
  params(