clerk-sdk-ruby 7.0.0 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (335) hide show
  1. checksums.yaml +4 -4
  2. data/lib/clerk/actortokens.rb +10 -10
  3. data/lib/clerk/admin_portal_link_tokens.rb +10 -10
  4. data/lib/clerk/agenttasks.rb +10 -10
  5. data/lib/clerk/allowlistidentifiers.rb +15 -15
  6. data/lib/clerk/api_keys.rb +40 -40
  7. data/lib/clerk/betafeatures.rb +10 -10
  8. data/lib/clerk/billing.rb +52 -52
  9. data/lib/clerk/blocklistidentifiers.rb +15 -15
  10. data/lib/clerk/clients.rb +15 -15
  11. data/lib/clerk/domains.rb +20 -20
  12. data/lib/clerk/emailaddresses.rb +43 -36
  13. data/lib/clerk/emailandsmstemplates.rb +6 -6
  14. data/lib/clerk/emailsmstemplates.rb +21 -21
  15. data/lib/clerk/enterpriseconnections.rb +35 -35
  16. data/lib/clerk/instancesettings.rb +60 -60
  17. data/lib/clerk/invitations.rb +20 -20
  18. data/lib/clerk/jwks.rb +5 -5
  19. data/lib/clerk/jwttemplates.rb +25 -25
  20. data/lib/clerk/m2m.rb +20 -20
  21. data/lib/clerk/machines.rb +45 -45
  22. data/lib/clerk/miscellaneous.rb +5 -5
  23. data/lib/clerk/models/components/algorithm.rb +19 -0
  24. data/lib/clerk/models/components/{clerkerror_meta.rbi → algorithm.rbi} +2 -2
  25. data/lib/clerk/models/components/billingpaymentattempt_totals.rb +1 -1
  26. data/lib/clerk/models/components/clerkerror.rb +1 -1
  27. data/lib/clerk/models/components/commercecreditledgerresponse.rb +3 -7
  28. data/lib/clerk/models/components/commercecreditledgerresponse.rbi +0 -2
  29. data/lib/clerk/models/components/{schemas_commerceperunittotal.rb → commerceperunittotal_2.rb} +2 -2
  30. data/lib/clerk/models/components/{schemas_commerceperunittotal.rbi → commerceperunittotal_2.rbi} +2 -2
  31. data/lib/clerk/models/components/{schemas_commerceperunittotaltier.rb → commerceperunittotaltier_2.rb} +1 -1
  32. data/lib/clerk/models/components/{schemas_commerceperunittotaltier.rbi → commerceperunittotaltier_2.rbi} +2 -2
  33. data/lib/clerk/models/components/{schemas_commerceplan.rb → commerceplan_2.rb} +6 -6
  34. data/lib/clerk/models/components/{schemas_commerceplan.rbi → commerceplan_2.rbi} +2 -2
  35. data/lib/clerk/models/components/{schemas_commerceplan_fee.rb → commerceplan_2_annual_fee.rb} +1 -1
  36. data/lib/clerk/models/components/{schemas_commerceplan_fee.rbi → commerceplan_2_annual_fee.rbi} +2 -2
  37. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_fee.rb → commerceplan_2_annual_monthly_fee.rb} +1 -1
  38. data/lib/clerk/models/components/{schemas_commerceplan_annual_monthly_fee.rbi → commerceplan_2_annual_monthly_fee.rbi} +2 -2
  39. data/lib/clerk/models/components/{schemas_commerceplan_annual_fee.rb → commerceplan_2_fee.rb} +1 -1
  40. data/lib/clerk/models/components/{schemas_commerceplan_annual_fee.rbi → commerceplan_2_fee.rbi} +2 -2
  41. data/lib/clerk/models/components/{schemas_commerceplan_object.rb → commerceplan_2_object.rb} +2 -2
  42. data/lib/clerk/models/components/{clerkerrors_meta.rbi → commerceplan_2_object.rbi} +2 -2
  43. data/lib/clerk/models/components/commercepricetransitiondetails.rb +1 -1
  44. data/lib/clerk/models/components/commercepricetransitionresponse.rb +1 -1
  45. data/lib/clerk/models/components/{schemas_commercesubscriptionitem.rb → commercesubscriptionitem_2.rb} +7 -7
  46. data/lib/clerk/models/components/{schemas_commercesubscriptionitem.rbi → commercesubscriptionitem_2.rbi} +2 -2
  47. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_amount.rb → commercesubscriptionitem_2_amount.rb} +1 -1
  48. data/lib/clerk/models/components/commercesubscriptionitem_2_amount.rbi +19 -0
  49. data/lib/clerk/models/components/{schemas_commerceplan_annual_monthly_fee.rb → commercesubscriptionitem_2_annual_fee.rb} +1 -1
  50. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_fee.rbi → commercesubscriptionitem_2_annual_fee.rbi} +2 -2
  51. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_annual_fee.rb → commercesubscriptionitem_2_annual_monthly_fee.rb} +1 -1
  52. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_amount.rbi → commercesubscriptionitem_2_annual_monthly_fee.rbi} +2 -2
  53. data/lib/clerk/models/components/commercesubscriptionitem_2_fee.rb +44 -0
  54. data/lib/clerk/models/components/commercesubscriptionitem_2_fee.rbi +19 -0
  55. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment.rb → commercesubscriptionitem_2_next_payment.rb} +3 -3
  56. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment.rbi → commercesubscriptionitem_2_next_payment.rbi} +2 -2
  57. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_amount.rb → commercesubscriptionitem_2_next_payment_amount.rb} +1 -1
  58. data/lib/clerk/models/components/commercesubscriptionitem_2_next_payment_amount.rbi +19 -0
  59. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_credits.rb → commercesubscriptionitem_2_next_payment_credits.rb} +3 -3
  60. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_credits.rbi → commercesubscriptionitem_2_next_payment_credits.rbi} +2 -2
  61. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_credits_proration.rb → commercesubscriptionitem_2_next_payment_credits_proration.rb} +1 -1
  62. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_credits_proration.rbi → commercesubscriptionitem_2_next_payment_credits_proration.rbi} +2 -2
  63. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_discounts.rb → commercesubscriptionitem_2_next_payment_discounts.rb} +2 -2
  64. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_discounts.rbi → commercesubscriptionitem_2_next_payment_discounts.rbi} +2 -2
  65. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_discounts_proration.rb → commercesubscriptionitem_2_next_payment_discounts_proration.rb} +1 -1
  66. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_discounts_proration.rbi → commercesubscriptionitem_2_next_payment_discounts_proration.rbi} +2 -2
  67. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_payer.rb → commercesubscriptionitem_2_next_payment_payer.rb} +1 -1
  68. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_payer.rbi → commercesubscriptionitem_2_next_payment_payer.rbi} +2 -2
  69. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_totals.rb → commercesubscriptionitem_2_next_payment_totals.rb} +3 -3
  70. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_totals.rbi → commercesubscriptionitem_2_next_payment_totals.rbi} +2 -2
  71. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_object_commercepayer.rb → commercesubscriptionitem_2_object_commercepayer.rb} +2 -2
  72. data/lib/clerk/models/components/commercesubscriptionitem_2_object_commercepayer.rbi +11 -0
  73. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_object_commerceplan.rb → commercesubscriptionitem_2_object_commerceplan.rb} +2 -2
  74. data/lib/clerk/models/components/commercesubscriptionitem_2_object_commerceplan.rbi +11 -0
  75. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_object_commercesubscriptionitem.rb → commercesubscriptionitem_2_object_commercesubscriptionitem.rb} +2 -2
  76. data/lib/clerk/models/components/commercesubscriptionitem_2_object_commercesubscriptionitem.rbi +11 -0
  77. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_plan.rb → commercesubscriptionitem_2_plan.rb} +6 -6
  78. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_plan.rbi → commercesubscriptionitem_2_plan.rbi} +2 -2
  79. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_plan_period.rb → commercesubscriptionitem_2_plan_period.rb} +2 -2
  80. data/lib/clerk/models/components/commercesubscriptionitem_2_plan_period.rbi +11 -0
  81. data/lib/clerk/models/components/{schemas_commercesubscriptionitem_status.rb → commercesubscriptionitem_2_status.rb} +2 -2
  82. data/lib/clerk/models/components/commercesubscriptionitem_2_status.rbi +11 -0
  83. data/lib/clerk/models/components/commercesubscriptionitem_totals.rb +1 -1
  84. data/lib/clerk/models/components/commercesubscriptionnextpayment.rb +1 -1
  85. data/lib/clerk/models/components/commercesubscriptionnextpayment_totals.rb +1 -1
  86. data/lib/clerk/models/components/emailaddress_verification_saml_clerkerror.rb +1 -1
  87. data/lib/clerk/models/components/enrollment_mode.rb +1 -0
  88. data/lib/clerk/models/components/enterpriseaccount_verification_oauth_clerkerror.rb +1 -1
  89. data/lib/clerk/models/components/enterpriseaccount_verification_saml_clerkerror.rb +1 -1
  90. data/lib/clerk/models/components/enterpriseconnection.rb +6 -2
  91. data/lib/clerk/models/components/enterpriseconnection.rbi +2 -0
  92. data/lib/clerk/models/components/{custom_attribute.rb → enterpriseconnection_custom_attribute.rb} +1 -1
  93. data/lib/clerk/models/components/enterpriseconnection_custom_attribute.rbi +21 -0
  94. data/lib/clerk/models/components/enterpriseconnection_mode.rb +21 -0
  95. data/lib/clerk/models/components/enterpriseconnection_mode.rbi +11 -0
  96. data/lib/clerk/models/components/enterpriseconnection_object.rb +19 -0
  97. data/lib/clerk/models/components/enterpriseconnection_object.rbi +11 -0
  98. data/lib/clerk/models/components/enterpriseconnection_saml_connection.rb +5 -1
  99. data/lib/clerk/models/components/enterpriseconnection_saml_connection.rbi +2 -0
  100. data/lib/clerk/models/components/externalaccountwithverification_verification_oauth_clerkerror.rb +1 -1
  101. data/lib/clerk/models/components/{schemas_featureresponse.rb → featureresponse_2.rb} +2 -2
  102. data/lib/clerk/models/components/{schemas_featureresponse.rbi → featureresponse_2.rbi} +2 -2
  103. data/lib/clerk/models/components/{schemas_featureresponse_object.rb → featureresponse_2_object.rb} +2 -2
  104. data/lib/clerk/models/components/featureresponse_2_object.rbi +11 -0
  105. data/lib/clerk/models/components/instanceprotect.rb +5 -1
  106. data/lib/clerk/models/components/instanceprotect.rbi +2 -0
  107. data/lib/clerk/models/components/instancesettings.rb +4 -1
  108. data/lib/clerk/models/components/login_hint.rb +36 -0
  109. data/lib/clerk/models/components/login_hint.rbi +15 -0
  110. data/lib/clerk/models/components/oauthapplicationsettings.rb +17 -1
  111. data/lib/clerk/models/components/oauthapplicationsettings.rbi +8 -0
  112. data/lib/clerk/models/components/organizationmembershippublicuserdata.rb +5 -1
  113. data/lib/clerk/models/components/organizationmembershippublicuserdata.rbi +2 -0
  114. data/lib/clerk/models/components/payer_commercepayer.rb +1 -1
  115. data/lib/clerk/models/components/payment_type.rb +1 -0
  116. data/lib/clerk/models/components/platform.rb +20 -0
  117. data/lib/clerk/models/components/{samlaccount_meta.rbi → platform.rbi} +2 -2
  118. data/lib/clerk/models/components/samlaccount_clerkerror.rb +1 -1
  119. data/lib/clerk/models/components/samlconnection_1.rb +15 -1
  120. data/lib/clerk/models/components/samlconnection_1.rbi +6 -0
  121. data/lib/clerk/models/components/samlconnection_2.rb +15 -1
  122. data/lib/clerk/models/components/samlconnection_2.rbi +6 -0
  123. data/lib/clerk/models/components/samlconnectionloginhint.rb +36 -0
  124. data/lib/clerk/models/components/samlconnectionloginhint.rbi +15 -0
  125. data/lib/clerk/models/components/samlconnectionloginhint_mode.rb +21 -0
  126. data/lib/clerk/models/components/samlconnectionloginhint_mode.rbi +11 -0
  127. data/lib/clerk/models/components/scimdirectory.rb +80 -0
  128. data/lib/clerk/models/components/scimdirectory.rbi +37 -0
  129. data/lib/clerk/models/components/scimdirectory_custom_attribute.rb +48 -0
  130. data/lib/clerk/models/components/{custom_attribute.rbi → scimdirectory_custom_attribute.rbi} +2 -2
  131. data/lib/clerk/models/components/scimdirectory_list.rb +36 -0
  132. data/lib/clerk/models/components/scimdirectory_list.rbi +15 -0
  133. data/lib/clerk/models/components/scimdirectory_object.rb +19 -0
  134. data/lib/clerk/models/components/scimdirectory_object.rbi +11 -0
  135. data/lib/clerk/models/components/scimgrouprolemapping.rb +64 -0
  136. data/lib/clerk/models/components/scimgrouprolemapping.rbi +29 -0
  137. data/lib/clerk/models/components/scimgrouprolemapping_deleted.rb +43 -0
  138. data/lib/clerk/models/components/scimgrouprolemapping_deleted.rbi +17 -0
  139. data/lib/clerk/models/components/scimgrouprolemapping_deleted_object.rb +19 -0
  140. data/lib/clerk/models/components/scimgrouprolemapping_deleted_object.rbi +11 -0
  141. data/lib/clerk/models/components/scimgrouprolemapping_list.rb +36 -0
  142. data/lib/clerk/models/components/scimgrouprolemapping_list.rbi +15 -0
  143. data/lib/clerk/models/components/scimgrouprolemapping_object.rb +19 -0
  144. data/lib/clerk/models/components/scimgrouprolemapping_object.rbi +11 -0
  145. data/lib/clerk/models/components/seats.rb +1 -1
  146. data/lib/clerk/models/components/trusteddevice.rb +72 -0
  147. data/lib/clerk/models/components/trusteddevice.rbi +33 -0
  148. data/lib/clerk/models/components/trusteddevice_list.rb +36 -0
  149. data/lib/clerk/models/components/trusteddevice_list.rbi +15 -0
  150. data/lib/clerk/models/components/trusteddevice_object.rb +19 -0
  151. data/lib/clerk/models/components/trusteddevice_object.rbi +11 -0
  152. data/lib/clerk/models/components/trusteddevice_status.rb +20 -0
  153. data/lib/clerk/models/components/trusteddevice_status.rbi +11 -0
  154. data/lib/clerk/models/components/verification_from_oauth_clerkerror.rb +1 -1
  155. data/lib/clerk/models/components/verification_google_one_tap_clerkerror.rb +1 -1
  156. data/lib/clerk/models/components.rb +49 -38
  157. data/lib/clerk/models/errors/clerkerrors.rb +1 -1
  158. data/lib/clerk/models/operations/createemailaddress_request.rb +7 -1
  159. data/lib/clerk/models/operations/createemailaddress_request.rbi +2 -0
  160. data/lib/clerk/models/operations/createenterpriseconnection_login_hint.rb +36 -0
  161. data/lib/clerk/models/operations/createenterpriseconnection_login_hint.rbi +15 -0
  162. data/lib/clerk/models/operations/createenterpriseconnection_mode.rb +21 -0
  163. data/lib/clerk/models/operations/createenterpriseconnection_mode.rbi +11 -0
  164. data/lib/clerk/models/operations/createenterpriseconnection_saml.rb +5 -1
  165. data/lib/clerk/models/operations/createenterpriseconnection_saml.rbi +2 -0
  166. data/lib/clerk/models/operations/createorganizationdomain_requestbody.rb +1 -1
  167. data/lib/clerk/models/operations/createsamlconnection_login_hint_1.rb +36 -0
  168. data/lib/clerk/models/operations/createsamlconnection_login_hint_1.rbi +15 -0
  169. data/lib/clerk/models/operations/createsamlconnection_login_hint_2.rb +36 -0
  170. data/lib/clerk/models/operations/createsamlconnection_login_hint_2.rbi +15 -0
  171. data/lib/clerk/models/operations/createsamlconnection_mode_1.rb +21 -0
  172. data/lib/clerk/models/operations/createsamlconnection_mode_1.rbi +11 -0
  173. data/lib/clerk/models/operations/createsamlconnection_mode_2.rb +21 -0
  174. data/lib/clerk/models/operations/createsamlconnection_mode_2.rbi +11 -0
  175. data/lib/clerk/models/operations/createsamlconnection_requestbody_1.rb +5 -1
  176. data/lib/clerk/models/operations/createsamlconnection_requestbody_1.rbi +2 -0
  177. data/lib/clerk/models/operations/createsamlconnection_requestbody_2.rb +5 -1
  178. data/lib/clerk/models/operations/createsamlconnection_requestbody_2.rbi +2 -0
  179. data/lib/clerk/models/operations/createscimdirectory_request.rb +44 -0
  180. data/lib/clerk/models/operations/createscimdirectory_request.rbi +19 -0
  181. data/lib/clerk/models/operations/createscimdirectory_response.rb +44 -0
  182. data/lib/clerk/models/operations/createscimdirectory_response.rbi +19 -0
  183. data/lib/clerk/models/operations/createscimgrouprolemapping_request.rb +36 -0
  184. data/lib/clerk/models/operations/createscimgrouprolemapping_request.rbi +15 -0
  185. data/lib/clerk/models/operations/createscimgrouprolemapping_requestbody.rb +42 -0
  186. data/lib/clerk/models/operations/createscimgrouprolemapping_requestbody.rbi +17 -0
  187. data/lib/clerk/models/operations/createscimgrouprolemapping_response.rb +44 -0
  188. data/lib/clerk/models/operations/createscimgrouprolemapping_response.rbi +19 -0
  189. data/lib/clerk/models/operations/createsignintoken_request.rb +6 -1
  190. data/lib/clerk/models/operations/createsignintoken_request.rbi +2 -0
  191. data/lib/clerk/models/operations/deletescimdirectory_request.rb +32 -0
  192. data/lib/clerk/models/operations/deletescimdirectory_request.rbi +13 -0
  193. data/lib/clerk/models/operations/deletescimdirectory_response.rb +44 -0
  194. data/lib/clerk/models/operations/deletescimdirectory_response.rbi +19 -0
  195. data/lib/clerk/models/operations/deletescimgrouprolemapping_request.rb +36 -0
  196. data/lib/clerk/models/operations/deletescimgrouprolemapping_request.rbi +15 -0
  197. data/lib/clerk/models/operations/deletescimgrouprolemapping_response.rb +44 -0
  198. data/lib/clerk/models/operations/deletescimgrouprolemapping_response.rbi +19 -0
  199. data/lib/clerk/models/operations/enrollment_mode.rb +5 -0
  200. data/lib/clerk/models/operations/extendbillingsubscriptionitemfreetrial_response.rb +4 -4
  201. data/lib/clerk/models/operations/extendbillingsubscriptionitemfreetrial_response.rbi +2 -2
  202. data/lib/clerk/models/operations/getscimdirectory_request.rb +32 -0
  203. data/lib/clerk/models/operations/getscimdirectory_request.rbi +13 -0
  204. data/lib/clerk/models/operations/getscimdirectory_response.rb +44 -0
  205. data/lib/clerk/models/operations/getscimdirectory_response.rbi +19 -0
  206. data/lib/clerk/models/operations/group_role_mapping.rb +44 -0
  207. data/lib/clerk/models/operations/group_role_mapping.rbi +19 -0
  208. data/lib/clerk/models/operations/listallorganizationdomains_request.rb +2 -1
  209. data/lib/clerk/models/operations/listorganizationdomains_request.rb +2 -1
  210. data/lib/clerk/models/operations/listscimdirectories_request.rb +39 -0
  211. data/lib/clerk/models/operations/listscimdirectories_request.rbi +15 -0
  212. data/lib/clerk/models/operations/listscimdirectories_response.rb +44 -0
  213. data/lib/clerk/models/operations/listscimdirectories_response.rbi +19 -0
  214. data/lib/clerk/models/operations/listscimgrouprolemappings_request.rb +32 -0
  215. data/lib/clerk/models/operations/listscimgrouprolemappings_request.rbi +13 -0
  216. data/lib/clerk/models/operations/listscimgrouprolemappings_response.rb +44 -0
  217. data/lib/clerk/models/operations/listscimgrouprolemappings_response.rbi +19 -0
  218. data/lib/clerk/models/operations/listusertrusteddevices_request.rb +32 -0
  219. data/lib/clerk/models/operations/listusertrusteddevices_request.rbi +13 -0
  220. data/lib/clerk/models/operations/listusertrusteddevices_response.rb +44 -0
  221. data/lib/clerk/models/operations/listusertrusteddevices_response.rbi +19 -0
  222. data/lib/clerk/models/operations/mapping.rb +36 -0
  223. data/lib/clerk/models/operations/mapping.rbi +15 -0
  224. data/lib/clerk/models/operations/removeuserpassword_request.rb +36 -0
  225. data/lib/clerk/models/operations/removeuserpassword_request.rbi +15 -0
  226. data/lib/clerk/models/operations/removeuserpassword_requestbody.rb +32 -0
  227. data/lib/clerk/models/operations/removeuserpassword_requestbody.rbi +13 -0
  228. data/lib/clerk/models/operations/removeuserpassword_response.rb +44 -0
  229. data/lib/clerk/models/operations/removeuserpassword_response.rbi +19 -0
  230. data/lib/clerk/models/operations/replacescimgrouprolemappings_request.rb +36 -0
  231. data/lib/clerk/models/operations/replacescimgrouprolemappings_request.rbi +15 -0
  232. data/lib/clerk/models/operations/replacescimgrouprolemappings_requestbody.rb +32 -0
  233. data/lib/clerk/models/operations/replacescimgrouprolemappings_requestbody.rbi +13 -0
  234. data/lib/clerk/models/operations/replacescimgrouprolemappings_response.rb +44 -0
  235. data/lib/clerk/models/operations/replacescimgrouprolemappings_response.rbi +19 -0
  236. data/lib/clerk/models/operations/replaceuseremailaddress_identification_status.rb +10 -2
  237. data/lib/clerk/models/operations/replaceuseremailaddress_requestbody.rb +16 -3
  238. data/lib/clerk/models/operations/replaceuseremailaddress_requestbody.rbi +2 -0
  239. data/lib/clerk/models/operations/replaceuserphonenumber_identification_status.rb +10 -2
  240. data/lib/clerk/models/operations/replaceuserphonenumber_requestbody.rb +9 -2
  241. data/lib/clerk/models/operations/revokeoauthapplicationtoken_request.rb +36 -0
  242. data/lib/clerk/models/operations/revokeoauthapplicationtoken_request.rbi +15 -0
  243. data/lib/clerk/models/operations/revokeoauthapplicationtoken_requestbody.rb +32 -0
  244. data/lib/clerk/models/operations/revokeoauthapplicationtoken_requestbody.rbi +13 -0
  245. data/lib/clerk/models/operations/revokeoauthapplicationtoken_response.rb +40 -0
  246. data/lib/clerk/models/operations/revokeoauthapplicationtoken_response.rbi +17 -0
  247. data/lib/clerk/models/operations/revokeusertrusteddevice_request.rb +36 -0
  248. data/lib/clerk/models/operations/revokeusertrusteddevice_request.rbi +15 -0
  249. data/lib/clerk/models/operations/revokeusertrusteddevice_response.rb +44 -0
  250. data/lib/clerk/models/operations/revokeusertrusteddevice_response.rbi +19 -0
  251. data/lib/clerk/models/operations/rotatescimdirectoryapikey_request.rb +32 -0
  252. data/lib/clerk/models/operations/rotatescimdirectoryapikey_request.rbi +13 -0
  253. data/lib/clerk/models/operations/rotatescimdirectoryapikey_response.rb +44 -0
  254. data/lib/clerk/models/operations/rotatescimdirectoryapikey_response.rbi +19 -0
  255. data/lib/clerk/models/operations/updateemailaddress_requestbody.rb +7 -1
  256. data/lib/clerk/models/operations/updateemailaddress_requestbody.rbi +2 -0
  257. data/lib/clerk/models/operations/updateenterpriseconnection_login_hint.rb +36 -0
  258. data/lib/clerk/models/operations/updateenterpriseconnection_login_hint.rbi +15 -0
  259. data/lib/clerk/models/operations/updateenterpriseconnection_mode.rb +21 -0
  260. data/lib/clerk/models/operations/updateenterpriseconnection_mode.rbi +11 -0
  261. data/lib/clerk/models/operations/updateenterpriseconnection_saml.rb +5 -1
  262. data/lib/clerk/models/operations/updateenterpriseconnection_saml.rbi +2 -0
  263. data/lib/clerk/models/operations/updateinstanceoauthapplicationsettings_request.rb +17 -1
  264. data/lib/clerk/models/operations/updateinstanceoauthapplicationsettings_request.rbi +8 -0
  265. data/lib/clerk/models/operations/updateorganizationdomain_requestbody.rb +1 -1
  266. data/lib/clerk/models/operations/updatesamlconnection_login_hint.rb +36 -0
  267. data/lib/clerk/models/operations/updatesamlconnection_login_hint.rbi +15 -0
  268. data/lib/clerk/models/operations/updatesamlconnection_mode.rb +21 -0
  269. data/lib/clerk/models/operations/updatesamlconnection_mode.rbi +11 -0
  270. data/lib/clerk/models/operations/updatesamlconnection_requestbody.rb +5 -1
  271. data/lib/clerk/models/operations/updatesamlconnection_requestbody.rbi +2 -0
  272. data/lib/clerk/models/operations/updatescimdirectory_request.rb +36 -0
  273. data/lib/clerk/models/operations/updatescimdirectory_request.rbi +15 -0
  274. data/lib/clerk/models/operations/updatescimdirectory_requestbody.rb +49 -0
  275. data/lib/clerk/models/operations/updatescimdirectory_requestbody.rbi +21 -0
  276. data/lib/clerk/models/operations/updatescimdirectory_response.rb +44 -0
  277. data/lib/clerk/models/operations/updatescimdirectory_response.rbi +19 -0
  278. data/lib/clerk/models/operations.rb +45 -0
  279. data/lib/clerk/oauthaccesstokens.rb +5 -5
  280. data/lib/clerk/oauthapplications.rb +185 -35
  281. data/lib/clerk/openapiclient.rb +2 -1
  282. data/lib/clerk/organizationdomains.rb +32 -32
  283. data/lib/clerk/organizationinvitations.rb +35 -35
  284. data/lib/clerk/organizationmemberships.rb +25 -25
  285. data/lib/clerk/organizationpermissions.rb +25 -25
  286. data/lib/clerk/organizationroles.rb +35 -35
  287. data/lib/clerk/organizations.rb +60 -60
  288. data/lib/clerk/phonenumbers.rb +43 -36
  289. data/lib/clerk/proxy.rb +3 -3
  290. data/lib/clerk/proxychecks.rb +5 -5
  291. data/lib/clerk/redirecturls.rb +20 -20
  292. data/lib/clerk/rolesets.rb +35 -35
  293. data/lib/clerk/samlconnections.rb +25 -25
  294. data/lib/clerk/scimdirectories.rb +1531 -0
  295. data/lib/clerk/sdk.rb +23 -5
  296. data/lib/clerk/sdkconfiguration.rb +3 -3
  297. data/lib/clerk/sessions.rb +35 -35
  298. data/lib/clerk/signintokens.rb +11 -11
  299. data/lib/clerk/signups.rb +10 -10
  300. data/lib/clerk/templates.rb +5 -5
  301. data/lib/clerk/testingtokens.rb +5 -5
  302. data/lib/clerk/users.rb +690 -196
  303. data/lib/clerk/utils/retries.rb +43 -1
  304. data/lib/clerk/waitlistentries.rb +30 -30
  305. data/lib/clerk/webhooks.rb +15 -15
  306. data/lib/clerk_sdk_ruby.rb +1 -0
  307. data/test/clerk/jwks_cache_scoping_test.rb +83 -0
  308. data/test/clerk/proxy_test.rb +108 -0
  309. metadata +195 -80
  310. data/lib/clerk/models/components/clerkerror_meta.rb +0 -27
  311. data/lib/clerk/models/components/clerkerrors_meta.rb +0 -27
  312. data/lib/clerk/models/components/emailaddress_verification_saml_meta.rb +0 -27
  313. data/lib/clerk/models/components/emailaddress_verification_saml_meta.rbi +0 -11
  314. data/lib/clerk/models/components/enterpriseaccount_verification_oauth_meta.rb +0 -27
  315. data/lib/clerk/models/components/enterpriseaccount_verification_oauth_meta.rbi +0 -11
  316. data/lib/clerk/models/components/enterpriseaccount_verification_saml_meta.rb +0 -27
  317. data/lib/clerk/models/components/enterpriseaccount_verification_saml_meta.rbi +0 -11
  318. data/lib/clerk/models/components/externalaccountwithverification_verification_oauth_meta.rb +0 -27
  319. data/lib/clerk/models/components/externalaccountwithverification_verification_oauth_meta.rbi +0 -11
  320. data/lib/clerk/models/components/samlaccount_meta.rb +0 -27
  321. data/lib/clerk/models/components/schemas_commerceplan_object.rbi +0 -11
  322. data/lib/clerk/models/components/schemas_commercesubscriptionitem_annual_fee.rbi +0 -19
  323. data/lib/clerk/models/components/schemas_commercesubscriptionitem_annual_monthly_fee.rb +0 -44
  324. data/lib/clerk/models/components/schemas_commercesubscriptionitem_annual_monthly_fee.rbi +0 -19
  325. data/lib/clerk/models/components/schemas_commercesubscriptionitem_next_payment_amount.rbi +0 -19
  326. data/lib/clerk/models/components/schemas_commercesubscriptionitem_object_commercepayer.rbi +0 -11
  327. data/lib/clerk/models/components/schemas_commercesubscriptionitem_object_commerceplan.rbi +0 -11
  328. data/lib/clerk/models/components/schemas_commercesubscriptionitem_object_commercesubscriptionitem.rbi +0 -11
  329. data/lib/clerk/models/components/schemas_commercesubscriptionitem_plan_period.rbi +0 -11
  330. data/lib/clerk/models/components/schemas_commercesubscriptionitem_status.rbi +0 -11
  331. data/lib/clerk/models/components/schemas_featureresponse_object.rbi +0 -11
  332. data/lib/clerk/models/components/verification_from_oauth_meta.rb +0 -27
  333. data/lib/clerk/models/components/verification_from_oauth_meta.rbi +0 -11
  334. data/lib/clerk/models/components/verification_google_one_tap_meta.rb +0 -27
  335. data/lib/clerk/models/components/verification_google_one_tap_meta.rbi +0 -11
