clerk-sdk-ruby 5.1.1 → 5.1.3

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 (326) hide show
  1. checksums.yaml +4 -4
  2. data/lib/clerk/actortokens.rb +12 -4
  3. data/lib/clerk/agenttasks.rb +335 -0
  4. data/lib/clerk/allowlistidentifiers.rb +16 -5
  5. data/lib/clerk/api_keys.rb +39 -13
  6. data/lib/clerk/betafeatures.rb +17 -9
  7. data/lib/clerk/billing.rb +46 -14
  8. data/lib/clerk/blocklistidentifiers.rb +16 -5
  9. data/lib/clerk/clients.rb +18 -7
  10. data/lib/clerk/domains.rb +21 -7
  11. data/lib/clerk/emailaddresses.rb +23 -9
  12. data/lib/clerk/emailandsmstemplates.rb +10 -5
  13. data/lib/clerk/emailsmstemplates.rb +28 -14
  14. data/lib/clerk/instancesettings.rb +306 -15
  15. data/lib/clerk/invitations.rb +22 -8
  16. data/lib/clerk/jwks.rb +7 -2
  17. data/lib/clerk/jwttemplates.rb +25 -8
  18. data/lib/clerk/m2m.rb +32 -14
  19. data/lib/clerk/machines.rb +43 -14
  20. data/lib/clerk/miscellaneous.rb +7 -2
  21. data/lib/clerk/models/components/action.rb +20 -0
  22. data/lib/clerk/models/components/action.rbi +11 -0
  23. data/lib/clerk/models/components/actortoken.rb +4 -4
  24. data/lib/clerk/models/components/adjustcreditbalancerequest.rb +48 -0
  25. data/lib/clerk/models/components/adjustcreditbalancerequest.rbi +21 -0
  26. data/lib/clerk/models/components/agenttask.rb +47 -0
  27. data/lib/clerk/models/components/agenttask.rbi +19 -0
  28. data/lib/clerk/models/components/agenttask_object.rb +19 -0
  29. data/lib/clerk/models/components/agenttask_object.rbi +11 -0
  30. data/lib/clerk/models/components/allowlistidentifier.rb +6 -6
  31. data/lib/clerk/models/components/allowlistidentifier_object.rb +1 -1
  32. data/lib/clerk/models/components/balance.rb +44 -0
  33. data/lib/clerk/models/components/balance.rbi +19 -0
  34. data/lib/clerk/models/components/billingpaymentattempt.rb +7 -3
  35. data/lib/clerk/models/components/billingpaymentattempt.rbi +2 -0
  36. data/lib/clerk/models/components/billingpaymentattempt_credits.rb +40 -0
  37. data/lib/clerk/models/components/billingpaymentattempt_credits.rbi +17 -0
  38. data/lib/clerk/models/components/billingpaymentattempt_payer.rb +36 -0
  39. data/lib/clerk/models/components/billingpaymentattempt_payer.rbi +15 -0
  40. data/lib/clerk/models/components/billingpaymentattempt_proration.rb +44 -0
  41. data/lib/clerk/models/components/billingpaymentattempt_proration.rbi +19 -0
  42. data/lib/clerk/models/components/billingpaymentattempt_totals.rb +52 -0
  43. data/lib/clerk/models/components/billingpaymentattempt_totals.rbi +23 -0
  44. data/lib/clerk/models/components/billingpriceresponse.rb +6 -2
  45. data/lib/clerk/models/components/billingpriceresponse.rbi +2 -0
  46. data/lib/clerk/models/components/billingstatement.rb +3 -3
  47. data/lib/clerk/models/components/{totals.rb → billingstatement_totals.rb} +6 -2
  48. data/lib/clerk/models/components/{totals.rbi → billingstatement_totals.rbi} +4 -2
  49. data/lib/clerk/models/components/blocklistidentifier.rb +6 -6
  50. data/lib/clerk/models/components/blocklistidentifier_object.rb +1 -1
  51. data/lib/clerk/models/components/blocklistidentifiers.rb +1 -1
  52. data/lib/clerk/models/components/client.rb +7 -7
  53. data/lib/clerk/models/components/client_object.rb +1 -1
  54. data/lib/clerk/models/components/cnametarget.rb +1 -1
  55. data/lib/clerk/models/components/commercecreditbalanceresponse.rb +36 -0
  56. data/lib/clerk/models/components/commercecreditbalanceresponse.rbi +15 -0
  57. data/lib/clerk/models/components/commercecreditledgerresponse.rb +64 -0
  58. data/lib/clerk/models/components/commercecreditledgerresponse.rbi +29 -0
  59. data/lib/clerk/models/components/commercepayerresponse.rb +1 -1
  60. data/lib/clerk/models/components/commercepaymentmethodresponse.rb +3 -3
  61. data/lib/clerk/models/components/commerceperunittotal.rb +40 -0
  62. data/lib/clerk/models/components/commerceperunittotal.rbi +17 -0
  63. data/lib/clerk/models/components/commerceperunittotaltier.rb +40 -0
  64. data/lib/clerk/models/components/commerceperunittotaltier.rbi +17 -0
  65. data/lib/clerk/models/components/commerceplan.rb +8 -4
  66. data/lib/clerk/models/components/commerceplan.rbi +2 -0
  67. data/lib/clerk/models/components/commerceplanunitprice.rb +40 -0
  68. data/lib/clerk/models/components/commerceplanunitprice.rbi +17 -0
  69. data/lib/clerk/models/components/commerceplanunitpricetier.rb +40 -0
  70. data/lib/clerk/models/components/commerceplanunitpricetier.rbi +17 -0
  71. data/lib/clerk/models/components/commercepricetransitiondetails.rb +2 -2
  72. data/lib/clerk/models/components/commercepricetransitionresponse.rb +1 -1
  73. data/lib/clerk/models/components/commercesubscription.rb +2 -2
  74. data/lib/clerk/models/components/commercesubscriptionitem.rb +17 -5
  75. data/lib/clerk/models/components/commercesubscriptionitem.rbi +6 -0
  76. data/lib/clerk/models/components/commercesubscriptionitem_credits.rb +40 -0
  77. data/lib/clerk/models/components/commercesubscriptionitem_credits.rbi +17 -0
  78. data/lib/clerk/models/components/commercesubscriptionitem_payer.rb +36 -0
  79. data/lib/clerk/models/components/commercesubscriptionitem_payer.rbi +15 -0
  80. data/lib/clerk/models/components/commercesubscriptionitem_plan.rb +8 -4
  81. data/lib/clerk/models/components/commercesubscriptionitem_plan.rbi +2 -0
  82. data/lib/clerk/models/components/commercesubscriptionitem_proration.rb +44 -0
  83. data/lib/clerk/models/components/commercesubscriptionitem_proration.rbi +19 -0
  84. data/lib/clerk/models/components/commercesubscriptionitem_totals.rb +52 -0
  85. data/lib/clerk/models/components/commercesubscriptionitem_totals.rbi +23 -0
  86. data/lib/clerk/models/components/commercesubscriptionitem_totals_credits.rb +40 -0
  87. data/lib/clerk/models/components/commercesubscriptionitem_totals_credits.rbi +17 -0
  88. data/lib/clerk/models/components/commercesubscriptionitem_totals_payer.rb +36 -0
  89. data/lib/clerk/models/components/commercesubscriptionitem_totals_payer.rbi +15 -0
  90. data/lib/clerk/models/components/commercesubscriptionitem_totals_proration.rb +44 -0
  91. data/lib/clerk/models/components/commercesubscriptionitem_totals_proration.rbi +19 -0
  92. data/lib/clerk/models/components/cookies.rb +1 -1
  93. data/lib/clerk/models/components/creator_role.rb +1 -1
  94. data/lib/clerk/models/components/default_role.rb +1 -1
  95. data/lib/clerk/models/components/domain.rb +2 -2
  96. data/lib/clerk/models/components/domains.rb +1 -1
  97. data/lib/clerk/models/components/emailaddress.rb +5 -5
  98. data/lib/clerk/models/components/emailaddress_admin.rb +3 -3
  99. data/lib/clerk/models/components/emailaddress_object.rb +1 -1
  100. data/lib/clerk/models/components/emailaddress_otp.rb +3 -3
  101. data/lib/clerk/models/components/emailaddress_saml.rb +3 -3
  102. data/lib/clerk/models/components/emailaddress_ticket.rb +3 -3
  103. data/lib/clerk/models/components/emaillink.rb +3 -3
  104. data/lib/clerk/models/components/enterpriseaccount.rb +5 -5
  105. data/lib/clerk/models/components/enterpriseaccount_oauth.rb +2 -2
  106. data/lib/clerk/models/components/enterpriseaccount_object.rb +1 -1
  107. data/lib/clerk/models/components/enterpriseaccount_saml.rb +3 -3
  108. data/lib/clerk/models/components/enterpriseaccount_ticket.rb +3 -3
  109. data/lib/clerk/models/components/enterpriseconnection_1.rb +3 -3
  110. data/lib/clerk/models/components/enterpriseconnection_2.rb +3 -3
  111. data/lib/clerk/models/components/extendfreetrialrequest.rb +1 -1
  112. data/lib/clerk/models/components/externalaccountwithverification.rb +7 -7
  113. data/lib/clerk/models/components/externalaccountwithverification_oauth.rb +2 -2
  114. data/lib/clerk/models/components/featureresponse.rb +1 -1
  115. data/lib/clerk/models/components/fromoauth.rb +2 -2
  116. data/lib/clerk/models/components/googleonetap.rb +3 -3
  117. data/lib/clerk/models/components/group.rb +1 -1
  118. data/lib/clerk/models/components/instance.rb +1 -1
  119. data/lib/clerk/models/components/instanceprotect.rb +1 -1
  120. data/lib/clerk/models/components/instancerestrictions.rb +1 -1
  121. data/lib/clerk/models/components/instancesettings.rb +1 -1
  122. data/lib/clerk/models/components/invitation.rb +5 -5
  123. data/lib/clerk/models/components/invitation_revoked.rb +5 -5
  124. data/lib/clerk/models/components/jwttemplate.rb +3 -3
  125. data/lib/clerk/models/components/machine.rb +1 -1
  126. data/lib/clerk/models/components/machine_created.rb +1 -1
  127. data/lib/clerk/models/components/machine_deleted.rb +1 -1
  128. data/lib/clerk/models/components/machine_secretkey.rb +1 -1
  129. data/lib/clerk/models/components/machinescope.rb +1 -1
  130. data/lib/clerk/models/components/machinescope_deleted.rb +1 -1
  131. data/lib/clerk/models/components/machinewithoutscopedmachines.rb +1 -1
  132. data/lib/clerk/models/components/oauthaccesstoken.rb +1 -1
  133. data/lib/clerk/models/components/oauthapplication.rb +6 -6
  134. data/lib/clerk/models/components/oauthapplications.rb +1 -1
  135. data/lib/clerk/models/components/oauthapplicationsettings.rb +40 -0
  136. data/lib/clerk/models/components/oauthapplicationsettings.rbi +17 -0
  137. data/lib/clerk/models/components/oauthapplicationsettings_object.rb +19 -0
  138. data/lib/clerk/models/components/oauthapplicationsettings_object.rbi +11 -0
  139. data/lib/clerk/models/components/oauthapplicationwithsecret.rb +7 -7
  140. data/lib/clerk/models/components/organization.rb +5 -5
  141. data/lib/clerk/models/components/organizationdomain.rb +3 -3
  142. data/lib/clerk/models/components/organizationdomain_object.rb +1 -1
  143. data/lib/clerk/models/components/organizationdomain_verification.rb +1 -1
  144. data/lib/clerk/models/components/organizationdomains.rb +1 -1
  145. data/lib/clerk/models/components/organizationinvitation.rb +2 -2
  146. data/lib/clerk/models/components/organizationinvitation_object.rb +1 -1
  147. data/lib/clerk/models/components/organizationinvitations.rb +1 -1
  148. data/lib/clerk/models/components/organizationinvitationswithpublicorganizationdata.rb +1 -1
  149. data/lib/clerk/models/components/organizationinvitationwithpublicorganizationdata.rb +2 -2
  150. data/lib/clerk/models/components/organizationinvitationwithpublicorganizationdata_object.rb +1 -1
  151. data/lib/clerk/models/components/organizationmembership.rb +2 -2
  152. data/lib/clerk/models/components/organizationmembership_object.rb +1 -1
  153. data/lib/clerk/models/components/organizationmembership_organization.rb +5 -5
  154. data/lib/clerk/models/components/organizationmembershippublicuserdata.rb +1 -1
  155. data/lib/clerk/models/components/organizationmemberships.rb +1 -1
  156. data/lib/clerk/models/components/organizations.rb +1 -1
  157. data/lib/clerk/models/components/organizationsettings.rb +3 -3
  158. data/lib/clerk/models/components/organizationwithlogo.rb +6 -6
  159. data/lib/clerk/models/components/passkey.rb +3 -3
  160. data/lib/clerk/models/components/passkey_object.rb +1 -1
  161. data/lib/clerk/models/components/payment_source.rb +3 -3
  162. data/lib/clerk/models/components/permission.rb +3 -3
  163. data/lib/clerk/models/components/permissions.rb +1 -1
  164. data/lib/clerk/models/components/phonenumber.rb +4 -4
  165. data/lib/clerk/models/components/phonenumber_admin.rb +3 -3
  166. data/lib/clerk/models/components/phonenumber_object.rb +1 -1
  167. data/lib/clerk/models/components/phonenumber_otp.rb +3 -3
  168. data/lib/clerk/models/components/protocol.rb +1 -1
  169. data/lib/clerk/models/components/proxycheck.rb +4 -4
  170. data/lib/clerk/models/components/redirecturl.rb +3 -3
  171. data/lib/clerk/models/components/role.rb +3 -3
  172. data/lib/clerk/models/components/role_set_migration.rb +1 -1
  173. data/lib/clerk/models/components/roles.rb +1 -1
  174. data/lib/clerk/models/components/roleset.rb +2 -2
  175. data/lib/clerk/models/components/rolesetitem.rb +1 -1
  176. data/lib/clerk/models/components/samlaccount.rb +3 -3
  177. data/lib/clerk/models/components/samlaccount_object.rb +1 -1
  178. data/lib/clerk/models/components/samlaccount_saml.rb +3 -3
  179. data/lib/clerk/models/components/samlaccount_ticket.rb +3 -3
  180. data/lib/clerk/models/components/samlconnection_1.rb +3 -3
  181. data/lib/clerk/models/components/samlconnection_2.rb +3 -3
  182. data/lib/clerk/models/components/samlconnections.rb +1 -1
  183. data/lib/clerk/models/components/schemas_commerceplan.rb +1 -1
  184. data/lib/clerk/models/components/schemas_commercesubscriptionitem.rb +4 -4
  185. data/lib/clerk/models/components/{payer.rb → schemas_commercesubscriptionitem_payer.rb} +2 -2
  186. data/lib/clerk/models/components/{payer.rbi → schemas_commercesubscriptionitem_payer.rbi} +2 -2
  187. data/lib/clerk/models/components/schemas_commercesubscriptionitem_plan.rb +1 -1
  188. data/lib/clerk/models/components/schemas_featureresponse.rb +1 -1
  189. data/lib/clerk/models/components/schemas_samlconnection_samlconnection_1.rb +4 -4
  190. data/lib/clerk/models/components/schemas_samlconnection_samlconnection_2.rb +4 -4
  191. data/lib/clerk/models/components/seats.rb +32 -0
  192. data/lib/clerk/models/components/seats.rbi +13 -0
  193. data/lib/clerk/models/components/session.rb +7 -7
  194. data/lib/clerk/models/components/session_object.rb +1 -1
  195. data/lib/clerk/models/components/signintoken.rb +4 -4
  196. data/lib/clerk/models/components/signup.rb +5 -5
  197. data/lib/clerk/models/components/signup_external_account.rb +1 -1
  198. data/lib/clerk/models/components/signupverification.rb +2 -2
  199. data/lib/clerk/models/components/template.rb +4 -4
  200. data/lib/clerk/models/components/template_object.rb +1 -1
  201. data/lib/clerk/models/components/testingtoken.rb +2 -2
  202. data/lib/clerk/models/components/token.rb +3 -3
  203. data/lib/clerk/models/components/token_object.rb +1 -1
  204. data/lib/clerk/models/components/totalcount.rb +2 -2
  205. data/lib/clerk/models/components/totalcount_object.rb +1 -1
  206. data/lib/clerk/models/components/user.rb +18 -18
  207. data/lib/clerk/models/components/user_object.rb +1 -1
  208. data/lib/clerk/models/components/verification_passkey_passkey.rb +4 -4
  209. data/lib/clerk/models/components/waitlistentry.rb +5 -5
  210. data/lib/clerk/models/components/waitlistentry_invitation.rb +5 -5
  211. data/lib/clerk/models/components/web3signature.rb +3 -3
  212. data/lib/clerk/models/components/web3wallet.rb +4 -4
  213. data/lib/clerk/models/components/web3wallet_admin.rb +3 -3
  214. data/lib/clerk/models/components/web3wallet_object.rb +1 -1
  215. data/lib/clerk/models/components.rb +27 -2
  216. data/lib/clerk/models/operations/actor.rb +1 -1
  217. data/lib/clerk/models/operations/adjustorganizationbillingcreditbalance_request.rb +36 -0
  218. data/lib/clerk/models/operations/adjustorganizationbillingcreditbalance_request.rbi +15 -0
  219. data/lib/clerk/models/operations/adjustorganizationbillingcreditbalance_response.rb +44 -0
  220. data/lib/clerk/models/operations/adjustorganizationbillingcreditbalance_response.rbi +19 -0
  221. data/lib/clerk/models/operations/adjustuserbillingcreditbalance_request.rb +36 -0
  222. data/lib/clerk/models/operations/adjustuserbillingcreditbalance_request.rbi +15 -0
  223. data/lib/clerk/models/operations/adjustuserbillingcreditbalance_response.rb +44 -0
  224. data/lib/clerk/models/operations/adjustuserbillingcreditbalance_response.rbi +19 -0
  225. data/lib/clerk/models/operations/clerkidpoauthaccesstoken.rb +1 -1
  226. data/lib/clerk/models/operations/createagenttask_request.rb +60 -0
  227. data/lib/clerk/models/operations/createagenttask_request.rbi +23 -0
  228. data/lib/clerk/models/operations/createagenttask_response.rb +44 -0
  229. data/lib/clerk/models/operations/createagenttask_response.rbi +19 -0
  230. data/lib/clerk/models/operations/createapikey_responsebody.rb +1 -1
  231. data/lib/clerk/models/operations/createbulkinvitations_requestbody.rb +1 -1
  232. data/lib/clerk/models/operations/createinvitation_request.rb +1 -1
  233. data/lib/clerk/models/operations/createm2mtoken_request.rb +5 -1
  234. data/lib/clerk/models/operations/createm2mtoken_request.rbi +2 -0
  235. data/lib/clerk/models/operations/createm2mtoken_responsebody.rb +1 -1
  236. data/lib/clerk/models/operations/createoauthapplication_request.rb +2 -2
  237. data/lib/clerk/models/operations/createroleset_request.rb +1 -1
  238. data/lib/clerk/models/operations/createsamlconnection_requestbody_1.rb +3 -3
  239. data/lib/clerk/models/operations/createsamlconnection_requestbody_2.rb +3 -3
  240. data/lib/clerk/models/operations/createsessiontoken_responsebody.rb +1 -1
  241. data/lib/clerk/models/operations/createsessiontokenfromtemplate_responsebody.rb +1 -1
  242. data/lib/clerk/models/operations/createuser_request.rb +5 -5
  243. data/lib/clerk/models/operations/data.rb +1 -1
  244. data/lib/clerk/models/operations/deleteapikey_responsebody.rb +1 -1
  245. data/lib/clerk/models/operations/getapikey_responsebody.rb +1 -1
  246. data/lib/clerk/models/operations/getinstanceoauthapplicationsettings_response.rb +44 -0
  247. data/lib/clerk/models/operations/getinstanceoauthapplicationsettings_response.rbi +19 -0
  248. data/lib/clerk/models/operations/getorganizationbillingcreditbalance_request.rb +32 -0
  249. data/lib/clerk/models/operations/getorganizationbillingcreditbalance_request.rbi +13 -0
  250. data/lib/clerk/models/operations/getorganizationbillingcreditbalance_response.rb +44 -0
  251. data/lib/clerk/models/operations/getorganizationbillingcreditbalance_response.rbi +19 -0
  252. data/lib/clerk/models/operations/getpublicinterstitial_request.rb +2 -2
  253. data/lib/clerk/models/operations/getuserbillingcreditbalance_request.rb +32 -0
  254. data/lib/clerk/models/operations/getuserbillingcreditbalance_request.rbi +13 -0
  255. data/lib/clerk/models/operations/getuserbillingcreditbalance_response.rb +44 -0
  256. data/lib/clerk/models/operations/getuserbillingcreditbalance_response.rbi +19 -0
  257. data/lib/clerk/models/operations/getuserlist_request.rb +2 -2
  258. data/lib/clerk/models/operations/getuserscount_request.rb +2 -2
  259. data/lib/clerk/models/operations/listallorganizationdomains_request.rb +3 -3
  260. data/lib/clerk/models/operations/listinstanceorganizationinvitations_status.rb +1 -0
  261. data/lib/clerk/models/operations/listorganizationinvitations_status.rb +1 -0
  262. data/lib/clerk/models/operations/listwaitlistentries_request.rb +1 -1
  263. data/lib/clerk/models/operations/m2m_token.rb +1 -1
  264. data/lib/clerk/models/operations/on_behalf_of.rb +37 -0
  265. data/lib/clerk/models/operations/on_behalf_of.rbi +15 -0
  266. data/lib/clerk/models/operations/permissions.rb +19 -0
  267. data/lib/clerk/models/operations/permissions.rbi +11 -0
  268. data/lib/clerk/models/operations/refreshsession_requestbody.rb +1 -1
  269. data/lib/clerk/models/operations/revokeagenttask_request.rb +32 -0
  270. data/lib/clerk/models/operations/revokeagenttask_request.rbi +13 -0
  271. data/lib/clerk/models/operations/revokeagenttask_response.rb +44 -0
  272. data/lib/clerk/models/operations/revokeagenttask_response.rbi +19 -0
  273. data/lib/clerk/models/operations/revokeapikey_responsebody.rb +1 -1
  274. data/lib/clerk/models/operations/revokem2mtoken_responsebody.rb +1 -1
  275. data/lib/clerk/models/operations/token_format.rb +20 -0
  276. data/lib/clerk/models/operations/token_format.rbi +11 -0
  277. data/lib/clerk/models/operations/updateapikey_responsebody.rb +1 -1
  278. data/lib/clerk/models/operations/updateinstance_request.rb +2 -2
  279. data/lib/clerk/models/operations/updateinstanceoauthapplicationsettings_request.rb +36 -0
  280. data/lib/clerk/models/operations/updateinstanceoauthapplicationsettings_request.rbi +15 -0
  281. data/lib/clerk/models/operations/updateinstanceoauthapplicationsettings_response.rb +44 -0
  282. data/lib/clerk/models/operations/updateinstanceoauthapplicationsettings_response.rbi +19 -0
  283. data/lib/clerk/models/operations/updateoauthapplication_requestbody.rb +2 -2
  284. data/lib/clerk/models/operations/updateroleset_requestbody.rb +1 -1
  285. data/lib/clerk/models/operations/updatesamlconnection_requestbody.rb +2 -2
  286. data/lib/clerk/models/operations/updateuser_requestbody.rb +2 -2
  287. data/lib/clerk/models/operations/updateusermetadata_requestbody.rb +1 -1
  288. data/lib/clerk/models/operations/usersgetorganizationinvitations_status.rb +1 -0
  289. data/lib/clerk/models/operations/verifyapikey_responsebody.rb +1 -1
  290. data/lib/clerk/models/operations/verifym2mtoken_responsebody.rb +1 -1
  291. data/lib/clerk/models/operations/verifyoauthaccesstoken_request.rb +2 -2
  292. data/lib/clerk/models/operations/verifytotp_responsebody.rb +1 -1
  293. data/lib/clerk/models/operations.rb +18 -0
  294. data/lib/clerk/oauthaccesstokens.rb +8 -3
  295. data/lib/clerk/oauthapplications.rb +29 -9
  296. data/lib/clerk/openapiclient.rb +4 -2
  297. data/lib/clerk/organizationdomains.rb +27 -10
  298. data/lib/clerk/organizationinvitations.rb +43 -20
  299. data/lib/clerk/organizationmemberships.rb +27 -10
  300. data/lib/clerk/organizationpermissions.rb +25 -8
  301. data/lib/clerk/organizationroles.rb +33 -10
  302. data/lib/clerk/organizations.rb +379 -16
  303. data/lib/clerk/phonenumbers.rb +21 -7
  304. data/lib/clerk/proxy.rb +1 -1
  305. data/lib/clerk/proxychecks.rb +10 -5
  306. data/lib/clerk/redirecturls.rb +20 -6
  307. data/lib/clerk/rolesets.rb +36 -13
  308. data/lib/clerk/samlconnections.rb +25 -8
  309. data/lib/clerk/sdkconfiguration.rb +3 -3
  310. data/lib/clerk/sessions.rb +40 -14
  311. data/lib/clerk/signintokens.rb +12 -4
  312. data/lib/clerk/signups.rb +12 -4
  313. data/lib/clerk/templates.rb +10 -5
  314. data/lib/clerk/testingtokens.rb +7 -2
  315. data/lib/clerk/users.rb +475 -49
  316. data/lib/clerk/utils/request_bodies.rb +8 -3
  317. data/lib/clerk/utils/security.rb +10 -0
  318. data/lib/clerk/utils/url.rb +11 -5
  319. data/lib/clerk/utils/utils.rb +33 -3
  320. data/lib/clerk/waitlistentries.rb +32 -12
  321. data/lib/clerk/webhooks.rb +15 -4
  322. data/lib/clerk_sdk_ruby.rb +1 -0
  323. data/lib/crystalline/metadata_fields.rb +66 -9
  324. data/lib/crystalline/module.rb +3 -3
  325. data/lib/crystalline/types.rb +11 -3
  326. metadata +107 -6
