clerk-sdk-ruby 8.0.2 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/clerk/actortokens.rb +9 -9
- data/lib/clerk/admin_portal_link_tokens.rb +18 -18
- data/lib/clerk/agenttasks.rb +9 -9
- data/lib/clerk/allowlistidentifiers.rb +13 -13
- data/lib/clerk/api_keys.rb +48 -48
- data/lib/clerk/betafeatures.rb +12 -10
- data/lib/clerk/billing.rb +68 -68
- data/lib/clerk/blocklistidentifiers.rb +13 -13
- data/lib/clerk/clients.rb +13 -13
- data/lib/clerk/directories.rb +342 -46
- data/lib/clerk/domains.rb +23 -20
- data/lib/clerk/emailaddresses.rb +37 -37
- data/lib/clerk/emailandsmstemplates.rb +5 -5
- data/lib/clerk/emailsmstemplates.rb +17 -17
- data/lib/clerk/enterpriseconnections.rb +31 -31
- data/lib/clerk/instancesettings.rb +52 -50
- data/lib/clerk/invitations.rb +166 -18
- data/lib/clerk/jwks.rb +3 -3
- data/lib/clerk/jwttemplates.rb +21 -21
- data/lib/clerk/logs.rb +683 -0
- data/lib/clerk/m2m.rb +27 -27
- data/lib/clerk/machines.rb +41 -41
- data/lib/clerk/miscellaneous.rb +2 -2
- data/lib/clerk/models/components/clerkerror.rb +1 -1
- data/lib/clerk/models/components/data.rb +27 -0
- data/lib/clerk/models/components/{type.rbi → data.rbi} +2 -2
- data/lib/clerk/models/components/directory.rb +8 -2
- data/lib/clerk/models/components/directory.rbi +2 -0
- data/lib/clerk/models/components/directorygroup.rb +44 -0
- data/lib/clerk/models/components/{directory_group.rbi → directorygroup.rbi} +4 -0
- data/lib/clerk/models/components/directorygroup_object.rb +19 -0
- data/lib/clerk/models/components/directorygroup_object.rbi +11 -0
- data/lib/clerk/models/components/directorygroupmember.rb +40 -0
- data/lib/clerk/models/components/directorygroupmember.rbi +17 -0
- data/lib/clerk/models/components/directorygroupmember_list.rb +36 -0
- data/lib/clerk/models/components/directorygroupmember_list.rbi +15 -0
- data/lib/clerk/models/components/directorygroupmember_list_cursor.rb +40 -0
- data/lib/clerk/models/components/directorygroupmember_list_cursor.rbi +17 -0
- data/lib/clerk/models/components/directorygroupmember_object.rb +19 -0
- data/lib/clerk/models/components/directorygroupmember_object.rbi +11 -0
- data/lib/clerk/models/components/directorygrouprolemapping_deleted.rb +1 -1
- data/lib/clerk/models/components/emailaddress_verification_saml_clerkerror.rb +1 -1
- data/lib/clerk/models/components/enterpriseaccount.rb +1 -1
- 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_idp_certificate.rb +40 -0
- data/lib/clerk/models/components/enterpriseconnection_idp_certificate.rbi +17 -0
- data/lib/clerk/models/components/enterpriseconnection_saml_connection.rb +18 -1
- data/lib/clerk/models/components/enterpriseconnection_saml_connection.rbi +8 -0
- data/lib/clerk/models/components/enterpriseconnectiontestrun.rb +1 -1
- data/lib/clerk/models/components/enterpriseconnectiontestrun_log.rb +44 -0
- data/lib/clerk/models/components/enterpriseconnectiontestrun_log.rbi +19 -0
- data/lib/clerk/models/components/externalaccountwithverification.rb +2 -2
- data/lib/clerk/models/components/externalaccountwithverification_verification_oauth_clerkerror.rb +1 -1
- data/lib/clerk/models/components/first_event.rb +115 -0
- data/lib/clerk/models/components/first_event.rbi +49 -0
- data/lib/clerk/models/components/instance.rb +5 -1
- data/lib/clerk/models/components/instance.rbi +2 -0
- data/lib/clerk/models/components/instanceprotect.rb +1 -1
- data/lib/clerk/models/components/invitation.rb +1 -1
- data/lib/clerk/models/components/invitation_revoked.rb +2 -2
- data/lib/clerk/models/components/log.rb +87 -18
- data/lib/clerk/models/components/log.rbi +38 -8
- data/lib/clerk/models/components/log_impersonator.rb +32 -0
- data/lib/clerk/models/components/log_impersonator.rbi +13 -0
- data/lib/clerk/models/components/log_list.rb +39 -0
- data/lib/clerk/models/components/log_list.rbi +15 -0
- data/lib/clerk/models/components/log_list_cursor.rb +72 -0
- data/lib/clerk/models/components/log_list_cursor.rbi +29 -0
- data/lib/clerk/models/components/logapplicationcontext.rb +36 -0
- data/lib/clerk/models/components/logapplicationcontext.rbi +15 -0
- data/lib/clerk/models/components/logbrowsercontext.rb +36 -0
- data/lib/clerk/models/components/logbrowsercontext.rbi +15 -0
- data/lib/clerk/models/components/logcontext.rb +36 -0
- data/lib/clerk/models/components/logcontext.rbi +15 -0
- data/lib/clerk/models/components/logdevicecontext.rb +60 -0
- data/lib/clerk/models/components/logdevicecontext.rbi +27 -0
- data/lib/clerk/models/components/logdomaincontext.rb +36 -0
- data/lib/clerk/models/components/logdomaincontext.rbi +15 -0
- data/lib/clerk/models/components/logenvironmentcontext.rb +44 -0
- data/lib/clerk/models/components/logenvironmentcontext.rbi +19 -0
- data/lib/clerk/models/components/loggroup.rb +89 -0
- data/lib/clerk/models/components/loggroup.rbi +37 -0
- data/lib/clerk/models/components/loggroup_impersonator.rb +32 -0
- data/lib/clerk/models/components/loggroup_impersonator.rbi +13 -0
- data/lib/clerk/models/components/loggroup_object.rb +19 -0
- data/lib/clerk/models/components/loggroup_object.rbi +11 -0
- data/lib/clerk/models/components/loglocationcontext.rb +41 -0
- data/lib/clerk/models/components/loglocationcontext.rbi +17 -0
- data/lib/clerk/models/components/logschema.rb +68 -0
- data/lib/clerk/models/components/logschema.rbi +25 -0
- data/lib/clerk/models/components/logschemafield.rb +49 -0
- data/lib/clerk/models/components/logschemafield.rbi +19 -0
- data/lib/clerk/models/components/logschemafield_type.rb +22 -0
- data/lib/clerk/models/components/logschemafield_type.rbi +11 -0
- data/lib/clerk/models/components/logwithpayload.rb +110 -0
- data/lib/clerk/models/components/logwithpayload.rbi +49 -0
- data/lib/clerk/models/components/logwithpayload_impersonator.rb +32 -0
- data/lib/clerk/models/components/logwithpayload_impersonator.rbi +13 -0
- data/lib/clerk/models/components/machine_deleted.rb +1 -1
- data/lib/clerk/models/components/machinescope_deleted.rb +1 -1
- data/lib/clerk/models/components/next_page_status.rb +21 -0
- data/lib/clerk/models/components/next_page_status.rbi +11 -0
- data/lib/clerk/models/components/oauthaccesstoken.rb +1 -1
- data/lib/clerk/models/components/oauthapplication.rb +9 -1
- data/lib/clerk/models/components/oauthapplication.rbi +4 -0
- data/lib/clerk/models/components/oauthapplicationsettings.rb +9 -1
- data/lib/clerk/models/components/oauthapplicationsettings.rbi +4 -0
- data/lib/clerk/models/components/oauthapplicationwithsecret.rb +9 -1
- data/lib/clerk/models/components/oauthapplicationwithsecret.rbi +4 -0
- data/lib/clerk/models/components/organization.rb +13 -8
- data/lib/clerk/models/components/organization.rbi +4 -2
- data/lib/clerk/models/components/organizationinvitation.rb +2 -2
- data/lib/clerk/models/components/organizationinvitationwithpublicorganizationdata.rb +2 -2
- data/lib/clerk/models/components/organizationmembership.rb +2 -2
- data/lib/clerk/models/components/organizationmembership_organization.rb +13 -8
- data/lib/clerk/models/components/organizationmembership_organization.rbi +4 -2
- data/lib/clerk/models/components/organizationwithlogo.rb +13 -8
- data/lib/clerk/models/components/organizationwithlogo.rbi +4 -2
- data/lib/clerk/models/components/role_set_migration.rb +1 -1
- data/lib/clerk/models/components/roleset.rb +1 -1
- data/lib/clerk/models/components/{type.rb → roleset_type.rb} +2 -2
- data/lib/clerk/models/components/roleset_type.rbi +11 -0
- data/lib/clerk/models/components/samlaccount.rb +1 -1
- data/lib/clerk/models/components/samlaccount_clerkerror.rb +1 -1
- data/lib/clerk/models/components/samlconnection_1.rb +6 -1
- data/lib/clerk/models/components/samlconnection_1.rbi +2 -0
- data/lib/clerk/models/components/samlconnection_2.rb +6 -1
- data/lib/clerk/models/components/samlconnection_2.rbi +2 -0
- data/lib/clerk/models/components/samlconnection_idp_certificate_1.rb +40 -0
- data/lib/clerk/models/components/samlconnection_idp_certificate_1.rbi +17 -0
- data/lib/clerk/models/components/samlconnection_idp_certificate_2.rb +40 -0
- data/lib/clerk/models/components/samlconnection_idp_certificate_2.rbi +17 -0
- data/lib/clerk/models/components/scimdirectory.rb +8 -2
- data/lib/clerk/models/components/scimdirectory.rbi +2 -0
- data/lib/clerk/models/components/scimgrouprolemapping_deleted.rb +1 -1
- data/lib/clerk/models/components/session.rb +2 -2
- data/lib/clerk/models/components/signup.rb +7 -3
- data/lib/clerk/models/components/signup.rbi +2 -0
- data/lib/clerk/models/components/signupverification.rb +1 -1
- data/lib/clerk/models/components/ssobypassallowlistpublicuserdata.rb +58 -0
- data/lib/clerk/models/components/ssobypassallowlistpublicuserdata.rbi +25 -0
- data/lib/clerk/models/components/ssobypassallowlistuser.rb +49 -0
- data/lib/clerk/models/components/ssobypassallowlistuser.rbi +21 -0
- data/lib/clerk/models/components/ssobypassallowlistuser_object.rb +19 -0
- data/lib/clerk/models/components/ssobypassallowlistuser_object.rbi +11 -0
- data/lib/clerk/models/components/user.rb +8 -4
- data/lib/clerk/models/components/user.rbi +2 -0
- data/lib/clerk/models/components/user_directory.rb +1 -1
- data/lib/clerk/models/components/{directory_group.rb → user_directory_group.rb} +1 -1
- data/lib/clerk/models/components/user_directory_group.rbi +15 -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/waitlistentry_invitation.rb +1 -1
- data/lib/clerk/models/components.rb +37 -3
- data/lib/clerk/models/errors/apierror.rb +3 -3
- data/lib/clerk/models/errors/clerkerrors.rb +2 -2
- data/lib/clerk/models/errors/createadminportallinktoken_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/createadminportallinktoken_conflict_error.rb +1 -1
- data/lib/clerk/models/errors/createadminportallinktoken_forbidden_error.rb +1 -1
- data/lib/clerk/models/errors/createadminportallinktoken_unauthorized_error.rb +1 -1
- data/lib/clerk/models/errors/createapikey_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/createapikey_conflict_error.rb +1 -1
- data/lib/clerk/models/errors/createm2mtoken_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/createm2mtoken_conflict_error.rb +1 -1
- data/lib/clerk/models/errors/deleteapikey_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/deleteapikey_notfound_error.rb +1 -1
- data/lib/clerk/models/errors/getapikey_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/getapikey_notfound_error.rb +1 -1
- data/lib/clerk/models/errors/getapikeys_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/getapikeys_notfound_error.rb +1 -1
- data/lib/clerk/models/errors/getapikeysecret_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/getapikeysecret_notfound_error.rb +1 -1
- data/lib/clerk/models/errors/getm2mtokens_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/getm2mtokens_forbidden_error.rb +1 -1
- data/lib/clerk/models/errors/getm2mtokens_notfound_error.rb +1 -1
- data/lib/clerk/models/errors/revokeadminportallinktoken_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/revokeadminportallinktoken_forbidden_error.rb +1 -1
- data/lib/clerk/models/errors/revokeadminportallinktoken_notfound_error.rb +1 -1
- data/lib/clerk/models/errors/revokeadminportallinktoken_unauthorized_error.rb +1 -1
- data/lib/clerk/models/errors/revokeapikey_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/revokeapikey_notfound_error.rb +1 -1
- data/lib/clerk/models/errors/revokem2mtoken_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/revokem2mtoken_notfound_error.rb +1 -1
- data/lib/clerk/models/errors/updateapikey_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/updateapikey_notfound_error.rb +1 -1
- data/lib/clerk/models/errors/verifyapikey_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/verifyapikey_notfound_error.rb +1 -1
- data/lib/clerk/models/errors/verifym2mtoken_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/verifym2mtoken_notfound_error.rb +1 -1
- data/lib/clerk/models/errors/verifyoauthaccesstoken_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/verifyoauthaccesstoken_notfound_error.rb +1 -1
- data/lib/clerk/models/operations/act.rb +40 -0
- data/lib/clerk/models/operations/act.rbi +17 -0
- data/lib/clerk/models/operations/act_act.rb +36 -0
- data/lib/clerk/models/operations/act_act.rbi +15 -0
- data/lib/clerk/models/operations/actor.rb +1 -1
- data/lib/clerk/models/operations/attemptemailaddressverification_requestbody.rb +7 -1
- data/lib/clerk/models/operations/attemptemailaddressverification_requestbody.rbi +2 -0
- data/lib/clerk/models/operations/attemptphonenumberverification_requestbody.rb +7 -1
- data/lib/clerk/models/operations/attemptphonenumberverification_requestbody.rbi +2 -0
- data/lib/clerk/models/operations/clerkidpoauthaccesstoken.rb +5 -1
- data/lib/clerk/models/operations/clerkidpoauthaccesstoken.rbi +2 -0
- data/lib/clerk/models/operations/createbulkinvitations_requestbody.rb +1 -1
- data/lib/clerk/models/operations/createenterpriseconnection_saml.rb +8 -2
- data/lib/clerk/models/operations/createenterpriseconnection_saml.rbi +2 -0
- data/lib/clerk/models/operations/createinvitation_request.rb +1 -1
- data/lib/clerk/models/operations/createoauthapplication_request.rb +13 -1
- data/lib/clerk/models/operations/createoauthapplication_request.rbi +6 -0
- data/lib/clerk/models/operations/createorganization_request.rb +2 -2
- data/lib/clerk/models/operations/createorganizationinvitation_requestbody.rb +2 -2
- data/lib/clerk/models/operations/createorganizationinvitationbulk_requestbody.rb +2 -2
- data/lib/clerk/models/operations/createorganizationmembership_requestbody.rb +2 -2
- data/lib/clerk/models/operations/createsamlconnection_requestbody_1.rb +8 -2
- data/lib/clerk/models/operations/createsamlconnection_requestbody_1.rbi +2 -0
- data/lib/clerk/models/operations/createsamlconnection_requestbody_2.rb +8 -2
- data/lib/clerk/models/operations/createsamlconnection_requestbody_2.rbi +2 -0
- data/lib/clerk/models/operations/createsignintoken_request.rb +17 -2
- data/lib/clerk/models/operations/createsignintoken_request.rbi +4 -0
- data/lib/clerk/models/operations/createssobypassallowlistuser_request.rb +32 -0
- data/lib/clerk/models/operations/createssobypassallowlistuser_request.rbi +13 -0
- data/lib/clerk/models/operations/createssobypassallowlistuser_response.rb +44 -0
- data/lib/clerk/models/operations/createssobypassallowlistuser_response.rbi +19 -0
- data/lib/clerk/models/operations/createuser_request.rb +8 -4
- data/lib/clerk/models/operations/createuser_request.rbi +2 -0
- data/lib/clerk/models/operations/deleteapikey_responsebody.rb +1 -1
- data/lib/clerk/models/operations/deleteinvitation_request.rb +32 -0
- data/lib/clerk/models/operations/deleteinvitation_request.rbi +13 -0
- data/lib/clerk/models/operations/deleteinvitation_response.rb +44 -0
- data/lib/clerk/models/operations/deleteinvitation_response.rbi +19 -0
- data/lib/clerk/models/operations/deletessobypassallowlistuser_request.rb +32 -0
- data/lib/clerk/models/operations/deletessobypassallowlistuser_request.rbi +13 -0
- data/lib/clerk/models/operations/deletessobypassallowlistuser_response.rb +44 -0
- data/lib/clerk/models/operations/deletessobypassallowlistuser_response.rbi +19 -0
- data/lib/clerk/models/operations/filter_match.rb +27 -0
- data/lib/clerk/models/operations/filter_match.rbi +11 -0
- data/lib/clerk/models/operations/getdirectorygroup_request.rb +36 -0
- data/lib/clerk/models/operations/getdirectorygroup_request.rbi +15 -0
- data/lib/clerk/models/operations/getdirectorygroup_response.rb +44 -0
- data/lib/clerk/models/operations/getdirectorygroup_response.rbi +19 -0
- data/lib/clerk/models/operations/getlog_request.rb +34 -0
- data/lib/clerk/models/operations/getlog_request.rbi +13 -0
- data/lib/clerk/models/operations/getlog_response.rb +44 -0
- data/lib/clerk/models/operations/getlog_response.rbi +19 -0
- data/lib/clerk/models/operations/getlogschema_request.rb +35 -0
- data/lib/clerk/models/operations/getlogschema_request.rbi +13 -0
- data/lib/clerk/models/operations/getlogschema_response.rb +44 -0
- data/lib/clerk/models/operations/getlogschema_response.rbi +19 -0
- data/lib/clerk/models/operations/listdirectorygroupmembers_request.rb +45 -0
- data/lib/clerk/models/operations/listdirectorygroupmembers_request.rbi +19 -0
- data/lib/clerk/models/operations/listdirectorygroupmembers_response.rb +44 -0
- data/lib/clerk/models/operations/listdirectorygroupmembers_response.rbi +19 -0
- data/lib/clerk/models/operations/listinvitations_request.rb +6 -1
- data/lib/clerk/models/operations/listinvitations_request.rbi +2 -0
- data/lib/clerk/models/operations/listloggroupevents_request.rb +47 -0
- data/lib/clerk/models/operations/listloggroupevents_request.rbi +19 -0
- data/lib/clerk/models/operations/listloggroupevents_response.rb +44 -0
- data/lib/clerk/models/operations/listloggroupevents_response.rbi +19 -0
- data/lib/clerk/models/operations/listlogs_request.rb +228 -0
- data/lib/clerk/models/operations/listlogs_request.rbi +55 -0
- data/lib/clerk/models/operations/listlogs_response.rb +44 -0
- data/lib/clerk/models/operations/listlogs_response.rbi +19 -0
- data/lib/clerk/models/operations/listssobypassallowlistusers_request.rb +32 -0
- data/lib/clerk/models/operations/listssobypassallowlistusers_request.rbi +13 -0
- data/lib/clerk/models/operations/listssobypassallowlistusers_response.rb +44 -0
- data/lib/clerk/models/operations/listssobypassallowlistusers_response.rbi +19 -0
- data/lib/clerk/models/operations/mergeorganizationmetadata_requestbody.rb +2 -2
- data/lib/clerk/models/operations/mergeuser_request.rb +36 -0
- data/lib/clerk/models/operations/mergeuser_request.rbi +15 -0
- data/lib/clerk/models/operations/mergeuser_requestbody.rb +36 -0
- data/lib/clerk/models/operations/mergeuser_requestbody.rbi +15 -0
- data/lib/clerk/models/operations/mergeuser_response.rb +44 -0
- data/lib/clerk/models/operations/mergeuser_response.rbi +19 -0
- data/lib/clerk/models/operations/mergeuser_responsebody.rb +36 -0
- data/lib/clerk/models/operations/mergeuser_responsebody.rbi +15 -0
- data/lib/clerk/models/operations/refreshsession_requestbody.rb +1 -1
- data/lib/clerk/models/operations/replaceorganizationmetadata_requestbody.rb +2 -2
- data/lib/clerk/models/operations/replaceroleset_requestbody.rb +1 -1
- data/lib/clerk/models/operations/replaceusermetadata_requestbody.rb +3 -3
- data/lib/clerk/models/operations/responsebody.rb +1 -1
- data/lib/clerk/models/operations/revokesession_request.rb +5 -1
- data/lib/clerk/models/operations/revokesession_request.rbi +2 -0
- data/lib/clerk/models/operations/revokesession_requestbody.rb +36 -0
- data/lib/clerk/models/operations/revokesession_requestbody.rbi +13 -0
- data/lib/clerk/models/operations/second_factor_verification.rb +25 -0
- data/lib/clerk/models/operations/second_factor_verification.rbi +11 -0
- data/lib/clerk/models/operations/updatedirectory_requestbody.rb +8 -2
- data/lib/clerk/models/operations/updatedirectory_requestbody.rbi +2 -0
- data/lib/clerk/models/operations/updateenterpriseconnection_saml.rb +8 -2
- data/lib/clerk/models/operations/updateenterpriseconnection_saml.rbi +2 -0
- data/lib/clerk/models/operations/updateinstance_request.rb +1 -1
- data/lib/clerk/models/operations/updateinstanceoauthapplicationsettings_request.rb +9 -1
- data/lib/clerk/models/operations/updateinstanceoauthapplicationsettings_request.rbi +4 -0
- data/lib/clerk/models/operations/updateinstanceprotect_request.rb +1 -5
- data/lib/clerk/models/operations/updateinstanceprotect_request.rbi +0 -2
- data/lib/clerk/models/operations/updateoauthapplication_requestbody.rb +13 -1
- data/lib/clerk/models/operations/updateoauthapplication_requestbody.rbi +6 -0
- data/lib/clerk/models/operations/updateorganization_requestbody.rb +12 -2
- data/lib/clerk/models/operations/updateorganization_requestbody.rbi +4 -0
- data/lib/clerk/models/operations/updateorganizationmembershipmetadata_requestbody.rb +2 -2
- data/lib/clerk/models/operations/updatesamlconnection_requestbody.rb +8 -2
- data/lib/clerk/models/operations/updatesamlconnection_requestbody.rbi +2 -0
- data/lib/clerk/models/operations/updatescimdirectory_requestbody.rb +8 -2
- data/lib/clerk/models/operations/updatescimdirectory_requestbody.rbi +2 -0
- data/lib/clerk/models/operations/updatesession_request.rb +36 -0
- data/lib/clerk/models/operations/updatesession_request.rbi +15 -0
- data/lib/clerk/models/operations/updatesession_requestbody.rb +33 -0
- data/lib/clerk/models/operations/updatesession_requestbody.rbi +13 -0
- data/lib/clerk/models/operations/updatesession_response.rb +44 -0
- data/lib/clerk/models/operations/updatesession_response.rbi +19 -0
- data/lib/clerk/models/operations/updateuser_requestbody.rb +5 -1
- data/lib/clerk/models/operations/updateuser_requestbody.rbi +2 -0
- data/lib/clerk/models/operations/updateusermetadata_requestbody.rb +3 -3
- data/lib/clerk/models/operations/verifypassword_requestbody.rb +7 -1
- data/lib/clerk/models/operations/verifypassword_requestbody.rbi +2 -0
- data/lib/clerk/models/operations/verifytotp_requestbody.rb +7 -1
- data/lib/clerk/models/operations/verifytotp_requestbody.rbi +2 -0
- data/lib/clerk/models/operations/view.rb +38 -0
- data/lib/clerk/models/operations/view.rbi +11 -0
- data/lib/clerk/models/operations.rb +33 -0
- data/lib/clerk/oauthaccesstokens.rb +7 -7
- data/lib/clerk/oauthapplications.rb +37 -37
- data/lib/clerk/openapiclient.rb +3 -1
- data/lib/clerk/organizationdomains.rb +28 -28
- data/lib/clerk/organizationinvitations.rb +35 -35
- data/lib/clerk/organizationmemberships.rb +25 -25
- data/lib/clerk/organizationpermissions.rb +24 -24
- data/lib/clerk/organizationroles.rb +32 -32
- data/lib/clerk/organizations.rb +61 -61
- data/lib/clerk/phonenumbers.rb +36 -36
- data/lib/clerk/proxychecks.rb +5 -5
- data/lib/clerk/redirecturls.rb +16 -16
- data/lib/clerk/rolesets.rb +38 -38
- data/lib/clerk/samlconnections.rb +23 -23
- data/lib/clerk/scimdirectories.rb +46 -46
- data/lib/clerk/sdk_hooks/types.rb +4 -4
- data/lib/clerk/sdkconfiguration.rb +4 -4
- data/lib/clerk/sessions.rb +219 -42
- data/lib/clerk/signintokens.rb +9 -9
- data/lib/clerk/signups.rb +9 -9
- data/lib/clerk/ssobypassallowlistusers.rb +477 -0
- data/lib/clerk/templates.rb +5 -5
- data/lib/clerk/testingtokens.rb +3 -3
- data/lib/clerk/users.rb +376 -189
- data/lib/clerk/utils/forms.rb +9 -9
- data/lib/clerk/utils/headers.rb +2 -2
- data/lib/clerk/utils/query_params.rb +6 -6
- data/lib/clerk/utils/request_bodies.rb +2 -2
- data/lib/clerk/utils/retries.rb +5 -5
- data/lib/clerk/utils/security.rb +4 -4
- data/lib/clerk/utils/utils.rb +13 -13
- data/lib/clerk/waitlistentries.rb +26 -26
- data/lib/clerk/webhooks.rb +11 -11
- data/lib/clerk_sdk_ruby.rb +2 -0
- metadata +142 -6
data/lib/clerk/logs.rb
ADDED
|
@@ -0,0 +1,683 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: false
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
require 'faraday'
|
|
7
|
+
require 'faraday/multipart'
|
|
8
|
+
require 'faraday/retry'
|
|
9
|
+
require_relative 'sdk_hooks/hooks'
|
|
10
|
+
require_relative 'utils/retries'
|
|
11
|
+
|
|
12
|
+
module Clerk
|
|
13
|
+
|
|
14
|
+
class Logs
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def initialize(sdk_config)
|
|
21
|
+
@sdk_configuration = sdk_config
|
|
22
|
+
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def get_url(base_url:, url_variables: nil)
|
|
27
|
+
sd_base_url, sd_options = @sdk_configuration.get_server_details
|
|
28
|
+
|
|
29
|
+
if base_url.nil?
|
|
30
|
+
base_url = sd_base_url
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
if url_variables.nil?
|
|
34
|
+
url_variables = sd_options
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
return Utils.template_url base_url, url_variables
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def list(request:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
45
|
+
# list - List all logs
|
|
46
|
+
# Returns a list of logs for the authenticated instance.
|
|
47
|
+
#
|
|
48
|
+
# Use it to find specific events, such as one user's failed sign-ins or
|
|
49
|
+
# every event in a trace. Narrow the search with filters and a time range
|
|
50
|
+
# (`event_time_after` and `event_time_before`), and stop paginating once
|
|
51
|
+
# you have what you need. Syncing or exporting logs through this endpoint
|
|
52
|
+
# isn't allowed; use log drains, part of the Enterprise plan, instead.
|
|
53
|
+
#
|
|
54
|
+
# Results are paginated with cursors. The `next_page_status` field in the
|
|
55
|
+
# cursor object says whether more results exist:
|
|
56
|
+
# - `"true"`: more results are available. Pass `starting_after` to get the
|
|
57
|
+
# next page.
|
|
58
|
+
# - `"unknown"`: to keep latency predictable, the server read only part of
|
|
59
|
+
# the time range, reported as `searched_from` and `searched_to`. More
|
|
60
|
+
# matches may exist in the rest of the range; pass `starting_after` to
|
|
61
|
+
# keep searching.
|
|
62
|
+
# - `"false"`: no more results exist within the requested range.
|
|
63
|
+
#
|
|
64
|
+
# Results never go back further than the plan's log retention.
|
|
65
|
+
# `retention_floor` in the cursor object is the oldest timestamp the plan
|
|
66
|
+
# can return. `retention_limit_reached` is `true` when `next_page_status`
|
|
67
|
+
# is `"false"` because the search ended at that floor, either because
|
|
68
|
+
# `event_time_after` asked for older events or because it was omitted.
|
|
69
|
+
url, params = @sdk_configuration.get_server_details
|
|
70
|
+
base_url = Utils.template_url(url, params)
|
|
71
|
+
url = "#{base_url}/logs"
|
|
72
|
+
headers = {}
|
|
73
|
+
|
|
74
|
+
query_params = Utils.get_query_params(Models::Operations::ListLogsRequest, request, nil)
|
|
75
|
+
headers['Accept'] = 'application/json'
|
|
76
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
77
|
+
retries ||= @sdk_configuration.retry_config
|
|
78
|
+
retries ||= Utils::RetryConfig.new(
|
|
79
|
+
backoff: Utils::BackoffStrategy.new(
|
|
80
|
+
exponent: 1.5,
|
|
81
|
+
initial_interval: 500,
|
|
82
|
+
max_elapsed_time: 3_600_000,
|
|
83
|
+
max_interval: 60_000
|
|
84
|
+
),
|
|
85
|
+
retry_connection_errors: true,
|
|
86
|
+
strategy: 'backoff'
|
|
87
|
+
)
|
|
88
|
+
retry_options = retries.to_faraday_retry_options(initial_time: ::Time.now)
|
|
89
|
+
retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
|
|
90
|
+
|
|
91
|
+
security = @sdk_configuration.security_source&.call
|
|
92
|
+
|
|
93
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
94
|
+
timeout ||= @sdk_configuration.timeout
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
connection = @sdk_configuration.client.dup
|
|
98
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
99
|
+
|
|
100
|
+
hook_ctx = SDKHooks::HookContext.new(
|
|
101
|
+
config: @sdk_configuration,
|
|
102
|
+
base_url: base_url,
|
|
103
|
+
oauth2_scopes: nil,
|
|
104
|
+
operation_id: 'ListLogs',
|
|
105
|
+
security_source: @sdk_configuration.security_source
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
error = nil
|
|
109
|
+
http_response = nil
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
begin
|
|
113
|
+
http_response = connection.get(url) do |req|
|
|
114
|
+
req.headers.merge!(headers)
|
|
115
|
+
req.options.timeout = timeout unless timeout.nil?
|
|
116
|
+
req.params = query_params
|
|
117
|
+
Utils.configure_request_security(req, security)
|
|
118
|
+
http_headers&.each do |key, value|
|
|
119
|
+
req.headers[key.to_s] = value
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
@sdk_configuration.hooks.before_request(
|
|
123
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
124
|
+
hook_ctx: hook_ctx
|
|
125
|
+
),
|
|
126
|
+
request: req
|
|
127
|
+
)
|
|
128
|
+
end
|
|
129
|
+
rescue ::StandardError => e
|
|
130
|
+
error = e
|
|
131
|
+
ensure
|
|
132
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
133
|
+
http_response = @sdk_configuration.hooks.after_error(
|
|
134
|
+
error: error,
|
|
135
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
|
136
|
+
hook_ctx: hook_ctx
|
|
137
|
+
),
|
|
138
|
+
response: http_response
|
|
139
|
+
)
|
|
140
|
+
else
|
|
141
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
142
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
143
|
+
hook_ctx: hook_ctx
|
|
144
|
+
),
|
|
145
|
+
response: http_response
|
|
146
|
+
)
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
if http_response.nil?
|
|
150
|
+
raise error if !error.nil?
|
|
151
|
+
raise 'no response'
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
156
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
|
157
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
158
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
159
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
160
|
+
hook_ctx: hook_ctx
|
|
161
|
+
),
|
|
162
|
+
response: http_response
|
|
163
|
+
)
|
|
164
|
+
response_data = http_response.env.response_body
|
|
165
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Components::LogList)
|
|
166
|
+
response = Models::Operations::ListLogsResponse.new(
|
|
167
|
+
status_code: http_response.status,
|
|
168
|
+
content_type: content_type,
|
|
169
|
+
raw_response: http_response,
|
|
170
|
+
log_list: obj
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
return response
|
|
174
|
+
else
|
|
175
|
+
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'
|
|
176
|
+
end
|
|
177
|
+
elsif Utils.match_status_code(http_response.status, ['401', '403', '422', '429'])
|
|
178
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
179
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
180
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
181
|
+
hook_ctx: hook_ctx
|
|
182
|
+
),
|
|
183
|
+
response: http_response
|
|
184
|
+
)
|
|
185
|
+
response_data = http_response.env.response_body
|
|
186
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
187
|
+
obj.raw_response = http_response
|
|
188
|
+
raise obj
|
|
189
|
+
else
|
|
190
|
+
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'
|
|
191
|
+
end
|
|
192
|
+
elsif Utils.match_status_code(http_response.status, ['503'])
|
|
193
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
194
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
195
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
196
|
+
hook_ctx: hook_ctx
|
|
197
|
+
),
|
|
198
|
+
response: http_response
|
|
199
|
+
)
|
|
200
|
+
response_data = http_response.env.response_body
|
|
201
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
202
|
+
obj.raw_response = http_response
|
|
203
|
+
raise obj
|
|
204
|
+
else
|
|
205
|
+
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'
|
|
206
|
+
end
|
|
207
|
+
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
|
208
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
209
|
+
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
|
210
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
211
|
+
else
|
|
212
|
+
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'
|
|
213
|
+
|
|
214
|
+
end
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
def get_schema(type:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
220
|
+
# get_schema - Retrieve the payload schema of a log event type
|
|
221
|
+
# Returns the payload schema of a log event type: which fields its
|
|
222
|
+
# payload carries, addressed by the dot-paths that the `payload_filter`
|
|
223
|
+
# and `payload_fields` parameters of the list endpoint accept.
|
|
224
|
+
#
|
|
225
|
+
# `type` accepts a concrete event type (`sign_in.completed`), a
|
|
226
|
+
# trailing-`*` wildcard (`sign_in.*`), or a bare family name (`sign_in`,
|
|
227
|
+
# normalized to `sign_in.*` when no concrete type matches — the
|
|
228
|
+
# response's `event_type`
|
|
229
|
+
# echoes the normalized form). For wildcard lookups the fields are the
|
|
230
|
+
# intersection across every matching event type, and `matched_event_types`
|
|
231
|
+
# lists what the intersection was computed over; per-type metadata
|
|
232
|
+
# (description, severity, docs_group) is present only for concrete types.
|
|
233
|
+
#
|
|
234
|
+
# The response is the same for every instance.
|
|
235
|
+
request = Models::Operations::GetLogSchemaRequest.new(
|
|
236
|
+
type: type
|
|
237
|
+
)
|
|
238
|
+
url, params = @sdk_configuration.get_server_details
|
|
239
|
+
base_url = Utils.template_url(url, params)
|
|
240
|
+
url = "#{base_url}/logs/schemas"
|
|
241
|
+
headers = {}
|
|
242
|
+
|
|
243
|
+
query_params = Utils.get_query_params(Models::Operations::GetLogSchemaRequest, request, nil)
|
|
244
|
+
headers['Accept'] = 'application/json'
|
|
245
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
246
|
+
retries ||= @sdk_configuration.retry_config
|
|
247
|
+
retries ||= Utils::RetryConfig.new(
|
|
248
|
+
backoff: Utils::BackoffStrategy.new(
|
|
249
|
+
exponent: 1.5,
|
|
250
|
+
initial_interval: 500,
|
|
251
|
+
max_elapsed_time: 3_600_000,
|
|
252
|
+
max_interval: 60_000
|
|
253
|
+
),
|
|
254
|
+
retry_connection_errors: true,
|
|
255
|
+
strategy: 'backoff'
|
|
256
|
+
)
|
|
257
|
+
retry_options = retries.to_faraday_retry_options(initial_time: ::Time.now)
|
|
258
|
+
retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
|
|
259
|
+
|
|
260
|
+
security = @sdk_configuration.security_source&.call
|
|
261
|
+
|
|
262
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
263
|
+
timeout ||= @sdk_configuration.timeout
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
connection = @sdk_configuration.client.dup
|
|
267
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
268
|
+
|
|
269
|
+
hook_ctx = SDKHooks::HookContext.new(
|
|
270
|
+
config: @sdk_configuration,
|
|
271
|
+
base_url: base_url,
|
|
272
|
+
oauth2_scopes: nil,
|
|
273
|
+
operation_id: 'GetLogSchema',
|
|
274
|
+
security_source: @sdk_configuration.security_source
|
|
275
|
+
)
|
|
276
|
+
|
|
277
|
+
error = nil
|
|
278
|
+
http_response = nil
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
begin
|
|
282
|
+
http_response = connection.get(url) do |req|
|
|
283
|
+
req.headers.merge!(headers)
|
|
284
|
+
req.options.timeout = timeout unless timeout.nil?
|
|
285
|
+
req.params = query_params
|
|
286
|
+
Utils.configure_request_security(req, security)
|
|
287
|
+
http_headers&.each do |key, value|
|
|
288
|
+
req.headers[key.to_s] = value
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
@sdk_configuration.hooks.before_request(
|
|
292
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
293
|
+
hook_ctx: hook_ctx
|
|
294
|
+
),
|
|
295
|
+
request: req
|
|
296
|
+
)
|
|
297
|
+
end
|
|
298
|
+
rescue ::StandardError => e
|
|
299
|
+
error = e
|
|
300
|
+
ensure
|
|
301
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
302
|
+
http_response = @sdk_configuration.hooks.after_error(
|
|
303
|
+
error: error,
|
|
304
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
|
305
|
+
hook_ctx: hook_ctx
|
|
306
|
+
),
|
|
307
|
+
response: http_response
|
|
308
|
+
)
|
|
309
|
+
else
|
|
310
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
311
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
312
|
+
hook_ctx: hook_ctx
|
|
313
|
+
),
|
|
314
|
+
response: http_response
|
|
315
|
+
)
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
if http_response.nil?
|
|
319
|
+
raise error if !error.nil?
|
|
320
|
+
raise 'no response'
|
|
321
|
+
end
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
325
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
|
326
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
327
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
328
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
329
|
+
hook_ctx: hook_ctx
|
|
330
|
+
),
|
|
331
|
+
response: http_response
|
|
332
|
+
)
|
|
333
|
+
response_data = http_response.env.response_body
|
|
334
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Components::LogSchema)
|
|
335
|
+
response = Models::Operations::GetLogSchemaResponse.new(
|
|
336
|
+
status_code: http_response.status,
|
|
337
|
+
content_type: content_type,
|
|
338
|
+
raw_response: http_response,
|
|
339
|
+
log_schema: obj
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
return response
|
|
343
|
+
else
|
|
344
|
+
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'
|
|
345
|
+
end
|
|
346
|
+
elsif Utils.match_status_code(http_response.status, ['401', '403', '422', '429'])
|
|
347
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
348
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
349
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
350
|
+
hook_ctx: hook_ctx
|
|
351
|
+
),
|
|
352
|
+
response: http_response
|
|
353
|
+
)
|
|
354
|
+
response_data = http_response.env.response_body
|
|
355
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
356
|
+
obj.raw_response = http_response
|
|
357
|
+
raise obj
|
|
358
|
+
else
|
|
359
|
+
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'
|
|
360
|
+
end
|
|
361
|
+
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
|
362
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
363
|
+
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
|
364
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
365
|
+
else
|
|
366
|
+
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'
|
|
367
|
+
|
|
368
|
+
end
|
|
369
|
+
end
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
def list_group_events(group_id:, started_at:, limit: nil, starting_after: nil, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
374
|
+
# list_group_events - List an event group's logs
|
|
375
|
+
# Returns the log entries of one event group past the ones a grouped
|
|
376
|
+
# page of `GET /logs` includes, oldest first, for loading
|
|
377
|
+
# more of a group. Accepts the same event filters as listing logs, so a
|
|
378
|
+
# filtered page keeps loading only matching events.
|
|
379
|
+
request = Models::Operations::ListLogGroupEventsRequest.new(
|
|
380
|
+
group_id: group_id,
|
|
381
|
+
started_at: started_at,
|
|
382
|
+
limit: limit,
|
|
383
|
+
starting_after: starting_after
|
|
384
|
+
)
|
|
385
|
+
url, params = @sdk_configuration.get_server_details
|
|
386
|
+
base_url = Utils.template_url(url, params)
|
|
387
|
+
url = Utils.generate_url(
|
|
388
|
+
Models::Operations::ListLogGroupEventsRequest,
|
|
389
|
+
base_url,
|
|
390
|
+
'/logs/groups/{group_id}/events',
|
|
391
|
+
request
|
|
392
|
+
)
|
|
393
|
+
headers = {}
|
|
394
|
+
|
|
395
|
+
query_params = Utils.get_query_params(Models::Operations::ListLogGroupEventsRequest, request, nil)
|
|
396
|
+
headers['Accept'] = 'application/json'
|
|
397
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
398
|
+
retries ||= @sdk_configuration.retry_config
|
|
399
|
+
retries ||= Utils::RetryConfig.new(
|
|
400
|
+
backoff: Utils::BackoffStrategy.new(
|
|
401
|
+
exponent: 1.5,
|
|
402
|
+
initial_interval: 500,
|
|
403
|
+
max_elapsed_time: 3_600_000,
|
|
404
|
+
max_interval: 60_000
|
|
405
|
+
),
|
|
406
|
+
retry_connection_errors: true,
|
|
407
|
+
strategy: 'backoff'
|
|
408
|
+
)
|
|
409
|
+
retry_options = retries.to_faraday_retry_options(initial_time: ::Time.now)
|
|
410
|
+
retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
|
|
411
|
+
|
|
412
|
+
security = @sdk_configuration.security_source&.call
|
|
413
|
+
|
|
414
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
415
|
+
timeout ||= @sdk_configuration.timeout
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
connection = @sdk_configuration.client.dup
|
|
419
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
420
|
+
|
|
421
|
+
hook_ctx = SDKHooks::HookContext.new(
|
|
422
|
+
config: @sdk_configuration,
|
|
423
|
+
base_url: base_url,
|
|
424
|
+
oauth2_scopes: nil,
|
|
425
|
+
operation_id: 'ListLogGroupEvents',
|
|
426
|
+
security_source: @sdk_configuration.security_source
|
|
427
|
+
)
|
|
428
|
+
|
|
429
|
+
error = nil
|
|
430
|
+
http_response = nil
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
begin
|
|
434
|
+
http_response = connection.get(url) do |req|
|
|
435
|
+
req.headers.merge!(headers)
|
|
436
|
+
req.options.timeout = timeout unless timeout.nil?
|
|
437
|
+
req.params = query_params
|
|
438
|
+
Utils.configure_request_security(req, security)
|
|
439
|
+
http_headers&.each do |key, value|
|
|
440
|
+
req.headers[key.to_s] = value
|
|
441
|
+
end
|
|
442
|
+
|
|
443
|
+
@sdk_configuration.hooks.before_request(
|
|
444
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
445
|
+
hook_ctx: hook_ctx
|
|
446
|
+
),
|
|
447
|
+
request: req
|
|
448
|
+
)
|
|
449
|
+
end
|
|
450
|
+
rescue ::StandardError => e
|
|
451
|
+
error = e
|
|
452
|
+
ensure
|
|
453
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
454
|
+
http_response = @sdk_configuration.hooks.after_error(
|
|
455
|
+
error: error,
|
|
456
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
|
457
|
+
hook_ctx: hook_ctx
|
|
458
|
+
),
|
|
459
|
+
response: http_response
|
|
460
|
+
)
|
|
461
|
+
else
|
|
462
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
463
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
464
|
+
hook_ctx: hook_ctx
|
|
465
|
+
),
|
|
466
|
+
response: http_response
|
|
467
|
+
)
|
|
468
|
+
end
|
|
469
|
+
|
|
470
|
+
if http_response.nil?
|
|
471
|
+
raise error if !error.nil?
|
|
472
|
+
raise 'no response'
|
|
473
|
+
end
|
|
474
|
+
end
|
|
475
|
+
|
|
476
|
+
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
477
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
|
478
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
479
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
480
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
481
|
+
hook_ctx: hook_ctx
|
|
482
|
+
),
|
|
483
|
+
response: http_response
|
|
484
|
+
)
|
|
485
|
+
response_data = http_response.env.response_body
|
|
486
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Components::LogList)
|
|
487
|
+
response = Models::Operations::ListLogGroupEventsResponse.new(
|
|
488
|
+
status_code: http_response.status,
|
|
489
|
+
content_type: content_type,
|
|
490
|
+
raw_response: http_response,
|
|
491
|
+
log_list: obj
|
|
492
|
+
)
|
|
493
|
+
|
|
494
|
+
return response
|
|
495
|
+
else
|
|
496
|
+
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'
|
|
497
|
+
end
|
|
498
|
+
elsif Utils.match_status_code(http_response.status, ['401', '403', '422', '429'])
|
|
499
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
500
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
501
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
502
|
+
hook_ctx: hook_ctx
|
|
503
|
+
),
|
|
504
|
+
response: http_response
|
|
505
|
+
)
|
|
506
|
+
response_data = http_response.env.response_body
|
|
507
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
508
|
+
obj.raw_response = http_response
|
|
509
|
+
raise obj
|
|
510
|
+
else
|
|
511
|
+
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'
|
|
512
|
+
end
|
|
513
|
+
elsif Utils.match_status_code(http_response.status, ['503'])
|
|
514
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
515
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
516
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
517
|
+
hook_ctx: hook_ctx
|
|
518
|
+
),
|
|
519
|
+
response: http_response
|
|
520
|
+
)
|
|
521
|
+
response_data = http_response.env.response_body
|
|
522
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
523
|
+
obj.raw_response = http_response
|
|
524
|
+
raise obj
|
|
525
|
+
else
|
|
526
|
+
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'
|
|
527
|
+
end
|
|
528
|
+
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
|
529
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
530
|
+
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
|
531
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
532
|
+
else
|
|
533
|
+
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'
|
|
534
|
+
|
|
535
|
+
end
|
|
536
|
+
end
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
def get(event_time_and_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
541
|
+
# get - Retrieve a single log
|
|
542
|
+
# Returns a single log entry by its composite key ({event_time_ms}:{event_id}).
|
|
543
|
+
# Unlike the list endpoint, this returns the full payload for the event.
|
|
544
|
+
request = Models::Operations::GetLogRequest.new(
|
|
545
|
+
event_time_and_id: event_time_and_id
|
|
546
|
+
)
|
|
547
|
+
url, params = @sdk_configuration.get_server_details
|
|
548
|
+
base_url = Utils.template_url(url, params)
|
|
549
|
+
url = Utils.generate_url(
|
|
550
|
+
Models::Operations::GetLogRequest,
|
|
551
|
+
base_url,
|
|
552
|
+
'/logs/{event_time_and_id}',
|
|
553
|
+
request
|
|
554
|
+
)
|
|
555
|
+
headers = {}
|
|
556
|
+
|
|
557
|
+
headers['Accept'] = 'application/json'
|
|
558
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
559
|
+
retries ||= @sdk_configuration.retry_config
|
|
560
|
+
retries ||= Utils::RetryConfig.new(
|
|
561
|
+
backoff: Utils::BackoffStrategy.new(
|
|
562
|
+
exponent: 1.5,
|
|
563
|
+
initial_interval: 500,
|
|
564
|
+
max_elapsed_time: 3_600_000,
|
|
565
|
+
max_interval: 60_000
|
|
566
|
+
),
|
|
567
|
+
retry_connection_errors: true,
|
|
568
|
+
strategy: 'backoff'
|
|
569
|
+
)
|
|
570
|
+
retry_options = retries.to_faraday_retry_options(initial_time: ::Time.now)
|
|
571
|
+
retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
|
|
572
|
+
|
|
573
|
+
security = @sdk_configuration.security_source&.call
|
|
574
|
+
|
|
575
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
576
|
+
timeout ||= @sdk_configuration.timeout
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
connection = @sdk_configuration.client.dup
|
|
580
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
581
|
+
|
|
582
|
+
hook_ctx = SDKHooks::HookContext.new(
|
|
583
|
+
config: @sdk_configuration,
|
|
584
|
+
base_url: base_url,
|
|
585
|
+
oauth2_scopes: nil,
|
|
586
|
+
operation_id: 'GetLog',
|
|
587
|
+
security_source: @sdk_configuration.security_source
|
|
588
|
+
)
|
|
589
|
+
|
|
590
|
+
error = nil
|
|
591
|
+
http_response = nil
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
begin
|
|
595
|
+
http_response = connection.get(url) do |req|
|
|
596
|
+
req.headers.merge!(headers)
|
|
597
|
+
req.options.timeout = timeout unless timeout.nil?
|
|
598
|
+
Utils.configure_request_security(req, security)
|
|
599
|
+
http_headers&.each do |key, value|
|
|
600
|
+
req.headers[key.to_s] = value
|
|
601
|
+
end
|
|
602
|
+
|
|
603
|
+
@sdk_configuration.hooks.before_request(
|
|
604
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
605
|
+
hook_ctx: hook_ctx
|
|
606
|
+
),
|
|
607
|
+
request: req
|
|
608
|
+
)
|
|
609
|
+
end
|
|
610
|
+
rescue ::StandardError => e
|
|
611
|
+
error = e
|
|
612
|
+
ensure
|
|
613
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
614
|
+
http_response = @sdk_configuration.hooks.after_error(
|
|
615
|
+
error: error,
|
|
616
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
|
617
|
+
hook_ctx: hook_ctx
|
|
618
|
+
),
|
|
619
|
+
response: http_response
|
|
620
|
+
)
|
|
621
|
+
else
|
|
622
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
623
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
624
|
+
hook_ctx: hook_ctx
|
|
625
|
+
),
|
|
626
|
+
response: http_response
|
|
627
|
+
)
|
|
628
|
+
end
|
|
629
|
+
|
|
630
|
+
if http_response.nil?
|
|
631
|
+
raise error if !error.nil?
|
|
632
|
+
raise 'no response'
|
|
633
|
+
end
|
|
634
|
+
end
|
|
635
|
+
|
|
636
|
+
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
637
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
|
638
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
639
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
640
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
641
|
+
hook_ctx: hook_ctx
|
|
642
|
+
),
|
|
643
|
+
response: http_response
|
|
644
|
+
)
|
|
645
|
+
response_data = http_response.env.response_body
|
|
646
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Components::LogWithPayload)
|
|
647
|
+
response = Models::Operations::GetLogResponse.new(
|
|
648
|
+
status_code: http_response.status,
|
|
649
|
+
content_type: content_type,
|
|
650
|
+
raw_response: http_response,
|
|
651
|
+
log_with_payload: obj
|
|
652
|
+
)
|
|
653
|
+
|
|
654
|
+
return response
|
|
655
|
+
else
|
|
656
|
+
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'
|
|
657
|
+
end
|
|
658
|
+
elsif Utils.match_status_code(http_response.status, ['401', '403', '404', '429'])
|
|
659
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
660
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
661
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
662
|
+
hook_ctx: hook_ctx
|
|
663
|
+
),
|
|
664
|
+
response: http_response
|
|
665
|
+
)
|
|
666
|
+
response_data = http_response.env.response_body
|
|
667
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
668
|
+
obj.raw_response = http_response
|
|
669
|
+
raise obj
|
|
670
|
+
else
|
|
671
|
+
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'
|
|
672
|
+
end
|
|
673
|
+
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
|
674
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
675
|
+
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
|
676
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
677
|
+
else
|
|
678
|
+
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'
|
|
679
|
+
|
|
680
|
+
end
|
|
681
|
+
end
|
|
682
|
+
end
|
|
683
|
+
end
|