data/lib/clerk/users.rb CHANGED
@@ -71,10 +71,10 @@ module Clerk
71
71
 
72
72
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
73
73
  timeout ||= @sdk_configuration.timeout
74
-
74
+
75
75
 
76
76
  connection = @sdk_configuration.client.dup
77
- connection.request :retry, retry_options
77
+ connection.use Utils::RetryMiddleware, retry_options
78
78
 
79
79
  hook_ctx = SDKHooks::HookContext.new(
80
80
  config: @sdk_configuration,
@@ -87,7 +87,7 @@ module Clerk
87
87
  error = nil
88
88
  http_response = nil
89
89
 
90
-
90
+
91
91
  begin
92
92
  http_response = connection.get(url) do |req|
93
93
  req.headers.merge!(headers)
@@ -124,13 +124,13 @@ module Clerk
124
124
  response: http_response
125
125
  )
126
126
  end
127
-
127
+
128
128
  if http_response.nil?
129
129
  raise error if !error.nil?
130
130
  raise 'no response'
131
131
  end
132
132
  end
133
-
133
+
134
134
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
135
135
  if Utils.match_status_code(http_response.status, ['200'])
136
136
  if Utils.match_content_type(content_type, 'application/json')
@@ -225,10 +225,10 @@ module Clerk
225
225
 