@@ -38,8 +38,10 @@ module Clerk
38
38
  end
39
39
 
40
40
 
41
+
42
+
41
43
 
42
- def update_instance_settings(request: nil, retries: nil, timeout_ms: nil)
44
+ def update_instance_settings(request: nil, retries: nil, timeout_ms: nil, http_headers: nil)
43
45
  # update_instance_settings - Update instance settings
44
46
  # Updates the settings of an instance
45
47
  url, params = @sdk_configuration.get_server_details
@@ -50,7 +52,7 @@ module Clerk
50
52
  req_content_type, data, form = Utils.serialize_request_body(request, false, true, :request, :json)
51
53
  headers['content-type'] = req_content_type
52
54
 
53
- if form
55
+ if form && !form.empty?
54
56
  body = Utils.encode_form(form)
55
57
  elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
56
58
  body = URI.encode_www_form(data)
@@ -100,6 +102,9 @@ module Clerk
100
102
  req.headers.merge!(headers)
101
103
  req.options.timeout = timeout unless timeout.nil?
102
104
  Utils.configure_request_security(req, security)
105
+ http_headers&.each do |key, value|
106
+ req.headers[key.to_s] = value
107
+ end
103
108
 
104
109
  @sdk_configuration.hooks.before_request(
105
110
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -183,15 +188,15 @@ module Clerk
183
188
 
184
189
 
185
190
 
186
- def update_production_instance_domain(request: nil, retries: nil, timeout_ms: nil)
191
+ def update_production_instance_domain(request: nil, retries: nil, timeout_ms: nil, http_headers: nil)
187
192
  # update_production_instance_domain - Update production instance domain
188
193
  # Change the domain of a production instance.
189
- #
194
+ #
190
195
  # Changing the domain requires updating the [DNS records](https://clerk.com/docs/deployments/overview#dns-records) accordingly, deploying new [SSL certificates](https://clerk.com/docs/deployments/overview#deploy-certificates), updating your Social Connection's redirect URLs and setting the new keys in your code.
191
- #
196
+ #
192
197
  # WARNING: Changing your domain will invalidate all current user sessions (i.e. users will be logged out). Also, while your application is being deployed, a small downtime is expected to occur.
193
- #
194
- # @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
198
+ #
199
+ # @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
195
200
  url, params = @sdk_configuration.get_server_details
196
201
  base_url = Utils.template_url(url, params)
197
202
  url = "#{base_url}/beta_features/domain"
@@ -200,7 +205,7 @@ module Clerk
200
205
  req_content_type, data, form = Utils.serialize_request_body(request, false, true, :request, :json)
201
206
  headers['content-type'] = req_content_type
202
207
 
203
- if form
208
+ if form && !form.empty?
204
209
  body = Utils.encode_form(form)
205
210
  elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
206
211
  body = URI.encode_www_form(data)
@@ -250,6 +255,9 @@ module Clerk
250
255
  req.headers.merge!(headers)
251
256
  req.options.timeout = timeout unless timeout.nil?
252
257
  Utils.configure_request_security(req, security)
258
+ http_headers&.each do |key, value|
259
+ req.headers[key.to_s] = value
260
+ end
253
261
 
254
262
  @sdk_configuration.hooks.before_request(
255
263
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -321,5 +329,5 @@ module Clerk
321
329
 
322
330
  end
323
331
  end
324
- end
332
+ end
325
333
  end
data/lib/clerk/billing.rb CHANGED
@@ -38,8 +38,10 @@ module Clerk
38
38
  end
39
39
 
40
40
 
41
+
42
+
41
43
 
42
- def list_plans(paginated: nil, limit: nil, offset: nil, payer_type: nil, retries: nil, timeout_ms: nil)
44
+ def list_plans(paginated: nil, limit: nil, offset: nil, payer_type: nil, retries: nil, timeout_ms: nil, http_headers: nil)
43
45
  # list_plans - List all billing plans
44
46
  # Returns a list of all billing plans for the instance. The plans are returned sorted by creation date,
45
47
  # with the newest plans appearing first. This includes both free and paid plans. Pagination is supported.
@@ -98,6 +100,9 @@ module Clerk
98
100
  req.options.timeout = timeout unless timeout.nil?
99
101
  req.params = query_params
100
102
  Utils.configure_request_security(req, security)
103
+ http_headers&.each do |key, value|
104
+ req.headers[key.to_s] = value
105
+ end
101
106
 
102
107
  @sdk_configuration.hooks.before_request(
103
108
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -196,7 +201,7 @@ module Clerk
196
201
 
197
202
 
198
203
 
199
- def list_prices(paginated: nil, limit: nil, offset: nil, plan_id: nil, retries: nil, timeout_ms: nil)
204
+ def list_prices(paginated: nil, limit: nil, offset: nil, plan_id: nil, retries: nil, timeout_ms: nil, http_headers: nil)
200
205
  # list_prices - List all billing prices
201
206
  # Returns a list of all prices for the instance. The prices are returned sorted by amount ascending,
202
207
  # then by creation date descending. This includes both default and custom prices. Pagination is supported.
@@ -255,6 +260,9 @@ module Clerk
255
260
  req.options.timeout = timeout unless timeout.nil?
256
261
  req.params = query_params
257
262
  Utils.configure_request_security(req, security)
263
+ http_headers&.each do |key, value|
264
+ req.headers[key.to_s] = value
265
+ end
258
266
 
259
267
  @sdk_configuration.hooks.before_request(
260
268
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -353,7 +361,7 @@ module Clerk
353
361
 
354
362
 
355
363
 
356
- def create_price(request:, retries: nil, timeout_ms: nil)
364
+ def create_price(request:, retries: nil, timeout_ms: nil, http_headers: nil)
357
365
  # create_price - Create a custom billing price
358
366
  # Creates a custom price for a billing plan. Custom prices allow you to offer different pricing
359
367
  # to specific customers while maintaining the same plan structure.
@@ -366,7 +374,7 @@ module Clerk
366
374
  headers['content-type'] = req_content_type
367
375
  raise StandardError, 'request body is required' if data.nil? && form.nil?
368
376
 
369
- if form
377
+ if form && !form.empty?
370
378
  body = Utils.encode_form(form)
371
379
  elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
372
380
  body = URI.encode_www_form(data)
@@ -416,6 +424,9 @@ module Clerk
416
424
  req.headers.merge!(headers)
417
425
  req.options.timeout = timeout unless timeout.nil?
418
426
  Utils.configure_request_security(req, security)
427
+ http_headers&.each do |key, value|
428
+ req.headers[key.to_s] = value
429
+ end
419
430
 
420
431
  @sdk_configuration.hooks.before_request(
421
432
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -514,7 +525,7 @@ module Clerk
514
525
 
515
526
 
516
527
 
517
- def list_subscription_items(request:, retries: nil, timeout_ms: nil)
528
+ def list_subscription_items(request:, retries: nil, timeout_ms: nil, http_headers: nil)
518
529
  # list_subscription_items - List all subscription items
519
530
  # Returns a list of all subscription items for the instance. The subscription items are returned sorted by creation date,
520
531
  # with the newest appearing first. This includes subscriptions for both users and organizations. Pagination is supported.
@@ -567,6 +578,9 @@ module Clerk
567
578
  req.options.timeout = timeout unless timeout.nil?
568
579
  req.params = query_params
569
580
  Utils.configure_request_security(req, security)
581
+ http_headers&.each do |key, value|
582
+ req.headers[key.to_s] = value
583
+ end
570
584
 
571
585
  @sdk_configuration.hooks.before_request(
572
586
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -665,7 +679,7 @@ module Clerk
665
679
 
666
680
 
667
681
 
668
- def cancel_subscription_item(subscription_item_id:, end_now: nil, retries: nil, timeout_ms: nil)
682
+ def cancel_subscription_item(subscription_item_id:, end_now: nil, retries: nil, timeout_ms: nil, http_headers: nil)
669
683
  # cancel_subscription_item - Cancel a subscription item
670
684
  # Cancel a specific subscription item. The subscription item can be canceled immediately or at the end of the current billing period.
671
685
  request = Models::Operations::CancelCommerceSubscriptionItemRequest.new(
@@ -726,6 +740,9 @@ module Clerk
726
740
  req.options.timeout = timeout unless timeout.nil?
727
741
  req.params = query_params
728
742
  Utils.configure_request_security(req, security)
743
+ http_headers&.each do |key, value|
744
+ req.headers[key.to_s] = value
745
+ end
729
746
 
730
747
  @sdk_configuration.hooks.before_request(
731
748
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -824,7 +841,7 @@ module Clerk
824
841
 
825
842
 
826
843
 
827
- def extend_subscription_item_free_trial(body:, subscription_item_id:, retries: nil, timeout_ms: nil)
844
+ def extend_subscription_item_free_trial(body:, subscription_item_id:, retries: nil, timeout_ms: nil, http_headers: nil)
828
845
  # extend_subscription_item_free_trial - Extend free trial for a subscription item
829
846
  # Extends the free trial period for a specific subscription item to the specified timestamp.
830
847
  # The subscription item must be currently in a free trial period, and the plan must support free trials.
@@ -848,7 +865,7 @@ module Clerk
848
865
  headers['content-type'] = req_content_type
849
866
  raise StandardError, 'request body is required' if data.nil? && form.nil?
850
867
 
851
- if form
868
+ if form && !form.empty?
852
869
  body = Utils.encode_form(form)
853
870
  elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
854
871
  body = URI.encode_www_form(data)
@@ -898,6 +915,9 @@ module Clerk
898
915
  req.headers.merge!(headers)
899
916
  req.options.timeout = timeout unless timeout.nil?
900
917
  Utils.configure_request_security(req, security)
918
+ http_headers&.each do |key, value|
919
+ req.headers[key.to_s] = value
920
+ end
901
921
 
902
922
  @sdk_configuration.hooks.before_request(
903
923
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -996,7 +1016,7 @@ module Clerk
996
1016
 
997
1017
 
998
1018
 
999
- def create_price_transition(body:, subscription_item_id:, retries: nil, timeout_ms: nil)
1019
+ def create_price_transition(body:, subscription_item_id:, retries: nil, timeout_ms: nil, http_headers: nil)
1000
1020
  # create_price_transition - Create a price transition for a subscription item
1001
1021
  # Creates a price transition for the specified subscription item.
1002
1022
  # This may create an upcoming subscription item or activate immediately depending on plan and payer rules.
@@ -1018,7 +1038,7 @@ module Clerk
1018
1038
  headers['content-type'] = req_content_type
1019
1039
  raise StandardError, 'request body is required' if data.nil? && form.nil?
1020
1040
 
1021
- if form
1041
+ if form && !form.empty?
1022
1042
  body = Utils.encode_form(form)
1023
1043
  elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
1024
1044
  body = URI.encode_www_form(data)
@@ -1068,6 +1088,9 @@ module Clerk
1068
1088
  req.headers.merge!(headers)
1069
1089
  req.options.timeout = timeout unless timeout.nil?
1070
1090
  Utils.configure_request_security(req, security)
1091
+ http_headers&.each do |key, value|
1092
+ req.headers[key.to_s] = value
1093
+ end
1071
1094
 
1072
1095
  @sdk_configuration.hooks.before_request(
1073
1096
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -1166,7 +1189,7 @@ module Clerk
1166
1189
 
1167
1190
 
1168
1191
 
1169
- def list_statements(paginated: nil, limit: nil, offset: nil, retries: nil, timeout_ms: nil)
1192
+ def list_statements(paginated: nil, limit: nil, offset: nil, retries: nil, timeout_ms: nil, http_headers: nil)
1170
1193
  # list_statements - List all billing statements
1171
1194
  # Returns a list of all billing statements for the instance. The statements are returned sorted by creation date,
1172
1195
  # with the newest statements appearing first. Pagination is supported.
@@ -1224,6 +1247,9 @@ module Clerk
1224
1247
  req.options.timeout = timeout unless timeout.nil?
1225
1248
  req.params = query_params
1226
1249
  Utils.configure_request_security(req, security)
1250
+ http_headers&.each do |key, value|
1251
+ req.headers[key.to_s] = value
1252
+ end
1227
1253
 
1228
1254
  @sdk_configuration.hooks.before_request(
1229
1255
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -1322,7 +1348,7 @@ module Clerk
1322
1348
 
1323
1349
 
1324
1350
 
1325
- def get_statement(statement_id:, retries: nil, timeout_ms: nil)
1351
+ def get_statement(statement_id:, retries: nil, timeout_ms: nil, http_headers: nil)
1326
1352
  # get_statement - Retrieve a billing statement
1327
1353
  # Retrieves the details of a billing statement.
1328
1354
  request = Models::Operations::GetBillingStatementRequest.new(
@@ -1380,6 +1406,9 @@ module Clerk
1380
1406
  req.headers.merge!(headers)
1381
1407
  req.options.timeout = timeout unless timeout.nil?
1382
1408
  Utils.configure_request_security(req, security)
1409
+ http_headers&.each do |key, value|
1410
+ req.headers[key.to_s] = value
1411
+ end
1383
1412
 
1384
1413
  @sdk_configuration.hooks.before_request(
1385
1414
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -1478,7 +1507,7 @@ module Clerk
1478
1507
 
1479
1508
 
1480
1509
 
1481
- def get_statement_payment_attempts(statement_id:, paginated: nil, limit: nil, offset: nil, retries: nil, timeout_ms: nil)
1510
+ def get_statement_payment_attempts(statement_id:, paginated: nil, limit: nil, offset: nil, retries: nil, timeout_ms: nil, http_headers: nil)
1482
1511
  # get_statement_payment_attempts - List payment attempts for a billing statement
1483
1512
  # Returns a list of all payment attempts for a specific billing statement. The payment attempts are returned sorted by creation date,
1484
1513
  # with the newest payment attempts appearing first. Pagination is supported.
@@ -1542,6 +1571,9 @@ module Clerk
1542
1571
  req.options.timeout = timeout unless timeout.nil?
1543
1572
  req.params = query_params
1544
1573
  Utils.configure_request_security(req, security)
1574
+ http_headers&.each do |key, value|
1575
+ req.headers[key.to_s] = value
1576
+ end
1545
1577
 
1546
1578
  @sdk_configuration.hooks.before_request(
1547
1579
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -1637,5 +1669,5 @@ module Clerk
1637
1669
 
1638
1670
  end
1639
1671
  end
1640
- end
1672
+ end
1641
1673
  end
@@ -38,8 +38,10 @@ module Clerk
38
38
  end
39
39
 
40
40
 
41
+
42
+
41
43
 
42
- def list(retries: nil, timeout_ms: nil)
44
+ def list(retries: nil, timeout_ms: nil, http_headers: nil)
43
45
  # list - List all identifiers on the block-list
44
46
  # Get a list of all identifiers which are not allowed to access an instance
45
47
  url, params = @sdk_configuration.get_server_details
@@ -89,6 +91,9 @@ module Clerk
89
91
  req.headers.merge!(headers)
90
92
  req.options.timeout = timeout unless timeout.nil?
91
93
  Utils.configure_request_security(req, security)
94
+ http_headers&.each do |key, value|
95
+ req.headers[key.to_s] = value
96
+ end
92
97
 
93
98
  @sdk_configuration.hooks.before_request(
94
99
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -172,7 +177,7 @@ module Clerk
172
177
 
173
178
 
174
179
 
175
- def create(request: nil, retries: nil, timeout_ms: nil)
180
+ def create(request: nil, retries: nil, timeout_ms: nil, http_headers: nil)
176
181
  # create - Add identifier to the block-list
177
182
  # Create an identifier that is blocked from accessing an instance
178
183
  url, params = @sdk_configuration.get_server_details
@@ -183,7 +188,7 @@ module Clerk
183
188
  req_content_type, data, form = Utils.serialize_request_body(request, false, true, :request, :json)
184
189
  headers['content-type'] = req_content_type
185
190
 
186
- if form
191
+ if form && !form.empty?
187
192
  body = Utils.encode_form(form)
188
193
  elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
189
194
  body = URI.encode_www_form(data)
@@ -233,6 +238,9 @@ module Clerk
233
238
  req.headers.merge!(headers)
234
239
  req.options.timeout = timeout unless timeout.nil?
235
240
  Utils.configure_request_security(req, security)
241
+ http_headers&.each do |key, value|
242
+ req.headers[key.to_s] = value
243
+ end
236
244
 
237
245
  @sdk_configuration.hooks.before_request(
238
246
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -316,7 +324,7 @@ module Clerk
316
324
 
317
325
 
318
326
 
319
- def delete(identifier_id:, retries: nil, timeout_ms: nil)
327
+ def delete(identifier_id:, retries: nil, timeout_ms: nil, http_headers: nil)
320
328
  # delete - Delete identifier from block-list
321
329
  # Delete an identifier from the instance block-list
322
330
  request = Models::Operations::DeleteBlocklistIdentifierRequest.new(
@@ -374,6 +382,9 @@ module Clerk
374
382
  req.headers.merge!(headers)
375
383
  req.options.timeout = timeout unless timeout.nil?
376
384
  Utils.configure_request_security(req, security)
385
+ http_headers&.each do |key, value|
386
+ req.headers[key.to_s] = value
387
+ end
377
388
 
378
389
  @sdk_configuration.hooks.before_request(
379
390
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -454,5 +465,5 @@ module Clerk
454
465
 
455
466
  end
456
467
  end
457
- end
468
+ end
458
469
  end
data/lib/clerk/clients.rb CHANGED
@@ -38,14 +38,16 @@ module Clerk
38
38
  end
39
39
 
40
40
 
41
+
42
+
41
43
 
42
- def list(paginated: nil, limit: nil, offset: nil, retries: nil, timeout_ms: nil)
44
+ def list(paginated: nil, limit: nil, offset: nil, retries: nil, timeout_ms: nil, http_headers: nil)
43
45
  # list - List all clients
44
46
  # Returns a list of all clients. The clients are returned sorted by creation date,
45
47
  # with the newest clients appearing first.
46
48
  # Warning: the endpoint is being deprecated and will be removed in future versions.
47
- #
48
- # @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
49
+ #
50
+ # @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
49
51
  request = Models::Operations::GetClientListRequest.new(
50
52
  paginated: paginated,
51
53
  limit: limit,
@@ -100,6 +102,9 @@ module Clerk
100
102
  req.options.timeout = timeout unless timeout.nil?
101
103
  req.params = query_params
102
104
  Utils.configure_request_security(req, security)
105
+ http_headers&.each do |key, value|
106
+ req.headers[key.to_s] = value
107
+ end
103
108
 
104
109
  @sdk_configuration.hooks.before_request(
105
110
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -183,7 +188,7 @@ module Clerk
183
188
 
184
189
 
185
190
 
186
- def verify(request: nil, retries: nil, timeout_ms: nil)
191
+ def verify(request: nil, retries: nil, timeout_ms: nil, http_headers: nil)
187
192
  # verify - Verify a client
188
193
  # Verifies the client in the provided token
189
194
  url, params = @sdk_configuration.get_server_details
@@ -194,7 +199,7 @@ module Clerk
194
199
  req_content_type, data, form = Utils.serialize_request_body(request, false, true, :request, :json)
195
200
  headers['content-type'] = req_content_type
196
201
 
197
- if form
202
+ if form && !form.empty?
198
203
  body = Utils.encode_form(form)
199
204
  elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
200
205
  body = URI.encode_www_form(data)
@@ -244,6 +249,9 @@ module Clerk
244
249
  req.headers.merge!(headers)
245
250
  req.options.timeout = timeout unless timeout.nil?
246
251
  Utils.configure_request_security(req, security)
252
+ http_headers&.each do |key, value|
253
+ req.headers[key.to_s] = value
254
+ end
247
255
 
248
256
  @sdk_configuration.hooks.before_request(
249
257
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -327,7 +335,7 @@ module Clerk
327
335
 
328
336
 
329
337
 
330
- def get(client_id:, retries: nil, timeout_ms: nil)
338
+ def get(client_id:, retries: nil, timeout_ms: nil, http_headers: nil)
331
339
  # get - Get a client
332
340
  # Returns the details of a client.
333
341
  request = Models::Operations::GetClientRequest.new(
@@ -385,6 +393,9 @@ module Clerk
385
393
  req.headers.merge!(headers)
386
394
  req.options.timeout = timeout unless timeout.nil?
387
395
  Utils.configure_request_security(req, security)
396
+ http_headers&.each do |key, value|
397
+ req.headers[key.to_s] = value
398
+ end
388
399
 
389
400
  @sdk_configuration.hooks.before_request(
390
401
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -465,5 +476,5 @@ module Clerk
465
476
 
466
477
  end
467
478
  end
468
- end
479
+ end
469
480
  end
data/lib/clerk/domains.rb CHANGED
@@ -38,8 +38,10 @@ module Clerk
38
38
  end
39
39
 
40
40
 
41
+
42
+
41
43
 
42
- def list(retries: nil, timeout_ms: nil)
44
+ def list(retries: nil, timeout_ms: nil, http_headers: nil)
43
45
  # list - List all instance domains
44
46
  # Use this endpoint to get a list of all domains for an instance.
45
47
  # The response will contain the primary domain for the instance and any satellite domains. Each domain in the response contains information about the URLs where Clerk operates and the required CNAME targets.
@@ -90,6 +92,9 @@ module Clerk
90
92
  req.headers.merge!(headers)
91
93
  req.options.timeout = timeout unless timeout.nil?
92
94
  Utils.configure_request_security(req, security)
95
+ http_headers&.each do |key, value|
96
+ req.headers[key.to_s] = value
97
+ end
93
98
 
94
99
  @sdk_configuration.hooks.before_request(
95
100
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -158,7 +163,7 @@ module Clerk
158
163
 
159
164
 
160
165
 
161
- def add(request: nil, retries: nil, timeout_ms: nil)
166
+ def add(request: nil, retries: nil, timeout_ms: nil, http_headers: nil)
162
167
  # add - Add a domain
163
168
  # Add a new domain for your instance.
164
169
  # Useful in the case of multi-domain instances, allows adding satellite domains to an instance.
@@ -173,7 +178,7 @@ module Clerk
173
178
  req_content_type, data, form = Utils.serialize_request_body(request, false, true, :request, :json)
174
179
  headers['content-type'] = req_content_type
175
180
 
176
- if form
181
+ if form && !form.empty?
177
182
  body = Utils.encode_form(form)
178
183
  elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
179
184
  body = URI.encode_www_form(data)
@@ -223,6 +228,9 @@ module Clerk
223
228
  req.headers.merge!(headers)
224
229
  req.options.timeout = timeout unless timeout.nil?
225
230
  Utils.configure_request_security(req, security)
231
+ http_headers&.each do |key, value|
232
+ req.headers[key.to_s] = value
233
+ end
226
234
 
227
235
  @sdk_configuration.hooks.before_request(
228
236
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -306,7 +314,7 @@ module Clerk
306
314
 
307
315
 
308
316
 
309
- def delete(domain_id:, retries: nil, timeout_ms: nil)
317
+ def delete(domain_id:, retries: nil, timeout_ms: nil, http_headers: nil)
310
318
  # delete - Delete a satellite domain
311
319
  # Deletes a satellite domain for the instance.
312
320
  # It is currently not possible to delete the instance's primary domain.
@@ -365,6 +373,9 @@ module Clerk
365
373
  req.headers.merge!(headers)
366
374
  req.options.timeout = timeout unless timeout.nil?
367
375
  Utils.configure_request_security(req, security)
376
+ http_headers&.each do |key, value|
377
+ req.headers[key.to_s] = value
378
+ end
368
379
 
369
380
  @sdk_configuration.hooks.before_request(
370
381
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -448,7 +459,7 @@ module Clerk
448
459
 
449
460
 
450
461
 
451
- def update(body:, domain_id:, retries: nil, timeout_ms: nil)
462
+ def update(body:, domain_id:, retries: nil, timeout_ms: nil, http_headers: nil)
452
463
  # update - Update a domain
453
464
  # The `proxy_url` can be updated only for production instances.
454
465
  # Update one of the instance's domains. Both primary and satellite domains can be updated.
@@ -476,7 +487,7 @@ module Clerk
476
487
  headers['content-type'] = req_content_type
477
488
  raise StandardError, 'request body is required' if data.nil? && form.nil?
478
489
 
479
- if form
490
+ if form && !form.empty?
480
491
  body = Utils.encode_form(form)
481
492
  elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
482
493
  body = URI.encode_www_form(data)
@@ -526,6 +537,9 @@ module Clerk
526
537
  req.headers.merge!(headers)
527
538
  req.options.timeout = timeout unless timeout.nil?
528
539
  Utils.configure_request_security(req, security)
540
+ http_headers&.each do |key, value|
541
+ req.headers[key.to_s] = value
542
+ end
529
543
 
530
544
  @sdk_configuration.hooks.before_request(
531
545
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -606,5 +620,5 @@ module Clerk
606
620
 
607
621
  end
608
622
  end
609
- end
623
+ end
610
624
  end
@@ -38,8 +38,10 @@ module Clerk
38
38
  end
39
39
 
40
40
 
41
+
42
+
41
43
 
42
- def create(request: nil, retries: nil, timeout_ms: nil)
44
+ def create(request: nil, retries: nil, timeout_ms: nil, http_headers: nil)
43
45
  # create - Create an email address
44
46
  # Create a new email address
45
47
  url, params = @sdk_configuration.get_server_details
@@ -50,7 +52,7 @@ module Clerk
50
52
  req_content_type, data, form = Utils.serialize_request_body(request, false, true, :request, :json)
51
53
  headers['content-type'] = req_content_type
52
54
 
53
- if form
55
+ if form && !form.empty?
54
56
  body = Utils.encode_form(form)
55
57
  elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
56
58
  body = URI.encode_www_form(data)
@@ -100,6 +102,9 @@ module Clerk
100
102
  req.headers.merge!(headers)
101
103
  req.options.timeout = timeout unless timeout.nil?
102
104
  Utils.configure_request_security(req, security)
105
+ http_headers&.each do |key, value|
106
+ req.headers[key.to_s] = value
107
+ end
103
108
 
104
109
  @sdk_configuration.hooks.before_request(
105
110
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -156,7 +161,7 @@ module Clerk
156
161
  else
157
162
  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'
158
163
  end
159
- elsif Utils.match_status_code(http_response.status, ['400', '401', '403', '404', '422'])
164
+ elsif Utils.match_status_code(http_response.status, ['400', '401', '403', '404', '409', '422'])
160
165
  if Utils.match_content_type(content_type, 'application/json')
161
166
  http_response = @sdk_configuration.hooks.after_success(
162
167
  hook_ctx: SDKHooks::AfterSuccessHookContext.new(
@@ -183,7 +188,7 @@ module Clerk
183
188
 
184
189
 
185
190
 
186
- def get(email_address_id:, retries: nil, timeout_ms: nil)
191
+ def get(email_address_id:, retries: nil, timeout_ms: nil, http_headers: nil)
187
192
  # get - Retrieve an email address
188
193
  # Returns the details of an email address.
189
194
  request = Models::Operations::GetEmailAddressRequest.new(
@@ -241,6 +246,9 @@ module Clerk
241
246
  req.headers.merge!(headers)
242
247
  req.options.timeout = timeout unless timeout.nil?
243
248
  Utils.configure_request_security(req, security)
249
+ http_headers&.each do |key, value|
250
+ req.headers[key.to_s] = value
251
+ end
244
252
 
245
253
  @sdk_configuration.hooks.before_request(
246
254
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -324,7 +332,7 @@ module Clerk
324
332
 
325
333
 
326
334
 
327
- def delete(email_address_id:, retries: nil, timeout_ms: nil)
335
+ def delete(email_address_id:, retries: nil, timeout_ms: nil, http_headers: nil)
328
336
  # delete - Delete an email address
329
337
  # Delete the email address with the given ID
330
338
  request = Models::Operations::DeleteEmailAddressRequest.new(
@@ -382,6 +390,9 @@ module Clerk
382
390
  req.headers.merge!(headers)
383
391
  req.options.timeout = timeout unless timeout.nil?
384
392
  Utils.configure_request_security(req, security)
393
+ http_headers&.each do |key, value|
394
+ req.headers[key.to_s] = value
395
+ end
385
396
 
386
397
  @sdk_configuration.hooks.before_request(
387
398
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -465,7 +476,7 @@ module Clerk
465
476
 
466
477
 
467
478
 
468
- def update(email_address_id:, body: nil, retries: nil, timeout_ms: nil)
479
+ def update(email_address_id:, body: nil, retries: nil, timeout_ms: nil, http_headers: nil)
469
480
  # update - Update an email address
470
481
  # Updates an email address.
471
482
  request = Models::Operations::UpdateEmailAddressRequest.new(
@@ -485,7 +496,7 @@ module Clerk
485
496
  req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json)
486
497
  headers['content-type'] = req_content_type
487
498
 
488
- if form
499
+ if form && !form.empty?
489
500
  body = Utils.encode_form(form)
490
501
  elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
491
502
  body = URI.encode_www_form(data)
@@ -535,6 +546,9 @@ module Clerk
535
546
  req.headers.merge!(headers)
536
547
  req.options.timeout = timeout unless timeout.nil?
537
548
  Utils.configure_request_security(req, security)
549
+ http_headers&.each do |key, value|
550
+ req.headers[key.to_s] = value
551
+ end
538
552
 
539
553
  @sdk_configuration.hooks.before_request(
540
554
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -591,7 +605,7 @@ module Clerk
591
605
  else
592
606
  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'
593
607
  end
594
- elsif Utils.match_status_code(http_response.status, ['400', '401', '403', '404'])
608
+ elsif Utils.match_status_code(http_response.status, ['400', '401', '403', '404', '409'])
595
609
  if Utils.match_content_type(content_type, 'application/json')
596
610
  http_response = @sdk_configuration.hooks.after_success(
597
611
  hook_ctx: SDKHooks::AfterSuccessHookContext.new(
@@ -615,5 +629,5 @@ module Clerk
615
629
 
616
630
  end
617
631
  end
618
- end
632
+ end
619
633
  end