clerk-sdk-ruby 7.0.0 → 8.0.1
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 -11
- data/lib/clerk/admin_portal_link_tokens.rb +10 -10
- data/lib/clerk/agenttasks.rb +10 -10
- data/lib/clerk/allowlistidentifiers.rb +15 -15
- data/lib/clerk/api_keys.rb +40 -40
- data/lib/clerk/betafeatures.rb +10 -10
- data/lib/clerk/billing.rb +388 -52
- data/lib/clerk/blocklistidentifiers.rb +15 -15
- data/lib/clerk/clients.rb +15 -15
- data/lib/clerk/directories.rb +1534 -0
- data/lib/clerk/domains.rb +27 -24
- data/lib/clerk/emailaddresses.rb +43 -36
- data/lib/clerk/emailandsmstemplates.rb +6 -6
- data/lib/clerk/emailsmstemplates.rb +21 -21
- data/lib/clerk/enterpriseconnections.rb +35 -35
- data/lib/clerk/instancesettings.rb +60 -60
- data/lib/clerk/invitations.rb +20 -20
- data/lib/clerk/jwks.rb +5 -5
- data/lib/clerk/jwttemplates.rb +25 -25
- data/lib/clerk/m2m.rb +20 -20
- data/lib/clerk/machines.rb +45 -45
- data/lib/clerk/miscellaneous.rb +5 -5
- data/lib/clerk/models/components/amount_off.rb +44 -0
- data/lib/clerk/models/components/{schemas_commerceplan_fee.rbi → amount_off.rbi} +2 -2
- data/lib/clerk/models/components/applycommercediscountrequest.rb +32 -0
- data/lib/clerk/models/components/applycommercediscountrequest.rbi +13 -0
- data/lib/clerk/models/components/automation_disposition.rb +21 -0
- data/lib/clerk/models/components/automation_disposition.rbi +11 -0
- data/lib/clerk/models/components/billingpaymentattempt_totals.rb +1 -1
- data/lib/clerk/models/components/billingstatement.rb +1 -1
- data/lib/clerk/models/components/{group.rb → billingstatement_group.rb} +1 -1
- data/lib/clerk/models/components/{group.rbi → billingstatement_group.rbi} +2 -2
- data/lib/clerk/models/components/biometriccredential.rb +72 -0
- data/lib/clerk/models/components/biometriccredential.rbi +33 -0
- data/lib/clerk/models/components/biometriccredential_algorithm.rb +19 -0
- data/lib/clerk/models/components/biometriccredential_algorithm.rbi +11 -0
- data/lib/clerk/models/components/biometriccredential_list.rb +36 -0
- data/lib/clerk/models/components/biometriccredential_list.rbi +15 -0
- data/lib/clerk/models/components/biometriccredential_object.rb +19 -0
- data/lib/clerk/models/components/biometriccredential_object.rbi +11 -0
- data/lib/clerk/models/components/biometriccredential_platform.rb +20 -0
- data/lib/clerk/models/components/biometriccredential_platform.rbi +11 -0
- data/lib/clerk/models/components/biometriccredential_status.rb +20 -0
- data/lib/clerk/models/components/biometriccredential_status.rbi +11 -0
- data/lib/clerk/models/components/clerkerror.rb +1 -1
- data/lib/clerk/models/components/commercecreditledgerresponse.rb +3 -7
- data/lib/clerk/models/components/commercecreditledgerresponse.rbi +0 -2
- data/lib/clerk/models/components/commercediscountredemptionresponse.rb +93 -0
- data/lib/clerk/models/components/commercediscountredemptionresponse.rbi +43 -0
- data/lib/clerk/models/components/commercediscountredemptionresponse_amount.rb +45 -0
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_amount.rbi → commercediscountredemptionresponse_amount.rbi} +2 -2
- data/lib/clerk/models/components/commercediscountredemptionresponse_object.rb +19 -0
- data/lib/clerk/models/components/commercediscountredemptionresponse_object.rbi +11 -0
- data/lib/clerk/models/components/commercediscountredemptionresponse_status.rb +21 -0
- data/lib/clerk/models/components/commercediscountredemptionresponse_status.rbi +11 -0
- data/lib/clerk/models/components/{schemas_commerceperunittotal.rb → commerceperunittotal_2.rb} +2 -2
- data/lib/clerk/models/components/{schemas_commerceperunittotal.rbi → commerceperunittotal_2.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commerceperunittotaltier.rb → commerceperunittotaltier_2.rb} +1 -1
- data/lib/clerk/models/components/{schemas_commerceperunittotaltier.rbi → commerceperunittotaltier_2.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commerceplan.rb → commerceplan_2.rb} +6 -6
- data/lib/clerk/models/components/{schemas_commerceplan.rbi → commerceplan_2.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commerceplan_fee.rb → commerceplan_2_annual_fee.rb} +1 -1
- data/lib/clerk/models/components/{schemas_commerceplan_annual_fee.rbi → commerceplan_2_annual_fee.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_fee.rb → commerceplan_2_annual_monthly_fee.rb} +1 -1
- data/lib/clerk/models/components/{schemas_commerceplan_annual_monthly_fee.rbi → commerceplan_2_annual_monthly_fee.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commerceplan_annual_fee.rb → commerceplan_2_fee.rb} +1 -1
- data/lib/clerk/models/components/commerceplan_2_fee.rbi +19 -0
- data/lib/clerk/models/components/{schemas_commerceplan_object.rb → commerceplan_2_object.rb} +2 -2
- data/lib/clerk/models/components/commerceplan_2_object.rbi +11 -0
- data/lib/clerk/models/components/commercepricetransitiondetails.rb +1 -1
- data/lib/clerk/models/components/commercepricetransitionresponse.rb +1 -1
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem.rb → commercesubscriptionitem_2.rb} +7 -7
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem.rbi → commercesubscriptionitem_2.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_amount.rb → commercesubscriptionitem_2_amount.rb} +1 -1
- data/lib/clerk/models/components/commercesubscriptionitem_2_amount.rbi +19 -0
- data/lib/clerk/models/components/{schemas_commerceplan_annual_monthly_fee.rb → commercesubscriptionitem_2_annual_fee.rb} +1 -1
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_fee.rbi → commercesubscriptionitem_2_annual_fee.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_annual_fee.rb → commercesubscriptionitem_2_annual_monthly_fee.rb} +1 -1
- data/lib/clerk/models/components/commercesubscriptionitem_2_annual_monthly_fee.rbi +19 -0
- data/lib/clerk/models/components/commercesubscriptionitem_2_fee.rb +44 -0
- data/lib/clerk/models/components/commercesubscriptionitem_2_fee.rbi +19 -0
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment.rb → commercesubscriptionitem_2_next_payment.rb} +3 -3
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment.rbi → commercesubscriptionitem_2_next_payment.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_amount.rb → commercesubscriptionitem_2_next_payment_amount.rb} +1 -1
- data/lib/clerk/models/components/commercesubscriptionitem_2_next_payment_amount.rbi +19 -0
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_credits.rb → commercesubscriptionitem_2_next_payment_credits.rb} +3 -3
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_credits.rbi → commercesubscriptionitem_2_next_payment_credits.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_credits_proration.rb → commercesubscriptionitem_2_next_payment_credits_proration.rb} +1 -1
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_credits_proration.rbi → commercesubscriptionitem_2_next_payment_credits_proration.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_discounts.rb → commercesubscriptionitem_2_next_payment_discounts.rb} +2 -2
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_discounts.rbi → commercesubscriptionitem_2_next_payment_discounts.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_discounts_proration.rb → commercesubscriptionitem_2_next_payment_discounts_proration.rb} +1 -1
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_discounts_proration.rbi → commercesubscriptionitem_2_next_payment_discounts_proration.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_payer.rb → commercesubscriptionitem_2_next_payment_payer.rb} +1 -1
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_payer.rbi → commercesubscriptionitem_2_next_payment_payer.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_totals.rb → commercesubscriptionitem_2_next_payment_totals.rb} +3 -3
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_totals.rbi → commercesubscriptionitem_2_next_payment_totals.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_object_commercepayer.rb → commercesubscriptionitem_2_object_commercepayer.rb} +2 -2
- data/lib/clerk/models/components/commercesubscriptionitem_2_object_commercepayer.rbi +11 -0
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_object_commerceplan.rb → commercesubscriptionitem_2_object_commerceplan.rb} +2 -2
- data/lib/clerk/models/components/commercesubscriptionitem_2_object_commerceplan.rbi +11 -0
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_object_commercesubscriptionitem.rb → commercesubscriptionitem_2_object_commercesubscriptionitem.rb} +2 -2
- data/lib/clerk/models/components/commercesubscriptionitem_2_object_commercesubscriptionitem.rbi +11 -0
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_plan.rb → commercesubscriptionitem_2_plan.rb} +6 -6
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_plan.rbi → commercesubscriptionitem_2_plan.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_plan_period.rb → commercesubscriptionitem_2_plan_period.rb} +2 -2
- data/lib/clerk/models/components/commercesubscriptionitem_2_plan_period.rbi +11 -0
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_status.rb → commercesubscriptionitem_2_status.rb} +2 -2
- data/lib/clerk/models/components/commercesubscriptionitem_2_status.rbi +11 -0
- data/lib/clerk/models/components/commercesubscriptionitem_totals.rb +1 -1
- data/lib/clerk/models/components/commercesubscriptionnextpayment.rb +1 -1
- data/lib/clerk/models/components/commercesubscriptionnextpayment_totals.rb +1 -1
- data/lib/clerk/models/components/createbillingpricerequest.rb +2 -2
- data/lib/clerk/models/components/directory.rb +80 -0
- data/lib/clerk/models/components/directory.rbi +37 -0
- data/lib/clerk/models/components/directory_custom_attribute.rb +52 -0
- data/lib/clerk/models/components/{custom_attribute.rbi → directory_custom_attribute.rbi} +4 -2
- data/lib/clerk/models/components/directory_group.rb +36 -0
- data/lib/clerk/models/components/directory_group.rbi +15 -0
- data/lib/clerk/models/components/directory_list.rb +36 -0
- data/lib/clerk/models/components/directory_list.rbi +15 -0
- data/lib/clerk/models/components/directory_object.rb +19 -0
- data/lib/clerk/models/components/{samlaccount_meta.rbi → directory_object.rbi} +2 -2
- data/lib/clerk/models/components/directorygrouprolemapping.rb +76 -0
- data/lib/clerk/models/components/directorygrouprolemapping.rbi +35 -0
- data/lib/clerk/models/components/directorygrouprolemapping_deleted.rb +43 -0
- data/lib/clerk/models/components/directorygrouprolemapping_deleted.rbi +17 -0
- data/lib/clerk/models/components/directorygrouprolemapping_deleted_object.rb +19 -0
- data/lib/clerk/models/components/directorygrouprolemapping_deleted_object.rbi +11 -0
- data/lib/clerk/models/components/directorygrouprolemapping_list.rb +36 -0
- data/lib/clerk/models/components/directorygrouprolemapping_list.rbi +15 -0
- data/lib/clerk/models/components/directorygrouprolemapping_object.rb +19 -0
- data/lib/clerk/models/components/directorygrouprolemapping_object.rbi +11 -0
- data/lib/clerk/models/components/dnstarget.rb +49 -0
- data/lib/clerk/models/components/dnstarget.rbi +21 -0
- data/lib/clerk/models/components/domain.rb +7 -2
- data/lib/clerk/models/components/domain.rbi +2 -0
- data/lib/clerk/models/components/effect.rb +20 -0
- data/lib/clerk/models/components/{clerkerror_meta.rbi → effect.rbi} +2 -2
- data/lib/clerk/models/components/emailaddress_verification_saml_clerkerror.rb +1 -1
- data/lib/clerk/models/components/enrollment_mode.rb +1 -0
- data/lib/clerk/models/components/enterpriseaccount_verification_oauth_clerkerror.rb +1 -1
- data/lib/clerk/models/components/enterpriseaccount_verification_saml_clerkerror.rb +1 -1
- data/lib/clerk/models/components/enterpriseconnection.rb +6 -2
- data/lib/clerk/models/components/enterpriseconnection.rbi +2 -0
- data/lib/clerk/models/components/{custom_attribute.rb → enterpriseconnection_custom_attribute.rb} +6 -2
- data/lib/clerk/models/components/enterpriseconnection_custom_attribute.rbi +23 -0
- data/lib/clerk/models/components/enterpriseconnection_mode.rb +21 -0
- data/lib/clerk/models/components/enterpriseconnection_mode.rbi +11 -0
- data/lib/clerk/models/components/enterpriseconnection_object.rb +19 -0
- data/lib/clerk/models/components/enterpriseconnection_object.rbi +11 -0
- data/lib/clerk/models/components/enterpriseconnection_saml_connection.rb +5 -1
- data/lib/clerk/models/components/enterpriseconnection_saml_connection.rbi +2 -0
- data/lib/clerk/models/components/externalaccountwithverification_verification_oauth_clerkerror.rb +1 -1
- data/lib/clerk/models/components/{schemas_featureresponse.rb → featureresponse_2.rb} +2 -2
- data/lib/clerk/models/components/{schemas_featureresponse.rbi → featureresponse_2.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_featureresponse_object.rb → featureresponse_2_object.rb} +2 -2
- data/lib/clerk/models/components/featureresponse_2_object.rbi +11 -0
- data/lib/clerk/models/components/instance.rb +13 -1
- data/lib/clerk/models/components/instance.rbi +6 -0
- data/lib/clerk/models/components/instanceprotect.rb +14 -2
- data/lib/clerk/models/components/instanceprotect.rbi +6 -0
- data/lib/clerk/models/components/instancesettings.rb +4 -1
- data/lib/clerk/models/components/level.rb +21 -0
- data/lib/clerk/models/components/{clerkerrors_meta.rbi → level.rbi} +2 -2
- data/lib/clerk/models/components/login_hint.rb +36 -0
- data/lib/clerk/models/components/login_hint.rbi +15 -0
- data/lib/clerk/models/components/oauthapplication.rb +7 -2
- data/lib/clerk/models/components/oauthapplication.rbi +2 -0
- data/lib/clerk/models/components/oauthapplicationsettings.rb +26 -1
- data/lib/clerk/models/components/oauthapplicationsettings.rbi +12 -0
- data/lib/clerk/models/components/oauthapplicationwithsecret.rb +7 -2
- data/lib/clerk/models/components/oauthapplicationwithsecret.rbi +2 -0
- data/lib/clerk/models/components/organization.rb +6 -1
- data/lib/clerk/models/components/organization.rbi +2 -0
- data/lib/clerk/models/components/organizationmembership_organization.rb +6 -1
- data/lib/clerk/models/components/organizationmembership_organization.rbi +2 -0
- data/lib/clerk/models/components/organizationmembershippublicuserdata.rb +5 -1
- data/lib/clerk/models/components/organizationmembershippublicuserdata.rbi +2 -0
- data/lib/clerk/models/components/organizationwithlogo.rb +6 -1
- data/lib/clerk/models/components/organizationwithlogo.rbi +2 -0
- data/lib/clerk/models/components/payer_commercepayer.rb +1 -1
- data/lib/clerk/models/components/payment_type.rb +1 -0
- data/lib/clerk/models/components/record_type.rb +20 -0
- data/lib/clerk/models/components/record_type.rbi +11 -0
- data/lib/clerk/models/components/reverification.rb +74 -0
- data/lib/clerk/models/components/reverification.rbi +31 -0
- data/lib/clerk/models/components/reverification_object.rb +20 -0
- data/lib/clerk/models/components/reverification_object.rbi +11 -0
- data/lib/clerk/models/components/reverification_status.rb +21 -0
- data/lib/clerk/models/components/reverification_status.rbi +11 -0
- data/lib/clerk/models/components/samlaccount_clerkerror.rb +1 -1
- data/lib/clerk/models/components/samlconnection_1.rb +15 -1
- data/lib/clerk/models/components/samlconnection_1.rbi +6 -0
- data/lib/clerk/models/components/samlconnection_2.rb +15 -1
- data/lib/clerk/models/components/samlconnection_2.rbi +6 -0
- data/lib/clerk/models/components/samlconnectionloginhint.rb +36 -0
- data/lib/clerk/models/components/samlconnectionloginhint.rbi +15 -0
- data/lib/clerk/models/components/samlconnectionloginhint_mode.rb +21 -0
- data/lib/clerk/models/components/samlconnectionloginhint_mode.rbi +11 -0
- data/lib/clerk/models/components/scim_group.rb +36 -0
- data/lib/clerk/models/components/scim_group.rbi +15 -0
- data/lib/clerk/models/components/scimdirectory.rb +80 -0
- data/lib/clerk/models/components/scimdirectory.rbi +37 -0
- data/lib/clerk/models/components/scimdirectory_custom_attribute.rb +52 -0
- data/lib/clerk/models/components/scimdirectory_custom_attribute.rbi +23 -0
- data/lib/clerk/models/components/scimdirectory_list.rb +36 -0
- data/lib/clerk/models/components/scimdirectory_list.rbi +15 -0
- data/lib/clerk/models/components/scimdirectory_object.rb +19 -0
- data/lib/clerk/models/components/scimdirectory_object.rbi +11 -0
- data/lib/clerk/models/components/scimgrouprolemapping.rb +76 -0
- data/lib/clerk/models/components/scimgrouprolemapping.rbi +35 -0
- data/lib/clerk/models/components/scimgrouprolemapping_deleted.rb +43 -0
- data/lib/clerk/models/components/scimgrouprolemapping_deleted.rbi +17 -0
- data/lib/clerk/models/components/scimgrouprolemapping_deleted_object.rb +19 -0
- data/lib/clerk/models/components/scimgrouprolemapping_deleted_object.rbi +11 -0
- data/lib/clerk/models/components/scimgrouprolemapping_list.rb +36 -0
- data/lib/clerk/models/components/scimgrouprolemapping_list.rbi +15 -0
- data/lib/clerk/models/components/scimgrouprolemapping_object.rb +19 -0
- data/lib/clerk/models/components/scimgrouprolemapping_object.rbi +11 -0
- data/lib/clerk/models/components/scimusermetadata.rb +64 -0
- data/lib/clerk/models/components/scimusermetadata.rbi +27 -0
- data/lib/clerk/models/components/scimusermetadata_group.rb +36 -0
- data/lib/clerk/models/components/scimusermetadata_group.rbi +15 -0
- data/lib/clerk/models/components/seats.rb +1 -1
- data/lib/clerk/models/components/source.rb +21 -0
- data/lib/clerk/models/components/source.rbi +11 -0
- data/lib/clerk/models/components/trusteddevice.rb +72 -0
- data/lib/clerk/models/components/trusteddevice.rbi +33 -0
- data/lib/clerk/models/components/trusteddevice_algorithm.rb +19 -0
- data/lib/clerk/models/components/trusteddevice_algorithm.rbi +11 -0
- data/lib/clerk/models/components/trusteddevice_list.rb +36 -0
- data/lib/clerk/models/components/trusteddevice_list.rbi +15 -0
- data/lib/clerk/models/components/trusteddevice_object.rb +19 -0
- data/lib/clerk/models/components/trusteddevice_object.rbi +11 -0
- data/lib/clerk/models/components/trusteddevice_platform.rb +20 -0
- data/lib/clerk/models/components/trusteddevice_platform.rbi +11 -0
- data/lib/clerk/models/components/trusteddevice_status.rb +20 -0
- data/lib/clerk/models/components/trusteddevice_status.rbi +11 -0
- data/lib/clerk/models/components/user.rb +16 -3
- data/lib/clerk/models/components/user.rbi +4 -0
- data/lib/clerk/models/components/user_directory.rb +65 -0
- data/lib/clerk/models/components/user_directory.rbi +27 -0
- data/lib/clerk/models/components/user_scim.rb +27 -6
- data/lib/clerk/models/components/user_scim.rbi +10 -0
- data/lib/clerk/models/components/verification_from_oauth_clerkerror.rb +1 -1
- data/lib/clerk/models/components/verification_google_one_tap_clerkerror.rb +1 -1
- data/lib/clerk/models/components.rb +85 -39
- data/lib/clerk/models/errors/clerkerrors.rb +1 -1
- data/lib/clerk/models/operations/adddomain_request.rb +3 -6
- data/lib/clerk/models/operations/applybillingsubscriptionitemdiscount_request.rb +36 -0
- data/lib/clerk/models/operations/applybillingsubscriptionitemdiscount_request.rbi +15 -0
- data/lib/clerk/models/operations/applybillingsubscriptionitemdiscount_response.rb +44 -0
- data/lib/clerk/models/operations/applybillingsubscriptionitemdiscount_response.rbi +19 -0
- data/lib/clerk/models/operations/clerkidpoauthaccesstoken.rb +5 -1
- data/lib/clerk/models/operations/clerkidpoauthaccesstoken.rbi +2 -0
- data/lib/clerk/models/operations/createdirectory_group_role_mapping.rb +52 -0
- data/lib/clerk/models/operations/createdirectory_group_role_mapping.rbi +23 -0
- data/lib/clerk/models/operations/createdirectory_request.rb +44 -0
- data/lib/clerk/models/operations/createdirectory_request.rbi +19 -0
- data/lib/clerk/models/operations/createdirectory_response.rb +44 -0
- data/lib/clerk/models/operations/createdirectory_response.rbi +19 -0
- data/lib/clerk/models/operations/createdirectorygrouprolemapping_request.rb +36 -0
- data/lib/clerk/models/operations/createdirectorygrouprolemapping_request.rbi +15 -0
- data/lib/clerk/models/operations/createdirectorygrouprolemapping_requestbody.rb +46 -0
- data/lib/clerk/models/operations/createdirectorygrouprolemapping_requestbody.rbi +19 -0
- data/lib/clerk/models/operations/createdirectorygrouprolemapping_response.rb +44 -0
- data/lib/clerk/models/operations/createdirectorygrouprolemapping_response.rbi +19 -0
- data/lib/clerk/models/operations/createemailaddress_request.rb +7 -1
- data/lib/clerk/models/operations/createemailaddress_request.rbi +2 -0
- data/lib/clerk/models/operations/createenterpriseconnection_custom_attribute.rb +5 -1
- data/lib/clerk/models/operations/createenterpriseconnection_custom_attribute.rbi +2 -0
- data/lib/clerk/models/operations/createenterpriseconnection_login_hint.rb +36 -0
- data/lib/clerk/models/operations/createenterpriseconnection_login_hint.rbi +15 -0
- data/lib/clerk/models/operations/createenterpriseconnection_mode.rb +21 -0
- data/lib/clerk/models/operations/createenterpriseconnection_mode.rbi +11 -0
- data/lib/clerk/models/operations/createenterpriseconnection_saml.rb +5 -1
- data/lib/clerk/models/operations/createenterpriseconnection_saml.rbi +2 -0
- data/lib/clerk/models/operations/createoauthapplication_request.rb +6 -2
- data/lib/clerk/models/operations/createoauthapplication_request.rbi +2 -0
- data/lib/clerk/models/operations/createorganizationdomain_requestbody.rb +1 -1
- data/lib/clerk/models/operations/createsamlconnection_login_hint_1.rb +36 -0
- data/lib/clerk/models/operations/createsamlconnection_login_hint_1.rbi +15 -0
- data/lib/clerk/models/operations/createsamlconnection_login_hint_2.rb +36 -0
- data/lib/clerk/models/operations/createsamlconnection_login_hint_2.rbi +15 -0
- data/lib/clerk/models/operations/createsamlconnection_mode_1.rb +21 -0
- data/lib/clerk/models/operations/createsamlconnection_mode_1.rbi +11 -0
- data/lib/clerk/models/operations/createsamlconnection_mode_2.rb +21 -0
- data/lib/clerk/models/operations/createsamlconnection_mode_2.rbi +11 -0
- data/lib/clerk/models/operations/createsamlconnection_requestbody_1.rb +5 -1
- data/lib/clerk/models/operations/createsamlconnection_requestbody_1.rbi +2 -0
- data/lib/clerk/models/operations/createsamlconnection_requestbody_2.rb +5 -1
- data/lib/clerk/models/operations/createsamlconnection_requestbody_2.rbi +2 -0
- data/lib/clerk/models/operations/createscimdirectory_group_role_mapping.rb +44 -0
- data/lib/clerk/models/operations/createscimdirectory_group_role_mapping.rbi +19 -0
- data/lib/clerk/models/operations/createscimdirectory_request.rb +44 -0
- data/lib/clerk/models/operations/createscimdirectory_request.rbi +19 -0
- data/lib/clerk/models/operations/createscimdirectory_response.rb +44 -0
- data/lib/clerk/models/operations/createscimdirectory_response.rbi +19 -0
- data/lib/clerk/models/operations/createscimgrouprolemapping_request.rb +36 -0
- data/lib/clerk/models/operations/createscimgrouprolemapping_request.rbi +15 -0
- data/lib/clerk/models/operations/createscimgrouprolemapping_requestbody.rb +42 -0
- data/lib/clerk/models/operations/createscimgrouprolemapping_requestbody.rbi +17 -0
- data/lib/clerk/models/operations/createscimgrouprolemapping_response.rb +44 -0
- data/lib/clerk/models/operations/createscimgrouprolemapping_response.rbi +19 -0
- data/lib/clerk/models/operations/createsignintoken_request.rb +6 -1
- data/lib/clerk/models/operations/createsignintoken_request.rbi +2 -0
- data/lib/clerk/models/operations/createuser_request.rb +8 -2
- data/lib/clerk/models/operations/createuser_request.rbi +2 -0
- data/lib/clerk/models/operations/deletedirectory_request.rb +32 -0
- data/lib/clerk/models/operations/deletedirectory_request.rbi +13 -0
- data/lib/clerk/models/operations/deletedirectory_response.rb +44 -0
- data/lib/clerk/models/operations/deletedirectory_response.rbi +19 -0
- data/lib/clerk/models/operations/deletedirectorygrouprolemapping_request.rb +36 -0
- data/lib/clerk/models/operations/deletedirectorygrouprolemapping_request.rbi +15 -0
- data/lib/clerk/models/operations/deletedirectorygrouprolemapping_response.rb +44 -0
- data/lib/clerk/models/operations/deletedirectorygrouprolemapping_response.rbi +19 -0
- data/lib/clerk/models/operations/deletedomain_request.rb +1 -1
- data/lib/clerk/models/operations/deletescimdirectory_request.rb +32 -0
- data/lib/clerk/models/operations/deletescimdirectory_request.rbi +13 -0
- data/lib/clerk/models/operations/deletescimdirectory_response.rb +44 -0
- data/lib/clerk/models/operations/deletescimdirectory_response.rbi +19 -0
- data/lib/clerk/models/operations/deletescimgrouprolemapping_request.rb +36 -0
- data/lib/clerk/models/operations/deletescimgrouprolemapping_request.rbi +15 -0
- data/lib/clerk/models/operations/deletescimgrouprolemapping_response.rb +44 -0
- data/lib/clerk/models/operations/deletescimgrouprolemapping_response.rbi +19 -0
- data/lib/clerk/models/operations/enrollment_mode.rb +5 -0
- data/lib/clerk/models/operations/extendbillingsubscriptionitemfreetrial_response.rb +4 -4
- data/lib/clerk/models/operations/extendbillingsubscriptionitemfreetrial_response.rbi +2 -2
- data/lib/clerk/models/operations/getdirectory_request.rb +32 -0
- data/lib/clerk/models/operations/getdirectory_request.rbi +13 -0
- data/lib/clerk/models/operations/getdirectory_response.rb +44 -0
- data/lib/clerk/models/operations/getdirectory_response.rbi +19 -0
- data/lib/clerk/models/operations/getreverification_request.rb +36 -0
- data/lib/clerk/models/operations/getreverification_request.rbi +15 -0
- data/lib/clerk/models/operations/getreverification_response.rb +44 -0
- data/lib/clerk/models/operations/getreverification_response.rbi +19 -0
- data/lib/clerk/models/operations/getscimdirectory_request.rb +32 -0
- data/lib/clerk/models/operations/getscimdirectory_request.rbi +13 -0
- data/lib/clerk/models/operations/getscimdirectory_response.rb +44 -0
- data/lib/clerk/models/operations/getscimdirectory_response.rbi +19 -0
- data/lib/clerk/models/operations/getuserlist_request.rb +13 -1
- data/lib/clerk/models/operations/getuserlist_request.rbi +2 -0
- data/lib/clerk/models/operations/listallorganizationdomains_request.rb +2 -1
- data/lib/clerk/models/operations/listdirectories_request.rb +39 -0
- data/lib/clerk/models/operations/listdirectories_request.rbi +15 -0
- data/lib/clerk/models/operations/listdirectories_response.rb +44 -0
- data/lib/clerk/models/operations/listdirectories_response.rbi +19 -0
- data/lib/clerk/models/operations/listdirectorygrouprolemappings_request.rb +32 -0
- data/lib/clerk/models/operations/listdirectorygrouprolemappings_request.rbi +13 -0
- data/lib/clerk/models/operations/listdirectorygrouprolemappings_response.rb +44 -0
- data/lib/clerk/models/operations/listdirectorygrouprolemappings_response.rbi +19 -0
- data/lib/clerk/models/operations/listoauthapplications_request.rb +2 -0
- data/lib/clerk/models/operations/listorganizationdomains_request.rb +2 -1
- data/lib/clerk/models/operations/listscimdirectories_request.rb +39 -0
- data/lib/clerk/models/operations/listscimdirectories_request.rbi +15 -0
- data/lib/clerk/models/operations/listscimdirectories_response.rb +44 -0
- data/lib/clerk/models/operations/listscimdirectories_response.rbi +19 -0
- data/lib/clerk/models/operations/listscimgrouprolemappings_request.rb +32 -0
- data/lib/clerk/models/operations/listscimgrouprolemappings_request.rbi +13 -0
- data/lib/clerk/models/operations/listscimgrouprolemappings_response.rb +44 -0
- data/lib/clerk/models/operations/listscimgrouprolemappings_response.rbi +19 -0
- data/lib/clerk/models/operations/listuserbiometriccredentials_request.rb +32 -0
- data/lib/clerk/models/operations/listuserbiometriccredentials_request.rbi +13 -0
- data/lib/clerk/models/operations/listuserbiometriccredentials_response.rb +44 -0
- data/lib/clerk/models/operations/listuserbiometriccredentials_response.rbi +19 -0
- data/lib/clerk/models/operations/listusertrusteddevices_request.rb +32 -0
- data/lib/clerk/models/operations/listusertrusteddevices_request.rbi +13 -0
- data/lib/clerk/models/operations/listusertrusteddevices_response.rb +44 -0
- data/lib/clerk/models/operations/listusertrusteddevices_response.rbi +19 -0
- data/lib/clerk/models/operations/removebillingsubscriptionitemdiscount_request.rb +36 -0
- data/lib/clerk/models/operations/removebillingsubscriptionitemdiscount_request.rbi +15 -0
- data/lib/clerk/models/operations/removebillingsubscriptionitemdiscount_response.rb +44 -0
- data/lib/clerk/models/operations/removebillingsubscriptionitemdiscount_response.rbi +19 -0
- data/lib/clerk/models/operations/removeuserpassword_request.rb +36 -0
- data/lib/clerk/models/operations/removeuserpassword_request.rbi +15 -0
- data/lib/clerk/models/operations/removeuserpassword_requestbody.rb +32 -0
- data/lib/clerk/models/operations/removeuserpassword_requestbody.rbi +13 -0
- data/lib/clerk/models/operations/removeuserpassword_response.rb +44 -0
- data/lib/clerk/models/operations/removeuserpassword_response.rbi +19 -0
- data/lib/clerk/models/operations/replacedirectorygrouprolemappings_mapping.rb +40 -0
- data/lib/clerk/models/operations/replacedirectorygrouprolemappings_mapping.rbi +17 -0
- data/lib/clerk/models/operations/replacedirectorygrouprolemappings_request.rb +36 -0
- data/lib/clerk/models/operations/replacedirectorygrouprolemappings_request.rbi +15 -0
- data/lib/clerk/models/operations/replacedirectorygrouprolemappings_requestbody.rb +32 -0
- data/lib/clerk/models/operations/replacedirectorygrouprolemappings_requestbody.rbi +13 -0
- data/lib/clerk/models/operations/replacedirectorygrouprolemappings_response.rb +44 -0
- data/lib/clerk/models/operations/replacedirectorygrouprolemappings_response.rbi +19 -0
- data/lib/clerk/models/operations/replacescimgrouprolemappings_mapping.rb +36 -0
- data/lib/clerk/models/operations/replacescimgrouprolemappings_mapping.rbi +15 -0
- data/lib/clerk/models/operations/replacescimgrouprolemappings_request.rb +36 -0
- data/lib/clerk/models/operations/replacescimgrouprolemappings_request.rbi +15 -0
- data/lib/clerk/models/operations/replacescimgrouprolemappings_requestbody.rb +32 -0
- data/lib/clerk/models/operations/replacescimgrouprolemappings_requestbody.rbi +13 -0
- data/lib/clerk/models/operations/replacescimgrouprolemappings_response.rb +44 -0
- data/lib/clerk/models/operations/replacescimgrouprolemappings_response.rbi +19 -0
- data/lib/clerk/models/operations/replaceuseremailaddress_identification_status.rb +10 -2
- data/lib/clerk/models/operations/replaceuseremailaddress_requestbody.rb +16 -3
- data/lib/clerk/models/operations/replaceuseremailaddress_requestbody.rbi +2 -0
- data/lib/clerk/models/operations/replaceuserphonenumber_identification_status.rb +10 -2
- data/lib/clerk/models/operations/replaceuserphonenumber_requestbody.rb +9 -2
- data/lib/clerk/models/operations/revokeoauthapplicationtoken_request.rb +36 -0
- data/lib/clerk/models/operations/revokeoauthapplicationtoken_request.rbi +15 -0
- data/lib/clerk/models/operations/revokeoauthapplicationtoken_requestbody.rb +32 -0
- data/lib/clerk/models/operations/revokeoauthapplicationtoken_requestbody.rbi +13 -0
- data/lib/clerk/models/operations/revokeoauthapplicationtoken_response.rb +40 -0
- data/lib/clerk/models/operations/revokeoauthapplicationtoken_response.rbi +17 -0
- data/lib/clerk/models/operations/revokeuserbiometriccredential_request.rb +36 -0
- data/lib/clerk/models/operations/revokeuserbiometriccredential_request.rbi +15 -0
- data/lib/clerk/models/operations/revokeuserbiometriccredential_response.rb +44 -0
- data/lib/clerk/models/operations/revokeuserbiometriccredential_response.rbi +19 -0
- data/lib/clerk/models/operations/revokeusertrusteddevice_request.rb +36 -0
- data/lib/clerk/models/operations/revokeusertrusteddevice_request.rbi +15 -0
- data/lib/clerk/models/operations/revokeusertrusteddevice_response.rb +44 -0
- data/lib/clerk/models/operations/revokeusertrusteddevice_response.rbi +19 -0
- data/lib/clerk/models/operations/rotatedirectoryapikey_request.rb +32 -0
- data/lib/clerk/models/operations/rotatedirectoryapikey_request.rbi +13 -0
- data/lib/clerk/models/operations/rotatedirectoryapikey_response.rb +44 -0
- data/lib/clerk/models/operations/rotatedirectoryapikey_response.rbi +19 -0
- data/lib/clerk/models/operations/rotatescimdirectoryapikey_request.rb +32 -0
- data/lib/clerk/models/operations/rotatescimdirectoryapikey_request.rbi +13 -0
- data/lib/clerk/models/operations/rotatescimdirectoryapikey_response.rb +44 -0
- data/lib/clerk/models/operations/rotatescimdirectoryapikey_response.rbi +19 -0
- data/lib/clerk/models/operations/updatedirectory_request.rb +36 -0
- data/lib/clerk/models/operations/updatedirectory_request.rbi +15 -0
- data/lib/clerk/models/operations/updatedirectory_requestbody.rb +49 -0
- data/lib/clerk/models/operations/updatedirectory_requestbody.rbi +21 -0
- data/lib/clerk/models/operations/updatedirectory_response.rb +44 -0
- data/lib/clerk/models/operations/updatedirectory_response.rbi +19 -0
- data/lib/clerk/models/operations/updateemailaddress_requestbody.rb +7 -1
- data/lib/clerk/models/operations/updateemailaddress_requestbody.rbi +2 -0
- data/lib/clerk/models/operations/updateenterpriseconnection_custom_attribute.rb +5 -1
- data/lib/clerk/models/operations/updateenterpriseconnection_custom_attribute.rbi +2 -0
- data/lib/clerk/models/operations/updateenterpriseconnection_login_hint.rb +36 -0
- data/lib/clerk/models/operations/updateenterpriseconnection_login_hint.rbi +15 -0
- data/lib/clerk/models/operations/updateenterpriseconnection_mode.rb +21 -0
- data/lib/clerk/models/operations/updateenterpriseconnection_mode.rbi +11 -0
- data/lib/clerk/models/operations/updateenterpriseconnection_saml.rb +5 -1
- data/lib/clerk/models/operations/updateenterpriseconnection_saml.rbi +2 -0
- data/lib/clerk/models/operations/updateinstance_request.rb +15 -5
- data/lib/clerk/models/operations/updateinstance_request.rbi +6 -2
- data/lib/clerk/models/operations/updateinstanceoauthapplicationsettings_request.rb +26 -1
- data/lib/clerk/models/operations/updateinstanceoauthapplicationsettings_request.rbi +12 -0
- data/lib/clerk/models/operations/updateinstanceprotect_request.rb +1 -1
- data/lib/clerk/models/operations/updateoauthapplication_requestbody.rb +9 -5
- data/lib/clerk/models/operations/updateoauthapplication_requestbody.rbi +4 -2
- data/lib/clerk/models/operations/updateorganization_requestbody.rb +6 -1
- data/lib/clerk/models/operations/updateorganization_requestbody.rbi +2 -0
- data/lib/clerk/models/operations/updateorganizationdomain_requestbody.rb +1 -1
- data/lib/clerk/models/operations/updatesamlconnection_login_hint.rb +36 -0
- data/lib/clerk/models/operations/updatesamlconnection_login_hint.rbi +15 -0
- data/lib/clerk/models/operations/updatesamlconnection_mode.rb +21 -0
- data/lib/clerk/models/operations/updatesamlconnection_mode.rbi +11 -0
- data/lib/clerk/models/operations/updatesamlconnection_requestbody.rb +5 -1
- data/lib/clerk/models/operations/updatesamlconnection_requestbody.rbi +2 -0
- data/lib/clerk/models/operations/updatescimdirectory_request.rb +36 -0
- data/lib/clerk/models/operations/updatescimdirectory_request.rbi +15 -0
- data/lib/clerk/models/operations/updatescimdirectory_requestbody.rb +49 -0
- data/lib/clerk/models/operations/updatescimdirectory_requestbody.rbi +21 -0
- data/lib/clerk/models/operations/updatescimdirectory_response.rb +44 -0
- data/lib/clerk/models/operations/updatescimdirectory_response.rbi +19 -0
- data/lib/clerk/models/operations/updateuser_requestbody.rb +1 -1
- data/lib/clerk/models/operations.rb +80 -0
- data/lib/clerk/oauthaccesstokens.rb +5 -5
- data/lib/clerk/oauthapplications.rb +185 -35
- data/lib/clerk/openapiclient.rb +3 -1
- data/lib/clerk/organizationdomains.rb +32 -32
- data/lib/clerk/organizationinvitations.rb +35 -35
- data/lib/clerk/organizationmemberships.rb +25 -25
- data/lib/clerk/organizationpermissions.rb +25 -25
- data/lib/clerk/organizationroles.rb +35 -35
- data/lib/clerk/organizations.rb +60 -60
- data/lib/clerk/phonenumbers.rb +53 -38
- data/lib/clerk/proxy.rb +3 -3
- data/lib/clerk/proxychecks.rb +5 -5
- data/lib/clerk/redirecturls.rb +20 -20
- data/lib/clerk/rolesets.rb +35 -35
- data/lib/clerk/samlconnections.rb +25 -25
- data/lib/clerk/scimdirectories.rb +1534 -0
- data/lib/clerk/sdk.rb +44 -6
- data/lib/clerk/sdkconfiguration.rb +3 -3
- data/lib/clerk/sessions.rb +181 -35
- data/lib/clerk/signintokens.rb +11 -11
- data/lib/clerk/signups.rb +10 -10
- data/lib/clerk/templates.rb +5 -5
- data/lib/clerk/testingtokens.rb +5 -5
- data/lib/clerk/users.rb +1045 -223
- data/lib/clerk/utils/retries.rb +43 -1
- data/lib/clerk/utils/utils.rb +6 -2
- data/lib/clerk/waitlistentries.rb +30 -30
- data/lib/clerk/webhooks.rb +15 -15
- data/lib/clerk_sdk_ruby.rb +2 -0
- data/test/clerk/jwks_cache_scoping_test.rb +83 -0
- data/test/clerk/org_permissions_v2_test.rb +130 -0
- data/test/clerk/proxy_test.rb +108 -0
- metadata +339 -82
- data/lib/clerk/models/components/clerkerror_meta.rb +0 -27
- data/lib/clerk/models/components/clerkerrors_meta.rb +0 -27
- data/lib/clerk/models/components/emailaddress_verification_saml_meta.rb +0 -27
- data/lib/clerk/models/components/emailaddress_verification_saml_meta.rbi +0 -11
- data/lib/clerk/models/components/enterpriseaccount_verification_oauth_meta.rb +0 -27
- data/lib/clerk/models/components/enterpriseaccount_verification_oauth_meta.rbi +0 -11
- data/lib/clerk/models/components/enterpriseaccount_verification_saml_meta.rb +0 -27
- data/lib/clerk/models/components/enterpriseaccount_verification_saml_meta.rbi +0 -11
- data/lib/clerk/models/components/externalaccountwithverification_verification_oauth_meta.rb +0 -27
- data/lib/clerk/models/components/externalaccountwithverification_verification_oauth_meta.rbi +0 -11
- data/lib/clerk/models/components/samlaccount_meta.rb +0 -27
- data/lib/clerk/models/components/schemas_commerceplan_object.rbi +0 -11
- data/lib/clerk/models/components/schemas_commercesubscriptionitem_annual_fee.rbi +0 -19
- data/lib/clerk/models/components/schemas_commercesubscriptionitem_annual_monthly_fee.rb +0 -44
- data/lib/clerk/models/components/schemas_commercesubscriptionitem_annual_monthly_fee.rbi +0 -19
- data/lib/clerk/models/components/schemas_commercesubscriptionitem_next_payment_amount.rbi +0 -19
- data/lib/clerk/models/components/schemas_commercesubscriptionitem_object_commercepayer.rbi +0 -11
- data/lib/clerk/models/components/schemas_commercesubscriptionitem_object_commerceplan.rbi +0 -11
- data/lib/clerk/models/components/schemas_commercesubscriptionitem_object_commercesubscriptionitem.rbi +0 -11
- data/lib/clerk/models/components/schemas_commercesubscriptionitem_plan_period.rbi +0 -11
- data/lib/clerk/models/components/schemas_commercesubscriptionitem_status.rbi +0 -11
- data/lib/clerk/models/components/schemas_featureresponse_object.rbi +0 -11
- data/lib/clerk/models/components/verification_from_oauth_meta.rb +0 -27
- data/lib/clerk/models/components/verification_from_oauth_meta.rbi +0 -11
- data/lib/clerk/models/components/verification_google_one_tap_meta.rb +0 -27
- data/lib/clerk/models/components/verification_google_one_tap_meta.rbi +0 -11
data/lib/clerk/users.rb
CHANGED
|
@@ -45,6 +45,11 @@ module Clerk
|
|
|
45
45
|
# list - List all users
|
|
46
46
|
# Returns a list of all users.
|
|
47
47
|
# The users are returned sorted by creation date, with the newest users appearing first.
|
|
48
|
+
#
|
|
49
|
+
# To walk more than a few pages, paginate with `starting_after` rather than `offset`.
|
|
50
|
+
# A cursor page costs the same no matter how far into the list it sits, while a large `offset`
|
|
51
|
+
# has to walk and discard every row before it, so it gets progressively slower and eventually
|
|
52
|
+
# times out. Cursor pagination requires the `created_at` ordering, which is the default.
|
|
48
53
|
url, params = @sdk_configuration.get_server_details
|
|
49
54
|
base_url = Utils.template_url(url, params)
|
|
50
55
|
url = "#{base_url}/users"
|
|
@@ -71,10 +76,10 @@ module Clerk
|
|
|
71
76
|
|
|
72
77
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
73
78
|
timeout ||= @sdk_configuration.timeout
|
|
74
|
-
|
|
79
|
+
|
|
75
80
|
|
|
76
81
|
connection = @sdk_configuration.client.dup
|
|
77
|
-
connection.
|
|
82
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
78
83
|
|
|
79
84
|
hook_ctx = SDKHooks::HookContext.new(
|
|
80
85
|
config: @sdk_configuration,
|
|
@@ -87,7 +92,7 @@ module Clerk
|
|
|
87
92
|
error = nil
|
|
88
93
|
http_response = nil
|
|
89
94
|
|
|
90
|
-
|
|
95
|
+
|
|
91
96
|
begin
|
|
92
97
|
http_response = connection.get(url) do |req|
|
|
93
98
|
req.headers.merge!(headers)
|
|
@@ -124,13 +129,13 @@ module Clerk
|
|
|
124
129
|
response: http_response
|
|
125
130
|
)
|
|
126
131
|
end
|
|
127
|
-
|
|
132
|
+
|
|
128
133
|
if http_response.nil?
|
|
129
134
|
raise error if !error.nil?
|
|
130
135
|
raise 'no response'
|
|
131
136
|
end
|
|
132
137
|
end
|
|
133
|
-
|
|
138
|
+
|
|
134
139
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
135
140
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
136
141
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -225,10 +230,10 @@ module Clerk
|
|
|
225
230
|
|
|
226
231
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
227
232
|
timeout ||= @sdk_configuration.timeout
|
|
228
|
-
|
|
233
|
+
|
|
229
234
|
|
|
230
235
|
connection = @sdk_configuration.client.dup
|
|
231
|
-
connection.
|
|
236
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
232
237
|
|
|
233
238
|
hook_ctx = SDKHooks::HookContext.new(
|
|
234
239
|
config: @sdk_configuration,
|
|
@@ -241,7 +246,7 @@ module Clerk
|
|
|
241
246
|
error = nil
|
|
242
247
|
http_response = nil
|
|
243
248
|
|
|
244
|
-
|
|
249
|
+
|
|
245
250
|
begin
|
|
246
251
|
http_response = connection.post(url) do |req|
|
|
247
252
|
req.body = body
|
|
@@ -278,13 +283,13 @@ module Clerk
|
|
|
278
283
|
response: http_response
|
|
279
284
|
)
|
|
280
285
|
end
|
|
281
|
-
|
|
286
|
+
|
|
282
287
|
if http_response.nil?
|
|
283
288
|
raise error if !error.nil?
|
|
284
289
|
raise 'no response'
|
|
285
290
|
end
|
|
286
291
|
end
|
|
287
|
-
|
|
292
|
+
|
|
288
293
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
289
294
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
290
295
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -363,10 +368,10 @@ module Clerk
|
|
|
363
368
|
|
|
364
369
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
365
370
|
timeout ||= @sdk_configuration.timeout
|
|
366
|
-
|
|
371
|
+
|
|
367
372
|
|
|
368
373
|
connection = @sdk_configuration.client.dup
|
|
369
|
-
connection.
|
|
374
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
370
375
|
|
|
371
376
|
hook_ctx = SDKHooks::HookContext.new(
|
|
372
377
|
config: @sdk_configuration,
|
|
@@ -379,7 +384,7 @@ module Clerk
|
|
|
379
384
|
error = nil
|
|
380
385
|
http_response = nil
|
|
381
386
|
|
|
382
|
-
|
|
387
|
+
|
|
383
388
|
begin
|
|
384
389
|
http_response = connection.get(url) do |req|
|
|
385
390
|
req.headers.merge!(headers)
|
|
@@ -416,13 +421,13 @@ module Clerk
|
|
|
416
421
|
response: http_response
|
|
417
422
|
)
|
|
418
423
|
end
|
|
419
|
-
|
|
424
|
+
|
|
420
425
|
if http_response.nil?
|
|
421
426
|
raise error if !error.nil?
|
|
422
427
|
raise 'no response'
|
|
423
428
|
end
|
|
424
429
|
end
|
|
425
|
-
|
|
430
|
+
|
|
426
431
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
427
432
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
428
433
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -508,10 +513,10 @@ module Clerk
|
|
|
508
513
|
|
|
509
514
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
510
515
|
timeout ||= @sdk_configuration.timeout
|
|
511
|
-
|
|
516
|
+
|
|
512
517
|
|
|
513
518
|
connection = @sdk_configuration.client.dup
|
|
514
|
-
connection.
|
|
519
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
515
520
|
|
|
516
521
|
hook_ctx = SDKHooks::HookContext.new(
|
|
517
522
|
config: @sdk_configuration,
|
|
@@ -524,7 +529,7 @@ module Clerk
|
|
|
524
529
|
error = nil
|
|
525
530
|
http_response = nil
|
|
526
531
|
|
|
527
|
-
|
|
532
|
+
|
|
528
533
|
begin
|
|
529
534
|
http_response = connection.get(url) do |req|
|
|
530
535
|
req.headers.merge!(headers)
|
|
@@ -560,13 +565,13 @@ module Clerk
|
|
|
560
565
|
response: http_response
|
|
561
566
|
)
|
|
562
567
|
end
|
|
563
|
-
|
|
568
|
+
|
|
564
569
|
if http_response.nil?
|
|
565
570
|
raise error if !error.nil?
|
|
566
571
|
raise 'no response'
|
|
567
572
|
end
|
|
568
573
|
end
|
|
569
|
-
|
|
574
|
+
|
|
570
575
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
571
576
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
572
577
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -672,10 +677,10 @@ module Clerk
|
|
|
672
677
|
|
|
673
678
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
674
679
|
timeout ||= @sdk_configuration.timeout
|
|
675
|
-
|
|
680
|
+
|
|
676
681
|
|
|
677
682
|
connection = @sdk_configuration.client.dup
|
|
678
|
-
connection.
|
|
683
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
679
684
|
|
|
680
685
|
hook_ctx = SDKHooks::HookContext.new(
|
|
681
686
|
config: @sdk_configuration,
|
|
@@ -688,7 +693,7 @@ module Clerk
|
|
|
688
693
|
error = nil
|
|
689
694
|
http_response = nil
|
|
690
695
|
|
|
691
|
-
|
|
696
|
+
|
|
692
697
|
begin
|
|
693
698
|
http_response = connection.patch(url) do |req|
|
|
694
699
|
req.body = body
|
|
@@ -725,13 +730,13 @@ module Clerk
|
|
|
725
730
|
response: http_response
|
|
726
731
|
)
|
|
727
732
|
end
|
|
728
|
-
|
|
733
|
+
|
|
729
734
|
if http_response.nil?
|
|
730
735
|
raise error if !error.nil?
|
|
731
736
|
raise 'no response'
|
|
732
737
|
end
|
|
733
738
|
end
|
|
734
|
-
|
|
739
|
+
|
|
735
740
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
736
741
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
737
742
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -817,10 +822,10 @@ module Clerk
|
|
|
817
822
|
|
|
818
823
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
819
824
|
timeout ||= @sdk_configuration.timeout
|
|
820
|
-
|
|
825
|
+
|
|
821
826
|
|
|
822
827
|
connection = @sdk_configuration.client.dup
|
|
823
|
-
connection.
|
|
828
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
824
829
|
|
|
825
830
|
hook_ctx = SDKHooks::HookContext.new(
|
|
826
831
|
config: @sdk_configuration,
|
|
@@ -833,7 +838,7 @@ module Clerk
|
|
|
833
838
|
error = nil
|
|
834
839
|
http_response = nil
|
|
835
840
|
|
|
836
|
-
|
|
841
|
+
|
|
837
842
|
begin
|
|
838
843
|
http_response = connection.delete(url) do |req|
|
|
839
844
|
req.headers.merge!(headers)
|
|
@@ -869,13 +874,13 @@ module Clerk
|
|
|
869
874
|
response: http_response
|
|
870
875
|
)
|
|
871
876
|
end
|
|
872
|
-
|
|
877
|
+
|
|
873
878
|
if http_response.nil?
|
|
874
879
|
raise error if !error.nil?
|
|
875
880
|
raise 'no response'
|
|
876
881
|
end
|
|
877
882
|
end
|
|
878
|
-
|
|
883
|
+
|
|
879
884
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
880
885
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
881
886
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -961,10 +966,10 @@ module Clerk
|
|
|
961
966
|
|
|
962
967
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
963
968
|
timeout ||= @sdk_configuration.timeout
|
|
964
|
-
|
|
969
|
+
|
|
965
970
|
|
|
966
971
|
connection = @sdk_configuration.client.dup
|
|
967
|
-
connection.
|
|
972
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
968
973
|
|
|
969
974
|
hook_ctx = SDKHooks::HookContext.new(
|
|
970
975
|
config: @sdk_configuration,
|
|
@@ -977,7 +982,7 @@ module Clerk
|
|
|
977
982
|
error = nil
|
|
978
983
|
http_response = nil
|
|
979
984
|
|
|
980
|
-
|
|
985
|
+
|
|
981
986
|
begin
|
|
982
987
|
http_response = connection.post(url) do |req|
|
|
983
988
|
req.headers.merge!(headers)
|
|
@@ -1013,13 +1018,13 @@ module Clerk
|
|
|
1013
1018
|
response: http_response
|
|
1014
1019
|
)
|
|
1015
1020
|
end
|
|
1016
|
-
|
|
1021
|
+
|
|
1017
1022
|
if http_response.nil?
|
|
1018
1023
|
raise error if !error.nil?
|
|
1019
1024
|
raise 'no response'
|
|
1020
1025
|
end
|
|
1021
1026
|
end
|
|
1022
|
-
|
|
1027
|
+
|
|
1023
1028
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
1024
1029
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
1025
1030
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -1105,10 +1110,10 @@ module Clerk
|
|
|
1105
1110
|
|
|
1106
1111
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
1107
1112
|
timeout ||= @sdk_configuration.timeout
|
|
1108
|
-
|
|
1113
|
+
|
|
1109
1114
|
|
|
1110
1115
|
connection = @sdk_configuration.client.dup
|
|
1111
|
-
connection.
|
|
1116
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
1112
1117
|
|
|
1113
1118
|
hook_ctx = SDKHooks::HookContext.new(
|
|
1114
1119
|
config: @sdk_configuration,
|
|
@@ -1121,7 +1126,7 @@ module Clerk
|
|
|
1121
1126
|
error = nil
|
|
1122
1127
|
http_response = nil
|
|
1123
1128
|
|
|
1124
|
-
|
|
1129
|
+
|
|
1125
1130
|
begin
|
|
1126
1131
|
http_response = connection.post(url) do |req|
|
|
1127
1132
|
req.headers.merge!(headers)
|
|
@@ -1157,13 +1162,13 @@ module Clerk
|
|
|
1157
1162
|
response: http_response
|
|
1158
1163
|
)
|
|
1159
1164
|
end
|
|
1160
|
-
|
|
1165
|
+
|
|
1161
1166
|
if http_response.nil?
|
|
1162
1167
|
raise error if !error.nil?
|
|
1163
1168
|
raise 'no response'
|
|
1164
1169
|
end
|
|
1165
1170
|
end
|
|
1166
|
-
|
|
1171
|
+
|
|
1167
1172
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
1168
1173
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
1169
1174
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -1252,10 +1257,10 @@ module Clerk
|
|
|
1252
1257
|
|
|
1253
1258
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
1254
1259
|
timeout ||= @sdk_configuration.timeout
|
|
1255
|
-
|
|
1260
|
+
|
|
1256
1261
|
|
|
1257
1262
|
connection = @sdk_configuration.client.dup
|
|
1258
|
-
connection.
|
|
1263
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
1259
1264
|
|
|
1260
1265
|
hook_ctx = SDKHooks::HookContext.new(
|
|
1261
1266
|
config: @sdk_configuration,
|
|
@@ -1268,7 +1273,7 @@ module Clerk
|
|
|
1268
1273
|
error = nil
|
|
1269
1274
|
http_response = nil
|
|
1270
1275
|
|
|
1271
|
-
|
|
1276
|
+
|
|
1272
1277
|
begin
|
|
1273
1278
|
http_response = connection.post(url) do |req|
|
|
1274
1279
|
req.body = body
|
|
@@ -1305,13 +1310,13 @@ module Clerk
|
|
|
1305
1310
|
response: http_response
|
|
1306
1311
|
)
|
|
1307
1312
|
end
|
|
1308
|
-
|
|
1313
|
+
|
|
1309
1314
|
if http_response.nil?
|
|
1310
1315
|
raise error if !error.nil?
|
|
1311
1316
|
raise 'no response'
|
|
1312
1317
|
end
|
|
1313
1318
|
end
|
|
1314
|
-
|
|
1319
|
+
|
|
1315
1320
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
1316
1321
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
1317
1322
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -1400,10 +1405,10 @@ module Clerk
|
|
|
1400
1405
|
|
|
1401
1406
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
1402
1407
|
timeout ||= @sdk_configuration.timeout
|
|
1403
|
-
|
|
1408
|
+
|
|
1404
1409
|
|
|
1405
1410
|
connection = @sdk_configuration.client.dup
|
|
1406
|
-
connection.
|
|
1411
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
1407
1412
|
|
|
1408
1413
|
hook_ctx = SDKHooks::HookContext.new(
|
|
1409
1414
|
config: @sdk_configuration,
|
|
@@ -1416,7 +1421,7 @@ module Clerk
|
|
|
1416
1421
|
error = nil
|
|
1417
1422
|
http_response = nil
|
|
1418
1423
|
|
|
1419
|
-
|
|
1424
|
+
|
|
1420
1425
|
begin
|
|
1421
1426
|
http_response = connection.post(url) do |req|
|
|
1422
1427
|
req.body = body
|
|
@@ -1453,13 +1458,13 @@ module Clerk
|
|
|
1453
1458
|
response: http_response
|
|
1454
1459
|
)
|
|
1455
1460
|
end
|
|
1456
|
-
|
|
1461
|
+
|
|
1457
1462
|
if http_response.nil?
|
|
1458
1463
|
raise error if !error.nil?
|
|
1459
1464
|
raise 'no response'
|
|
1460
1465
|
end
|
|
1461
1466
|
end
|
|
1462
|
-
|
|
1467
|
+
|
|
1463
1468
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
1464
1469
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
1465
1470
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -1546,10 +1551,10 @@ module Clerk
|
|
|
1546
1551
|
|
|
1547
1552
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
1548
1553
|
timeout ||= @sdk_configuration.timeout
|
|
1549
|
-
|
|
1554
|
+
|
|
1550
1555
|
|
|
1551
1556
|
connection = @sdk_configuration.client.dup
|
|
1552
|
-
connection.
|
|
1557
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
1553
1558
|
|
|
1554
1559
|
hook_ctx = SDKHooks::HookContext.new(
|
|
1555
1560
|
config: @sdk_configuration,
|
|
@@ -1562,7 +1567,7 @@ module Clerk
|
|
|
1562
1567
|
error = nil
|
|
1563
1568
|
http_response = nil
|
|
1564
1569
|
|
|
1565
|
-
|
|
1570
|
+
|
|
1566
1571
|
begin
|
|
1567
1572
|
http_response = connection.post(url) do |req|
|
|
1568
1573
|
req.headers.merge!(headers)
|
|
@@ -1598,13 +1603,13 @@ module Clerk
|
|
|
1598
1603
|
response: http_response
|
|
1599
1604
|
)
|
|
1600
1605
|
end
|
|
1601
|
-
|
|
1606
|
+
|
|
1602
1607
|
if http_response.nil?
|
|
1603
1608
|
raise error if !error.nil?
|
|
1604
1609
|
raise 'no response'
|
|
1605
1610
|
end
|
|
1606
1611
|
end
|
|
1607
|
-
|
|
1612
|
+
|
|
1608
1613
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
1609
1614
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
1610
1615
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -1690,10 +1695,10 @@ module Clerk
|
|
|
1690
1695
|
|
|
1691
1696
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
1692
1697
|
timeout ||= @sdk_configuration.timeout
|
|
1693
|
-
|
|
1698
|
+
|
|
1694
1699
|
|
|
1695
1700
|
connection = @sdk_configuration.client.dup
|
|
1696
|
-
connection.
|
|
1701
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
1697
1702
|
|
|
1698
1703
|
hook_ctx = SDKHooks::HookContext.new(
|
|
1699
1704
|
config: @sdk_configuration,
|
|
@@ -1706,7 +1711,7 @@ module Clerk
|
|
|
1706
1711
|
error = nil
|
|
1707
1712
|
http_response = nil
|
|
1708
1713
|
|
|
1709
|
-
|
|
1714
|
+
|
|
1710
1715
|
begin
|
|
1711
1716
|
http_response = connection.post(url) do |req|
|
|
1712
1717
|
req.headers.merge!(headers)
|
|
@@ -1742,13 +1747,13 @@ module Clerk
|
|
|
1742
1747
|
response: http_response
|
|
1743
1748
|
)
|
|
1744
1749
|
end
|
|
1745
|
-
|
|
1750
|
+
|
|
1746
1751
|
if http_response.nil?
|
|
1747
1752
|
raise error if !error.nil?
|
|
1748
1753
|
raise 'no response'
|
|
1749
1754
|
end
|
|
1750
1755
|
end
|
|
1751
|
-
|
|
1756
|
+
|
|
1752
1757
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
1753
1758
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
1754
1759
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -1846,10 +1851,10 @@ module Clerk
|
|
|
1846
1851
|
|
|
1847
1852
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
1848
1853
|
timeout ||= @sdk_configuration.timeout
|
|
1849
|
-
|
|
1854
|
+
|
|
1850
1855
|
|
|
1851
1856
|
connection = @sdk_configuration.client.dup
|
|
1852
|
-
connection.
|
|
1857
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
1853
1858
|
|
|
1854
1859
|
hook_ctx = SDKHooks::HookContext.new(
|
|
1855
1860
|
config: @sdk_configuration,
|
|
@@ -1862,7 +1867,7 @@ module Clerk
|
|
|
1862
1867
|
error = nil
|
|
1863
1868
|
http_response = nil
|
|
1864
1869
|
|
|
1865
|
-
|
|
1870
|
+
|
|
1866
1871
|
begin
|
|
1867
1872
|
http_response = connection.post(url) do |req|
|
|
1868
1873
|
req.body = body
|
|
@@ -1899,13 +1904,13 @@ module Clerk
|
|
|
1899
1904
|
response: http_response
|
|
1900
1905
|
)
|
|
1901
1906
|
end
|
|
1902
|
-
|
|
1907
|
+
|
|
1903
1908
|
if http_response.nil?
|
|
1904
1909
|
raise error if !error.nil?
|
|
1905
1910
|
raise 'no response'
|
|
1906
1911
|
end
|
|
1907
1912
|
end
|
|
1908
|
-
|
|
1913
|
+
|
|
1909
1914
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
1910
1915
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
1911
1916
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -1991,10 +1996,10 @@ module Clerk
|
|
|
1991
1996
|
|
|
1992
1997
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
1993
1998
|
timeout ||= @sdk_configuration.timeout
|
|
1994
|
-
|
|
1999
|
+
|
|
1995
2000
|
|
|
1996
2001
|
connection = @sdk_configuration.client.dup
|
|
1997
|
-
connection.
|
|
2002
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
1998
2003
|
|
|
1999
2004
|
hook_ctx = SDKHooks::HookContext.new(
|
|
2000
2005
|
config: @sdk_configuration,
|
|
@@ -2007,7 +2012,7 @@ module Clerk
|
|
|
2007
2012
|
error = nil
|
|
2008
2013
|
http_response = nil
|
|
2009
2014
|
|
|
2010
|
-
|
|
2015
|
+
|
|
2011
2016
|
begin
|
|
2012
2017
|
http_response = connection.delete(url) do |req|
|
|
2013
2018
|
req.headers.merge!(headers)
|
|
@@ -2043,13 +2048,13 @@ module Clerk
|
|
|
2043
2048
|
response: http_response
|
|
2044
2049
|
)
|
|
2045
2050
|
end
|
|
2046
|
-
|
|
2051
|
+
|
|
2047
2052
|
if http_response.nil?
|
|
2048
2053
|
raise error if !error.nil?
|
|
2049
2054
|
raise 'no response'
|
|
2050
2055
|
end
|
|
2051
2056
|
end
|
|
2052
|
-
|
|
2057
|
+
|
|
2053
2058
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
2054
2059
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
2055
2060
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -2153,10 +2158,10 @@ module Clerk
|
|
|
2153
2158
|
|
|
2154
2159
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
2155
2160
|
timeout ||= @sdk_configuration.timeout
|
|
2156
|
-
|
|
2161
|
+
|
|
2157
2162
|
|
|
2158
2163
|
connection = @sdk_configuration.client.dup
|
|
2159
|
-
connection.
|
|
2164
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
2160
2165
|
|
|
2161
2166
|
hook_ctx = SDKHooks::HookContext.new(
|
|
2162
2167
|
config: @sdk_configuration,
|
|
@@ -2169,7 +2174,7 @@ module Clerk
|
|
|
2169
2174
|
error = nil
|
|
2170
2175
|
http_response = nil
|
|
2171
2176
|
|
|
2172
|
-
|
|
2177
|
+
|
|
2173
2178
|
begin
|
|
2174
2179
|
http_response = connection.patch(url) do |req|
|
|
2175
2180
|
req.body = body
|
|
@@ -2206,13 +2211,13 @@ module Clerk
|
|
|
2206
2211
|
response: http_response
|
|
2207
2212
|
)
|
|
2208
2213
|
end
|
|
2209
|
-
|
|
2214
|
+
|
|
2210
2215
|
if http_response.nil?
|
|
2211
2216
|
raise error if !error.nil?
|
|
2212
2217
|
raise 'no response'
|
|
2213
2218
|
end
|
|
2214
2219
|
end
|
|
2215
|
-
|
|
2220
|
+
|
|
2216
2221
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
2217
2222
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
2218
2223
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -2317,10 +2322,10 @@ module Clerk
|
|
|
2317
2322
|
|
|
2318
2323
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
2319
2324
|
timeout ||= @sdk_configuration.timeout
|
|
2320
|
-
|
|
2325
|
+
|
|
2321
2326
|
|
|
2322
2327
|
connection = @sdk_configuration.client.dup
|
|
2323
|
-
connection.
|
|
2328
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
2324
2329
|
|
|
2325
2330
|
hook_ctx = SDKHooks::HookContext.new(
|
|
2326
2331
|
config: @sdk_configuration,
|
|
@@ -2333,7 +2338,7 @@ module Clerk
|
|
|
2333
2338
|
error = nil
|
|
2334
2339
|
http_response = nil
|
|
2335
2340
|
|
|
2336
|
-
|
|
2341
|
+
|
|
2337
2342
|
begin
|
|
2338
2343
|
http_response = connection.put(url) do |req|
|
|
2339
2344
|
req.body = body
|
|
@@ -2370,13 +2375,13 @@ module Clerk
|
|
|
2370
2375
|
response: http_response
|
|
2371
2376
|
)
|
|
2372
2377
|
end
|
|
2373
|
-
|
|
2378
|
+
|
|
2374
2379
|
if http_response.nil?
|
|
2375
2380
|
raise error if !error.nil?
|
|
2376
2381
|
raise 'no response'
|
|
2377
2382
|
end
|
|
2378
2383
|
end
|
|
2379
|
-
|
|
2384
|
+
|
|
2380
2385
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
2381
2386
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
2382
2387
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -2464,10 +2469,10 @@ module Clerk
|
|
|
2464
2469
|
|
|
2465
2470
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
2466
2471
|
timeout ||= @sdk_configuration.timeout
|
|
2467
|
-
|
|
2472
|
+
|
|
2468
2473
|
|
|
2469
2474
|
connection = @sdk_configuration.client.dup
|
|
2470
|
-
connection.
|
|
2475
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
2471
2476
|
|
|
2472
2477
|
hook_ctx = SDKHooks::HookContext.new(
|
|
2473
2478
|
config: @sdk_configuration,
|
|
@@ -2480,7 +2485,7 @@ module Clerk
|
|
|
2480
2485
|
error = nil
|
|
2481
2486
|
http_response = nil
|
|
2482
2487
|
|
|
2483
|
-
|
|
2488
|
+
|
|
2484
2489
|
begin
|
|
2485
2490
|
http_response = connection.get(url) do |req|
|
|
2486
2491
|
req.headers.merge!(headers)
|
|
@@ -2516,13 +2521,13 @@ module Clerk
|
|
|
2516
2521
|
response: http_response
|
|
2517
2522
|
)
|
|
2518
2523
|
end
|
|
2519
|
-
|
|
2524
|
+
|
|
2520
2525
|
if http_response.nil?
|
|
2521
2526
|
raise error if !error.nil?
|
|
2522
2527
|
raise 'no response'
|
|
2523
2528
|
end
|
|
2524
2529
|
end
|
|
2525
|
-
|
|
2530
|
+
|
|
2526
2531
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
2527
2532
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
2528
2533
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -2624,10 +2629,10 @@ module Clerk
|
|
|
2624
2629
|
|
|
2625
2630
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
2626
2631
|
timeout ||= @sdk_configuration.timeout
|
|
2627
|
-
|
|
2632
|
+
|
|
2628
2633
|
|
|
2629
2634
|
connection = @sdk_configuration.client.dup
|
|
2630
|
-
connection.
|
|
2635
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
2631
2636
|
|
|
2632
2637
|
hook_ctx = SDKHooks::HookContext.new(
|
|
2633
2638
|
config: @sdk_configuration,
|
|
@@ -2640,7 +2645,7 @@ module Clerk
|
|
|
2640
2645
|
error = nil
|
|
2641
2646
|
http_response = nil
|
|
2642
2647
|
|
|
2643
|
-
|
|
2648
|
+
|
|
2644
2649
|
begin
|
|
2645
2650
|
http_response = connection.get(url) do |req|
|
|
2646
2651
|
req.headers.merge!(headers)
|
|
@@ -2676,13 +2681,13 @@ module Clerk
|
|
|
2676
2681
|
response: http_response
|
|
2677
2682
|
)
|
|
2678
2683
|
end
|
|
2679
|
-
|
|
2684
|
+
|
|
2680
2685
|
if http_response.nil?
|
|
2681
2686
|
raise error if !error.nil?
|
|
2682
2687
|
raise 'no response'
|
|
2683
2688
|
end
|
|
2684
2689
|
end
|
|
2685
|
-
|
|
2690
|
+
|
|
2686
2691
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
2687
2692
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
2688
2693
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -2797,10 +2802,10 @@ module Clerk
|
|
|
2797
2802
|
|
|
2798
2803
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
2799
2804
|
timeout ||= @sdk_configuration.timeout
|
|
2800
|
-
|
|
2805
|
+
|
|
2801
2806
|
|
|
2802
2807
|
connection = @sdk_configuration.client.dup
|
|
2803
|
-
connection.
|
|
2808
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
2804
2809
|
|
|
2805
2810
|
hook_ctx = SDKHooks::HookContext.new(
|
|
2806
2811
|
config: @sdk_configuration,
|
|
@@ -2813,7 +2818,7 @@ module Clerk
|
|
|
2813
2818
|
error = nil
|
|
2814
2819
|
http_response = nil
|
|
2815
2820
|
|
|
2816
|
-
|
|
2821
|
+
|
|
2817
2822
|
begin
|
|
2818
2823
|
http_response = connection.post(url) do |req|
|
|
2819
2824
|
req.body = body
|
|
@@ -2850,13 +2855,13 @@ module Clerk
|
|
|
2850
2855
|
response: http_response
|
|
2851
2856
|
)
|
|
2852
2857
|
end
|
|
2853
|
-
|
|
2858
|
+
|
|
2854
2859
|
if http_response.nil?
|
|
2855
2860
|
raise error if !error.nil?
|
|
2856
2861
|
raise 'no response'
|
|
2857
2862
|
end
|
|
2858
2863
|
end
|
|
2859
|
-
|
|
2864
|
+
|
|
2860
2865
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
2861
2866
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
2862
2867
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -2956,10 +2961,10 @@ module Clerk
|
|
|
2956
2961
|
|
|
2957
2962
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
2958
2963
|
timeout ||= @sdk_configuration.timeout
|
|
2959
|
-
|
|
2964
|
+
|
|
2960
2965
|
|
|
2961
2966
|
connection = @sdk_configuration.client.dup
|
|
2962
|
-
connection.
|
|
2967
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
2963
2968
|
|
|
2964
2969
|
hook_ctx = SDKHooks::HookContext.new(
|
|
2965
2970
|
config: @sdk_configuration,
|
|
@@ -2972,7 +2977,7 @@ module Clerk
|
|
|
2972
2977
|
error = nil
|
|
2973
2978
|
http_response = nil
|
|
2974
2979
|
|
|
2975
|
-
|
|
2980
|
+
|
|
2976
2981
|
begin
|
|
2977
2982
|
http_response = connection.get(url) do |req|
|
|
2978
2983
|
req.headers.merge!(headers)
|
|
@@ -3009,13 +3014,13 @@ module Clerk
|
|
|
3009
3014
|
response: http_response
|
|
3010
3015
|
)
|
|
3011
3016
|
end
|
|
3012
|
-
|
|
3017
|
+
|
|
3013
3018
|
if http_response.nil?
|
|
3014
3019
|
raise error if !error.nil?
|
|
3015
3020
|
raise 'no response'
|
|
3016
3021
|
end
|
|
3017
3022
|
end
|
|
3018
|
-
|
|
3023
|
+
|
|
3019
3024
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
3020
3025
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
3021
3026
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -3104,10 +3109,10 @@ module Clerk
|
|
|
3104
3109
|
|
|
3105
3110
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
3106
3111
|
timeout ||= @sdk_configuration.timeout
|
|
3107
|
-
|
|
3112
|
+
|
|
3108
3113
|
|
|
3109
3114
|
connection = @sdk_configuration.client.dup
|
|
3110
|
-
connection.
|
|
3115
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
3111
3116
|
|
|
3112
3117
|
hook_ctx = SDKHooks::HookContext.new(
|
|
3113
3118
|
config: @sdk_configuration,
|
|
@@ -3120,7 +3125,7 @@ module Clerk
|
|
|
3120
3125
|
error = nil
|
|
3121
3126
|
http_response = nil
|
|
3122
3127
|
|
|
3123
|
-
|
|
3128
|
+
|
|
3124
3129
|
begin
|
|
3125
3130
|
http_response = connection.get(url) do |req|
|
|
3126
3131
|
req.headers.merge!(headers)
|
|
@@ -3157,13 +3162,13 @@ module Clerk
|
|
|
3157
3162
|
response: http_response
|
|
3158
3163
|
)
|
|
3159
3164
|
end
|
|
3160
|
-
|
|
3165
|
+
|
|
3161
3166
|
if http_response.nil?
|
|
3162
3167
|
raise error if !error.nil?
|
|
3163
3168
|
raise 'no response'
|
|
3164
3169
|
end
|
|
3165
3170
|
end
|
|
3166
|
-
|
|
3171
|
+
|
|
3167
3172
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
3168
3173
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
3169
3174
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -3253,10 +3258,10 @@ module Clerk
|
|
|
3253
3258
|
|
|
3254
3259
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
3255
3260
|
timeout ||= @sdk_configuration.timeout
|
|
3256
|
-
|
|
3261
|
+
|
|
3257
3262
|
|
|
3258
3263
|
connection = @sdk_configuration.client.dup
|
|
3259
|
-
connection.
|
|
3264
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
3260
3265
|
|
|
3261
3266
|
hook_ctx = SDKHooks::HookContext.new(
|
|
3262
3267
|
config: @sdk_configuration,
|
|
@@ -3269,7 +3274,7 @@ module Clerk
|
|
|
3269
3274
|
error = nil
|
|
3270
3275
|
http_response = nil
|
|
3271
3276
|
|
|
3272
|
-
|
|
3277
|
+
|
|
3273
3278
|
begin
|
|
3274
3279
|
http_response = connection.get(url) do |req|
|
|
3275
3280
|
req.headers.merge!(headers)
|
|
@@ -3306,13 +3311,13 @@ module Clerk
|
|
|
3306
3311
|
response: http_response
|
|
3307
3312
|
)
|
|
3308
3313
|
end
|
|
3309
|
-
|
|
3314
|
+
|
|
3310
3315
|
if http_response.nil?
|
|
3311
3316
|
raise error if !error.nil?
|
|
3312
3317
|
raise 'no response'
|
|
3313
3318
|
end
|
|
3314
3319
|
end
|
|
3315
|
-
|
|
3320
|
+
|
|
3316
3321
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
3317
3322
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
3318
3323
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -3362,20 +3367,21 @@ module Clerk
|
|
|
3362
3367
|
|
|
3363
3368
|
|
|
3364
3369
|
|
|
3365
|
-
def
|
|
3366
|
-
#
|
|
3367
|
-
#
|
|
3368
|
-
#
|
|
3369
|
-
request
|
|
3370
|
+
def remove_password(user_id:, body: nil, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
3371
|
+
# remove_password - Remove a user's password
|
|
3372
|
+
# Removes the password credential from the given user. This is a privileged operation and does not require the user's current password. Password removal is allowed even when the user has no other sign-in method configured.
|
|
3373
|
+
#
|
|
3374
|
+
# If the user does not have a password, the user is returned unchanged and no password-deletion or user-update event is emitted. By default, existing sessions remain active. Set `sign_out_of_other_sessions` to `true` to revoke sessions active when the request is processed.
|
|
3375
|
+
request = Models::Operations::RemoveUserPasswordRequest.new(
|
|
3370
3376
|
user_id: user_id,
|
|
3371
3377
|
body: body
|
|
3372
3378
|
)
|
|
3373
3379
|
url, params = @sdk_configuration.get_server_details
|
|
3374
3380
|
base_url = Utils.template_url(url, params)
|
|
3375
3381
|
url = Utils.generate_url(
|
|
3376
|
-
Models::Operations::
|
|
3382
|
+
Models::Operations::RemoveUserPasswordRequest,
|
|
3377
3383
|
base_url,
|
|
3378
|
-
'/users/{user_id}/
|
|
3384
|
+
'/users/{user_id}/remove_password',
|
|
3379
3385
|
request
|
|
3380
3386
|
)
|
|
3381
3387
|
headers = {}
|
|
@@ -3410,23 +3416,23 @@ module Clerk
|
|
|
3410
3416
|
|
|
3411
3417
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
3412
3418
|
timeout ||= @sdk_configuration.timeout
|
|
3413
|
-
|
|
3419
|
+
|
|
3414
3420
|
|
|
3415
3421
|
connection = @sdk_configuration.client.dup
|
|
3416
|
-
connection.
|
|
3422
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
3417
3423
|
|
|
3418
3424
|
hook_ctx = SDKHooks::HookContext.new(
|
|
3419
3425
|
config: @sdk_configuration,
|
|
3420
3426
|
base_url: base_url,
|
|
3421
3427
|
oauth2_scopes: nil,
|
|
3422
|
-
operation_id: '
|
|
3428
|
+
operation_id: 'RemoveUserPassword',
|
|
3423
3429
|
security_source: @sdk_configuration.security_source
|
|
3424
3430
|
)
|
|
3425
3431
|
|
|
3426
3432
|
error = nil
|
|
3427
3433
|
http_response = nil
|
|
3428
3434
|
|
|
3429
|
-
|
|
3435
|
+
|
|
3430
3436
|
begin
|
|
3431
3437
|
http_response = connection.post(url) do |req|
|
|
3432
3438
|
req.body = body
|
|
@@ -3463,13 +3469,13 @@ module Clerk
|
|
|
3463
3469
|
response: http_response
|
|
3464
3470
|
)
|
|
3465
3471
|
end
|
|
3466
|
-
|
|
3472
|
+
|
|
3467
3473
|
if http_response.nil?
|
|
3468
3474
|
raise error if !error.nil?
|
|
3469
3475
|
raise 'no response'
|
|
3470
3476
|
end
|
|
3471
3477
|
end
|
|
3472
|
-
|
|
3478
|
+
|
|
3473
3479
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
3474
3480
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
3475
3481
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -3480,18 +3486,33 @@ module Clerk
|
|
|
3480
3486
|
response: http_response
|
|
3481
3487
|
)
|
|
3482
3488
|
response_data = http_response.env.response_body
|
|
3483
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::
|
|
3484
|
-
response = Models::Operations::
|
|
3489
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::User)
|
|
3490
|
+
response = Models::Operations::RemoveUserPasswordResponse.new(
|
|
3485
3491
|
status_code: http_response.status,
|
|
3486
3492
|
content_type: content_type,
|
|
3487
3493
|
raw_response: http_response,
|
|
3488
|
-
|
|
3494
|
+
user: obj
|
|
3489
3495
|
)
|
|
3490
3496
|
|
|
3491
3497
|
return response
|
|
3492
3498
|
else
|
|
3493
3499
|
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
3494
3500
|
end
|
|
3501
|
+
elsif Utils.match_status_code(http_response.status, ['400', '401', '403', '404'])
|
|
3502
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
3503
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
3504
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
3505
|
+
hook_ctx: hook_ctx
|
|
3506
|
+
),
|
|
3507
|
+
response: http_response
|
|
3508
|
+
)
|
|
3509
|
+
response_data = http_response.env.response_body
|
|
3510
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
3511
|
+
obj.raw_response = http_response
|
|
3512
|
+
raise obj
|
|
3513
|
+
else
|
|
3514
|
+
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'
|
|
3515
|
+
end
|
|
3495
3516
|
elsif Utils.match_status_code(http_response.status, ['500'])
|
|
3496
3517
|
if Utils.match_content_type(content_type, 'application/json')
|
|
3497
3518
|
http_response = @sdk_configuration.hooks.after_success(
|
|
@@ -3507,7 +3528,7 @@ module Clerk
|
|
|
3507
3528
|
else
|
|
3508
3529
|
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
3509
3530
|
end
|
|
3510
|
-
elsif Utils.match_status_code(http_response.status, ['
|
|
3531
|
+
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
|
3511
3532
|
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
3512
3533
|
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
|
3513
3534
|
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
@@ -3519,22 +3540,20 @@ module Clerk
|
|
|
3519
3540
|
|
|
3520
3541
|
|
|
3521
3542
|
|
|
3522
|
-
def
|
|
3523
|
-
#
|
|
3524
|
-
#
|
|
3525
|
-
# Verifying a backup code will result it in being consumed (i.e. it will
|
|
3526
|
-
# become invalid).
|
|
3543
|
+
def verify_password(user_id:, body: nil, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
3544
|
+
# verify_password - Verify the password of a user
|
|
3545
|
+
# Check that the user's password matches the supplied input.
|
|
3527
3546
|
# Useful for custom auth flows and re-verification.
|
|
3528
|
-
request = Models::Operations::
|
|
3547
|
+
request = Models::Operations::VerifyPasswordRequest.new(
|
|
3529
3548
|
user_id: user_id,
|
|
3530
3549
|
body: body
|
|
3531
3550
|
)
|
|
3532
3551
|
url, params = @sdk_configuration.get_server_details
|
|
3533
3552
|
base_url = Utils.template_url(url, params)
|
|
3534
3553
|
url = Utils.generate_url(
|
|
3535
|
-
Models::Operations::
|
|
3554
|
+
Models::Operations::VerifyPasswordRequest,
|
|
3536
3555
|
base_url,
|
|
3537
|
-
'/users/{user_id}/
|
|
3556
|
+
'/users/{user_id}/verify_password',
|
|
3538
3557
|
request
|
|
3539
3558
|
)
|
|
3540
3559
|
headers = {}
|
|
@@ -3569,23 +3588,23 @@ module Clerk
|
|
|
3569
3588
|
|
|
3570
3589
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
3571
3590
|
timeout ||= @sdk_configuration.timeout
|
|
3572
|
-
|
|
3591
|
+
|
|
3573
3592
|
|
|
3574
3593
|
connection = @sdk_configuration.client.dup
|
|
3575
|
-
connection.
|
|
3594
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
3576
3595
|
|
|
3577
3596
|
hook_ctx = SDKHooks::HookContext.new(
|
|
3578
3597
|
config: @sdk_configuration,
|
|
3579
3598
|
base_url: base_url,
|
|
3580
3599
|
oauth2_scopes: nil,
|
|
3581
|
-
operation_id: '
|
|
3600
|
+
operation_id: 'VerifyPassword',
|
|
3582
3601
|
security_source: @sdk_configuration.security_source
|
|
3583
3602
|
)
|
|
3584
3603
|
|
|
3585
3604
|
error = nil
|
|
3586
3605
|
http_response = nil
|
|
3587
3606
|
|
|
3588
|
-
|
|
3607
|
+
|
|
3589
3608
|
begin
|
|
3590
3609
|
http_response = connection.post(url) do |req|
|
|
3591
3610
|
req.body = body
|
|
@@ -3622,13 +3641,13 @@ module Clerk
|
|
|
3622
3641
|
response: http_response
|
|
3623
3642
|
)
|
|
3624
3643
|
end
|
|
3625
|
-
|
|
3644
|
+
|
|
3626
3645
|
if http_response.nil?
|
|
3627
3646
|
raise error if !error.nil?
|
|
3628
3647
|
raise 'no response'
|
|
3629
3648
|
end
|
|
3630
3649
|
end
|
|
3631
|
-
|
|
3650
|
+
|
|
3632
3651
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
3633
3652
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
3634
3653
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -3639,8 +3658,8 @@ module Clerk
|
|
|
3639
3658
|
response: http_response
|
|
3640
3659
|
)
|
|
3641
3660
|
response_data = http_response.env.response_body
|
|
3642
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::
|
|
3643
|
-
response = Models::Operations::
|
|
3661
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::VerifyPasswordResponseBody)
|
|
3662
|
+
response = Models::Operations::VerifyPasswordResponse.new(
|
|
3644
3663
|
status_code: http_response.status,
|
|
3645
3664
|
content_type: content_type,
|
|
3646
3665
|
raw_response: http_response,
|
|
@@ -3678,22 +3697,36 @@ module Clerk
|
|
|
3678
3697
|
|
|
3679
3698
|
|
|
3680
3699
|
|
|
3681
|
-
def
|
|
3682
|
-
#
|
|
3683
|
-
#
|
|
3684
|
-
|
|
3685
|
-
|
|
3700
|
+
def verify_totp(user_id:, body: nil, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
3701
|
+
# verify_totp - Verify a TOTP or backup code for a user
|
|
3702
|
+
# Verify that the provided TOTP or backup code is valid for the user.
|
|
3703
|
+
# Verifying a backup code will result it in being consumed (i.e. it will
|
|
3704
|
+
# become invalid).
|
|
3705
|
+
# Useful for custom auth flows and re-verification.
|
|
3706
|
+
request = Models::Operations::VerifyTOTPRequest.new(
|
|
3707
|
+
user_id: user_id,
|
|
3708
|
+
body: body
|
|
3686
3709
|
)
|
|
3687
3710
|
url, params = @sdk_configuration.get_server_details
|
|
3688
3711
|
base_url = Utils.template_url(url, params)
|
|
3689
3712
|
url = Utils.generate_url(
|
|
3690
|
-
Models::Operations::
|
|
3713
|
+
Models::Operations::VerifyTOTPRequest,
|
|
3691
3714
|
base_url,
|
|
3692
|
-
'/users/{user_id}/
|
|
3715
|
+
'/users/{user_id}/verify_totp',
|
|
3693
3716
|
request
|
|
3694
3717
|
)
|
|
3695
3718
|
headers = {}
|
|
3696
3719
|
|
|
3720
|
+
req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json)
|
|
3721
|
+
headers['content-type'] = req_content_type
|
|
3722
|
+
|
|
3723
|
+
if form && !form.empty?
|
|
3724
|
+
body = Utils.encode_form(form)
|
|
3725
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
|
3726
|
+
body = URI.encode_www_form(data)
|
|
3727
|
+
else
|
|
3728
|
+
body = data
|
|
3729
|
+
end
|
|
3697
3730
|
headers['Accept'] = 'application/json'
|
|
3698
3731
|
headers['user-agent'] = @sdk_configuration.user_agent
|
|
3699
3732
|
retries ||= @sdk_configuration.retry_config
|
|
@@ -3714,25 +3747,26 @@ module Clerk
|
|
|
3714
3747
|
|
|
3715
3748
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
3716
3749
|
timeout ||= @sdk_configuration.timeout
|
|
3717
|
-
|
|
3750
|
+
|
|
3718
3751
|
|
|
3719
3752
|
connection = @sdk_configuration.client.dup
|
|
3720
|
-
connection.
|
|
3753
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
3721
3754
|
|
|
3722
3755
|
hook_ctx = SDKHooks::HookContext.new(
|
|
3723
3756
|
config: @sdk_configuration,
|
|
3724
3757
|
base_url: base_url,
|
|
3725
3758
|
oauth2_scopes: nil,
|
|
3726
|
-
operation_id: '
|
|
3759
|
+
operation_id: 'VerifyTOTP',
|
|
3727
3760
|
security_source: @sdk_configuration.security_source
|
|
3728
3761
|
)
|
|
3729
3762
|
|
|
3730
3763
|
error = nil
|
|
3731
3764
|
http_response = nil
|
|
3732
3765
|
|
|
3733
|
-
|
|
3766
|
+
|
|
3734
3767
|
begin
|
|
3735
|
-
http_response = connection.
|
|
3768
|
+
http_response = connection.post(url) do |req|
|
|
3769
|
+
req.body = body
|
|
3736
3770
|
req.headers.merge!(headers)
|
|
3737
3771
|
req.options.timeout = timeout unless timeout.nil?
|
|
3738
3772
|
Utils.configure_request_security(req, security)
|
|
@@ -3766,13 +3800,637 @@ module Clerk
|
|
|
3766
3800
|
response: http_response
|
|
3767
3801
|
)
|
|
3768
3802
|
end
|
|
3769
|
-
|
|
3803
|
+
|
|
3804
|
+
if http_response.nil?
|
|
3805
|
+
raise error if !error.nil?
|
|
3806
|
+
raise 'no response'
|
|
3807
|
+
end
|
|
3808
|
+
end
|
|
3809
|
+
|
|
3810
|
+
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
3811
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
|
3812
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
3813
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
3814
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
3815
|
+
hook_ctx: hook_ctx
|
|
3816
|
+
),
|
|
3817
|
+
response: http_response
|
|
3818
|
+
)
|
|
3819
|
+
response_data = http_response.env.response_body
|
|
3820
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::VerifyTOTPResponseBody)
|
|
3821
|
+
response = Models::Operations::VerifyTOTPResponse.new(
|
|
3822
|
+
status_code: http_response.status,
|
|
3823
|
+
content_type: content_type,
|
|
3824
|
+
raw_response: http_response,
|
|
3825
|
+
object: obj
|
|
3826
|
+
)
|
|
3827
|
+
|
|
3828
|
+
return response
|
|
3829
|
+
else
|
|
3830
|
+
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'
|
|
3831
|
+
end
|
|
3832
|
+
elsif Utils.match_status_code(http_response.status, ['500'])
|
|
3833
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
3834
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
3835
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
3836
|
+
hook_ctx: hook_ctx
|
|
3837
|
+
),
|
|
3838
|
+
response: http_response
|
|
3839
|
+
)
|
|
3840
|
+
response_data = http_response.env.response_body
|
|
3841
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
3842
|
+
obj.raw_response = http_response
|
|
3843
|
+
raise obj
|
|
3844
|
+
else
|
|
3845
|
+
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'
|
|
3846
|
+
end
|
|
3847
|
+
elsif Utils.match_status_code(http_response.status, ['400', '404', '422', '4XX'])
|
|
3848
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
3849
|
+
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
|
3850
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
3851
|
+
else
|
|
3852
|
+
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'
|
|
3853
|
+
|
|
3854
|
+
end
|
|
3855
|
+
end
|
|
3856
|
+
|
|
3857
|
+
|
|
3858
|
+
|
|
3859
|
+
def disable_mfa(user_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
3860
|
+
# disable_mfa - Disable a user's MFA methods
|
|
3861
|
+
# Disable all of a user's MFA methods (e.g. OTP sent via SMS, TOTP on their authenticator app) at once.
|
|
3862
|
+
request = Models::Operations::DisableMFARequest.new(
|
|
3863
|
+
user_id: user_id
|
|
3864
|
+
)
|
|
3865
|
+
url, params = @sdk_configuration.get_server_details
|
|
3866
|
+
base_url = Utils.template_url(url, params)
|
|
3867
|
+
url = Utils.generate_url(
|
|
3868
|
+
Models::Operations::DisableMFARequest,
|
|
3869
|
+
base_url,
|
|
3870
|
+
'/users/{user_id}/mfa',
|
|
3871
|
+
request
|
|
3872
|
+
)
|
|
3873
|
+
headers = {}
|
|
3874
|
+
|
|
3875
|
+
headers['Accept'] = 'application/json'
|
|
3876
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
3877
|
+
retries ||= @sdk_configuration.retry_config
|
|
3878
|
+
retries ||= Utils::RetryConfig.new(
|
|
3879
|
+
backoff: Utils::BackoffStrategy.new(
|
|
3880
|
+
exponent: 1.5,
|
|
3881
|
+
initial_interval: 500,
|
|
3882
|
+
max_elapsed_time: 3_600_000,
|
|
3883
|
+
max_interval: 60_000
|
|
3884
|
+
),
|
|
3885
|
+
retry_connection_errors: true,
|
|
3886
|
+
strategy: 'backoff'
|
|
3887
|
+
)
|
|
3888
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
|
3889
|
+
retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
|
|
3890
|
+
|
|
3891
|
+
security = @sdk_configuration.security_source&.call
|
|
3892
|
+
|
|
3893
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
3894
|
+
timeout ||= @sdk_configuration.timeout
|
|
3895
|
+
|
|
3896
|
+
|
|
3897
|
+
connection = @sdk_configuration.client.dup
|
|
3898
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
3899
|
+
|
|
3900
|
+
hook_ctx = SDKHooks::HookContext.new(
|
|
3901
|
+
config: @sdk_configuration,
|
|
3902
|
+
base_url: base_url,
|
|
3903
|
+
oauth2_scopes: nil,
|
|
3904
|
+
operation_id: 'DisableMFA',
|
|
3905
|
+
security_source: @sdk_configuration.security_source
|
|
3906
|
+
)
|
|
3907
|
+
|
|
3908
|
+
error = nil
|
|
3909
|
+
http_response = nil
|
|
3910
|
+
|
|
3911
|
+
|
|
3912
|
+
begin
|
|
3913
|
+
http_response = connection.delete(url) do |req|
|
|
3914
|
+
req.headers.merge!(headers)
|
|
3915
|
+
req.options.timeout = timeout unless timeout.nil?
|
|
3916
|
+
Utils.configure_request_security(req, security)
|
|
3917
|
+
http_headers&.each do |key, value|
|
|
3918
|
+
req.headers[key.to_s] = value
|
|
3919
|
+
end
|
|
3920
|
+
|
|
3921
|
+
@sdk_configuration.hooks.before_request(
|
|
3922
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
3923
|
+
hook_ctx: hook_ctx
|
|
3924
|
+
),
|
|
3925
|
+
request: req
|
|
3926
|
+
)
|
|
3927
|
+
end
|
|
3928
|
+
rescue StandardError => e
|
|
3929
|
+
error = e
|
|
3930
|
+
ensure
|
|
3931
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
3932
|
+
http_response = @sdk_configuration.hooks.after_error(
|
|
3933
|
+
error: error,
|
|
3934
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
|
3935
|
+
hook_ctx: hook_ctx
|
|
3936
|
+
),
|
|
3937
|
+
response: http_response
|
|
3938
|
+
)
|
|
3939
|
+
else
|
|
3940
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
3941
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
3942
|
+
hook_ctx: hook_ctx
|
|
3943
|
+
),
|
|
3944
|
+
response: http_response
|
|
3945
|
+
)
|
|
3946
|
+
end
|
|
3947
|
+
|
|
3948
|
+
if http_response.nil?
|
|
3949
|
+
raise error if !error.nil?
|
|
3950
|
+
raise 'no response'
|
|
3951
|
+
end
|
|
3952
|
+
end
|
|
3953
|
+
|
|
3954
|
+
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
3955
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
|
3956
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
3957
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
3958
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
3959
|
+
hook_ctx: hook_ctx
|
|
3960
|
+
),
|
|
3961
|
+
response: http_response
|
|
3962
|
+
)
|
|
3963
|
+
response_data = http_response.env.response_body
|
|
3964
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::DisableMFAResponseBody)
|
|
3965
|
+
response = Models::Operations::DisableMFAResponse.new(
|
|
3966
|
+
status_code: http_response.status,
|
|
3967
|
+
content_type: content_type,
|
|
3968
|
+
raw_response: http_response,
|
|
3969
|
+
object: obj
|
|
3970
|
+
)
|
|
3971
|
+
|
|
3972
|
+
return response
|
|
3973
|
+
else
|
|
3974
|
+
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'
|
|
3975
|
+
end
|
|
3976
|
+
elsif Utils.match_status_code(http_response.status, ['404'])
|
|
3977
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
3978
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
3979
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
3980
|
+
hook_ctx: hook_ctx
|
|
3981
|
+
),
|
|
3982
|
+
response: http_response
|
|
3983
|
+
)
|
|
3984
|
+
response_data = http_response.env.response_body
|
|
3985
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
3986
|
+
obj.raw_response = http_response
|
|
3987
|
+
raise obj
|
|
3988
|
+
else
|
|
3989
|
+
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'
|
|
3990
|
+
end
|
|
3991
|
+
elsif Utils.match_status_code(http_response.status, ['500'])
|
|
3992
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
3993
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
3994
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
3995
|
+
hook_ctx: hook_ctx
|
|
3996
|
+
),
|
|
3997
|
+
response: http_response
|
|
3998
|
+
)
|
|
3999
|
+
response_data = http_response.env.response_body
|
|
4000
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
4001
|
+
obj.raw_response = http_response
|
|
4002
|
+
raise obj
|
|
4003
|
+
else
|
|
4004
|
+
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'
|
|
4005
|
+
end
|
|
4006
|
+
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
|
4007
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
4008
|
+
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
|
4009
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
4010
|
+
else
|
|
4011
|
+
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'
|
|
4012
|
+
|
|
4013
|
+
end
|
|
4014
|
+
end
|
|
4015
|
+
|
|
4016
|
+
|
|
4017
|
+
|
|
4018
|
+
def delete_backup_codes(user_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
4019
|
+
# delete_backup_codes - Disable all user's Backup codes
|
|
4020
|
+
# Disable all of a user's backup codes.
|
|
4021
|
+
request = Models::Operations::DeleteBackupCodeRequest.new(
|
|
4022
|
+
user_id: user_id
|
|
4023
|
+
)
|
|
4024
|
+
url, params = @sdk_configuration.get_server_details
|
|
4025
|
+
base_url = Utils.template_url(url, params)
|
|
4026
|
+
url = Utils.generate_url(
|
|
4027
|
+
Models::Operations::DeleteBackupCodeRequest,
|
|
4028
|
+
base_url,
|
|
4029
|
+
'/users/{user_id}/backup_code',
|
|
4030
|
+
request
|
|
4031
|
+
)
|
|
4032
|
+
headers = {}
|
|
4033
|
+
|
|
4034
|
+
headers['Accept'] = 'application/json'
|
|
4035
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
4036
|
+
retries ||= @sdk_configuration.retry_config
|
|
4037
|
+
retries ||= Utils::RetryConfig.new(
|
|
4038
|
+
backoff: Utils::BackoffStrategy.new(
|
|
4039
|
+
exponent: 1.5,
|
|
4040
|
+
initial_interval: 500,
|
|
4041
|
+
max_elapsed_time: 3_600_000,
|
|
4042
|
+
max_interval: 60_000
|
|
4043
|
+
),
|
|
4044
|
+
retry_connection_errors: true,
|
|
4045
|
+
strategy: 'backoff'
|
|
4046
|
+
)
|
|
4047
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
|
4048
|
+
retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
|
|
4049
|
+
|
|
4050
|
+
security = @sdk_configuration.security_source&.call
|
|
4051
|
+
|
|
4052
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
4053
|
+
timeout ||= @sdk_configuration.timeout
|
|
4054
|
+
|
|
4055
|
+
|
|
4056
|
+
connection = @sdk_configuration.client.dup
|
|
4057
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
4058
|
+
|
|
4059
|
+
hook_ctx = SDKHooks::HookContext.new(
|
|
4060
|
+
config: @sdk_configuration,
|
|
4061
|
+
base_url: base_url,
|
|
4062
|
+
oauth2_scopes: nil,
|
|
4063
|
+
operation_id: 'DeleteBackupCode',
|
|
4064
|
+
security_source: @sdk_configuration.security_source
|
|
4065
|
+
)
|
|
4066
|
+
|
|
4067
|
+
error = nil
|
|
4068
|
+
http_response = nil
|
|
4069
|
+
|
|
4070
|
+
|
|
4071
|
+
begin
|
|
4072
|
+
http_response = connection.delete(url) do |req|
|
|
4073
|
+
req.headers.merge!(headers)
|
|
4074
|
+
req.options.timeout = timeout unless timeout.nil?
|
|
4075
|
+
Utils.configure_request_security(req, security)
|
|
4076
|
+
http_headers&.each do |key, value|
|
|
4077
|
+
req.headers[key.to_s] = value
|
|
4078
|
+
end
|
|
4079
|
+
|
|
4080
|
+
@sdk_configuration.hooks.before_request(
|
|
4081
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
4082
|
+
hook_ctx: hook_ctx
|
|
4083
|
+
),
|
|
4084
|
+
request: req
|
|
4085
|
+
)
|
|
4086
|
+
end
|
|
4087
|
+
rescue StandardError => e
|
|
4088
|
+
error = e
|
|
4089
|
+
ensure
|
|
4090
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
4091
|
+
http_response = @sdk_configuration.hooks.after_error(
|
|
4092
|
+
error: error,
|
|
4093
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
|
4094
|
+
hook_ctx: hook_ctx
|
|
4095
|
+
),
|
|
4096
|
+
response: http_response
|
|
4097
|
+
)
|
|
4098
|
+
else
|
|
4099
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
4100
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
4101
|
+
hook_ctx: hook_ctx
|
|
4102
|
+
),
|
|
4103
|
+
response: http_response
|
|
4104
|
+
)
|
|
4105
|
+
end
|
|
4106
|
+
|
|
4107
|
+
if http_response.nil?
|
|
4108
|
+
raise error if !error.nil?
|
|
4109
|
+
raise 'no response'
|
|
4110
|
+
end
|
|
4111
|
+
end
|
|
4112
|
+
|
|
4113
|
+
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
4114
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
|
4115
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
4116
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
4117
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
4118
|
+
hook_ctx: hook_ctx
|
|
4119
|
+
),
|
|
4120
|
+
response: http_response
|
|
4121
|
+
)
|
|
4122
|
+
response_data = http_response.env.response_body
|
|
4123
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::DeleteBackupCodeResponseBody)
|
|
4124
|
+
response = Models::Operations::DeleteBackupCodeResponse.new(
|
|
4125
|
+
status_code: http_response.status,
|
|
4126
|
+
content_type: content_type,
|
|
4127
|
+
raw_response: http_response,
|
|
4128
|
+
object: obj
|
|
4129
|
+
)
|
|
4130
|
+
|
|
4131
|
+
return response
|
|
4132
|
+
else
|
|
4133
|
+
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'
|
|
4134
|
+
end
|
|
4135
|
+
elsif Utils.match_status_code(http_response.status, ['404'])
|
|
4136
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
4137
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
4138
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
4139
|
+
hook_ctx: hook_ctx
|
|
4140
|
+
),
|
|
4141
|
+
response: http_response
|
|
4142
|
+
)
|
|
4143
|
+
response_data = http_response.env.response_body
|
|
4144
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
4145
|
+
obj.raw_response = http_response
|
|
4146
|
+
raise obj
|
|
4147
|
+
else
|
|
4148
|
+
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'
|
|
4149
|
+
end
|
|
4150
|
+
elsif Utils.match_status_code(http_response.status, ['500'])
|
|
4151
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
4152
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
4153
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
4154
|
+
hook_ctx: hook_ctx
|
|
4155
|
+
),
|
|
4156
|
+
response: http_response
|
|
4157
|
+
)
|
|
4158
|
+
response_data = http_response.env.response_body
|
|
4159
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
4160
|
+
obj.raw_response = http_response
|
|
4161
|
+
raise obj
|
|
4162
|
+
else
|
|
4163
|
+
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'
|
|
4164
|
+
end
|
|
4165
|
+
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
|
4166
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
4167
|
+
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
|
4168
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
4169
|
+
else
|
|
4170
|
+
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'
|
|
4171
|
+
|
|
4172
|
+
end
|
|
4173
|
+
end
|
|
4174
|
+
|
|
4175
|
+
|
|
4176
|
+
|
|
4177
|
+
def delete_passkey(user_id:, passkey_identification_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
4178
|
+
# delete_passkey - Delete a user passkey
|
|
4179
|
+
# Delete the passkey identification for a given user. The user is notified through email or SMS unless the passkey registration was never completed.
|
|
4180
|
+
request = Models::Operations::UserPasskeyDeleteRequest.new(
|
|
4181
|
+
user_id: user_id,
|
|
4182
|
+
passkey_identification_id: passkey_identification_id
|
|
4183
|
+
)
|
|
4184
|
+
url, params = @sdk_configuration.get_server_details
|
|
4185
|
+
base_url = Utils.template_url(url, params)
|
|
4186
|
+
url = Utils.generate_url(
|
|
4187
|
+
Models::Operations::UserPasskeyDeleteRequest,
|
|
4188
|
+
base_url,
|
|
4189
|
+
'/users/{user_id}/passkeys/{passkey_identification_id}',
|
|
4190
|
+
request
|
|
4191
|
+
)
|
|
4192
|
+
headers = {}
|
|
4193
|
+
|
|
4194
|
+
headers['Accept'] = 'application/json'
|
|
4195
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
4196
|
+
retries ||= @sdk_configuration.retry_config
|
|
4197
|
+
retries ||= Utils::RetryConfig.new(
|
|
4198
|
+
backoff: Utils::BackoffStrategy.new(
|
|
4199
|
+
exponent: 1.5,
|
|
4200
|
+
initial_interval: 500,
|
|
4201
|
+
max_elapsed_time: 3_600_000,
|
|
4202
|
+
max_interval: 60_000
|
|
4203
|
+
),
|
|
4204
|
+
retry_connection_errors: true,
|
|
4205
|
+
strategy: 'backoff'
|
|
4206
|
+
)
|
|
4207
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
|
4208
|
+
retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
|
|
4209
|
+
|
|
4210
|
+
security = @sdk_configuration.security_source&.call
|
|
4211
|
+
|
|
4212
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
4213
|
+
timeout ||= @sdk_configuration.timeout
|
|
4214
|
+
|
|
4215
|
+
|
|
4216
|
+
connection = @sdk_configuration.client.dup
|
|
4217
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
4218
|
+
|
|
4219
|
+
hook_ctx = SDKHooks::HookContext.new(
|
|
4220
|
+
config: @sdk_configuration,
|
|
4221
|
+
base_url: base_url,
|
|
4222
|
+
oauth2_scopes: nil,
|
|
4223
|
+
operation_id: 'UserPasskeyDelete',
|
|
4224
|
+
security_source: @sdk_configuration.security_source
|
|
4225
|
+
)
|
|
4226
|
+
|
|
4227
|
+
error = nil
|
|
4228
|
+
http_response = nil
|
|
4229
|
+
|
|
4230
|
+
|
|
4231
|
+
begin
|
|
4232
|
+
http_response = connection.delete(url) do |req|
|
|
4233
|
+
req.headers.merge!(headers)
|
|
4234
|
+
req.options.timeout = timeout unless timeout.nil?
|
|
4235
|
+
Utils.configure_request_security(req, security)
|
|
4236
|
+
http_headers&.each do |key, value|
|
|
4237
|
+
req.headers[key.to_s] = value
|
|
4238
|
+
end
|
|
4239
|
+
|
|
4240
|
+
@sdk_configuration.hooks.before_request(
|
|
4241
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
4242
|
+
hook_ctx: hook_ctx
|
|
4243
|
+
),
|
|
4244
|
+
request: req
|
|
4245
|
+
)
|
|
4246
|
+
end
|
|
4247
|
+
rescue StandardError => e
|
|
4248
|
+
error = e
|
|
4249
|
+
ensure
|
|
4250
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
4251
|
+
http_response = @sdk_configuration.hooks.after_error(
|
|
4252
|
+
error: error,
|
|
4253
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
|
4254
|
+
hook_ctx: hook_ctx
|
|
4255
|
+
),
|
|
4256
|
+
response: http_response
|
|
4257
|
+
)
|
|
4258
|
+
else
|
|
4259
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
4260
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
4261
|
+
hook_ctx: hook_ctx
|
|
4262
|
+
),
|
|
4263
|
+
response: http_response
|
|
4264
|
+
)
|
|
4265
|
+
end
|
|
4266
|
+
|
|
4267
|
+
if http_response.nil?
|
|
4268
|
+
raise error if !error.nil?
|
|
4269
|
+
raise 'no response'
|
|
4270
|
+
end
|
|
4271
|
+
end
|
|
4272
|
+
|
|
4273
|
+
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
4274
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
|
4275
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
4276
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
4277
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
4278
|
+
hook_ctx: hook_ctx
|
|
4279
|
+
),
|
|
4280
|
+
response: http_response
|
|
4281
|
+
)
|
|
4282
|
+
response_data = http_response.env.response_body
|
|
4283
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::DeletedObject)
|
|
4284
|
+
response = Models::Operations::UserPasskeyDeleteResponse.new(
|
|
4285
|
+
status_code: http_response.status,
|
|
4286
|
+
content_type: content_type,
|
|
4287
|
+
raw_response: http_response,
|
|
4288
|
+
deleted_object: obj
|
|
4289
|
+
)
|
|
4290
|
+
|
|
4291
|
+
return response
|
|
4292
|
+
else
|
|
4293
|
+
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'
|
|
4294
|
+
end
|
|
4295
|
+
elsif Utils.match_status_code(http_response.status, ['403', '404'])
|
|
4296
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
4297
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
4298
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
4299
|
+
hook_ctx: hook_ctx
|
|
4300
|
+
),
|
|
4301
|
+
response: http_response
|
|
4302
|
+
)
|
|
4303
|
+
response_data = http_response.env.response_body
|
|
4304
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
4305
|
+
obj.raw_response = http_response
|
|
4306
|
+
raise obj
|
|
4307
|
+
else
|
|
4308
|
+
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'
|
|
4309
|
+
end
|
|
4310
|
+
elsif Utils.match_status_code(http_response.status, ['500'])
|
|
4311
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
4312
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
4313
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
4314
|
+
hook_ctx: hook_ctx
|
|
4315
|
+
),
|
|
4316
|
+
response: http_response
|
|
4317
|
+
)
|
|
4318
|
+
response_data = http_response.env.response_body
|
|
4319
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
4320
|
+
obj.raw_response = http_response
|
|
4321
|
+
raise obj
|
|
4322
|
+
else
|
|
4323
|
+
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'
|
|
4324
|
+
end
|
|
4325
|
+
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
|
4326
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
4327
|
+
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
|
4328
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
4329
|
+
else
|
|
4330
|
+
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'
|
|
4331
|
+
|
|
4332
|
+
end
|
|
4333
|
+
end
|
|
4334
|
+
|
|
4335
|
+
|
|
4336
|
+
|
|
4337
|
+
def list_trusted_devices(user_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
4338
|
+
# list_trusted_devices - List a user's trusted devices
|
|
4339
|
+
# Returns the active trusted devices enrolled by the user.
|
|
4340
|
+
#
|
|
4341
|
+
# @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
4342
|
+
request = Models::Operations::ListUserTrustedDevicesRequest.new(
|
|
4343
|
+
user_id: user_id
|
|
4344
|
+
)
|
|
4345
|
+
url, params = @sdk_configuration.get_server_details
|
|
4346
|
+
base_url = Utils.template_url(url, params)
|
|
4347
|
+
url = Utils.generate_url(
|
|
4348
|
+
Models::Operations::ListUserTrustedDevicesRequest,
|
|
4349
|
+
base_url,
|
|
4350
|
+
'/users/{user_id}/trusted_devices',
|
|
4351
|
+
request
|
|
4352
|
+
)
|
|
4353
|
+
headers = {}
|
|
4354
|
+
|
|
4355
|
+
headers['Accept'] = 'application/json'
|
|
4356
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
4357
|
+
retries ||= @sdk_configuration.retry_config
|
|
4358
|
+
retries ||= Utils::RetryConfig.new(
|
|
4359
|
+
backoff: Utils::BackoffStrategy.new(
|
|
4360
|
+
exponent: 1.5,
|
|
4361
|
+
initial_interval: 500,
|
|
4362
|
+
max_elapsed_time: 3_600_000,
|
|
4363
|
+
max_interval: 60_000
|
|
4364
|
+
),
|
|
4365
|
+
retry_connection_errors: true,
|
|
4366
|
+
strategy: 'backoff'
|
|
4367
|
+
)
|
|
4368
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
|
4369
|
+
retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
|
|
4370
|
+
|
|
4371
|
+
security = @sdk_configuration.security_source&.call
|
|
4372
|
+
|
|
4373
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
4374
|
+
timeout ||= @sdk_configuration.timeout
|
|
4375
|
+
|
|
4376
|
+
|
|
4377
|
+
connection = @sdk_configuration.client.dup
|
|
4378
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
4379
|
+
|
|
4380
|
+
hook_ctx = SDKHooks::HookContext.new(
|
|
4381
|
+
config: @sdk_configuration,
|
|
4382
|
+
base_url: base_url,
|
|
4383
|
+
oauth2_scopes: nil,
|
|
4384
|
+
operation_id: 'ListUserTrustedDevices',
|
|
4385
|
+
security_source: @sdk_configuration.security_source
|
|
4386
|
+
)
|
|
4387
|
+
|
|
4388
|
+
error = nil
|
|
4389
|
+
http_response = nil
|
|
4390
|
+
|
|
4391
|
+
|
|
4392
|
+
begin
|
|
4393
|
+
http_response = connection.get(url) do |req|
|
|
4394
|
+
req.headers.merge!(headers)
|
|
4395
|
+
req.options.timeout = timeout unless timeout.nil?
|
|
4396
|
+
Utils.configure_request_security(req, security)
|
|
4397
|
+
http_headers&.each do |key, value|
|
|
4398
|
+
req.headers[key.to_s] = value
|
|
4399
|
+
end
|
|
4400
|
+
|
|
4401
|
+
@sdk_configuration.hooks.before_request(
|
|
4402
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
4403
|
+
hook_ctx: hook_ctx
|
|
4404
|
+
),
|
|
4405
|
+
request: req
|
|
4406
|
+
)
|
|
4407
|
+
end
|
|
4408
|
+
rescue StandardError => e
|
|
4409
|
+
error = e
|
|
4410
|
+
ensure
|
|
4411
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
4412
|
+
http_response = @sdk_configuration.hooks.after_error(
|
|
4413
|
+
error: error,
|
|
4414
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
|
4415
|
+
hook_ctx: hook_ctx
|
|
4416
|
+
),
|
|
4417
|
+
response: http_response
|
|
4418
|
+
)
|
|
4419
|
+
else
|
|
4420
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
4421
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
4422
|
+
hook_ctx: hook_ctx
|
|
4423
|
+
),
|
|
4424
|
+
response: http_response
|
|
4425
|
+
)
|
|
4426
|
+
end
|
|
4427
|
+
|
|
3770
4428
|
if http_response.nil?
|
|
3771
4429
|
raise error if !error.nil?
|
|
3772
4430
|
raise 'no response'
|
|
3773
4431
|
end
|
|
3774
4432
|
end
|
|
3775
|
-
|
|
4433
|
+
|
|
3776
4434
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
3777
4435
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
3778
4436
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -3783,19 +4441,19 @@ module Clerk
|
|
|
3783
4441
|
response: http_response
|
|
3784
4442
|
)
|
|
3785
4443
|
response_data = http_response.env.response_body
|
|
3786
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::
|
|
3787
|
-
response = Models::Operations::
|
|
4444
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::TrustedDeviceList)
|
|
4445
|
+
response = Models::Operations::ListUserTrustedDevicesResponse.new(
|
|
3788
4446
|
status_code: http_response.status,
|
|
3789
4447
|
content_type: content_type,
|
|
3790
4448
|
raw_response: http_response,
|
|
3791
|
-
|
|
4449
|
+
trusted_device_list: obj
|
|
3792
4450
|
)
|
|
3793
4451
|
|
|
3794
4452
|
return response
|
|
3795
4453
|
else
|
|
3796
4454
|
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'
|
|
3797
4455
|
end
|
|
3798
|
-
elsif Utils.match_status_code(http_response.status, ['404'])
|
|
4456
|
+
elsif Utils.match_status_code(http_response.status, ['403', '404'])
|
|
3799
4457
|
if Utils.match_content_type(content_type, 'application/json')
|
|
3800
4458
|
http_response = @sdk_configuration.hooks.after_success(
|
|
3801
4459
|
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
@@ -3837,18 +4495,21 @@ module Clerk
|
|
|
3837
4495
|
|
|
3838
4496
|
|
|
3839
4497
|
|
|
3840
|
-
def
|
|
3841
|
-
#
|
|
3842
|
-
#
|
|
3843
|
-
|
|
3844
|
-
|
|
4498
|
+
def revoke_trusted_device(user_id:, trusted_device_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
4499
|
+
# revoke_trusted_device - Revoke a user's trusted device
|
|
4500
|
+
# Revokes an active trusted device enrolled by the user.
|
|
4501
|
+
#
|
|
4502
|
+
# @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
4503
|
+
request = Models::Operations::RevokeUserTrustedDeviceRequest.new(
|
|
4504
|
+
user_id: user_id,
|
|
4505
|
+
trusted_device_id: trusted_device_id
|
|
3845
4506
|
)
|
|
3846
4507
|
url, params = @sdk_configuration.get_server_details
|
|
3847
4508
|
base_url = Utils.template_url(url, params)
|
|
3848
4509
|
url = Utils.generate_url(
|
|
3849
|
-
Models::Operations::
|
|
4510
|
+
Models::Operations::RevokeUserTrustedDeviceRequest,
|
|
3850
4511
|
base_url,
|
|
3851
|
-
'/users/{user_id}/
|
|
4512
|
+
'/users/{user_id}/trusted_devices/{trusted_device_id}',
|
|
3852
4513
|
request
|
|
3853
4514
|
)
|
|
3854
4515
|
headers = {}
|
|
@@ -3873,23 +4534,23 @@ module Clerk
|
|
|
3873
4534
|
|
|
3874
4535
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
3875
4536
|
timeout ||= @sdk_configuration.timeout
|
|
3876
|
-
|
|
4537
|
+
|
|
3877
4538
|
|
|
3878
4539
|
connection = @sdk_configuration.client.dup
|
|
3879
|
-
connection.
|
|
4540
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
3880
4541
|
|
|
3881
4542
|
hook_ctx = SDKHooks::HookContext.new(
|
|
3882
4543
|
config: @sdk_configuration,
|
|
3883
4544
|
base_url: base_url,
|
|
3884
4545
|
oauth2_scopes: nil,
|
|
3885
|
-
operation_id: '
|
|
4546
|
+
operation_id: 'RevokeUserTrustedDevice',
|
|
3886
4547
|
security_source: @sdk_configuration.security_source
|
|
3887
4548
|
)
|
|
3888
4549
|
|
|
3889
4550
|
error = nil
|
|
3890
4551
|
http_response = nil
|
|
3891
4552
|
|
|
3892
|
-
|
|
4553
|
+
|
|
3893
4554
|
begin
|
|
3894
4555
|
http_response = connection.delete(url) do |req|
|
|
3895
4556
|
req.headers.merge!(headers)
|
|
@@ -3925,13 +4586,172 @@ module Clerk
|
|
|
3925
4586
|
response: http_response
|
|
3926
4587
|
)
|
|
3927
4588
|
end
|
|
3928
|
-
|
|
4589
|
+
|
|
3929
4590
|
if http_response.nil?
|
|
3930
4591
|
raise error if !error.nil?
|
|
3931
4592
|
raise 'no response'
|
|
3932
4593
|
end
|
|
3933
4594
|
end
|
|
4595
|
+
|
|
4596
|
+
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
4597
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
|
4598
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
4599
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
4600
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
4601
|
+
hook_ctx: hook_ctx
|
|
4602
|
+
),
|
|
4603
|
+
response: http_response
|
|
4604
|
+
)
|
|
4605
|
+
response_data = http_response.env.response_body
|
|
4606
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::TrustedDevice)
|
|
4607
|
+
response = Models::Operations::RevokeUserTrustedDeviceResponse.new(
|
|
4608
|
+
status_code: http_response.status,
|
|
4609
|
+
content_type: content_type,
|
|
4610
|
+
raw_response: http_response,
|
|
4611
|
+
trusted_device: obj
|
|
4612
|
+
)
|
|
4613
|
+
|
|
4614
|
+
return response
|
|
4615
|
+
else
|
|
4616
|
+
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'
|
|
4617
|
+
end
|
|
4618
|
+
elsif Utils.match_status_code(http_response.status, ['403', '404'])
|
|
4619
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
4620
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
4621
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
4622
|
+
hook_ctx: hook_ctx
|
|
4623
|
+
),
|
|
4624
|
+
response: http_response
|
|
4625
|
+
)
|
|
4626
|
+
response_data = http_response.env.response_body
|
|
4627
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
4628
|
+
obj.raw_response = http_response
|
|
4629
|
+
raise obj
|
|
4630
|
+
else
|
|
4631
|
+
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'
|
|
4632
|
+
end
|
|
4633
|
+
elsif Utils.match_status_code(http_response.status, ['500'])
|
|
4634
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
4635
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
4636
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
4637
|
+
hook_ctx: hook_ctx
|
|
4638
|
+
),
|
|
4639
|
+
response: http_response
|
|
4640
|
+
)
|
|
4641
|
+
response_data = http_response.env.response_body
|
|
4642
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
4643
|
+
obj.raw_response = http_response
|
|
4644
|
+
raise obj
|
|
4645
|
+
else
|
|
4646
|
+
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'
|
|
4647
|
+
end
|
|
4648
|
+
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
|
4649
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
4650
|
+
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
|
4651
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
4652
|
+
else
|
|
4653
|
+
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'
|
|
4654
|
+
|
|
4655
|
+
end
|
|
4656
|
+
end
|
|
4657
|
+
|
|
4658
|
+
|
|
4659
|
+
|
|
4660
|
+
def list_biometric_credentials(user_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
4661
|
+
# list_biometric_credentials - List a user's biometric credentials
|
|
4662
|
+
# Returns the active biometric credentials enrolled by the user.
|
|
4663
|
+
request = Models::Operations::ListUserBiometricCredentialsRequest.new(
|
|
4664
|
+
user_id: user_id
|
|
4665
|
+
)
|
|
4666
|
+
url, params = @sdk_configuration.get_server_details
|
|
4667
|
+
base_url = Utils.template_url(url, params)
|
|
4668
|
+
url = Utils.generate_url(
|
|
4669
|
+
Models::Operations::ListUserBiometricCredentialsRequest,
|
|
4670
|
+
base_url,
|
|
4671
|
+
'/users/{user_id}/biometric_credentials',
|
|
4672
|
+
request
|
|
4673
|
+
)
|
|
4674
|
+
headers = {}
|
|
4675
|
+
|
|
4676
|
+
headers['Accept'] = 'application/json'
|
|
4677
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
4678
|
+
retries ||= @sdk_configuration.retry_config
|
|
4679
|
+
retries ||= Utils::RetryConfig.new(
|
|
4680
|
+
backoff: Utils::BackoffStrategy.new(
|
|
4681
|
+
exponent: 1.5,
|
|
4682
|
+
initial_interval: 500,
|
|
4683
|
+
max_elapsed_time: 3_600_000,
|
|
4684
|
+
max_interval: 60_000
|
|
4685
|
+
),
|
|
4686
|
+
retry_connection_errors: true,
|
|
4687
|
+
strategy: 'backoff'
|
|
4688
|
+
)
|
|
4689
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
|
4690
|
+
retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
|
|
4691
|
+
|
|
4692
|
+
security = @sdk_configuration.security_source&.call
|
|
4693
|
+
|
|
4694
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
4695
|
+
timeout ||= @sdk_configuration.timeout
|
|
4696
|
+
|
|
4697
|
+
|
|
4698
|
+
connection = @sdk_configuration.client.dup
|
|
4699
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
4700
|
+
|
|
4701
|
+
hook_ctx = SDKHooks::HookContext.new(
|
|
4702
|
+
config: @sdk_configuration,
|
|
4703
|
+
base_url: base_url,
|
|
4704
|
+
oauth2_scopes: nil,
|
|
4705
|
+
operation_id: 'ListUserBiometricCredentials',
|
|
4706
|
+
security_source: @sdk_configuration.security_source
|
|
4707
|
+
)
|
|
4708
|
+
|
|
4709
|
+
error = nil
|
|
4710
|
+
http_response = nil
|
|
3934
4711
|
|
|
4712
|
+
|
|
4713
|
+
begin
|
|
4714
|
+
http_response = connection.get(url) do |req|
|
|
4715
|
+
req.headers.merge!(headers)
|
|
4716
|
+
req.options.timeout = timeout unless timeout.nil?
|
|
4717
|
+
Utils.configure_request_security(req, security)
|
|
4718
|
+
http_headers&.each do |key, value|
|
|
4719
|
+
req.headers[key.to_s] = value
|
|
4720
|
+
end
|
|
4721
|
+
|
|
4722
|
+
@sdk_configuration.hooks.before_request(
|
|
4723
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
4724
|
+
hook_ctx: hook_ctx
|
|
4725
|
+
),
|
|
4726
|
+
request: req
|
|
4727
|
+
)
|
|
4728
|
+
end
|
|
4729
|
+
rescue StandardError => e
|
|
4730
|
+
error = e
|
|
4731
|
+
ensure
|
|
4732
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
4733
|
+
http_response = @sdk_configuration.hooks.after_error(
|
|
4734
|
+
error: error,
|
|
4735
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
|
4736
|
+
hook_ctx: hook_ctx
|
|
4737
|
+
),
|
|
4738
|
+
response: http_response
|
|
4739
|
+
)
|
|
4740
|
+
else
|
|
4741
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
4742
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
4743
|
+
hook_ctx: hook_ctx
|
|
4744
|
+
),
|
|
4745
|
+
response: http_response
|
|
4746
|
+
)
|
|
4747
|
+
end
|
|
4748
|
+
|
|
4749
|
+
if http_response.nil?
|
|
4750
|
+
raise error if !error.nil?
|
|
4751
|
+
raise 'no response'
|
|
4752
|
+
end
|
|
4753
|
+
end
|
|
4754
|
+
|
|
3935
4755
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
3936
4756
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
3937
4757
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -3942,19 +4762,19 @@ module Clerk
|
|
|
3942
4762
|
response: http_response
|
|
3943
4763
|
)
|
|
3944
4764
|
response_data = http_response.env.response_body
|
|
3945
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::
|
|
3946
|
-
response = Models::Operations::
|
|
4765
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::BiometricCredentialList)
|
|
4766
|
+
response = Models::Operations::ListUserBiometricCredentialsResponse.new(
|
|
3947
4767
|
status_code: http_response.status,
|
|
3948
4768
|
content_type: content_type,
|
|
3949
4769
|
raw_response: http_response,
|
|
3950
|
-
|
|
4770
|
+
biometric_credential_list: obj
|
|
3951
4771
|
)
|
|
3952
4772
|
|
|
3953
4773
|
return response
|
|
3954
4774
|
else
|
|
3955
4775
|
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'
|
|
3956
4776
|
end
|
|
3957
|
-
elsif Utils.match_status_code(http_response.status, ['404'])
|
|
4777
|
+
elsif Utils.match_status_code(http_response.status, ['403', '404'])
|
|
3958
4778
|
if Utils.match_content_type(content_type, 'application/json')
|
|
3959
4779
|
http_response = @sdk_configuration.hooks.after_success(
|
|
3960
4780
|
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
@@ -3996,19 +4816,19 @@ module Clerk
|
|
|
3996
4816
|
|
|
3997
4817
|
|
|
3998
4818
|
|
|
3999
|
-
def
|
|
4000
|
-
#
|
|
4001
|
-
#
|
|
4002
|
-
request = Models::Operations::
|
|
4819
|
+
def revoke_biometric_credential(user_id:, biometric_credential_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
4820
|
+
# revoke_biometric_credential - Revoke a user's biometric credential
|
|
4821
|
+
# Revokes an active biometric credential enrolled by the user.
|
|
4822
|
+
request = Models::Operations::RevokeUserBiometricCredentialRequest.new(
|
|
4003
4823
|
user_id: user_id,
|
|
4004
|
-
|
|
4824
|
+
biometric_credential_id: biometric_credential_id
|
|
4005
4825
|
)
|
|
4006
4826
|
url, params = @sdk_configuration.get_server_details
|
|
4007
4827
|
base_url = Utils.template_url(url, params)
|
|
4008
4828
|
url = Utils.generate_url(
|
|
4009
|
-
Models::Operations::
|
|
4829
|
+
Models::Operations::RevokeUserBiometricCredentialRequest,
|
|
4010
4830
|
base_url,
|
|
4011
|
-
'/users/{user_id}/
|
|
4831
|
+
'/users/{user_id}/biometric_credentials/{biometric_credential_id}',
|
|
4012
4832
|
request
|
|
4013
4833
|
)
|
|
4014
4834
|
headers = {}
|
|
@@ -4033,23 +4853,23 @@ module Clerk
|
|
|
4033
4853
|
|
|
4034
4854
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
4035
4855
|
timeout ||= @sdk_configuration.timeout
|
|
4036
|
-
|
|
4856
|
+
|
|
4037
4857
|
|
|
4038
4858
|
connection = @sdk_configuration.client.dup
|
|
4039
|
-
connection.
|
|
4859
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
4040
4860
|
|
|
4041
4861
|
hook_ctx = SDKHooks::HookContext.new(
|
|
4042
4862
|
config: @sdk_configuration,
|
|
4043
4863
|
base_url: base_url,
|
|
4044
4864
|
oauth2_scopes: nil,
|
|
4045
|
-
operation_id: '
|
|
4865
|
+
operation_id: 'RevokeUserBiometricCredential',
|
|
4046
4866
|
security_source: @sdk_configuration.security_source
|
|
4047
4867
|
)
|
|
4048
4868
|
|
|
4049
4869
|
error = nil
|
|
4050
4870
|
http_response = nil
|
|
4051
4871
|
|
|
4052
|
-
|
|
4872
|
+
|
|
4053
4873
|
begin
|
|
4054
4874
|
http_response = connection.delete(url) do |req|
|
|
4055
4875
|
req.headers.merge!(headers)
|
|
@@ -4085,13 +4905,13 @@ module Clerk
|
|
|
4085
4905
|
response: http_response
|
|
4086
4906
|
)
|
|
4087
4907
|
end
|
|
4088
|
-
|
|
4908
|
+
|
|
4089
4909
|
if http_response.nil?
|
|
4090
4910
|
raise error if !error.nil?
|
|
4091
4911
|
raise 'no response'
|
|
4092
4912
|
end
|
|
4093
4913
|
end
|
|
4094
|
-
|
|
4914
|
+
|
|
4095
4915
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
4096
4916
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
4097
4917
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -4102,12 +4922,12 @@ module Clerk
|
|
|
4102
4922
|
response: http_response
|
|
4103
4923
|
)
|
|
4104
4924
|
response_data = http_response.env.response_body
|
|
4105
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::
|
|
4106
|
-
response = Models::Operations::
|
|
4925
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::BiometricCredential)
|
|
4926
|
+
response = Models::Operations::RevokeUserBiometricCredentialResponse.new(
|
|
4107
4927
|
status_code: http_response.status,
|
|
4108
4928
|
content_type: content_type,
|
|
4109
4929
|
raw_response: http_response,
|
|
4110
|
-
|
|
4930
|
+
biometric_credential: obj
|
|
4111
4931
|
)
|
|
4112
4932
|
|
|
4113
4933
|
return response
|
|
@@ -4193,10 +5013,10 @@ module Clerk
|
|
|
4193
5013
|
|
|
4194
5014
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
4195
5015
|
timeout ||= @sdk_configuration.timeout
|
|
4196
|
-
|
|
5016
|
+
|
|
4197
5017
|
|
|
4198
5018
|
connection = @sdk_configuration.client.dup
|
|
4199
|
-
connection.
|
|
5019
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
4200
5020
|
|
|
4201
5021
|
hook_ctx = SDKHooks::HookContext.new(
|
|
4202
5022
|
config: @sdk_configuration,
|
|
@@ -4209,7 +5029,7 @@ module Clerk
|
|
|
4209
5029
|
error = nil
|
|
4210
5030
|
http_response = nil
|
|
4211
5031
|
|
|
4212
|
-
|
|
5032
|
+
|
|
4213
5033
|
begin
|
|
4214
5034
|
http_response = connection.delete(url) do |req|
|
|
4215
5035
|
req.headers.merge!(headers)
|
|
@@ -4245,13 +5065,13 @@ module Clerk
|
|
|
4245
5065
|
response: http_response
|
|
4246
5066
|
)
|
|
4247
5067
|
end
|
|
4248
|
-
|
|
5068
|
+
|
|
4249
5069
|
if http_response.nil?
|
|
4250
5070
|
raise error if !error.nil?
|
|
4251
5071
|
raise 'no response'
|
|
4252
5072
|
end
|
|
4253
5073
|
end
|
|
4254
|
-
|
|
5074
|
+
|
|
4255
5075
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
4256
5076
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
4257
5077
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -4352,10 +5172,10 @@ module Clerk
|
|
|
4352
5172
|
|
|
4353
5173
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
4354
5174
|
timeout ||= @sdk_configuration.timeout
|
|
4355
|
-
|
|
5175
|
+
|
|
4356
5176
|
|
|
4357
5177
|
connection = @sdk_configuration.client.dup
|
|
4358
|
-
connection.
|
|
5178
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
4359
5179
|
|
|
4360
5180
|
hook_ctx = SDKHooks::HookContext.new(
|
|
4361
5181
|
config: @sdk_configuration,
|
|
@@ -4368,7 +5188,7 @@ module Clerk
|
|
|
4368
5188
|
error = nil
|
|
4369
5189
|
http_response = nil
|
|
4370
5190
|
|
|
4371
|
-
|
|
5191
|
+
|
|
4372
5192
|
begin
|
|
4373
5193
|
http_response = connection.delete(url) do |req|
|
|
4374
5194
|
req.headers.merge!(headers)
|
|
@@ -4404,13 +5224,13 @@ module Clerk
|
|
|
4404
5224
|
response: http_response
|
|
4405
5225
|
)
|
|
4406
5226
|
end
|
|
4407
|
-
|
|
5227
|
+
|
|
4408
5228
|
if http_response.nil?
|
|
4409
5229
|
raise error if !error.nil?
|
|
4410
5230
|
raise 'no response'
|
|
4411
5231
|
end
|
|
4412
5232
|
end
|
|
4413
|
-
|
|
5233
|
+
|
|
4414
5234
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
4415
5235
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
4416
5236
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -4512,10 +5332,10 @@ module Clerk
|
|
|
4512
5332
|
|
|
4513
5333
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
4514
5334
|
timeout ||= @sdk_configuration.timeout
|
|
4515
|
-
|
|
5335
|
+
|
|
4516
5336
|
|
|
4517
5337
|
connection = @sdk_configuration.client.dup
|
|
4518
|
-
connection.
|
|
5338
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
4519
5339
|
|
|
4520
5340
|
hook_ctx = SDKHooks::HookContext.new(
|
|
4521
5341
|
config: @sdk_configuration,
|
|
@@ -4528,7 +5348,7 @@ module Clerk
|
|
|
4528
5348
|
error = nil
|
|
4529
5349
|
http_response = nil
|
|
4530
5350
|
|
|
4531
|
-
|
|
5351
|
+
|
|
4532
5352
|
begin
|
|
4533
5353
|
http_response = connection.delete(url) do |req|
|
|
4534
5354
|
req.headers.merge!(headers)
|
|
@@ -4564,13 +5384,13 @@ module Clerk
|
|
|
4564
5384
|
response: http_response
|
|
4565
5385
|
)
|
|
4566
5386
|
end
|
|
4567
|
-
|
|
5387
|
+
|
|
4568
5388
|
if http_response.nil?
|
|
4569
5389
|
raise error if !error.nil?
|
|
4570
5390
|
raise 'no response'
|
|
4571
5391
|
end
|
|
4572
5392
|
end
|
|
4573
|
-
|
|
5393
|
+
|
|
4574
5394
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
4575
5395
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
4576
5396
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -4682,10 +5502,10 @@ module Clerk
|
|
|
4682
5502
|
|
|
4683
5503
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
4684
5504
|
timeout ||= @sdk_configuration.timeout
|
|
4685
|
-
|
|
5505
|
+
|
|
4686
5506
|
|
|
4687
5507
|
connection = @sdk_configuration.client.dup
|
|
4688
|
-
connection.
|
|
5508
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
4689
5509
|
|
|
4690
5510
|
hook_ctx = SDKHooks::HookContext.new(
|
|
4691
5511
|
config: @sdk_configuration,
|
|
@@ -4698,7 +5518,7 @@ module Clerk
|
|
|
4698
5518
|
error = nil
|
|
4699
5519
|
http_response = nil
|
|
4700
5520
|
|
|
4701
|
-
|
|
5521
|
+
|
|
4702
5522
|
begin
|
|
4703
5523
|
http_response = connection.post(url) do |req|
|
|
4704
5524
|
req.body = body
|
|
@@ -4735,13 +5555,13 @@ module Clerk
|
|
|
4735
5555
|
response: http_response
|
|
4736
5556
|
)
|
|
4737
5557
|
end
|
|
4738
|
-
|
|
5558
|
+
|
|
4739
5559
|
if http_response.nil?
|
|
4740
5560
|
raise error if !error.nil?
|
|
4741
5561
|
raise 'no response'
|
|
4742
5562
|
end
|
|
4743
5563
|
end
|
|
4744
|
-
|
|
5564
|
+
|
|
4745
5565
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
4746
5566
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
4747
5567
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -4794,6 +5614,8 @@ module Clerk
|
|
|
4794
5614
|
def unset_password_compromised(user_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
4795
5615
|
# unset_password_compromised - Unset a user's password as compromised
|
|
4796
5616
|
# Sets the given user's password as no longer compromised. The user will no longer be prompted to reset their password on their next sign-in.
|
|
5617
|
+
#
|
|
5618
|
+
# If the user is in reserved-email password quarantine, the quarantine is preserved and the returned user will still have `requires_password_reset` set to `true`. Reserved-email password quarantine can only be cleared by completing a password reset or changing/removing the password.
|
|
4797
5619
|
request = Models::Operations::UnsetUserPasswordCompromisedRequest.new(
|
|
4798
5620
|
user_id: user_id
|
|
4799
5621
|
)
|
|
@@ -4827,10 +5649,10 @@ module Clerk
|
|
|
4827
5649
|
|
|
4828
5650
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
4829
5651
|
timeout ||= @sdk_configuration.timeout
|
|
4830
|
-
|
|
5652
|
+
|
|
4831
5653
|
|
|
4832
5654
|
connection = @sdk_configuration.client.dup
|
|
4833
|
-
connection.
|
|
5655
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
4834
5656
|
|
|
4835
5657
|
hook_ctx = SDKHooks::HookContext.new(
|
|
4836
5658
|
config: @sdk_configuration,
|
|
@@ -4843,7 +5665,7 @@ module Clerk
|
|
|
4843
5665
|
error = nil
|
|
4844
5666
|
http_response = nil
|
|
4845
5667
|
|
|
4846
|
-
|
|
5668
|
+
|
|
4847
5669
|
begin
|
|
4848
5670
|
http_response = connection.post(url) do |req|
|
|
4849
5671
|
req.headers.merge!(headers)
|
|
@@ -4879,13 +5701,13 @@ module Clerk
|
|
|
4879
5701
|
response: http_response
|
|
4880
5702
|
)
|
|
4881
5703
|
end
|
|
4882
|
-
|
|
5704
|
+
|
|
4883
5705
|
if http_response.nil?
|
|
4884
5706
|
raise error if !error.nil?
|
|
4885
5707
|
raise 'no response'
|
|
4886
5708
|
end
|
|
4887
5709
|
end
|
|
4888
|
-
|
|
5710
|
+
|
|
4889
5711
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
4890
5712
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
4891
5713
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -4969,10 +5791,10 @@ module Clerk
|
|
|
4969
5791
|
|
|
4970
5792
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
4971
5793
|
timeout ||= @sdk_configuration.timeout
|
|
4972
|
-
|
|
5794
|
+
|
|
4973
5795
|
|
|
4974
5796
|
connection = @sdk_configuration.client.dup
|
|
4975
|
-
connection.
|
|
5797
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
4976
5798
|
|
|
4977
5799
|
hook_ctx = SDKHooks::HookContext.new(
|
|
4978
5800
|
config: @sdk_configuration,
|
|
@@ -4985,7 +5807,7 @@ module Clerk
|
|
|
4985
5807
|
error = nil
|
|
4986
5808
|
http_response = nil
|
|
4987
5809
|
|
|
4988
|
-
|
|
5810
|
+
|
|
4989
5811
|
begin
|
|
4990
5812
|
http_response = connection.get(url) do |req|
|
|
4991
5813
|
req.headers.merge!(headers)
|
|
@@ -5022,13 +5844,13 @@ module Clerk
|
|
|
5022
5844
|
response: http_response
|
|
5023
5845
|
)
|
|
5024
5846
|
end
|
|
5025
|
-
|
|
5847
|
+
|
|
5026
5848
|
if http_response.nil?
|
|
5027
5849
|
raise error if !error.nil?
|
|
5028
5850
|
raise 'no response'
|
|
5029
5851
|
end
|
|
5030
5852
|
end
|
|
5031
|
-
|
|
5853
|
+
|
|
5032
5854
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
5033
5855
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
5034
5856
|
if Utils.match_content_type(content_type, 'application/json')
|