226
226
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
227
227
  timeout ||= @sdk_configuration.timeout
228
-
228
+
229
229
 
230
230
  connection = @sdk_configuration.client.dup
231
- connection.request :retry, retry_options
231
+ connection.use Utils::RetryMiddleware, retry_options
232
232
 
233
233
  hook_ctx = SDKHooks::HookContext.new(
234
234
  config: @sdk_configuration,
@@ -241,7 +241,7 @@ module Clerk
241
241
  error = nil
242
242
  http_response = nil
243
243
 
244
-
244
+
245
245
  begin
246
246
  http_response = connection.post(url) do |req|
247
247
  req.body = body
@@ -278,13 +278,13 @@ module Clerk
278
278
  response: http_response
279
279
  )
280
280
  end
281
-
281
+
282
282
  if http_response.nil?
283
283
  raise error if !error.nil?
284
284
  raise 'no response'
285
285
  end
286
286
  end
287
-
287
+
288
288
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
289
289
  if Utils.match_status_code(http_response.status, ['200'])
290
290
  if Utils.match_content_type(content_type, 'application/json')
@@ -363,10 +363,10 @@ module Clerk
363
363
 
364
364
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
365
365
  timeout ||= @sdk_configuration.timeout
366
-
366
+
367
367
 
368
368
  connection = @sdk_configuration.client.dup
369
- connection.request :retry, retry_options
369
+ connection.use Utils::RetryMiddleware, retry_options
370
370
 
371
371
  hook_ctx = SDKHooks::HookContext.new(
372
372
  config: @sdk_configuration,
@@ -379,7 +379,7 @@ module Clerk
379
379
  error = nil
380
380
  http_response = nil
381
381
 
382
-
382
+
383
383
  begin
384
384
  http_response = connection.get(url) do |req|
385
385
  req.headers.merge!(headers)
@@ -416,13 +416,13 @@ module Clerk
416
416
  response: http_response
417
417
  )
418
418
  end
419
-
419
+
420
420
  if http_response.nil?
421
421
  raise error if !error.nil?
422
422
  raise 'no response'
423
423
  end
424
424
  end
425
-
425
+
426
426
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
427
427
  if Utils.match_status_code(http_response.status, ['200'])
428
428
  if Utils.match_content_type(content_type, 'application/json')
@@ -508,10 +508,10 @@ module Clerk
508
508
 
509
509
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
510
510
  timeout ||= @sdk_configuration.timeout
511
-
511
+
512
512
 
513
513
  connection = @sdk_configuration.client.dup
514
- connection.request :retry, retry_options
514
+ connection.use Utils::RetryMiddleware, retry_options
515
515
 
516
516
  hook_ctx = SDKHooks::HookContext.new(
517
517
  config: @sdk_configuration,
@@ -524,7 +524,7 @@ module Clerk
524
524
  error = nil
525
525
  http_response = nil
526
526
 
527
-
527
+
528
528
  begin
529
529
  http_response = connection.get(url) do |req|
530
530
  req.headers.merge!(headers)
@@ -560,13 +560,13 @@ module Clerk
560
560
  response: http_response
561
561
  )
562
562
  end
563
-
563
+
564
564
  if http_response.nil?
565
565
  raise error if !error.nil?
566
566
  raise 'no response'
567
567
  end
568
568
  end
569
-
569
+
570
570
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
571
571
  if Utils.match_status_code(http_response.status, ['200'])
572
572
  if Utils.match_content_type(content_type, 'application/json')
@@ -672,10 +672,10 @@ module Clerk
672
672
 
673
673
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
674
674
  timeout ||= @sdk_configuration.timeout
675
-
675
+
676
676
 
677
677
  connection = @sdk_configuration.client.dup
678
- connection.request :retry, retry_options
678
+ connection.use Utils::RetryMiddleware, retry_options
679
679
 
680
680
  hook_ctx = SDKHooks::HookContext.new(
681
681
  config: @sdk_configuration,
@@ -688,7 +688,7 @@ module Clerk
688
688
  error = nil
689
689
  http_response = nil
690
690
 
691
-
691
+
692
692
  begin
693
693
  http_response = connection.patch(url) do |req|
694
694
  req.body = body
@@ -725,13 +725,13 @@ module Clerk
725
725
  response: http_response
726
726
  )
727
727
  end
728
-
728
+
729
729
  if http_response.nil?
730
730
  raise error if !error.nil?
731
731
  raise 'no response'
732
732
  end
733
733
  end
734
-
734
+
735
735
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
736
736
  if Utils.match_status_code(http_response.status, ['200'])
737
737
  if Utils.match_content_type(content_type, 'application/json')
@@ -817,10 +817,10 @@ module Clerk
817
817
 
818
818
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
819
819
  timeout ||= @sdk_configuration.timeout
820
-
820
+
821
821
 
822
822
  connection = @sdk_configuration.client.dup
823
- connection.request :retry, retry_options
823
+ connection.use Utils::RetryMiddleware, retry_options
824
824
 
