clerk-sdk-ruby 5.1.2 → 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 (155) hide show
  1. checksums.yaml +4 -4
  2. data/lib/clerk/actortokens.rb +11 -3
  3. data/lib/clerk/agenttasks.rb +335 -0
  4. data/lib/clerk/allowlistidentifiers.rb +15 -4
  5. data/lib/clerk/api_keys.rb +35 -9
  6. data/lib/clerk/betafeatures.rb +11 -3
  7. data/lib/clerk/billing.rb +43 -11
  8. data/lib/clerk/blocklistidentifiers.rb +15 -4
  9. data/lib/clerk/clients.rb +15 -4
  10. data/lib/clerk/domains.rb +19 -5
  11. data/lib/clerk/emailaddresses.rb +21 -7
  12. data/lib/clerk/emailandsmstemplates.rb +7 -2
  13. data/lib/clerk/emailsmstemplates.rb +19 -5
  14. data/lib/clerk/instancesettings.rb +299 -8
  15. data/lib/clerk/invitations.rb +19 -5
  16. data/lib/clerk/jwks.rb +7 -2
  17. data/lib/clerk/jwttemplates.rb +23 -6
  18. data/lib/clerk/m2m.rb +23 -5
  19. data/lib/clerk/machines.rb +39 -10
  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/adjustcreditbalancerequest.rb +48 -0
  24. data/lib/clerk/models/components/adjustcreditbalancerequest.rbi +21 -0
  25. data/lib/clerk/models/components/agenttask.rb +47 -0
  26. data/lib/clerk/models/components/agenttask.rbi +19 -0
  27. data/lib/clerk/models/components/agenttask_object.rb +19 -0
  28. data/lib/clerk/models/components/agenttask_object.rbi +11 -0
  29. data/lib/clerk/models/components/balance.rb +44 -0
  30. data/lib/clerk/models/components/balance.rbi +19 -0
  31. data/lib/clerk/models/components/billingpaymentattempt.rb +5 -1
  32. data/lib/clerk/models/components/billingpaymentattempt.rbi +2 -0
  33. data/lib/clerk/models/components/billingpaymentattempt_credits.rb +40 -0
  34. data/lib/clerk/models/components/billingpaymentattempt_credits.rbi +17 -0
  35. data/lib/clerk/models/components/billingpaymentattempt_payer.rb +36 -0
  36. data/lib/clerk/models/components/billingpaymentattempt_payer.rbi +15 -0
  37. data/lib/clerk/models/components/billingpaymentattempt_proration.rb +44 -0
  38. data/lib/clerk/models/components/billingpaymentattempt_proration.rbi +19 -0
  39. data/lib/clerk/models/components/billingpaymentattempt_totals.rb +52 -0
  40. data/lib/clerk/models/components/billingpaymentattempt_totals.rbi +23 -0
  41. data/lib/clerk/models/components/billingpriceresponse.rb +5 -1
  42. data/lib/clerk/models/components/billingpriceresponse.rbi +2 -0
  43. data/lib/clerk/models/components/billingstatement.rb +1 -1
  44. data/lib/clerk/models/components/{totals.rb → billingstatement_totals.rb} +6 -2
  45. data/lib/clerk/models/components/{totals.rbi → billingstatement_totals.rbi} +4 -2
  46. data/lib/clerk/models/components/commercecreditbalanceresponse.rb +36 -0
  47. data/lib/clerk/models/components/commercecreditbalanceresponse.rbi +15 -0
  48. data/lib/clerk/models/components/commercecreditledgerresponse.rb +64 -0
  49. data/lib/clerk/models/components/commercecreditledgerresponse.rbi +29 -0
  50. data/lib/clerk/models/components/commerceperunittotal.rb +40 -0
  51. data/lib/clerk/models/components/commerceperunittotal.rbi +17 -0
  52. data/lib/clerk/models/components/commerceperunittotaltier.rb +40 -0
  53. data/lib/clerk/models/components/commerceperunittotaltier.rbi +17 -0
  54. data/lib/clerk/models/components/commerceplan.rb +5 -1
  55. data/lib/clerk/models/components/commerceplan.rbi +2 -0
  56. data/lib/clerk/models/components/commerceplanunitprice.rb +40 -0
  57. data/lib/clerk/models/components/commerceplanunitprice.rbi +17 -0
  58. data/lib/clerk/models/components/commerceplanunitpricetier.rb +40 -0
  59. data/lib/clerk/models/components/commerceplanunitpricetier.rbi +17 -0
  60. data/lib/clerk/models/components/commercesubscriptionitem.rb +13 -1
  61. data/lib/clerk/models/components/commercesubscriptionitem.rbi +6 -0
  62. data/lib/clerk/models/components/commercesubscriptionitem_credits.rb +40 -0
  63. data/lib/clerk/models/components/commercesubscriptionitem_credits.rbi +17 -0
  64. data/lib/clerk/models/components/commercesubscriptionitem_payer.rb +36 -0
  65. data/lib/clerk/models/components/commercesubscriptionitem_payer.rbi +15 -0
  66. data/lib/clerk/models/components/commercesubscriptionitem_plan.rb +5 -1
  67. data/lib/clerk/models/components/commercesubscriptionitem_plan.rbi +2 -0
  68. data/lib/clerk/models/components/commercesubscriptionitem_proration.rb +44 -0
  69. data/lib/clerk/models/components/commercesubscriptionitem_proration.rbi +19 -0
  70. data/lib/clerk/models/components/commercesubscriptionitem_totals.rb +52 -0
  71. data/lib/clerk/models/components/commercesubscriptionitem_totals.rbi +23 -0
  72. data/lib/clerk/models/components/commercesubscriptionitem_totals_credits.rb +40 -0
  73. data/lib/clerk/models/components/commercesubscriptionitem_totals_credits.rbi +17 -0
  74. data/lib/clerk/models/components/commercesubscriptionitem_totals_payer.rb +36 -0
  75. data/lib/clerk/models/components/commercesubscriptionitem_totals_payer.rbi +15 -0
  76. data/lib/clerk/models/components/commercesubscriptionitem_totals_proration.rb +44 -0
  77. data/lib/clerk/models/components/commercesubscriptionitem_totals_proration.rbi +19 -0
  78. data/lib/clerk/models/components/oauthapplicationsettings.rb +40 -0
  79. data/lib/clerk/models/components/oauthapplicationsettings.rbi +17 -0
  80. data/lib/clerk/models/components/oauthapplicationsettings_object.rb +19 -0
  81. data/lib/clerk/models/components/oauthapplicationsettings_object.rbi +11 -0
  82. data/lib/clerk/models/components/schemas_commercesubscriptionitem.rb +1 -1
  83. data/lib/clerk/models/components/{payer.rb → schemas_commercesubscriptionitem_payer.rb} +1 -1
  84. data/lib/clerk/models/components/{payer.rbi → schemas_commercesubscriptionitem_payer.rbi} +2 -2
  85. data/lib/clerk/models/components/seats.rb +32 -0
  86. data/lib/clerk/models/components/seats.rbi +13 -0
  87. data/lib/clerk/models/components.rb +27 -2
  88. data/lib/clerk/models/operations/adjustorganizationbillingcreditbalance_request.rb +36 -0
  89. data/lib/clerk/models/operations/adjustorganizationbillingcreditbalance_request.rbi +15 -0
  90. data/lib/clerk/models/operations/adjustorganizationbillingcreditbalance_response.rb +44 -0
  91. data/lib/clerk/models/operations/adjustorganizationbillingcreditbalance_response.rbi +19 -0
  92. data/lib/clerk/models/operations/adjustuserbillingcreditbalance_request.rb +36 -0
  93. data/lib/clerk/models/operations/adjustuserbillingcreditbalance_request.rbi +15 -0
  94. data/lib/clerk/models/operations/adjustuserbillingcreditbalance_response.rb +44 -0
  95. data/lib/clerk/models/operations/adjustuserbillingcreditbalance_response.rbi +19 -0
  96. data/lib/clerk/models/operations/createagenttask_request.rb +60 -0
  97. data/lib/clerk/models/operations/createagenttask_request.rbi +23 -0
  98. data/lib/clerk/models/operations/createagenttask_response.rb +44 -0
  99. data/lib/clerk/models/operations/createagenttask_response.rbi +19 -0
  100. data/lib/clerk/models/operations/createm2mtoken_request.rb +5 -1
  101. data/lib/clerk/models/operations/createm2mtoken_request.rbi +2 -0
  102. data/lib/clerk/models/operations/getinstanceoauthapplicationsettings_response.rb +44 -0
  103. data/lib/clerk/models/operations/getinstanceoauthapplicationsettings_response.rbi +19 -0
  104. data/lib/clerk/models/operations/getorganizationbillingcreditbalance_request.rb +32 -0
  105. data/lib/clerk/models/operations/getorganizationbillingcreditbalance_request.rbi +13 -0
  106. data/lib/clerk/models/operations/getorganizationbillingcreditbalance_response.rb +44 -0
  107. data/lib/clerk/models/operations/getorganizationbillingcreditbalance_response.rbi +19 -0
  108. data/lib/clerk/models/operations/getuserbillingcreditbalance_request.rb +32 -0
  109. data/lib/clerk/models/operations/getuserbillingcreditbalance_request.rbi +13 -0
  110. data/lib/clerk/models/operations/getuserbillingcreditbalance_response.rb +44 -0
  111. data/lib/clerk/models/operations/getuserbillingcreditbalance_response.rbi +19 -0
  112. data/lib/clerk/models/operations/listinstanceorganizationinvitations_status.rb +1 -0
  113. data/lib/clerk/models/operations/listorganizationinvitations_status.rb +1 -0
  114. data/lib/clerk/models/operations/on_behalf_of.rb +37 -0
  115. data/lib/clerk/models/operations/on_behalf_of.rbi +15 -0
  116. data/lib/clerk/models/operations/permissions.rb +19 -0
  117. data/lib/clerk/models/operations/permissions.rbi +11 -0
  118. data/lib/clerk/models/operations/revokeagenttask_request.rb +32 -0
  119. data/lib/clerk/models/operations/revokeagenttask_request.rbi +13 -0
  120. data/lib/clerk/models/operations/revokeagenttask_response.rb +44 -0
  121. data/lib/clerk/models/operations/revokeagenttask_response.rbi +19 -0
  122. data/lib/clerk/models/operations/token_format.rb +20 -0
  123. data/lib/clerk/models/operations/token_format.rbi +11 -0
  124. data/lib/clerk/models/operations/updateinstanceoauthapplicationsettings_request.rb +36 -0
  125. data/lib/clerk/models/operations/updateinstanceoauthapplicationsettings_request.rbi +15 -0
  126. data/lib/clerk/models/operations/updateinstanceoauthapplicationsettings_response.rb +44 -0
  127. data/lib/clerk/models/operations/updateinstanceoauthapplicationsettings_response.rbi +19 -0
  128. data/lib/clerk/models/operations/usersgetorganizationinvitations_status.rb +1 -0
  129. data/lib/clerk/models/operations.rb +18 -0
  130. data/lib/clerk/oauthaccesstokens.rb +7 -2
  131. data/lib/clerk/oauthapplications.rb +27 -7
  132. data/lib/clerk/openapiclient.rb +4 -2
  133. data/lib/clerk/organizationdomains.rb +23 -6
  134. data/lib/clerk/organizationinvitations.rb +32 -9
  135. data/lib/clerk/organizationmemberships.rb +23 -6
  136. data/lib/clerk/organizationpermissions.rb +23 -6
  137. data/lib/clerk/organizationroles.rb +31 -8
  138. data/lib/clerk/organizations.rb +374 -11
  139. data/lib/clerk/phonenumbers.rb +19 -5
  140. data/lib/clerk/proxychecks.rb +7 -2
  141. data/lib/clerk/redirecturls.rb +19 -5
  142. data/lib/clerk/rolesets.rb +31 -8
  143. data/lib/clerk/samlconnections.rb +23 -6
  144. data/lib/clerk/sdkconfiguration.rb +3 -3
  145. data/lib/clerk/sessions.rb +35 -9
  146. data/lib/clerk/signintokens.rb +11 -3
  147. data/lib/clerk/signups.rb +11 -3
  148. data/lib/clerk/templates.rb +7 -2
  149. data/lib/clerk/testingtokens.rb +7 -2
  150. data/lib/clerk/users.rb +458 -32
  151. data/lib/clerk/waitlistentries.rb +27 -7
  152. data/lib/clerk/webhooks.rb +15 -4
  153. data/lib/clerk_sdk_ruby.rb +1 -0
  154. data/lib/crystalline/types.rb +11 -3
  155. metadata +107 -6
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.
@@ -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.
@@ -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.
@@ -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
@@ -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,8 +38,10 @@ 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.
@@ -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
@@ -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.
@@ -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.
@@ -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
@@ -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(
@@ -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
@@ -38,8 +38,10 @@ module Clerk
38
38
  end
39
39
 
40
40
 
41
+
42
+
41
43
 
42
- def upsert(template_type:, slug:, body: nil, retries: nil, timeout_ms: nil)
44
+ def upsert(template_type:, slug:, body: nil, retries: nil, timeout_ms: nil, http_headers: nil)
43
45
  # upsert - Update a template for a given type and slug
44
46
  # Updates the existing template of the given type and slug
45
47
  #
@@ -112,6 +114,9 @@ module Clerk
112
114
  req.headers.merge!(headers)
113
115
  req.options.timeout = timeout unless timeout.nil?
114
116
  Utils.configure_request_security(req, security)
117
+ http_headers&.each do |key, value|
118
+ req.headers[key.to_s] = value
119
+ end
115
120
 
116
121
  @sdk_configuration.hooks.before_request(
117
122
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -192,5 +197,5 @@ module Clerk
192
197
 
193
198
  end
194
199
  end
195
- end
200
+ end
196
201
  end
@@ -38,8 +38,10 @@ module Clerk
38
38
  end
39
39
 
40
40
 
41
+
42
+
41
43
 
42
- def list(template_type:, paginated: nil, limit: nil, offset: nil, retries: nil, timeout_ms: nil)
44
+ def list(template_type:, paginated: nil, limit: nil, offset: nil, retries: nil, timeout_ms: nil, http_headers: nil)
43
45
  # list - List all templates
44
46
  # Returns a list of all templates.
45
47
  # The templates are returned sorted by position.
@@ -105,6 +107,9 @@ module Clerk
105
107
  req.options.timeout = timeout unless timeout.nil?
106
108
  req.params = query_params
107
109
  Utils.configure_request_security(req, security)
110
+ http_headers&.each do |key, value|
111
+ req.headers[key.to_s] = value
112
+ end
108
113
 
109
114
  @sdk_configuration.hooks.before_request(
110
115
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -188,7 +193,7 @@ module Clerk
188
193
 
189
194
 
190
195
 
191
- def get(template_type:, slug:, retries: nil, timeout_ms: nil)
196
+ def get(template_type:, slug:, retries: nil, timeout_ms: nil, http_headers: nil)
192
197
  # get - Retrieve a template
193
198
  # Returns the details of a template
194
199
  #
@@ -249,6 +254,9 @@ module Clerk
249
254
  req.headers.merge!(headers)
250
255
  req.options.timeout = timeout unless timeout.nil?
251
256
  Utils.configure_request_security(req, security)
257
+ http_headers&.each do |key, value|
258
+ req.headers[key.to_s] = value
259
+ end
252
260
 
253
261
  @sdk_configuration.hooks.before_request(
254
262
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -332,7 +340,7 @@ module Clerk
332
340
 
333
341
 
334
342
 
335
- def revert(template_type:, slug:, retries: nil, timeout_ms: nil)
343
+ def revert(template_type:, slug:, retries: nil, timeout_ms: nil, http_headers: nil)
336
344
  # revert - Revert a template
337
345
  # Reverts an updated template to its default state
338
346
  #
@@ -393,6 +401,9 @@ module Clerk
393
401
  req.headers.merge!(headers)
394
402
  req.options.timeout = timeout unless timeout.nil?
395
403
  Utils.configure_request_security(req, security)
404
+ http_headers&.each do |key, value|
405
+ req.headers[key.to_s] = value
406
+ end
396
407
 
397
408
  @sdk_configuration.hooks.before_request(
398
409
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -476,7 +487,7 @@ module Clerk
476
487
 
477
488
 
478
489
 
479
- def toggle_template_delivery(template_type:, slug:, body: nil, retries: nil, timeout_ms: nil)
490
+ def toggle_template_delivery(template_type:, slug:, body: nil, retries: nil, timeout_ms: nil, http_headers: nil)
480
491
  # toggle_template_delivery - Toggle the delivery by Clerk for a template of a given type and slug
481
492
  # Toggles the delivery by Clerk for a template of a given type and slug.
482
493
  # If disabled, Clerk will not deliver the resulting email or SMS.
@@ -551,6 +562,9 @@ module Clerk
551
562
  req.headers.merge!(headers)
552
563
  req.options.timeout = timeout unless timeout.nil?
553
564
  Utils.configure_request_security(req, security)
565
+ http_headers&.each do |key, value|
566
+ req.headers[key.to_s] = value
567
+ end
554
568
 
555
569
  @sdk_configuration.hooks.before_request(
556
570
  hook_ctx: SDKHooks::BeforeRequestHookContext.new(
@@ -631,5 +645,5 @@ module Clerk
631
645
 
632
646
  end
633
647
  end
634
- end
648
+ end
635
649
  end