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.
- checksums.yaml +4 -4
- data/lib/clerk/actortokens.rb +11 -3
- data/lib/clerk/agenttasks.rb +335 -0
- data/lib/clerk/allowlistidentifiers.rb +15 -4
- data/lib/clerk/api_keys.rb +35 -9
- data/lib/clerk/betafeatures.rb +11 -3
- data/lib/clerk/billing.rb +43 -11
- data/lib/clerk/blocklistidentifiers.rb +15 -4
- data/lib/clerk/clients.rb +15 -4
- data/lib/clerk/domains.rb +19 -5
- data/lib/clerk/emailaddresses.rb +21 -7
- data/lib/clerk/emailandsmstemplates.rb +7 -2
- data/lib/clerk/emailsmstemplates.rb +19 -5
- data/lib/clerk/instancesettings.rb +299 -8
- data/lib/clerk/invitations.rb +19 -5
- data/lib/clerk/jwks.rb +7 -2
- data/lib/clerk/jwttemplates.rb +23 -6
- data/lib/clerk/m2m.rb +23 -5
- data/lib/clerk/machines.rb +39 -10
- data/lib/clerk/miscellaneous.rb +7 -2
- data/lib/clerk/models/components/action.rb +20 -0
- data/lib/clerk/models/components/action.rbi +11 -0
- data/lib/clerk/models/components/adjustcreditbalancerequest.rb +48 -0
- data/lib/clerk/models/components/adjustcreditbalancerequest.rbi +21 -0
- data/lib/clerk/models/components/agenttask.rb +47 -0
- data/lib/clerk/models/components/agenttask.rbi +19 -0
- data/lib/clerk/models/components/agenttask_object.rb +19 -0
- data/lib/clerk/models/components/agenttask_object.rbi +11 -0
- data/lib/clerk/models/components/balance.rb +44 -0
- data/lib/clerk/models/components/balance.rbi +19 -0
- data/lib/clerk/models/components/billingpaymentattempt.rb +5 -1
- data/lib/clerk/models/components/billingpaymentattempt.rbi +2 -0
- data/lib/clerk/models/components/billingpaymentattempt_credits.rb +40 -0
- data/lib/clerk/models/components/billingpaymentattempt_credits.rbi +17 -0
- data/lib/clerk/models/components/billingpaymentattempt_payer.rb +36 -0
- data/lib/clerk/models/components/billingpaymentattempt_payer.rbi +15 -0
- data/lib/clerk/models/components/billingpaymentattempt_proration.rb +44 -0
- data/lib/clerk/models/components/billingpaymentattempt_proration.rbi +19 -0
- data/lib/clerk/models/components/billingpaymentattempt_totals.rb +52 -0
- data/lib/clerk/models/components/billingpaymentattempt_totals.rbi +23 -0
- data/lib/clerk/models/components/billingpriceresponse.rb +5 -1
- data/lib/clerk/models/components/billingpriceresponse.rbi +2 -0
- data/lib/clerk/models/components/billingstatement.rb +1 -1
- data/lib/clerk/models/components/{totals.rb → billingstatement_totals.rb} +6 -2
- data/lib/clerk/models/components/{totals.rbi → billingstatement_totals.rbi} +4 -2
- data/lib/clerk/models/components/commercecreditbalanceresponse.rb +36 -0
- data/lib/clerk/models/components/commercecreditbalanceresponse.rbi +15 -0
- data/lib/clerk/models/components/commercecreditledgerresponse.rb +64 -0
- data/lib/clerk/models/components/commercecreditledgerresponse.rbi +29 -0
- data/lib/clerk/models/components/commerceperunittotal.rb +40 -0
- data/lib/clerk/models/components/commerceperunittotal.rbi +17 -0
- data/lib/clerk/models/components/commerceperunittotaltier.rb +40 -0
- data/lib/clerk/models/components/commerceperunittotaltier.rbi +17 -0
- data/lib/clerk/models/components/commerceplan.rb +5 -1
- data/lib/clerk/models/components/commerceplan.rbi +2 -0
- data/lib/clerk/models/components/commerceplanunitprice.rb +40 -0
- data/lib/clerk/models/components/commerceplanunitprice.rbi +17 -0
- data/lib/clerk/models/components/commerceplanunitpricetier.rb +40 -0
- data/lib/clerk/models/components/commerceplanunitpricetier.rbi +17 -0
- data/lib/clerk/models/components/commercesubscriptionitem.rb +13 -1
- data/lib/clerk/models/components/commercesubscriptionitem.rbi +6 -0
- data/lib/clerk/models/components/commercesubscriptionitem_credits.rb +40 -0
- data/lib/clerk/models/components/commercesubscriptionitem_credits.rbi +17 -0
- data/lib/clerk/models/components/commercesubscriptionitem_payer.rb +36 -0
- data/lib/clerk/models/components/commercesubscriptionitem_payer.rbi +15 -0
- data/lib/clerk/models/components/commercesubscriptionitem_plan.rb +5 -1
- data/lib/clerk/models/components/commercesubscriptionitem_plan.rbi +2 -0
- data/lib/clerk/models/components/commercesubscriptionitem_proration.rb +44 -0
- data/lib/clerk/models/components/commercesubscriptionitem_proration.rbi +19 -0
- data/lib/clerk/models/components/commercesubscriptionitem_totals.rb +52 -0
- data/lib/clerk/models/components/commercesubscriptionitem_totals.rbi +23 -0
- data/lib/clerk/models/components/commercesubscriptionitem_totals_credits.rb +40 -0
- data/lib/clerk/models/components/commercesubscriptionitem_totals_credits.rbi +17 -0
- data/lib/clerk/models/components/commercesubscriptionitem_totals_payer.rb +36 -0
- data/lib/clerk/models/components/commercesubscriptionitem_totals_payer.rbi +15 -0
- data/lib/clerk/models/components/commercesubscriptionitem_totals_proration.rb +44 -0
- data/lib/clerk/models/components/commercesubscriptionitem_totals_proration.rbi +19 -0
- data/lib/clerk/models/components/oauthapplicationsettings.rb +40 -0
- data/lib/clerk/models/components/oauthapplicationsettings.rbi +17 -0
- data/lib/clerk/models/components/oauthapplicationsettings_object.rb +19 -0
- data/lib/clerk/models/components/oauthapplicationsettings_object.rbi +11 -0
- data/lib/clerk/models/components/schemas_commercesubscriptionitem.rb +1 -1
- data/lib/clerk/models/components/{payer.rb → schemas_commercesubscriptionitem_payer.rb} +1 -1
- data/lib/clerk/models/components/{payer.rbi → schemas_commercesubscriptionitem_payer.rbi} +2 -2
- data/lib/clerk/models/components/seats.rb +32 -0
- data/lib/clerk/models/components/seats.rbi +13 -0
- data/lib/clerk/models/components.rb +27 -2
- data/lib/clerk/models/operations/adjustorganizationbillingcreditbalance_request.rb +36 -0
- data/lib/clerk/models/operations/adjustorganizationbillingcreditbalance_request.rbi +15 -0
- data/lib/clerk/models/operations/adjustorganizationbillingcreditbalance_response.rb +44 -0
- data/lib/clerk/models/operations/adjustorganizationbillingcreditbalance_response.rbi +19 -0
- data/lib/clerk/models/operations/adjustuserbillingcreditbalance_request.rb +36 -0
- data/lib/clerk/models/operations/adjustuserbillingcreditbalance_request.rbi +15 -0
- data/lib/clerk/models/operations/adjustuserbillingcreditbalance_response.rb +44 -0
- data/lib/clerk/models/operations/adjustuserbillingcreditbalance_response.rbi +19 -0
- data/lib/clerk/models/operations/createagenttask_request.rb +60 -0
- data/lib/clerk/models/operations/createagenttask_request.rbi +23 -0
- data/lib/clerk/models/operations/createagenttask_response.rb +44 -0
- data/lib/clerk/models/operations/createagenttask_response.rbi +19 -0
- data/lib/clerk/models/operations/createm2mtoken_request.rb +5 -1
- data/lib/clerk/models/operations/createm2mtoken_request.rbi +2 -0
- data/lib/clerk/models/operations/getinstanceoauthapplicationsettings_response.rb +44 -0
- data/lib/clerk/models/operations/getinstanceoauthapplicationsettings_response.rbi +19 -0
- data/lib/clerk/models/operations/getorganizationbillingcreditbalance_request.rb +32 -0
- data/lib/clerk/models/operations/getorganizationbillingcreditbalance_request.rbi +13 -0
- data/lib/clerk/models/operations/getorganizationbillingcreditbalance_response.rb +44 -0
- data/lib/clerk/models/operations/getorganizationbillingcreditbalance_response.rbi +19 -0
- data/lib/clerk/models/operations/getuserbillingcreditbalance_request.rb +32 -0
- data/lib/clerk/models/operations/getuserbillingcreditbalance_request.rbi +13 -0
- data/lib/clerk/models/operations/getuserbillingcreditbalance_response.rb +44 -0
- data/lib/clerk/models/operations/getuserbillingcreditbalance_response.rbi +19 -0
- data/lib/clerk/models/operations/listinstanceorganizationinvitations_status.rb +1 -0
- data/lib/clerk/models/operations/listorganizationinvitations_status.rb +1 -0
- data/lib/clerk/models/operations/on_behalf_of.rb +37 -0
- data/lib/clerk/models/operations/on_behalf_of.rbi +15 -0
- data/lib/clerk/models/operations/permissions.rb +19 -0
- data/lib/clerk/models/operations/permissions.rbi +11 -0
- data/lib/clerk/models/operations/revokeagenttask_request.rb +32 -0
- data/lib/clerk/models/operations/revokeagenttask_request.rbi +13 -0
- data/lib/clerk/models/operations/revokeagenttask_response.rb +44 -0
- data/lib/clerk/models/operations/revokeagenttask_response.rbi +19 -0
- data/lib/clerk/models/operations/token_format.rb +20 -0
- data/lib/clerk/models/operations/token_format.rbi +11 -0
- data/lib/clerk/models/operations/updateinstanceoauthapplicationsettings_request.rb +36 -0
- data/lib/clerk/models/operations/updateinstanceoauthapplicationsettings_request.rbi +15 -0
- data/lib/clerk/models/operations/updateinstanceoauthapplicationsettings_response.rb +44 -0
- data/lib/clerk/models/operations/updateinstanceoauthapplicationsettings_response.rbi +19 -0
- data/lib/clerk/models/operations/usersgetorganizationinvitations_status.rb +1 -0
- data/lib/clerk/models/operations.rb +18 -0
- data/lib/clerk/oauthaccesstokens.rb +7 -2
- data/lib/clerk/oauthapplications.rb +27 -7
- data/lib/clerk/openapiclient.rb +4 -2
- data/lib/clerk/organizationdomains.rb +23 -6
- data/lib/clerk/organizationinvitations.rb +32 -9
- data/lib/clerk/organizationmemberships.rb +23 -6
- data/lib/clerk/organizationpermissions.rb +23 -6
- data/lib/clerk/organizationroles.rb +31 -8
- data/lib/clerk/organizations.rb +374 -11
- data/lib/clerk/phonenumbers.rb +19 -5
- data/lib/clerk/proxychecks.rb +7 -2
- data/lib/clerk/redirecturls.rb +19 -5
- data/lib/clerk/rolesets.rb +31 -8
- data/lib/clerk/samlconnections.rb +23 -6
- data/lib/clerk/sdkconfiguration.rb +3 -3
- data/lib/clerk/sessions.rb +35 -9
- data/lib/clerk/signintokens.rb +11 -3
- data/lib/clerk/signups.rb +11 -3
- data/lib/clerk/templates.rb +7 -2
- data/lib/clerk/testingtokens.rb +7 -2
- data/lib/clerk/users.rb +458 -32
- data/lib/clerk/waitlistentries.rb +27 -7
- data/lib/clerk/webhooks.rb +15 -4
- data/lib/clerk_sdk_ruby.rb +1 -0
- data/lib/crystalline/types.rb +11 -3
- metadata +107 -6
data/lib/clerk/organizations.rb
CHANGED
|
@@ -38,8 +38,10 @@ module Clerk
|
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
|
|
41
|
+
|
|
42
|
+
|
|
41
43
|
|
|
42
|
-
def list(request:, retries: nil, timeout_ms: nil)
|
|
44
|
+
def list(request:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
43
45
|
# list - Get a list of organizations for an instance
|
|
44
46
|
# This request returns the list of organizations for an instance.
|
|
45
47
|
# Results can be paginated using the optional `limit` and `offset` query parameters.
|
|
@@ -94,6 +96,9 @@ module Clerk
|
|
|
94
96
|
req.options.timeout = timeout unless timeout.nil?
|
|
95
97
|
req.params = query_params
|
|
96
98
|
Utils.configure_request_security(req, security)
|
|
99
|
+
http_headers&.each do |key, value|
|
|
100
|
+
req.headers[key.to_s] = value
|
|
101
|
+
end
|
|
97
102
|
|
|
98
103
|
@sdk_configuration.hooks.before_request(
|
|
99
104
|
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
@@ -177,7 +182,7 @@ module Clerk
|
|
|
177
182
|
|
|
178
183
|
|
|
179
184
|
|
|
180
|
-
def create(request: nil, retries: nil, timeout_ms: nil)
|
|
185
|
+
def create(request: nil, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
181
186
|
# create - Create an organization
|
|
182
187
|
# Creates a new organization with the given name for an instance.
|
|
183
188
|
# You can specify an optional slug for the new organization.
|
|
@@ -247,6 +252,9 @@ module Clerk
|
|
|
247
252
|
req.headers.merge!(headers)
|
|
248
253
|
req.options.timeout = timeout unless timeout.nil?
|
|
249
254
|
Utils.configure_request_security(req, security)
|
|
255
|
+
http_headers&.each do |key, value|
|
|
256
|
+
req.headers[key.to_s] = value
|
|
257
|
+
end
|
|
250
258
|
|
|
251
259
|
@sdk_configuration.hooks.before_request(
|
|
252
260
|
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
@@ -330,7 +338,7 @@ module Clerk
|
|
|
330
338
|
|
|
331
339
|
|
|
332
340
|
|
|
333
|
-
def get(organization_id:, include_members_count: nil, include_missing_member_with_elevated_permissions: nil, retries: nil, timeout_ms: nil)
|
|
341
|
+
def get(organization_id:, include_members_count: nil, include_missing_member_with_elevated_permissions: nil, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
334
342
|
# get - Retrieve an organization by ID or slug
|
|
335
343
|
# Fetches the organization whose ID or slug matches the provided `id_or_slug` URL query parameter.
|
|
336
344
|
request = Models::Operations::GetOrganizationRequest.new(
|
|
@@ -392,6 +400,9 @@ module Clerk
|
|
|
392
400
|
req.options.timeout = timeout unless timeout.nil?
|
|
393
401
|
req.params = query_params
|
|
394
402
|
Utils.configure_request_security(req, security)
|
|
403
|
+
http_headers&.each do |key, value|
|
|
404
|
+
req.headers[key.to_s] = value
|
|
405
|
+
end
|
|
395
406
|
|
|
396
407
|
@sdk_configuration.hooks.before_request(
|
|
397
408
|
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
@@ -475,7 +486,7 @@ module Clerk
|
|
|
475
486
|
|
|
476
487
|
|
|
477
488
|
|
|
478
|
-
def update(body:, organization_id:, retries: nil, timeout_ms: nil)
|
|
489
|
+
def update(body:, organization_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
479
490
|
# update - Update an organization
|
|
480
491
|
# Updates an existing organization
|
|
481
492
|
request = Models::Operations::UpdateOrganizationRequest.new(
|
|
@@ -546,6 +557,9 @@ module Clerk
|
|
|
546
557
|
req.headers.merge!(headers)
|
|
547
558
|
req.options.timeout = timeout unless timeout.nil?
|
|
548
559
|
Utils.configure_request_security(req, security)
|
|
560
|
+
http_headers&.each do |key, value|
|
|
561
|
+
req.headers[key.to_s] = value
|
|
562
|
+
end
|
|
549
563
|
|
|
550
564
|
@sdk_configuration.hooks.before_request(
|
|
551
565
|
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
@@ -602,7 +616,7 @@ module Clerk
|
|
|
602
616
|
else
|
|
603
617
|
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'
|
|
604
618
|
end
|
|
605
|
-
elsif Utils.match_status_code(http_response.status, ['402', '403', '404', '422'])
|
|
619
|
+
elsif Utils.match_status_code(http_response.status, ['400', '402', '403', '404', '422'])
|
|
606
620
|
if Utils.match_content_type(content_type, 'application/json')
|
|
607
621
|
http_response = @sdk_configuration.hooks.after_success(
|
|
608
622
|
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
@@ -629,7 +643,7 @@ module Clerk
|
|
|
629
643
|
|
|
630
644
|
|
|
631
645
|
|
|
632
|
-
def delete(organization_id:, retries: nil, timeout_ms: nil)
|
|
646
|
+
def delete(organization_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
633
647
|
# delete - Delete an organization
|
|
634
648
|
# Deletes the given organization.
|
|
635
649
|
# Please note that deleting an organization will also delete all memberships and invitations.
|
|
@@ -692,6 +706,9 @@ module Clerk
|
|
|
692
706
|
req.headers.merge!(headers)
|
|
693
707
|
req.options.timeout = timeout unless timeout.nil?
|
|
694
708
|
Utils.configure_request_security(req, security)
|
|
709
|
+
http_headers&.each do |key, value|
|
|
710
|
+
req.headers[key.to_s] = value
|
|
711
|
+
end
|
|
695
712
|
|
|
696
713
|
@sdk_configuration.hooks.before_request(
|
|
697
714
|
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
@@ -775,7 +792,7 @@ module Clerk
|
|
|
775
792
|
|
|
776
793
|
|
|
777
794
|
|
|
778
|
-
def merge_metadata(body:, organization_id:, retries: nil, timeout_ms: nil)
|
|
795
|
+
def merge_metadata(body:, organization_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
779
796
|
# merge_metadata - Merge and update metadata for an organization
|
|
780
797
|
# Update organization metadata attributes by merging existing values with the provided parameters.
|
|
781
798
|
# Metadata values will be updated via a deep merge.
|
|
@@ -849,6 +866,9 @@ module Clerk
|
|
|
849
866
|
req.headers.merge!(headers)
|
|
850
867
|
req.options.timeout = timeout unless timeout.nil?
|
|
851
868
|
Utils.configure_request_security(req, security)
|
|
869
|
+
http_headers&.each do |key, value|
|
|
870
|
+
req.headers[key.to_s] = value
|
|
871
|
+
end
|
|
852
872
|
|
|
853
873
|
@sdk_configuration.hooks.before_request(
|
|
854
874
|
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
@@ -932,7 +952,7 @@ module Clerk
|
|
|
932
952
|
|
|
933
953
|
|
|
934
954
|
|
|
935
|
-
def upload_logo(organization_id:, body: nil, retries: nil, timeout_ms: nil)
|
|
955
|
+
def upload_logo(organization_id:, body: nil, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
936
956
|
# upload_logo - Upload a logo for the organization
|
|
937
957
|
# Set or replace an organization's logo, by uploading an image file.
|
|
938
958
|
# This endpoint uses the `multipart/form-data` request content type and accepts a file of image type.
|
|
@@ -1005,6 +1025,9 @@ module Clerk
|
|
|
1005
1025
|
req.headers.merge!(headers)
|
|
1006
1026
|
req.options.timeout = timeout unless timeout.nil?
|
|
1007
1027
|
Utils.configure_request_security(req, security)
|
|
1028
|
+
http_headers&.each do |key, value|
|
|
1029
|
+
req.headers[key.to_s] = value
|
|
1030
|
+
end
|
|
1008
1031
|
|
|
1009
1032
|
@sdk_configuration.hooks.before_request(
|
|
1010
1033
|
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
@@ -1088,7 +1111,7 @@ module Clerk
|
|
|
1088
1111
|
|
|
1089
1112
|
|
|
1090
1113
|
|
|
1091
|
-
def delete_logo(organization_id:, retries: nil, timeout_ms: nil)
|
|
1114
|
+
def delete_logo(organization_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
1092
1115
|
# delete_logo - Delete the organization's logo.
|
|
1093
1116
|
# Delete the organization's logo.
|
|
1094
1117
|
request = Models::Operations::DeleteOrganizationLogoRequest.new(
|
|
@@ -1146,6 +1169,9 @@ module Clerk
|
|
|
1146
1169
|
req.headers.merge!(headers)
|
|
1147
1170
|
req.options.timeout = timeout unless timeout.nil?
|
|
1148
1171
|
Utils.configure_request_security(req, security)
|
|
1172
|
+
http_headers&.each do |key, value|
|
|
1173
|
+
req.headers[key.to_s] = value
|
|
1174
|
+
end
|
|
1149
1175
|
|
|
1150
1176
|
@sdk_configuration.hooks.before_request(
|
|
1151
1177
|
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
@@ -1229,7 +1255,7 @@ module Clerk
|
|
|
1229
1255
|
|
|
1230
1256
|
|
|
1231
1257
|
|
|
1232
|
-
def get_billing_subscription(organization_id:, retries: nil, timeout_ms: nil)
|
|
1258
|
+
def get_billing_subscription(organization_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
1233
1259
|
# get_billing_subscription - Retrieve an organization's billing subscription
|
|
1234
1260
|
# Retrieves the billing subscription for the specified organization.
|
|
1235
1261
|
# This includes subscription details, active plans, billing information, and payment status.
|
|
@@ -1289,6 +1315,9 @@ module Clerk
|
|
|
1289
1315
|
req.headers.merge!(headers)
|
|
1290
1316
|
req.options.timeout = timeout unless timeout.nil?
|
|
1291
1317
|
Utils.configure_request_security(req, security)
|
|
1318
|
+
http_headers&.each do |key, value|
|
|
1319
|
+
req.headers[key.to_s] = value
|
|
1320
|
+
end
|
|
1292
1321
|
|
|
1293
1322
|
@sdk_configuration.hooks.before_request(
|
|
1294
1323
|
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
@@ -1384,5 +1413,339 @@ module Clerk
|
|
|
1384
1413
|
|
|
1385
1414
|
end
|
|
1386
1415
|
end
|
|
1387
|
-
|
|
1416
|
+
|
|
1417
|
+
|
|
1418
|
+
|
|
1419
|
+
def get_billing_credit_balance(organization_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
1420
|
+
# get_billing_credit_balance - Retrieve an organization's credit balance
|
|
1421
|
+
# Retrieves the current credit balance for the specified organization.
|
|
1422
|
+
# Credits can be applied during checkout to reduce the charge or automatically applied to upcoming recurring charges.
|
|
1423
|
+
request = Models::Operations::GetOrganizationBillingCreditBalanceRequest.new(
|
|
1424
|
+
organization_id: organization_id
|
|
1425
|
+
)
|
|
1426
|
+
url, params = @sdk_configuration.get_server_details
|
|
1427
|
+
base_url = Utils.template_url(url, params)
|
|
1428
|
+
url = Utils.generate_url(
|
|
1429
|
+
Models::Operations::GetOrganizationBillingCreditBalanceRequest,
|
|
1430
|
+
base_url,
|
|
1431
|
+
'/organizations/{organization_id}/billing/credits',
|
|
1432
|
+
request
|
|
1433
|
+
)
|
|
1434
|
+
headers = {}
|
|
1435
|
+
|
|
1436
|
+
headers['Accept'] = 'application/json'
|
|
1437
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
1438
|
+
retries ||= @sdk_configuration.retry_config
|
|
1439
|
+
retries ||= Utils::RetryConfig.new(
|
|
1440
|
+
backoff: Utils::BackoffStrategy.new(
|
|
1441
|
+
exponent: 1.5,
|
|
1442
|
+
initial_interval: 500,
|
|
1443
|
+
max_elapsed_time: 3_600_000,
|
|
1444
|
+
max_interval: 60_000
|
|
1445
|
+
),
|
|
1446
|
+
retry_connection_errors: true,
|
|
1447
|
+
strategy: 'backoff'
|
|
1448
|
+
)
|
|
1449
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
|
1450
|
+
retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
|
|
1451
|
+
|
|
1452
|
+
security = @sdk_configuration.security_source&.call
|
|
1453
|
+
|
|
1454
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
1455
|
+
timeout ||= @sdk_configuration.timeout
|
|
1456
|
+
|
|
1457
|
+
|
|
1458
|
+
connection = @sdk_configuration.client.dup
|
|
1459
|
+
connection.request :retry, retry_options
|
|
1460
|
+
|
|
1461
|
+
hook_ctx = SDKHooks::HookContext.new(
|
|
1462
|
+
config: @sdk_configuration,
|
|
1463
|
+
base_url: base_url,
|
|
1464
|
+
oauth2_scopes: nil,
|
|
1465
|
+
operation_id: 'GetOrganizationBillingCreditBalance',
|
|
1466
|
+
security_source: @sdk_configuration.security_source
|
|
1467
|
+
)
|
|
1468
|
+
|
|
1469
|
+
error = nil
|
|
1470
|
+
http_response = nil
|
|
1471
|
+
|
|
1472
|
+
|
|
1473
|
+
begin
|
|
1474
|
+
http_response = connection.get(url) do |req|
|
|
1475
|
+
req.headers.merge!(headers)
|
|
1476
|
+
req.options.timeout = timeout unless timeout.nil?
|
|
1477
|
+
Utils.configure_request_security(req, security)
|
|
1478
|
+
http_headers&.each do |key, value|
|
|
1479
|
+
req.headers[key.to_s] = value
|
|
1480
|
+
end
|
|
1481
|
+
|
|
1482
|
+
@sdk_configuration.hooks.before_request(
|
|
1483
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
1484
|
+
hook_ctx: hook_ctx
|
|
1485
|
+
),
|
|
1486
|
+
request: req
|
|
1487
|
+
)
|
|
1488
|
+
end
|
|
1489
|
+
rescue StandardError => e
|
|
1490
|
+
error = e
|
|
1491
|
+
ensure
|
|
1492
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
1493
|
+
http_response = @sdk_configuration.hooks.after_error(
|
|
1494
|
+
error: error,
|
|
1495
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
|
1496
|
+
hook_ctx: hook_ctx
|
|
1497
|
+
),
|
|
1498
|
+
response: http_response
|
|
1499
|
+
)
|
|
1500
|
+
else
|
|
1501
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
1502
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
1503
|
+
hook_ctx: hook_ctx
|
|
1504
|
+
),
|
|
1505
|
+
response: http_response
|
|
1506
|
+
)
|
|
1507
|
+
end
|
|
1508
|
+
|
|
1509
|
+
if http_response.nil?
|
|
1510
|
+
raise error if !error.nil?
|
|
1511
|
+
raise 'no response'
|
|
1512
|
+
end
|
|
1513
|
+
end
|
|
1514
|
+
|
|
1515
|
+
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
1516
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
|
1517
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
1518
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
1519
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
1520
|
+
hook_ctx: hook_ctx
|
|
1521
|
+
),
|
|
1522
|
+
response: http_response
|
|
1523
|
+
)
|
|
1524
|
+
response_data = http_response.env.response_body
|
|
1525
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::CommerceCreditBalanceResponse)
|
|
1526
|
+
response = Models::Operations::GetOrganizationBillingCreditBalanceResponse.new(
|
|
1527
|
+
status_code: http_response.status,
|
|
1528
|
+
content_type: content_type,
|
|
1529
|
+
raw_response: http_response,
|
|
1530
|
+
commerce_credit_balance_response: obj
|
|
1531
|
+
)
|
|
1532
|
+
|
|
1533
|
+
return response
|
|
1534
|
+
else
|
|
1535
|
+
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'
|
|
1536
|
+
end
|
|
1537
|
+
elsif Utils.match_status_code(http_response.status, ['400', '401', '403', '404', '422'])
|
|
1538
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
1539
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
1540
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
1541
|
+
hook_ctx: hook_ctx
|
|
1542
|
+
),
|
|
1543
|
+
response: http_response
|
|
1544
|
+
)
|
|
1545
|
+
response_data = http_response.env.response_body
|
|
1546
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
1547
|
+
obj.raw_response = http_response
|
|
1548
|
+
raise obj
|
|
1549
|
+
else
|
|
1550
|
+
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'
|
|
1551
|
+
end
|
|
1552
|
+
elsif Utils.match_status_code(http_response.status, ['500'])
|
|
1553
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
1554
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
1555
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
1556
|
+
hook_ctx: hook_ctx
|
|
1557
|
+
),
|
|
1558
|
+
response: http_response
|
|
1559
|
+
)
|
|
1560
|
+
response_data = http_response.env.response_body
|
|
1561
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
1562
|
+
obj.raw_response = http_response
|
|
1563
|
+
raise obj
|
|
1564
|
+
else
|
|
1565
|
+
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'
|
|
1566
|
+
end
|
|
1567
|
+
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
|
1568
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
1569
|
+
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
|
1570
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
1571
|
+
else
|
|
1572
|
+
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'
|
|
1573
|
+
|
|
1574
|
+
end
|
|
1575
|
+
end
|
|
1576
|
+
|
|
1577
|
+
|
|
1578
|
+
|
|
1579
|
+
def adjust_billing_credit_balance(body:, organization_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
1580
|
+
# adjust_billing_credit_balance - Adjust an organization's credit balance
|
|
1581
|
+
# Increases or decreases the credit balance for the specified organization.
|
|
1582
|
+
# Each adjustment is recorded as a ledger entry. The idempotency_key parameter
|
|
1583
|
+
# ensures that duplicate requests are safely handled.
|
|
1584
|
+
request = Models::Operations::AdjustOrganizationBillingCreditBalanceRequest.new(
|
|
1585
|
+
organization_id: organization_id,
|
|
1586
|
+
body: body
|
|
1587
|
+
)
|
|
1588
|
+
url, params = @sdk_configuration.get_server_details
|
|
1589
|
+
base_url = Utils.template_url(url, params)
|
|
1590
|
+
url = Utils.generate_url(
|
|
1591
|
+
Models::Operations::AdjustOrganizationBillingCreditBalanceRequest,
|
|
1592
|
+
base_url,
|
|
1593
|
+
'/organizations/{organization_id}/billing/credits',
|
|
1594
|
+
request
|
|
1595
|
+
)
|
|
1596
|
+
headers = {}
|
|
1597
|
+
|
|
1598
|
+
req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json)
|
|
1599
|
+
headers['content-type'] = req_content_type
|
|
1600
|
+
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
|
1601
|
+
|
|
1602
|
+
if form && !form.empty?
|
|
1603
|
+
body = Utils.encode_form(form)
|
|
1604
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
|
1605
|
+
body = URI.encode_www_form(data)
|
|
1606
|
+
else
|
|
1607
|
+
body = data
|
|
1608
|
+
end
|
|
1609
|
+
headers['Accept'] = 'application/json'
|
|
1610
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
1611
|
+
retries ||= @sdk_configuration.retry_config
|
|
1612
|
+
retries ||= Utils::RetryConfig.new(
|
|
1613
|
+
backoff: Utils::BackoffStrategy.new(
|
|
1614
|
+
exponent: 1.5,
|
|
1615
|
+
initial_interval: 500,
|
|
1616
|
+
max_elapsed_time: 3_600_000,
|
|
1617
|
+
max_interval: 60_000
|
|
1618
|
+
),
|
|
1619
|
+
retry_connection_errors: true,
|
|
1620
|
+
strategy: 'backoff'
|
|
1621
|
+
)
|
|
1622
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
|
1623
|
+
retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
|
|
1624
|
+
|
|
1625
|
+
security = @sdk_configuration.security_source&.call
|
|
1626
|
+
|
|
1627
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
1628
|
+
timeout ||= @sdk_configuration.timeout
|
|
1629
|
+
|
|
1630
|
+
|
|
1631
|
+
connection = @sdk_configuration.client.dup
|
|
1632
|
+
connection.request :retry, retry_options
|
|
1633
|
+
|
|
1634
|
+
hook_ctx = SDKHooks::HookContext.new(
|
|
1635
|
+
config: @sdk_configuration,
|
|
1636
|
+
base_url: base_url,
|
|
1637
|
+
oauth2_scopes: nil,
|
|
1638
|
+
operation_id: 'AdjustOrganizationBillingCreditBalance',
|
|
1639
|
+
security_source: @sdk_configuration.security_source
|
|
1640
|
+
)
|
|
1641
|
+
|
|
1642
|
+
error = nil
|
|
1643
|
+
http_response = nil
|
|
1644
|
+
|
|
1645
|
+
|
|
1646
|
+
begin
|
|
1647
|
+
http_response = connection.post(url) do |req|
|
|
1648
|
+
req.body = body
|
|
1649
|
+
req.headers.merge!(headers)
|
|
1650
|
+
req.options.timeout = timeout unless timeout.nil?
|
|
1651
|
+
Utils.configure_request_security(req, security)
|
|
1652
|
+
http_headers&.each do |key, value|
|
|
1653
|
+
req.headers[key.to_s] = value
|
|
1654
|
+
end
|
|
1655
|
+
|
|
1656
|
+
@sdk_configuration.hooks.before_request(
|
|
1657
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
1658
|
+
hook_ctx: hook_ctx
|
|
1659
|
+
),
|
|
1660
|
+
request: req
|
|
1661
|
+
)
|
|
1662
|
+
end
|
|
1663
|
+
rescue StandardError => e
|
|
1664
|
+
error = e
|
|
1665
|
+
ensure
|
|
1666
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
1667
|
+
http_response = @sdk_configuration.hooks.after_error(
|
|
1668
|
+
error: error,
|
|
1669
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
|
1670
|
+
hook_ctx: hook_ctx
|
|
1671
|
+
),
|
|
1672
|
+
response: http_response
|
|
1673
|
+
)
|
|
1674
|
+
else
|
|
1675
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
1676
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
1677
|
+
hook_ctx: hook_ctx
|
|
1678
|
+
),
|
|
1679
|
+
response: http_response
|
|
1680
|
+
)
|
|
1681
|
+
end
|
|
1682
|
+
|
|
1683
|
+
if http_response.nil?
|
|
1684
|
+
raise error if !error.nil?
|
|
1685
|
+
raise 'no response'
|
|
1686
|
+
end
|
|
1687
|
+
end
|
|
1688
|
+
|
|
1689
|
+
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
1690
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
|
1691
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
1692
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
1693
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
1694
|
+
hook_ctx: hook_ctx
|
|
1695
|
+
),
|
|
1696
|
+
response: http_response
|
|
1697
|
+
)
|
|
1698
|
+
response_data = http_response.env.response_body
|
|
1699
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::CommerceCreditLedgerResponse)
|
|
1700
|
+
response = Models::Operations::AdjustOrganizationBillingCreditBalanceResponse.new(
|
|
1701
|
+
status_code: http_response.status,
|
|
1702
|
+
content_type: content_type,
|
|
1703
|
+
raw_response: http_response,
|
|
1704
|
+
commerce_credit_ledger_response: obj
|
|
1705
|
+
)
|
|
1706
|
+
|
|
1707
|
+
return response
|
|
1708
|
+
else
|
|
1709
|
+
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'
|
|
1710
|
+
end
|
|
1711
|
+
elsif Utils.match_status_code(http_response.status, ['400', '401', '403', '404', '409', '422'])
|
|
1712
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
1713
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
1714
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
1715
|
+
hook_ctx: hook_ctx
|
|
1716
|
+
),
|
|
1717
|
+
response: http_response
|
|
1718
|
+
)
|
|
1719
|
+
response_data = http_response.env.response_body
|
|
1720
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
1721
|
+
obj.raw_response = http_response
|
|
1722
|
+
raise obj
|
|
1723
|
+
else
|
|
1724
|
+
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'
|
|
1725
|
+
end
|
|
1726
|
+
elsif Utils.match_status_code(http_response.status, ['500'])
|
|
1727
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
1728
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
1729
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
1730
|
+
hook_ctx: hook_ctx
|
|
1731
|
+
),
|
|
1732
|
+
response: http_response
|
|
1733
|
+
)
|
|
1734
|
+
response_data = http_response.env.response_body
|
|
1735
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
1736
|
+
obj.raw_response = http_response
|
|
1737
|
+
raise obj
|
|
1738
|
+
else
|
|
1739
|
+
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'
|
|
1740
|
+
end
|
|
1741
|
+
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
|
1742
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
1743
|
+
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
|
1744
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
1745
|
+
else
|
|
1746
|
+
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'
|
|
1747
|
+
|
|
1748
|
+
end
|
|
1749
|
+
end
|
|
1750
|
+
end
|
|
1388
1751
|
end
|
data/lib/clerk/phonenumbers.rb
CHANGED
|
@@ -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 a phone number
|
|
44
46
|
# Create a new phone number
|
|
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(
|
|
@@ -183,7 +188,7 @@ module Clerk
|
|
|
183
188
|
|
|
184
189
|
|
|
185
190
|
|
|
186
|
-
def get(phone_number_id:, retries: nil, timeout_ms: nil)
|
|
191
|
+
def get(phone_number_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
187
192
|
# get - Retrieve a phone number
|
|
188
193
|
# Returns the details of a phone number
|
|
189
194
|
request = Models::Operations::GetPhoneNumberRequest.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(phone_number_id:, retries: nil, timeout_ms: nil)
|
|
335
|
+
def delete(phone_number_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
328
336
|
# delete - Delete a phone number
|
|
329
337
|
# Delete the phone number with the given ID
|
|
330
338
|
request = Models::Operations::DeletePhoneNumberRequest.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(phone_number_id:, body: nil, retries: nil, timeout_ms: nil)
|
|
479
|
+
def update(phone_number_id:, body: nil, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
469
480
|
# update - Update a phone number
|
|
470
481
|
# Updates a phone number
|
|
471
482
|
request = Models::Operations::UpdatePhoneNumberRequest.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(
|
|
@@ -615,5 +629,5 @@ module Clerk
|
|
|
615
629
|
|
|
616
630
|
end
|
|
617
631
|
end
|
|
618
|
-
|
|
632
|
+
end
|
|
619
633
|
end
|
data/lib/clerk/proxychecks.rb
CHANGED
|
@@ -38,8 +38,10 @@ module Clerk
|
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
|
|
41
|
+
|
|
42
|
+
|
|
41
43
|
|
|
42
|
-
def verify(request: nil, retries: nil, timeout_ms: nil)
|
|
44
|
+
def verify(request: nil, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
43
45
|
# verify - Verify the proxy configuration for your domain
|
|
44
46
|
# This endpoint can be used to validate that a proxy-enabled domain is operational.
|
|
45
47
|
# It tries to verify that the proxy URL provided in the parameters maps to a functional proxy that can reach the Clerk Frontend API.
|
|
@@ -107,6 +109,9 @@ module Clerk
|
|
|
107
109
|
req.headers.merge!(headers)
|
|
108
110
|
req.options.timeout = timeout unless timeout.nil?
|
|
109
111
|
Utils.configure_request_security(req, security)
|
|
112
|
+
http_headers&.each do |key, value|
|
|
113
|
+
req.headers[key.to_s] = value
|
|
114
|
+
end
|
|
110
115
|
|
|
111
116
|
@sdk_configuration.hooks.before_request(
|
|
112
117
|
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
@@ -187,5 +192,5 @@ module Clerk
|
|
|
187
192
|
|
|
188
193
|
end
|
|
189
194
|
end
|
|
190
|
-
|
|
195
|
+
end
|
|
191
196
|
end
|