825
825
  hook_ctx = SDKHooks::HookContext.new(
826
826
  config: @sdk_configuration,
@@ -833,7 +833,7 @@ module Clerk
833
833
  error = nil
834
834
  http_response = nil
835
835
 
836
-
836
+
837
837
  begin
838
838
  http_response = connection.delete(url) do |req|
839
839
  req.headers.merge!(headers)
@@ -869,13 +869,13 @@ module Clerk
869
869
  response: http_response
870
870
  )
871
871
  end
872
-
872
+
873
873
  if http_response.nil?
874
874
  raise error if !error.nil?
875
875
  raise 'no response'
876
876
  end
877
877
  end
878
-
878
+
879
879
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
880
880
  if Utils.match_status_code(http_response.status, ['200'])
881
881
  if Utils.match_content_type(content_type, 'application/json')
@@ -961,10 +961,10 @@ module Clerk
961
961
 
962
962
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
963
963
  timeout ||= @sdk_configuration.timeout
964
-
964
+
965
965
 
966
966
  connection = @sdk_configuration.client.dup
967
- connection.request :retry, retry_options
967
+ connection.use Utils::RetryMiddleware, retry_options
968
968
 
969
969
  hook_ctx = SDKHooks::HookContext.new(
970
970
  config: @sdk_configuration,
@@ -977,7 +977,7 @@ module Clerk
977
977
  error = nil
978
978
  http_response = nil
979
979
 
980
-
980
+
981
981
  begin
982
982
  http_response = connection.post(url) do |req|
983
983
  req.headers.merge!(headers)
@@ -1013,13 +1013,13 @@ module Clerk
1013
1013
  response: http_response
1014
1014
  )
1015
1015
  end
1016
-
1016
+
1017
1017
  if http_response.nil?
1018
1018
  raise error if !error.nil?
1019
1019
  raise 'no response'
1020
1020
  end
1021
1021
  end
1022
-
1022
+
1023
1023
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
1024
1024
  if Utils.match_status_code(http_response.status, ['200'])
1025
1025
  if Utils.match_content_type(content_type, 'application/json')
@@ -1105,10 +1105,10 @@ module Clerk
1105
1105
 
1106
1106
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
1107
1107
  timeout ||= @sdk_configuration.timeout
1108
-
1108
+
1109
1109
 
1110
1110
  connection = @sdk_configuration.client.dup
1111
- connection.request :retry, retry_options
1111
+ connection.use Utils::RetryMiddleware, retry_options
1112
1112
 
1113
1113
  hook_ctx = SDKHooks::HookContext.new(
1114
1114
  config: @sdk_configuration,
@@ -1121,7 +1121,7 @@ module Clerk
1121
1121
  error = nil
1122
1122
  http_response = nil
1123
1123
 
1124
-
1124
+
1125
1125
  begin
1126
1126
  http_response = connection.post(url) do |req|
1127
1127
  req.headers.merge!(headers)
@@ -1157,13 +1157,13 @@ module Clerk
1157
1157
  response: http_response
1158
1158
  )
1159
1159
  end
1160
-
1160
+
1161
1161
  if http_response.nil?
1162
1162
  raise error if !error.nil?
1163
1163
  raise 'no response'
1164
1164
  end
1165
1165
  end
1166
-
1166
+
1167
1167
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
1168
1168
  if Utils.match_status_code(http_response.status, ['200'])
1169
1169
  if Utils.match_content_type(content_type, 'application/json')
@@ -1252,10 +1252,10 @@ module Clerk
1252
1252
 
1253
1253
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
1254
1254
  timeout ||= @sdk_configuration.timeout
1255
-
1255
+
1256
1256
 
1257
1257
  connection = @sdk_configuration.client.dup
1258
- connection.request :retry, retry_options
1258
+ connection.use Utils::RetryMiddleware, retry_options
1259
1259
 
1260
1260
  hook_ctx = SDKHooks::HookContext.new(
1261
1261
  config: @sdk_configuration,
@@ -1268,7 +1268,7 @@ module Clerk
1268
1268
  error = nil
1269
1269
  http_response = nil
1270
1270
 
1271
-
1271
+
1272
1272
  begin
1273
1273
  http_response = connection.post(url) do |req|
1274
1274
  req.body = body
@@ -1305,13 +1305,13 @@ module Clerk
1305
1305
  response: http_response
1306
1306
  )
1307
1307
  end
1308
-
1308
+
1309
1309
  if http_response.nil?
1310
1310
  raise error if !error.nil?
1311
1311
  raise 'no response'
1312
1312
  end
1313
1313
  end
1314
-
1314
+
1315
1315
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
1316
1316
  if Utils.match_status_code(http_response.status, ['200'])
1317
1317
  if Utils.match_content_type(content_type, 'application/json')
@@ -1400,10 +1400,10 @@ module Clerk
1400
1400
 
1401
1401
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
1402
1402
  timeout ||= @sdk_configuration.timeout
1403
-
1403
+
1404
1404
 
1405
1405
  connection = @sdk_configuration.client.dup
1406
- connection.request :retry, retry_options
1406
+ connection.use Utils::RetryMiddleware, retry_options
1407
1407
 
1408
1408
  hook_ctx = SDKHooks::HookContext.new(
1409
1409
  config: @sdk_configuration,
@@ -1416,7 +1416,7 @@ module Clerk
1416
1416
  error = nil
1417
1417
  http_response = nil
1418
1418
 
1419
-
1419
+
1420
1420
  begin
1421
1421
  http_response = connection.post(url) do |req|
1422
1422
  req.body = body
@@ -1453,13 +1453,13 @@ module Clerk
1453
1453
  response: http_response
1454
1454
  )
1455
1455
  end
1456
-
1456
+
1457
1457
  if http_response.nil?
1458
1458
  raise error if !error.nil?
1459
1459
  raise 'no response'
1460
1460
  end
1461
1461
  end
1462
-
1462
+
1463
1463
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
1464
1464
  if Utils.match_status_code(http_response.status, ['200'])
1465
1465
  if Utils.match_content_type(content_type, 'application/json')
@@ -1546,10 +1546,10 @@ module Clerk
1546
1546
 
1547
1547
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
1548
1548
  timeout ||= @sdk_configuration.timeout
1549
-
1549
+
1550
1550
 
1551
1551
  connection = @sdk_configuration.client.dup
1552
- connection.request :retry, retry_options
1552
+ connection.use Utils::RetryMiddleware, retry_options
1553
1553
 
1554
1554
  hook_ctx = SDKHooks::HookContext.new(
1555
1555
  config: @sdk_configuration,
@@ -1562,7 +1562,7 @@ module Clerk
1562
1562
  error = nil
1563
1563
  http_response = nil
1564
1564
 
1565
-
1565
+
1566
1566
  begin
1567
1567
  http_response = connection.post(url) do |req|
1568
1568
  req.headers.merge!(headers)
@@ -1598,13 +1598,13 @@ module Clerk
1598
1598
  response: http_response
1599
1599
  )
1600
1600
  end
1601
-
1601
+
1602
1602
  if http_response.nil?
1603
1603
  raise error if !error.nil?
1604
1604
  raise 'no response'
1605
1605
  end
1606
1606
  end
1607
-
1607
+
1608
1608
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
1609
1609
  if Utils.match_status_code(http_response.status, ['200'])
1610
1610
  if Utils.match_content_type(content_type, 'application/json')
@@ -1690,10 +1690,10 @@ module Clerk
1690
1690
 
1691
1691
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
1692
1692
  timeout ||= @sdk_configuration.timeout
1693
-
1693
+
1694
1694
 
1695
1695
  connection = @sdk_configuration.client.dup
1696
- connection.request :retry, retry_options
1696
+ connection.use Utils::RetryMiddleware, retry_options
1697
1697
 
1698
1698
  hook_ctx = SDKHooks::HookContext.new(
1699
1699
  config: @sdk_configuration,
@@ -1706,7 +1706,7 @@ module Clerk
1706
1706
  error = nil
1707
1707
  http_response = nil
1708
1708
 
1709
-
1709
+
1710
1710
  begin
1711
1711
  http_response = connection.post(url) do |req|
1712
1712
  req.headers.merge!(headers)
@@ -1742,13 +1742,13 @@ module Clerk
1742
1742
  response: http_response
1743
1743
  )
1744
1744
  end
1745
-
1745
+
1746
1746
  if http_response.nil?
1747
1747
  raise error if !error.nil?
1748
1748
  raise 'no response'
1749
1749
  end
1750
1750
  end
1751
-
1751
+
1752
1752
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
1753
1753
  if Utils.match_status_code(http_response.status, ['200'])
1754
1754
  if Utils.match_content_type(content_type, 'application/json')
@@ -1846,10 +1846,10 @@ module Clerk
1846
1846
 
1847
1847
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
1848
1848
  timeout ||= @sdk_configuration.timeout
1849
-
1849
+
1850
1850
 
1851
1851
  connection = @sdk_configuration.client.dup
1852
- connection.request :retry, retry_options
1852
+ connection.use Utils::RetryMiddleware, retry_options
1853
1853
 
1854
1854
  hook_ctx = SDKHooks::HookContext.new(
1855
1855
  config: @sdk_configuration,
@@ -1862,7 +1862,7 @@ module Clerk
1862
1862
  error = nil
1863
1863
  http_response = nil
1864
1864
 
1865
-
1865
+
1866
1866
  begin
1867
1867
  http_response = connection.post(url) do |req|
1868
1868
  req.body = body
@@ -1899,13 +1899,13 @@ module Clerk
1899
1899
  response: http_response
1900
1900
  )
1901
1901
  end
1902
-
1902
+
1903
1903
  if http_response.nil?
1904
1904
  raise error if !error.nil?
1905
1905
  raise 'no response'
1906
1906
  end
1907
1907
  end
1908
-
1908
+
1909
1909
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
1910
1910
  if Utils.match_status_code(http_response.status, ['200'])
1911
1911
  if Utils.match_content_type(content_type, 'application/json')
@@ -1991,10 +1991,10 @@ module Clerk
1991
1991
 
1992
1992
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
1993
1993
  timeout ||= @sdk_configuration.timeout
1994
-
1994
+
1995
1995
 
1996
1996
  connection = @sdk_configuration.client.dup
1997
- connection.request :retry, retry_options
1997
+ connection.use Utils::RetryMiddleware, retry_options
1998
1998
 
1999
1999
  hook_ctx = SDKHooks::HookContext.new(
2000
2000
  config: @sdk_configuration,
@@ -2007,7 +2007,7 @@ module Clerk
2007
2007
  error = nil
2008
2008
  http_response = nil
2009
2009
 
2010
-
2010
+
2011
2011
  begin
2012
2012
  http_response = connection.delete(url) do |req|
2013
2013
  req.headers.merge!(headers)
@@ -2043,13 +2043,13 @@ module Clerk
2043
2043
  response: http_response
2044
2044
  )
2045
2045
  end
2046
-
2046
+
2047
2047
  if http_response.nil?
2048
2048
  raise error if !error.nil?
2049
2049
  raise 'no response'
2050
2050
  end
2051
2051
  end
2052
-
2052
+
2053
2053
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
2054
2054
  if Utils.match_status_code(http_response.status, ['200'])
2055
2055
  if Utils.match_content_type(content_type, 'application/json')
@@ -2153,10 +2153,10 @@ module Clerk
2153
2153
 
2154
2154
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
2155
2155
  timeout ||= @sdk_configuration.timeout
2156
-
2156
+
2157
2157
 
2158
2158
  connection = @sdk_configuration.client.dup
2159
- connection.request :retry, retry_options
2159
+ connection.use Utils::RetryMiddleware, retry_options
2160
2160
 
2161
2161
  hook_ctx = SDKHooks::HookContext.new(
2162
2162
  config: @sdk_configuration,
@@ -2169,7 +2169,7 @@ module Clerk
2169
2169
  error = nil
2170
2170
  http_response = nil
2171
2171
 
2172
-
2172
+
2173
2173
  begin
2174
2174
  http_response = connection.patch(url) do |req|
2175
2175
  req.body = body
@@ -2206,13 +2206,13 @@ module Clerk
2206
2206
  response: http_response
2207
2207
  )
2208
2208
  end
2209
-
2209
+
2210
2210
  if http_response.nil?
2211
2211
  raise error if !error.nil?
2212
2212
  raise 'no response'
2213
2213
  end
2214
2214
  end
2215
-
2215
+
2216
2216
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
2217
2217
  if Utils.match_status_code(http_response.status, ['200'])
2218
2218
  if Utils.match_content_type(content_type, 'application/json')
@@ -2317,10 +2317,10 @@ module Clerk
2317
2317
 
2318
2318
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
2319
2319
  timeout ||= @sdk_configuration.timeout
2320
-
2320
+
2321
2321
 
2322
2322
  connection = @sdk_configuration.client.dup
2323
- connection.request :retry, retry_options
2323
+ connection.use Utils::RetryMiddleware, retry_options
2324
2324
 
2325
2325
  hook_ctx = SDKHooks::HookContext.new(
2326
2326
  config: @sdk_configuration,
@@ -2333,7 +2333,7 @@ module Clerk
2333
2333
  error = nil
2334
2334
  http_response = nil
2335
2335
 
2336
-
2336
+
2337
2337
  begin
2338
2338
  http_response = connection.put(url) do |req|
2339
2339
  req.body = body
@@ -2370,13 +2370,13 @@ module Clerk
2370
2370
  response: http_response
2371
2371
  )
2372
2372
  end
2373
-
2373
+
2374
2374
  if http_response.nil?
2375
2375
  raise error if !error.nil?
2376
2376
  raise 'no response'
2377
2377
  end
2378
2378
  end
2379
-
2379
+
2380
2380
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
2381
2381
  if Utils.match_status_code(http_response.status, ['200'])
2382
2382
  if Utils.match_content_type(content_type, 'application/json')
@@ -2464,10 +2464,10 @@ module Clerk
2464
2464
 
2465
2465
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
2466
2466
  timeout ||= @sdk_configuration.timeout
2467
-
2467
+
2468
2468
 
2469
2469
  connection = @sdk_configuration.client.dup
2470
- connection.request :retry, retry_options
2470
+ connection.use Utils::RetryMiddleware, retry_options
2471
2471
 
2472
2472
  hook_ctx = SDKHooks::HookContext.new(
2473
2473
  config: @sdk_configuration,
@@ -2480,7 +2480,7 @@ module Clerk
2480
2480
  error = nil
2481
2481
  http_response = nil
2482
2482
 
2483
-
2483
+
2484
2484
  begin
2485
2485
  http_response = connection.get(url) do |req|
2486
2486
  req.headers.merge!(headers)
@@ -2516,13 +2516,13 @@ module Clerk
2516
2516
  response: http_response
2517
2517
  )
2518
2518
  end
2519
-
2519
+
2520
2520
  if http_response.nil?
2521
2521
  raise error if !error.nil?
2522
2522
  raise 'no response'
2523
2523
  end
2524
2524
  end
2525
-
2525
+
2526
2526
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
2527
2527
  if Utils.match_status_code(http_response.status, ['200'])
2528
2528
  if Utils.match_content_type(content_type, 'application/json')
@@ -2624,10 +2624,10 @@ module Clerk
2624
2624
 
2625
2625
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
2626
2626
  timeout ||= @sdk_configuration.timeout
2627
-
2627
+
2628
2628
 
2629
2629
  connection = @sdk_configuration.client.dup
2630
- connection.request :retry, retry_options
2630
+ connection.use Utils::RetryMiddleware, retry_options
2631
2631
 
2632
2632
  hook_ctx = SDKHooks::HookContext.new(
2633
2633
  config: @sdk_configuration,
@@ -2640,7 +2640,7 @@ module Clerk
2640
2640
  error = nil
2641
2641
  http_response = nil
2642
2642
 
2643
-
2643
+
2644
2644
  begin
2645
2645
  http_response = connection.get(url) do |req|
2646
2646
  req.headers.merge!(headers)
@@ -2676,13 +2676,13 @@ module Clerk
2676
2676
  response: http_response
2677
2677
  )
2678
2678
  end
2679
-
2679
+
2680
2680
  if http_response.nil?
2681
2681
  raise error if !error.nil?
2682
2682
  raise 'no response'
2683
2683
  end
2684
2684
  end
2685
-
2685
+
2686
2686
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
2687
2687
  if Utils.match_status_code(http_response.status, ['200'])
2688
2688
  if Utils.match_content_type(content_type, 'application/json')
@@ -2797,10 +2797,10 @@ module Clerk
2797
2797
 
2798
2798
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
2799
2799
  timeout ||= @sdk_configuration.timeout
2800
-
2800
+
2801
2801
 
2802
2802
  connection = @sdk_configuration.client.dup
2803
- connection.request :retry, retry_options
2803
+ connection.use Utils::RetryMiddleware, retry_options
2804
2804
 
2805
2805
  hook_ctx = SDKHooks::HookContext.new(
2806
2806
  config: @sdk_configuration,
@@ -2813,7 +2813,7 @@ module Clerk
2813
2813
  error = nil
2814
2814
  http_response = nil
2815
2815
 
2816
-
2816
+
2817
2817
  begin
2818
2818
  http_response = connection.post(url) do |req|
2819
2819
  req.body = body
@@ -2850,13 +2850,13 @@ module Clerk
2850
2850
  response: http_response
2851
2851
  )
2852
2852
  end
2853
-
2853
+
2854
2854
  if http_response.nil?
2855
2855
  raise error if !error.nil?
2856
2856
  raise 'no response'
2857
2857
  end
2858
2858
  end
2859
-
2859
+
2860
2860
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
2861
2861
  if Utils.match_status_code(http_response.status, ['200'])
2862
2862
  if Utils.match_content_type(content_type, 'application/json')
@@ -2956,10 +2956,10 @@ module Clerk
2956
2956
 
2957
2957
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
2958
2958
  timeout ||= @sdk_configuration.timeout
2959
-
2959
+
2960
2960
 
2961
2961
  connection = @sdk_configuration.client.dup
2962
- connection.request :retry, retry_options
2962
+ connection.use Utils::RetryMiddleware, retry_options
2963
2963
 
2964
2964
  hook_ctx = SDKHooks::HookContext.new(
2965
2965
  config: @sdk_configuration,
@@ -2972,7 +2972,7 @@ module Clerk
2972
2972
  error = nil
2973
2973
  http_response = nil
2974
2974
 
2975
-
2975
+
2976
2976
  begin
2977
2977
  http_response = connection.get(url) do |req|
2978
2978
  req.headers.merge!(headers)
@@ -3009,13 +3009,13 @@ module Clerk
3009
3009
  response: http_response
3010
3010
  )
3011
3011
  end
3012
-
3012
+
3013
3013
  if http_response.nil?
3014
3014
  raise error if !error.nil?
3015
3015
  raise 'no response'
3016
3016
  end
3017
3017
  end
3018
-
3018
+
3019
3019
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
3020
3020
  if Utils.match_status_code(http_response.status, ['200'])
3021
3021
  if Utils.match_content_type(content_type, 'application/json')
@@ -3104,10 +3104,10 @@ module Clerk
3104
3104
 
3105
3105
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
3106
3106
  timeout ||= @sdk_configuration.timeout
3107
-
3107
+
3108
3108
 
3109
3109
  connection = @sdk_configuration.client.dup
3110
- connection.request :retry, retry_options
3110
+ connection.use Utils::RetryMiddleware, retry_options
3111
3111
 
3112
3112
  hook_ctx = SDKHooks::HookContext.new(
3113
3113
  config: @sdk_configuration,
@@ -3120,7 +3120,7 @@ module Clerk
3120
3120
  error = nil
3121
3121
  http_response = nil
3122
3122
 
3123
-
3123
+
3124
3124
  begin
3125
3125
  http_response = connection.get(url) do |req|
3126
3126
  req.headers.merge!(headers)
@@ -3157,13 +3157,13 @@ module Clerk
3157
3157
  response: http_response
3158
3158
  )
3159
3159
  end
3160
-
3160
+
3161
3161
  if http_response.nil?
3162
3162
  raise error if !error.nil?
3163
3163
  raise 'no response'
3164
3164
  end
3165
3165
  end
3166
-
3166
+
3167
3167
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
3168
3168
  if Utils.match_status_code(http_response.status, ['200'])
3169
3169
  if Utils.match_content_type(content_type, 'application/json')
@@ -3253,10 +3253,10 @@ module Clerk
3253
3253
 
3254
3254
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
3255
3255
  timeout ||= @sdk_configuration.timeout
3256
-
3256
+
3257
3257
 
3258
3258
  connection = @sdk_configuration.client.dup
3259
- connection.request :retry, retry_options
3259
+ connection.use Utils::RetryMiddleware, retry_options
3260
3260
 
3261
3261
  hook_ctx = SDKHooks::HookContext.new(
3262
3262
  config: @sdk_configuration,
@@ -3269,7 +3269,7 @@ module Clerk
3269
3269
  error = nil
3270
3270
  http_response = nil
3271
3271
 
3272
-
3272
+
3273
3273
  begin
3274
3274
  http_response = connection.get(url) do |req|
3275
3275
  req.headers.merge!(headers)
@@ -3306,13 +3306,13 @@ module Clerk
3306
3306
  response: http_response
3307
3307
  )
3308
3308
  end
3309
-
3309
+
3310
3310
  if http_response.nil?
3311
3311
  raise error if !error.nil?
3312
3312
  raise 'no response'
3313
3313
  end
3314
3314
  end
3315
-
3315
+
3316
3316
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
3317
3317
  if Utils.match_status_code(http_response.status, ['200'])
3318
3318
  if Utils.match_content_type(content_type, 'application/json')
@@ -3362,20 +3362,21 @@ module Clerk
3362
3362
 
3363
3363
 
3364
3364
 
3365
- def verify_password(user_id:, body: nil, retries: nil, timeout_ms: nil, http_headers: nil)
3366
- # verify_password - Verify the password of a user
3367
- # Check that the user's password matches the supplied input.
3368
- # Useful for custom auth flows and re-verification.
3369
- request = Models::Operations::VerifyPasswordRequest.new(
3365
+ def remove_password(user_id:, body: nil, retries: nil, timeout_ms: nil, http_headers: nil)
3366
+ # remove_password - Remove a user's password
3367
+ # Removes the password credential from the given user. This is a privileged operation and does not require the user's current password. Password removal is allowed even when the user has no other sign-in method configured.
3368
+ #
3369
+ # If the user does not have a password, the user is returned unchanged and no password-deletion or user-update event is emitted. By default, existing sessions remain active. Set `sign_out_of_other_sessions` to `true` to revoke sessions active when the request is processed.
3370
+ request = Models::Operations::RemoveUserPasswordRequest.new(
3370
3371
  user_id: user_id,
3371
3372
  body: body
3372
3373
  )
3373
3374
  url, params = @sdk_configuration.get_server_details
3374
3375
  base_url = Utils.template_url(url, params)
3375
3376
  url = Utils.generate_url(
3376
- Models::Operations::VerifyPasswordRequest,
3377
+ Models::Operations::RemoveUserPasswordRequest,
3377
3378
  base_url,
3378
- '/users/{user_id}/verify_password',
3379
+ '/users/{user_id}/remove_password',
3379
3380
  request
3380
3381
  )
3381
3382
  headers = {}
@@ -3410,23 +3411,23 @@ module Clerk
3410
3411
 
3411
3412
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
3412
3413
  timeout ||= @sdk_configuration.timeout
3413
-
3414
+
3414
3415
 
3415
3416
  connection = @sdk_configuration.client.dup
3416
- connection.request :retry, retry_options
3417
+ connection.use Utils::RetryMiddleware, retry_options
3417
3418
 
3418
3419
  hook_ctx = SDKHooks::HookContext.new(
3419
3420
  config: @sdk_configuration,
3420
3421
  base_url: base_url,
3421
3422
  oauth2_scopes: nil,
3422
- operation_id: 'VerifyPassword',
3423
+ operation_id: 'RemoveUserPassword',
3423
3424
  security_source: @sdk_configuration.security_source
3424
3425
  )
3425
3426
 
3426
3427
  error = nil
3427
3428
  http_response = nil
3428
3429
 
3429
-
3430
+
3430
3431
  begin
3431
3432
  http_response = connection.post(url) do |req|
3432
3433
  req.body = body
@@ -3463,13 +3464,13 @@ module Clerk
3463
3464
  response: http_response
3464
3465
  )
3465
3466
  end
3466
-
3467
+
3467
3468
  if http_response.nil?
3468
3469
  raise error if !error.nil?
3469
3470
  raise 'no response'
3470
3471
  end
3471
3472
  end
3472
-
3473
+
3473
3474
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
3474
3475
  if Utils.match_status_code(http_response.status, ['200'])
3475
3476
  if Utils.match_content_type(content_type, 'application/json')
@@ -3480,18 +3481,33 @@ module Clerk
3480
3481
  response: http_response
3481
3482
  )
3482
3483
  response_data = http_response.env.response_body
3483
- obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::VerifyPasswordResponseBody)
3484
- response = Models::Operations::VerifyPasswordResponse.new(
3484
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::User)
3485
+ response = Models::Operations::RemoveUserPasswordResponse.new(
3485
3486
  status_code: http_response.status,
3486
3487
  content_type: content_type,
3487
3488
  raw_response: http_response,
3488
- object: obj
3489
+ user: obj
3489
3490
  )
3490
3491
 
3491
3492
  return response
3492
3493
  else
3493
3494
  raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
3494
3495
  end
3496
+ elsif Utils.match_status_code(http_response.status, ['400', '401', '403', '404'])
3497
+ if Utils.match_content_type(content_type, 'application/json')
3498
+ http_response = @sdk_configuration.hooks.after_success(
3499
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
3500
+ hook_ctx: hook_ctx
3501
+ ),
3502
+ response: http_response
3503
+ )
3504
+ response_data = http_response.env.response_body
3505
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
3506
+ obj.raw_response = http_response
3507
+ raise obj
3508
+ else
3509
+ raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
3510
+ end
3495
3511
  elsif Utils.match_status_code(http_response.status, ['500'])
3496
3512
  if Utils.match_content_type(content_type, 'application/json')
3497
3513
  http_response = @sdk_configuration.hooks.after_success(
@@ -3507,7 +3523,7 @@ module Clerk
3507
3523
  else
3508
3524
  raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
3509
3525
  end
3510
- elsif Utils.match_status_code(http_response.status, ['400', '404', '422', '4XX'])
3526
+ elsif Utils.match_status_code(http_response.status, ['4XX'])
3511
3527
  raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
3512
3528
  elsif Utils.match_status_code(http_response.status, ['5XX'])
3513
3529
  raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
@@ -3519,22 +3535,20 @@ module Clerk
3519
3535
 
3520
3536
 
3521
3537
 
3522
- def verify_totp(user_id:, body: nil, retries: nil, timeout_ms: nil, http_headers: nil)
3523
- # verify_totp - Verify a TOTP or backup code for a user
3524
- # Verify that the provided TOTP or backup code is valid for the user.
3525
- # Verifying a backup code will result it in being consumed (i.e. it will
3526
- # become invalid).
3538
+ def verify_password(user_id:, body: nil, retries: nil, timeout_ms: nil, http_headers: nil)
3539
+ # verify_password - Verify the password of a user
3540
+ # Check that the user's password matches the supplied input.
3527
3541
  # Useful for custom auth flows and re-verification.
3528
- request = Models::Operations::VerifyTOTPRequest.new(
3542
+ request = Models::Operations::VerifyPasswordRequest.new(
3529
3543
  user_id: user_id,
3530
3544
  body: body
3531
3545
  )
3532
3546
  url, params = @sdk_configuration.get_server_details
3533
3547
  base_url = Utils.template_url(url, params)
3534
3548
  url = Utils.generate_url(
3535
- Models::Operations::VerifyTOTPRequest,
3549
+ Models::Operations::VerifyPasswordRequest,
3536
3550
  base_url,
3537
- '/users/{user_id}/verify_totp',
3551
+ '/users/{user_id}/verify_password',
3538
3552
  request
3539
3553
  )
3540
3554
  headers = {}
@@ -3569,23 +3583,23 @@ module Clerk
3569
3583
 
3570
3584
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
3571
3585
  timeout ||= @sdk_configuration.timeout
3572
-
3586
+
3573
3587
 
3574
3588
  connection = @sdk_configuration.client.dup
3575
- connection.request :retry, retry_options
3589
+ connection.use Utils::RetryMiddleware, retry_options
3576
3590
 
3577
3591
  hook_ctx = SDKHooks::HookContext.new(
3578
3592
  config: @sdk_configuration,
3579
3593
  base_url: base_url,
3580
3594
  oauth2_scopes: nil,
3581
- operation_id: 'VerifyTOTP',
3595
+ operation_id: 'VerifyPassword',
3582
3596
  security_source: @sdk_configuration.security_source
3583
3597
  )
3584
3598
 
3585
3599
  error = nil
3586
3600
  http_response = nil
3587
3601
 
3588
-
3602
+
3589
3603
  begin
3590
3604
  http_response = connection.post(url) do |req|
3591
3605
  req.body = body
@@ -3622,13 +3636,13 @@ module Clerk
3622
3636
  response: http_response
3623
3637
  )
3624
3638
  end
3625
-
3639
+
3626
3640
  if http_response.nil?
3627
3641
  raise error if !error.nil?
3628
3642
  raise 'no response'
3629
3643
  end
3630
3644
  end
3631
-
3645
+
3632
3646
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
3633
3647
  if Utils.match_status_code(http_response.status, ['200'])
3634
3648
  if Utils.match_content_type(content_type, 'application/json')
@@ -3639,8 +3653,8 @@ module Clerk
3639
3653
  response: http_response
3640
3654
  )
3641
3655
  response_data = http_response.env.response_body
3642
- obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::VerifyTOTPResponseBody)
3643
- response = Models::Operations::VerifyTOTPResponse.new(
3656
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::VerifyPasswordResponseBody)
3657
+ response = Models::Operations::VerifyPasswordResponse.new(
3644
3658
  status_code: http_response.status,
3645
3659
  content_type: content_type,
3646
3660
  raw_response: http_response,
@@ -3678,22 +3692,36 @@ module Clerk
3678
3692
 
3679
3693
 
3680
3694
 
3681
- def disable_mfa(user_id:, retries: nil, timeout_ms: nil, http_headers: nil)
3682
- # disable_mfa - Disable a user's MFA methods
3683
- # Disable all of a user's MFA methods (e.g. OTP sent via SMS, TOTP on their authenticator app) at once.
3684
- request = Models::Operations::DisableMFARequest.new(
3685
- user_id: user_id
3695
+ def verify_totp(user_id:, body: nil, retries: nil, timeout_ms: nil, http_headers: nil)
3696
+ # verify_totp - Verify a TOTP or backup code for a user
3697
+ # Verify that the provided TOTP or backup code is valid for the user.
3698
+ # Verifying a backup code will result it in being consumed (i.e. it will
3699
+ # become invalid).
3700
+ # Useful for custom auth flows and re-verification.
3701
+ request = Models::Operations::VerifyTOTPRequest.new(
3702
+ user_id: user_id,
3703
+ body: body
3686
3704
  )
3687
3705
  url, params = @sdk_configuration.get_server_details
3688
3706
  base_url = Utils.template_url(url, params)
3689
3707
  url = Utils.generate_url(
3690
- Models::Operations::DisableMFARequest,
3708
+ Models::Operations::VerifyTOTPRequest,
3691
3709
  base_url,
3692
- '/users/{user_id}/mfa',
3710
+ '/users/{user_id}/verify_totp',
3693
3711
  request
3694
3712
  )
3695
3713
  headers = {}
3696
3714
 
3715
+ req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json)
3716
+ headers['content-type'] = req_content_type
3717
+
3718
+ if form && !form.empty?
3719
+ body = Utils.encode_form(form)
3720
+ elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
3721
+ body = URI.encode_www_form(data)
3722
+ else
3723
+ body = data
3724
+ end
3697
3725
  headers['Accept'] = 'application/json'
3698
3726
  headers['user-agent'] = @sdk_configuration.user_agent
3699
3727
  retries ||= @sdk_configuration.retry_config
@@ -3714,25 +3742,26 @@ module Clerk
3714
3742
 
3715
3743
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
3716
3744
  timeout ||= @sdk_configuration.timeout
3717
-
3745
+
3718
3746
 
3719
3747
  connection = @sdk_configuration.client.dup
3720
- connection.request :retry, retry_options
3748
+ connection.use Utils::RetryMiddleware, retry_options
3721
3749
 
3722
3750
  hook_ctx = SDKHooks::HookContext.new(
3723
3751
  config: @sdk_configuration,
3724
3752
  base_url: base_url,
3725
3753
  oauth2_scopes: nil,
3726
- operation_id: 'DisableMFA',
3754
+ operation_id: 'VerifyTOTP',
3727
3755
  security_source: @sdk_configuration.security_source
3728
3756
  )
3729
3757
 
3730
3758
  error = nil
3731
3759
  http_response = nil
3732
3760
 
3733
-
3761
+
3734
3762
  begin
3735
- http_response = connection.delete(url) do |req|
3763
+ http_response = connection.post(url) do |req|
3764
+ req.body = body
3736
3765
  req.headers.merge!(headers)
3737
3766
  req.options.timeout = timeout unless timeout.nil?
3738
3767
  Utils.configure_request_security(req, security)
@@ -3766,13 +3795,157 @@ module Clerk
3766
3795
  response: http_response
3767
3796
  )
3768
3797
  end
3769
-
3798
+
3770
3799
  if http_response.nil?
3771
3800
  raise error if !error.nil?
3772
3801
  raise 'no response'
3773
3802
  end
3774
3803
  end
3804
+
3805
+ content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
3806
+ if Utils.match_status_code(http_response.status, ['200'])
3807
+ if Utils.match_content_type(content_type, 'application/json')
3808
+ http_response = @sdk_configuration.hooks.after_success(
3809
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
3810
+ hook_ctx: hook_ctx
3811
+ ),
3812
+ response: http_response
3813
+ )
3814
+ response_data = http_response.env.response_body
3815
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::VerifyTOTPResponseBody)
3816
+ response = Models::Operations::VerifyTOTPResponse.new(
3817
+ status_code: http_response.status,
3818
+ content_type: content_type,
3819
+ raw_response: http_response,
3820
+ object: obj
3821
+ )
3822
+
3823
+ return response
3824
+ else
3825
+ raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
3826
+ end
3827
+ elsif Utils.match_status_code(http_response.status, ['500'])
3828
+ if Utils.match_content_type(content_type, 'application/json')
3829
+ http_response = @sdk_configuration.hooks.after_success(
3830
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
3831
+ hook_ctx: hook_ctx
3832
+ ),
3833
+ response: http_response
3834
+ )
3835
+ response_data = http_response.env.response_body
3836
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
3837
+ obj.raw_response = http_response
3838
+ raise obj
3839
+ else
3840
+ raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
3841
+ end
3842
+ elsif Utils.match_status_code(http_response.status, ['400', '404', '422', '4XX'])
3843
+ raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
3844
+ elsif Utils.match_status_code(http_response.status, ['5XX'])
3845
+ raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
3846
+ else
3847
+ raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
3848
+
3849
+ end
3850
+ end
3851
+
3852
+
3853
+
3854
+ def disable_mfa(user_id:, retries: nil, timeout_ms: nil, http_headers: nil)
3855
+ # disable_mfa - Disable a user's MFA methods
3856
+ # Disable all of a user's MFA methods (e.g. OTP sent via SMS, TOTP on their authenticator app) at once.
3857
+ request = Models::Operations::DisableMFARequest.new(
3858
+ user_id: user_id
3859
+ )
3860
+ url, params = @sdk_configuration.get_server_details
3861
+ base_url = Utils.template_url(url, params)
3862
+ url = Utils.generate_url(
3863
+ Models::Operations::DisableMFARequest,
3864
+ base_url,
3865
+ '/users/{user_id}/mfa',
3866
+ request
3867
+ )
3868
+ headers = {}
3869
+
3870
+ headers['Accept'] = 'application/json'
3871
+ headers['user-agent'] = @sdk_configuration.user_agent
3872
+ retries ||= @sdk_configuration.retry_config
3873
+ retries ||= Utils::RetryConfig.new(
3874
+ backoff: Utils::BackoffStrategy.new(
3875
+ exponent: 1.5,
3876
+ initial_interval: 500,
3877
+ max_elapsed_time: 3_600_000,
3878
+ max_interval: 60_000
3879
+ ),
3880
+ retry_connection_errors: true,
3881
+ strategy: 'backoff'
3882
+ )
3883
+ retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
3884
+ retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
3885
+
3886
+ security = @sdk_configuration.security_source&.call
3887
+
3888
+ timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
3889
+ timeout ||= @sdk_configuration.timeout
3890
+
3891
+
3892
+ connection = @sdk_configuration.client.dup
3893
+ connection.use Utils::RetryMiddleware, retry_options
3894
+
3895
+ hook_ctx = SDKHooks::HookContext.new(
3896
+ config: @sdk_configuration,
3897
+ base_url: base_url,
3898
+ oauth2_scopes: nil,
3899
+ operation_id: 'DisableMFA',
3900
+ security_source: @sdk_configuration.security_source
3901
+ )
3902
+
3903
+ error = nil
3904
+ http_response = nil
3775
3905
 
3906
+
3907
+ begin
3908
+ http_response = connection.delete(url) do |req|
3909
+ req.headers.merge!(headers)
3910
+ req.options.timeout = timeout unless timeout.nil?
3911
+ Utils.configure_request_security(req, security)
3912
+ http_headers&.each do |key, value|
3913
+ req.headers[key.to_s] = value
3914
+ end
3915
+
3916
+ @sdk_configuration.hooks.before_request(
3917
+ hook_ctx: SDKHooks::BeforeRequestHookContext.new(
3918
+ hook_ctx: hook_ctx
3919
+ ),
3920
+ request: req
3921
+ )
3922
+ end
3923
+ rescue StandardError => e
3924
+ error = e
3925
+ ensure
3926
+ if http_response.nil? || Utils.error_status?(http_response.status)
3927
+ http_response = @sdk_configuration.hooks.after_error(
3928
+ error: error,
3929
+ hook_ctx: SDKHooks::AfterErrorHookContext.new(
3930
+ hook_ctx: hook_ctx
3931
+ ),
3932
+ response: http_response
3933
+ )
3934
+ else
3935
+ http_response = @sdk_configuration.hooks.after_success(
3936
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
3937
+ hook_ctx: hook_ctx
3938
+ ),
3939
+ response: http_response
3940
+ )
3941
+ end
3942
+
3943
+ if http_response.nil?
3944
+ raise error if !error.nil?
3945
+ raise 'no response'
3946
+ end
3947
+ end
3948
+
3776
3949
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
3777
3950
  if Utils.match_status_code(http_response.status, ['200'])
3778
3951
  if Utils.match_content_type(content_type, 'application/json')
@@ -3873,10 +4046,10 @@ module Clerk
3873
4046
 
3874
4047
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
3875
4048
  timeout ||= @sdk_configuration.timeout
3876
-
4049
+
3877
4050
 
3878
4051
  connection = @sdk_configuration.client.dup
3879
- connection.request :retry, retry_options
4052
+ connection.use Utils::RetryMiddleware, retry_options
3880
4053
 
3881
4054
  hook_ctx = SDKHooks::HookContext.new(
3882
4055
  config: @sdk_configuration,
@@ -3889,7 +4062,7 @@ module Clerk
3889
4062
  error = nil
3890
4063
  http_response = nil
3891
4064
 
3892
-
4065
+
3893
4066
  begin
3894
4067
  http_response = connection.delete(url) do |req|
3895
4068
  req.headers.merge!(headers)
@@ -3925,13 +4098,13 @@ module Clerk
3925
4098
  response: http_response
3926
4099
  )
3927
4100
  end
3928
-
4101
+
3929
4102
  if http_response.nil?
3930
4103
  raise error if !error.nil?
3931
4104
  raise 'no response'
3932
4105
  end
3933
4106
  end
3934
-
4107
+
3935
4108
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
3936
4109
  if Utils.match_status_code(http_response.status, ['200'])
3937
4110
  if Utils.match_content_type(content_type, 'application/json')
@@ -4033,10 +4206,10 @@ module Clerk
4033
4206
 
4034
4207
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
4035
4208
  timeout ||= @sdk_configuration.timeout
4036
-
4209
+
4037
4210
 
4038
4211
  connection = @sdk_configuration.client.dup
4039
- connection.request :retry, retry_options
4212
+ connection.use Utils::RetryMiddleware, retry_options
4040
4213
 
4041
4214
  hook_ctx = SDKHooks::HookContext.new(
4042
4215
  config: @sdk_configuration,
@@ -4049,7 +4222,7 @@ module Clerk
4049
4222
  error = nil
4050
4223
  http_response = nil
4051
4224
 
4052
-
4225
+
4053
4226
  begin
4054
4227
  http_response = connection.delete(url) do |req|
4055
4228
  req.headers.merge!(headers)
@@ -4085,13 +4258,13 @@ module Clerk
4085
4258
  response: http_response
4086
4259
  )
4087
4260
  end
4088
-
4261
+
4089
4262
  if http_response.nil?
4090
4263
  raise error if !error.nil?
4091
4264
  raise 'no response'
4092
4265
  end
4093
4266
  end
4094
-
4267
+
4095
4268
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
4096
4269
  if Utils.match_status_code(http_response.status, ['200'])
4097
4270
  if Utils.match_content_type(content_type, 'application/json')
@@ -4156,6 +4329,325 @@ module Clerk
4156
4329
 
4157
4330
 
4158
4331
 
4332
+ def list_trusted_devices(user_id:, retries: nil, timeout_ms: nil, http_headers: nil)
4333
+ # list_trusted_devices - List a user's trusted devices
4334
+ # Returns the active trusted devices enrolled by the user.
4335
+ request = Models::Operations::ListUserTrustedDevicesRequest.new(
4336
+ user_id: user_id
4337
+ )
4338
+ url, params = @sdk_configuration.get_server_details
4339
+ base_url = Utils.template_url(url, params)
4340
+ url = Utils.generate_url(
4341
+ Models::Operations::ListUserTrustedDevicesRequest,
4342
+ base_url,
4343
+ '/users/{user_id}/trusted_devices',
4344
+ request
4345
+ )
4346
+ headers = {}
4347
+
4348
+ headers['Accept'] = 'application/json'
4349
+ headers['user-agent'] = @sdk_configuration.user_agent
4350
+ retries ||= @sdk_configuration.retry_config
4351
+ retries ||= Utils::RetryConfig.new(
4352
+ backoff: Utils::BackoffStrategy.new(
4353
+ exponent: 1.5,
4354
+ initial_interval: 500,
4355
+ max_elapsed_time: 3_600_000,
4356
+ max_interval: 60_000
4357
+ ),
4358
+ retry_connection_errors: true,
4359
+ strategy: 'backoff'
4360
+ )
4361
+ retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
4362
+ retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
4363
+
4364
+ security = @sdk_configuration.security_source&.call
4365
+
4366
+ timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
4367
+ timeout ||= @sdk_configuration.timeout
4368
+
4369
+
4370
+ connection = @sdk_configuration.client.dup
4371
+ connection.use Utils::RetryMiddleware, retry_options
4372
+
4373
+ hook_ctx = SDKHooks::HookContext.new(
4374
+ config: @sdk_configuration,
4375
+ base_url: base_url,
4376
+ oauth2_scopes: nil,
4377
+ operation_id: 'ListUserTrustedDevices',
4378
+ security_source: @sdk_configuration.security_source
4379
+ )
4380
+
4381
+ error = nil
4382
+ http_response = nil
4383
+
4384
+
4385
+ begin
4386
+ http_response = connection.get(url) do |req|
4387
+ req.headers.merge!(headers)
4388
+ req.options.timeout = timeout unless timeout.nil?
4389
+ Utils.configure_request_security(req, security)
4390
+ http_headers&.each do |key, value|
4391
+ req.headers[key.to_s] = value
4392
+ end
4393
+
4394
+ @sdk_configuration.hooks.before_request(
4395
+ hook_ctx: SDKHooks::BeforeRequestHookContext.new(
4396
+ hook_ctx: hook_ctx
4397
+ ),
4398
+ request: req
4399
+ )
4400
+ end
4401
+ rescue StandardError => e
4402
+ error = e
4403
+ ensure
4404
+ if http_response.nil? || Utils.error_status?(http_response.status)
4405
+ http_response = @sdk_configuration.hooks.after_error(
4406
+ error: error,
4407
+ hook_ctx: SDKHooks::AfterErrorHookContext.new(
4408
+ hook_ctx: hook_ctx
4409
+ ),
4410
+ response: http_response
4411
+ )
4412
+ else
4413
+ http_response = @sdk_configuration.hooks.after_success(
4414
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
4415
+ hook_ctx: hook_ctx
4416
+ ),
4417
+ response: http_response
4418
+ )
4419
+ end
4420
+
4421
+ if http_response.nil?
4422
+ raise error if !error.nil?
4423
+ raise 'no response'
4424
+ end
4425
+ end
4426
+
4427
+ content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
4428
+ if Utils.match_status_code(http_response.status, ['200'])
4429
+ if Utils.match_content_type(content_type, 'application/json')
4430
+ http_response = @sdk_configuration.hooks.after_success(
4431
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
4432
+ hook_ctx: hook_ctx
4433
+ ),
4434
+ response: http_response
4435
+ )
4436
+ response_data = http_response.env.response_body
4437
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::TrustedDeviceList)
4438
+ response = Models::Operations::ListUserTrustedDevicesResponse.new(
4439
+ status_code: http_response.status,
4440
+ content_type: content_type,
4441
+ raw_response: http_response,
4442
+ trusted_device_list: obj
4443
+ )
4444
+
4445
+ return response
4446
+ else
4447
+ raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
4448
+ end
4449
+ elsif Utils.match_status_code(http_response.status, ['403', '404'])
4450
+ if Utils.match_content_type(content_type, 'application/json')
4451
+ http_response = @sdk_configuration.hooks.after_success(
4452
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
4453
+ hook_ctx: hook_ctx
4454
+ ),
4455
+ response: http_response
4456
+ )
4457
+ response_data = http_response.env.response_body
4458
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
4459
+ obj.raw_response = http_response
4460
+ raise obj
4461
+ else
4462
+ raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
4463
+ end
4464
+ elsif Utils.match_status_code(http_response.status, ['500'])
4465
+ if Utils.match_content_type(content_type, 'application/json')
4466
+ http_response = @sdk_configuration.hooks.after_success(
4467
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
4468
+ hook_ctx: hook_ctx
4469
+ ),
4470
+ response: http_response
4471
+ )
4472
+ response_data = http_response.env.response_body
4473
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
4474
+ obj.raw_response = http_response
4475
+ raise obj
4476
+ else
4477
+ raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
4478
+ end
4479
+ elsif Utils.match_status_code(http_response.status, ['4XX'])
4480
+ raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
4481
+ elsif Utils.match_status_code(http_response.status, ['5XX'])
4482
+ raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
4483
+ else
4484
+ raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
4485
+
4486
+ end
4487
+ end
4488
+
4489
+
4490
+
4491
+ def revoke_trusted_device(user_id:, trusted_device_id:, retries: nil, timeout_ms: nil, http_headers: nil)
4492
+ # revoke_trusted_device - Revoke a user's trusted device
4493
+ # Revokes an active trusted device enrolled by the user.
4494
+ request = Models::Operations::RevokeUserTrustedDeviceRequest.new(
4495
+ user_id: user_id,
4496
+ trusted_device_id: trusted_device_id
4497
+ )
4498
+ url, params = @sdk_configuration.get_server_details
4499
+ base_url = Utils.template_url(url, params)
4500
+ url = Utils.generate_url(
4501
+ Models::Operations::RevokeUserTrustedDeviceRequest,
4502
+ base_url,
4503
+ '/users/{user_id}/trusted_devices/{trusted_device_id}',
4504
+ request
4505
+ )
4506
+ headers = {}
4507
+
4508
+ headers['Accept'] = 'application/json'
4509
+ headers['user-agent'] = @sdk_configuration.user_agent
4510
+ retries ||= @sdk_configuration.retry_config
4511
+ retries ||= Utils::RetryConfig.new(
4512
+ backoff: Utils::BackoffStrategy.new(
4513
+ exponent: 1.5,
4514
+ initial_interval: 500,
4515
+ max_elapsed_time: 3_600_000,
4516
+ max_interval: 60_000
4517
+ ),
4518
+ retry_connection_errors: true,
4519
+ strategy: 'backoff'
4520
+ )
4521
+ retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
4522
+ retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
4523
+
4524
+ security = @sdk_configuration.security_source&.call
4525
+
4526
+ timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
4527
+ timeout ||= @sdk_configuration.timeout
4528
+
4529
+
4530
+ connection = @sdk_configuration.client.dup
4531
+ connection.use Utils::RetryMiddleware, retry_options
4532
+
4533
+ hook_ctx = SDKHooks::HookContext.new(
4534
+ config: @sdk_configuration,
4535
+ base_url: base_url,
4536
+ oauth2_scopes: nil,
4537
+ operation_id: 'RevokeUserTrustedDevice',
4538
+ security_source: @sdk_configuration.security_source
4539
+ )
4540
+
4541
+ error = nil
4542
+ http_response = nil
4543
+
4544
+
4545
+ begin
4546
+ http_response = connection.delete(url) do |req|
4547
+ req.headers.merge!(headers)
4548
+ req.options.timeout = timeout unless timeout.nil?
4549
+ Utils.configure_request_security(req, security)
4550
+ http_headers&.each do |key, value|
4551
+ req.headers[key.to_s] = value
4552
+ end
4553
+
4554
+ @sdk_configuration.hooks.before_request(
4555
+ hook_ctx: SDKHooks::BeforeRequestHookContext.new(
4556
+ hook_ctx: hook_ctx
4557
+ ),
4558
+ request: req
4559
+ )
4560
+ end
4561
+ rescue StandardError => e
4562
+ error = e
4563
+ ensure
4564
+ if http_response.nil? || Utils.error_status?(http_response.status)
4565
+ http_response = @sdk_configuration.hooks.after_error(
4566
+ error: error,
4567
+ hook_ctx: SDKHooks::AfterErrorHookContext.new(
4568
+ hook_ctx: hook_ctx
4569
+ ),
4570
+ response: http_response
4571
+ )
4572
+ else
4573
+ http_response = @sdk_configuration.hooks.after_success(
4574
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
4575
+ hook_ctx: hook_ctx
4576
+ ),
4577
+ response: http_response
4578
+ )
4579
+ end
4580
+
4581
+ if http_response.nil?
4582
+ raise error if !error.nil?
4583
+ raise 'no response'
4584
+ end
4585
+ end
4586
+
4587
+ content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
4588
+ if Utils.match_status_code(http_response.status, ['200'])
4589
+ if Utils.match_content_type(content_type, 'application/json')
4590
+ http_response = @sdk_configuration.hooks.after_success(
4591
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
4592
+ hook_ctx: hook_ctx
4593
+ ),
4594
+ response: http_response
4595
+ )
4596
+ response_data = http_response.env.response_body
4597
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::TrustedDevice)
4598
+ response = Models::Operations::RevokeUserTrustedDeviceResponse.new(
4599
+ status_code: http_response.status,
4600
+ content_type: content_type,
4601
+ raw_response: http_response,
4602
+ trusted_device: obj
4603
+ )
4604
+
4605
+ return response
4606
+ else
4607
+ raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
4608
+ end
4609
+ elsif Utils.match_status_code(http_response.status, ['403', '404'])
4610
+ if Utils.match_content_type(content_type, 'application/json')
4611
+ http_response = @sdk_configuration.hooks.after_success(
4612
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
4613
+ hook_ctx: hook_ctx
4614
+ ),
4615
+ response: http_response
4616
+ )
4617
+ response_data = http_response.env.response_body
4618
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
4619
+ obj.raw_response = http_response
4620
+ raise obj
4621
+ else
4622
+ raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
4623
+ end
4624
+ elsif Utils.match_status_code(http_response.status, ['500'])
4625
+ if Utils.match_content_type(content_type, 'application/json')
4626
+ http_response = @sdk_configuration.hooks.after_success(
4627
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
4628
+ hook_ctx: hook_ctx
4629
+ ),
4630
+ response: http_response
4631
+ )
4632
+ response_data = http_response.env.response_body
4633
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
4634
+ obj.raw_response = http_response
4635
+ raise obj
4636
+ else
4637
+ raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
4638
+ end
4639
+ elsif Utils.match_status_code(http_response.status, ['4XX'])
4640
+ raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
4641
+ elsif Utils.match_status_code(http_response.status, ['5XX'])
4642
+ raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
4643
+ else
4644
+ raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
4645
+
4646
+ end
4647
+ end
4648
+
4649
+
4650
+
4159
4651
  def delete_web3_wallet(user_id:, web3_wallet_identification_id:, retries: nil, timeout_ms: nil, http_headers: nil)
4160
4652
  # delete_web3_wallet - Delete a user web3 wallet
4161
4653
  # Delete the web3 wallet identification for a given user.
@@ -4193,10 +4685,10 @@ module Clerk
4193
4685
 
4194
4686
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
4195
4687
  timeout ||= @sdk_configuration.timeout
4196
-
4688
+
4197
4689
 
4198
4690
  connection = @sdk_configuration.client.dup
4199
- connection.request :retry, retry_options
4691
+ connection.use Utils::RetryMiddleware, retry_options
4200
4692
 
4201
4693
  hook_ctx = SDKHooks::HookContext.new(
4202
4694
  config: @sdk_configuration,
@@ -4209,7 +4701,7 @@ module Clerk
4209
4701
  error = nil
4210
4702
  http_response = nil
4211
4703
 
4212
-
4704
+
4213
4705
  begin
4214
4706
  http_response = connection.delete(url) do |req|
4215
4707
  req.headers.merge!(headers)
@@ -4245,13 +4737,13 @@ module Clerk
4245
4737
  response: http_response
4246
4738
  )
4247
4739
  end
4248
-
4740
+
4249
4741
  if http_response.nil?
4250
4742
  raise error if !error.nil?
4251
4743
  raise 'no response'
4252
4744
  end
4253
4745
  end
4254
-
4746
+
4255
4747
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
4256
4748
  if Utils.match_status_code(http_response.status, ['200'])
4257
4749
  if Utils.match_content_type(content_type, 'application/json')
@@ -4352,10 +4844,10 @@ module Clerk
4352
4844
 
4353
4845
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
4354
4846
  timeout ||= @sdk_configuration.timeout
4355
-
4847
+
4356
4848
 
4357
4849
  connection = @sdk_configuration.client.dup
4358
- connection.request :retry, retry_options
4850
+ connection.use Utils::RetryMiddleware, retry_options
4359
4851
 
4360
4852
  hook_ctx = SDKHooks::HookContext.new(
4361
4853
  config: @sdk_configuration,
@@ -4368,7 +4860,7 @@ module Clerk
4368
4860
  error = nil
4369
4861
  http_response = nil
4370
4862
 
4371
-
4863
+
4372
4864
  begin
4373
4865
  http_response = connection.delete(url) do |req|
4374
4866
  req.headers.merge!(headers)
@@ -4404,13 +4896,13 @@ module Clerk
4404
4896
  response: http_response
4405
4897
  )
4406
4898
  end
4407
-
4899
+
4408
4900
  if http_response.nil?
4409
4901
  raise error if !error.nil?
4410
4902
  raise 'no response'
4411
4903
  end
4412
4904
  end
4413
-
4905
+
4414
4906
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
4415
4907
  if Utils.match_status_code(http_response.status, ['200'])
4416
4908
  if Utils.match_content_type(content_type, 'application/json')
@@ -4512,10 +5004,10 @@ module Clerk
4512
5004
 
4513
5005
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
4514
5006
  timeout ||= @sdk_configuration.timeout
4515
-
5007
+
4516
5008
 
4517
5009
  connection = @sdk_configuration.client.dup
4518
- connection.request :retry, retry_options
5010
+ connection.use Utils::RetryMiddleware, retry_options
4519
5011
 
4520
5012
  hook_ctx = SDKHooks::HookContext.new(
4521
5013
  config: @sdk_configuration,
@@ -4528,7 +5020,7 @@ module Clerk
4528
5020
  error = nil
4529
5021
  http_response = nil
4530
5022
 
4531
-
5023
+
4532
5024
  begin
4533
5025
  http_response = connection.delete(url) do |req|
4534
5026
  req.headers.merge!(headers)
@@ -4564,13 +5056,13 @@ module Clerk
4564
5056
  response: http_response
4565
5057
  )
4566
5058
  end
4567
-
5059
+
4568
5060
  if http_response.nil?
4569
5061
  raise error if !error.nil?
4570
5062
  raise 'no response'
4571
5063
  end
4572
5064
  end
4573
-
5065
+
4574
5066
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
4575
5067
  if Utils.match_status_code(http_response.status, ['200'])
4576
5068
  if Utils.match_content_type(content_type, 'application/json')
@@ -4682,10 +5174,10 @@ module Clerk
4682
5174
 
4683
5175
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
4684
5176
  timeout ||= @sdk_configuration.timeout
4685
-
5177
+
4686
5178
 
4687
5179
  connection = @sdk_configuration.client.dup
4688
- connection.request :retry, retry_options
5180
+ connection.use Utils::RetryMiddleware, retry_options
4689
5181
 
4690
5182
  hook_ctx = SDKHooks::HookContext.new(
4691
5183
  config: @sdk_configuration,
@@ -4698,7 +5190,7 @@ module Clerk
4698
5190
  error = nil
4699
5191
  http_response = nil
4700
5192
 
4701
-
5193
+
4702
5194
  begin
4703
5195
  http_response = connection.post(url) do |req|
4704
5196
  req.body = body
@@ -4735,13 +5227,13 @@ module Clerk
4735
5227
  response: http_response
4736
5228
  )
4737
5229
  end
4738
-
5230
+
4739
5231
  if http_response.nil?
4740
5232
  raise error if !error.nil?
4741
5233
  raise 'no response'
4742
5234
  end
4743
5235
  end
4744
-
5236
+
4745
5237
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
4746
5238
  if Utils.match_status_code(http_response.status, ['200'])
4747
5239
  if Utils.match_content_type(content_type, 'application/json')
@@ -4794,6 +5286,8 @@ module Clerk
4794
5286
  def unset_password_compromised(user_id:, retries: nil, timeout_ms: nil, http_headers: nil)
4795
5287
  # unset_password_compromised - Unset a user's password as compromised
4796
5288
  # Sets the given user's password as no longer compromised. The user will no longer be prompted to reset their password on their next sign-in.
5289
+ #
5290
+ # If the user is in reserved-email password quarantine, the quarantine is preserved and the returned user will still have `requires_password_reset` set to `true`. Reserved-email password quarantine can only be cleared by completing a password reset or changing/removing the password.
4797
5291
  request = Models::Operations::UnsetUserPasswordCompromisedRequest.new(
4798
5292
  user_id: user_id
4799
5293
  )
@@ -4827,10 +5321,10 @@ module Clerk
4827
5321
 
4828
5322
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
4829
5323
  timeout ||= @sdk_configuration.timeout
4830
-
5324
+
4831
5325
 
4832
5326
  connection = @sdk_configuration.client.dup
4833
- connection.request :retry, retry_options
5327
+ connection.use Utils::RetryMiddleware, retry_options
4834
5328
 
4835
5329
  hook_ctx = SDKHooks::HookContext.new(
4836
5330
  config: @sdk_configuration,
@@ -4843,7 +5337,7 @@ module Clerk
4843
5337
  error = nil
4844
5338
  http_response = nil
4845
5339
 
4846
-
5340
+
4847
5341
  begin
4848
5342
  http_response = connection.post(url) do |req|
4849
5343
  req.headers.merge!(headers)
@@ -4879,13 +5373,13 @@ module Clerk
4879
5373
  response: http_response
4880
5374
  )
4881
5375
  end
4882
-
5376
+
4883
5377
  if http_response.nil?
4884
5378
  raise error if !error.nil?
4885
5379
  raise 'no response'
4886
5380
  end
4887
5381
  end
4888
-
5382
+
4889
5383
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
4890
5384
  if Utils.match_status_code(http_response.status, ['200'])
4891
5385
  if Utils.match_content_type(content_type, 'application/json')
@@ -4969,10 +5463,10 @@ module Clerk
4969
5463
 
4970
5464
  timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
4971
5465
  timeout ||= @sdk_configuration.timeout
4972
-
5466
+
4973
5467
 
4974
5468
  connection = @sdk_configuration.client.dup
4975
- connection.request :retry, retry_options
5469
+ connection.use Utils::RetryMiddleware, retry_options
4976
5470
 
4977
5471
  hook_ctx = SDKHooks::HookContext.new(
4978
5472
  config: @sdk_configuration,
@@ -4985,7 +5479,7 @@ module Clerk
4985
5479
  error = nil
4986
5480
  http_response = nil
4987
5481
 
4988
-
5482
+
4989
5483
  begin
4990
5484
  http_response = connection.get(url) do |req|
4991
5485
  req.headers.merge!(headers)
@@ -5022,13 +5516,13 @@ module Clerk
5022
5516
  response: http_response
5023
5517
  )
5024
5518
  end
5025
-
5519
+
5026
5520
  if http_response.nil?
5027
5521
  raise error if !error.nil?
5028
5522
  raise 'no response'
5029
5523
  end
5030
5524
  end
5031
-
5525
+
5032
5526
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
5033
5527
  if Utils.match_status_code(http_response.status, ['200'])
5034
5528
  if Utils.match_content_type(content_type, 'application/json')