From 298ab54564b56bb8f59f137be1e36911b0a20375 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Thu, 23 Jan 2025 20:59:03 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.472.1 --- .gitignore | 1 + .speakeasy/gen.lock | 1539 +++++++++-------- .speakeasy/gen.yaml | 3 +- .speakeasy/workflow.lock | 14 +- README.md | 13 +- RELEASES.md | 12 +- docs/models/createinvitationrequestbody.md | 5 +- .../createoauthapplicationrequestbody.md | 2 +- ...createorganizationinvitationbulkrequest.md | 8 +- ...teorganizationinvitationbulkrequestbody.md | 13 + .../createorganizationinvitationrequest.md | 8 +- ...createorganizationinvitationrequestbody.md | 17 +- docs/models/createorganizationrequestbody.md | 2 +- .../models/createsamlconnectionrequestbody.md | 1 + docs/models/createsessionrequestbody.md | 8 + .../createsessiontokenfromtemplaterequest.md | 9 +- ...eatesessiontokenfromtemplaterequestbody.md | 8 + docs/models/createsessiontokenobject.md | 8 + docs/models/createsessiontokenrequest.md | 9 + docs/models/createsessiontokenrequestbody.md | 8 + docs/models/createsessiontokenresponsebody.md | 11 + docs/models/createwaitlistentryrequestbody.md | 9 + docs/models/emailaddress.md | 3 +- docs/models/fromoauth.md | 12 + docs/models/fromoauthverificationstatus.md | 9 + docs/models/getuserlistrequest.md | 10 +- docs/models/getuserscountrequest.md | 5 +- docs/models/instance.md | 13 + docs/models/instanceobject.md | 10 + docs/models/{wellknownjwks.md => jwks.md} | 2 +- docs/models/keys.md | 4 +- docs/models/listinvitationsrequest.md | 3 +- docs/models/listsamlconnectionsrequest.md | 9 +- .../listwaitlistentriesqueryparamstatus.md | 13 + docs/models/listwaitlistentriesrequest.md | 12 + docs/models/oauth.md | 13 - docs/models/oauthapplication.md | 2 + docs/models/oauthapplicationwithsecret.md | 2 + docs/models/oauthverificationstatus.md | 12 - docs/models/oauthverificationstrategy.md | 16 - docs/models/organization.md | 2 +- docs/models/organizationinvitation.md | 2 + ...ioninvitationwithpublicorganizationdata.md | 1 + .../organizationmembershiporganization.md | 2 +- docs/models/organizationwithlogo.md | 2 +- docs/models/requestbody.md | 16 +- docs/models/responsebody.md | 3 +- docs/models/schemassamlconnection.md | 1 + docs/models/signup.md | 51 +- docs/models/templateslug.md | 12 + docs/models/type.md | 3 +- docs/models/updateemailaddressrequest.md | 8 +- docs/models/updatejwttemplaterequest.md | 8 +- ...teorganizationmembershipmetadatarequest.md | 10 +- docs/models/updatephonenumberrequest.md | 8 +- .../models/updatesamlconnectionrequestbody.md | 1 + docs/models/updatesignuprequest.md | 8 +- docs/models/updateusermetadatarequest.md | 8 +- docs/models/uploadorganizationlogorequest.md | 8 +- docs/models/verification.md | 4 +- docs/models/verifyclientrequestbody.md | 2 + docs/models/verifypasswordrequest.md | 8 +- docs/models/verifytotprequest.md | 8 +- docs/models/waitlistentries.md | 11 + docs/models/waitlistentry.md | 15 + docs/models/waitlistentryinvitation.md | 17 + docs/models/waitlistentryinvitationobject.md | 8 + docs/models/waitlistentryinvitationstatus.md | 11 + docs/models/waitlistentryobject.md | 8 + docs/models/waitlistentrystatus.md | 11 + .../web3signatureverificationstrategy.md | 3 +- docs/sdks/actortokens/README.md | 18 +- docs/sdks/allowlistblocklist/README.md | 26 +- docs/sdks/domainssdk/README.md | 16 +- docs/sdks/instancesettingssdk/README.md | 41 +- docs/sdks/invitations/README.md | 94 +- docs/sdks/{jwks => jwkssdk}/README.md | 4 +- docs/sdks/jwttemplates/README.md | 2 +- docs/sdks/oauthapplicationssdk/README.md | 18 +- .../sdks/organizationinvitationssdk/README.md | 49 +- .../sdks/organizationmembershipssdk/README.md | 7 +- docs/sdks/organizationssdk/README.md | 42 +- docs/sdks/samlconnectionssdk/README.md | 59 +- docs/sdks/sessions/README.md | 90 +- docs/sdks/testingtokens/README.md | 2 +- docs/sdks/users/README.md | 46 +- docs/sdks/waitlistentriessdk/README.md | 99 ++ poetry.lock | 131 +- pylintrc | 5 +- pyproject.toml | 32 +- src/clerk_backend_api/__init__.py | 11 +- src/clerk_backend_api/_version.py | 5 +- src/clerk_backend_api/actortokens.py | 104 +- src/clerk_backend_api/allowlistblocklist.py | 158 +- src/clerk_backend_api/allowlistidentifiers.py | 14 +- src/clerk_backend_api/betafeatures.py | 110 +- .../blocklistidentifiers_sdk.py | 14 +- src/clerk_backend_api/clerk_redirecturls.py | 78 +- src/clerk_backend_api/clients.py | 70 +- src/clerk_backend_api/domains_sdk.py | 104 +- src/clerk_backend_api/emailaddresses.py | 104 +- src/clerk_backend_api/emailandsmstemplates.py | 14 +- src/clerk_backend_api/emailsmstemplates.py | 56 +- ...ttings_sdk.py => instance_settings_sdk.py} | 318 +++- src/clerk_backend_api/invitations.py | 336 +++- .../{jwks.py => jwks_sdk.py} | 24 +- src/clerk_backend_api/jwttemplates.py | 118 +- src/clerk_backend_api/miscellaneous.py | 14 +- src/clerk_backend_api/models/__init__.py | 92 +- .../models/createbulkinvitationsop.py | 98 ++ .../models/createinvitationop.py | 35 +- .../models/createoauthapplicationop.py | 4 +- .../createorganizationinvitationbulkop.py | 24 +- .../models/createorganizationinvitationop.py | 30 +- .../models/createorganizationop.py | 4 +- .../models/createsamlconnectionop.py | 7 + .../models/createsessionop.py | 16 + .../createsessiontokenfromtemplateop.py | 57 +- .../models/createsessiontokenop.py | 92 + .../models/createwaitlistentryop.py | 25 + src/clerk_backend_api/models/emailaddress.py | 59 +- .../models/getoauthaccesstokenop.py | 8 +- src/clerk_backend_api/models/getuserlistop.py | 104 +- .../models/getuserscountop.py | 42 + .../models/identificationlink.py | 3 +- src/clerk_backend_api/models/instance.py | 73 + .../models/{wellknown_jwks.py => jwks.py} | 10 +- .../models/listinvitationsop.py | 8 + .../models/listsamlconnectionsop.py | 24 +- .../models/listwaitlistentriesop.py | 84 + .../models/oauthapplication.py | 6 + .../models/oauthapplicationwithsecret.py | 6 + src/clerk_backend_api/models/organization.py | 6 +- .../models/organizationinvitation.py | 65 +- ...ioninvitationwithpublicorganizationdata.py | 56 +- .../models/organizationmembership.py | 6 +- .../models/organizationwithlogo.py | 6 +- .../models/schemas_samlconnection.py | 5 + src/clerk_backend_api/models/signup.py | 11 + .../models/updateemailaddressop.py | 7 +- .../models/updatejwttemplateop.py | 6 +- .../updateorganizationmembershipmetadataop.py | 6 +- .../models/updatephonenumberop.py | 7 +- .../models/updatesamlconnectionop.py | 7 + .../models/updatesignupop.py | 7 +- .../models/updateusermetadataop.py | 6 +- .../models/uploadorganizationlogoop.py | 6 +- .../models/verifyclientop.py | 4 + .../models/verifypasswordop.py | 6 +- src/clerk_backend_api/models/verifytotpop.py | 6 +- .../models/waitlistentries.py | 24 + src/clerk_backend_api/models/waitlistentry.py | 196 +++ src/clerk_backend_api/models/web3wallet.py | 1 + .../oauthapplications_sdk.py | 156 +- .../organizationdomain_sdk.py | 14 +- .../organizationdomains_sdk.py | 42 +- .../organizationinvitations_sdk.py | 160 +- .../organizationmemberships_sdk.py | 126 +- src/clerk_backend_api/organizations_sdk.py | 216 ++- src/clerk_backend_api/phonenumbers.py | 104 +- src/clerk_backend_api/proxychecks.py | 50 +- src/clerk_backend_api/redirecturls.py | 14 +- src/clerk_backend_api/samlconnections_sdk.py | 204 ++- src/clerk_backend_api/sdk.py | 14 +- src/clerk_backend_api/sdkconfiguration.py | 14 +- src/clerk_backend_api/sessions.py | 522 +++++- src/clerk_backend_api/signintokens.py | 64 +- src/clerk_backend_api/signups.py | 26 +- src/clerk_backend_api/templates.py | 14 +- src/clerk_backend_api/testingtokens.py | 22 +- src/clerk_backend_api/users.py | 546 +++++- src/clerk_backend_api/waitlist_entries_sdk.py | 427 +++++ src/clerk_backend_api/webhooks.py | 42 +- 173 files changed, 6605 insertions(+), 2078 deletions(-) create mode 100644 docs/models/createorganizationinvitationbulkrequestbody.md create mode 100644 docs/models/createsessionrequestbody.md create mode 100644 docs/models/createsessiontokenfromtemplaterequestbody.md create mode 100644 docs/models/createsessiontokenobject.md create mode 100644 docs/models/createsessiontokenrequest.md create mode 100644 docs/models/createsessiontokenrequestbody.md create mode 100644 docs/models/createsessiontokenresponsebody.md create mode 100644 docs/models/createwaitlistentryrequestbody.md create mode 100644 docs/models/fromoauth.md create mode 100644 docs/models/fromoauthverificationstatus.md create mode 100644 docs/models/instance.md create mode 100644 docs/models/instanceobject.md rename docs/models/{wellknownjwks.md => jwks.md} (97%) create mode 100644 docs/models/listwaitlistentriesqueryparamstatus.md create mode 100644 docs/models/listwaitlistentriesrequest.md delete mode 100644 docs/models/oauth.md delete mode 100644 docs/models/oauthverificationstatus.md delete mode 100644 docs/models/oauthverificationstrategy.md create mode 100644 docs/models/templateslug.md create mode 100644 docs/models/waitlistentries.md create mode 100644 docs/models/waitlistentry.md create mode 100644 docs/models/waitlistentryinvitation.md create mode 100644 docs/models/waitlistentryinvitationobject.md create mode 100644 docs/models/waitlistentryinvitationstatus.md create mode 100644 docs/models/waitlistentryobject.md create mode 100644 docs/models/waitlistentrystatus.md rename docs/sdks/{jwks => jwkssdk}/README.md (95%) create mode 100644 docs/sdks/waitlistentriessdk/README.md rename src/clerk_backend_api/{instancesettings_sdk.py => instance_settings_sdk.py} (65%) rename src/clerk_backend_api/{jwks.py => jwks_sdk.py} (89%) create mode 100644 src/clerk_backend_api/models/createbulkinvitationsop.py create mode 100644 src/clerk_backend_api/models/createsessionop.py create mode 100644 src/clerk_backend_api/models/createsessiontokenop.py create mode 100644 src/clerk_backend_api/models/createwaitlistentryop.py create mode 100644 src/clerk_backend_api/models/instance.py rename src/clerk_backend_api/models/{wellknown_jwks.py => jwks.py} (82%) create mode 100644 src/clerk_backend_api/models/listwaitlistentriesop.py create mode 100644 src/clerk_backend_api/models/waitlistentries.py create mode 100644 src/clerk_backend_api/models/waitlistentry.py create mode 100644 src/clerk_backend_api/waitlist_entries_sdk.py diff --git a/.gitignore b/.gitignore index 7755092..5a82b06 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.speakeasy/reports README-PYPI.md .venv/ venv/ diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index c27f03d..d0ded9b 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: bfe29c99-6e67-43fe-b928-64d6a5ed6aa8 management: - docChecksum: 3b85d94743e8bef36aebfc53ac120e1b + docChecksum: b774ab4868edf5a0a8859b821fbe9e0c docVersion: v1 - speakeasyVersion: 1.460.6 - generationVersion: 2.484.4 - releaseVersion: 1.6.0 - configChecksum: 11a372d385b3244fe1fc0e9c62b4d760 + speakeasyVersion: 1.472.1 + generationVersion: 2.493.34 + releaseVersion: 1.7.0 + configChecksum: 0712524972f974f0758ec494fe42e062 repoURL: https://github.com/clerk/clerk-sdk-python.git installationURL: https://github.com/clerk/clerk-sdk-python.git published: true @@ -15,12 +15,12 @@ features: additionalDependencies: 1.0.0 additionalProperties: 1.0.1 constsAndDefaults: 1.0.5 - core: 5.7.4 + core: 5.10.4 defaultEnabledRetries: 0.2.0 - deprecations: 3.0.1 + deprecations: 3.0.2 enumUnions: 0.1.0 envVarSecurityUsage: 0.3.2 - examples: 3.0.0 + examples: 3.0.1 flatRequests: 1.0.1 flattening: 3.1.0 globalSecurity: 3.0.2 @@ -42,7 +42,6 @@ generatedFiles: - .gitattributes - .python-version - .vscode/settings.json - - CONTRIBUTING.md - USAGE.md - docs/models/actor.md - docs/models/actortoken.md @@ -85,6 +84,7 @@ generatedFiles: - docs/models/createorganizationdomainrequest.md - docs/models/createorganizationdomainrequestbody.md - docs/models/createorganizationinvitationbulkrequest.md + - docs/models/createorganizationinvitationbulkrequestbody.md - docs/models/createorganizationinvitationrequest.md - docs/models/createorganizationinvitationrequestbody.md - docs/models/createorganizationmembershiprequest.md @@ -94,12 +94,19 @@ generatedFiles: - docs/models/createredirecturlrequestbody.md - docs/models/createsamlconnectionattributemapping.md - docs/models/createsamlconnectionrequestbody.md + - docs/models/createsessionrequestbody.md - docs/models/createsessiontokenfromtemplateobject.md - docs/models/createsessiontokenfromtemplaterequest.md + - docs/models/createsessiontokenfromtemplaterequestbody.md - docs/models/createsessiontokenfromtemplateresponsebody.md + - docs/models/createsessiontokenobject.md + - docs/models/createsessiontokenrequest.md + - docs/models/createsessiontokenrequestbody.md + - docs/models/createsessiontokenresponsebody.md - docs/models/createsignintokenrequestbody.md - docs/models/createuserrequestbody.md - docs/models/createusertotprequest.md + - docs/models/createwaitlistentryrequestbody.md - docs/models/deleteallowlistidentifierrequest.md - docs/models/deletebackupcoderequest.md - docs/models/deletebackupcoderesponsebody.md @@ -136,6 +143,8 @@ generatedFiles: - docs/models/externalaccount.md - docs/models/externalaccounts.md - docs/models/file.md + - docs/models/fromoauth.md + - docs/models/fromoauthverificationstatus.md - docs/models/getclientlistrequest.md - docs/models/getclientrequest.md - docs/models/getemailaddressrequest.md @@ -157,7 +166,9 @@ generatedFiles: - docs/models/getuserscountrequest.md - docs/models/identificationlink.md - docs/models/identifiertype.md + - docs/models/instance.md - docs/models/instancegetorganizationmembershipsrequest.md + - docs/models/instanceobject.md - docs/models/instancerestrictions.md - docs/models/instancerestrictionsobject.md - docs/models/instancesettings.md @@ -168,6 +179,7 @@ generatedFiles: - docs/models/invitationrevokedobject.md - docs/models/invitationrevokedstatus.md - docs/models/invitationstatus.md + - docs/models/jwks.md - docs/models/jwttemplate.md - docs/models/jwttemplateobject.md - docs/models/keys.md @@ -184,19 +196,18 @@ generatedFiles: - docs/models/listorganizationsrequest.md - docs/models/listpendingorganizationinvitationsrequest.md - docs/models/listsamlconnectionsrequest.md + - docs/models/listwaitlistentriesqueryparamstatus.md + - docs/models/listwaitlistentriesrequest.md - docs/models/lockuserrequest.md - docs/models/mergeorganizationmetadatarequest.md - docs/models/mergeorganizationmetadatarequestbody.md - docs/models/meta.md - docs/models/nonce.md - - docs/models/oauth.md - docs/models/oauthapplication.md - docs/models/oauthapplicationobject.md - docs/models/oauthapplications.md - docs/models/oauthapplicationwithsecret.md - docs/models/oauthapplicationwithsecretobject.md - - docs/models/oauthverificationstatus.md - - docs/models/oauthverificationstrategy.md - docs/models/object.md - docs/models/organization.md - docs/models/organizationdomain.md @@ -284,6 +295,7 @@ generatedFiles: - docs/models/svixurl.md - docs/models/template.md - docs/models/templateobject.md + - docs/models/templateslug.md - docs/models/templatetype.md - docs/models/testingtoken.md - docs/models/testingtokenobject.md @@ -363,6 +375,13 @@ generatedFiles: - docs/models/verifytotprequest.md - docs/models/verifytotprequestbody.md - docs/models/verifytotpresponsebody.md + - docs/models/waitlistentries.md + - docs/models/waitlistentry.md + - docs/models/waitlistentryinvitation.md + - docs/models/waitlistentryinvitationobject.md + - docs/models/waitlistentryinvitationstatus.md + - docs/models/waitlistentryobject.md + - docs/models/waitlistentrystatus.md - docs/models/web3signature.md - docs/models/web3signatureverificationstatus.md - docs/models/web3signatureverificationstrategy.md @@ -370,7 +389,6 @@ generatedFiles: - docs/models/web3walletobject.md - docs/models/web3walletverification.md - docs/models/web3walletverificationadmin.md - - docs/models/wellknownjwks.md - docs/sdks/actortokens/README.md - docs/sdks/allowlistblocklist/README.md - docs/sdks/allowlistidentifiers/README.md @@ -385,7 +403,7 @@ generatedFiles: - docs/sdks/emailsmstemplates/README.md - docs/sdks/instancesettingssdk/README.md - docs/sdks/invitations/README.md - - docs/sdks/jwks/README.md + - docs/sdks/jwkssdk/README.md - docs/sdks/jwttemplates/README.md - docs/sdks/miscellaneous/README.md - docs/sdks/oauthapplicationssdk/README.md @@ -404,6 +422,7 @@ generatedFiles: - docs/sdks/templates/README.md - docs/sdks/testingtokens/README.md - docs/sdks/users/README.md + - docs/sdks/waitlistentriessdk/README.md - docs/sdks/webhooks/README.md - poetry.toml - py.typed @@ -429,9 +448,9 @@ generatedFiles: - src/clerk_backend_api/emailandsmstemplates.py - src/clerk_backend_api/emailsmstemplates.py - src/clerk_backend_api/httpclient.py - - src/clerk_backend_api/instancesettings_sdk.py + - src/clerk_backend_api/instance_settings_sdk.py - src/clerk_backend_api/invitations.py - - src/clerk_backend_api/jwks.py + - src/clerk_backend_api/jwks_sdk.py - src/clerk_backend_api/jwttemplates.py - src/clerk_backend_api/miscellaneous.py - src/clerk_backend_api/models/__init__.py @@ -449,6 +468,7 @@ generatedFiles: - src/clerk_backend_api/models/createactortokenop.py - src/clerk_backend_api/models/createallowlistidentifierop.py - src/clerk_backend_api/models/createblocklistidentifierop.py + - src/clerk_backend_api/models/createbulkinvitationsop.py - src/clerk_backend_api/models/createemailaddressop.py - src/clerk_backend_api/models/createinvitationop.py - src/clerk_backend_api/models/createjwttemplateop.py @@ -461,10 +481,13 @@ generatedFiles: - src/clerk_backend_api/models/createphonenumberop.py - src/clerk_backend_api/models/createredirecturlop.py - src/clerk_backend_api/models/createsamlconnectionop.py + - src/clerk_backend_api/models/createsessionop.py - src/clerk_backend_api/models/createsessiontokenfromtemplateop.py + - src/clerk_backend_api/models/createsessiontokenop.py - src/clerk_backend_api/models/createsignintokenop.py - src/clerk_backend_api/models/createuserop.py - src/clerk_backend_api/models/createusertotpop.py + - src/clerk_backend_api/models/createwaitlistentryop.py - src/clerk_backend_api/models/deleteallowlistidentifierop.py - src/clerk_backend_api/models/deletebackupcodeop.py - src/clerk_backend_api/models/deleteblocklistidentifierop.py @@ -508,11 +531,13 @@ generatedFiles: - src/clerk_backend_api/models/getuserop.py - src/clerk_backend_api/models/getuserscountop.py - src/clerk_backend_api/models/identificationlink.py + - src/clerk_backend_api/models/instance.py - src/clerk_backend_api/models/instancegetorganizationmembershipsop.py - src/clerk_backend_api/models/instancerestrictions.py - src/clerk_backend_api/models/instancesettings.py - src/clerk_backend_api/models/invitation.py - src/clerk_backend_api/models/invitation_revoked.py + - src/clerk_backend_api/models/jwks.py - src/clerk_backend_api/models/jwttemplate.py - src/clerk_backend_api/models/listinstanceorganizationinvitationsop.py - src/clerk_backend_api/models/listinvitationsop.py @@ -523,6 +548,7 @@ generatedFiles: - src/clerk_backend_api/models/listorganizationsop.py - src/clerk_backend_api/models/listpendingorganizationinvitationsop.py - src/clerk_backend_api/models/listsamlconnectionsop.py + - src/clerk_backend_api/models/listwaitlistentriesop.py - src/clerk_backend_api/models/lockuserop.py - src/clerk_backend_api/models/mergeorganizationmetadataop.py - src/clerk_backend_api/models/oauthapplication.py @@ -599,8 +625,9 @@ generatedFiles: - src/clerk_backend_api/models/verifypasswordop.py - src/clerk_backend_api/models/verifysessionop.py - src/clerk_backend_api/models/verifytotpop.py + - src/clerk_backend_api/models/waitlistentries.py + - src/clerk_backend_api/models/waitlistentry.py - src/clerk_backend_api/models/web3wallet.py - - src/clerk_backend_api/models/wellknown_jwks.py - src/clerk_backend_api/oauthapplications_sdk.py - src/clerk_backend_api/organizationdomain_sdk.py - src/clerk_backend_api/organizationdomains_sdk.py @@ -637,59 +664,48 @@ generatedFiles: - src/clerk_backend_api/utils/serializers.py - src/clerk_backend_api/utils/url.py - src/clerk_backend_api/utils/values.py + - src/clerk_backend_api/waitlist_entries_sdk.py - src/clerk_backend_api/webhooks.py examples: - AddDomain: - speakeasy-default-add-domain: - requestBody: - application/json: {"name": "example.com", "is_satellite": true, "proxy_url": "https://proxy.example.com"} - responses: - "200": - application/json: {"object": "domain", "id": "domain_id", "name": "example.com", "is_satellite": false, "frontend_api_url": "https://frontend.example.com", "accounts_portal_url": null, "proxy_url": null, "development_origin": "http://localhost:3000", "cname_targets": [{"host": "cname.example.com", "value": "value.example.com", "required": true}]} - "400": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - BanUser: - speakeasy-default-ban-user: + GetPublicInterstitial: + speakeasy-default-get-public-interstitial: parameters: - path: - user_id: "user_12345" + query: + frontendApi: "frontend-api_1a2b3c4d" + publishable_key: "pub_1a2b3c4d" + GetJWKS: + speakeasy-default-get-JWKS: responses: "200": - application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value", "message": "", "attempts": null, "expire_at": null}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "ticket", "attempts": null, "expire_at": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": true, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 431195, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} - "402": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - ChangeProductionInstanceDomain: - speakeasy-default-change-production-instance-domain: - requestBody: - application/json: {"home_url": "https://www.newdomain.com", "is_secondary": false} - responses: - "400": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - CreateActorToken: - speakeasy-default-create-actor-token: - requestBody: - application/json: {"user_id": "user_1a2b3c", "expires_in_seconds": 3600, "session_max_duration_in_seconds": 1800} + application/json: {"keys": [{"use": "", "kty": "", "kid": "", "alg": "", "n": "", "e": "", "x": "", "crv": ""}, {"use": "", "kty": "", "kid": "", "alg": "", "n": "", "e": "", "x": "", "crv": ""}, {"use": "", "kty": "", "kid": "", "alg": "", "n": "", "e": "", "x": "", "crv": ""}]} + GetClientList: + speakeasy-default-get-client-list: + parameters: + query: + limit: 20 + offset: 10 responses: "200": - application/json: {"object": "actor_token", "id": "actor_tok_1a2b3c", "status": "pending", "user_id": "user_1a2b3c", "token": "token_string", "url": "https://example.com/token", "created_at": 1609459200, "updated_at": 1612137600} + application/json: [{"object": "client", "id": "client_123456789abcd", "session_ids": ["sess_123456789abcd", "sess_23456789abcd"], "sessions": [{"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": false, "browser_name": "", "browser_version": "", "ip_address": "58.39.162.163", "city": "Lake Aryannaton", "country": "Panama"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}, {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": false, "browser_name": "", "browser_version": "", "ip_address": "018a:1ecd:a17c:0d9e:31d2:a99a:2bc9:c682", "city": "Fort Alexiefurt", "country": "Ukraine"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}], "sign_in_id": "signin_123456789abcd", "sign_up_id": "signup_123456789abcd", "last_active_session_id": "session_123456789abcd", "updated_at": 1632580323, "created_at": 1622481123}, {"object": "client", "id": "client_123456789abcd", "session_ids": ["sess_123456789abcd", "sess_23456789abcd"], "sessions": [{"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": true, "browser_name": "", "browser_version": "", "ip_address": "ccbf:131c:b3e6:bb11:6fa5:72e9:0bfb:bed0", "city": "Zackerycester", "country": "Saint Vincent and the Grenadines"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}, {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": true, "browser_name": "", "browser_version": "", "ip_address": "166.176.154.104", "city": "Port Ernestinaview", "country": "Barbados"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}, {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": true, "browser_name": "", "browser_version": "", "ip_address": "f98a:4d1d:9444:2eca:a0aa:a6c2:dc28:d8ea", "city": "Livermore", "country": "Cook Islands"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}], "sign_in_id": "signin_123456789abcd", "sign_up_id": "signup_123456789abcd", "last_active_session_id": "session_123456789abcd", "updated_at": 1632580323, "created_at": 1622481123}, {"object": "client", "id": "client_123456789abcd", "session_ids": ["sess_123456789abcd", "sess_23456789abcd"], "sessions": [{"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": false, "browser_name": "", "browser_version": "", "ip_address": "214.132.198.41", "city": "East Gideonside", "country": "Angola"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}], "sign_in_id": "signin_123456789abcd", "sign_up_id": "signup_123456789abcd", "last_active_session_id": "session_123456789abcd", "updated_at": 1632580323, "created_at": 1622481123}] "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - CreateAllowlistIdentifier: - speakeasy-default-create-allowlist-identifier: + VerifyClient: + speakeasy-default-verify-client: requestBody: - application/json: {"identifier": "user@example.com", "notify": true} + application/json: {"token": "jwt_token_example"} responses: "200": - application/json: {"object": "allowlist_identifier", "id": "alid_123456", "invitation_id": "inv_123456", "identifier": "user@example.com", "identifier_type": "email_address", "instance_id": "instance_12345", "created_at": 1622547600, "updated_at": 1622648600} + application/json: {"object": "client", "id": "client_123456789abcd", "session_ids": ["sess_123456789abcd", "sess_23456789abcd"], "sessions": [{"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": true, "browser_name": "", "browser_version": "", "ip_address": "58.193.100.66", "city": "West Matteoville", "country": "Oman"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}, {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": true, "browser_name": "", "browser_version": "", "ip_address": "b769:20fd:df0e:4479:fbef:8fcc:b2fa:de28", "city": "East Deloresview", "country": "Canada"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}, {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": true, "browser_name": "", "browser_version": "", "ip_address": "51e3:ddfe:7a17:c6bf:2a53:9ca8:ba8e:b53d", "city": "East Name", "country": "Australia"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}], "sign_in_id": "signin_123456789abcd", "sign_up_id": "signup_123456789abcd", "last_active_session_id": "session_123456789abcd", "updated_at": 1632580323, "created_at": 1622481123} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - CreateBlocklistIdentifier: - speakeasy-default-create-blocklist-identifier: - requestBody: - application/json: {"identifier": "example@example.com"} + GetClient: + speakeasy-default-get-client: + parameters: + path: + client_id: "cli_123456789" responses: "200": - application/json: {"object": "blocklist_identifier", "id": "identifier_id", "identifier": "blocked@example.com", "identifier_type": "email_address", "instance_id": "instance_id_here", "created_at": 1609459200, "updated_at": 1612137600} + application/json: {"object": "client", "id": "client_123456789abcd", "session_ids": ["sess_123456789abcd", "sess_23456789abcd"], "sessions": [{"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": false, "browser_name": "", "browser_version": "", "ip_address": "bfa9:54e9:b146:2cb8:adc7:735b:6aaf:e70f", "city": "Herbertville", "country": "Canada"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}, {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": false, "browser_name": "", "browser_version": "", "ip_address": "220.165.137.74", "city": "Runolfssonview", "country": "Guyana"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}], "sign_in_id": "signin_123456789abcd", "sign_up_id": "signup_123456789abcd", "last_active_session_id": "session_123456789abcd", "updated_at": 1632580323, "created_at": 1622481123} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} CreateEmailAddress: @@ -698,273 +714,310 @@ examples: application/json: {"user_id": "user_12345", "email_address": "example@clerk.com", "verified": false, "primary": true} responses: "200": - application/json: {"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001} + application/json: {"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "matches_sso_connection": true, "created_at": 1615458901, "updated_at": 1615459001} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - CreateInvitation: - speakeasy-default-create-invitation: - requestBody: - application/json: {"email_address": "user@example.com", "public_metadata": {}, "redirect_url": "https://example.com/welcome", "notify": true, "ignore_existing": "​false", "expires_in_days": 486589} + GetEmailAddress: + speakeasy-default-get-email-address: + parameters: + path: + email_address_id: "email_address_id_example" responses: "200": - application/json: {"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "public_metadata": {}, "revoked": false, "status": "pending", "url": "https://example.com/invitations/accept?code=abcd1234", "expires_at": 638424, "created_at": 1622549600, "updated_at": 1622553200} + application/json: {"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "matches_sso_connection": false, "created_at": 1615458901, "updated_at": 1615459001} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - CreateJWTTemplate: - speakeasy-default-create-JWT-template: - requestBody: - application/json: {"name": "Example Template", "claims": {}, "lifetime": 3600, "allowed_clock_skew": 5, "custom_signing_key": false, "signing_algorithm": "RS256", "signing_key": "PRIVATE_KEY_PLACEHOLDER"} + DeleteEmailAddress: + speakeasy-default-delete-email-address: + parameters: + path: + email_address_id: "email_address_id_example" responses: "200": - application/json: {"object": "jwt_template", "id": "jt_1234567890abcdef", "name": "My First JWT Template", "claims": {}, "lifetime": 3600, "allowed_clock_skew": 5, "custom_signing_key": false, "signing_algorithm": "RS256", "created_at": 1609459200, "updated_at": 1612137600} + application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - CreateOAuthApplication: - speakeasy-default-create-O-auth-application: + UpdateEmailAddress: + speakeasy-default-update-email-address: + parameters: + path: + email_address_id: "email_address_id_example" requestBody: - application/json: {"name": "Example App", "callback_url": "https://example.com/oauth/callback", "scopes": "profile email public_metadata", "public": true} + application/json: {"verified": false, "primary": true} responses: "200": - application/json: {"object": "oauth_application", "id": "oauth_app_1234", "instance_id": "instance_5678", "name": "Example OAuth App", "client_id": "client_12345", "public": false, "scopes": "profile email", "callback_url": "https://example.com/oauth/callback", "authorize_url": "https://example.com/authorize", "token_fetch_url": "https://example.com/oauth/token", "user_info_url": "https://example.com/userinfo", "created_at": 1609459200, "updated_at": 1612137600, "client_secret": "secretXYZ123"} + application/json: {"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "matches_sso_connection": false, "created_at": 1615458901, "updated_at": 1615459001} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - CreateOrganization: - speakeasy-default-create-organization: + CreatePhoneNumber: + speakeasy-default-create-phone-number: requestBody: - application/json: {"name": "NewOrg", "created_by": "user_123", "private_metadata": {"internal_code": "ABC123"}, "public_metadata": {"public_event": "Annual Summit"}, "slug": "neworg", "max_allowed_memberships": 100, "created_at": ""} + application/json: {"user_id": "usr_12345", "phone_number": "+11234567890", "verified": true, "primary": false, "reserved_for_second_factor": false} responses: "200": - application/json: {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800} + application/json: {"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1594842023, "updated_at": 1604842023} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - CreateOrganizationInvitation: - speakeasy-default-create-organization-invitation: + GetPhoneNumber: + speakeasy-default-get-phone-number: parameters: path: - organization_id: "org_12345" - requestBody: - application/json: {"email_address": "user@example.com", "inviter_user_id": "user_67890", "role": "admin", "public_metadata": {"key": "value"}, "private_metadata": {"private_key": "secret_value"}, "redirect_url": "https://example.com/welcome"} + phone_number_id: "phone_12345" responses: "200": - application/json: {"id": "inv_12345", "object": "organization_invitation", "email_address": "user@example.com", "role": "admin", "role_name": "", "organization_id": "org_12345", "status": "pending", "public_metadata": {"key": "value"}, "private_metadata": {"private_key": "secret_value"}, "created_at": 1622547600, "updated_at": 1622551200} + application/json: {"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1594842023, "updated_at": 1604842023} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - CreateOrganizationInvitationBulk: - speakeasy-default-create-organization-invitation-bulk: + DeletePhoneNumber: + speakeasy-default-delete-phone-number: parameters: path: - organization_id: "org_12345" - requestBody: - application/json: [{"email_address": "newmember@example.com", "inviter_user_id": "user_67890", "role": "admin", "public_metadata": {}, "private_metadata": {}, "redirect_url": "https://example.com/welcome"}] + phone_number_id: "phone_12345" responses: "200": - application/json: {"data": [{"id": "inv_12345", "object": "organization_invitation", "email_address": "user@example.com", "role": "admin", "role_name": "", "organization_id": "org_12345", "status": "pending", "public_metadata": {"key": "value"}, "private_metadata": {"private_key": "secret_value"}, "created_at": 1622547600, "updated_at": 1622551200}], "total_count": 10} + application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - CreateOrganizationMembership: - speakeasy-default-create-organization-membership: + UpdatePhoneNumber: + speakeasy-default-update-phone-number: parameters: path: - organization_id: "org_123" - requestBody: - application/json: {"user_id": "user_456", "role": "admin"} - responses: - "200": - application/json: {"id": "org_mem_123", "object": "organization_membership", "role": "member", "role_name": "", "permissions": ["read"], "public_metadata": {}, "private_metadata": {}, "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800} - "400": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - CreatePhoneNumber: - speakeasy-default-create-phone-number: + phone_number_id: "phone_12345" requestBody: - application/json: {"user_id": "usr_12345", "phone_number": "+11234567890", "verified": true, "primary": false, "reserved_for_second_factor": false} + application/json: {"verified": false, "primary": true, "reserved_for_second_factor": true} responses: "200": application/json: {"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1594842023, "updated_at": 1604842023} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - CreateRedirectURL: - speakeasy-default-create-redirect-URL: - requestBody: - application/json: {"url": "https://my-app.com/oauth-callback"} + GetSessionList: + speakeasy-default-get-session-list: + parameters: + query: + client_id: "client_123" + user_id: "user_456" + status: "active" + limit: 20 + offset: 10 responses: "200": - application/json: {"object": "redirect_url", "id": "red_12345", "url": "https://my-app.com/oauth-callback", "created_at": 1610000000, "updated_at": 1620000000} + application/json: [{"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": false, "browser_name": "", "browser_version": "", "ip_address": "e353:de0f:11fb:d018:a1ec:da17:c0d9:e31d", "city": "South Herminiaview", "country": "Republic of Korea"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}] "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - CreateSAMLConnection: - speakeasy-default-create-SAML-connection: + createSession: + speakeasy-default-create-session: requestBody: - application/json: {"name": "My SAML Connection", "domain": "example.org", "provider": "saml_custom", "idp_entity_id": "http://idp.example.org/", "idp_sso_url": "http://idp.example.org/sso", "idp_certificate": "MIIDdzCCAl+gAwIBAgIJAKcyBaiiz+DT...", "idp_metadata_url": "http://idp.example.org/metadata.xml", "idp_metadata": ""} responses: "200": - application/json: {"object": "saml_connection", "id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "idp_entity_id": "idp-entity-id", "idp_sso_url": "https://sso.mycompany.com", "idp_certificate": "MIIDdzCCAl+gAwIBAgIJAKcyBaiiz+DT...", "idp_metadata_url": "https://sso.mycompany.com/metadata", "idp_metadata": "", "id": "", "device_type": "", "is_mobile": false, "browser_name": "", "browser_version": "", "ip_address": "252.214.104.239", "city": "Urielborough", "country": "Peru"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000} + "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - CreateSessionTokenFromTemplate: - speakeasy-default-create-session-token-from-template: + GetSession: + speakeasy-default-get-session: parameters: path: - session_id: "ses_123abcd4567" - template_name: "custom_hasura" - responses: - "200": - application/json: {"object": "token", "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvZSBCbG9nZ3MiLCJpYXQiOjE1MTYyMzkwMjJ9.qKVwLLnbfqfM5VCfU8vDhXXXS0VklRcsErgTpELYgfw"} - "401": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - CreateSignInToken: - speakeasy-default-create-sign-in-token: - requestBody: - application/json: {"user_id": "user_12345", "expires_in_seconds": 2592000} + session_id: "sess_1234567890abcdef" responses: "200": - application/json: {"object": "sign_in_token", "id": "token_12345", "status": "pending", "user_id": "user_12345", "token": "secret_token", "url": "https://example.com/signin/token", "created_at": 1609459200, "updated_at": 1612137600} - "404": + application/json: {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": false, "browser_name": "", "browser_version": "", "ip_address": "bbfa:954e:9b14:62cb:8adc:7735:b6aa:fe70", "city": "Kendall", "country": "Iran"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000} + "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - CreateSvixApp: - speakeasy-default-create-svix-app: + RevokeSession: + speakeasy-default-revoke-session: + parameters: + path: + session_id: "sess_1234567890abcdef" responses: "200": - application/json: {"svix_url": "https://app.svix.com/your-instance-url"} + application/json: {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": false, "browser_name": "", "browser_version": "", "ip_address": "31.46.247.141", "city": "Sioux Falls", "country": "Austria"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - CreateTestingToken: - speakeasy-default-create-testing-token: - responses: - "200": - application/json: {"object": "testing_token", "token": "1713877200-c_2J2MvPu9PnXcuhbPZNao0LOXqK9A7YrnBn0HmIWxy", "expires_at": 1713880800} - CreateUser: - speakeasy-default-create-user: + VerifySession: + speakeasy-default-verify-session: + parameters: + path: + session_id: "sess_w8q4g9s60j28fghv00f3" requestBody: - application/json: {"external_id": "ext-id-001", "first_name": "John", "last_name": "Doe", "email_address": ["john.doe@example.com"], "phone_number": ["+12345678901"], "web3_wallet": ["0x123456789abcdef0x123456789abcdef"], "username": "johndoe123", "password": "Secure*Pass4", "password_digest": "$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc", "password_hasher": "argon2i", "skip_password_checks": false, "skip_password_requirement": false, "totp_secret": "base32totpsecretkey", "backup_codes": ["123456", "654321"], "public_metadata": {"role": "user"}, "private_metadata": {"internal_id": "789"}, "unsafe_metadata": {"preferences": {"theme": "dark"}}, "delete_self_enabled": true, "legal_accepted_at": "", "skip_legal_checks": false, "create_organization_enabled": true, "create_organizations_limit": 134365, "created_at": "2023-03-15T07:15:20.902Z"} + application/json: {"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZXNzaW9uX2lkIjoic2Vzc193OHF4ZzZzNm9qMjhmZ2h2MDBmMyIsImlhdCI6MTU4MjY0OTg2Mn0.J4KP2L6bEZ6YccHFW4E2vKbOLw_mmO0gF_GNRw-wtLM"} responses: "200": - application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value", "message": "", "attempts": null, "expire_at": null}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml", "external_verification_redirect_url": "https://example.com/saml_callback", "error": null, "expire_at": 1622852400, "attempts": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": false, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 951062, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} + application/json: {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": false, "browser_name": "", "browser_version": "", "ip_address": "47.58.193.100", "city": "North Eduardo", "country": "Papua New Guinea"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - DeleteAllowlistIdentifier: - speakeasy-default-delete-allowlist-identifier: + CreateSessionToken: + speakeasy-default-create-session-token: parameters: path: - identifier_id: "example_identifier_id" + session_id: "" + requestBody: + application/json: {"expires_in_seconds": 6005.84} responses: "200": - application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} - "402": + application/json: {"object": "token", "jwt": ""} + "401": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - DeleteBlocklistIdentifier: - speakeasy-default-delete-blocklist-identifier: + CreateSessionTokenFromTemplate: + speakeasy-default-create-session-token-from-template: parameters: path: - identifier_id: "identifier123" + session_id: "ses_123abcd4567" + template_name: "custom_hasura" + requestBody: + application/json: {"expires_in_seconds": 2299.84} responses: "200": - application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} - "402": + application/json: {"object": "token", "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvZSBCbG9nZ3MiLCJpYXQiOjE1MTYyMzkwMjJ9.qKVwLLnbfqfM5VCfU8vDhXXXS0VklRcsErgTpELYgfw"} + "401": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - DeleteDomain: - speakeasy-default-delete-domain: + GetTemplateList: + "": parameters: path: - domain_id: "domain_12345" + template_type: "email" responses: "200": - application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} - "403": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - DeleteEmailAddress: - speakeasy-default-delete-email-address: + application/json: [{"id": "temp_12345", "object": "template", "instance_id": "inst_67890", "resource_type": "system", "template_type": "email", "name": "Welcome Email", "slug": "welcome_email", "position": 1, "can_revert": false, "can_delete": true, "can_toggle": false, "subject": "Welcome to our service!", "markup": "

Hello, {{ user.name }}

", "body": "You are now signed up. Welcome!", "available_variables": ["user.name", "user.email"], "required_variables": ["user.name"], "from_email_name": "Clerk Support", "reply_to_email_name": "support@clerk.com", "delivered_by_clerk": true, "enabled": false, "updated_at": 1610000000, "created_at": 1600000000}, {"id": "temp_12345", "object": "template", "instance_id": "inst_67890", "resource_type": "system", "template_type": "email", "name": "Welcome Email", "slug": "welcome_email", "position": 1, "can_revert": false, "can_delete": true, "can_toggle": true, "subject": "Welcome to our service!", "markup": "

Hello, {{ user.name }}

", "body": "You are now signed up. Welcome!", "available_variables": ["user.name", "user.email"], "required_variables": ["user.name"], "from_email_name": "Clerk Support", "reply_to_email_name": "support@clerk.com", "delivered_by_clerk": true, "enabled": true, "updated_at": 1610000000, "created_at": 1600000000}, {"id": "temp_12345", "object": "template", "instance_id": "inst_67890", "resource_type": "system", "template_type": "email", "name": "Welcome Email", "slug": "welcome_email", "position": 1, "can_revert": false, "can_delete": true, "can_toggle": true, "subject": "Welcome to our service!", "markup": "

Hello, {{ user.name }}

", "body": "You are now signed up. Welcome!", "available_variables": ["user.name", "user.email"], "required_variables": ["user.name"], "from_email_name": "Clerk Support", "reply_to_email_name": "support@clerk.com", "delivered_by_clerk": true, "enabled": false, "updated_at": 1610000000, "created_at": 1600000000}] + "400": + application/json: {"errors": [{"message": "Invalid input", "long_message": "The input provided does not meet the requirements.", "code": "400_bad_request", "meta": {}, "clerk_trace_id": "trace_123456789abcd"}], "meta": {}} + RevertTemplate: + speakeasy-default-revert-template: parameters: path: - email_address_id: "email_address_id_example" + template_type: "email" + slug: "welcome-email" responses: "200": - application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} + application/json: {"id": "temp_12345", "object": "template", "instance_id": "inst_67890", "resource_type": "system", "template_type": "email", "name": "Welcome Email", "slug": "welcome_email", "position": 1, "can_revert": false, "can_delete": true, "can_toggle": true, "subject": "Welcome to our service!", "markup": "

Hello, {{ user.name }}

", "body": "You are now signed up. Welcome!", "available_variables": ["user.name", "user.email"], "required_variables": ["user.name"], "from_email_name": "Clerk Support", "reply_to_email_name": "support@clerk.com", "delivered_by_clerk": true, "enabled": false, "updated_at": 1610000000, "created_at": 1600000000} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - DeleteJWTTemplate: - speakeasy-default-delete-JWT-template: + GetTemplate: + speakeasy-default-get-template: parameters: path: - template_id: "" + template_type: "email" + slug: "welcome-email" responses: "200": - application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} - "403": + application/json: {"id": "temp_12345", "object": "template", "instance_id": "inst_67890", "resource_type": "system", "template_type": "email", "name": "Welcome Email", "slug": "welcome_email", "position": 1, "can_revert": false, "can_delete": true, "can_toggle": false, "subject": "Welcome to our service!", "markup": "

Hello, {{ user.name }}

", "body": "You are now signed up. Welcome!", "available_variables": ["user.name", "user.email"], "required_variables": ["user.name"], "from_email_name": "Clerk Support", "reply_to_email_name": "support@clerk.com", "delivered_by_clerk": true, "enabled": false, "updated_at": 1610000000, "created_at": 1600000000} + "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - DeleteOAuthApplication: - speakeasy-default-delete-O-auth-application: + ToggleTemplateDelivery: + speakeasy-default-toggle-template-delivery: parameters: path: - oauth_application_id: "oauth_app_09876" + template_type: "email" + slug: "welcome-email" + requestBody: + application/json: {"delivered_by_clerk": true} responses: "200": - application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} - "403": + application/json: {"id": "temp_12345", "object": "template", "instance_id": "inst_67890", "resource_type": "system", "template_type": "email", "name": "Welcome Email", "slug": "welcome_email", "position": 1, "can_revert": false, "can_delete": true, "can_toggle": false, "subject": "Welcome to our service!", "markup": "

Hello, {{ user.name }}

", "body": "You are now signed up. Welcome!", "available_variables": ["user.name", "user.email"], "required_variables": ["user.name"], "from_email_name": "Clerk Support", "reply_to_email_name": "support@clerk.com", "delivered_by_clerk": true, "enabled": false, "updated_at": 1610000000, "created_at": 1600000000} + "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - DeleteOrganization: - speakeasy-default-delete-organization: + UpsertTemplate: + speakeasy-default-upsert-template: parameters: path: - organization_id: "org_321_delete" + template_type: "sms" + slug: "verification-code" + requestBody: + application/json: {"name": "Verification Code", "subject": "Your Verification Code", "markup": "

Your code: {{code}}

", "body": "Use this code to verify your email: {{code}}", "delivered_by_clerk": true, "from_email_name": "hello", "reply_to_email_name": "support"} responses: "200": - application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} - "404": + application/json: {"id": "temp_12345", "object": "template", "instance_id": "inst_67890", "resource_type": "system", "template_type": "email", "name": "Welcome Email", "slug": "welcome_email", "position": 1, "can_revert": false, "can_delete": true, "can_toggle": false, "subject": "Welcome to our service!", "markup": "

Hello, {{ user.name }}

", "body": "You are now signed up. Welcome!", "available_variables": ["user.name", "user.email"], "required_variables": ["user.name"], "from_email_name": "Clerk Support", "reply_to_email_name": "support@clerk.com", "delivered_by_clerk": true, "enabled": true, "updated_at": 1610000000, "created_at": 1600000000} + "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - DeleteOrganizationLogo: - speakeasy-default-delete-organization-logo: + PreviewTemplate: + speakeasy-default-preview-template: parameters: path: - organization_id: "org_12345" + template_type: "email" + slug: "welcome-email" + requestBody: + application/json: {"subject": "Welcome to our service!", "body": "Hi, thank you for joining our service.", "from_email_name": "hello", "reply_to_email_name": "support"} responses: "200": - application/json: {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800} - "404": + application/json: {} + "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - DeleteOrganizationMembership: - speakeasy-default-delete-organization-membership: + GetUserList: + "": parameters: - path: - organization_id: "org_12345" - user_id: "user_67890" + query: + email_address: ["test@example.com"] + phone_number: ["+12345678901"] + external_id: ["external-id-123"] + username: ["user123"] + web3_wallet: ["0x123456789abcdef0x123456789abcdef"] + user_id: ["user-id-123"] + organization_id: ["org-id-123"] + query: "John" + email_address_query: "" + phone_number_query: "" + username_query: "" + name_query: "" + last_active_at_before: 1700690400000 + last_active_at_after: 1700690400000 + last_active_at_since: 1700690400000 + created_at_before: 1730160000000 + created_at_after: 1730160000000 + limit: 20 + offset: 10 + order_by: "-created_at" responses: "200": - application/json: {"id": "org_mem_123", "object": "organization_membership", "role": "member", "role_name": "", "permissions": ["read"], "public_metadata": {}, "private_metadata": {}, "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800} + application/json: [{"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_123", "object": "email_address", "email_address": "john.doe@example.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "matches_sso_connection": false, "created_at": 1609459200, "updated_at": 1609459200}], "phone_numbers": [{"id": "phone_id_123", "object": "phone_number", "phone_number": "+12345678901", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "phone_code", "attempts": 2, "expire_at": 1622852400}, "linked_to": [{"type": "oauth_google", "id": "link_id_123"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1609459200, "updated_at": 1609459200}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value", "message": "", "attempts": null, "expire_at": null}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml", "attempts": null, "expire_at": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": true, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 152837, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000}, {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_123", "object": "email_address", "email_address": "john.doe@example.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "matches_sso_connection": false, "created_at": 1609459200, "updated_at": 1609459200}], "phone_numbers": [{"id": "phone_id_123", "object": "phone_number", "phone_number": "+12345678901", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "phone_code", "attempts": 2, "expire_at": 1622852400}, "linked_to": [{"type": "oauth_google", "id": "link_id_123"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1609459200, "updated_at": 1609459200}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value", "message": "", "attempts": null, "expire_at": null}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml", "attempts": null, "expire_at": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": false, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 86140, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000}, {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_123", "object": "email_address", "email_address": "john.doe@example.com", "reserved": false, "verification": {"status": "verified", "strategy": "from_oauth_apple", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "matches_sso_connection": false, "created_at": 1609459200, "updated_at": 1609459200}], "phone_numbers": [{"id": "phone_id_123", "object": "phone_number", "phone_number": "+12345678901", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 2, "expire_at": 1622852400}, "linked_to": [{"type": "oauth_google", "id": "link_id_123"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1609459200, "updated_at": 1609459200}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value", "message": "", "attempts": null, "expire_at": null}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml", "attempts": null, "expire_at": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": true, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 54607, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000}] "400": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - DeletePhoneNumber: - speakeasy-default-delete-phone-number: - parameters: - path: - phone_number_id: "phone_12345" + application/json: {"errors": [{"message": "Invalid input", "long_message": "The input provided does not meet the requirements.", "code": "400_bad_request", "meta": {}, "clerk_trace_id": "trace_123456789abcd"}], "meta": {}} + CreateUser: + speakeasy-default-create-user: + requestBody: + application/json: {"external_id": "ext-id-001", "first_name": "John", "last_name": "Doe", "email_address": ["john.doe@example.com"], "phone_number": ["+12345678901"], "web3_wallet": ["0x123456789abcdef0x123456789abcdef"], "username": "johndoe123", "password": "Secure*Pass4", "password_digest": "$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc", "password_hasher": "", "skip_password_checks": false, "skip_password_requirement": false, "totp_secret": "base32totpsecretkey", "backup_codes": ["123456", "654321"], "public_metadata": {"role": "user"}, "private_metadata": {"internal_id": "789"}, "unsafe_metadata": {"preferences": {"theme": "dark"}}, "delete_self_enabled": true, "legal_accepted_at": "", "skip_legal_checks": false, "create_organization_enabled": true, "create_organizations_limit": 134365, "created_at": "2023-03-15T07:15:20.902Z"} responses: "200": - application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} + application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "matches_sso_connection": true, "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value", "message": "", "attempts": null, "expire_at": null}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "ticket", "attempts": null, "expire_at": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": false, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 86, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - DeleteRedirectURL: - speakeasy-default-delete-redirect-URL: + GetUsersCount: + speakeasy-default-get-users-count: parameters: - path: - id: "redir_01FG4K9G5NWSQ4ZPT4TQE4Z7G3" + query: + email_address: ["user@example.com"] + phone_number: ["+1234567890"] + external_id: ["external-id-123"] + username: ["username123"] + web3_wallet: ["0x123456789abcdef"] + user_id: ["user-id-123"] + query: "John Doe" + email_address_query: "" + phone_number_query: "" + username_query: "" responses: "200": - application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} - "404": + application/json: {"object": "total_count", "total_count": 100} + "422": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - DeleteSAMLConnection: - speakeasy-default-delete-SAML-connection: + GetUser: + speakeasy-default-get-user: parameters: path: - saml_connection_id: "saml_conn_123_delete" + user_id: "usr_1" responses: "200": - application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} - "402": + application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "matches_sso_connection": false, "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value", "message": "", "attempts": null, "expire_at": null}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "ticket", "attempts": null, "expire_at": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": false, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 521235, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} + "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - DeleteSvixApp: - speakeasy-default-delete-svix-app: + UpdateUser: + speakeasy-default-update-user: + parameters: + path: + user_id: "usr_1" + requestBody: + application/json: {"external_id": "ext_123", "first_name": "Jane", "last_name": "Doe", "primary_email_address_id": "eml_12345", "notify_primary_email_address_changed": true, "primary_phone_number_id": "phn_67890", "primary_web3_wallet_id": "wlt_123", "username": "janedoe", "profile_image_id": "img_789", "password": "secretPass123!", "password_digest": "$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc", "password_hasher": "", "skip_password_checks": false, "sign_out_of_other_sessions": true, "totp_secret": "ABCD1234EFGH5678", "backup_codes": ["123456", "654321"], "public_metadata": {"theme": "dark"}, "private_metadata": {"vip": true}, "unsafe_metadata": {"age": 30}, "delete_self_enabled": true, "create_organization_enabled": false, "legal_accepted_at": "", "skip_legal_checks": false, "create_organizations_limit": 597129, "created_at": "2021-04-05T14:30:00.000Z"} responses: + "200": + application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "matches_sso_connection": true, "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value", "message": "", "attempts": null, "expire_at": null}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "ticket", "attempts": null, "expire_at": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": false, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 488852, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} DeleteUser: @@ -977,279 +1030,238 @@ examples: application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - DeleteUserProfileImage: - speakeasy-default-delete-user-profile-image: + BanUser: + speakeasy-default-ban-user: parameters: path: - user_id: "usr_test123" + user_id: "user_12345" responses: "200": - application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value", "message": "", "attempts": null, "expire_at": null}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml", "external_verification_redirect_url": "https://example.com/saml_callback", "error": null, "expire_at": 1622852400, "attempts": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": true, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 547131, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} - "404": + application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "matches_sso_connection": false, "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value", "message": "", "attempts": null, "expire_at": null}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml", "external_verification_redirect_url": "https://example.com/saml_callback", "error": null, "expire_at": 1622852400, "attempts": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": true, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 274486, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} + "402": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - DisableMFA: - speakeasy-default-disable-MFA: + UnbanUser: + speakeasy-default-unban-user: parameters: path: - user_id: "user_123456" + user_id: "user_12345" responses: "200": - application/json: {"user_id": "user_123456"} - "404": + application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "matches_sso_connection": true, "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value", "message": "", "attempts": null, "expire_at": null}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "ticket", "attempts": null, "expire_at": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": true, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 894025, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} + "402": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - GenerateSvixAuthURL: - speakeasy-default-generate-svix-auth-URL: + LockUser: + speakeasy-default-lock-user: + parameters: + path: + user_id: "user_123456789" responses: "200": - application/json: {"svix_url": "https://app.svix.com/your-instance-url"} - "400": + application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "matches_sso_connection": true, "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value", "message": "", "attempts": null, "expire_at": null}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "ticket", "attempts": null, "expire_at": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": true, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 830993, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} + "403": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - GetClient: - speakeasy-default-get-client: + UnlockUser: + speakeasy-default-unlock-user: parameters: path: - client_id: "cli_123456789" + user_id: "user_12345" responses: "200": - application/json: {"object": "client", "id": "client_123456789abcd", "session_ids": ["sess_123456789abcd", "sess_23456789abcd"], "sessions": [{"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": false, "browser_name": "", "browser_version": "", "ip_address": "bbfa:954e:9b14:62cb:8adc:7735:b6aa:fe70", "city": "Kendall", "country": "Iran"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}, {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": true, "browser_name": "", "browser_version": "", "ip_address": "140.27.220.165", "city": "Eldacester", "country": "Saint Pierre and Miquelon"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}], "sign_in_id": "signin_123456789abcd", "sign_up_id": "signup_123456789abcd", "last_active_session_id": "session_123456789abcd", "updated_at": 1632580323, "created_at": 1622481123} - "400": + application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "matches_sso_connection": true, "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value", "message": "", "attempts": null, "expire_at": null}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "ticket", "attempts": null, "expire_at": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": false, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 550861, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} + "403": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - GetClientList: - speakeasy-default-get-client-list: + SetUserProfileImage: + speakeasy-default-set-user-profile-image: parameters: - query: - limit: 20 - offset: 10 + path: + user_id: "usr_test123" + requestBody: + multipart/form-data: {"file": {"": ""}} responses: "200": - application/json: [{"object": "client", "id": "client_123456789abcd", "session_ids": ["sess_123456789abcd", "sess_23456789abcd"], "sessions": [{"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": false, "browser_name": "", "browser_version": "", "ip_address": "e353:de0f:11fb:d018:a1ec:da17:c0d9:e31d", "city": "South Herminiaview", "country": "Republic of Korea"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}, {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": true, "browser_name": "", "browser_version": "", "ip_address": "c9c6:823e:0dee:1fcc:bf13:1cb3:e6bb:116f", "city": "Gerlachborough", "country": "Bermuda"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}], "sign_in_id": "signin_123456789abcd", "sign_up_id": "signup_123456789abcd", "last_active_session_id": "session_123456789abcd", "updated_at": 1632580323, "created_at": 1622481123}, {"object": "client", "id": "client_123456789abcd", "session_ids": ["sess_123456789abcd", "sess_23456789abcd"], "sessions": [{"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": false, "browser_name": "", "browser_version": "", "ip_address": "1.207.244.199", "city": "Uriahside", "country": "Andorra"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}, {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": true, "browser_name": "", "browser_version": "", "ip_address": "fa80:efd8:0c78:12ef:98a4:d1d9:4442:ecaa", "city": "South Newellfort", "country": "Estonia"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}], "sign_in_id": "signin_123456789abcd", "sign_up_id": "signup_123456789abcd", "last_active_session_id": "session_123456789abcd", "updated_at": 1632580323, "created_at": 1622481123}, {"object": "client", "id": "client_123456789abcd", "session_ids": ["sess_123456789abcd", "sess_23456789abcd"], "sessions": [], "sign_in_id": "signin_123456789abcd", "sign_up_id": "signup_123456789abcd", "last_active_session_id": "session_123456789abcd", "updated_at": 1632580323, "created_at": 1622481123}] + application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "matches_sso_connection": false, "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value", "message": "", "attempts": null, "expire_at": null}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "ticket", "attempts": null, "expire_at": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": false, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 67260, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - GetEmailAddress: - speakeasy-default-get-email-address: + DeleteUserProfileImage: + speakeasy-default-delete-user-profile-image: parameters: path: - email_address_id: "email_address_id_example" + user_id: "usr_test123" responses: "200": - application/json: {"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001} - "400": + application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "matches_sso_connection": true, "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value", "message": "", "attempts": null, "expire_at": null}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml", "external_verification_redirect_url": "https://example.com/saml_callback", "error": null, "expire_at": 1622852400, "attempts": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": false, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 935500, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} + "404": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - GetJWKS: - speakeasy-default-get-JWKS: - responses: - "200": - application/json: {"keys": [{"use": "", "kty": "", "kid": "", "alg": "", "n": "", "e": ""}, {"use": "", "kty": "", "kid": "", "alg": "", "n": "", "e": ""}]} - GetJWTTemplate: - speakeasy-default-get-JWT-template: + UpdateUserMetadata: + speakeasy-default-update-user-metadata: parameters: path: - template_id: "template_123" + user_id: "user_123456789" + requestBody: + application/json: {"public_metadata": {"key": "", "key1": ""}, "private_metadata": {"key": "", "key1": "", "key2": ""}, "unsafe_metadata": {"key": ""}} responses: "200": - application/json: {"object": "jwt_template", "id": "jt_1234567890abcdef", "name": "My First JWT Template", "claims": {}, "lifetime": 3600, "allowed_clock_skew": 5, "custom_signing_key": false, "signing_algorithm": "RS256", "created_at": 1609459200, "updated_at": 1612137600} - "404": + application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "matches_sso_connection": false, "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value", "message": "", "attempts": null, "expire_at": null}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml", "external_verification_redirect_url": "https://example.com/saml_callback", "error": null, "expire_at": 1622852400, "attempts": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": true, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 661662, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} + "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} GetOAuthAccessToken: speakeasy-default-get-O-auth-access-token: parameters: path: - provider: "oauth_google" user_id: "user_123" + provider: "oauth_google" responses: "200": - application/json: [] - "422": - application/json: - errors: - - clerk_trace_id: trace_id - code: error_code - long_message: Longer error message with more details - message: Error message - meta: {} - meta: {} + application/json: [{"object": "oauth_access_token", "external_account_id": "external_account_456", "provider_user_id": "provider_user_789", "token": "access_token_123", "provider": "oauth_google", "label": "Primary account", "scopes": ["email", "profile"], "token_secret": "token_secret_xyz", "expires_at": 187913}] "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - GetOAuthApplication: - speakeasy-default-get-O-auth-application: + UsersGetOrganizationMemberships: + speakeasy-default-users-get-organization-memberships: parameters: path: - oauth_application_id: "oauth_app_12345" + user_id: "usr_1234567890" + query: + limit: 20 + offset: 10 responses: "200": - application/json: {"object": "oauth_application", "id": "oauth_app_1234", "instance_id": "instance_5678", "name": "Example OAuth App", "client_id": "client_12345", "public": false, "scopes": "profile email", "callback_url": "https://example.com/oauth/callback", "authorize_url": "https://example.com/authorize", "token_fetch_url": "https://example.com/oauth/token", "user_info_url": "https://example.com/userinfo", "created_at": 1609459200, "updated_at": 1612137600} + application/json: {"data": [{"id": "org_mem_123", "object": "organization_membership", "role": "member", "role_name": "", "permissions": ["read"], "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800}], "total_count": 1} "403": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - GetOrganization: - speakeasy-default-get-organization: + UsersGetOrganizationInvitations: + speakeasy-default-users-get-organization-invitations: parameters: path: - organization_id: "org_123" + user_id: "" query: - include_members_count: false + limit: 20 + offset: 10 + status: "pending" responses: "200": - application/json: {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800} - "403": + application/json: {"data": [{"id": "", "object": "organization_invitation", "email_address": "Regan_Erdman@gmail.com", "role": "", "role_name": "", "organization_id": "", "status": "", "public_metadata": {"key": ""}, "private_metadata": {"key": "", "key1": ""}, "url": "https://colossal-self-confidence.name", "public_organization_data": {"id": "", "name": "", "slug": "", "image_url": "https://worthy-councilman.org", "has_image": false}, "created_at": 260863, "updated_at": 89328}], "total_count": 42030} + "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - GetOrganizationInvitation: - speakeasy-default-get-organization-invitation: + VerifyPassword: + speakeasy-default-verify-password: parameters: path: - invitation_id: "inv_987654321" - organization_id: "org_123456789" + user_id: "user_123" + requestBody: + application/json: {"password": "securepassword123"} responses: "200": - application/json: {"id": "inv_12345", "object": "organization_invitation", "email_address": "user@example.com", "role": "admin", "role_name": "", "organization_id": "org_12345", "status": "pending", "public_metadata": {"key": "value"}, "private_metadata": {"private_key": "secret_value"}, "created_at": 1622547600, "updated_at": 1622551200} - "400": + application/json: {"verified": true} + "500": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - GetPhoneNumber: - speakeasy-default-get-phone-number: + VerifyTOTP: + speakeasy-default-verify-TOTP: parameters: path: - phone_number_id: "phone_12345" + user_id: "usr_1a2b3c" + requestBody: + application/json: {"code": "123456"} responses: "200": - application/json: {"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1594842023, "updated_at": 1604842023} - "400": + application/json: {"verified": true, "code_type": "totp"} + "500": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - GetPublicInterstitial: - speakeasy-default-get-public-interstitial: - parameters: - query: - frontendApi: "frontend-api_1a2b3c4d" - publishable_key: "pub_1a2b3c4d" - GetRedirectURL: - speakeasy-default-get-redirect-URL: + DisableMFA: + speakeasy-default-disable-MFA: parameters: path: - id: "redir_01FG4K9G5NWSQ4ZPT4TQE4Z7G3" + user_id: "user_123456" responses: "200": - application/json: {"object": "redirect_url", "id": "red_12345", "url": "https://my-app.com/oauth-callback", "created_at": 1610000000, "updated_at": 1620000000} + application/json: {"user_id": "user_123456"} "404": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - GetSAMLConnection: - speakeasy-default-get-SAML-connection: + "500": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + DeleteBackupCode: + speakeasy-default-delete-backup-code: parameters: path: - saml_connection_id: "saml_conn_123" + user_id: "" responses: "200": - application/json: {"object": "saml_connection", "id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "idp_entity_id": "idp-entity-id", "idp_sso_url": "https://sso.mycompany.com", "idp_certificate": "MIIDdzCCAl+gAwIBAgIJAKcyBaiiz+DT...", "idp_metadata_url": "https://sso.mycompany.com/metadata", "idp_metadata": ""} + "404": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - GetSession: - speakeasy-default-get-session: + "500": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + UserPasskeyDelete: + speakeasy-default-user-passkey-delete: parameters: path: - session_id: "sess_1234567890abcdef" + user_id: "" + passkey_identification_id: "" responses: "200": - application/json: {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": false, "browser_name": "", "browser_version": "", "ip_address": "bbfa:954e:9b14:62cb:8adc:7735:b6aa:fe70", "city": "Kendall", "country": "Iran"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000} - "400": + application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} + "403": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - GetSessionList: - speakeasy-default-get-session-list: + "500": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + UserWeb3WalletDelete: + speakeasy-default-user-web3-wallet-delete: parameters: - query: - client_id: "client_123" - limit: 20 - offset: 10 - status: "active" - user_id: "user_456" + path: + user_id: "" + web3_wallet_identification_id: "" responses: "200": - application/json: [{"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": false, "browser_name": "", "browser_version": "", "ip_address": "e353:de0f:11fb:d018:a1ec:da17:c0d9:e31d", "city": "South Herminiaview", "country": "Republic of Korea"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}] + application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - GetTemplate: - speakeasy-default-get-template: - parameters: - path: - slug: "welcome-email" - template_type: "email" - responses: - "200": - application/json: {"id": "temp_12345", "object": "template", "instance_id": "inst_67890", "resource_type": "system", "template_type": "email", "name": "Welcome Email", "slug": "welcome_email", "position": 1, "can_revert": false, "can_delete": true, "can_toggle": false, "subject": "Welcome to our service!", "markup": "

Hello, {{ user.name }}

", "body": "You are now signed up. Welcome!", "available_variables": ["user.name", "user.email"], "required_variables": ["user.name"], "from_email_name": "Clerk Support", "reply_to_email_name": "support@clerk.com", "delivered_by_clerk": true, "enabled": false, "updated_at": 1610000000, "created_at": 1600000000} - "400": + "500": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - GetTemplateList: - "": + CreateUserTOTP: + speakeasy-default-create-user-TOTP: parameters: path: - template_type: "email" + user_id: "" responses: "200": - application/json: [{"id": "temp_12345", "object": "template", "instance_id": "inst_67890", "resource_type": "system", "template_type": "email", "name": "Welcome Email", "slug": "welcome_email", "position": 1, "can_revert": false, "can_delete": true, "can_toggle": false, "subject": "Welcome to our service!", "markup": "

Hello, {{ user.name }}

", "body": "You are now signed up. Welcome!", "available_variables": ["user.name", "user.email"], "required_variables": ["user.name"], "from_email_name": "Clerk Support", "reply_to_email_name": "support@clerk.com", "delivered_by_clerk": true, "enabled": false, "updated_at": 1610000000, "created_at": 1600000000}, {"id": "temp_12345", "object": "template", "instance_id": "inst_67890", "resource_type": "system", "template_type": "email", "name": "Welcome Email", "slug": "welcome_email", "position": 1, "can_revert": false, "can_delete": true, "can_toggle": false, "subject": "Welcome to our service!", "markup": "

Hello, {{ user.name }}

", "body": "You are now signed up. Welcome!", "available_variables": ["user.name", "user.email"], "required_variables": ["user.name"], "from_email_name": "Clerk Support", "reply_to_email_name": "support@clerk.com", "delivered_by_clerk": true, "enabled": true, "updated_at": 1610000000, "created_at": 1600000000}, {"id": "temp_12345", "object": "template", "instance_id": "inst_67890", "resource_type": "system", "template_type": "email", "name": "Welcome Email", "slug": "welcome_email", "position": 1, "can_revert": false, "can_delete": true, "can_toggle": true, "subject": "Welcome to our service!", "markup": "

Hello, {{ user.name }}

", "body": "You are now signed up. Welcome!", "available_variables": ["user.name", "user.email"], "required_variables": ["user.name"], "from_email_name": "Clerk Support", "reply_to_email_name": "support@clerk.com", "delivered_by_clerk": true, "enabled": true, "updated_at": 1610000000, "created_at": 1600000000}] - "400": - application/json: {"errors": [{"message": "Invalid input", "long_message": "The input provided does not meet the requirements.", "code": "400_bad_request", "meta": {}, "clerk_trace_id": "trace_123456789abcd"}], "meta": {}} - GetUser: - speakeasy-default-get-user: + application/json: {"object": "", "id": "", "secret": "", "uri": "https://creamy-merit.net", "verified": false, "backup_codes": ["", ""], "key": "", "key1": ""} + "403": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + "500": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + DeleteTOTP: + speakeasy-default-delete-TOTP: parameters: path: - user_id: "usr_1" + user_id: "" responses: "200": - application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value", "message": "", "attempts": null, "expire_at": null}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "ticket", "attempts": null, "expire_at": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": false, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 544221, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} - "400": + application/json: {"user_id": ""} + "404": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - GetUserList: - "": + "500": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + DeleteExternalAccount: + speakeasy-default-delete-external-account: parameters: - query: - email_address: ["test@example.com"] - external_id: ["external-id-123"] - last_active_at_since: 1700690400000 - limit: 20 - offset: 10 - order_by: "-created_at" - organization_id: ["org-id-123"] - phone_number: ["+12345678901"] - query: "John" - user_id: ["user-id-123"] - username: ["user123"] - web3_wallet: ["0x123456789abcdef0x123456789abcdef"] + path: + user_id: "" + external_account_id: "" responses: "200": - application/json: [{"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_123", "object": "email_address", "email_address": "john.doe@example.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1609459200, "updated_at": 1609459200}], "phone_numbers": [{"id": "phone_id_123", "object": "phone_number", "phone_number": "+12345678901", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 2, "expire_at": 1622852400}, "linked_to": [{"type": "oauth_google", "id": "link_id_123"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1609459200, "updated_at": 1609459200}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml", "attempts": null, "expire_at": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": false, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 177706, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000}, {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_123", "object": "email_address", "email_address": "john.doe@example.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1609459200, "updated_at": 1609459200}], "phone_numbers": [{"id": "phone_id_123", "object": "phone_number", "phone_number": "+12345678901", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 2, "expire_at": 1622852400}, "linked_to": [{"type": "oauth_google", "id": "link_id_123"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1609459200, "updated_at": 1609459200}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml", "attempts": null, "expire_at": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": true, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 635532, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000}, {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_123", "object": "email_address", "email_address": "john.doe@example.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1609459200, "updated_at": 1609459200}], "phone_numbers": [{"id": "phone_id_123", "object": "phone_number", "phone_number": "+12345678901", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 2, "expire_at": 1622852400}, "linked_to": [{"type": "oauth_google", "id": "link_id_123"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1609459200, "updated_at": 1609459200}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml", "attempts": null, "expire_at": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": true, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 68504, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000}] + application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} "400": - application/json: {"errors": [{"message": "Invalid input", "long_message": "The input provided does not meet the requirements.", "code": "400_bad_request", "meta": {}, "clerk_trace_id": "trace_123456789abcd"}], "meta": {}} - GetUsersCount: - speakeasy-default-get-users-count: - parameters: - query: - email_address: ["user@example.com"] - external_id: ["external-id-123"] - phone_number: ["+1234567890"] - query: "John Doe" - user_id: ["user-id-123"] - username: ["username123"] - web3_wallet: ["0x123456789abcdef"] - responses: - "200": - application/json: {"object": "total_count", "total_count": 100} - "422": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - ListAllowlistIdentifiers: - speakeasy-default-list-allowlist-identifiers: - responses: - "200": - application/json: [{"object": "allowlist_identifier", "id": "alid_123456", "invitation_id": "inv_123456", "identifier": "user@example.com", "identifier_type": "email_address", "instance_id": "instance_12345", "created_at": 1622547600, "updated_at": 1622648600}, {"object": "allowlist_identifier", "id": "alid_123456", "invitation_id": "inv_123456", "identifier": "user@example.com", "identifier_type": "email_address", "instance_id": "instance_12345", "created_at": 1622547600, "updated_at": 1622648600}, {"object": "allowlist_identifier", "id": "alid_123456", "invitation_id": "inv_123456", "identifier": "user@example.com", "identifier_type": "email_address", "instance_id": "instance_12345", "created_at": 1622547600, "updated_at": 1622648600}] - "401": + "500": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - ListBlocklistIdentifiers: - speakeasy-default-list-blocklist-identifiers: + CreateInvitation: + speakeasy-default-create-invitation: + requestBody: + application/json: {"email_address": "user@example.com", "redirect_url": "https://example.com/welcome", "notify": true, "ignore_existing": "​false", "expires_in_days": 486589, "template_slug": "waitlist_invitation"} responses: "200": - application/json: {"data": [{"object": "blocklist_identifier", "id": "identifier_id", "identifier": "blocked@example.com", "identifier_type": "email_address", "instance_id": "instance_id_here", "created_at": 1609459200, "updated_at": 1612137600}, {"object": "blocklist_identifier", "id": "identifier_id", "identifier": "blocked@example.com", "identifier_type": "email_address", "instance_id": "instance_id_here", "created_at": 1609459200, "updated_at": 1612137600}, {"object": "blocklist_identifier", "id": "identifier_id", "identifier": "blocked@example.com", "identifier_type": "email_address", "instance_id": "instance_id_here", "created_at": 1609459200, "updated_at": 1612137600}], "total_count": 100} - "401": + application/json: {"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "revoked": false, "status": "pending", "url": "https://example.com/invitations/accept?code=abcd1234", "expires_at": 417458, "created_at": 1622549600, "updated_at": 1622553200} + "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - ListDomains: - speakeasy-default-list-domains: - responses: - "200": - application/json: {"data": [{"object": "domain", "id": "domain_id", "name": "example.com", "is_satellite": false, "frontend_api_url": "https://frontend.example.com", "accounts_portal_url": null, "proxy_url": null, "development_origin": "http://localhost:3000", "cname_targets": [{"host": "cname.example.com", "value": "value.example.com", "required": true}]}, {"object": "domain", "id": "domain_id", "name": "example.com", "is_satellite": false, "frontend_api_url": "https://frontend.example.com", "accounts_portal_url": null, "proxy_url": null, "development_origin": "http://localhost:3000", "cname_targets": [{"host": "cname.example.com", "value": "value.example.com", "required": true}]}, {"object": "domain", "id": "domain_id", "name": "example.com", "is_satellite": false, "frontend_api_url": "https://frontend.example.com", "accounts_portal_url": null, "proxy_url": null, "development_origin": "http://localhost:3000", "cname_targets": [{"host": "cname.example.com", "value": "value.example.com", "required": true}]}], "total_count": 1} ListInvitations: speakeasy-default-list-invitations: parameters: @@ -1257,65 +1269,81 @@ examples: limit: 20 offset: 10 status: "pending" + query: "" responses: "200": - application/json: [{"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "public_metadata": {}, "revoked": false, "status": "pending", "url": "https://example.com/invitations/accept?code=abcd1234", "expires_at": 768578, "created_at": 1622549600, "updated_at": 1622553200}, {"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "public_metadata": {}, "revoked": false, "status": "pending", "url": "https://example.com/invitations/accept?code=abcd1234", "expires_at": 547272, "created_at": 1622549600, "updated_at": 1622553200}, {"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "public_metadata": {}, "revoked": false, "status": "pending", "url": "https://example.com/invitations/accept?code=abcd1234", "expires_at": 678317, "created_at": 1622549600, "updated_at": 1622553200}] - ListJWTTemplates: - speakeasy-default-list-JWT-templates: + application/json: [{"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "revoked": false, "status": "pending", "url": "https://example.com/invitations/accept?code=abcd1234", "expires_at": 547272, "created_at": 1622549600, "updated_at": 1622553200}, {"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "revoked": false, "status": "pending", "url": "https://example.com/invitations/accept?code=abcd1234", "expires_at": 678317, "created_at": 1622549600, "updated_at": 1622553200}, {"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "revoked": false, "status": "pending", "url": "https://example.com/invitations/accept?code=abcd1234", "expires_at": 177706, "created_at": 1622549600, "updated_at": 1622553200}] + CreateBulkInvitations: + speakeasy-default-create-bulk-invitations: + requestBody: + application/json: [{"email_address": "Jeff_Schiller50@gmail.com", "public_metadata": {"key": ""}, "redirect_url": "https://dreary-advancement.net/", "notify": true, "ignore_existing": false, "expires_in_days": 123536}, {"email_address": "Pierce13@hotmail.com", "public_metadata": {"key": ""}, "redirect_url": "https://shrill-jet.net/", "notify": true, "ignore_existing": false, "expires_in_days": 665767}] responses: "200": - application/json: [{"object": "jwt_template", "id": "jt_1234567890abcdef", "name": "My First JWT Template", "claims": {}, "lifetime": 3600, "allowed_clock_skew": 5, "custom_signing_key": false, "signing_algorithm": "RS256", "created_at": 1609459200, "updated_at": 1612137600}, {"object": "jwt_template", "id": "jt_1234567890abcdef", "name": "My First JWT Template", "claims": {}, "lifetime": 3600, "allowed_clock_skew": 5, "custom_signing_key": false, "signing_algorithm": "RS256", "created_at": 1609459200, "updated_at": 1612137600}, {"object": "jwt_template", "id": "jt_1234567890abcdef", "name": "My First JWT Template", "claims": {}, "lifetime": 3600, "allowed_clock_skew": 5, "custom_signing_key": false, "signing_algorithm": "RS256", "created_at": 1609459200, "updated_at": 1612137600}] - ListOAuthApplications: - speakeasy-default-list-O-auth-applications: + application/json: [{"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "revoked": false, "status": "pending", "url": "https://example.com/invitations/accept?code=abcd1234", "expires_at": 95345, "created_at": 1622549600, "updated_at": 1622553200}] + "400": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + RevokeInvitation: + speakeasy-default-revoke-invitation: + parameters: + path: + invitation_id: "inv_123" + responses: + "200": + application/json: {"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "revoked": true, "status": "revoked", "url": "https://example.com/invitations/accept?code=abcd1234", "expires_at": 861369, "created_at": 1622549600, "updated_at": 1622553200} + "400": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + ListInstanceOrganizationInvitations: + speakeasy-default-list-instance-organization-invitations: parameters: query: limit: 20 offset: 10 + order_by: "-created_at" + status: "accepted" + query: "" responses: "200": - application/json: {"data": [{"object": "oauth_application", "id": "oauth_app_1234", "instance_id": "instance_5678", "name": "Example OAuth App", "client_id": "client_12345", "public": false, "scopes": "profile email", "callback_url": "https://example.com/oauth/callback", "authorize_url": "https://example.com/authorize", "token_fetch_url": "https://example.com/oauth/token", "user_info_url": "https://example.com/userinfo", "created_at": 1609459200, "updated_at": 1612137600}], "total_count": 1} + application/json: {"data": [], "total_count": 598480} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - ListOrganizationInvitations: - speakeasy-default-list-organization-invitations: + "500": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + CreateOrganizationInvitation: + speakeasy-default-create-organization-invitation: parameters: path: organization_id: "org_12345" - query: - limit: 20 - offset: 10 - status: "pending" + requestBody: + application/json: {"email_address": "user@example.com", "inviter_user_id": "user_67890", "role": "admin", "public_metadata": {"key": "value"}, "private_metadata": {"private_key": "secret_value"}, "redirect_url": "https://example.com/welcome", "expires_in_days": 486589} responses: "200": - application/json: {"data": [{"id": "inv_12345", "object": "organization_invitation", "email_address": "user@example.com", "role": "admin", "role_name": "", "organization_id": "org_12345", "status": "pending", "public_metadata": {"key": "value"}, "private_metadata": {"private_key": "secret_value"}, "created_at": 1622547600, "updated_at": 1622551200}], "total_count": 10} + application/json: {"id": "inv_12345", "object": "organization_invitation", "email_address": "user@example.com", "role": "admin", "role_name": "", "organization_id": "org_12345", "status": "pending", "public_metadata": {"key": "value"}, "private_metadata": {"private_key": "secret_value"}, "url": "https://inferior-chainstay.com", "expires_at": 796474, "created_at": 1622547600, "updated_at": 1622551200} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - ListOrganizationMemberships: - speakeasy-default-list-organization-memberships: + ListOrganizationInvitations: + speakeasy-default-list-organization-invitations: parameters: path: - organization_id: "org_789" + organization_id: "org_12345" query: limit: 20 offset: 10 - order_by: "+created_at" + status: "pending" responses: "200": - application/json: {"data": [{"id": "org_mem_123", "object": "organization_membership", "role": "member", "role_name": "", "permissions": ["read"], "public_metadata": {}, "private_metadata": {}, "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800}, {"id": "org_mem_123", "object": "organization_membership", "role": "member", "role_name": "", "permissions": ["read"], "public_metadata": {}, "private_metadata": {}, "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800}, {"id": "org_mem_123", "object": "organization_membership", "role": "member", "role_name": "", "permissions": ["read"], "public_metadata": {}, "private_metadata": {}, "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800}], "total_count": 1} - "401": + application/json: {"data": [{"id": "inv_12345", "object": "organization_invitation", "email_address": "user@example.com", "role": "admin", "role_name": "", "organization_id": "org_12345", "status": "pending", "public_metadata": {"key": "value"}, "private_metadata": {"private_key": "secret_value"}, "url": "https://neglected-plastic.biz", "expires_at": 229716, "created_at": 1622547600, "updated_at": 1622551200}], "total_count": 10} + "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - ListOrganizations: - speakeasy-default-list-organizations: + CreateOrganizationInvitationBulk: + speakeasy-default-create-organization-invitation-bulk: parameters: - query: - include_members_count: false - limit: 20 - offset: 10 - order_by: "-name" - query: "clerk" + path: + organization_id: "org_12345" + requestBody: + application/json: [] responses: "200": - application/json: {"data": [{"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}], "total_count": 1} + application/json: {"data": [{"id": "inv_12345", "object": "organization_invitation", "email_address": "user@example.com", "role": "admin", "role_name": "", "organization_id": "org_12345", "status": "pending", "public_metadata": {"key": "value"}, "private_metadata": {"private_key": "secret_value"}, "url": "https://violent-unibody.com", "expires_at": 251956, "created_at": 1622547600, "updated_at": 1622551200}], "total_count": 10} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} ListPendingOrganizationInvitations: @@ -1328,177 +1356,149 @@ examples: offset: 10 responses: "200": - application/json: {"data": [{"id": "inv_12345", "object": "organization_invitation", "email_address": "user@example.com", "role": "member", "role_name": "", "organization_id": "org_12345", "status": "pending", "public_metadata": {"key": "value"}, "private_metadata": {"private_key": "secret_value"}, "created_at": 1617981379, "updated_at": 1625581379}], "total_count": 10} + application/json: {"data": [{"id": "inv_12345", "object": "organization_invitation", "email_address": "user@example.com", "role": "member", "role_name": "", "organization_id": "org_12345", "status": "pending", "public_metadata": {"key": "value"}, "private_metadata": {"private_key": "secret_value"}, "url": "https://these-department.net/", "expires_at": 943319, "created_at": 1617981379, "updated_at": 1625581379}], "total_count": 10} "400": application/json: {"errors": [{"message": "Invalid input", "long_message": "The input provided does not meet the requirements.", "code": "400_bad_request", "meta": {}, "clerk_trace_id": "trace_123456789abcd"}], "meta": {}} - ListRedirectURLs: - speakeasy-default-list-redirect-UR-ls: - responses: - "200": - application/json: [{"object": "redirect_url", "id": "red_12345", "url": "https://my-app.com/oauth-callback", "created_at": 1610000000, "updated_at": 1620000000}, {"object": "redirect_url", "id": "red_12345", "url": "https://my-app.com/oauth-callback", "created_at": 1610000000, "updated_at": 1620000000}, {"object": "redirect_url", "id": "red_12345", "url": "https://my-app.com/oauth-callback", "created_at": 1610000000, "updated_at": 1620000000}] - ListSAMLConnections: - speakeasy-default-list-SAML-connections: - parameters: - query: - limit: 20 - offset: 10 - responses: - "200": - application/json: {"data": [{"object": "saml_connection", "id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "idp_entity_id": "idp-entity-id", "idp_sso_url": "https://sso.mycompany.com", "idp_certificate": "MIIDdzCCAl+gAwIBAgIJAKcyBaiiz+DT...", "idp_metadata_url": "https://sso.mycompany.com/metadata", "idp_metadata": "", "attempts": null, "expire_at": null}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml", "external_verification_redirect_url": "https://example.com/saml_callback", "error": null, "expire_at": 1622852400, "attempts": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": false, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 437822, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} - "403": + application/json: {"id": "inv_12345", "object": "organization_invitation", "email_address": "user@example.com", "role": "admin", "role_name": "", "organization_id": "org_12345", "status": "pending", "public_metadata": {"key": "value"}, "private_metadata": {"private_key": "secret_value"}, "url": "https://normal-making.name", "expires_at": 969961, "created_at": 1622547600, "updated_at": 1622551200} + "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - MergeOrganizationMetadata: - speakeasy-default-merge-organization-metadata: + RevokeOrganizationInvitation: + speakeasy-default-revoke-organization-invitation: parameters: path: - organization_id: "org_12345" + organization_id: "org_123456" + invitation_id: "inv_123456" requestBody: - application/json: {} + application/json: {"requesting_user_id": "usr_12345"} responses: "200": - application/json: {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800} + application/json: {"id": "inv_12345", "object": "organization_invitation", "email_address": "user@example.com", "role": "admin", "role_name": "", "organization_id": "org_12345", "status": "pending", "public_metadata": {"key": "value"}, "private_metadata": {"private_key": "secret_value"}, "url": "https://anguished-cassava.biz", "expires_at": 968343, "created_at": 1622547600, "updated_at": 1622551200} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - PreviewTemplate: - speakeasy-default-preview-template: - parameters: - path: - slug: "welcome-email" - template_type: "email" - requestBody: - application/json: {"subject": "Welcome to our service!", "body": "Hi, thank you for joining our service.", "from_email_name": "hello", "reply_to_email_name": "support"} + ListAllowlistIdentifiers: + speakeasy-default-list-allowlist-identifiers: responses: - "400": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} "200": - application/json: {} - RevertTemplate: - speakeasy-default-revert-template: - parameters: - path: - slug: "welcome-email" - template_type: "email" + application/json: [{"object": "allowlist_identifier", "id": "alid_123456", "invitation_id": "inv_123456", "identifier": "user@example.com", "identifier_type": "email_address", "instance_id": "instance_12345", "created_at": 1622547600, "updated_at": 1622648600}, {"object": "allowlist_identifier", "id": "alid_123456", "invitation_id": "inv_123456", "identifier": "user@example.com", "identifier_type": "email_address", "instance_id": "instance_12345", "created_at": 1622547600, "updated_at": 1622648600}, {"object": "allowlist_identifier", "id": "alid_123456", "invitation_id": "inv_123456", "identifier": "user@example.com", "identifier_type": "email_address", "instance_id": "instance_12345", "created_at": 1622547600, "updated_at": 1622648600}] + "401": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + CreateAllowlistIdentifier: + speakeasy-default-create-allowlist-identifier: + requestBody: + application/json: {"identifier": "user@example.com", "notify": true} responses: "200": - application/json: {"id": "temp_12345", "object": "template", "instance_id": "inst_67890", "resource_type": "system", "template_type": "email", "name": "Welcome Email", "slug": "welcome_email", "position": 1, "can_revert": false, "can_delete": true, "can_toggle": true, "subject": "Welcome to our service!", "markup": "

Hello, {{ user.name }}

", "body": "You are now signed up. Welcome!", "available_variables": ["user.name", "user.email"], "required_variables": ["user.name"], "from_email_name": "Clerk Support", "reply_to_email_name": "support@clerk.com", "delivered_by_clerk": true, "enabled": false, "updated_at": 1610000000, "created_at": 1600000000} + application/json: {"object": "allowlist_identifier", "id": "alid_123456", "invitation_id": "inv_123456", "identifier": "user@example.com", "identifier_type": "email_address", "instance_id": "instance_12345", "created_at": 1622547600, "updated_at": 1622648600} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - RevokeActorToken: - speakeasy-default-revoke-actor-token: - parameters: - path: - actor_token_id: "act_tok_abcdefghijk" + CreateBlocklistIdentifier: + speakeasy-default-create-blocklist-identifier: + requestBody: + application/json: {"identifier": "example@example.com"} responses: "200": - application/json: {"object": "actor_token", "id": "actor_tok_1a2b3c", "status": "pending", "user_id": "user_1a2b3c", "token": "token_string", "url": "https://example.com/token", "created_at": 1609459200, "updated_at": 1612137600} + application/json: {"object": "blocklist_identifier", "id": "identifier_id", "identifier": "blocked@example.com", "identifier_type": "email_address", "instance_id": "instance_id_here", "created_at": 1609459200, "updated_at": 1612137600} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - RevokeInvitation: - speakeasy-default-revoke-invitation: + DeleteBlocklistIdentifier: + speakeasy-default-delete-blocklist-identifier: parameters: path: - invitation_id: "inv_123" + identifier_id: "identifier123" responses: "200": - application/json: {"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "public_metadata": {}, "revoked": true, "status": "revoked", "url": "https://example.com/invitations/accept?code=abcd1234", "expires_at": 861369, "created_at": 1622549600, "updated_at": 1622553200} - "400": + application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} + "402": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - RevokeOrganizationInvitation: - speakeasy-default-revoke-organization-invitation: + DeleteAllowlistIdentifier: + speakeasy-default-delete-allowlist-identifier: parameters: path: - invitation_id: "inv_123456" - organization_id: "org_123456" - requestBody: - application/json: {"requesting_user_id": "usr_12345"} + identifier_id: "example_identifier_id" responses: "200": - application/json: {"id": "inv_12345", "object": "organization_invitation", "email_address": "user@example.com", "role": "admin", "role_name": "", "organization_id": "org_12345", "status": "pending", "public_metadata": {"key": "value"}, "private_metadata": {"private_key": "secret_value"}, "created_at": 1622547600, "updated_at": 1622551200} - "400": + application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} + "402": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - RevokeSession: - speakeasy-default-revoke-session: - parameters: - path: - session_id: "sess_1234567890abcdef" + ListBlocklistIdentifiers: + speakeasy-default-list-blocklist-identifiers: responses: "200": - application/json: {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": false, "browser_name": "", "browser_version": "", "ip_address": "31.46.247.141", "city": "Sioux Falls", "country": "Austria"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000} - "400": + application/json: {"data": [{"object": "blocklist_identifier", "id": "identifier_id", "identifier": "blocked@example.com", "identifier_type": "email_address", "instance_id": "instance_id_here", "created_at": 1609459200, "updated_at": 1612137600}, {"object": "blocklist_identifier", "id": "identifier_id", "identifier": "blocked@example.com", "identifier_type": "email_address", "instance_id": "instance_id_here", "created_at": 1609459200, "updated_at": 1612137600}, {"object": "blocklist_identifier", "id": "identifier_id", "identifier": "blocked@example.com", "identifier_type": "email_address", "instance_id": "instance_id_here", "created_at": 1609459200, "updated_at": 1612137600}], "total_count": 100} + "401": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - RevokeSignInToken: - speakeasy-default-revoke-sign-in-token: - parameters: - path: - sign_in_token_id: "tok_test_1234567890" + UpdateInstanceAuthConfig: + speakeasy-default-update-instance-auth-config: + requestBody: + application/json: {"restricted_to_allowlist": false, "from_email_address": "noreply", "progressive_sign_up": true, "session_token_template": "defaultSessionToken", "enhanced_email_deliverability": true, "test_mode": true} responses: "200": - application/json: {"object": "sign_in_token", "id": "token_12345", "status": "pending", "user_id": "user_12345", "token": "secret_token", "url": "https://example.com/signin/token", "created_at": 1609459200, "updated_at": 1612137600} + application/json: {"object": "instance_settings", "id": "inst_123456789", "restricted_to_allowlist": false, "from_email_address": "noreply@clerk.dev", "progressive_sign_up": true, "enhanced_email_deliverability": true} + "402": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + UpdateProductionInstanceDomain: + speakeasy-default-update-production-instance-domain: + requestBody: + application/json: {"home_url": "https://www.example.com"} + responses: "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - RotateOAuthApplicationSecret: - speakeasy-default-rotate-O-auth-application-secret: - parameters: - path: - oauth_application_id: "oauth_application_12345" + ChangeProductionInstanceDomain: + speakeasy-default-change-production-instance-domain: + requestBody: + application/json: {"home_url": "https://www.newdomain.com", "is_secondary": false} responses: - "200": - application/json: {"object": "oauth_application", "id": "oauth_app_1234", "instance_id": "instance_5678", "name": "Example OAuth App", "client_id": "client_12345", "public": false, "scopes": "profile email", "callback_url": "https://example.com/oauth/callback", "authorize_url": "https://example.com/authorize", "token_fetch_url": "https://example.com/oauth/token", "user_info_url": "https://example.com/userinfo", "created_at": 1609459200, "updated_at": 1612137600, "client_secret": "secretXYZ123"} - "403": + "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - SetUserProfileImage: - speakeasy-default-set-user-profile-image: - parameters: - path: - user_id: "usr_test123" + CreateActorToken: + speakeasy-default-create-actor-token: requestBody: - multipart/form-data: {"file": {"": ""}} + application/json: {"user_id": "user_1a2b3c", "actor": {}, "expires_in_seconds": 3600, "session_max_duration_in_seconds": 1800} responses: "200": - application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value", "message": "", "attempts": null, "expire_at": null}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "ticket", "attempts": null, "expire_at": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": false, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 739191, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} + application/json: {"object": "actor_token", "id": "actor_tok_1a2b3c", "status": "pending", "user_id": "user_1a2b3c", "actor": {}, "token": "token_string", "url": "https://example.com/token", "created_at": 1609459200, "updated_at": 1612137600} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - ToggleTemplateDelivery: - speakeasy-default-toggle-template-delivery: + RevokeActorToken: + speakeasy-default-revoke-actor-token: parameters: path: - slug: "welcome-email" - template_type: "email" - requestBody: - application/json: {"delivered_by_clerk": true} + actor_token_id: "act_tok_abcdefghijk" responses: "200": - application/json: {"id": "temp_12345", "object": "template", "instance_id": "inst_67890", "resource_type": "system", "template_type": "email", "name": "Welcome Email", "slug": "welcome_email", "position": 1, "can_revert": false, "can_delete": true, "can_toggle": false, "subject": "Welcome to our service!", "markup": "

Hello, {{ user.name }}

", "body": "You are now signed up. Welcome!", "available_variables": ["user.name", "user.email"], "required_variables": ["user.name"], "from_email_name": "Clerk Support", "reply_to_email_name": "support@clerk.com", "delivered_by_clerk": true, "enabled": false, "updated_at": 1610000000, "created_at": 1600000000} + application/json: {"object": "actor_token", "id": "actor_tok_1a2b3c", "status": "pending", "user_id": "user_1a2b3c", "actor": {}, "token": "token_string", "url": "https://example.com/token", "created_at": 1609459200, "updated_at": 1612137600} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - UnbanUser: - speakeasy-default-unban-user: - parameters: - path: - user_id: "user_12345" + ListDomains: + speakeasy-default-list-domains: responses: "200": - application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value", "message": "", "attempts": null, "expire_at": null}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml", "external_verification_redirect_url": "https://example.com/saml_callback", "error": null, "expire_at": 1622852400, "attempts": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": false, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 300086, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} - "402": + application/json: {"data": [{"object": "domain", "id": "domain_id", "name": "example.com", "is_satellite": false, "frontend_api_url": "https://frontend.example.com", "accounts_portal_url": null, "proxy_url": null, "development_origin": "http://localhost:3000", "cname_targets": [{"host": "cname.example.com", "value": "value.example.com", "required": true}]}, {"object": "domain", "id": "domain_id", "name": "example.com", "is_satellite": false, "frontend_api_url": "https://frontend.example.com", "accounts_portal_url": null, "proxy_url": null, "development_origin": "http://localhost:3000", "cname_targets": [{"host": "cname.example.com", "value": "value.example.com", "required": true}]}, {"object": "domain", "id": "domain_id", "name": "example.com", "is_satellite": false, "frontend_api_url": "https://frontend.example.com", "accounts_portal_url": null, "proxy_url": null, "development_origin": "http://localhost:3000", "cname_targets": [{"host": "cname.example.com", "value": "value.example.com", "required": true}]}], "total_count": 1} + AddDomain: + speakeasy-default-add-domain: + requestBody: + application/json: {"name": "example.com", "is_satellite": true, "proxy_url": "https://proxy.example.com"} + responses: + "200": + application/json: {"object": "domain", "id": "domain_id", "name": "example.com", "is_satellite": false, "frontend_api_url": "https://frontend.example.com", "accounts_portal_url": null, "proxy_url": null, "development_origin": "http://localhost:3000", "cname_targets": [{"host": "cname.example.com", "value": "value.example.com", "required": true}]} + "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - UnlockUser: - speakeasy-default-unlock-user: + DeleteDomain: + speakeasy-default-delete-domain: parameters: path: - user_id: "user_12345" + domain_id: "domain_12345" responses: "200": - application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value", "message": "", "attempts": null, "expire_at": null}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml", "external_verification_redirect_url": "https://example.com/saml_callback", "error": null, "expire_at": 1622852400, "attempts": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": false, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 740570, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} + application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} "403": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} UpdateDomain: @@ -1513,18 +1513,11 @@ examples: application/json: {"object": "domain", "id": "domain_id", "name": "example.com", "is_satellite": false, "frontend_api_url": "https://frontend.example.com", "accounts_portal_url": null, "proxy_url": null, "development_origin": "http://localhost:3000", "cname_targets": [{"host": "cname.example.com", "value": "value.example.com", "required": true}]} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - UpdateEmailAddress: - speakeasy-default-update-email-address: - parameters: - path: - email_address_id: "email_address_id_example" - requestBody: - application/json: {"verified": false, "primary": true} + GetInstance: + speakeasy-default-get-instance: responses: "200": - application/json: {"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001} - "400": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + application/json: {"object": "instance", "id": "", "environment_type": "development", "allowed_origins": ["http://localhost:3000", "https://some-domain"]} UpdateInstance: speakeasy-default-update-instance: requestBody: @@ -1532,13 +1525,13 @@ examples: responses: "422": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - UpdateInstanceAuthConfig: - speakeasy-default-update-instance-auth-config: + UpdateInstanceRestrictions: + speakeasy-default-update-instance-restrictions: requestBody: - application/json: {"restricted_to_allowlist": false, "from_email_address": "noreply", "progressive_sign_up": true, "session_token_template": "defaultSessionToken", "enhanced_email_deliverability": true, "test_mode": true} + application/json: {"allowlist": false, "blocklist": true, "block_email_subaddresses": true, "block_disposable_email_domains": true, "ignore_dots_for_gmail_addresses": false} responses: "200": - application/json: {"object": "instance_settings", "id": "inst_123456789", "restricted_to_allowlist": false, "from_email_address": "noreply@clerk.dev", "progressive_sign_up": true, "enhanced_email_deliverability": true} + application/json: {"object": "instance_restrictions", "allowlist": false, "blocklist": true, "block_email_subaddresses": true, "ignore_dots_for_gmail_addresses": false} "402": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} UpdateInstanceOrganizationSettings: @@ -1548,16 +1541,50 @@ examples: responses: "200": application/json: {"object": "organization_settings", "enabled": true, "max_allowed_memberships": 5, "max_allowed_roles": 3, "max_allowed_permissions": 15, "creator_role": "admin", "admin_delete_enabled": true, "domains_enabled": true, "domains_enrollment_modes": ["automatic_invitation", "automatic_suggestion"], "domains_default_role": "member"} - "402": + "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - UpdateInstanceRestrictions: - speakeasy-default-update-instance-restrictions: + CreateSvixApp: + speakeasy-default-create-svix-app: + responses: + "200": + application/json: {"svix_url": "https://app.svix.com/your-instance-url"} + "400": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + DeleteSvixApp: + speakeasy-default-delete-svix-app: + responses: + "400": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + GenerateSvixAuthURL: + speakeasy-default-generate-svix-auth-URL: + responses: + "200": + application/json: {"svix_url": "https://app.svix.com/your-instance-url"} + "400": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + ListJWTTemplates: + speakeasy-default-list-JWT-templates: + responses: + "200": + application/json: [{"object": "jwt_template", "id": "jt_1234567890abcdef", "name": "My First JWT Template", "claims": {}, "lifetime": 3600, "allowed_clock_skew": 5, "custom_signing_key": false, "signing_algorithm": "RS256", "created_at": 1609459200, "updated_at": 1612137600}, {"object": "jwt_template", "id": "jt_1234567890abcdef", "name": "My First JWT Template", "claims": {}, "lifetime": 3600, "allowed_clock_skew": 5, "custom_signing_key": false, "signing_algorithm": "RS256", "created_at": 1609459200, "updated_at": 1612137600}, {"object": "jwt_template", "id": "jt_1234567890abcdef", "name": "My First JWT Template", "claims": {}, "lifetime": 3600, "allowed_clock_skew": 5, "custom_signing_key": false, "signing_algorithm": "RS256", "created_at": 1609459200, "updated_at": 1612137600}] + CreateJWTTemplate: + speakeasy-default-create-JWT-template: requestBody: - application/json: {"allowlist": false, "blocklist": true, "block_email_subaddresses": true, "block_disposable_email_domains": true, "ignore_dots_for_gmail_addresses": false} + application/json: {"name": "Example Template", "claims": {}, "lifetime": 3600, "allowed_clock_skew": 5, "custom_signing_key": false, "signing_algorithm": "RS256", "signing_key": "PRIVATE_KEY_PLACEHOLDER"} responses: "200": - application/json: {"object": "instance_restrictions", "allowlist": false, "blocklist": true, "block_email_subaddresses": true, "ignore_dots_for_gmail_addresses": false} - "402": + application/json: {"object": "jwt_template", "id": "jt_1234567890abcdef", "name": "My First JWT Template", "claims": {}, "lifetime": 3600, "allowed_clock_skew": 5, "custom_signing_key": false, "signing_algorithm": "RS256", "created_at": 1609459200, "updated_at": 1612137600} + "400": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + GetJWTTemplate: + speakeasy-default-get-JWT-template: + parameters: + path: + template_id: "template_123" + responses: + "200": + application/json: {"object": "jwt_template", "id": "jt_1234567890abcdef", "name": "My First JWT Template", "claims": {}, "lifetime": 3600, "allowed_clock_skew": 5, "custom_signing_key": false, "signing_algorithm": "RS256", "created_at": 1609459200, "updated_at": 1612137600} + "404": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} UpdateJWTTemplate: speakeasy-default-update-JWT-template: @@ -1565,22 +1592,55 @@ examples: path: template_id: "" requestBody: - application/json: {"name": "", "lifetime": "8574.77", "allowed_clock_skew": "5971.29", "custom_signing_key": true, "signing_algorithm": "", "signing_key": ""} + application/json: {"name": "", "lifetime": 8574.78, "allowed_clock_skew": 5971.29, "custom_signing_key": true, "signing_algorithm": "", "signing_key": ""} responses: "200": application/json: {"object": "jwt_template", "id": "jt_1234567890abcdef", "name": "My First JWT Template", "claims": {}, "lifetime": 3600, "allowed_clock_skew": 5, "custom_signing_key": false, "signing_algorithm": "RS256", "created_at": 1609459200, "updated_at": 1612137600} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - UpdateOAuthApplication: - speakeasy-default-update-O-auth-application: + DeleteJWTTemplate: + speakeasy-default-delete-JWT-template: parameters: path: - oauth_application_id: "oauth_app_67890" + template_id: "" + responses: + "200": + application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} + "403": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + ListOrganizations: + speakeasy-default-list-organizations: + parameters: + query: + limit: 20 + offset: 10 + include_members_count: false + query: "clerk" + order_by: "-name" + responses: + "200": + application/json: {"data": [{"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}], "total_count": 1} + "400": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + CreateOrganization: + speakeasy-default-create-organization: requestBody: - application/json: {"name": "Updated OAuth App Name", "callback_url": "https://example.com/oauth/callback", "scopes": "profile email public_metadata private_metadata"} + application/json: {"name": "NewOrg", "created_by": "user_123", "private_metadata": {"internal_code": "ABC123"}, "public_metadata": {"public_event": "Annual Summit"}, "slug": "neworg", "max_allowed_memberships": 100, "created_at": "1721474962525"} + responses: + "200": + application/json: {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800} + "400": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + GetOrganization: + speakeasy-default-get-organization: + parameters: + path: + organization_id: "org_123" + query: + include_members_count: false responses: "200": - application/json: {"object": "oauth_application", "id": "oauth_app_1234", "instance_id": "instance_5678", "name": "Example OAuth App", "client_id": "client_12345", "public": false, "scopes": "profile email", "callback_url": "https://example.com/oauth/callback", "authorize_url": "https://example.com/authorize", "token_fetch_url": "https://example.com/oauth/token", "user_info_url": "https://example.com/userinfo", "created_at": 1609459200, "updated_at": 1612137600} + application/json: {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800} "403": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} UpdateOrganization: @@ -1589,150 +1649,182 @@ examples: path: organization_id: "org_123_update" requestBody: - application/json: {"public_metadata": {}, "private_metadata": {}, "name": "New Organization Name", "slug": "new-org-slug", "max_allowed_memberships": 100, "admin_delete_enabled": true, "created_at": ""} + application/json: {"name": "New Organization Name", "slug": "new-org-slug", "max_allowed_memberships": 100, "admin_delete_enabled": true, "created_at": "1733171278360", "key": "", "key1": ""} responses: "200": application/json: {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800} "402": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - UpdateOrganizationMembership: - speakeasy-default-update-organization-membership: + DeleteOrganization: + speakeasy-default-delete-organization: + parameters: + path: + organization_id: "org_321_delete" + responses: + "200": + application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} + "404": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + MergeOrganizationMetadata: + speakeasy-default-merge-organization-metadata: parameters: path: organization_id: "org_12345" - user_id: "user_67890" requestBody: - application/json: {"role": "admin"} + application/json: {"public_metadata": {"announcement": "We are opening a new office!"}, "private_metadata": {"internal_use_only": "Future plans discussion."}, "key": "", "key1": "", "key2": ""} responses: "200": - application/json: {"id": "org_mem_123", "object": "organization_membership", "role": "member", "role_name": "", "permissions": ["read"], "public_metadata": {}, "private_metadata": {}, "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800} + application/json: {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - UpdateOrganizationMembershipMetadata: - speakeasy-default-update-organization-membership-metadata: + UploadOrganizationLogo: + speakeasy-default-upload-organization-logo: parameters: path: - organization_id: "org_123456" - user_id: "user_654321" + organization_id: "org_12345" requestBody: - application/json: {"public_metadata": {}, "private_metadata": {}} + multipart/form-data: {"uploader_user_id": "user_67890", "file": {"": ""}} responses: "200": - application/json: {"id": "org_mem_123", "object": "organization_membership", "role": "member", "role_name": "", "permissions": ["read"], "public_metadata": {}, "private_metadata": {}, "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800} + application/json: {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800, "image_url": "https://example.com/image_url.png", "has_image": true} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - UpdatePhoneNumber: - speakeasy-default-update-phone-number: + DeleteOrganizationLogo: + speakeasy-default-delete-organization-logo: parameters: path: - phone_number_id: "phone_12345" - requestBody: - application/json: {"verified": false, "primary": true, "reserved_for_second_factor": true} + organization_id: "org_12345" responses: "200": - application/json: {"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1594842023, "updated_at": 1604842023} - "400": + application/json: {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800} + "404": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - UpdateProductionInstanceDomain: - speakeasy-default-update-production-instance-domain: + CreateOrganizationMembership: + speakeasy-default-create-organization-membership: + parameters: + path: + organization_id: "org_123" requestBody: - application/json: {"home_url": "https://www.example.com"} + application/json: {"user_id": "user_456", "role": "admin"} responses: + "200": + application/json: {"id": "org_mem_123", "object": "organization_membership", "role": "member", "role_name": "", "permissions": ["read"], "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - UpdateSAMLConnection: - speakeasy-default-update-SAML-connection: + ListOrganizationMemberships: + speakeasy-default-list-organization-memberships: parameters: path: - saml_connection_id: "saml_conn_123_update" - requestBody: - application/json: {"name": "Example SAML Connection", "domain": "example.com", "idp_entity_id": "entity_123", "idp_sso_url": "https://idp.example.com/sso", "idp_certificate": "MIIDBTCCAe2gAwIBAgIQ...", "idp_metadata_url": "https://idp.example.com/metadata", "idp_metadata": "...", "attribute_mapping": {"user_id": "id123", "email_address": "user@example.com", "first_name": "Jane", "last_name": "Doe"}, "active": true, "sync_user_attributes": false, "allow_subdomains": true, "allow_idp_initiated": false, "disable_additional_identifications": false} + organization_id: "org_789" + query: + limit: 20 + offset: 10 + order_by: "+created_at" responses: "200": - application/json: {"object": "saml_connection", "id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "idp_entity_id": "idp-entity-id", "idp_sso_url": "https://sso.mycompany.com", "idp_certificate": "MIIDdzCCAl+gAwIBAgIJAKcyBaiiz+DT...", "idp_metadata_url": "https://sso.mycompany.com/metadata", "idp_metadata": "", "permissions": ["read"], "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800}, {"id": "org_mem_123", "object": "organization_membership", "role": "member", "role_name": "", "permissions": ["read"], "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800}, {"id": "org_mem_123", "object": "organization_membership", "role": "member", "role_name": "", "permissions": ["read"], "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800}], "total_count": 1} + "401": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - UpdateSignUp: - speakeasy-default-update-sign-up: + UpdateOrganizationMembership: + speakeasy-default-update-organization-membership: parameters: path: - id: "signup_1234567890abcdef" + organization_id: "org_12345" + user_id: "user_67890" requestBody: - application/json: {"external_id": "ext_id_7890abcdef123456"} + application/json: {"role": "admin"} responses: "200": - application/json: {"object": "sign_up_attempt", "id": "signup_1234567890abcdef", "status": "complete", "required_fields": ["email_address"], "optional_fields": ["first_name", "last_name"], "missing_fields": ["phone_number"], "unverified_fields": ["email_address"], "username": "user_123456", "email_address": "user@example.com", "phone_number": "+1234567890", "web3_wallet": "0x1234567890abcdef1234567890abcdef12345678", "password_enabled": true, "first_name": "John", "last_name": "Doe", "unsafe_metadata": {"key": "", "key1": "", "key2": ""}, "public_metadata": {"key": "", "key1": ""}, "custom_action": false, "external_id": "ext_id_7890abcdef123456", "created_session_id": "sess_1234567890abcdef", "created_user_id": "user_1234567890abcdef", "abandon_at": 1609459200} - "403": + application/json: {"id": "org_mem_123", "object": "organization_membership", "role": "member", "role_name": "", "permissions": ["read"], "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800} + "404": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - UpdateUser: - speakeasy-default-update-user: + DeleteOrganizationMembership: + speakeasy-default-delete-organization-membership: parameters: path: - user_id: "usr_1" + organization_id: "org_12345" + user_id: "user_67890" + responses: + "200": + application/json: {"id": "org_mem_123", "object": "organization_membership", "role": "member", "role_name": "", "permissions": ["read"], "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800} + "401": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + UpdateOrganizationMembershipMetadata: + speakeasy-default-update-organization-membership-metadata: + parameters: + path: + organization_id: "org_123456" + user_id: "user_654321" requestBody: - application/json: {"external_id": "ext_123", "first_name": "Jane", "last_name": "Doe", "primary_email_address_id": "eml_12345", "notify_primary_email_address_changed": true, "primary_phone_number_id": "phn_67890", "primary_web3_wallet_id": "wlt_123", "username": "janedoe", "profile_image_id": "img_789", "password": "secretPass123!", "password_digest": "$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc", "password_hasher": "argon2i", "skip_password_checks": false, "sign_out_of_other_sessions": true, "totp_secret": "ABCD1234EFGH5678", "backup_codes": ["123456", "654321"], "public_metadata": {"theme": "dark"}, "private_metadata": {"vip": true}, "unsafe_metadata": {"age": 30}, "delete_self_enabled": true, "create_organization_enabled": false, "legal_accepted_at": "", "skip_legal_checks": false, "create_organizations_limit": 597129, "created_at": "2021-04-05T14:30:00.000Z"} + application/json: {} responses: "200": - application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value", "message": "", "attempts": null, "expire_at": null}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "ticket", "attempts": null, "expire_at": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": false, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 627690, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} + application/json: {"id": "org_mem_123", "object": "organization_membership", "role": "member", "role_name": "", "permissions": ["read"], "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - UpdateUserMetadata: - speakeasy-default-update-user-metadata: + InstanceGetOrganizationMemberships: + speakeasy-default-instance-get-organization-memberships: + parameters: + query: + limit: 20 + offset: 10 + order_by: "" + responses: + "200": + application/json: {"data": [{"id": "org_mem_123", "object": "organization_membership", "role": "member", "role_name": "", "permissions": ["read"], "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800}], "total_count": 1} + "400": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + "500": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + CreateOrganizationDomain: + speakeasy-default-create-organization-domain: parameters: path: - user_id: "user_123456789" + organization_id: "" requestBody: - application/json: {"public_metadata": {"key": "", "key1": ""}, "private_metadata": {"key": "", "key1": ""}, "unsafe_metadata": {"key": "", "key1": ""}} + application/json: {"name": "", "enrollment_mode": "", "verified": true} responses: "200": - application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value", "message": "", "attempts": null, "expire_at": null}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce", "attempts": null, "expire_at": null}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "ticket", "attempts": null, "expire_at": null}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": false, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "create_organizations_limit": 234613, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} + application/json: {"id": "", "object": "organization_domain", "organization_id": "", "name": "", "enrollment_mode": "automatic_invitation", "affiliation_email_address": "", "verification": {"status": "unverified", "strategy": "", "attempts": 134365, "expire_at": 69025}, "total_pending_invitations": 796474, "total_pending_suggestions": 951062, "created_at": 86, "updated_at": 169727} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - UploadOrganizationLogo: - speakeasy-default-upload-organization-logo: + ListOrganizationDomains: + speakeasy-default-list-organization-domains: parameters: path: - organization_id: "org_12345" - requestBody: - multipart/form-data: {"uploader_user_id": "user_67890", "file": {"": ""}} + organization_id: "" + query: + limit: 20 + offset: 10 + verified: "" + enrollment_mode: "" responses: "200": - application/json: {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800, "image_url": "https://example.com/image_url.png", "has_image": true} - "400": + application/json: {"data": [{"id": "", "object": "organization_domain", "organization_id": "", "name": "", "enrollment_mode": "automatic_invitation", "affiliation_email_address": "", "verification": {"status": "verified", "strategy": "", "attempts": 177706, "expire_at": 229716}, "total_pending_invitations": 152837, "total_pending_suggestions": 635532, "created_at": 639387, "updated_at": 17577}, {"id": "", "object": "organization_domain", "organization_id": "", "name": "", "enrollment_mode": "automatic_suggestion", "affiliation_email_address": "", "verification": {"status": "unverified", "strategy": "", "attempts": 68504, "expire_at": 687960}, "total_pending_invitations": 509883, "total_pending_suggestions": 633911, "created_at": 7468, "updated_at": 54607}, {"id": "", "object": "organization_domain", "organization_id": "", "name": "", "enrollment_mode": "automatic_invitation", "affiliation_email_address": "", "verification": {"status": "unverified", "strategy": "", "attempts": 73227, "expire_at": 931165}, "total_pending_invitations": 567445, "total_pending_suggestions": 876407, "created_at": 490078, "updated_at": 51681}], "total_count": 322596} + "401": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - UpsertTemplate: - speakeasy-default-upsert-template: + DeleteOrganizationDomain: + speakeasy-default-delete-organization-domain: parameters: path: - slug: "verification-code" - template_type: "sms" - requestBody: - application/json: {"name": "Verification Code", "subject": "Your Verification Code", "markup": "

Your code: {{code}}

", "body": "Use this code to verify your email: {{code}}", "delivered_by_clerk": true, "from_email_name": "hello", "reply_to_email_name": "support"} + organization_id: "" + domain_id: "" responses: "200": - application/json: {"id": "temp_12345", "object": "template", "instance_id": "inst_67890", "resource_type": "system", "template_type": "email", "name": "Welcome Email", "slug": "welcome_email", "position": 1, "can_revert": false, "can_delete": true, "can_toggle": false, "subject": "Welcome to our service!", "markup": "

Hello, {{ user.name }}

", "body": "You are now signed up. Welcome!", "available_variables": ["user.name", "user.email"], "required_variables": ["user.name"], "from_email_name": "Clerk Support", "reply_to_email_name": "support@clerk.com", "delivered_by_clerk": true, "enabled": true, "updated_at": 1610000000, "created_at": 1600000000} + application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - UsersGetOrganizationMemberships: - speakeasy-default-users-get-organization-memberships: + UpdateOrganizationDomain: + speakeasy-default-update-organization-domain: parameters: path: - user_id: "usr_1234567890" - query: - limit: 20 - offset: 10 - responses: - "200": - application/json: {"data": [{"id": "org_mem_123", "object": "organization_membership", "role": "member", "role_name": "", "permissions": ["read"], "public_metadata": {}, "private_metadata": {}, "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800}], "total_count": 1} - "403": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - VerifyClient: - speakeasy-default-verify-client: + organization_id: "" + domain_id: "" requestBody: - application/json: {"token": "jwt_token_example"} + application/json: {"enrollment_mode": "", "verified": false} responses: "200": - application/json: {"object": "client", "id": "client_123456789abcd", "session_ids": ["sess_123456789abcd", "sess_23456789abcd"], "sessions": [{"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": false, "browser_name": "", "browser_version": "", "ip_address": "47.58.193.100", "city": "North Eduardo", "country": "Papua New Guinea"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}, {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": true, "browser_name": "", "browser_version": "", "ip_address": "1db7:6920:fddf:0e44:79fb:ef8f:ccb2:fade", "city": "West Chaseburgh", "country": "Djibouti"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}, {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": true, "browser_name": "", "browser_version": "", "ip_address": "0.185.60.12", "city": "Connside", "country": "Mozambique"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}], "sign_in_id": "signin_123456789abcd", "sign_up_id": "signup_123456789abcd", "last_active_session_id": "session_123456789abcd", "updated_at": 1632580323, "created_at": 1622481123} + application/json: {"id": "", "object": "organization_domain", "organization_id": "", "name": "", "enrollment_mode": "automatic_invitation", "affiliation_email_address": "", "verification": {"status": "unverified", "strategy": "", "attempts": 991464, "expire_at": 627690}, "total_pending_invitations": 488852, "total_pending_suggestions": 984008, "created_at": 54062, "updated_at": 896501} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} VerifyDomainProxy: @@ -1744,194 +1836,211 @@ examples: application/json: {"object": "proxy_check", "id": "chk_3498fd", "domain_id": "domain_32hfu3e", "last_run_at": 1622547600, "proxy_url": "https://example.com/__clerk", "successful": true, "created_at": 1622547000, "updated_at": 1622547700} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - VerifyPassword: - speakeasy-default-verify-password: - parameters: - path: - user_id: "user_123" + ListRedirectURLs: + speakeasy-default-list-redirect-UR-ls: + responses: + "200": + application/json: [{"object": "redirect_url", "id": "red_12345", "url": "https://my-app.com/oauth-callback", "created_at": 1610000000, "updated_at": 1620000000}, {"object": "redirect_url", "id": "red_12345", "url": "https://my-app.com/oauth-callback", "created_at": 1610000000, "updated_at": 1620000000}, {"object": "redirect_url", "id": "red_12345", "url": "https://my-app.com/oauth-callback", "created_at": 1610000000, "updated_at": 1620000000}] + CreateRedirectURL: + speakeasy-default-create-redirect-URL: requestBody: - application/json: {"password": "securepassword123"} + application/json: {"url": "https://my-app.com/oauth-callback"} responses: "200": - application/json: {"verified": true} - "500": + application/json: {"object": "redirect_url", "id": "red_12345", "url": "https://my-app.com/oauth-callback", "created_at": 1610000000, "updated_at": 1620000000} + "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - VerifySession: - speakeasy-default-verify-session: + GetRedirectURL: + speakeasy-default-get-redirect-URL: parameters: path: - session_id: "sess_w8q4g9s60j28fghv00f3" - requestBody: - application/json: {"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZXNzaW9uX2lkIjoic2Vzc193OHF4ZzZzNm9qMjhmZ2h2MDBmMyIsImlhdCI6MTU4MjY0OTg2Mn0.J4KP2L6bEZ6YccHFW4E2vKbOLw_mmO0gF_GNRw-wtLM"} + id: "redir_01FG4K9G5NWSQ4ZPT4TQE4Z7G3" responses: "200": - application/json: {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "latest_activity": {"object": "", "id": "", "device_type": "", "is_mobile": false, "browser_name": "", "browser_version": "", "ip_address": "47.58.193.100", "city": "North Eduardo", "country": "Papua New Guinea"}, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000} - "400": + application/json: {"object": "redirect_url", "id": "red_12345", "url": "https://my-app.com/oauth-callback", "created_at": 1610000000, "updated_at": 1620000000} + "404": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - VerifyTOTP: - speakeasy-default-verify-TOTP: + DeleteRedirectURL: + speakeasy-default-delete-redirect-URL: parameters: path: - user_id: "usr_1a2b3c" + id: "redir_01FG4K9G5NWSQ4ZPT4TQE4Z7G3" + responses: + "200": + application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} + "404": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + CreateSignInToken: + speakeasy-default-create-sign-in-token: requestBody: - application/json: {"code": "123456"} + application/json: {"user_id": "user_12345", "expires_in_seconds": 2592000} responses: "200": - application/json: {"verified": true, "code_type": "totp"} - "500": + application/json: {"object": "sign_in_token", "id": "token_12345", "status": "pending", "user_id": "user_12345", "token": "secret_token", "url": "https://example.com/signin/token", "created_at": 1609459200, "updated_at": 1612137600} + "404": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - UsersGetOrganizationInvitations: - speakeasy-default-users-get-organization-invitations: + RevokeSignInToken: + speakeasy-default-revoke-sign-in-token: parameters: path: - user_id: "" - query: - limit: 20 - offset: 10 - status: "pending" + sign_in_token_id: "tok_test_1234567890" responses: "200": - application/json: {"data": [{"id": "", "object": "organization_invitation", "email_address": "Regan_Erdman@gmail.com", "role": "", "role_name": "", "organization_id": "", "status": "", "public_metadata": {"key": ""}, "private_metadata": {"key": ""}, "public_organization_data": {"id": "", "name": "", "slug": "", "image_url": "https://colossal-self-confidence.name", "has_image": false}, "created_at": 985977, "updated_at": 199359}], "total_count": 865330} + application/json: {"object": "sign_in_token", "id": "token_12345", "status": "pending", "user_id": "user_12345", "token": "secret_token", "url": "https://example.com/signin/token", "created_at": 1609459200, "updated_at": 1612137600} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - DeleteBackupCode: - speakeasy-default-delete-backup-code: + UpdateSignUp: + speakeasy-default-update-sign-up: parameters: path: - user_id: "" + id: "signup_1234567890abcdef" + requestBody: + application/json: {"external_id": "ext_id_7890abcdef123456"} responses: "200": - application/json: {"user_id": ""} - "404": + application/json: {"object": "sign_up_attempt", "id": "signup_1234567890abcdef", "status": "complete", "required_fields": ["email_address"], "optional_fields": ["first_name", "last_name"], "missing_fields": ["phone_number"], "unverified_fields": ["email_address"], "username": "user_123456", "email_address": "user@example.com", "phone_number": "+1234567890", "web3_wallet": "0x1234567890abcdef1234567890abcdef12345678", "password_enabled": true, "first_name": "John", "last_name": "Doe", "unsafe_metadata": {"key": "", "key1": "", "key2": ""}, "public_metadata": {"key": "", "key1": ""}, "custom_action": false, "external_id": "ext_id_7890abcdef123456", "created_session_id": "sess_1234567890abcdef", "created_user_id": "user_1234567890abcdef", "abandon_at": 1609459200, "legal_accepted_at": 1700690400000} + "403": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - UserPasskeyDelete: - speakeasy-default-user-passkey-delete: + ListOAuthApplications: + speakeasy-default-list-O-auth-applications: parameters: - path: - user_id: "" - passkey_identification_id: "" + query: + limit: 20 + offset: 10 responses: "200": - application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} - "403": + application/json: {"data": [{"object": "oauth_application", "id": "oauth_app_1234", "instance_id": "instance_5678", "name": "Example OAuth App", "client_id": "client_12345", "public": false, "scopes": "profile email", "callback_url": "https://example.com/oauth/callback", "authorize_url": "https://example.com/authorize", "token_fetch_url": "https://example.com/oauth/token", "user_info_url": "https://example.com/userinfo", "discovery_url": "https://neglected-plastic.biz", "token_introspection_url": "https://crooked-overload.name/", "created_at": 1609459200, "updated_at": 1612137600}], "total_count": 1} + "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - UserWeb3WalletDelete: - speakeasy-default-user-web3-wallet-delete: - parameters: - path: - user_id: "" - web3_wallet_identification_id: "" + CreateOAuthApplication: + speakeasy-default-create-O-auth-application: + requestBody: + application/json: {"name": "Example App", "callback_url": "https://example.com/oauth/callback", "scopes": "profile email public_metadata", "public": true} responses: "200": - application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} + application/json: {"object": "oauth_application", "id": "oauth_app_1234", "instance_id": "instance_5678", "name": "Example OAuth App", "client_id": "client_12345", "public": false, "scopes": "profile email", "callback_url": "https://example.com/oauth/callback", "authorize_url": "https://example.com/authorize", "token_fetch_url": "https://example.com/oauth/token", "user_info_url": "https://example.com/userinfo", "discovery_url": "https://probable-heating.com/", "token_introspection_url": "https://standard-utilization.com/", "created_at": 1609459200, "updated_at": 1612137600, "client_secret": "secretXYZ123"} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - CreateUserTOTP: - speakeasy-default-create-user-TOTP: + GetOAuthApplication: + speakeasy-default-get-O-auth-application: parameters: path: - user_id: "" + oauth_application_id: "oauth_app_12345" responses: "200": - application/json: {"object": "", "id": "", "secret": "", "uri": "https://creamy-merit.net", "verified": false, "backup_codes": [""], "key": "", "key1": ""} + application/json: {"object": "oauth_application", "id": "oauth_app_1234", "instance_id": "instance_5678", "name": "Example OAuth App", "client_id": "client_12345", "public": false, "scopes": "profile email", "callback_url": "https://example.com/oauth/callback", "authorize_url": "https://example.com/authorize", "token_fetch_url": "https://example.com/oauth/token", "user_info_url": "https://example.com/userinfo", "discovery_url": "https://normal-making.name", "token_introspection_url": "https://lavish-ice-cream.biz", "created_at": 1609459200, "updated_at": 1612137600} "403": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - DeleteTOTP: - speakeasy-default-delete-TOTP: + UpdateOAuthApplication: + speakeasy-default-update-O-auth-application: parameters: path: - user_id: "" + oauth_application_id: "oauth_app_67890" + requestBody: + application/json: {"name": "Updated OAuth App Name", "callback_url": "https://example.com/oauth/callback", "scopes": "profile email public_metadata private_metadata"} responses: "200": - application/json: {"user_id": ""} - "404": + application/json: {"object": "oauth_application", "id": "oauth_app_1234", "instance_id": "instance_5678", "name": "Example OAuth App", "client_id": "client_12345", "public": false, "scopes": "profile email", "callback_url": "https://example.com/oauth/callback", "authorize_url": "https://example.com/authorize", "token_fetch_url": "https://example.com/oauth/token", "user_info_url": "https://example.com/userinfo", "discovery_url": "https://passionate-flu.org", "token_introspection_url": "https://lumbering-wheel.com", "created_at": 1609459200, "updated_at": 1612137600} + "403": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - DeleteExternalAccount: - speakeasy-default-delete-external-account: + DeleteOAuthApplication: + speakeasy-default-delete-O-auth-application: parameters: path: - user_id: "" - external_account_id: "" + oauth_application_id: "oauth_app_09876" responses: "200": application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} - "400": + "403": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - ListInstanceOrganizationInvitations: - speakeasy-default-list-instance-organization-invitations: + RotateOAuthApplicationSecret: + speakeasy-default-rotate-O-auth-application-secret: parameters: - query: - limit: 20 - offset: 10 - order_by: "-created_at" - status: "accepted" - query: "" + path: + oauth_application_id: "oauth_application_12345" responses: "200": - application/json: {"data": [], "total_count": 598480} - "400": + application/json: {"object": "oauth_application", "id": "oauth_app_1234", "instance_id": "instance_5678", "name": "Example OAuth App", "client_id": "client_12345", "public": false, "scopes": "profile email", "callback_url": "https://example.com/oauth/callback", "authorize_url": "https://example.com/authorize", "token_fetch_url": "https://example.com/oauth/token", "user_info_url": "https://example.com/userinfo", "discovery_url": "https://enchanting-language.org", "token_introspection_url": "https://tempting-popularity.net/", "created_at": 1609459200, "updated_at": 1612137600, "client_secret": "secretXYZ123"} + "403": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - InstanceGetOrganizationMemberships: - speakeasy-default-instance-get-organization-memberships: + ListSAMLConnections: + speakeasy-default-list-SAML-connections: parameters: query: limit: 20 offset: 10 - order_by: "" + organization_id: ["", "", ""] responses: "200": - application/json: {"data": [{"id": "org_mem_123", "object": "organization_membership", "role": "member", "role_name": "", "permissions": ["read"], "public_metadata": {}, "private_metadata": {}, "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800}], "total_count": 1} - "400": + application/json: {"data": [{"object": "saml_connection", "id": "", "name": "", "domain": "remorseful-concentration.biz", "idp_entity_id": "", "idp_sso_url": "https://primary-paintwork.com/", "idp_certificate": "", "idp_metadata_url": "https://breakable-bathrobe.net", "idp_metadata": "", "acs_url": "https://pricey-accountability.com", "sp_entity_id": "", "sp_metadata_url": "https://lovely-bench.org/", "organization_id": "", "attribute_mapping": {"user_id": "", "email_address": "Selina.Bechtelar86@yahoo.com", "first_name": "Stacey", "last_name": "Volkman"}, "active": true, "provider": "", "user_count": 75058, "sync_user_attributes": false, "allow_subdomains": true, "allow_idp_initiated": true, "disable_additional_identifications": true, "created_at": 432930, "updated_at": 480616}, {"object": "saml_connection", "id": "", "name": "", "domain": "careless-lid.org", "idp_entity_id": "", "idp_sso_url": "https://tragic-exhaust.info/", "idp_certificate": "", "idp_metadata_url": "https://delirious-tinderbox.com/", "idp_metadata": "", "acs_url": "https://vivid-tool.com", "sp_entity_id": "", "sp_metadata_url": "https://odd-spork.net", "organization_id": "", "attribute_mapping": {"user_id": "", "email_address": "Armani_Bins77@hotmail.com", "first_name": "Malika", "last_name": "Sauer"}, "active": false, "provider": "", "user_count": 66993, "sync_user_attributes": true, "allow_subdomains": true, "allow_idp_initiated": false, "disable_additional_identifications": false, "created_at": 258945, "updated_at": 324206}], "total_count": 5} + "402": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - CreateOrganizationDomain: - speakeasy-default-create-organization-domain: + CreateSAMLConnection: + speakeasy-default-create-SAML-connection: + requestBody: + application/json: {"name": "My SAML Connection", "domain": "example.org", "provider": "saml_custom", "idp_entity_id": "http://idp.example.org/", "idp_sso_url": "http://idp.example.org/sso", "idp_certificate": "MIIDdzCCAl+gAwIBAgIJAKcyBaiiz+DT...", "idp_metadata_url": "http://idp.example.org/metadata.xml", "idp_metadata": "", "attribute_mapping": {"user_id": "nameid", "email_address": "mail", "first_name": "givenName", "last_name": "surname"}} + responses: + "200": + application/json: {"object": "saml_connection", "id": "", "name": "", "domain": "low-packaging.info", "idp_entity_id": "", "idp_sso_url": "https://black-and-white-secrecy.org/", "idp_certificate": "", "idp_metadata_url": "https://deafening-bonnet.net/", "idp_metadata": "", "acs_url": "https://outrageous-resolve.org", "sp_entity_id": "", "sp_metadata_url": "https://far-off-affect.biz/", "organization_id": "", "attribute_mapping": {"user_id": "", "email_address": "Aniya.Denesik@gmail.com", "first_name": "Eulalia", "last_name": "Mueller"}, "active": false, "provider": "", "user_count": 200664, "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "disable_additional_identifications": false, "created_at": 550483, "updated_at": 906537} + "402": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} + GetSAMLConnection: + speakeasy-default-get-SAML-connection: parameters: path: - organization_id: "" - requestBody: - application/json: {"name": "", "enrollment_mode": "", "verified": true} + saml_connection_id: "saml_conn_123" responses: "200": - application/json: {"id": "", "object": "organization_domain", "organization_id": "", "name": "", "enrollment_mode": "automatic_invitation", "affiliation_email_address": "", "verification": {"status": "unverified", "strategy": "", "attempts": 134365, "expire_at": 69025}, "total_pending_invitations": 796474, "total_pending_suggestions": 951062, "created_at": 86, "updated_at": 169727} - "400": + application/json: {"object": "saml_connection", "id": "", "name": "", "domain": "rural-mathematics.name", "idp_entity_id": "", "idp_sso_url": "https://willing-impostor.info", "idp_certificate": "", "idp_metadata_url": "https://earnest-tuber.info/", "idp_metadata": "", "acs_url": "https://boiling-dash.biz", "sp_entity_id": "", "sp_metadata_url": "https://next-shark.info/", "organization_id": "", "attribute_mapping": {"user_id": "", "email_address": "Leola.Hand17@hotmail.com", "first_name": "Osbaldo", "last_name": "Rippin"}, "active": false, "provider": "", "user_count": 710500, "sync_user_attributes": false, "allow_subdomains": true, "allow_idp_initiated": true, "disable_additional_identifications": false, "created_at": 444836, "updated_at": 424256} + "402": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - ListOrganizationDomains: - speakeasy-default-list-organization-domains: + UpdateSAMLConnection: + speakeasy-default-update-SAML-connection: parameters: path: - organization_id: "" - query: - limit: 20 - offset: 10 - verified: "" - enrollment_mode: "" + saml_connection_id: "saml_conn_123_update" + requestBody: + application/json: {"name": "Example SAML Connection", "domain": "example.com", "idp_entity_id": "entity_123", "idp_sso_url": "https://idp.example.com/sso", "idp_certificate": "MIIDBTCCAe2gAwIBAgIQ...", "idp_metadata_url": "https://idp.example.com/metadata", "idp_metadata": "...", "organization_id": "", "attribute_mapping": {"user_id": "id123", "email_address": "user@example.com", "first_name": "Jane", "last_name": "Doe"}, "active": true, "sync_user_attributes": false, "allow_subdomains": true, "allow_idp_initiated": false, "disable_additional_identifications": false} responses: "200": - application/json: {"data": [{"id": "", "object": "organization_domain", "organization_id": "", "name": "", "enrollment_mode": "automatic_invitation", "affiliation_email_address": "", "verification": {"status": "verified", "strategy": "", "attempts": 177706, "expire_at": 229716}, "total_pending_invitations": 152837, "total_pending_suggestions": 635532, "created_at": 639387, "updated_at": 17577}, {"id": "", "object": "organization_domain", "organization_id": "", "name": "", "enrollment_mode": "automatic_suggestion", "affiliation_email_address": "", "verification": {"status": "unverified", "strategy": "", "attempts": 68504, "expire_at": 687960}, "total_pending_invitations": 509883, "total_pending_suggestions": 633911, "created_at": 7468, "updated_at": 54607}, {"id": "", "object": "organization_domain", "organization_id": "", "name": "", "enrollment_mode": "automatic_invitation", "affiliation_email_address": "", "verification": {"status": "unverified", "strategy": "", "attempts": 73227, "expire_at": 931165}, "total_pending_invitations": 567445, "total_pending_suggestions": 876407, "created_at": 490078, "updated_at": 51681}], "total_count": 322596} - "401": + application/json: {"object": "saml_connection", "id": "", "name": "", "domain": "passionate-flu.org", "idp_entity_id": "", "idp_sso_url": "https://lumbering-wheel.com", "idp_certificate": "", "idp_metadata_url": "https://juvenile-exploration.biz", "idp_metadata": "", "acs_url": "https://square-tackle.biz/", "sp_entity_id": "", "sp_metadata_url": "https://some-popularity.info/", "organization_id": "", "attribute_mapping": {"user_id": "", "email_address": "Nigel_Kessler11@gmail.com", "first_name": "Fermin", "last_name": "Skiles"}, "active": false, "provider": "", "user_count": 711565, "sync_user_attributes": false, "allow_subdomains": true, "allow_idp_initiated": false, "disable_additional_identifications": false, "created_at": 514361, "updated_at": 800094} + "402": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - DeleteOrganizationDomain: - speakeasy-default-delete-organization-domain: + DeleteSAMLConnection: + speakeasy-default-delete-SAML-connection: parameters: path: - organization_id: "" - domain_id: "" + saml_connection_id: "saml_conn_123_delete" responses: "200": application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} - "400": + "402": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} - UpdateOrganizationDomain: - speakeasy-default-update-organization-domain: + CreateTestingToken: + speakeasy-default-create-testing-token: + responses: + "200": + application/json: {"object": "testing_token", "token": "1713877200-c_2J2MvPu9PnXcuhbPZNao0LOXqK9A7YrnBn0HmIWxy", "expires_at": 1713880800} + ListWaitlistEntries: + speakeasy-default-list-waitlist-entries: parameters: - path: - organization_id: "" - domain_id: "" + query: + limit: 20 + offset: 10 + query: "" + status: "completed" + order_by: "-created_at" + responses: + "200": + application/json: {"data": [{"object": "waitlist_entry", "id": "", "email_address": "Zakary_Haag@yahoo.com", "status": "pending", "is_locked": false, "created_at": 155167, "updated_at": 176370, "invitation": {"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "revoked": false, "status": "pending", "url": "https://example.com/invitations/accept?code=abcd1234", "expires_at": 322595, "created_at": 1622549600, "updated_at": 1622553200}}, {"object": "waitlist_entry", "id": "", "email_address": "Annetta88@yahoo.com", "status": "pending", "is_locked": false, "created_at": 314527, "updated_at": 985553, "invitation": {"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "revoked": false, "status": "pending", "url": "https://example.com/invitations/accept?code=abcd1234", "expires_at": 904589, "created_at": 1622549600, "updated_at": 1622553200}}], "total_count": 138830} + CreateWaitlistEntry: + speakeasy-default-create-waitlist-entry: requestBody: - application/json: {"enrollment_mode": "", "verified": false} + application/json: {"email_address": "Demond_Willms@hotmail.com", "notify": true} responses: "200": - application/json: {"id": "", "object": "organization_domain", "organization_id": "", "name": "", "enrollment_mode": "automatic_invitation", "affiliation_email_address": "", "verification": {"status": "unverified", "strategy": "", "attempts": 991464, "expire_at": 627690}, "total_pending_invitations": 488852, "total_pending_suggestions": 984008, "created_at": 54062, "updated_at": 896501} + application/json: {"object": "waitlist_entry", "id": "", "email_address": "Garnett_Armstrong@hotmail.com", "status": "pending", "is_locked": true, "created_at": 343613, "updated_at": 621525, "invitation": {"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "revoked": false, "status": "pending", "url": "https://example.com/invitations/accept?code=abcd1234", "expires_at": 724415, "created_at": 1622549600, "updated_at": 1622553200}} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "meta": {}, "clerk_trace_id": "trace_id"}], "meta": {}} +examplesVersion: 1.0.0 generatedTests: {} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index c456e58..822df62 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -13,7 +13,7 @@ generation: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: false python: - version: 1.6.0 + version: 1.7.0 additionalDependencies: dev: pytest: ^8.3.3 @@ -26,6 +26,7 @@ python: clientServerStatusCodesAsErrors: true defaultErrorName: SDKError description: Python Client SDK for clerk.dev + enableCustomCodeRegions: false enumFormat: enum fixFlags: responseRequiredSep2024: false diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 4b2d328..c5b761a 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.460.6 +speakeasyVersion: 1.472.1 sources: clerk-openapi: sourceNamespace: clerk-openapi - sourceRevisionDigest: sha256:de9b855af22f0de48a4450efc13be4118c382aea703cf9564aa6256d2157da4c - sourceBlobDigest: sha256:7b41f36bbee97872160a060f96cfaec9693350316134a3f6001fd772dd625c66 + sourceRevisionDigest: sha256:7ca7aea4edacc8bcf47894f3bf68b4226235fe3776207931fb92c739c2d7f909 + sourceBlobDigest: sha256:3ae6d4a0bbbd6f172bfa5e453f3f8842523efc3476c92f70887ae139de22a3d0 tags: - latest - - speakeasy-sdk-regen-1735917707 + - speakeasy-sdk-regen-1737665832 - v1 targets: clerk-sdk-python: source: clerk-openapi sourceNamespace: clerk-openapi - sourceRevisionDigest: sha256:de9b855af22f0de48a4450efc13be4118c382aea703cf9564aa6256d2157da4c - sourceBlobDigest: sha256:7b41f36bbee97872160a060f96cfaec9693350316134a3f6001fd772dd625c66 + sourceRevisionDigest: sha256:7ca7aea4edacc8bcf47894f3bf68b4226235fe3776207931fb92c739c2d7f909 + sourceBlobDigest: sha256:3ae6d4a0bbbd6f172bfa5e453f3f8842523efc3476c92f70887ae139de22a3d0 codeSamplesNamespace: clerk-openapi-python-code-samples - codeSamplesRevisionDigest: sha256:47440a8818de1516a26b0572a0e9390b83099629ad1cb522cba6fb90cfbaa8af + codeSamplesRevisionDigest: sha256:cde1813eb807d1bff06d0ab8d76346d45b3c19b65ce3628c1d9a83e2c93da404 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 85f2234..9610491 100644 --- a/README.md +++ b/README.md @@ -245,6 +245,7 @@ If the request is correctly authenticated, the token's payload is made available ### [instance_settings](docs/sdks/instancesettingssdk/README.md) +* [get_instance](docs/sdks/instancesettingssdk/README.md#get_instance) - Fetch the current instance * [update](docs/sdks/instancesettingssdk/README.md#update) - Update instance settings * [update_restrictions](docs/sdks/instancesettingssdk/README.md#update_restrictions) - Update instance restrictions * [update_organization_settings](docs/sdks/instancesettingssdk/README.md#update_organization_settings) - Update instance organization settings @@ -253,11 +254,12 @@ If the request is correctly authenticated, the token's payload is made available * [create](docs/sdks/invitations/README.md#create) - Create an invitation * [list](docs/sdks/invitations/README.md#list) - List all invitations +* [create_bulk_invitations](docs/sdks/invitations/README.md#create_bulk_invitations) - Create multiple invitations * [revoke](docs/sdks/invitations/README.md#revoke) - Revokes an invitation -### [jwks](docs/sdks/jwks/README.md) +### [jwks](docs/sdks/jwkssdk/README.md) -* [get](docs/sdks/jwks/README.md#get) - Retrieve the JSON Web Key Set of the instance +* [get](docs/sdks/jwkssdk/README.md#get) - Retrieve the JSON Web Key Set of the instance ### [jwt_templates](docs/sdks/jwttemplates/README.md) @@ -352,9 +354,11 @@ If the request is correctly authenticated, the token's payload is made available ### [sessions](docs/sdks/sessions/README.md) * [list](docs/sdks/sessions/README.md#list) - List all sessions +* [create_session](docs/sdks/sessions/README.md#create_session) - Create a new active session * [get](docs/sdks/sessions/README.md#get) - Retrieve a session * [revoke](docs/sdks/sessions/README.md#revoke) - Revoke a session * [~~verify~~](docs/sdks/sessions/README.md#verify) - Verify a session :warning: **Deprecated** +* [create_session_token](docs/sdks/sessions/README.md#create_session_token) - Create a session token * [create_token_from_template](docs/sdks/sessions/README.md#create_token_from_template) - Create a session token from a jwt template ### [sign_in_tokens](docs/sdks/signintokens/README.md) @@ -402,6 +406,11 @@ If the request is correctly authenticated, the token's payload is made available * [delete_totp](docs/sdks/users/README.md#delete_totp) - Delete all the user's TOTPs * [delete_external_account](docs/sdks/users/README.md#delete_external_account) - Delete External Account +### [waitlist_entries](docs/sdks/waitlistentriessdk/README.md) + +* [list_waitlist_entries](docs/sdks/waitlistentriessdk/README.md#list_waitlist_entries) - List all waitlist entries +* [create_waitlist_entry](docs/sdks/waitlistentriessdk/README.md#create_waitlist_entry) - Create a waitlist entry + ### [webhooks](docs/sdks/webhooks/README.md) * [create_svix_app](docs/sdks/webhooks/README.md#create_svix_app) - Create a Svix app diff --git a/RELEASES.md b/RELEASES.md index 9754e4f..be42fab 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -228,4 +228,14 @@ Based on: ### Generated - [python v1.6.0] . ### Releases -- [PyPI v1.6.0] https://pypi.org/project/clerk-backend-api/1.6.0 - . \ No newline at end of file +- [PyPI v1.6.0] https://pypi.org/project/clerk-backend-api/1.6.0 - . + +## 2025-01-23 20:56:56 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.472.1 (2.493.34) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.7.0] . +### Releases +- [PyPI v1.7.0] https://pypi.org/project/clerk-backend-api/1.7.0 - . \ No newline at end of file diff --git a/docs/models/createinvitationrequestbody.md b/docs/models/createinvitationrequestbody.md index e167b56..ad61391 100644 --- a/docs/models/createinvitationrequestbody.md +++ b/docs/models/createinvitationrequestbody.md @@ -10,6 +10,7 @@ Required parameters | `email_address` | *str* | :heavy_check_mark: | The email address the invitation will be sent to | user@example.com | | `public_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata that will be attached to the newly created invitation.
The value of this property should be a well-formed JSON object.
Once the user accepts the invitation and signs up, these metadata will end up in the user's public metadata. | {} | | `redirect_url` | *Optional[str]* | :heavy_minus_sign: | Optional URL which specifies where to redirect the user once they click the invitation link.
This is only required if you have implemented a [custom flow](https://clerk.com/docs/authentication/invitations#custom-flow) and you're not using Clerk Hosted Pages or Clerk Components. | https://example.com/welcome | -| `notify` | *OptionalNullable[bool]* | :heavy_minus_sign: | Optional flag which denotes whether an email invitation should be sent to the given email address.
Defaults to true. | true | +| `notify` | *OptionalNullable[bool]* | :heavy_minus_sign: | Optional flag which denotes whether an email invitation should be sent to the given email address.
Defaults to `true`. | true | | `ignore_existing` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether an invitation should be created if there is already an existing invitation for this email address, or it's claimed by another user. | ​false | -| `expires_in_days` | *OptionalNullable[int]* | :heavy_minus_sign: | The number of days the invitation will be valid for. By default, the invitation does not expire. | | \ No newline at end of file +| `expires_in_days` | *OptionalNullable[int]* | :heavy_minus_sign: | The number of days the invitation will be valid for. By default, the invitation expires after 30 days. | | +| `template_slug` | [OptionalNullable[models.TemplateSlug]](../models/templateslug.md) | :heavy_minus_sign: | The slug of the email template to use for the invitation email.
If not provided, the "invitation" template will be used. | | \ No newline at end of file diff --git a/docs/models/createoauthapplicationrequestbody.md b/docs/models/createoauthapplicationrequestbody.md index 6a5791a..1251b24 100644 --- a/docs/models/createoauthapplicationrequestbody.md +++ b/docs/models/createoauthapplicationrequestbody.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | *str* | :heavy_check_mark: | The name of the new OAuth application | Example App | -| `callback_url` | *str* | :heavy_check_mark: | The callback URL of the new OAuth application | https://example.com/oauth/callback | +| `callback_url` | *Optional[str]* | :heavy_minus_sign: | The callback URL of the new OAuth application | https://example.com/oauth/callback | | `scopes` | *Optional[str]* | :heavy_minus_sign: | Define the allowed scopes for the new OAuth applications that dictate the user payload of the OAuth user info endpoint. Available scopes are `profile`, `email`, `public_metadata`, `private_metadata`. Provide the requested scopes as a string, separated by spaces. | profile email public_metadata | | `public` | *Optional[bool]* | :heavy_minus_sign: | If true, this client is public and cannot securely store a client secret.
Only the authorization code flow with proof key for code exchange (PKCE) may be used.
Public clients cannot be updated to be confidential clients, and vice versa. | true | \ No newline at end of file diff --git a/docs/models/createorganizationinvitationbulkrequest.md b/docs/models/createorganizationinvitationbulkrequest.md index 763c6fe..54a9b1f 100644 --- a/docs/models/createorganizationinvitationbulkrequest.md +++ b/docs/models/createorganizationinvitationbulkrequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `organization_id` | *str* | :heavy_check_mark: | The organization ID. | org_12345 | -| `request_body` | List[[models.RequestBody](../models/requestbody.md)] | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | *str* | :heavy_check_mark: | The organization ID. | org_12345 | +| `request_body` | List[[models.CreateOrganizationInvitationBulkRequestBody](../models/createorganizationinvitationbulkrequestbody.md)] | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/createorganizationinvitationbulkrequestbody.md b/docs/models/createorganizationinvitationbulkrequestbody.md new file mode 100644 index 0000000..01acb1f --- /dev/null +++ b/docs/models/createorganizationinvitationbulkrequestbody.md @@ -0,0 +1,13 @@ +# CreateOrganizationInvitationBulkRequestBody + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `email_address` | *str* | :heavy_check_mark: | The email address of the new member that is going to be invited to the organization | newmember@example.com | +| `role` | *str* | :heavy_check_mark: | The role of the new member in the organization. | admin | +| `inviter_user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the user that invites the new member to the organization.
Must be an administrator in the organization. | user_67890 | +| `public_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API.
When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. | {} | +| `private_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API.
When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. | {} | +| `redirect_url` | *Optional[str]* | :heavy_minus_sign: | Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email. | https://example.com/welcome | \ No newline at end of file diff --git a/docs/models/createorganizationinvitationrequest.md b/docs/models/createorganizationinvitationrequest.md index 528a9a1..e5e0eaa 100644 --- a/docs/models/createorganizationinvitationrequest.md +++ b/docs/models/createorganizationinvitationrequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization for which to send the invitation | org_12345 | -| `request_body` | [models.CreateOrganizationInvitationRequestBody](../models/createorganizationinvitationrequestbody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization for which to send the invitation | org_12345 | +| `request_body` | [Optional[models.CreateOrganizationInvitationRequestBody]](../models/createorganizationinvitationrequestbody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/createorganizationinvitationrequestbody.md b/docs/models/createorganizationinvitationrequestbody.md index 631f7fa..9aa4b73 100644 --- a/docs/models/createorganizationinvitationrequestbody.md +++ b/docs/models/createorganizationinvitationrequestbody.md @@ -3,11 +3,12 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `email_address` | *str* | :heavy_check_mark: | The email address of the new member that is going to be invited to the organization | user@example.com | -| `role` | *str* | :heavy_check_mark: | The role of the new member in the organization | admin | -| `inviter_user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the user that invites the new member to the organization.
Must be an administrator in the organization. | user_67890 | -| `public_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. | {
"key": "value"
} | -| `private_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. | {
"private_key": "secret_value"
} | -| `redirect_url` | *Optional[str]* | :heavy_minus_sign: | Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email. | https://example.com/welcome | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `email_address` | *str* | :heavy_check_mark: | The email address of the new member that is going to be invited to the organization | user@example.com | +| `role` | *str* | :heavy_check_mark: | The role of the new member in the organization | admin | +| `inviter_user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the user that invites the new member to the organization.
Must be an administrator in the organization. | user_67890 | +| `public_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API.
When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. | {
"key": "value"
} | +| `private_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API.
When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. | {
"private_key": "secret_value"
} | +| `redirect_url` | *Optional[str]* | :heavy_minus_sign: | Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email. | https://example.com/welcome | +| `expires_in_days` | *OptionalNullable[int]* | :heavy_minus_sign: | The number of days the invitation will be valid for. By default, the invitation has a 30 days expire. | | \ No newline at end of file diff --git a/docs/models/createorganizationrequestbody.md b/docs/models/createorganizationrequestbody.md index 854cf4f..1cb042d 100644 --- a/docs/models/createorganizationrequestbody.md +++ b/docs/models/createorganizationrequestbody.md @@ -6,7 +6,7 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `name` | *str* | :heavy_check_mark: | The name of the new organization.
May not contain URLs or HTML. | NewOrg | -| `created_by` | *str* | :heavy_check_mark: | The ID of the User who will become the administrator for the new organization | user_123 | +| `created_by` | *Optional[str]* | :heavy_minus_sign: | The ID of the User who will become the administrator for the new organization | user_123 | | `private_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata saved on the organization, accessible only from the Backend API | {
"internal_code": "ABC123"
} | | `public_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata saved on the organization, read-only from the Frontend API and fully accessible (read/write) from the Backend API | {
"public_event": "Annual Summit"
} | | `slug` | *Optional[str]* | :heavy_minus_sign: | A slug for the new organization.
Can contain only lowercase alphanumeric characters and the dash "-".
Must be unique for the instance. | neworg | diff --git a/docs/models/createsamlconnectionrequestbody.md b/docs/models/createsamlconnectionrequestbody.md index e753f5f..12adaa2 100644 --- a/docs/models/createsamlconnectionrequestbody.md +++ b/docs/models/createsamlconnectionrequestbody.md @@ -13,4 +13,5 @@ | `idp_certificate` | *OptionalNullable[str]* | :heavy_minus_sign: | The X.509 certificate as provided by the IdP | MIIDdzCCAl+gAwIBAgIJAKcyBaiiz+DT... | | `idp_metadata_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties | http://idp.example.org/metadata.xml | | `idp_metadata` | *OptionalNullable[str]* | :heavy_minus_sign: | The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties | Defaults to `true`. | \ No newline at end of file diff --git a/docs/models/emailaddress.md b/docs/models/emailaddress.md index d3bf9f5..8552758 100644 --- a/docs/models/emailaddress.md +++ b/docs/models/emailaddress.md @@ -14,4 +14,5 @@ Success | `linked_to` | List[[models.IdentificationLink](../models/identificationlink.md)] | :heavy_check_mark: | N/A | [
{
"type": "oauth_google",
"id": "link_12345"
}
] | | `created_at` | *int* | :heavy_check_mark: | Unix timestamp of creation
| 1615458901 | | `updated_at` | *int* | :heavy_check_mark: | Unix timestamp of creation
| 1615459001 | -| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | email_id_56789 | \ No newline at end of file +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | email_id_56789 | +| `matches_sso_connection` | *Optional[bool]* | :heavy_minus_sign: | Indicates whether this email address domain matches an active enterprise connection.
| | \ No newline at end of file diff --git a/docs/models/fromoauth.md b/docs/models/fromoauth.md new file mode 100644 index 0000000..5bda140 --- /dev/null +++ b/docs/models/fromoauth.md @@ -0,0 +1,12 @@ +# FromOAuth + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `status` | [models.FromOAuthVerificationStatus](../models/fromoauthverificationstatus.md) | :heavy_check_mark: | N/A | +| `strategy` | *str* | :heavy_check_mark: | N/A | +| `expire_at` | *Nullable[int]* | :heavy_check_mark: | N/A | +| `error` | [OptionalNullable[models.Error]](../models/error.md) | :heavy_minus_sign: | N/A | +| `attempts` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/fromoauthverificationstatus.md b/docs/models/fromoauthverificationstatus.md new file mode 100644 index 0000000..9e86d45 --- /dev/null +++ b/docs/models/fromoauthverificationstatus.md @@ -0,0 +1,9 @@ +# FromOAuthVerificationStatus + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `UNVERIFIED` | unverified | +| `VERIFIED` | verified | \ No newline at end of file diff --git a/docs/models/getuserlistrequest.md b/docs/models/getuserlistrequest.md index 65ff784..d03fb4d 100644 --- a/docs/models/getuserlistrequest.md +++ b/docs/models/getuserlistrequest.md @@ -13,7 +13,15 @@ | `user_id` | List[*str*] | :heavy_minus_sign: | Returns users with the user ids specified.
For each user id, the `+` and `-` can be
prepended to the id, which denote whether the
respective user id should be included or
excluded from the result set.
Accepts up to 100 user ids.
Any user ids not found are ignored. | [
"user-id-123"
] | | `organization_id` | List[*str*] | :heavy_minus_sign: | Returns users that have memberships to the
given organizations.
For each organization id, the `+` and `-` can be
prepended to the id, which denote whether the
respective organization should be included or
excluded from the result set.
Accepts up to 100 organization ids. | [
"org-id-123"
] | | `query` | *Optional[str]* | :heavy_minus_sign: | Returns users that match the given query.
For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names.
The query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well. | John | -| `last_active_at_since` | *Optional[int]* | :heavy_minus_sign: | Returns users that had session activity since the given date, with day precision.
Providing a value with higher precision than day will result in an error.
Example: use 1700690400000 to retrieve users that had session activity from 2023-11-23 until the current day. | 1700690400000 | +| `email_address_query` | *Optional[str]* | :heavy_minus_sign: | Returns users with emails that match the given query, via case-insensitive partial match.
For example, `email_address_query=ello` will match a user with the email `HELLO@example.com`. | | +| `phone_number_query` | *Optional[str]* | :heavy_minus_sign: | Returns users with phone numbers that match the given query, via case-insensitive partial match.
For example, `phone_number_query=555` will match a user with the phone number `+1555xxxxxxx`. | | +| `username_query` | *Optional[str]* | :heavy_minus_sign: | Returns users with usernames that match the given query, via case-insensitive partial match.
For example, `username_query=CoolUser` will match a user with the username `SomeCoolUser`. | | +| `name_query` | *Optional[str]* | :heavy_minus_sign: | Returns users with names that match the given query, via case-insensitive partial match. | | +| `last_active_at_before` | *Optional[int]* | :heavy_minus_sign: | Returns users whose last session activity was before the given date (with millisecond precision).
Example: use 1700690400000 to retrieve users whose last session activity was before 2023-11-23. | 1700690400000 | +| `last_active_at_after` | *Optional[int]* | :heavy_minus_sign: | Returns users whose last session activity was after the given date (with millisecond precision).
Example: use 1700690400000 to retrieve users whose last session activity was after 2023-11-23. | 1700690400000 | +| ~~`last_active_at_since`~~ | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Returns users that had session activity since the given date.
Example: use 1700690400000 to retrieve users that had session activity from 2023-11-23 until the current day.
Deprecated in favor of `last_active_at_after`. | 1700690400000 | +| `created_at_before` | *Optional[int]* | :heavy_minus_sign: | Returns users who have been created before the given date (with millisecond precision).
Example: use 1730160000000 to retrieve users who have been created before 2024-10-29. | 1730160000000 | +| `created_at_after` | *Optional[int]* | :heavy_minus_sign: | Returns users who have been created after the given date (with millisecond precision).
Example: use 1730160000000 to retrieve users who have been created after 2024-10-29. | 1730160000000 | | `limit` | *Optional[int]* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | 20 | | `offset` | *Optional[int]* | :heavy_minus_sign: | Skip the first `offset` results when paginating.
Needs to be an integer greater or equal to zero.
To be used in conjunction with `limit`. | 10 | | `order_by` | *Optional[str]* | :heavy_minus_sign: | Allows to return users in a particular order.
At the moment, you can order the returned users by their `created_at`,`updated_at`,`email_address`,`web3wallet`,`first_name`,`last_name`,`phone_number`,`username`,`last_active_at`,`last_sign_in_at`.
In order to specify the direction, you can use the `+/-` symbols prepended in the property to order by.
For example, if you want users to be returned in descending order according to their `created_at` property, you can use `-created_at`.
If you don't use `+` or `-`, then `+` is implied. We only support one `order_by` parameter, and if multiple `order_by` parameters are provided, we will only keep the first one. For example,
if you pass `order_by=username&order_by=created_at`, we will consider only the first `order_by` parameter, which is `username`. The `created_at` parameter will be ignored in this case. | | \ No newline at end of file diff --git a/docs/models/getuserscountrequest.md b/docs/models/getuserscountrequest.md index 945f287..cc28b6e 100644 --- a/docs/models/getuserscountrequest.md +++ b/docs/models/getuserscountrequest.md @@ -11,4 +11,7 @@ | `username` | List[*str*] | :heavy_minus_sign: | Counts users with the specified usernames.
Accepts up to 100 usernames.
Any usernames not found are ignored. | [
"username123"
] | | `web3_wallet` | List[*str*] | :heavy_minus_sign: | Counts users with the specified web3 wallet addresses.
Accepts up to 100 web3 wallet addresses.
Any web3 wallet addressed not found are ignored. | [
"0x123456789abcdef"
] | | `user_id` | List[*str*] | :heavy_minus_sign: | Counts users with the user ids specified.
Accepts up to 100 user ids.
Any user ids not found are ignored. | [
"user-id-123"
] | -| `query` | *Optional[str]* | :heavy_minus_sign: | Counts users that match the given query.
For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names.
The query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well. | John Doe | \ No newline at end of file +| `query` | *Optional[str]* | :heavy_minus_sign: | Counts users that match the given query.
For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names.
The query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well. | John Doe | +| `email_address_query` | *Optional[str]* | :heavy_minus_sign: | Counts users with emails that match the given query, via case-insensitive partial match.
For example, `email_address_query=ello` will match a user with the email `HELLO@example.com`,
and will be included in the resulting count. | | +| `phone_number_query` | *Optional[str]* | :heavy_minus_sign: | Counts users with phone numbers that match the given query, via case-insensitive partial match.
For example, `phone_number_query=555` will match a user with the phone number `+1555xxxxxxx`,
and will be included in the resulting count. | | +| `username_query` | *Optional[str]* | :heavy_minus_sign: | Counts users with usernames that match the given query, via case-insensitive partial match.
For example, `username_query=CoolUser` will match a user with the username `SomeCoolUser`,
and will be included in the resulting count. | | \ No newline at end of file diff --git a/docs/models/instance.md b/docs/models/instance.md new file mode 100644 index 0000000..f957a0a --- /dev/null +++ b/docs/models/instance.md @@ -0,0 +1,13 @@ +# Instance + +Success + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `object` | [Optional[models.InstanceObject]](../models/instanceobject.md) | :heavy_minus_sign: | String representing the object's type. Objects of the same type share the same value. | | +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `environment_type` | *Optional[str]* | :heavy_minus_sign: | N/A | development | +| `allowed_origins` | List[*str*] | :heavy_minus_sign: | N/A | [
"http://localhost:3000",
"https://some-domain"
] | \ No newline at end of file diff --git a/docs/models/instanceobject.md b/docs/models/instanceobject.md new file mode 100644 index 0000000..808ebf9 --- /dev/null +++ b/docs/models/instanceobject.md @@ -0,0 +1,10 @@ +# InstanceObject + +String representing the object's type. Objects of the same type share the same value. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `INSTANCE` | instance | \ No newline at end of file diff --git a/docs/models/wellknownjwks.md b/docs/models/jwks.md similarity index 97% rename from docs/models/wellknownjwks.md rename to docs/models/jwks.md index 5ece24c..93fa756 100644 --- a/docs/models/wellknownjwks.md +++ b/docs/models/jwks.md @@ -1,4 +1,4 @@ -# WellKnownJWKS +# Jwks Get the JSON Web Key Set diff --git a/docs/models/keys.md b/docs/models/keys.md index 1137917..117ccff 100644 --- a/docs/models/keys.md +++ b/docs/models/keys.md @@ -10,4 +10,6 @@ | `kid` | *Optional[str]* | :heavy_minus_sign: | N/A | | `alg` | *Optional[str]* | :heavy_minus_sign: | N/A | | `n` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `e` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `e` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `x` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `crv` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/listinvitationsrequest.md b/docs/models/listinvitationsrequest.md index e985fb0..a675ba6 100644 --- a/docs/models/listinvitationsrequest.md +++ b/docs/models/listinvitationsrequest.md @@ -7,4 +7,5 @@ | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `limit` | *Optional[int]* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | 20 | | `offset` | *Optional[int]* | :heavy_minus_sign: | Skip the first `offset` results when paginating.
Needs to be an integer greater or equal to zero.
To be used in conjunction with `limit`. | 10 | -| `status` | [Optional[models.ListInvitationsQueryParamStatus]](../models/listinvitationsqueryparamstatus.md) | :heavy_minus_sign: | Filter invitations based on their status | pending | \ No newline at end of file +| `status` | [Optional[models.ListInvitationsQueryParamStatus]](../models/listinvitationsqueryparamstatus.md) | :heavy_minus_sign: | Filter invitations based on their status | pending | +| `query` | *Optional[str]* | :heavy_minus_sign: | Filter invitations based on their `email_address` or `id` | | \ No newline at end of file diff --git a/docs/models/listsamlconnectionsrequest.md b/docs/models/listsamlconnectionsrequest.md index 2228f0c..7c31e5f 100644 --- a/docs/models/listsamlconnectionsrequest.md +++ b/docs/models/listsamlconnectionsrequest.md @@ -3,7 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| `limit` | *Optional[int]* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | 20 | -| `offset` | *Optional[int]* | :heavy_minus_sign: | Skip the first `offset` results when paginating.
Needs to be an integer greater or equal to zero.
To be used in conjunction with `limit`. | 10 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | 20 | +| `offset` | *Optional[int]* | :heavy_minus_sign: | Skip the first `offset` results when paginating.
Needs to be an integer greater or equal to zero.
To be used in conjunction with `limit`. | 10 | +| `organization_id` | List[*str*] | :heavy_minus_sign: | Returns SAML connections that have an associated organization ID to the
given organizations.
For each organization id, the `+` and `-` can be
prepended to the id, which denote whether the
respective organization should be included or
excluded from the result set.
Accepts up to 100 organization ids. | | \ No newline at end of file diff --git a/docs/models/listwaitlistentriesqueryparamstatus.md b/docs/models/listwaitlistentriesqueryparamstatus.md new file mode 100644 index 0000000..4400e15 --- /dev/null +++ b/docs/models/listwaitlistentriesqueryparamstatus.md @@ -0,0 +1,13 @@ +# ListWaitlistEntriesQueryParamStatus + +Filter waitlist entries by their status + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `PENDING` | pending | +| `INVITED` | invited | +| `COMPLETED` | completed | +| `REJECTED` | rejected | \ No newline at end of file diff --git a/docs/models/listwaitlistentriesrequest.md b/docs/models/listwaitlistentriesrequest.md new file mode 100644 index 0000000..4c2ac41 --- /dev/null +++ b/docs/models/listwaitlistentriesrequest.md @@ -0,0 +1,12 @@ +# ListWaitlistEntriesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | 20 | +| `offset` | *Optional[int]* | :heavy_minus_sign: | Skip the first `offset` results when paginating.
Needs to be an integer greater or equal to zero.
To be used in conjunction with `limit`. | 10 | +| `query` | *Optional[str]* | :heavy_minus_sign: | Filter waitlist entries by email address | | +| `status` | [Optional[models.ListWaitlistEntriesQueryParamStatus]](../models/listwaitlistentriesqueryparamstatus.md) | :heavy_minus_sign: | Filter waitlist entries by their status | | +| `order_by` | *Optional[str]* | :heavy_minus_sign: | Specify the order of results. Supported values are:
- `created_at`
- `email_address`
- `invited_at`

Use `+` for ascending or `-` for descending order. Defaults to `-created_at`. | | \ No newline at end of file diff --git a/docs/models/oauth.md b/docs/models/oauth.md deleted file mode 100644 index 404fbae..0000000 --- a/docs/models/oauth.md +++ /dev/null @@ -1,13 +0,0 @@ -# Oauth - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `status` | [models.OauthVerificationStatus](../models/oauthverificationstatus.md) | :heavy_check_mark: | N/A | verified | -| `strategy` | [models.OauthVerificationStrategy](../models/oauthverificationstrategy.md) | :heavy_check_mark: | N/A | oauth_google | -| `expire_at` | *int* | :heavy_check_mark: | N/A | 1615462399 | -| `external_verification_redirect_url` | *Optional[str]* | :heavy_minus_sign: | N/A | https://oauth.google.com/verify | -| `error` | [OptionalNullable[models.Error]](../models/error.md) | :heavy_minus_sign: | N/A | | -| `attempts` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | 1 | \ No newline at end of file diff --git a/docs/models/oauthapplication.md b/docs/models/oauthapplication.md index 78c0f1c..affc653 100644 --- a/docs/models/oauthapplication.md +++ b/docs/models/oauthapplication.md @@ -16,5 +16,7 @@ | `authorize_url` | *str* | :heavy_check_mark: | N/A | https://example.com/authorize | | `token_fetch_url` | *str* | :heavy_check_mark: | N/A | https://example.com/oauth/token | | `user_info_url` | *str* | :heavy_check_mark: | N/A | https://example.com/userinfo | +| `discovery_url` | *str* | :heavy_check_mark: | N/A | | +| `token_introspection_url` | *str* | :heavy_check_mark: | N/A | | | `created_at` | *int* | :heavy_check_mark: | Unix timestamp of creation.
| 1609459200 | | `updated_at` | *int* | :heavy_check_mark: | Unix timestamp of last update.
| 1612137600 | \ No newline at end of file diff --git a/docs/models/oauthapplicationwithsecret.md b/docs/models/oauthapplicationwithsecret.md index b3fe2b8..c0dbdbf 100644 --- a/docs/models/oauthapplicationwithsecret.md +++ b/docs/models/oauthapplicationwithsecret.md @@ -16,6 +16,8 @@ | `authorize_url` | *str* | :heavy_check_mark: | N/A | https://example.com/authorize | | `token_fetch_url` | *str* | :heavy_check_mark: | N/A | https://example.com/oauth/token | | `user_info_url` | *str* | :heavy_check_mark: | N/A | https://example.com/userinfo | +| `discovery_url` | *str* | :heavy_check_mark: | N/A | | +| `token_introspection_url` | *str* | :heavy_check_mark: | N/A | | | `created_at` | *int* | :heavy_check_mark: | Unix timestamp of creation.
| 1609459200 | | `updated_at` | *int* | :heavy_check_mark: | Unix timestamp of last update.
| 1612137600 | | `client_secret` | *Optional[str]* | :heavy_minus_sign: | Empty if public client.
| secretXYZ123 | \ No newline at end of file diff --git a/docs/models/oauthverificationstatus.md b/docs/models/oauthverificationstatus.md deleted file mode 100644 index 9638035..0000000 --- a/docs/models/oauthverificationstatus.md +++ /dev/null @@ -1,12 +0,0 @@ -# OauthVerificationStatus - - -## Values - -| Name | Value | -| -------------- | -------------- | -| `UNVERIFIED` | unverified | -| `VERIFIED` | verified | -| `FAILED` | failed | -| `EXPIRED` | expired | -| `TRANSFERABLE` | transferable | \ No newline at end of file diff --git a/docs/models/oauthverificationstrategy.md b/docs/models/oauthverificationstrategy.md deleted file mode 100644 index 86e12ee..0000000 --- a/docs/models/oauthverificationstrategy.md +++ /dev/null @@ -1,16 +0,0 @@ -# OauthVerificationStrategy - - -## Values - -| Name | Value | -| ---------------------- | ---------------------- | -| `OAUTH_GOOGLE` | oauth_google | -| `OAUTH_MOCK` | oauth_mock | -| `FROM_OAUTH_GOOGLE` | from_oauth_google | -| `FROM_OAUTH_DISCORD` | from_oauth_discord | -| `FROM_OAUTH_MICROSOFT` | from_oauth_microsoft | -| `OAUTH_APPLE` | oauth_apple | -| `OAUTH_MICROSOFT` | oauth_microsoft | -| `OAUTH_GITHUB` | oauth_github | -| `EMAIL_LINK` | email_link | \ No newline at end of file diff --git a/docs/models/organization.md b/docs/models/organization.md index bad5c2d..b1d0f4b 100644 --- a/docs/models/organization.md +++ b/docs/models/organization.md @@ -16,4 +16,4 @@ | `updated_at` | *int* | :heavy_check_mark: | Unix timestamp of last update.
| 1625164800 | | `members_count` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | 150 | | `admin_delete_enabled` | *Optional[bool]* | :heavy_minus_sign: | N/A | true | -| `created_by` | *Optional[str]* | :heavy_minus_sign: | N/A | user_123456 | \ No newline at end of file +| `created_by` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | user_123456 | \ No newline at end of file diff --git a/docs/models/organizationinvitation.md b/docs/models/organizationinvitation.md index d4c1dc7..0d4b956 100644 --- a/docs/models/organizationinvitation.md +++ b/docs/models/organizationinvitation.md @@ -16,5 +16,7 @@ An organization invitation | `status` | *Optional[str]* | :heavy_minus_sign: | N/A | pending | | `public_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | {
"key": "value"
} | | `private_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | {
"private_key": "secret_value"
} | +| `url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `expires_at` | *OptionalNullable[int]* | :heavy_minus_sign: | Unix timestamp of expiration.
| | | `created_at` | *Optional[int]* | :heavy_minus_sign: | Unix timestamp of creation. | 1622547600 | | `updated_at` | *Optional[int]* | :heavy_minus_sign: | Unix timestamp of last update. | 1622551200 | \ No newline at end of file diff --git a/docs/models/organizationinvitationwithpublicorganizationdata.md b/docs/models/organizationinvitationwithpublicorganizationdata.md index b3ab193..8ce3c9e 100644 --- a/docs/models/organizationinvitationwithpublicorganizationdata.md +++ b/docs/models/organizationinvitationwithpublicorganizationdata.md @@ -16,6 +16,7 @@ An organization invitation with public organization data populated | `status` | *Optional[str]* | :heavy_minus_sign: | N/A | | `public_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | `private_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `public_organization_data` | [Optional[models.PublicOrganizationData]](../models/publicorganizationdata.md) | :heavy_minus_sign: | N/A | | `created_at` | *Optional[int]* | :heavy_minus_sign: | Unix timestamp of creation. | | `updated_at` | *Optional[int]* | :heavy_minus_sign: | Unix timestamp of last update. | \ No newline at end of file diff --git a/docs/models/organizationmembershiporganization.md b/docs/models/organizationmembershiporganization.md index d9615d4..839357d 100644 --- a/docs/models/organizationmembershiporganization.md +++ b/docs/models/organizationmembershiporganization.md @@ -16,4 +16,4 @@ | `updated_at` | *int* | :heavy_check_mark: | Unix timestamp of last update.
| 1625164800 | | `members_count` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | 150 | | `admin_delete_enabled` | *Optional[bool]* | :heavy_minus_sign: | N/A | true | -| `created_by` | *Optional[str]* | :heavy_minus_sign: | N/A | user_123456 | \ No newline at end of file +| `created_by` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | user_123456 | \ No newline at end of file diff --git a/docs/models/organizationwithlogo.md b/docs/models/organizationwithlogo.md index 08b580e..37c54ad 100644 --- a/docs/models/organizationwithlogo.md +++ b/docs/models/organizationwithlogo.md @@ -17,6 +17,6 @@ | `image_url` | *str* | :heavy_check_mark: | N/A | https://example.com/image_url.png | | `members_count` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | 150 | | `admin_delete_enabled` | *Optional[bool]* | :heavy_minus_sign: | N/A | true | -| `created_by` | *Optional[str]* | :heavy_minus_sign: | N/A | user_123456 | +| `created_by` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | user_123456 | | ~~`logo_url`~~ | *Optional[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | https://example.com/logo_url.png | | `has_image` | *Optional[bool]* | :heavy_minus_sign: | N/A | true | \ No newline at end of file diff --git a/docs/models/requestbody.md b/docs/models/requestbody.md index c0134cb..0ffe0c1 100644 --- a/docs/models/requestbody.md +++ b/docs/models/requestbody.md @@ -3,11 +3,11 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `email_address` | *str* | :heavy_check_mark: | The email address of the new member that is going to be invited to the organization | newmember@example.com | -| `role` | *str* | :heavy_check_mark: | The role of the new member in the organization. | admin | -| `inviter_user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the user that invites the new member to the organization.
Must be an administrator in the organization. | user_67890 | -| `public_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. | {} | -| `private_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. | {} | -| `redirect_url` | *Optional[str]* | :heavy_minus_sign: | Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email. | https://example.com/welcome | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `email_address` | *str* | :heavy_check_mark: | The email address the invitation will be sent to | +| `public_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata that will be attached to the newly created invitation.
The value of this property should be a well-formed JSON object.
Once the user accepts the invitation and signs up, these metadata will end up in the user's public metadata. | +| `redirect_url` | *Optional[str]* | :heavy_minus_sign: | The URL where the user is redirected upon visiting the invitation link, where they can accept the invitation. Required if you have implemented a [custom flow for handling application invitations](/docs/custom-flows/invitations). | +| `notify` | *OptionalNullable[bool]* | :heavy_minus_sign: | Optional flag which denotes whether an email invitation should be sent to the given email address.
Defaults to true. | +| `ignore_existing` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether an invitation should be created if there is already an existing invitation for this email
address, or it's claimed by another user. | +| `expires_in_days` | *OptionalNullable[int]* | :heavy_minus_sign: | The number of days the invitation will be valid for. By default, the invitation expires after 30 days. | \ No newline at end of file diff --git a/docs/models/responsebody.md b/docs/models/responsebody.md index b279c3b..9530e9f 100644 --- a/docs/models/responsebody.md +++ b/docs/models/responsebody.md @@ -13,4 +13,5 @@ | `public_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | {} | | `label` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | Primary account | | `scopes` | List[*str*] | :heavy_minus_sign: | The list of scopes that the token is valid for.
Only present for OAuth 2.0 tokens. | [
"email",
"profile"
] | -| `token_secret` | *Optional[str]* | :heavy_minus_sign: | The token secret. Only present for OAuth 1.0 tokens. | token_secret_xyz | \ No newline at end of file +| `token_secret` | *Optional[str]* | :heavy_minus_sign: | The token secret. Only present for OAuth 1.0 tokens. | token_secret_xyz | +| `expires_at` | *OptionalNullable[int]* | :heavy_minus_sign: | Unix timestamp of the access token expiration. | | \ No newline at end of file diff --git a/docs/models/schemassamlconnection.md b/docs/models/schemassamlconnection.md index 6b45898..77f6a48 100644 --- a/docs/models/schemassamlconnection.md +++ b/docs/models/schemassamlconnection.md @@ -23,6 +23,7 @@ | `updated_at` | *int* | :heavy_check_mark: | Unix timestamp of last update.
| | `idp_metadata_url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `idp_metadata` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `organization_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `attribute_mapping` | [Optional[models.AttributeMapping]](../models/attributemapping.md) | :heavy_minus_sign: | N/A | | `allow_subdomains` | *Optional[bool]* | :heavy_minus_sign: | N/A | | `allow_idp_initiated` | *Optional[bool]* | :heavy_minus_sign: | N/A | diff --git a/docs/models/signup.md b/docs/models/signup.md index f5eed3a..442ff89 100644 --- a/docs/models/signup.md +++ b/docs/models/signup.md @@ -5,28 +5,29 @@ Success ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `object` | [models.SignUpObject](../models/signupobject.md) | :heavy_check_mark: | N/A | sign_up_attempt | -| `id` | *str* | :heavy_check_mark: | N/A | signup_1234567890abcdef | -| `status` | [models.SignUpStatus](../models/signupstatus.md) | :heavy_check_mark: | N/A | complete | -| `password_enabled` | *bool* | :heavy_check_mark: | N/A | true | -| `custom_action` | *bool* | :heavy_check_mark: | N/A | false | -| `abandon_at` | *int* | :heavy_check_mark: | N/A | 1609459200 | -| `required_fields` | List[*str*] | :heavy_minus_sign: | N/A | [
"email_address"
] | -| `optional_fields` | List[*str*] | :heavy_minus_sign: | N/A | [
"first_name",
"last_name"
] | -| `missing_fields` | List[*str*] | :heavy_minus_sign: | N/A | [
"phone_number"
] | -| `unverified_fields` | List[*str*] | :heavy_minus_sign: | N/A | [
"email_address"
] | -| `verifications` | [Optional[models.Verifications]](../models/verifications.md) | :heavy_minus_sign: | N/A | | -| `username` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | user_123456 | -| `email_address` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | user@example.com | -| `phone_number` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +1234567890 | -| `web3_wallet` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | 0x1234567890abcdef1234567890abcdef12345678 | -| `first_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | John | -| `last_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | Doe | -| `unsafe_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | -| `public_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | -| `external_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | ext_id_7890abcdef123456 | -| `created_session_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | sess_1234567890abcdef | -| `created_user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | user_1234567890abcdef | -| `external_account` | [Optional[models.ExternalAccount]](../models/externalaccount.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `object` | [models.SignUpObject](../models/signupobject.md) | :heavy_check_mark: | N/A | sign_up_attempt | +| `id` | *str* | :heavy_check_mark: | N/A | signup_1234567890abcdef | +| `status` | [models.SignUpStatus](../models/signupstatus.md) | :heavy_check_mark: | N/A | complete | +| `password_enabled` | *bool* | :heavy_check_mark: | N/A | true | +| `custom_action` | *bool* | :heavy_check_mark: | N/A | false | +| `abandon_at` | *int* | :heavy_check_mark: | N/A | 1609459200 | +| `required_fields` | List[*str*] | :heavy_minus_sign: | N/A | [
"email_address"
] | +| `optional_fields` | List[*str*] | :heavy_minus_sign: | N/A | [
"first_name",
"last_name"
] | +| `missing_fields` | List[*str*] | :heavy_minus_sign: | N/A | [
"phone_number"
] | +| `unverified_fields` | List[*str*] | :heavy_minus_sign: | N/A | [
"email_address"
] | +| `verifications` | [Optional[models.Verifications]](../models/verifications.md) | :heavy_minus_sign: | N/A | | +| `username` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | user_123456 | +| `email_address` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | user@example.com | +| `phone_number` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +1234567890 | +| `web3_wallet` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | 0x1234567890abcdef1234567890abcdef12345678 | +| `first_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | John | +| `last_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | Doe | +| `unsafe_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | +| `public_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | +| `external_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | ext_id_7890abcdef123456 | +| `created_session_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | sess_1234567890abcdef | +| `created_user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | user_1234567890abcdef | +| `legal_accepted_at` | *OptionalNullable[int]* | :heavy_minus_sign: | Unix timestamp at which the user accepted the legal requirements.
| 1700690400000 | +| `external_account` | [Optional[models.ExternalAccount]](../models/externalaccount.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/templateslug.md b/docs/models/templateslug.md new file mode 100644 index 0000000..adfc971 --- /dev/null +++ b/docs/models/templateslug.md @@ -0,0 +1,12 @@ +# TemplateSlug + +The slug of the email template to use for the invitation email. +If not provided, the "invitation" template will be used. + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `INVITATION` | invitation | +| `WAITLIST_INVITATION` | waitlist_invitation | \ No newline at end of file diff --git a/docs/models/type.md b/docs/models/type.md index a7d8abe..2a1e737 100644 --- a/docs/models/type.md +++ b/docs/models/type.md @@ -8,8 +8,7 @@ | `OAUTH_GOOGLE` | oauth_google | | `OAUTH_MOCK` | oauth_mock | | `SAML` | saml | -| `OAUTH_MICROSOFT` | oauth_microsoft | -| `EMAIL_LINK` | email_link | | `OAUTH_APPLE` | oauth_apple | | `OAUTH_DISCORD` | oauth_discord | +| `OAUTH_MICROSOFT` | oauth_microsoft | | `OAUTH_GITHUB` | oauth_github | \ No newline at end of file diff --git a/docs/models/updateemailaddressrequest.md b/docs/models/updateemailaddressrequest.md index 99a6d3f..0aa8ed5 100644 --- a/docs/models/updateemailaddressrequest.md +++ b/docs/models/updateemailaddressrequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `email_address_id` | *str* | :heavy_check_mark: | The ID of the email address to update | email_address_id_example | -| `request_body` | [models.UpdateEmailAddressRequestBody](../models/updateemailaddressrequestbody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `email_address_id` | *str* | :heavy_check_mark: | The ID of the email address to update | email_address_id_example | +| `request_body` | [Optional[models.UpdateEmailAddressRequestBody]](../models/updateemailaddressrequestbody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/updatejwttemplaterequest.md b/docs/models/updatejwttemplaterequest.md index 2a676a8..3b8f983 100644 --- a/docs/models/updatejwttemplaterequest.md +++ b/docs/models/updatejwttemplaterequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `template_id` | *str* | :heavy_check_mark: | The ID of the JWT template to update | -| `request_body` | [models.UpdateJWTTemplateRequestBody](../models/updatejwttemplaterequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `template_id` | *str* | :heavy_check_mark: | The ID of the JWT template to update | +| `request_body` | [Optional[models.UpdateJWTTemplateRequestBody]](../models/updatejwttemplaterequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/updateorganizationmembershipmetadatarequest.md b/docs/models/updateorganizationmembershipmetadatarequest.md index 15fb489..5adf959 100644 --- a/docs/models/updateorganizationmembershipmetadatarequest.md +++ b/docs/models/updateorganizationmembershipmetadatarequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization the membership belongs to | org_123456 | -| `user_id` | *str* | :heavy_check_mark: | The ID of the user that this membership belongs to | user_654321 | -| `request_body` | [models.UpdateOrganizationMembershipMetadataRequestBody](../models/updateorganizationmembershipmetadatarequestbody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization the membership belongs to | org_123456 | +| `user_id` | *str* | :heavy_check_mark: | The ID of the user that this membership belongs to | user_654321 | +| `request_body` | [Optional[models.UpdateOrganizationMembershipMetadataRequestBody]](../models/updateorganizationmembershipmetadatarequestbody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/updatephonenumberrequest.md b/docs/models/updatephonenumberrequest.md index 4bae0db..47c385c 100644 --- a/docs/models/updatephonenumberrequest.md +++ b/docs/models/updatephonenumberrequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `phone_number_id` | *str* | :heavy_check_mark: | The ID of the phone number to update | phone_12345 | -| `request_body` | [models.UpdatePhoneNumberRequestBody](../models/updatephonenumberrequestbody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `phone_number_id` | *str* | :heavy_check_mark: | The ID of the phone number to update | phone_12345 | +| `request_body` | [Optional[models.UpdatePhoneNumberRequestBody]](../models/updatephonenumberrequestbody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/updatesamlconnectionrequestbody.md b/docs/models/updatesamlconnectionrequestbody.md index 1d767b3..fedf9d8 100644 --- a/docs/models/updatesamlconnectionrequestbody.md +++ b/docs/models/updatesamlconnectionrequestbody.md @@ -12,6 +12,7 @@ | `idp_certificate` | *OptionalNullable[str]* | :heavy_minus_sign: | The x509 certificated as provided by the IdP | MIIDBTCCAe2gAwIBAgIQ... | | `idp_metadata_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties and replaces them | https://idp.example.com/metadata | | `idp_metadata` | *OptionalNullable[str]* | :heavy_minus_sign: | The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties | ... | +| `organization_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the organization to which users of this SAML Connection will be added | | | `attribute_mapping` | [OptionalNullable[models.UpdateSAMLConnectionAttributeMapping]](../models/updatesamlconnectionattributemapping.md) | :heavy_minus_sign: | Define the atrtibute name mapping between Identity Provider and Clerk's user properties | | | `active` | *OptionalNullable[bool]* | :heavy_minus_sign: | Activate or de-activate the SAML Connection | true | | `sync_user_attributes` | *OptionalNullable[bool]* | :heavy_minus_sign: | Controls whether to update the user's attributes in each sign-in | false | diff --git a/docs/models/updatesignuprequest.md b/docs/models/updatesignuprequest.md index 57d74cc..5d03372 100644 --- a/docs/models/updatesignuprequest.md +++ b/docs/models/updatesignuprequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The ID of the sign-up to update | signup_1234567890abcdef | -| `request_body` | [models.UpdateSignUpRequestBody](../models/updatesignuprequestbody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The ID of the sign-up to update | signup_1234567890abcdef | +| `request_body` | [Optional[models.UpdateSignUpRequestBody]](../models/updatesignuprequestbody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/updateusermetadatarequest.md b/docs/models/updateusermetadatarequest.md index a7ba3c9..dd5fc87 100644 --- a/docs/models/updateusermetadatarequest.md +++ b/docs/models/updateusermetadatarequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `user_id` | *str* | :heavy_check_mark: | The ID of the user whose metadata will be updated and merged | user_123456789 | -| `request_body` | [models.UpdateUserMetadataRequestBody](../models/updateusermetadatarequestbody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `user_id` | *str* | :heavy_check_mark: | The ID of the user whose metadata will be updated and merged | user_123456789 | +| `request_body` | [Optional[models.UpdateUserMetadataRequestBody]](../models/updateusermetadatarequestbody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/uploadorganizationlogorequest.md b/docs/models/uploadorganizationlogorequest.md index c3d3fdc..9880db5 100644 --- a/docs/models/uploadorganizationlogorequest.md +++ b/docs/models/uploadorganizationlogorequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization for which to upload a logo | org_12345 | -| `request_body` | [models.UploadOrganizationLogoRequestBody](../models/uploadorganizationlogorequestbody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization for which to upload a logo | org_12345 | +| `request_body` | [Optional[models.UploadOrganizationLogoRequestBody]](../models/uploadorganizationlogorequestbody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/verification.md b/docs/models/verification.md index ec67038..3f9fc63 100644 --- a/docs/models/verification.md +++ b/docs/models/verification.md @@ -15,9 +15,9 @@ value: models.Otp = /* values here */ value: models.Admin = /* values here */ ``` -### `models.Oauth` +### `models.FromOAuth` ```python -value: models.Oauth = /* values here */ +value: models.FromOAuth = /* values here */ ``` diff --git a/docs/models/verifyclientrequestbody.md b/docs/models/verifyclientrequestbody.md index e47e123..59d6125 100644 --- a/docs/models/verifyclientrequestbody.md +++ b/docs/models/verifyclientrequestbody.md @@ -1,5 +1,7 @@ # VerifyClientRequestBody +Parameters. + ## Fields diff --git a/docs/models/verifypasswordrequest.md b/docs/models/verifypasswordrequest.md index 99a1170..17801cd 100644 --- a/docs/models/verifypasswordrequest.md +++ b/docs/models/verifypasswordrequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `user_id` | *str* | :heavy_check_mark: | The ID of the user for whom to verify the password | user_123 | -| `request_body` | [models.VerifyPasswordRequestBody](../models/verifypasswordrequestbody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `user_id` | *str* | :heavy_check_mark: | The ID of the user for whom to verify the password | user_123 | +| `request_body` | [Optional[models.VerifyPasswordRequestBody]](../models/verifypasswordrequestbody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/verifytotprequest.md b/docs/models/verifytotprequest.md index 177d749..e63e932 100644 --- a/docs/models/verifytotprequest.md +++ b/docs/models/verifytotprequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `user_id` | *str* | :heavy_check_mark: | The ID of the user for whom to verify the TOTP | usr_1a2b3c | -| `request_body` | [models.VerifyTOTPRequestBody](../models/verifytotprequestbody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `user_id` | *str* | :heavy_check_mark: | The ID of the user for whom to verify the TOTP | usr_1a2b3c | +| `request_body` | [Optional[models.VerifyTOTPRequestBody]](../models/verifytotprequestbody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/waitlistentries.md b/docs/models/waitlistentries.md new file mode 100644 index 0000000..59d7677 --- /dev/null +++ b/docs/models/waitlistentries.md @@ -0,0 +1,11 @@ +# WaitlistEntries + +List of waitlist entries + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `data` | List[[models.WaitlistEntry](../models/waitlistentry.md)] | :heavy_check_mark: | N/A | +| `total_count` | *int* | :heavy_check_mark: | Total number of waitlist entries | \ No newline at end of file diff --git a/docs/models/waitlistentry.md b/docs/models/waitlistentry.md new file mode 100644 index 0000000..97f731d --- /dev/null +++ b/docs/models/waitlistentry.md @@ -0,0 +1,15 @@ +# WaitlistEntry + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `object` | [models.WaitlistEntryObject](../models/waitlistentryobject.md) | :heavy_check_mark: | N/A | | +| `id` | *str* | :heavy_check_mark: | N/A | | +| `email_address` | *str* | :heavy_check_mark: | N/A | | +| `status` | [models.WaitlistEntryStatus](../models/waitlistentrystatus.md) | :heavy_check_mark: | N/A | pending | +| `created_at` | *int* | :heavy_check_mark: | Unix timestamp of creation.
| | +| `updated_at` | *int* | :heavy_check_mark: | Unix timestamp of last update.
| | +| `is_locked` | *Optional[bool]* | :heavy_minus_sign: | Indicates if the waitlist entry is locked. Locked entries are being processed in a batch action and are unavailable for other actions.
| | +| `invitation` | [OptionalNullable[models.WaitlistEntryInvitation]](../models/waitlistentryinvitation.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/waitlistentryinvitation.md b/docs/models/waitlistentryinvitation.md new file mode 100644 index 0000000..154aed4 --- /dev/null +++ b/docs/models/waitlistentryinvitation.md @@ -0,0 +1,17 @@ +# WaitlistEntryInvitation + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `object` | [models.WaitlistEntryInvitationObject](../models/waitlistentryinvitationobject.md) | :heavy_check_mark: | N/A | invitation | +| `id` | *str* | :heavy_check_mark: | N/A | inv_f02930r3 | +| `email_address` | *str* | :heavy_check_mark: | N/A | invitee@example.com | +| `status` | [models.WaitlistEntryInvitationStatus](../models/waitlistentryinvitationstatus.md) | :heavy_check_mark: | N/A | pending | +| `created_at` | *int* | :heavy_check_mark: | Unix timestamp of creation.
| 1622549600 | +| `updated_at` | *int* | :heavy_check_mark: | Unix timestamp of last update.
| 1622553200 | +| `public_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | {} | +| `revoked` | *Optional[bool]* | :heavy_minus_sign: | N/A | false | +| `url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | https://example.com/invitations/accept?code=abcd1234 | +| `expires_at` | *OptionalNullable[int]* | :heavy_minus_sign: | Unix timestamp of expiration.
| | \ No newline at end of file diff --git a/docs/models/waitlistentryinvitationobject.md b/docs/models/waitlistentryinvitationobject.md new file mode 100644 index 0000000..10427b5 --- /dev/null +++ b/docs/models/waitlistentryinvitationobject.md @@ -0,0 +1,8 @@ +# WaitlistEntryInvitationObject + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `INVITATION` | invitation | \ No newline at end of file diff --git a/docs/models/waitlistentryinvitationstatus.md b/docs/models/waitlistentryinvitationstatus.md new file mode 100644 index 0000000..4e0aa7f --- /dev/null +++ b/docs/models/waitlistentryinvitationstatus.md @@ -0,0 +1,11 @@ +# WaitlistEntryInvitationStatus + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `PENDING` | pending | +| `ACCEPTED` | accepted | +| `REVOKED` | revoked | +| `EXPIRED` | expired | \ No newline at end of file diff --git a/docs/models/waitlistentryobject.md b/docs/models/waitlistentryobject.md new file mode 100644 index 0000000..3342907 --- /dev/null +++ b/docs/models/waitlistentryobject.md @@ -0,0 +1,8 @@ +# WaitlistEntryObject + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `WAITLIST_ENTRY` | waitlist_entry | \ No newline at end of file diff --git a/docs/models/waitlistentrystatus.md b/docs/models/waitlistentrystatus.md new file mode 100644 index 0000000..65b1c1d --- /dev/null +++ b/docs/models/waitlistentrystatus.md @@ -0,0 +1,11 @@ +# WaitlistEntryStatus + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `PENDING` | pending | +| `INVITED` | invited | +| `REJECTED` | rejected | +| `COMPLETED` | completed | \ No newline at end of file diff --git a/docs/models/web3signatureverificationstrategy.md b/docs/models/web3signatureverificationstrategy.md index 0a96340..cb668a6 100644 --- a/docs/models/web3signatureverificationstrategy.md +++ b/docs/models/web3signatureverificationstrategy.md @@ -6,4 +6,5 @@ | Name | Value | | -------------------------------- | -------------------------------- | | `WEB3_METAMASK_SIGNATURE` | web3_metamask_signature | -| `WEB3_COINBASE_WALLET_SIGNATURE` | web3_coinbase_wallet_signature | \ No newline at end of file +| `WEB3_COINBASE_WALLET_SIGNATURE` | web3_coinbase_wallet_signature | +| `WEB3_OKX_WALLET_SIGNATURE` | web3_okx_wallet_signature | \ No newline at end of file diff --git a/docs/sdks/actortokens/README.md b/docs/sdks/actortokens/README.md index 150b285..af06c33 100644 --- a/docs/sdks/actortokens/README.md +++ b/docs/sdks/actortokens/README.md @@ -22,7 +22,12 @@ with Clerk( bearer_auth="", ) as clerk: - res = clerk.actor_tokens.create(user_id="user_1a2b3c", actor={}, expires_in_seconds=3600, session_max_duration_in_seconds=1800) + res = clerk.actor_tokens.create(request={ + "user_id": "user_1a2b3c", + "actor": {}, + "expires_in_seconds": 3600, + "session_max_duration_in_seconds": 1800, + }) assert res is not None @@ -33,13 +38,10 @@ with Clerk( ### Parameters -| Parameter | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `user_id` | *str* | :heavy_check_mark: | The ID of the user being impersonated. | user_1a2b3c | -| `actor` | [models.CreateActorTokenActor](../../models/createactortokenactor.md) | :heavy_check_mark: | The actor payload. It needs to include a sub property which should contain the ID of the actor.
This whole payload will be also included in the JWT session token. | {
"sub": "user_2OEpKhcCN1Lat9NQ0G6puh7q5Rb"
} | -| `expires_in_seconds` | *Optional[int]* | :heavy_minus_sign: | Optional parameter to specify the life duration of the actor token in seconds.
By default, the duration is 1 hour. | 3600 | -| `session_max_duration_in_seconds` | *Optional[int]* | :heavy_minus_sign: | The maximum duration that the session which will be created by the generated actor token should last.
By default, the duration of a session created via an actor token, lasts 30 minutes. | 1800 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `request` | [models.CreateActorTokenRequestBody](../../models/createactortokenrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/allowlistblocklist/README.md b/docs/sdks/allowlistblocklist/README.md index 9aabeb3..491f2bf 100644 --- a/docs/sdks/allowlistblocklist/README.md +++ b/docs/sdks/allowlistblocklist/README.md @@ -62,7 +62,10 @@ with Clerk( bearer_auth="", ) as clerk: - res = clerk.allowlist_blocklist.create_allowlist_identifier(identifier="user@example.com", notify=True) + res = clerk.allowlist_blocklist.create_allowlist_identifier(request={ + "identifier": "user@example.com", + "notify": True, + }) assert res is not None @@ -73,11 +76,10 @@ with Clerk( ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `identifier` | *str* | :heavy_check_mark: | The identifier to be added in the allow-list.
This can be an email address, a phone number or a web3 wallet. | user@example.com | -| `notify` | *Optional[bool]* | :heavy_minus_sign: | This flag denotes whether the given identifier will receive an invitation to join the application.
Note that this only works for email address and phone number identifiers. | true | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `request` | [models.CreateAllowlistIdentifierRequestBody](../../models/createallowlistidentifierrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -103,7 +105,9 @@ with Clerk( bearer_auth="", ) as clerk: - res = clerk.allowlist_blocklist.create_blocklist_identifier(identifier="example@example.com") + res = clerk.allowlist_blocklist.create_blocklist_identifier(request={ + "identifier": "example@example.com", + }) assert res is not None @@ -114,10 +118,10 @@ with Clerk( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `identifier` | *str* | :heavy_check_mark: | The identifier to be added in the block-list.
This can be an email address, a phone number or a web3 wallet. | example@example.com | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `request` | [models.CreateBlocklistIdentifierRequestBody](../../models/createblocklistidentifierrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/domainssdk/README.md b/docs/sdks/domainssdk/README.md index fc2814c..668bd71 100644 --- a/docs/sdks/domainssdk/README.md +++ b/docs/sdks/domainssdk/README.md @@ -68,7 +68,11 @@ with Clerk( bearer_auth="", ) as clerk: - res = clerk.domains.add(name="example.com", is_satellite=True, proxy_url="https://proxy.example.com") + res = clerk.domains.add(request={ + "name": "example.com", + "is_satellite": True, + "proxy_url": "https://proxy.example.com", + }) assert res is not None @@ -79,12 +83,10 @@ with Clerk( ### Parameters -| Parameter | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| `name` | *str* | :heavy_check_mark: | The new domain name. Can contain the port for development instances. | example.com | -| `is_satellite` | *bool* | :heavy_check_mark: | Marks the new domain as satellite. Only `true` is accepted at the moment. | true | -| `proxy_url` | *Optional[str]* | :heavy_minus_sign: | The full URL of the proxy which will forward requests to the Clerk Frontend API for this domain. Applicable only to production instances. | https://proxy.example.com | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [models.AddDomainRequestBody](../../models/adddomainrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/instancesettingssdk/README.md b/docs/sdks/instancesettingssdk/README.md index 25c6e76..020b17f 100644 --- a/docs/sdks/instancesettingssdk/README.md +++ b/docs/sdks/instancesettingssdk/README.md @@ -5,10 +5,49 @@ ### Available Operations +* [get_instance](#get_instance) - Fetch the current instance * [update](#update) - Update instance settings * [update_restrictions](#update_restrictions) - Update instance restrictions * [update_organization_settings](#update_organization_settings) - Update instance organization settings +## get_instance + +Fetches the current instance + +### Example Usage + +```python +from clerk_backend_api import Clerk + +with Clerk( + bearer_auth="", +) as clerk: + + res = clerk.instance_settings.get_instance() + + assert res is not None + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.Instance](../../models/instance.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| models.SDKError | 4XX, 5XX | \*/\* | + ## update Updates the settings of an instance @@ -149,5 +188,5 @@ with Clerk( | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 402, 404, 422 | application/json | +| models.ClerkErrors | 400, 402, 404, 422 | application/json | | models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/invitations/README.md b/docs/sdks/invitations/README.md index 45295c8..f1e2eba 100644 --- a/docs/sdks/invitations/README.md +++ b/docs/sdks/invitations/README.md @@ -10,6 +10,7 @@ Invitations allow you to invite someone to sign up to your application, via emai * [create](#create) - Create an invitation * [list](#list) - List all invitations +* [create_bulk_invitations](#create_bulk_invitations) - Create multiple invitations * [revoke](#revoke) - Revokes an invitation ## create @@ -21,15 +22,24 @@ Also, trying to create an invitation for an email address that already exists in ### Example Usage ```python +import clerk_backend_api from clerk_backend_api import Clerk with Clerk( bearer_auth="", ) as clerk: - res = clerk.invitations.create(email_address="user@example.com", public_metadata={ + res = clerk.invitations.create(request={ + "email_address": "user@example.com", + "public_metadata": { - }, redirect_url="https://example.com/welcome", notify=True, ignore_existing=True, expires_in_days=486589) + }, + "redirect_url": "https://example.com/welcome", + "notify": True, + "ignore_existing": True, + "expires_in_days": 486589, + "template_slug": clerk_backend_api.TemplateSlug.WAITLIST_INVITATION, + }) assert res is not None @@ -40,15 +50,10 @@ with Clerk( ### Parameters -| Parameter | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `email_address` | *str* | :heavy_check_mark: | The email address the invitation will be sent to | user@example.com | -| `public_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata that will be attached to the newly created invitation.
The value of this property should be a well-formed JSON object.
Once the user accepts the invitation and signs up, these metadata will end up in the user's public metadata. | {} | -| `redirect_url` | *Optional[str]* | :heavy_minus_sign: | Optional URL which specifies where to redirect the user once they click the invitation link.
This is only required if you have implemented a [custom flow](https://clerk.com/docs/authentication/invitations#custom-flow) and you're not using Clerk Hosted Pages or Clerk Components. | https://example.com/welcome | -| `notify` | *OptionalNullable[bool]* | :heavy_minus_sign: | Optional flag which denotes whether an email invitation should be sent to the given email address.
Defaults to true. | true | -| `ignore_existing` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether an invitation should be created if there is already an existing invitation for this email address, or it's claimed by another user. | ​false | -| `expires_in_days` | *OptionalNullable[int]* | :heavy_minus_sign: | The number of days the invitation will be valid for. By default, the invitation does not expire. | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `request` | [models.CreateInvitationRequestBody](../../models/createinvitationrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -75,7 +80,7 @@ with Clerk( bearer_auth="", ) as clerk: - res = clerk.invitations.list(limit=20, offset=10, status=clerk_backend_api.ListInvitationsQueryParamStatus.PENDING) + res = clerk.invitations.list(limit=20, offset=10, status=clerk_backend_api.ListInvitationsQueryParamStatus.PENDING, query="") assert res is not None @@ -91,6 +96,7 @@ with Clerk( | `limit` | *Optional[int]* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | 20 | | `offset` | *Optional[int]* | :heavy_minus_sign: | Skip the first `offset` results when paginating.
Needs to be an integer greater or equal to zero.
To be used in conjunction with `limit`. | 10 | | `status` | [Optional[models.ListInvitationsQueryParamStatus]](../../models/listinvitationsqueryparamstatus.md) | :heavy_minus_sign: | Filter invitations based on their status | pending | +| `query` | *Optional[str]* | :heavy_minus_sign: | Filter invitations based on their `email_address` or `id` | | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -103,6 +109,70 @@ with Clerk( | --------------- | --------------- | --------------- | | models.SDKError | 4XX, 5XX | \*/\* | +## create_bulk_invitations + +Use this API operation to create multiple invitations for the provided email addresses. You can choose to send the +invitations as emails by setting the `notify` parameter to `true`. There cannot be an existing invitation for any +of the email addresses you provide unless you set `ignore_existing` to `true` for specific email addresses. Please +note that there must be no existing user for any of the email addresses you provide, and this rule cannot be bypassed. + +### Example Usage + +```python +from clerk_backend_api import Clerk + +with Clerk( + bearer_auth="", +) as clerk: + + res = clerk.invitations.create_bulk_invitations(request=[ + { + "email_address": "Jeff_Schiller50@gmail.com", + "public_metadata": { + "key": "", + }, + "redirect_url": "https://dreary-advancement.net/", + "notify": True, + "ignore_existing": False, + "expires_in_days": 123536, + }, + { + "email_address": "Pierce13@hotmail.com", + "public_metadata": { + "key": "", + }, + "redirect_url": "https://shrill-jet.net/", + "notify": True, + "ignore_existing": False, + "expires_in_days": 665767, + }, + ]) + + assert res is not None + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [List[models.RequestBody]](../../models/.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[List[models.Invitation]](../../models/.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 400, 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + ## revoke Revokes the given invitation. diff --git a/docs/sdks/jwks/README.md b/docs/sdks/jwkssdk/README.md similarity index 95% rename from docs/sdks/jwks/README.md rename to docs/sdks/jwkssdk/README.md index 6425ff4..97ebf03 100644 --- a/docs/sdks/jwks/README.md +++ b/docs/sdks/jwkssdk/README.md @@ -1,4 +1,4 @@ -# Jwks +# JwksSDK (*jwks*) ## Overview @@ -37,7 +37,7 @@ with Clerk( ### Response -**[models.WellKnownJWKS](../../models/wellknownjwks.md)** +**[models.Jwks](../../models/jwks.md)** ### Errors diff --git a/docs/sdks/jwttemplates/README.md b/docs/sdks/jwttemplates/README.md index 18657e4..afab050 100644 --- a/docs/sdks/jwttemplates/README.md +++ b/docs/sdks/jwttemplates/README.md @@ -150,7 +150,7 @@ with Clerk( bearer_auth="", ) as clerk: - res = clerk.jwt_templates.update(template_id="", name="", claims={}, lifetime=8574.77, allowed_clock_skew=5971.29, custom_signing_key=True, signing_algorithm="", signing_key="") + res = clerk.jwt_templates.update(template_id="", name="", claims={}, lifetime=8574.78, allowed_clock_skew=5971.29, custom_signing_key=True, signing_algorithm="", signing_key="") assert res is not None diff --git a/docs/sdks/oauthapplicationssdk/README.md b/docs/sdks/oauthapplicationssdk/README.md index a501f43..efafc5a 100644 --- a/docs/sdks/oauthapplicationssdk/README.md +++ b/docs/sdks/oauthapplicationssdk/README.md @@ -71,7 +71,12 @@ with Clerk( bearer_auth="", ) as clerk: - res = clerk.oauth_applications.create(name="Example App", callback_url="https://example.com/oauth/callback", scopes="profile email public_metadata", public=True) + res = clerk.oauth_applications.create(request={ + "name": "Example App", + "callback_url": "https://example.com/oauth/callback", + "scopes": "profile email public_metadata", + "public": True, + }) assert res is not None @@ -82,13 +87,10 @@ with Clerk( ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `name` | *str* | :heavy_check_mark: | The name of the new OAuth application | Example App | -| `callback_url` | *str* | :heavy_check_mark: | The callback URL of the new OAuth application | https://example.com/oauth/callback | -| `scopes` | *Optional[str]* | :heavy_minus_sign: | Define the allowed scopes for the new OAuth applications that dictate the user payload of the OAuth user info endpoint. Available scopes are `profile`, `email`, `public_metadata`, `private_metadata`. Provide the requested scopes as a string, separated by spaces. | profile email public_metadata | -| `public` | *Optional[bool]* | :heavy_minus_sign: | If true, this client is public and cannot securely store a client secret.
Only the authorization code flow with proof key for code exchange (PKCE) may be used.
Public clients cannot be updated to be confidential clients, and vice versa. | true | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `request` | [models.CreateOAuthApplicationRequestBody](../../models/createoauthapplicationrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/organizationinvitationssdk/README.md b/docs/sdks/organizationinvitationssdk/README.md index e9b1532..3471e58 100644 --- a/docs/sdks/organizationinvitationssdk/README.md +++ b/docs/sdks/organizationinvitationssdk/README.md @@ -60,7 +60,8 @@ with Clerk( | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 400, 404, 422, 500 | application/json | +| models.ClerkErrors | 400, 404, 422 | application/json | +| models.ClerkErrors | 500 | application/json | | models.SDKError | 4XX, 5XX | \*/\* | ## create @@ -95,7 +96,7 @@ with Clerk( "key": "value", }, private_metadata={ "private_key": "secret_value", - }, redirect_url="https://example.com/welcome") + }, redirect_url="https://example.com/welcome", expires_in_days=486589) assert res is not None @@ -106,16 +107,17 @@ with Clerk( ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization for which to send the invitation | org_12345 | -| `email_address` | *str* | :heavy_check_mark: | The email address of the new member that is going to be invited to the organization | user@example.com | -| `role` | *str* | :heavy_check_mark: | The role of the new member in the organization | admin | -| `inviter_user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the user that invites the new member to the organization.
Must be an administrator in the organization. | user_67890 | -| `public_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. | {
"key": "value"
} | -| `private_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. | {
"private_key": "secret_value"
} | -| `redirect_url` | *Optional[str]* | :heavy_minus_sign: | Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email. | https://example.com/welcome | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization for which to send the invitation | org_12345 | +| `email_address` | *str* | :heavy_check_mark: | The email address of the new member that is going to be invited to the organization | user@example.com | +| `role` | *str* | :heavy_check_mark: | The role of the new member in the organization | admin | +| `inviter_user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the user that invites the new member to the organization.
Must be an administrator in the organization. | user_67890 | +| `public_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API.
When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. | {
"key": "value"
} | +| `private_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API.
When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. | {
"private_key": "secret_value"
} | +| `redirect_url` | *Optional[str]* | :heavy_minus_sign: | Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email. | https://example.com/welcome | +| `expires_in_days` | *OptionalNullable[int]* | :heavy_minus_sign: | The number of days the invitation will be valid for. By default, the invitation has a 30 days expire. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -203,18 +205,7 @@ with Clerk( ) as clerk: res = clerk.organization_invitations.bulk_create(organization_id="org_12345", request_body=[ - { - "email_address": "newmember@example.com", - "role": "admin", - "inviter_user_id": "user_67890", - "public_metadata": { - - }, - "private_metadata": { - - }, - "redirect_url": "https://example.com/welcome", - }, + ]) assert res is not None @@ -226,11 +217,11 @@ with Clerk( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `organization_id` | *str* | :heavy_check_mark: | The organization ID. | org_12345 | -| `request_body` | List[[models.RequestBody](../../models/requestbody.md)] | :heavy_check_mark: | N/A | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | *str* | :heavy_check_mark: | The organization ID. | org_12345 | +| `request_body` | List[[models.CreateOrganizationInvitationBulkRequestBody](../../models/createorganizationinvitationbulkrequestbody.md)] | :heavy_check_mark: | N/A | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/docs/sdks/organizationmembershipssdk/README.md b/docs/sdks/organizationmembershipssdk/README.md index f75a74a..579c37a 100644 --- a/docs/sdks/organizationmembershipssdk/README.md +++ b/docs/sdks/organizationmembershipssdk/README.md @@ -136,7 +136,7 @@ with Clerk( | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 400, 404, 422 | application/json | +| models.ClerkErrors | 404, 422 | application/json | | models.SDKError | 4XX, 5XX | \*/\* | ## delete @@ -177,7 +177,7 @@ with Clerk( | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 400, 401, 404 | application/json | +| models.ClerkErrors | 401, 404 | application/json | | models.SDKError | 4XX, 5XX | \*/\* | ## update_metadata @@ -268,5 +268,6 @@ with Clerk( | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 400, 401, 422, 500 | application/json | +| models.ClerkErrors | 400, 401, 422 | application/json | +| models.ClerkErrors | 500 | application/json | | models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/organizationssdk/README.md b/docs/sdks/organizationssdk/README.md index ff88496..98a6cee 100644 --- a/docs/sdks/organizationssdk/README.md +++ b/docs/sdks/organizationssdk/README.md @@ -67,7 +67,6 @@ with Clerk( ## create Creates a new organization with the given name for an instance. -In order to successfully create an organization you need to provide the ID of the User who will become the organization administrator. You can specify an optional slug for the new organization. If provided, the organization slug can contain only lowercase alphanumeric characters (letters and digits) and the dash "-". Organization slugs must be unique for the instance. @@ -87,11 +86,19 @@ with Clerk( bearer_auth="", ) as clerk: - res = clerk.organizations.create(name="NewOrg", created_by="user_123", private_metadata={ - "internal_code": "ABC123", - }, public_metadata={ - "public_event": "Annual Summit", - }, slug="neworg", max_allowed_memberships=100, created_at="") + res = clerk.organizations.create(request={ + "name": "NewOrg", + "created_by": "user_123", + "private_metadata": { + "internal_code": "ABC123", + }, + "public_metadata": { + "public_event": "Annual Summit", + }, + "slug": "neworg", + "max_allowed_memberships": 100, + "created_at": "1721474962525", + }) assert res is not None @@ -102,16 +109,10 @@ with Clerk( ### Parameters -| Parameter | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -| `name` | *str* | :heavy_check_mark: | The name of the new organization.
May not contain URLs or HTML. | NewOrg | -| `created_by` | *str* | :heavy_check_mark: | The ID of the User who will become the administrator for the new organization | user_123 | -| `private_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata saved on the organization, accessible only from the Backend API | {
"internal_code": "ABC123"
} | -| `public_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata saved on the organization, read-only from the Frontend API and fully accessible (read/write) from the Backend API | {
"public_event": "Annual Summit"
} | -| `slug` | *Optional[str]* | :heavy_minus_sign: | A slug for the new organization.
Can contain only lowercase alphanumeric characters and the dash "-".
Must be unique for the instance. | neworg | -| `max_allowed_memberships` | *Optional[int]* | :heavy_minus_sign: | The maximum number of memberships allowed for this organization | 100 | -| `created_at` | *Optional[str]* | :heavy_minus_sign: | A custom date/time denoting _when_ the organization was created, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `request` | [models.CreateOrganizationRequestBody](../../models/createorganizationrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -182,8 +183,9 @@ with Clerk( }, private_metadata={ - }, name="New Organization Name", slug="new-org-slug", max_allowed_memberships=100, admin_delete_enabled=True, created_at="", additional_properties={ - + }, name="New Organization Name", slug="new-org-slug", max_allowed_memberships=100, admin_delete_enabled=True, created_at="1733171278360", additional_properties={ + "key": "", + "key1": "", }) assert res is not None @@ -282,7 +284,9 @@ with Clerk( }, private_metadata={ "internal_use_only": "Future plans discussion.", }, additional_properties={ - + "key": "", + "key1": "", + "key2": "", }) assert res is not None diff --git a/docs/sdks/samlconnectionssdk/README.md b/docs/sdks/samlconnectionssdk/README.md index 26631c8..512dbaa 100644 --- a/docs/sdks/samlconnectionssdk/README.md +++ b/docs/sdks/samlconnectionssdk/README.md @@ -26,7 +26,11 @@ with Clerk( bearer_auth="", ) as clerk: - res = clerk.saml_connections.list(limit=20, offset=10) + res = clerk.saml_connections.list(limit=20, offset=10, organization_id=[ + "", + "", + "", + ]) assert res is not None @@ -37,11 +41,12 @@ with Clerk( ### Parameters -| Parameter | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| `limit` | *Optional[int]* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | 20 | -| `offset` | *Optional[int]* | :heavy_minus_sign: | Skip the first `offset` results when paginating.
Needs to be an integer greater or equal to zero.
To be used in conjunction with `limit`. | 10 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | 20 | +| `offset` | *Optional[int]* | :heavy_minus_sign: | Skip the first `offset` results when paginating.
Needs to be an integer greater or equal to zero.
To be used in conjunction with `limit`. | 10 | +| `organization_id` | List[*str*] | :heavy_minus_sign: | Returns SAML connections that have an associated organization ID to the
given organizations.
For each organization id, the `+` and `-` can be
prepended to the id, which denote whether the
respective organization should be included or
excluded from the result set.
Accepts up to 100 organization ids. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -68,11 +73,22 @@ with Clerk( bearer_auth="", ) as clerk: - res = clerk.saml_connections.create(name="My SAML Connection", domain="example.org", provider=clerk_backend_api.Provider.SAML_CUSTOM, idp_entity_id="http://idp.example.org/", idp_sso_url="http://idp.example.org/sso", idp_certificate="MIIDdzCCAl+gAwIBAgIJAKcyBaiiz+DT...", idp_metadata_url="http://idp.example.org/metadata.xml", idp_metadata="", + "attribute_mapping": { + "user_id": "nameid", + "email_address": "mail", + "first_name": "givenName", + "last_name": "surname", + }, }) assert res is not None @@ -84,18 +100,10 @@ with Clerk( ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -| `name` | *str* | :heavy_check_mark: | The name to use as a label for this SAML Connection | My SAML Connection | -| `domain` | *str* | :heavy_check_mark: | The domain of your organization. Sign in flows using an email with this domain, will use this SAML Connection. | example.org | -| `provider` | [models.Provider](../../models/provider.md) | :heavy_check_mark: | The IdP provider of the connection. | saml_custom | -| `idp_entity_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The Entity ID as provided by the IdP | http://idp.example.org/ | -| `idp_sso_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The Single-Sign On URL as provided by the IdP | http://idp.example.org/sso | -| `idp_certificate` | *OptionalNullable[str]* | :heavy_minus_sign: | The X.509 certificate as provided by the IdP | MIIDdzCCAl+gAwIBAgIJAKcyBaiiz+DT... | -| `idp_metadata_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties | http://idp.example.org/metadata.xml | -| `idp_metadata` | *OptionalNullable[str]* | :heavy_minus_sign: | The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties | ... | +| `organization_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the organization to which users of this SAML Connection will be added | | | `attribute_mapping` | [OptionalNullable[models.UpdateSAMLConnectionAttributeMapping]](../../models/updatesamlconnectionattributemapping.md) | :heavy_minus_sign: | Define the atrtibute name mapping between Identity Provider and Clerk's user properties | | | `active` | *OptionalNullable[bool]* | :heavy_minus_sign: | Activate or de-activate the SAML Connection | true | | `sync_user_attributes` | *OptionalNullable[bool]* | :heavy_minus_sign: | Controls whether to update the user's attributes in each sign-in | false | diff --git a/docs/sdks/sessions/README.md b/docs/sdks/sessions/README.md index 36b3e78..97d2d13 100644 --- a/docs/sdks/sessions/README.md +++ b/docs/sdks/sessions/README.md @@ -11,9 +11,11 @@ Sessions are created when a user successfully goes through the sign in or sign u ### Available Operations * [list](#list) - List all sessions +* [create_session](#create_session) - Create a new active session * [get](#get) - Retrieve a session * [revoke](#revoke) - Revoke a session * [~~verify~~](#verify) - Verify a session :warning: **Deprecated** +* [create_session_token](#create_session_token) - Create a session token * [create_token_from_template](#create_token_from_template) - Create a session token from a jwt template ## list @@ -64,6 +66,50 @@ with Clerk( | models.ClerkErrors | 400, 401, 422 | application/json | | models.SDKError | 4XX, 5XX | \*/\* | +## create_session + +Create a new active session for the provided user ID. + +This operation is only available for Clerk Development instances. + +### Example Usage + +```python +from clerk_backend_api import Clerk + +with Clerk( + bearer_auth="", +) as clerk: + + res = clerk.sessions.create_session(request={ + "user_id": "", + }) + + assert res is not None + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `request` | [models.CreateSessionRequestBody](../../models/createsessionrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.Session](../../models/session.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 400, 401, 404, 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + ## get Retrieve the details of a session @@ -191,6 +237,47 @@ with Clerk( | models.ClerkErrors | 400, 401, 404, 410 | application/json | | models.SDKError | 4XX, 5XX | \*/\* | +## create_session_token + +Creates a session JSON Web Token (JWT) based on a session. + +### Example Usage + +```python +from clerk_backend_api import Clerk + +with Clerk( + bearer_auth="", +) as clerk: + + res = clerk.sessions.create_session_token(session_id="", expires_in_seconds=6005.84) + + assert res is not None + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `session_id` | *str* | :heavy_check_mark: | The ID of the session | +| `expires_in_seconds` | *OptionalNullable[float]* | :heavy_minus_sign: | Use this parameter to override the default session token lifetime. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.CreateSessionTokenResponseBody](../../models/createsessiontokenresponsebody.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 401, 404 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + ## create_token_from_template Creates a JSON Web Token(JWT) based on a session and a JWT Template name defined for your instance @@ -204,7 +291,7 @@ with Clerk( bearer_auth="", ) as clerk: - res = clerk.sessions.create_token_from_template(session_id="ses_123abcd4567", template_name="custom_hasura") + res = clerk.sessions.create_token_from_template(session_id="ses_123abcd4567", template_name="custom_hasura", expires_in_seconds=2299.84) assert res is not None @@ -219,6 +306,7 @@ with Clerk( | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | | `session_id` | *str* | :heavy_check_mark: | The ID of the session | ses_123abcd4567 | | `template_name` | *str* | :heavy_check_mark: | The name of the JWT Template defined in your instance (e.g. `custom_hasura`). | custom_hasura | +| `expires_in_seconds` | *OptionalNullable[float]* | :heavy_minus_sign: | Use this parameter to override the JWT token lifetime. | | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/docs/sdks/testingtokens/README.md b/docs/sdks/testingtokens/README.md index 9ba3449..521153a 100644 --- a/docs/sdks/testingtokens/README.md +++ b/docs/sdks/testingtokens/README.md @@ -9,7 +9,7 @@ ## create -Retrieve a new testing token. Only available for development instances. +Retrieve a new testing token. ### Example Usage diff --git a/docs/sdks/users/README.md b/docs/sdks/users/README.md index 5748aa1..e44bcda 100644 --- a/docs/sdks/users/README.md +++ b/docs/sdks/users/README.md @@ -62,7 +62,7 @@ with Clerk( "user-id-123", ], organization_id=[ "org-id-123", - ], query="John", last_active_at_since=1700690400000, limit=20, offset=10, order_by="-created_at") + ], query="John", email_address_query="", phone_number_query="", username_query="", name_query="", last_active_at_before=1700690400000, last_active_at_after=1700690400000, last_active_at_since=1700690400000, created_at_before=1730160000000, created_at_after=1730160000000, limit=20, offset=10, order_by="-created_at") assert res is not None @@ -83,7 +83,15 @@ with Clerk( | `user_id` | List[*str*] | :heavy_minus_sign: | Returns users with the user ids specified.
For each user id, the `+` and `-` can be
prepended to the id, which denote whether the
respective user id should be included or
excluded from the result set.
Accepts up to 100 user ids.
Any user ids not found are ignored. | [
"user-id-123"
] | | `organization_id` | List[*str*] | :heavy_minus_sign: | Returns users that have memberships to the
given organizations.
For each organization id, the `+` and `-` can be
prepended to the id, which denote whether the
respective organization should be included or
excluded from the result set.
Accepts up to 100 organization ids. | [
"org-id-123"
] | | `query` | *Optional[str]* | :heavy_minus_sign: | Returns users that match the given query.
For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names.
The query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well. | John | -| `last_active_at_since` | *Optional[int]* | :heavy_minus_sign: | Returns users that had session activity since the given date, with day precision.
Providing a value with higher precision than day will result in an error.
Example: use 1700690400000 to retrieve users that had session activity from 2023-11-23 until the current day. | 1700690400000 | +| `email_address_query` | *Optional[str]* | :heavy_minus_sign: | Returns users with emails that match the given query, via case-insensitive partial match.
For example, `email_address_query=ello` will match a user with the email `HELLO@example.com`. | | +| `phone_number_query` | *Optional[str]* | :heavy_minus_sign: | Returns users with phone numbers that match the given query, via case-insensitive partial match.
For example, `phone_number_query=555` will match a user with the phone number `+1555xxxxxxx`. | | +| `username_query` | *Optional[str]* | :heavy_minus_sign: | Returns users with usernames that match the given query, via case-insensitive partial match.
For example, `username_query=CoolUser` will match a user with the username `SomeCoolUser`. | | +| `name_query` | *Optional[str]* | :heavy_minus_sign: | Returns users with names that match the given query, via case-insensitive partial match. | | +| `last_active_at_before` | *Optional[int]* | :heavy_minus_sign: | Returns users whose last session activity was before the given date (with millisecond precision).
Example: use 1700690400000 to retrieve users whose last session activity was before 2023-11-23. | 1700690400000 | +| `last_active_at_after` | *Optional[int]* | :heavy_minus_sign: | Returns users whose last session activity was after the given date (with millisecond precision).
Example: use 1700690400000 to retrieve users whose last session activity was after 2023-11-23. | 1700690400000 | +| `last_active_at_since` | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Returns users that had session activity since the given date.
Example: use 1700690400000 to retrieve users that had session activity from 2023-11-23 until the current day.
Deprecated in favor of `last_active_at_after`. | 1700690400000 | +| `created_at_before` | *Optional[int]* | :heavy_minus_sign: | Returns users who have been created before the given date (with millisecond precision).
Example: use 1730160000000 to retrieve users who have been created before 2024-10-29. | 1730160000000 | +| `created_at_after` | *Optional[int]* | :heavy_minus_sign: | Returns users who have been created after the given date (with millisecond precision).
Example: use 1730160000000 to retrieve users who have been created after 2024-10-29. | 1730160000000 | | `limit` | *Optional[int]* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | 20 | | `offset` | *Optional[int]* | :heavy_minus_sign: | Skip the first `offset` results when paginating.
Needs to be an integer greater or equal to zero.
To be used in conjunction with `limit`. | 10 | | `order_by` | *Optional[str]* | :heavy_minus_sign: | Allows to return users in a particular order.
At the moment, you can order the returned users by their `created_at`,`updated_at`,`email_address`,`web3wallet`,`first_name`,`last_name`,`phone_number`,`username`,`last_active_at`,`last_sign_in_at`.
In order to specify the direction, you can use the `+/-` symbols prepended in the property to order by.
For example, if you want users to be returned in descending order according to their `created_at` property, you can use `-created_at`.
If you don't use `+` or `-`, then `+` is implied. We only support one `order_by` parameter, and if multiple `order_by` parameters are provided, we will only keep the first one. For example,
if you pass `order_by=username&order_by=created_at`, we will consider only the first `order_by` parameter, which is `username`. The `created_at` parameter will be ignored in this case. | | @@ -135,7 +143,7 @@ with Clerk( "username": "johndoe123", "password": "Secure*Pass4", "password_digest": "$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc", - "password_hasher": "argon2i", + "password_hasher": "", "skip_password_checks": False, "skip_password_requirement": False, "totp_secret": "base32totpsecretkey", @@ -212,7 +220,7 @@ with Clerk( "0x123456789abcdef", ], user_id=[ "user-id-123", - ], query="John Doe") + ], query="John Doe", email_address_query="", phone_number_query="", username_query="") assert res is not None @@ -232,6 +240,9 @@ with Clerk( | `web3_wallet` | List[*str*] | :heavy_minus_sign: | Counts users with the specified web3 wallet addresses.
Accepts up to 100 web3 wallet addresses.
Any web3 wallet addressed not found are ignored. | [
"0x123456789abcdef"
] | | `user_id` | List[*str*] | :heavy_minus_sign: | Counts users with the user ids specified.
Accepts up to 100 user ids.
Any user ids not found are ignored. | [
"user-id-123"
] | | `query` | *Optional[str]* | :heavy_minus_sign: | Counts users that match the given query.
For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names.
The query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well. | John Doe | +| `email_address_query` | *Optional[str]* | :heavy_minus_sign: | Counts users with emails that match the given query, via case-insensitive partial match.
For example, `email_address_query=ello` will match a user with the email `HELLO@example.com`,
and will be included in the resulting count. | | +| `phone_number_query` | *Optional[str]* | :heavy_minus_sign: | Counts users with phone numbers that match the given query, via case-insensitive partial match.
For example, `phone_number_query=555` will match a user with the phone number `+1555xxxxxxx`,
and will be included in the resulting count. | | +| `username_query` | *Optional[str]* | :heavy_minus_sign: | Counts users with usernames that match the given query, via case-insensitive partial match.
For example, `username_query=CoolUser` will match a user with the username `SomeCoolUser`,
and will be included in the resulting count. | | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -309,7 +320,7 @@ with Clerk( bearer_auth="", ) as clerk: - res = clerk.users.update(user_id="usr_1", external_id="ext_123", first_name="Jane", last_name="Doe", primary_email_address_id="eml_12345", notify_primary_email_address_changed=True, primary_phone_number_id="phn_67890", primary_web3_wallet_id="wlt_123", username="janedoe", profile_image_id="img_789", password="secretPass123!", password_digest="$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc", password_hasher="argon2i", skip_password_checks=False, sign_out_of_other_sessions=True, totp_secret="ABCD1234EFGH5678", backup_codes=[ + res = clerk.users.update(user_id="usr_1", external_id="ext_123", first_name="Jane", last_name="Doe", primary_email_address_id="eml_12345", notify_primary_email_address_changed=True, primary_phone_number_id="phn_67890", primary_web3_wallet_id="wlt_123", username="janedoe", profile_image_id="img_789", password="secretPass123!", password_digest="$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc", password_hasher="", skip_password_checks=False, sign_out_of_other_sessions=True, totp_secret="ABCD1234EFGH5678", backup_codes=[ "123456", "654321", ], public_metadata={ @@ -682,9 +693,9 @@ with Clerk( }, private_metadata={ "key": "", "key1": "", + "key2": "", }, unsafe_metadata={ "key": "", - "key1": "", }) assert res is not None @@ -754,7 +765,7 @@ with Clerk( | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 400, 422 | application/json | +| models.ClerkErrors | 400, 404, 422 | application/json | | models.SDKError | 4XX, 5XX | \*/\* | ## get_organization_memberships @@ -966,7 +977,8 @@ with Clerk( | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 404, 500 | application/json | +| models.ClerkErrors | 404 | application/json | +| models.ClerkErrors | 500 | application/json | | models.SDKError | 4XX, 5XX | \*/\* | ## delete_backup_codes @@ -1006,7 +1018,8 @@ with Clerk( | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 404, 500 | application/json | +| models.ClerkErrors | 404 | application/json | +| models.ClerkErrors | 500 | application/json | | models.SDKError | 4XX, 5XX | \*/\* | ## delete_passkey @@ -1047,7 +1060,8 @@ with Clerk( | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 403, 404, 500 | application/json | +| models.ClerkErrors | 403, 404 | application/json | +| models.ClerkErrors | 500 | application/json | | models.SDKError | 4XX, 5XX | \*/\* | ## delete_web3_wallet @@ -1088,7 +1102,8 @@ with Clerk( | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 400, 403, 404, 500 | application/json | +| models.ClerkErrors | 400, 403, 404 | application/json | +| models.ClerkErrors | 500 | application/json | | models.SDKError | 4XX, 5XX | \*/\* | ## create_totp @@ -1129,7 +1144,8 @@ with Clerk( | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 403, 404, 500 | application/json | +| models.ClerkErrors | 403, 404 | application/json | +| models.ClerkErrors | 500 | application/json | | models.SDKError | 4XX, 5XX | \*/\* | ## delete_totp @@ -1169,7 +1185,8 @@ with Clerk( | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 404, 500 | application/json | +| models.ClerkErrors | 404 | application/json | +| models.ClerkErrors | 500 | application/json | | models.SDKError | 4XX, 5XX | \*/\* | ## delete_external_account @@ -1210,5 +1227,6 @@ with Clerk( | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 400, 403, 404, 500 | application/json | +| models.ClerkErrors | 400, 403, 404 | application/json | +| models.ClerkErrors | 500 | application/json | | models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/waitlistentriessdk/README.md b/docs/sdks/waitlistentriessdk/README.md new file mode 100644 index 0000000..67adefb --- /dev/null +++ b/docs/sdks/waitlistentriessdk/README.md @@ -0,0 +1,99 @@ +# WaitlistEntriesSDK +(*waitlist_entries*) + +## Overview + +### Available Operations + +* [list_waitlist_entries](#list_waitlist_entries) - List all waitlist entries +* [create_waitlist_entry](#create_waitlist_entry) - Create a waitlist entry + +## list_waitlist_entries + +Retrieve a list of waitlist entries for the instance. +Entries are ordered by creation date in descending order by default. +Supports filtering by email address or status and pagination with limit and offset parameters. + +### Example Usage + +```python +import clerk_backend_api +from clerk_backend_api import Clerk + +with Clerk( + bearer_auth="", +) as clerk: + + res = clerk.waitlist_entries.list_waitlist_entries(limit=20, offset=10, query="", status=clerk_backend_api.ListWaitlistEntriesQueryParamStatus.COMPLETED, order_by="-created_at") + + assert res is not None + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | 20 | +| `offset` | *Optional[int]* | :heavy_minus_sign: | Skip the first `offset` results when paginating.
Needs to be an integer greater or equal to zero.
To be used in conjunction with `limit`. | 10 | +| `query` | *Optional[str]* | :heavy_minus_sign: | Filter waitlist entries by email address | | +| `status` | [Optional[models.ListWaitlistEntriesQueryParamStatus]](../../models/listwaitlistentriesqueryparamstatus.md) | :heavy_minus_sign: | Filter waitlist entries by their status | | +| `order_by` | *Optional[str]* | :heavy_minus_sign: | Specify the order of results. Supported values are:
- `created_at`
- `email_address`
- `invited_at`

Use `+` for ascending or `-` for descending order. Defaults to `-created_at`. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.WaitlistEntries](../../models/waitlistentries.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| models.SDKError | 4XX, 5XX | \*/\* | + +## create_waitlist_entry + +Creates a new waitlist entry for the given email address. +If the email address is already on the waitlist, no new entry will be created and the existing waitlist entry will be returned. + +### Example Usage + +```python +from clerk_backend_api import Clerk + +with Clerk( + bearer_auth="", +) as clerk: + + res = clerk.waitlist_entries.create_waitlist_entry(request={ + "email_address": "Demond_Willms@hotmail.com", + "notify": True, + }) + + assert res is not None + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `request` | [models.CreateWaitlistEntryRequestBody](../../models/createwaitlistentryrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.WaitlistEntry](../../models/waitlistentry.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 400, 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/poetry.lock b/poetry.lock index d9deceb..827352c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.0.1 and should not be changed by hand. [[package]] name = "annotated-types" @@ -6,20 +6,19 @@ version = "0.7.0" description = "Reusable constraint types to use with typing.Annotated" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, ] -[package.dependencies] -typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} - [[package]] name = "anyio" version = "4.5.0" description = "High level compatibility layer for multiple asynchronous event loop implementations" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "anyio-4.5.0-py3-none-any.whl", hash = "sha256:fdeb095b7cc5a5563175eedd926ec4ae55413bb4be5770c424af0ba46ccb4a78"}, {file = "anyio-4.5.0.tar.gz", hash = "sha256:c5a275fe5ca0afd788001f58fca1e69e29ce706d746e317d660e21f70c530ef9"}, @@ -42,6 +41,7 @@ version = "3.2.4" description = "An abstract syntax tree for Python with inference support." optional = false python-versions = ">=3.8.0" +groups = ["dev"] files = [ {file = "astroid-3.2.4-py3-none-any.whl", hash = "sha256:413658a61eeca6202a59231abb473f932038fbcbf1666587f66d482083413a25"}, {file = "astroid-3.2.4.tar.gz", hash = "sha256:0e14202810b30da1b735827f78f5157be2bbd4a7a59b7707ca0bfc2fb4c0063a"}, @@ -56,6 +56,7 @@ version = "2024.8.30" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" +groups = ["main"] files = [ {file = "certifi-2024.8.30-py3-none-any.whl", hash = "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8"}, {file = "certifi-2024.8.30.tar.gz", hash = "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9"}, @@ -67,6 +68,8 @@ version = "1.17.1" description = "Foreign Function Interface for Python calling C code." optional = false python-versions = ">=3.8" +groups = ["main"] +markers = "platform_python_implementation != \"PyPy\"" files = [ {file = "cffi-1.17.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:df8b1c11f177bc2313ec4b2d46baec87a5f3e71fc8b45dab2ee7cae86d9aba14"}, {file = "cffi-1.17.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8f2cdc858323644ab277e9bb925ad72ae0e67f69e804f4898c070998d50b1a67"}, @@ -146,6 +149,8 @@ version = "0.4.6" description = "Cross-platform colored terminal text." optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +groups = ["dev"] +markers = "sys_platform == \"win32\"" files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, @@ -157,6 +162,7 @@ version = "43.0.1" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "cryptography-43.0.1-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:8385d98f6a3bf8bb2d65a73e17ed87a3ba84f6991c155691c51112075f9ffc5d"}, {file = "cryptography-43.0.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:27e613d7077ac613e399270253259d9d53872aaf657471473ebfc9a52935c062"}, @@ -206,6 +212,7 @@ version = "0.3.9" description = "serialize all of Python" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "dill-0.3.9-py3-none-any.whl", hash = "sha256:468dff3b89520b474c0397703366b7b95eebe6303f108adf9b19da1f702be87a"}, {file = "dill-0.3.9.tar.gz", hash = "sha256:81aa267dddf68cbfe8029c42ca9ec6a4ab3b22371d1c450abc54422577b4512c"}, @@ -221,6 +228,7 @@ version = "0.2.0" description = "Like `typing._eval_type`, but lets older Python versions use newer typing features." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "eval_type_backport-0.2.0-py3-none-any.whl", hash = "sha256:ac2f73d30d40c5a30a80b8739a789d6bb5e49fdffa66d7912667e2015d9c9933"}, {file = "eval_type_backport-0.2.0.tar.gz", hash = "sha256:68796cfbc7371ebf923f03bdf7bef415f3ec098aeced24e054b253a0e78f7b37"}, @@ -235,6 +243,8 @@ version = "1.2.2" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" +groups = ["main", "dev"] +markers = "python_version < \"3.11\"" files = [ {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, @@ -249,6 +259,7 @@ version = "0.14.0" description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, @@ -260,6 +271,7 @@ version = "1.0.6" description = "A minimal low-level HTTP client." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "httpcore-1.0.6-py3-none-any.whl", hash = "sha256:27b59625743b85577a8c0e10e55b50b5368a4f2cfe8cc7bcfa9cf00829c2682f"}, {file = "httpcore-1.0.6.tar.gz", hash = "sha256:73f6dbd6eb8c21bbf7ef8efad555481853f5f6acdeaff1edb0694289269ee17f"}, @@ -281,6 +293,7 @@ version = "0.28.1" description = "The next generation HTTP client." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"}, {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"}, @@ -305,6 +318,7 @@ version = "3.10" description = "Internationalized Domain Names in Applications (IDNA)" optional = false python-versions = ">=3.6" +groups = ["main"] files = [ {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, @@ -319,6 +333,7 @@ version = "2.0.0" description = "brain-dead simple config-ini parsing" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, @@ -330,6 +345,7 @@ version = "5.13.2" description = "A Python utility / library to sort Python imports." optional = false python-versions = ">=3.8.0" +groups = ["dev"] files = [ {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, @@ -344,6 +360,7 @@ version = "1.0.6" description = "A more powerful JSONPath implementation in modern python" optional = false python-versions = ">=3.6" +groups = ["main"] files = [ {file = "jsonpath-python-1.0.6.tar.gz", hash = "sha256:dd5be4a72d8a2995c3f583cf82bf3cd1a9544cfdabf2d22595b67aff07349666"}, {file = "jsonpath_python-1.0.6-py3-none-any.whl", hash = "sha256:1e3b78df579f5efc23565293612decee04214609208a2335884b3ee3f786b575"}, @@ -355,6 +372,7 @@ version = "0.7.0" description = "McCabe checker, plugin for flake8" optional = false python-versions = ">=3.6" +groups = ["dev"] files = [ {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, @@ -362,49 +380,56 @@ files = [ [[package]] name = "mypy" -version = "1.13.0" +version = "1.14.1" description = "Optional static typing for Python" optional = false python-versions = ">=3.8" -files = [ - {file = "mypy-1.13.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6607e0f1dd1fb7f0aca14d936d13fd19eba5e17e1cd2a14f808fa5f8f6d8f60a"}, - {file = "mypy-1.13.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8a21be69bd26fa81b1f80a61ee7ab05b076c674d9b18fb56239d72e21d9f4c80"}, - {file = "mypy-1.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7b2353a44d2179846a096e25691d54d59904559f4232519d420d64da6828a3a7"}, - {file = "mypy-1.13.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0730d1c6a2739d4511dc4253f8274cdd140c55c32dfb0a4cf8b7a43f40abfa6f"}, - {file = "mypy-1.13.0-cp310-cp310-win_amd64.whl", hash = "sha256:c5fc54dbb712ff5e5a0fca797e6e0aa25726c7e72c6a5850cfd2adbc1eb0a372"}, - {file = "mypy-1.13.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:581665e6f3a8a9078f28d5502f4c334c0c8d802ef55ea0e7276a6e409bc0d82d"}, - {file = "mypy-1.13.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3ddb5b9bf82e05cc9a627e84707b528e5c7caaa1c55c69e175abb15a761cec2d"}, - {file = "mypy-1.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:20c7ee0bc0d5a9595c46f38beb04201f2620065a93755704e141fcac9f59db2b"}, - {file = "mypy-1.13.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3790ded76f0b34bc9c8ba4def8f919dd6a46db0f5a6610fb994fe8efdd447f73"}, - {file = "mypy-1.13.0-cp311-cp311-win_amd64.whl", hash = "sha256:51f869f4b6b538229c1d1bcc1dd7d119817206e2bc54e8e374b3dfa202defcca"}, - {file = "mypy-1.13.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:5c7051a3461ae84dfb5dd15eff5094640c61c5f22257c8b766794e6dd85e72d5"}, - {file = "mypy-1.13.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:39bb21c69a5d6342f4ce526e4584bc5c197fd20a60d14a8624d8743fffb9472e"}, - {file = "mypy-1.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:164f28cb9d6367439031f4c81e84d3ccaa1e19232d9d05d37cb0bd880d3f93c2"}, - {file = "mypy-1.13.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a4c1bfcdbce96ff5d96fc9b08e3831acb30dc44ab02671eca5953eadad07d6d0"}, - {file = "mypy-1.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:a0affb3a79a256b4183ba09811e3577c5163ed06685e4d4b46429a271ba174d2"}, - {file = "mypy-1.13.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a7b44178c9760ce1a43f544e595d35ed61ac2c3de306599fa59b38a6048e1aa7"}, - {file = "mypy-1.13.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5d5092efb8516d08440e36626f0153b5006d4088c1d663d88bf79625af3d1d62"}, - {file = "mypy-1.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de2904956dac40ced10931ac967ae63c5089bd498542194b436eb097a9f77bc8"}, - {file = "mypy-1.13.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:7bfd8836970d33c2105562650656b6846149374dc8ed77d98424b40b09340ba7"}, - {file = "mypy-1.13.0-cp313-cp313-win_amd64.whl", hash = "sha256:9f73dba9ec77acb86457a8fc04b5239822df0c14a082564737833d2963677dbc"}, - {file = "mypy-1.13.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:100fac22ce82925f676a734af0db922ecfea991e1d7ec0ceb1e115ebe501301a"}, - {file = "mypy-1.13.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7bcb0bb7f42a978bb323a7c88f1081d1b5dee77ca86f4100735a6f541299d8fb"}, - {file = "mypy-1.13.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bde31fc887c213e223bbfc34328070996061b0833b0a4cfec53745ed61f3519b"}, - {file = "mypy-1.13.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:07de989f89786f62b937851295ed62e51774722e5444a27cecca993fc3f9cd74"}, - {file = "mypy-1.13.0-cp38-cp38-win_amd64.whl", hash = "sha256:4bde84334fbe19bad704b3f5b78c4abd35ff1026f8ba72b29de70dda0916beb6"}, - {file = "mypy-1.13.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0246bcb1b5de7f08f2826451abd947bf656945209b140d16ed317f65a17dc7dc"}, - {file = "mypy-1.13.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7f5b7deae912cf8b77e990b9280f170381fdfbddf61b4ef80927edd813163732"}, - {file = "mypy-1.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7029881ec6ffb8bc233a4fa364736789582c738217b133f1b55967115288a2bc"}, - {file = "mypy-1.13.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3e38b980e5681f28f033f3be86b099a247b13c491f14bb8b1e1e134d23bb599d"}, - {file = "mypy-1.13.0-cp39-cp39-win_amd64.whl", hash = "sha256:a6789be98a2017c912ae6ccb77ea553bbaf13d27605d2ca20a76dfbced631b24"}, - {file = "mypy-1.13.0-py3-none-any.whl", hash = "sha256:9c250883f9fd81d212e0952c92dbfcc96fc237f4b7c92f56ac81fd48460b3e5a"}, - {file = "mypy-1.13.0.tar.gz", hash = "sha256:0291a61b6fbf3e6673e3405cfcc0e7650bebc7939659fdca2702958038bd835e"}, +groups = ["dev"] +files = [ + {file = "mypy-1.14.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:52686e37cf13d559f668aa398dd7ddf1f92c5d613e4f8cb262be2fb4fedb0fcb"}, + {file = "mypy-1.14.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1fb545ca340537d4b45d3eecdb3def05e913299ca72c290326be19b3804b39c0"}, + {file = "mypy-1.14.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:90716d8b2d1f4cd503309788e51366f07c56635a3309b0f6a32547eaaa36a64d"}, + {file = "mypy-1.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2ae753f5c9fef278bcf12e1a564351764f2a6da579d4a81347e1d5a15819997b"}, + {file = "mypy-1.14.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:e0fe0f5feaafcb04505bcf439e991c6d8f1bf8b15f12b05feeed96e9e7bf1427"}, + {file = "mypy-1.14.1-cp310-cp310-win_amd64.whl", hash = "sha256:7d54bd85b925e501c555a3227f3ec0cfc54ee8b6930bd6141ec872d1c572f81f"}, + {file = "mypy-1.14.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f995e511de847791c3b11ed90084a7a0aafdc074ab88c5a9711622fe4751138c"}, + {file = "mypy-1.14.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d64169ec3b8461311f8ce2fd2eb5d33e2d0f2c7b49116259c51d0d96edee48d1"}, + {file = "mypy-1.14.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ba24549de7b89b6381b91fbc068d798192b1b5201987070319889e93038967a8"}, + {file = "mypy-1.14.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:183cf0a45457d28ff9d758730cd0210419ac27d4d3f285beda038c9083363b1f"}, + {file = "mypy-1.14.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f2a0ecc86378f45347f586e4163d1769dd81c5a223d577fe351f26b179e148b1"}, + {file = "mypy-1.14.1-cp311-cp311-win_amd64.whl", hash = "sha256:ad3301ebebec9e8ee7135d8e3109ca76c23752bac1e717bc84cd3836b4bf3eae"}, + {file = "mypy-1.14.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:30ff5ef8519bbc2e18b3b54521ec319513a26f1bba19a7582e7b1f58a6e69f14"}, + {file = "mypy-1.14.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:cb9f255c18052343c70234907e2e532bc7e55a62565d64536dbc7706a20b78b9"}, + {file = "mypy-1.14.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8b4e3413e0bddea671012b063e27591b953d653209e7a4fa5e48759cda77ca11"}, + {file = "mypy-1.14.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:553c293b1fbdebb6c3c4030589dab9fafb6dfa768995a453d8a5d3b23784af2e"}, + {file = "mypy-1.14.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fad79bfe3b65fe6a1efaed97b445c3d37f7be9fdc348bdb2d7cac75579607c89"}, + {file = "mypy-1.14.1-cp312-cp312-win_amd64.whl", hash = "sha256:8fa2220e54d2946e94ab6dbb3ba0a992795bd68b16dc852db33028df2b00191b"}, + {file = "mypy-1.14.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:92c3ed5afb06c3a8e188cb5da4984cab9ec9a77ba956ee419c68a388b4595255"}, + {file = "mypy-1.14.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:dbec574648b3e25f43d23577309b16534431db4ddc09fda50841f1e34e64ed34"}, + {file = "mypy-1.14.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8c6d94b16d62eb3e947281aa7347d78236688e21081f11de976376cf010eb31a"}, + {file = "mypy-1.14.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d4b19b03fdf54f3c5b2fa474c56b4c13c9dbfb9a2db4370ede7ec11a2c5927d9"}, + {file = "mypy-1.14.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:0c911fde686394753fff899c409fd4e16e9b294c24bfd5e1ea4675deae1ac6fd"}, + {file = "mypy-1.14.1-cp313-cp313-win_amd64.whl", hash = "sha256:8b21525cb51671219f5307be85f7e646a153e5acc656e5cebf64bfa076c50107"}, + {file = "mypy-1.14.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:7084fb8f1128c76cd9cf68fe5971b37072598e7c31b2f9f95586b65c741a9d31"}, + {file = "mypy-1.14.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:8f845a00b4f420f693f870eaee5f3e2692fa84cc8514496114649cfa8fd5e2c6"}, + {file = "mypy-1.14.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:44bf464499f0e3a2d14d58b54674dee25c031703b2ffc35064bd0df2e0fac319"}, + {file = "mypy-1.14.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c99f27732c0b7dc847adb21c9d47ce57eb48fa33a17bc6d7d5c5e9f9e7ae5bac"}, + {file = "mypy-1.14.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:bce23c7377b43602baa0bd22ea3265c49b9ff0b76eb315d6c34721af4cdf1d9b"}, + {file = "mypy-1.14.1-cp38-cp38-win_amd64.whl", hash = "sha256:8edc07eeade7ebc771ff9cf6b211b9a7d93687ff892150cb5692e4f4272b0837"}, + {file = "mypy-1.14.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3888a1816d69f7ab92092f785a462944b3ca16d7c470d564165fe703b0970c35"}, + {file = "mypy-1.14.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:46c756a444117c43ee984bd055db99e498bc613a70bbbc120272bd13ca579fbc"}, + {file = "mypy-1.14.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:27fc248022907e72abfd8e22ab1f10e903915ff69961174784a3900a8cba9ad9"}, + {file = "mypy-1.14.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:499d6a72fb7e5de92218db961f1a66d5f11783f9ae549d214617edab5d4dbdbb"}, + {file = "mypy-1.14.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:57961db9795eb566dc1d1b4e9139ebc4c6b0cb6e7254ecde69d1552bf7613f60"}, + {file = "mypy-1.14.1-cp39-cp39-win_amd64.whl", hash = "sha256:07ba89fdcc9451f2ebb02853deb6aaaa3d2239a236669a63ab3801bbf923ef5c"}, + {file = "mypy-1.14.1-py3-none-any.whl", hash = "sha256:b66a60cc4073aeb8ae00057f9c1f64d49e90f918fbcef9a977eb121da8b8f1d1"}, + {file = "mypy-1.14.1.tar.gz", hash = "sha256:7ec88144fe9b510e8475ec2f5f251992690fcf89ccb4500b214b4226abcd32d6"}, ] [package.dependencies] -mypy-extensions = ">=1.0.0" +mypy_extensions = ">=1.0.0" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = ">=4.6.0" +typing_extensions = ">=4.6.0" [package.extras] dmypy = ["psutil (>=4.0)"] @@ -419,6 +444,7 @@ version = "1.0.0" description = "Type system extensions for programs checked with the mypy type checker." optional = false python-versions = ">=3.5" +groups = ["main", "dev"] files = [ {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, @@ -430,6 +456,7 @@ version = "24.1" description = "Core utilities for Python packages" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124"}, {file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"}, @@ -441,6 +468,7 @@ version = "4.3.6" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "platformdirs-4.3.6-py3-none-any.whl", hash = "sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb"}, {file = "platformdirs-4.3.6.tar.gz", hash = "sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907"}, @@ -457,6 +485,7 @@ version = "1.5.0" description = "plugin and hook calling mechanisms for python" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, @@ -472,6 +501,8 @@ version = "2.22" description = "C parser in Python" optional = false python-versions = ">=3.8" +groups = ["main"] +markers = "platform_python_implementation != \"PyPy\"" files = [ {file = "pycparser-2.22-py3-none-any.whl", hash = "sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc"}, {file = "pycparser-2.22.tar.gz", hash = "sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6"}, @@ -483,6 +514,7 @@ version = "2.10.3" description = "Data validation using Python type hints" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "pydantic-2.10.3-py3-none-any.whl", hash = "sha256:be04d85bbc7b65651c5f8e6b9976ed9c6f41782a55524cef079a34a0bb82144d"}, {file = "pydantic-2.10.3.tar.gz", hash = "sha256:cb5ac360ce894ceacd69c403187900a02c4b20b693a9dd1d643e1effab9eadf9"}, @@ -503,6 +535,7 @@ version = "2.27.1" description = "Core functionality for Pydantic validation and serialization" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "pydantic_core-2.27.1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:71a5e35c75c021aaf400ac048dacc855f000bdfed91614b4a726f7432f1f3d6a"}, {file = "pydantic_core-2.27.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f82d068a2d6ecfc6e054726080af69a6764a10015467d7d7b9f66d6ed5afa23b"}, @@ -615,6 +648,7 @@ version = "2.9.0" description = "JSON Web Token implementation in Python" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "PyJWT-2.9.0-py3-none-any.whl", hash = "sha256:3b02fb0f44517787776cf48f2ae25d8e14f300e6d7545a4315cee571a415e850"}, {file = "pyjwt-2.9.0.tar.gz", hash = "sha256:7e1e5b56cc735432a7369cbfa0efe50fa113ebecdc04ae6922deba8b84582d0c"}, @@ -632,6 +666,7 @@ version = "3.2.3" description = "python code static checker" optional = false python-versions = ">=3.8.0" +groups = ["dev"] files = [ {file = "pylint-3.2.3-py3-none-any.whl", hash = "sha256:b3d7d2708a3e04b4679e02d99e72329a8b7ee8afb8d04110682278781f889fa8"}, {file = "pylint-3.2.3.tar.gz", hash = "sha256:02f6c562b215582386068d52a30f520d84fdbcf2a95fc7e855b816060d048b60"}, @@ -662,6 +697,7 @@ version = "8.3.3" description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "pytest-8.3.3-py3-none-any.whl", hash = "sha256:a6853c7375b2663155079443d2e45de913a911a11d669df02a50814944db57b2"}, {file = "pytest-8.3.3.tar.gz", hash = "sha256:70b98107bd648308a7952b06e6ca9a50bc660be218d53c257cc1fc94fda10181"}, @@ -684,6 +720,7 @@ version = "2.8.2" description = "Extensions to the standard Python datetime module" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +groups = ["main"] files = [ {file = "python-dateutil-2.8.2.tar.gz", hash = "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"}, {file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"}, @@ -698,6 +735,7 @@ version = "1.16.0" description = "Python 2 and 3 compatibility utilities" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +groups = ["main"] files = [ {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, @@ -709,6 +747,7 @@ version = "1.3.1" description = "Sniff out which async library your code is running under" optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, @@ -720,6 +759,8 @@ version = "2.0.1" description = "A lil' TOML parser" optional = false python-versions = ">=3.7" +groups = ["dev"] +markers = "python_version < \"3.11\"" files = [ {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, @@ -731,6 +772,7 @@ version = "0.13.2" description = "Style preserving TOML library" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "tomlkit-0.13.2-py3-none-any.whl", hash = "sha256:7a974427f6e119197f670fbbbeae7bef749a6c14e793db934baefc1b5f03efde"}, {file = "tomlkit-0.13.2.tar.gz", hash = "sha256:fff5fe59a87295b278abd31bec92c15d9bc4a06885ab12bcea52c71119392e79"}, @@ -742,6 +784,7 @@ version = "2.9.0.20240906" description = "Typing stubs for python-dateutil" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "types-python-dateutil-2.9.0.20240906.tar.gz", hash = "sha256:9706c3b68284c25adffc47319ecc7947e5bb86b3773f843c73906fd598bc176e"}, {file = "types_python_dateutil-2.9.0.20240906-py3-none-any.whl", hash = "sha256:27c8cc2d058ccb14946eebcaaa503088f4f6dbc4fb6093d3d456a49aef2753f6"}, @@ -753,6 +796,7 @@ version = "4.12.2" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" +groups = ["main", "dev"] files = [ {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, @@ -764,6 +808,7 @@ version = "0.9.0" description = "Runtime inspection utilities for typing module." optional = false python-versions = "*" +groups = ["main"] files = [ {file = "typing_inspect-0.9.0-py3-none-any.whl", hash = "sha256:9ee6fc59062311ef8547596ab6b955e1b8aa46242d854bfc78f4f6b0eff35f9f"}, {file = "typing_inspect-0.9.0.tar.gz", hash = "sha256:b23fc42ff6f6ef6954e4852c1fb512cdd18dbea03134f91f856a95ccc9461f78"}, @@ -774,6 +819,6 @@ mypy-extensions = ">=0.3.0" typing-extensions = ">=3.7.4" [metadata] -lock-version = "2.0" -python-versions = "^3.8" -content-hash = "6c29ed30643f3990f280d30aba36d4e4ba66b6ed8bd1b21d835bbdba24c7f112" +lock-version = "2.1" +python-versions = ">=3.9" +content-hash = "0d796b7c7dea3f2a5a3325a8febeadfda27afc07d8be3aa409e6788fe61b528c" diff --git a/pylintrc b/pylintrc index 94f4492..310bbb2 100644 --- a/pylintrc +++ b/pylintrc @@ -89,7 +89,7 @@ persistent=yes # Minimum Python version to use for version dependent checks. Will default to # the version used to run pylint. -py-version=3.8 +py-version=3.9 # Discover python modules and packages in the file system subtree. recursive=no @@ -189,7 +189,8 @@ good-names=i, _, e, id, - n + n, + x # Good variable names regexes, separated by a comma. If names match any regex, # they will always be accepted diff --git a/pyproject.toml b/pyproject.toml index bb771c9..c16a9b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,22 @@ -[tool.poetry] +[project] name = "clerk-backend-api" -version = "1.6.0" +version = "1.7.0" description = "Python Client SDK for clerk.dev" -authors = ["Clerk",] +authors = [{ name = "Clerk" },] readme = "README-PYPI.md" +requires-python = ">=3.9" +dependencies = [ + "cryptography (>=43.0.1,<44.0.0)", + "eval-type-backport >=0.2.0", + "httpx >=0.28.1", + "jsonpath-python >=1.0.6", + "pydantic >=2.10.3", + "pyjwt (>=2.9.0,<3.0.0)", + "python-dateutil >=2.8.2", + "typing-inspect >=0.9.0", +] + +[tool.poetry] repository = "https://github.com/clerk/clerk-sdk-python.git" packages = [ { include = "clerk_backend_api", from = "src" } @@ -16,19 +29,8 @@ include = ["py.typed", "src/clerk_backend_api/py.typed"] [virtualenvs] in-project = true -[tool.poetry.dependencies] -python = "^3.8" -cryptography = "^43.0.1" -eval-type-backport = "^0.2.0" -httpx = "^0.28.1" -jsonpath-python = "^1.0.6" -pydantic = "~2.10.3" -pyjwt = "^2.9.0" -python-dateutil = "^2.8.2" -typing-inspect = "^0.9.0" - [tool.poetry.group.dev.dependencies] -mypy = "==1.13.0" +mypy = "==1.14.1" pylint = "==3.2.3" pytest = "^8.3.3" types-python-dateutil = "^2.9.0.20240316" diff --git a/src/clerk_backend_api/__init__.py b/src/clerk_backend_api/__init__.py index a1b7f62..dd02e42 100644 --- a/src/clerk_backend_api/__init__.py +++ b/src/clerk_backend_api/__init__.py @@ -1,9 +1,18 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from ._version import __title__, __version__ +from ._version import ( + __title__, + __version__, + __openapi_doc_version__, + __gen_version__, + __user_agent__, +) from .sdk import * from .sdkconfiguration import * from .models import * VERSION: str = __version__ +OPENAPI_DOC_VERSION = __openapi_doc_version__ +SPEAKEASY_GENERATOR_VERSION = __gen_version__ +USER_AGENT = __user_agent__ diff --git a/src/clerk_backend_api/_version.py b/src/clerk_backend_api/_version.py index 428d75a..dff2d36 100644 --- a/src/clerk_backend_api/_version.py +++ b/src/clerk_backend_api/_version.py @@ -3,7 +3,10 @@ import importlib.metadata __title__: str = "clerk-backend-api" -__version__: str = "1.6.0" +__version__: str = "1.7.0" +__openapi_doc_version__: str = "v1" +__gen_version__: str = "2.493.34" +__user_agent__: str = "speakeasy-sdk/python 1.7.0 2.493.34 v1 clerk-backend-api" try: if __package__ is not None: diff --git a/src/clerk_backend_api/actortokens.py b/src/clerk_backend_api/actortokens.py index 382053b..a196795 100644 --- a/src/clerk_backend_api/actortokens.py +++ b/src/clerk_backend_api/actortokens.py @@ -3,20 +3,20 @@ from .basesdk import BaseSDK from clerk_backend_api import models, utils from clerk_backend_api._hooks import HookContext -from clerk_backend_api.types import OptionalNullable, UNSET -from typing import Any, Mapping, Optional, Union +from clerk_backend_api.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Mapping, Optional, Union, cast class ActorTokens(BaseSDK): def create( self, *, - user_id: str, - actor: Union[ - models.CreateActorTokenActor, models.CreateActorTokenActorTypedDict - ], - expires_in_seconds: Optional[int] = 3600, - session_max_duration_in_seconds: Optional[int] = 1800, + request: Optional[ + Union[ + models.CreateActorTokenRequestBody, + models.CreateActorTokenRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -27,10 +27,7 @@ def create( Create an actor token that can be used to impersonate the given user. The `actor` parameter needs to include at least a \"sub\" key whose value is the ID of the actor (impersonating) user. - :param user_id: The ID of the user being impersonated. - :param actor: The actor payload. It needs to include a sub property which should contain the ID of the actor. This whole payload will be also included in the JWT session token. - :param expires_in_seconds: Optional parameter to specify the life duration of the actor token in seconds. By default, the duration is 1 hour. - :param session_max_duration_in_seconds: The maximum duration that the session which will be created by the generated actor token should last. By default, the duration of a session created via an actor token, lasts 30 minutes. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -44,12 +41,11 @@ def create( if server_url is not None: base_url = server_url - request = models.CreateActorTokenRequestBody( - user_id=user_id, - actor=utils.get_pydantic_model(actor, models.CreateActorTokenActor), - expires_in_seconds=expires_in_seconds, - session_max_duration_in_seconds=session_max_duration_in_seconds, - ) + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[models.CreateActorTokenRequestBody] + ) + request = cast(Optional[models.CreateActorTokenRequestBody], request) req = self._build_request( method="POST", @@ -57,7 +53,7 @@ def create( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -65,7 +61,11 @@ def create( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.CreateActorTokenRequestBody + request, + False, + True, + "json", + Optional[models.CreateActorTokenRequestBody], ), timeout_ms=timeout_ms, ) @@ -95,7 +95,12 @@ def create( if utils.match_response(http_res, ["400", "402", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -113,12 +118,12 @@ def create( async def create_async( self, *, - user_id: str, - actor: Union[ - models.CreateActorTokenActor, models.CreateActorTokenActorTypedDict - ], - expires_in_seconds: Optional[int] = 3600, - session_max_duration_in_seconds: Optional[int] = 1800, + request: Optional[ + Union[ + models.CreateActorTokenRequestBody, + models.CreateActorTokenRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -129,10 +134,7 @@ async def create_async( Create an actor token that can be used to impersonate the given user. The `actor` parameter needs to include at least a \"sub\" key whose value is the ID of the actor (impersonating) user. - :param user_id: The ID of the user being impersonated. - :param actor: The actor payload. It needs to include a sub property which should contain the ID of the actor. This whole payload will be also included in the JWT session token. - :param expires_in_seconds: Optional parameter to specify the life duration of the actor token in seconds. By default, the duration is 1 hour. - :param session_max_duration_in_seconds: The maximum duration that the session which will be created by the generated actor token should last. By default, the duration of a session created via an actor token, lasts 30 minutes. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -146,12 +148,11 @@ async def create_async( if server_url is not None: base_url = server_url - request = models.CreateActorTokenRequestBody( - user_id=user_id, - actor=utils.get_pydantic_model(actor, models.CreateActorTokenActor), - expires_in_seconds=expires_in_seconds, - session_max_duration_in_seconds=session_max_duration_in_seconds, - ) + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[models.CreateActorTokenRequestBody] + ) + request = cast(Optional[models.CreateActorTokenRequestBody], request) req = self._build_request_async( method="POST", @@ -159,7 +160,7 @@ async def create_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -167,7 +168,11 @@ async def create_async( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.CreateActorTokenRequestBody + request, + False, + True, + "json", + Optional[models.CreateActorTokenRequestBody], ), timeout_ms=timeout_ms, ) @@ -197,7 +202,12 @@ async def create_async( if utils.match_response(http_res, ["400", "402", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -284,7 +294,12 @@ def revoke( if utils.match_response(http_res, ["400", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -371,7 +386,12 @@ async def revoke_async( if utils.match_response(http_res, ["400", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/allowlistblocklist.py b/src/clerk_backend_api/allowlistblocklist.py index 4eef64a..30e5955 100644 --- a/src/clerk_backend_api/allowlistblocklist.py +++ b/src/clerk_backend_api/allowlistblocklist.py @@ -3,8 +3,8 @@ from .basesdk import BaseSDK from clerk_backend_api import models, utils from clerk_backend_api._hooks import HookContext -from clerk_backend_api.types import OptionalNullable, UNSET -from typing import Any, List, Mapping, Optional +from clerk_backend_api.types import BaseModel, OptionalNullable, UNSET +from typing import Any, List, Mapping, Optional, Union, cast class AllowlistBlocklist(BaseSDK): @@ -75,7 +75,12 @@ def list_allowlist_identifiers( if utils.match_response(http_res, ["401", "402"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -157,7 +162,12 @@ async def list_allowlist_identifiers_async( if utils.match_response(http_res, ["401", "402"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -175,8 +185,12 @@ async def list_allowlist_identifiers_async( def create_allowlist_identifier( self, *, - identifier: str, - notify: Optional[bool] = False, + request: Optional[ + Union[ + models.CreateAllowlistIdentifierRequestBody, + models.CreateAllowlistIdentifierRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -186,8 +200,7 @@ def create_allowlist_identifier( Create an identifier allowed to sign up to an instance - :param identifier: The identifier to be added in the allow-list. This can be an email address, a phone number or a web3 wallet. - :param notify: This flag denotes whether the given identifier will receive an invitation to join the application. Note that this only works for email address and phone number identifiers. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -201,10 +214,11 @@ def create_allowlist_identifier( if server_url is not None: base_url = server_url - request = models.CreateAllowlistIdentifierRequestBody( - identifier=identifier, - notify=notify, - ) + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[models.CreateAllowlistIdentifierRequestBody] + ) + request = cast(Optional[models.CreateAllowlistIdentifierRequestBody], request) req = self._build_request( method="POST", @@ -212,7 +226,7 @@ def create_allowlist_identifier( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -222,9 +236,9 @@ def create_allowlist_identifier( get_serialized_body=lambda: utils.serialize_request_body( request, False, - False, + True, "json", - models.CreateAllowlistIdentifierRequestBody, + Optional[models.CreateAllowlistIdentifierRequestBody], ), timeout_ms=timeout_ms, ) @@ -256,7 +270,12 @@ def create_allowlist_identifier( if utils.match_response(http_res, ["400", "402", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -274,8 +293,12 @@ def create_allowlist_identifier( async def create_allowlist_identifier_async( self, *, - identifier: str, - notify: Optional[bool] = False, + request: Optional[ + Union[ + models.CreateAllowlistIdentifierRequestBody, + models.CreateAllowlistIdentifierRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -285,8 +308,7 @@ async def create_allowlist_identifier_async( Create an identifier allowed to sign up to an instance - :param identifier: The identifier to be added in the allow-list. This can be an email address, a phone number or a web3 wallet. - :param notify: This flag denotes whether the given identifier will receive an invitation to join the application. Note that this only works for email address and phone number identifiers. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -300,10 +322,11 @@ async def create_allowlist_identifier_async( if server_url is not None: base_url = server_url - request = models.CreateAllowlistIdentifierRequestBody( - identifier=identifier, - notify=notify, - ) + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[models.CreateAllowlistIdentifierRequestBody] + ) + request = cast(Optional[models.CreateAllowlistIdentifierRequestBody], request) req = self._build_request_async( method="POST", @@ -311,7 +334,7 @@ async def create_allowlist_identifier_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -321,9 +344,9 @@ async def create_allowlist_identifier_async( get_serialized_body=lambda: utils.serialize_request_body( request, False, - False, + True, "json", - models.CreateAllowlistIdentifierRequestBody, + Optional[models.CreateAllowlistIdentifierRequestBody], ), timeout_ms=timeout_ms, ) @@ -355,7 +378,12 @@ async def create_allowlist_identifier_async( if utils.match_response(http_res, ["400", "402", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -373,7 +401,12 @@ async def create_allowlist_identifier_async( def create_blocklist_identifier( self, *, - identifier: str, + request: Optional[ + Union[ + models.CreateBlocklistIdentifierRequestBody, + models.CreateBlocklistIdentifierRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -383,7 +416,7 @@ def create_blocklist_identifier( Create an identifier that is blocked from accessing an instance - :param identifier: The identifier to be added in the block-list. This can be an email address, a phone number or a web3 wallet. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -397,9 +430,11 @@ def create_blocklist_identifier( if server_url is not None: base_url = server_url - request = models.CreateBlocklistIdentifierRequestBody( - identifier=identifier, - ) + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[models.CreateBlocklistIdentifierRequestBody] + ) + request = cast(Optional[models.CreateBlocklistIdentifierRequestBody], request) req = self._build_request( method="POST", @@ -407,7 +442,7 @@ def create_blocklist_identifier( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -417,9 +452,9 @@ def create_blocklist_identifier( get_serialized_body=lambda: utils.serialize_request_body( request, False, - False, + True, "json", - models.CreateBlocklistIdentifierRequestBody, + Optional[models.CreateBlocklistIdentifierRequestBody], ), timeout_ms=timeout_ms, ) @@ -451,7 +486,12 @@ def create_blocklist_identifier( if utils.match_response(http_res, ["400", "402", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -469,7 +509,12 @@ def create_blocklist_identifier( async def create_blocklist_identifier_async( self, *, - identifier: str, + request: Optional[ + Union[ + models.CreateBlocklistIdentifierRequestBody, + models.CreateBlocklistIdentifierRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -479,7 +524,7 @@ async def create_blocklist_identifier_async( Create an identifier that is blocked from accessing an instance - :param identifier: The identifier to be added in the block-list. This can be an email address, a phone number or a web3 wallet. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -493,9 +538,11 @@ async def create_blocklist_identifier_async( if server_url is not None: base_url = server_url - request = models.CreateBlocklistIdentifierRequestBody( - identifier=identifier, - ) + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[models.CreateBlocklistIdentifierRequestBody] + ) + request = cast(Optional[models.CreateBlocklistIdentifierRequestBody], request) req = self._build_request_async( method="POST", @@ -503,7 +550,7 @@ async def create_blocklist_identifier_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -513,9 +560,9 @@ async def create_blocklist_identifier_async( get_serialized_body=lambda: utils.serialize_request_body( request, False, - False, + True, "json", - models.CreateBlocklistIdentifierRequestBody, + Optional[models.CreateBlocklistIdentifierRequestBody], ), timeout_ms=timeout_ms, ) @@ -547,7 +594,12 @@ async def create_blocklist_identifier_async( if utils.match_response(http_res, ["400", "402", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -634,7 +686,12 @@ def delete_blocklist_identifier( if utils.match_response(http_res, ["402", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -721,7 +778,12 @@ async def delete_blocklist_identifier_async( if utils.match_response(http_res, ["402", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/allowlistidentifiers.py b/src/clerk_backend_api/allowlistidentifiers.py index 7a1b45d..60c12a2 100644 --- a/src/clerk_backend_api/allowlistidentifiers.py +++ b/src/clerk_backend_api/allowlistidentifiers.py @@ -80,7 +80,12 @@ def delete( if utils.match_response(http_res, ["402", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -167,7 +172,12 @@ async def delete_async( if utils.match_response(http_res, ["402", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/betafeatures.py b/src/clerk_backend_api/betafeatures.py index f603c47..6e5c719 100644 --- a/src/clerk_backend_api/betafeatures.py +++ b/src/clerk_backend_api/betafeatures.py @@ -12,10 +12,12 @@ class BetaFeatures(BaseSDK): def update_instance_settings( self, *, - request: Union[ - models.UpdateInstanceAuthConfigRequestBody, - models.UpdateInstanceAuthConfigRequestBodyTypedDict, - ] = models.UpdateInstanceAuthConfigRequestBody(), + request: Optional[ + Union[ + models.UpdateInstanceAuthConfigRequestBody, + models.UpdateInstanceAuthConfigRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -41,9 +43,9 @@ def update_instance_settings( if not isinstance(request, BaseModel): request = utils.unmarshal( - request, models.UpdateInstanceAuthConfigRequestBody + request, Optional[models.UpdateInstanceAuthConfigRequestBody] ) - request = cast(models.UpdateInstanceAuthConfigRequestBody, request) + request = cast(Optional[models.UpdateInstanceAuthConfigRequestBody], request) req = self._build_request( method="PATCH", @@ -51,7 +53,7 @@ def update_instance_settings( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -95,7 +97,12 @@ def update_instance_settings( if utils.match_response(http_res, ["402", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -113,10 +120,12 @@ def update_instance_settings( async def update_instance_settings_async( self, *, - request: Union[ - models.UpdateInstanceAuthConfigRequestBody, - models.UpdateInstanceAuthConfigRequestBodyTypedDict, - ] = models.UpdateInstanceAuthConfigRequestBody(), + request: Optional[ + Union[ + models.UpdateInstanceAuthConfigRequestBody, + models.UpdateInstanceAuthConfigRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -142,9 +151,9 @@ async def update_instance_settings_async( if not isinstance(request, BaseModel): request = utils.unmarshal( - request, models.UpdateInstanceAuthConfigRequestBody + request, Optional[models.UpdateInstanceAuthConfigRequestBody] ) - request = cast(models.UpdateInstanceAuthConfigRequestBody, request) + request = cast(Optional[models.UpdateInstanceAuthConfigRequestBody], request) req = self._build_request_async( method="PATCH", @@ -152,7 +161,7 @@ async def update_instance_settings_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -196,7 +205,12 @@ async def update_instance_settings_async( if utils.match_response(http_res, ["402", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -306,7 +320,12 @@ def update_domain( if utils.match_response(http_res, ["400", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -416,7 +435,12 @@ async def update_domain_async( if utils.match_response(http_res, ["400", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -434,10 +458,12 @@ async def update_domain_async( def change_production_instance_domain( self, *, - request: Union[ - models.ChangeProductionInstanceDomainRequestBody, - models.ChangeProductionInstanceDomainRequestBodyTypedDict, - ] = models.ChangeProductionInstanceDomainRequestBody(), + request: Optional[ + Union[ + models.ChangeProductionInstanceDomainRequestBody, + models.ChangeProductionInstanceDomainRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -467,9 +493,11 @@ def change_production_instance_domain( if not isinstance(request, BaseModel): request = utils.unmarshal( - request, models.ChangeProductionInstanceDomainRequestBody + request, Optional[models.ChangeProductionInstanceDomainRequestBody] ) - request = cast(models.ChangeProductionInstanceDomainRequestBody, request) + request = cast( + Optional[models.ChangeProductionInstanceDomainRequestBody], request + ) req = self._build_request( method="POST", @@ -477,7 +505,7 @@ def change_production_instance_domain( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -519,7 +547,12 @@ def change_production_instance_domain( if utils.match_response(http_res, ["400", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -537,10 +570,12 @@ def change_production_instance_domain( async def change_production_instance_domain_async( self, *, - request: Union[ - models.ChangeProductionInstanceDomainRequestBody, - models.ChangeProductionInstanceDomainRequestBodyTypedDict, - ] = models.ChangeProductionInstanceDomainRequestBody(), + request: Optional[ + Union[ + models.ChangeProductionInstanceDomainRequestBody, + models.ChangeProductionInstanceDomainRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -570,9 +605,11 @@ async def change_production_instance_domain_async( if not isinstance(request, BaseModel): request = utils.unmarshal( - request, models.ChangeProductionInstanceDomainRequestBody + request, Optional[models.ChangeProductionInstanceDomainRequestBody] ) - request = cast(models.ChangeProductionInstanceDomainRequestBody, request) + request = cast( + Optional[models.ChangeProductionInstanceDomainRequestBody], request + ) req = self._build_request_async( method="POST", @@ -580,7 +617,7 @@ async def change_production_instance_domain_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -622,7 +659,12 @@ async def change_production_instance_domain_async( if utils.match_response(http_res, ["400", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/blocklistidentifiers_sdk.py b/src/clerk_backend_api/blocklistidentifiers_sdk.py index 57d251a..f30679a 100644 --- a/src/clerk_backend_api/blocklistidentifiers_sdk.py +++ b/src/clerk_backend_api/blocklistidentifiers_sdk.py @@ -75,7 +75,12 @@ def list( if utils.match_response(http_res, ["401", "402"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -157,7 +162,12 @@ async def list_async( if utils.match_response(http_res, ["401", "402"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/clerk_redirecturls.py b/src/clerk_backend_api/clerk_redirecturls.py index 4e5fc84..222399c 100644 --- a/src/clerk_backend_api/clerk_redirecturls.py +++ b/src/clerk_backend_api/clerk_redirecturls.py @@ -11,10 +11,12 @@ class ClerkRedirectUrls(BaseSDK): def create( self, *, - request: Union[ - models.CreateRedirectURLRequestBody, - models.CreateRedirectURLRequestBodyTypedDict, - ] = models.CreateRedirectURLRequestBody(), + request: Optional[ + Union[ + models.CreateRedirectURLRequestBody, + models.CreateRedirectURLRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -39,8 +41,10 @@ def create( base_url = server_url if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CreateRedirectURLRequestBody) - request = cast(models.CreateRedirectURLRequestBody, request) + request = utils.unmarshal( + request, Optional[models.CreateRedirectURLRequestBody] + ) + request = cast(Optional[models.CreateRedirectURLRequestBody], request) req = self._build_request( method="POST", @@ -48,7 +52,7 @@ def create( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -90,7 +94,12 @@ def create( if utils.match_response(http_res, ["400", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -108,10 +117,12 @@ def create( async def create_async( self, *, - request: Union[ - models.CreateRedirectURLRequestBody, - models.CreateRedirectURLRequestBodyTypedDict, - ] = models.CreateRedirectURLRequestBody(), + request: Optional[ + Union[ + models.CreateRedirectURLRequestBody, + models.CreateRedirectURLRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -136,8 +147,10 @@ async def create_async( base_url = server_url if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CreateRedirectURLRequestBody) - request = cast(models.CreateRedirectURLRequestBody, request) + request = utils.unmarshal( + request, Optional[models.CreateRedirectURLRequestBody] + ) + request = cast(Optional[models.CreateRedirectURLRequestBody], request) req = self._build_request_async( method="POST", @@ -145,7 +158,7 @@ async def create_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -187,7 +200,12 @@ async def create_async( if utils.match_response(http_res, ["400", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -274,7 +292,12 @@ def get( if utils.match_response(http_res, "404", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -361,7 +384,12 @@ async def get_async( if utils.match_response(http_res, "404", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -448,7 +476,12 @@ def delete( if utils.match_response(http_res, "404", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -535,7 +568,12 @@ async def delete_async( if utils.match_response(http_res, "404", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/clients.py b/src/clerk_backend_api/clients.py index cd7e8c3..1ae986e 100644 --- a/src/clerk_backend_api/clients.py +++ b/src/clerk_backend_api/clients.py @@ -95,7 +95,12 @@ def list( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -192,7 +197,12 @@ async def list_async( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -210,9 +220,11 @@ async def list_async( def verify( self, *, - request: Union[ - models.VerifyClientRequestBody, models.VerifyClientRequestBodyTypedDict - ] = models.VerifyClientRequestBody(), + request: Optional[ + Union[ + models.VerifyClientRequestBody, models.VerifyClientRequestBodyTypedDict + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -237,8 +249,8 @@ def verify( base_url = server_url if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.VerifyClientRequestBody) - request = cast(models.VerifyClientRequestBody, request) + request = utils.unmarshal(request, Optional[models.VerifyClientRequestBody]) + request = cast(Optional[models.VerifyClientRequestBody], request) req = self._build_request( method="POST", @@ -246,7 +258,7 @@ def verify( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -284,7 +296,12 @@ def verify( if utils.match_response(http_res, ["400", "401", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -302,9 +319,11 @@ def verify( async def verify_async( self, *, - request: Union[ - models.VerifyClientRequestBody, models.VerifyClientRequestBodyTypedDict - ] = models.VerifyClientRequestBody(), + request: Optional[ + Union[ + models.VerifyClientRequestBody, models.VerifyClientRequestBodyTypedDict + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -329,8 +348,8 @@ async def verify_async( base_url = server_url if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.VerifyClientRequestBody) - request = cast(models.VerifyClientRequestBody, request) + request = utils.unmarshal(request, Optional[models.VerifyClientRequestBody]) + request = cast(Optional[models.VerifyClientRequestBody], request) req = self._build_request_async( method="POST", @@ -338,7 +357,7 @@ async def verify_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -376,7 +395,12 @@ async def verify_async( if utils.match_response(http_res, ["400", "401", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -463,7 +487,12 @@ def get( if utils.match_response(http_res, ["400", "401", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -550,7 +579,12 @@ async def get_async( if utils.match_response(http_res, ["400", "401", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/domains_sdk.py b/src/clerk_backend_api/domains_sdk.py index 9b87501..4e9c5c7 100644 --- a/src/clerk_backend_api/domains_sdk.py +++ b/src/clerk_backend_api/domains_sdk.py @@ -3,8 +3,8 @@ from .basesdk import BaseSDK from clerk_backend_api import models, utils from clerk_backend_api._hooks import HookContext -from clerk_backend_api.types import OptionalNullable, UNSET -from typing import Any, Mapping, Optional +from clerk_backend_api.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Mapping, Optional, Union, cast class DomainsSDK(BaseSDK): @@ -72,7 +72,12 @@ def list( if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, Optional[models.Domains]) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -149,7 +154,12 @@ async def list_async( if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, Optional[models.Domains]) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -167,9 +177,9 @@ async def list_async( def add( self, *, - name: str, - is_satellite: bool, - proxy_url: Optional[str] = None, + request: Optional[ + Union[models.AddDomainRequestBody, models.AddDomainRequestBodyTypedDict] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -183,9 +193,7 @@ def add( At the moment, instances can have only one primary domain, so the `is_satellite` parameter must be set to `true`. If you're planning to configure the new satellite domain to run behind a proxy, pass the `proxy_url` parameter accordingly. - :param name: The new domain name. Can contain the port for development instances. - :param is_satellite: Marks the new domain as satellite. Only `true` is accepted at the moment. - :param proxy_url: The full URL of the proxy which will forward requests to the Clerk Frontend API for this domain. Applicable only to production instances. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -199,11 +207,9 @@ def add( if server_url is not None: base_url = server_url - request = models.AddDomainRequestBody( - name=name, - is_satellite=is_satellite, - proxy_url=proxy_url, - ) + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, Optional[models.AddDomainRequestBody]) + request = cast(Optional[models.AddDomainRequestBody], request) req = self._build_request( method="POST", @@ -211,7 +217,7 @@ def add( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -219,7 +225,7 @@ def add( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.AddDomainRequestBody + request, False, True, "json", Optional[models.AddDomainRequestBody] ), timeout_ms=timeout_ms, ) @@ -249,7 +255,12 @@ def add( if utils.match_response(http_res, ["400", "402", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -267,9 +278,9 @@ def add( async def add_async( self, *, - name: str, - is_satellite: bool, - proxy_url: Optional[str] = None, + request: Optional[ + Union[models.AddDomainRequestBody, models.AddDomainRequestBodyTypedDict] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -283,9 +294,7 @@ async def add_async( At the moment, instances can have only one primary domain, so the `is_satellite` parameter must be set to `true`. If you're planning to configure the new satellite domain to run behind a proxy, pass the `proxy_url` parameter accordingly. - :param name: The new domain name. Can contain the port for development instances. - :param is_satellite: Marks the new domain as satellite. Only `true` is accepted at the moment. - :param proxy_url: The full URL of the proxy which will forward requests to the Clerk Frontend API for this domain. Applicable only to production instances. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -299,11 +308,9 @@ async def add_async( if server_url is not None: base_url = server_url - request = models.AddDomainRequestBody( - name=name, - is_satellite=is_satellite, - proxy_url=proxy_url, - ) + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, Optional[models.AddDomainRequestBody]) + request = cast(Optional[models.AddDomainRequestBody], request) req = self._build_request_async( method="POST", @@ -311,7 +318,7 @@ async def add_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -319,7 +326,7 @@ async def add_async( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.AddDomainRequestBody + request, False, True, "json", Optional[models.AddDomainRequestBody] ), timeout_ms=timeout_ms, ) @@ -349,7 +356,12 @@ async def add_async( if utils.match_response(http_res, ["400", "402", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -437,7 +449,12 @@ def delete( if utils.match_response(http_res, ["403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -525,7 +542,12 @@ async def delete_async( if utils.match_response(http_res, ["403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -637,7 +659,12 @@ def update( if utils.match_response(http_res, ["400", "404", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -749,7 +776,12 @@ async def update_async( if utils.match_response(http_res, ["400", "404", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/emailaddresses.py b/src/clerk_backend_api/emailaddresses.py index 3a41772..d7d9761 100644 --- a/src/clerk_backend_api/emailaddresses.py +++ b/src/clerk_backend_api/emailaddresses.py @@ -11,10 +11,12 @@ class EmailAddresses(BaseSDK): def create( self, *, - request: Union[ - models.CreateEmailAddressRequestBody, - models.CreateEmailAddressRequestBodyTypedDict, - ] = models.CreateEmailAddressRequestBody(), + request: Optional[ + Union[ + models.CreateEmailAddressRequestBody, + models.CreateEmailAddressRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -39,8 +41,10 @@ def create( base_url = server_url if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CreateEmailAddressRequestBody) - request = cast(models.CreateEmailAddressRequestBody, request) + request = utils.unmarshal( + request, Optional[models.CreateEmailAddressRequestBody] + ) + request = cast(Optional[models.CreateEmailAddressRequestBody], request) req = self._build_request( method="POST", @@ -48,7 +52,7 @@ def create( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -92,7 +96,12 @@ def create( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -110,10 +119,12 @@ def create( async def create_async( self, *, - request: Union[ - models.CreateEmailAddressRequestBody, - models.CreateEmailAddressRequestBodyTypedDict, - ] = models.CreateEmailAddressRequestBody(), + request: Optional[ + Union[ + models.CreateEmailAddressRequestBody, + models.CreateEmailAddressRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -138,8 +149,10 @@ async def create_async( base_url = server_url if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CreateEmailAddressRequestBody) - request = cast(models.CreateEmailAddressRequestBody, request) + request = utils.unmarshal( + request, Optional[models.CreateEmailAddressRequestBody] + ) + request = cast(Optional[models.CreateEmailAddressRequestBody], request) req = self._build_request_async( method="POST", @@ -147,7 +160,7 @@ async def create_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -191,7 +204,12 @@ async def create_async( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -280,7 +298,12 @@ def get( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -369,7 +392,12 @@ async def get_async( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -458,7 +486,12 @@ def delete( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -547,7 +580,12 @@ async def delete_async( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -607,7 +645,7 @@ def update( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", @@ -617,9 +655,9 @@ def update( get_serialized_body=lambda: utils.serialize_request_body( request.request_body, False, - False, + True, "json", - models.UpdateEmailAddressRequestBody, + Optional[models.UpdateEmailAddressRequestBody], ), timeout_ms=timeout_ms, ) @@ -651,7 +689,12 @@ def update( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -711,7 +754,7 @@ async def update_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", @@ -721,9 +764,9 @@ async def update_async( get_serialized_body=lambda: utils.serialize_request_body( request.request_body, False, - False, + True, "json", - models.UpdateEmailAddressRequestBody, + Optional[models.UpdateEmailAddressRequestBody], ), timeout_ms=timeout_ms, ) @@ -755,7 +798,12 @@ async def update_async( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/emailandsmstemplates.py b/src/clerk_backend_api/emailandsmstemplates.py index 698350f..52d0cda 100644 --- a/src/clerk_backend_api/emailandsmstemplates.py +++ b/src/clerk_backend_api/emailandsmstemplates.py @@ -119,7 +119,12 @@ def upsert( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -244,7 +249,12 @@ async def upsert_async( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/emailsmstemplates.py b/src/clerk_backend_api/emailsmstemplates.py index 035e643..26a5002 100644 --- a/src/clerk_backend_api/emailsmstemplates.py +++ b/src/clerk_backend_api/emailsmstemplates.py @@ -85,7 +85,12 @@ def list( if utils.match_response(http_res, ["400", "401", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -176,7 +181,12 @@ async def list_async( if utils.match_response(http_res, ["400", "401", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -271,7 +281,12 @@ def revert( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -366,7 +381,12 @@ async def revert_async( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -459,7 +479,12 @@ def get( if utils.match_response(http_res, ["400", "401", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -552,7 +577,12 @@ async def get_async( if utils.match_response(http_res, ["400", "401", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -659,7 +689,12 @@ def toggle_template_delivery( if utils.match_response(http_res, ["400", "401", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -766,7 +801,12 @@ async def toggle_template_delivery_async( if utils.match_response(http_res, ["400", "401", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/instancesettings_sdk.py b/src/clerk_backend_api/instance_settings_sdk.py similarity index 65% rename from src/clerk_backend_api/instancesettings_sdk.py rename to src/clerk_backend_api/instance_settings_sdk.py index b19e434..9c6cf3d 100644 --- a/src/clerk_backend_api/instancesettings_sdk.py +++ b/src/clerk_backend_api/instance_settings_sdk.py @@ -8,12 +8,177 @@ class InstanceSettingsSDK(BaseSDK): + def get_instance( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.Instance]: + r"""Fetch the current instance + + Fetches the current instance + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + req = self._build_request( + method="GET", + path="/instance", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="GetInstance", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[models.Instance]) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_instance_async( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.Instance]: + r"""Fetch the current instance + + Fetches the current instance + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + req = self._build_request_async( + method="GET", + path="/instance", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="GetInstance", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[models.Instance]) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + def update( self, *, - request: Union[ - models.UpdateInstanceRequestBody, models.UpdateInstanceRequestBodyTypedDict - ] = models.UpdateInstanceRequestBody(), + request: Optional[ + Union[ + models.UpdateInstanceRequestBody, + models.UpdateInstanceRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -38,8 +203,10 @@ def update( base_url = server_url if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.UpdateInstanceRequestBody) - request = cast(models.UpdateInstanceRequestBody, request) + request = utils.unmarshal( + request, Optional[models.UpdateInstanceRequestBody] + ) + request = cast(Optional[models.UpdateInstanceRequestBody], request) req = self._build_request( method="PATCH", @@ -47,7 +214,7 @@ def update( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -85,7 +252,12 @@ def update( if utils.match_response(http_res, "422", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -103,9 +275,12 @@ def update( async def update_async( self, *, - request: Union[ - models.UpdateInstanceRequestBody, models.UpdateInstanceRequestBodyTypedDict - ] = models.UpdateInstanceRequestBody(), + request: Optional[ + Union[ + models.UpdateInstanceRequestBody, + models.UpdateInstanceRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -130,8 +305,10 @@ async def update_async( base_url = server_url if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.UpdateInstanceRequestBody) - request = cast(models.UpdateInstanceRequestBody, request) + request = utils.unmarshal( + request, Optional[models.UpdateInstanceRequestBody] + ) + request = cast(Optional[models.UpdateInstanceRequestBody], request) req = self._build_request_async( method="PATCH", @@ -139,7 +316,7 @@ async def update_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -177,7 +354,12 @@ async def update_async( if utils.match_response(http_res, "422", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -195,10 +377,12 @@ async def update_async( def update_restrictions( self, *, - request: Union[ - models.UpdateInstanceRestrictionsRequestBody, - models.UpdateInstanceRestrictionsRequestBodyTypedDict, - ] = models.UpdateInstanceRestrictionsRequestBody(), + request: Optional[ + Union[ + models.UpdateInstanceRestrictionsRequestBody, + models.UpdateInstanceRestrictionsRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -224,9 +408,9 @@ def update_restrictions( if not isinstance(request, BaseModel): request = utils.unmarshal( - request, models.UpdateInstanceRestrictionsRequestBody + request, Optional[models.UpdateInstanceRestrictionsRequestBody] ) - request = cast(models.UpdateInstanceRestrictionsRequestBody, request) + request = cast(Optional[models.UpdateInstanceRestrictionsRequestBody], request) req = self._build_request( method="PATCH", @@ -234,7 +418,7 @@ def update_restrictions( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -278,7 +462,12 @@ def update_restrictions( if utils.match_response(http_res, ["402", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -296,10 +485,12 @@ def update_restrictions( async def update_restrictions_async( self, *, - request: Union[ - models.UpdateInstanceRestrictionsRequestBody, - models.UpdateInstanceRestrictionsRequestBodyTypedDict, - ] = models.UpdateInstanceRestrictionsRequestBody(), + request: Optional[ + Union[ + models.UpdateInstanceRestrictionsRequestBody, + models.UpdateInstanceRestrictionsRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -325,9 +516,9 @@ async def update_restrictions_async( if not isinstance(request, BaseModel): request = utils.unmarshal( - request, models.UpdateInstanceRestrictionsRequestBody + request, Optional[models.UpdateInstanceRestrictionsRequestBody] ) - request = cast(models.UpdateInstanceRestrictionsRequestBody, request) + request = cast(Optional[models.UpdateInstanceRestrictionsRequestBody], request) req = self._build_request_async( method="PATCH", @@ -335,7 +526,7 @@ async def update_restrictions_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -379,7 +570,12 @@ async def update_restrictions_async( if utils.match_response(http_res, ["402", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -397,10 +593,12 @@ async def update_restrictions_async( def update_organization_settings( self, *, - request: Union[ - models.UpdateInstanceOrganizationSettingsRequestBody, - models.UpdateInstanceOrganizationSettingsRequestBodyTypedDict, - ] = models.UpdateInstanceOrganizationSettingsRequestBody(), + request: Optional[ + Union[ + models.UpdateInstanceOrganizationSettingsRequestBody, + models.UpdateInstanceOrganizationSettingsRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -426,9 +624,11 @@ def update_organization_settings( if not isinstance(request, BaseModel): request = utils.unmarshal( - request, models.UpdateInstanceOrganizationSettingsRequestBody + request, Optional[models.UpdateInstanceOrganizationSettingsRequestBody] ) - request = cast(models.UpdateInstanceOrganizationSettingsRequestBody, request) + request = cast( + Optional[models.UpdateInstanceOrganizationSettingsRequestBody], request + ) req = self._build_request( method="PATCH", @@ -436,7 +636,7 @@ def update_organization_settings( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -468,7 +668,7 @@ def update_organization_settings( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["402", "404", "422", "4XX", "5XX"], + error_status_codes=["400", "402", "404", "422", "4XX", "5XX"], retry_config=retry_config, ) @@ -477,10 +677,17 @@ def update_organization_settings( return utils.unmarshal_json( http_res.text, Optional[models.OrganizationSettings] ) - if utils.match_response(http_res, ["402", "404", "422"], "application/json"): + if utils.match_response( + http_res, ["400", "402", "404", "422"], "application/json" + ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -498,10 +705,12 @@ def update_organization_settings( async def update_organization_settings_async( self, *, - request: Union[ - models.UpdateInstanceOrganizationSettingsRequestBody, - models.UpdateInstanceOrganizationSettingsRequestBodyTypedDict, - ] = models.UpdateInstanceOrganizationSettingsRequestBody(), + request: Optional[ + Union[ + models.UpdateInstanceOrganizationSettingsRequestBody, + models.UpdateInstanceOrganizationSettingsRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -527,9 +736,11 @@ async def update_organization_settings_async( if not isinstance(request, BaseModel): request = utils.unmarshal( - request, models.UpdateInstanceOrganizationSettingsRequestBody + request, Optional[models.UpdateInstanceOrganizationSettingsRequestBody] ) - request = cast(models.UpdateInstanceOrganizationSettingsRequestBody, request) + request = cast( + Optional[models.UpdateInstanceOrganizationSettingsRequestBody], request + ) req = self._build_request_async( method="PATCH", @@ -537,7 +748,7 @@ async def update_organization_settings_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -569,7 +780,7 @@ async def update_organization_settings_async( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["402", "404", "422", "4XX", "5XX"], + error_status_codes=["400", "402", "404", "422", "4XX", "5XX"], retry_config=retry_config, ) @@ -578,10 +789,17 @@ async def update_organization_settings_async( return utils.unmarshal_json( http_res.text, Optional[models.OrganizationSettings] ) - if utils.match_response(http_res, ["402", "404", "422"], "application/json"): + if utils.match_response( + http_res, ["400", "402", "404", "422"], "application/json" + ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/invitations.py b/src/clerk_backend_api/invitations.py index 6d567ca..72526a1 100644 --- a/src/clerk_backend_api/invitations.py +++ b/src/clerk_backend_api/invitations.py @@ -3,8 +3,8 @@ from .basesdk import BaseSDK from clerk_backend_api import models, utils from clerk_backend_api._hooks import HookContext -from clerk_backend_api.types import OptionalNullable, UNSET -from typing import Any, Dict, List, Mapping, Optional +from clerk_backend_api.types import BaseModel, OptionalNullable, UNSET +from typing import Any, List, Mapping, Optional, Union, cast class Invitations(BaseSDK): @@ -15,12 +15,12 @@ class Invitations(BaseSDK): def create( self, *, - email_address: str, - public_metadata: Optional[Dict[str, Any]] = None, - redirect_url: Optional[str] = None, - notify: OptionalNullable[bool] = True, - ignore_existing: OptionalNullable[bool] = False, - expires_in_days: OptionalNullable[int] = UNSET, + request: Optional[ + Union[ + models.CreateInvitationRequestBody, + models.CreateInvitationRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -32,12 +32,7 @@ def create( Keep in mind that you cannot create an invitation if there is already one for the given email address. Also, trying to create an invitation for an email address that already exists in your application will result to an error. - :param email_address: The email address the invitation will be sent to - :param public_metadata: Metadata that will be attached to the newly created invitation. The value of this property should be a well-formed JSON object. Once the user accepts the invitation and signs up, these metadata will end up in the user's public metadata. - :param redirect_url: Optional URL which specifies where to redirect the user once they click the invitation link. This is only required if you have implemented a [custom flow](https://clerk.com/docs/authentication/invitations#custom-flow) and you're not using Clerk Hosted Pages or Clerk Components. - :param notify: Optional flag which denotes whether an email invitation should be sent to the given email address. Defaults to true. - :param ignore_existing: Whether an invitation should be created if there is already an existing invitation for this email address, or it's claimed by another user. - :param expires_in_days: The number of days the invitation will be valid for. By default, the invitation does not expire. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -51,14 +46,11 @@ def create( if server_url is not None: base_url = server_url - request = models.CreateInvitationRequestBody( - email_address=email_address, - public_metadata=public_metadata, - redirect_url=redirect_url, - notify=notify, - ignore_existing=ignore_existing, - expires_in_days=expires_in_days, - ) + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[models.CreateInvitationRequestBody] + ) + request = cast(Optional[models.CreateInvitationRequestBody], request) req = self._build_request( method="POST", @@ -66,7 +58,7 @@ def create( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -74,7 +66,11 @@ def create( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.CreateInvitationRequestBody + request, + False, + True, + "json", + Optional[models.CreateInvitationRequestBody], ), timeout_ms=timeout_ms, ) @@ -104,7 +100,12 @@ def create( if utils.match_response(http_res, ["400", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -122,12 +123,12 @@ def create( async def create_async( self, *, - email_address: str, - public_metadata: Optional[Dict[str, Any]] = None, - redirect_url: Optional[str] = None, - notify: OptionalNullable[bool] = True, - ignore_existing: OptionalNullable[bool] = False, - expires_in_days: OptionalNullable[int] = UNSET, + request: Optional[ + Union[ + models.CreateInvitationRequestBody, + models.CreateInvitationRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -139,12 +140,7 @@ async def create_async( Keep in mind that you cannot create an invitation if there is already one for the given email address. Also, trying to create an invitation for an email address that already exists in your application will result to an error. - :param email_address: The email address the invitation will be sent to - :param public_metadata: Metadata that will be attached to the newly created invitation. The value of this property should be a well-formed JSON object. Once the user accepts the invitation and signs up, these metadata will end up in the user's public metadata. - :param redirect_url: Optional URL which specifies where to redirect the user once they click the invitation link. This is only required if you have implemented a [custom flow](https://clerk.com/docs/authentication/invitations#custom-flow) and you're not using Clerk Hosted Pages or Clerk Components. - :param notify: Optional flag which denotes whether an email invitation should be sent to the given email address. Defaults to true. - :param ignore_existing: Whether an invitation should be created if there is already an existing invitation for this email address, or it's claimed by another user. - :param expires_in_days: The number of days the invitation will be valid for. By default, the invitation does not expire. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -158,14 +154,11 @@ async def create_async( if server_url is not None: base_url = server_url - request = models.CreateInvitationRequestBody( - email_address=email_address, - public_metadata=public_metadata, - redirect_url=redirect_url, - notify=notify, - ignore_existing=ignore_existing, - expires_in_days=expires_in_days, - ) + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[models.CreateInvitationRequestBody] + ) + request = cast(Optional[models.CreateInvitationRequestBody], request) req = self._build_request_async( method="POST", @@ -173,7 +166,7 @@ async def create_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -181,7 +174,11 @@ async def create_async( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.CreateInvitationRequestBody + request, + False, + True, + "json", + Optional[models.CreateInvitationRequestBody], ), timeout_ms=timeout_ms, ) @@ -211,7 +208,12 @@ async def create_async( if utils.match_response(http_res, ["400", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -232,6 +234,7 @@ def list( limit: Optional[int] = 10, offset: Optional[int] = 0, status: Optional[models.ListInvitationsQueryParamStatus] = None, + query: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -244,6 +247,7 @@ def list( :param limit: Applies a limit to the number of results returned. Can be used for paginating the results together with `offset`. :param offset: Skip the first `offset` results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with `limit`. :param status: Filter invitations based on their status + :param query: Filter invitations based on their `email_address` or `id` :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -261,6 +265,7 @@ def list( limit=limit, offset=offset, status=status, + query=query, ) req = self._build_request( @@ -302,7 +307,12 @@ def list( return utils.unmarshal_json( http_res.text, Optional[List[models.Invitation]] ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -323,6 +333,7 @@ async def list_async( limit: Optional[int] = 10, offset: Optional[int] = 0, status: Optional[models.ListInvitationsQueryParamStatus] = None, + query: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -335,6 +346,7 @@ async def list_async( :param limit: Applies a limit to the number of results returned. Can be used for paginating the results together with `offset`. :param offset: Skip the first `offset` results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with `limit`. :param status: Filter invitations based on their status + :param query: Filter invitations based on their `email_address` or `id` :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -352,6 +364,7 @@ async def list_async( limit=limit, offset=offset, status=status, + query=query, ) req = self._build_request_async( @@ -393,7 +406,216 @@ async def list_async( return utils.unmarshal_json( http_res.text, Optional[List[models.Invitation]] ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def create_bulk_invitations( + self, + *, + request: Optional[ + Union[List[models.RequestBody], List[models.RequestBodyTypedDict]] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[List[models.Invitation]]: + r"""Create multiple invitations + + Use this API operation to create multiple invitations for the provided email addresses. You can choose to send the + invitations as emails by setting the `notify` parameter to `true`. There cannot be an existing invitation for any + of the email addresses you provide unless you set `ignore_existing` to `true` for specific email addresses. Please + note that there must be no existing user for any of the email addresses you provide, and this rule cannot be bypassed. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, Optional[List[models.RequestBody]]) + request = cast(Optional[List[models.RequestBody]], request) + + req = self._build_request( + method="POST", + path="/invitations/bulk", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, True, "json", Optional[List[models.RequestBody]] + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="CreateBulkInvitations", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["400", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[List[models.Invitation]] + ) + if utils.match_response(http_res, ["400", "422"], "application/json"): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def create_bulk_invitations_async( + self, + *, + request: Optional[ + Union[List[models.RequestBody], List[models.RequestBodyTypedDict]] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[List[models.Invitation]]: + r"""Create multiple invitations + + Use this API operation to create multiple invitations for the provided email addresses. You can choose to send the + invitations as emails by setting the `notify` parameter to `true`. There cannot be an existing invitation for any + of the email addresses you provide unless you set `ignore_existing` to `true` for specific email addresses. Please + note that there must be no existing user for any of the email addresses you provide, and this rule cannot be bypassed. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, Optional[List[models.RequestBody]]) + request = cast(Optional[List[models.RequestBody]], request) + + req = self._build_request_async( + method="POST", + path="/invitations/bulk", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, True, "json", Optional[List[models.RequestBody]] + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="CreateBulkInvitations", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["400", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[List[models.Invitation]] + ) + if utils.match_response(http_res, ["400", "422"], "application/json"): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -485,7 +707,12 @@ def revoke( if utils.match_response(http_res, ["400", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -577,7 +804,12 @@ async def revoke_async( if utils.match_response(http_res, ["400", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/jwks.py b/src/clerk_backend_api/jwks_sdk.py similarity index 89% rename from src/clerk_backend_api/jwks.py rename to src/clerk_backend_api/jwks_sdk.py index 6564f63..0edb93e 100644 --- a/src/clerk_backend_api/jwks.py +++ b/src/clerk_backend_api/jwks_sdk.py @@ -7,7 +7,7 @@ from typing import Mapping, Optional -class Jwks(BaseSDK): +class JwksSDK(BaseSDK): def get( self, *, @@ -15,7 +15,7 @@ def get( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> Optional[models.WellKnownJWKS]: + ) -> Optional[models.Jwks]: r"""Retrieve the JSON Web Key Set of the instance Retrieve the JSON Web Key Set of the instance @@ -68,8 +68,13 @@ def get( ) if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, Optional[models.WellKnownJWKS]) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + return utils.unmarshal_json(http_res.text, Optional[models.Jwks]) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -91,7 +96,7 @@ async def get_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> Optional[models.WellKnownJWKS]: + ) -> Optional[models.Jwks]: r"""Retrieve the JSON Web Key Set of the instance Retrieve the JSON Web Key Set of the instance @@ -144,8 +149,13 @@ async def get_async( ) if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, Optional[models.WellKnownJWKS]) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + return utils.unmarshal_json(http_res.text, Optional[models.Jwks]) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/jwttemplates.py b/src/clerk_backend_api/jwttemplates.py index d0d4d4a..9826db1 100644 --- a/src/clerk_backend_api/jwttemplates.py +++ b/src/clerk_backend_api/jwttemplates.py @@ -69,7 +69,12 @@ def list( return utils.unmarshal_json( http_res.text, Optional[List[models.JWTTemplate]] ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -145,7 +150,12 @@ async def list_async( return utils.unmarshal_json( http_res.text, Optional[List[models.JWTTemplate]] ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -163,10 +173,12 @@ async def list_async( def create( self, *, - request: Union[ - models.CreateJWTTemplateRequestBody, - models.CreateJWTTemplateRequestBodyTypedDict, - ] = models.CreateJWTTemplateRequestBody(), + request: Optional[ + Union[ + models.CreateJWTTemplateRequestBody, + models.CreateJWTTemplateRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -191,8 +203,10 @@ def create( base_url = server_url if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CreateJWTTemplateRequestBody) - request = cast(models.CreateJWTTemplateRequestBody, request) + request = utils.unmarshal( + request, Optional[models.CreateJWTTemplateRequestBody] + ) + request = cast(Optional[models.CreateJWTTemplateRequestBody], request) req = self._build_request( method="POST", @@ -200,7 +214,7 @@ def create( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -242,7 +256,12 @@ def create( if utils.match_response(http_res, ["400", "402", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -260,10 +279,12 @@ def create( async def create_async( self, *, - request: Union[ - models.CreateJWTTemplateRequestBody, - models.CreateJWTTemplateRequestBodyTypedDict, - ] = models.CreateJWTTemplateRequestBody(), + request: Optional[ + Union[ + models.CreateJWTTemplateRequestBody, + models.CreateJWTTemplateRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -288,8 +309,10 @@ async def create_async( base_url = server_url if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CreateJWTTemplateRequestBody) - request = cast(models.CreateJWTTemplateRequestBody, request) + request = utils.unmarshal( + request, Optional[models.CreateJWTTemplateRequestBody] + ) + request = cast(Optional[models.CreateJWTTemplateRequestBody], request) req = self._build_request_async( method="POST", @@ -297,7 +320,7 @@ async def create_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -339,7 +362,12 @@ async def create_async( if utils.match_response(http_res, ["400", "402", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -426,7 +454,12 @@ def get( if utils.match_response(http_res, "404", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -513,7 +546,12 @@ async def get_async( if utils.match_response(http_res, "404", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -594,7 +632,7 @@ def update( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", @@ -604,9 +642,9 @@ def update( get_serialized_body=lambda: utils.serialize_request_body( request.request_body, False, - False, + True, "json", - models.UpdateJWTTemplateRequestBody, + Optional[models.UpdateJWTTemplateRequestBody], ), timeout_ms=timeout_ms, ) @@ -636,7 +674,12 @@ def update( if utils.match_response(http_res, ["400", "402", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -717,7 +760,7 @@ async def update_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", @@ -727,9 +770,9 @@ async def update_async( get_serialized_body=lambda: utils.serialize_request_body( request.request_body, False, - False, + True, "json", - models.UpdateJWTTemplateRequestBody, + Optional[models.UpdateJWTTemplateRequestBody], ), timeout_ms=timeout_ms, ) @@ -759,7 +802,12 @@ async def update_async( if utils.match_response(http_res, ["400", "402", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -844,7 +892,12 @@ def delete( if utils.match_response(http_res, ["403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -929,7 +982,12 @@ async def delete_async( if utils.match_response(http_res, ["403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/miscellaneous.py b/src/clerk_backend_api/miscellaneous.py index 446b6b3..8b1e12e 100644 --- a/src/clerk_backend_api/miscellaneous.py +++ b/src/clerk_backend_api/miscellaneous.py @@ -81,7 +81,12 @@ def get_interstitial( if utils.match_response(http_res, "200", "*"): return - if utils.match_response(http_res, ["400", "4XX", "500", "5XX"], "*"): + if utils.match_response(http_res, ["400", "4XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, ["500", "5XX"], "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -167,7 +172,12 @@ async def get_interstitial_async( if utils.match_response(http_res, "200", "*"): return - if utils.match_response(http_res, ["400", "4XX", "500", "5XX"], "*"): + if utils.match_response(http_res, ["400", "4XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, ["500", "5XX"], "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/models/__init__.py b/src/clerk_backend_api/models/__init__.py index 7e27e8a..6d6b690 100644 --- a/src/clerk_backend_api/models/__init__.py +++ b/src/clerk_backend_api/models/__init__.py @@ -50,6 +50,7 @@ CreateBlocklistIdentifierRequestBody, CreateBlocklistIdentifierRequestBodyTypedDict, ) +from .createbulkinvitationsop import RequestBody, RequestBodyTypedDict from .createemailaddressop import ( CreateEmailAddressRequestBody, CreateEmailAddressRequestBodyTypedDict, @@ -57,6 +58,7 @@ from .createinvitationop import ( CreateInvitationRequestBody, CreateInvitationRequestBodyTypedDict, + TemplateSlug, ) from .createjwttemplateop import ( CreateJWTTemplateClaims, @@ -76,9 +78,9 @@ ) from .createorganizationinvitationbulkop import ( CreateOrganizationInvitationBulkRequest, + CreateOrganizationInvitationBulkRequestBody, + CreateOrganizationInvitationBulkRequestBodyTypedDict, CreateOrganizationInvitationBulkRequestTypedDict, - RequestBody, - RequestBodyTypedDict, ) from .createorganizationinvitationop import ( CreateOrganizationInvitationRequest, @@ -111,19 +113,35 @@ CreateSAMLConnectionRequestBodyTypedDict, Provider, ) +from .createsessionop import CreateSessionRequestBody, CreateSessionRequestBodyTypedDict from .createsessiontokenfromtemplateop import ( CreateSessionTokenFromTemplateObject, CreateSessionTokenFromTemplateRequest, + CreateSessionTokenFromTemplateRequestBody, + CreateSessionTokenFromTemplateRequestBodyTypedDict, CreateSessionTokenFromTemplateRequestTypedDict, CreateSessionTokenFromTemplateResponseBody, CreateSessionTokenFromTemplateResponseBodyTypedDict, ) +from .createsessiontokenop import ( + CreateSessionTokenObject, + CreateSessionTokenRequest, + CreateSessionTokenRequestBody, + CreateSessionTokenRequestBodyTypedDict, + CreateSessionTokenRequestTypedDict, + CreateSessionTokenResponseBody, + CreateSessionTokenResponseBodyTypedDict, +) from .createsignintokenop import ( CreateSignInTokenRequestBody, CreateSignInTokenRequestBodyTypedDict, ) from .createuserop import CreateUserRequestBody, CreateUserRequestBodyTypedDict from .createusertotpop import CreateUserTOTPRequest, CreateUserTOTPRequestTypedDict +from .createwaitlistentryop import ( + CreateWaitlistEntryRequestBody, + CreateWaitlistEntryRequestBodyTypedDict, +) from .deleteallowlistidentifierop import ( DeleteAllowlistIdentifierRequest, DeleteAllowlistIdentifierRequestTypedDict, @@ -216,10 +234,9 @@ ErrorMeta, ErrorMetaTypedDict, ErrorTypedDict, - Oauth, - OauthTypedDict, - OauthVerificationStatus, - OauthVerificationStrategy, + FromOAuth, + FromOAuthTypedDict, + FromOAuthVerificationStatus, Otp, OtpTypedDict, Strategy, @@ -277,6 +294,7 @@ from .getuserop import GetUserRequest, GetUserRequestTypedDict from .getuserscountop import GetUsersCountRequest, GetUsersCountRequestTypedDict from .identificationlink import IdentificationLink, IdentificationLinkTypedDict, Type +from .instance import Instance, InstanceObject, InstanceTypedDict from .instancegetorganizationmembershipsop import ( InstanceGetOrganizationMembershipsRequest, InstanceGetOrganizationMembershipsRequestTypedDict, @@ -303,6 +321,7 @@ InvitationRevokedStatus, InvitationRevokedTypedDict, ) +from .jwks import Jwks, JwksTypedDict, Keys, KeysTypedDict from .jwttemplate import ( Claims, ClaimsTypedDict, @@ -349,6 +368,11 @@ ListSAMLConnectionsRequest, ListSAMLConnectionsRequestTypedDict, ) +from .listwaitlistentriesop import ( + ListWaitlistEntriesQueryParamStatus, + ListWaitlistEntriesRequest, + ListWaitlistEntriesRequestTypedDict, +) from .lockuserop import LockUserRequest, LockUserRequestTypedDict from .mergeorganizationmetadataop import ( MergeOrganizationMetadataRequest, @@ -741,6 +765,17 @@ VerifyTOTPResponseBody, VerifyTOTPResponseBodyTypedDict, ) +from .waitlistentries import WaitlistEntries, WaitlistEntriesTypedDict +from .waitlistentry import ( + WaitlistEntry, + WaitlistEntryInvitation, + WaitlistEntryInvitationObject, + WaitlistEntryInvitationStatus, + WaitlistEntryInvitationTypedDict, + WaitlistEntryObject, + WaitlistEntryStatus, + WaitlistEntryTypedDict, +) from .web3wallet import ( AdminVerificationWeb3WalletStatus, AdminVerificationWeb3WalletStrategy, @@ -756,7 +791,7 @@ Web3WalletVerificationAdminTypedDict, Web3WalletVerificationTypedDict, ) -from .wellknown_jwks import Keys, KeysTypedDict, WellKnownJWKS, WellKnownJWKSTypedDict + __all__ = [ "Actor", @@ -829,6 +864,8 @@ "CreateOrganizationDomainRequestBodyTypedDict", "CreateOrganizationDomainRequestTypedDict", "CreateOrganizationInvitationBulkRequest", + "CreateOrganizationInvitationBulkRequestBody", + "CreateOrganizationInvitationBulkRequestBodyTypedDict", "CreateOrganizationInvitationBulkRequestTypedDict", "CreateOrganizationInvitationRequest", "CreateOrganizationInvitationRequestBody", @@ -848,17 +885,30 @@ "CreateSAMLConnectionAttributeMappingTypedDict", "CreateSAMLConnectionRequestBody", "CreateSAMLConnectionRequestBodyTypedDict", + "CreateSessionRequestBody", + "CreateSessionRequestBodyTypedDict", "CreateSessionTokenFromTemplateObject", "CreateSessionTokenFromTemplateRequest", + "CreateSessionTokenFromTemplateRequestBody", + "CreateSessionTokenFromTemplateRequestBodyTypedDict", "CreateSessionTokenFromTemplateRequestTypedDict", "CreateSessionTokenFromTemplateResponseBody", "CreateSessionTokenFromTemplateResponseBodyTypedDict", + "CreateSessionTokenObject", + "CreateSessionTokenRequest", + "CreateSessionTokenRequestBody", + "CreateSessionTokenRequestBodyTypedDict", + "CreateSessionTokenRequestTypedDict", + "CreateSessionTokenResponseBody", + "CreateSessionTokenResponseBodyTypedDict", "CreateSignInTokenRequestBody", "CreateSignInTokenRequestBodyTypedDict", "CreateUserRequestBody", "CreateUserRequestBodyTypedDict", "CreateUserTOTPRequest", "CreateUserTOTPRequestTypedDict", + "CreateWaitlistEntryRequestBody", + "CreateWaitlistEntryRequestBodyTypedDict", "DeleteAllowlistIdentifierRequest", "DeleteAllowlistIdentifierRequestTypedDict", "DeleteBackupCodeRequest", @@ -927,6 +977,9 @@ "ExternalAccountsTypedDict", "File", "FileTypedDict", + "FromOAuth", + "FromOAuthTypedDict", + "FromOAuthVerificationStatus", "GetClientListRequest", "GetClientListRequestTypedDict", "GetClientRequest", @@ -968,14 +1021,17 @@ "IdentificationLink", "IdentificationLinkTypedDict", "IdentifierType", + "Instance", "InstanceGetOrganizationMembershipsRequest", "InstanceGetOrganizationMembershipsRequestTypedDict", + "InstanceObject", "InstanceRestrictions", "InstanceRestrictionsObject", "InstanceRestrictionsTypedDict", "InstanceSettings", "InstanceSettingsObject", "InstanceSettingsTypedDict", + "InstanceTypedDict", "Invitation", "InvitationObject", "InvitationRevoked", @@ -987,6 +1043,8 @@ "JWTTemplate", "JWTTemplateObject", "JWTTemplateTypedDict", + "Jwks", + "JwksTypedDict", "Keys", "KeysTypedDict", "LatestActivity", @@ -1012,6 +1070,9 @@ "ListPendingOrganizationInvitationsRequestTypedDict", "ListSAMLConnectionsRequest", "ListSAMLConnectionsRequestTypedDict", + "ListWaitlistEntriesQueryParamStatus", + "ListWaitlistEntriesRequest", + "ListWaitlistEntriesRequestTypedDict", "LockUserRequest", "LockUserRequestTypedDict", "MergeOrganizationMetadataRequest", @@ -1031,10 +1092,6 @@ "OAuthApplicationsTypedDict", "OTPVerificationStatus", "OTPVerificationStrategy", - "Oauth", - "OauthTypedDict", - "OauthVerificationStatus", - "OauthVerificationStrategy", "Object", "Organization", "OrganizationDomain", @@ -1173,6 +1230,7 @@ "SvixURLTypedDict", "Template", "TemplateObject", + "TemplateSlug", "TemplateType", "TemplateTypedDict", "TestingToken", @@ -1318,6 +1376,16 @@ "VerifyTOTPRequestTypedDict", "VerifyTOTPResponseBody", "VerifyTOTPResponseBodyTypedDict", + "WaitlistEntries", + "WaitlistEntriesTypedDict", + "WaitlistEntry", + "WaitlistEntryInvitation", + "WaitlistEntryInvitationObject", + "WaitlistEntryInvitationStatus", + "WaitlistEntryInvitationTypedDict", + "WaitlistEntryObject", + "WaitlistEntryStatus", + "WaitlistEntryTypedDict", "Web3Signature", "Web3SignatureTypedDict", "Web3SignatureVerificationStatus", @@ -1329,6 +1397,4 @@ "Web3WalletVerificationAdmin", "Web3WalletVerificationAdminTypedDict", "Web3WalletVerificationTypedDict", - "WellKnownJWKS", - "WellKnownJWKSTypedDict", ] diff --git a/src/clerk_backend_api/models/createbulkinvitationsop.py b/src/clerk_backend_api/models/createbulkinvitationsop.py new file mode 100644 index 0000000..092b81e --- /dev/null +++ b/src/clerk_backend_api/models/createbulkinvitationsop.py @@ -0,0 +1,98 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from clerk_backend_api.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, Dict, Optional +from typing_extensions import NotRequired, TypedDict + + +class RequestBodyTypedDict(TypedDict): + email_address: str + r"""The email address the invitation will be sent to""" + public_metadata: NotRequired[Dict[str, Any]] + r"""Metadata that will be attached to the newly created invitation. + The value of this property should be a well-formed JSON object. + Once the user accepts the invitation and signs up, these metadata will end up in the user's public metadata. + """ + redirect_url: NotRequired[str] + r"""The URL where the user is redirected upon visiting the invitation link, where they can accept the invitation. Required if you have implemented a [custom flow for handling application invitations](/docs/custom-flows/invitations).""" + notify: NotRequired[Nullable[bool]] + r"""Optional flag which denotes whether an email invitation should be sent to the given email address. + Defaults to true. + """ + ignore_existing: NotRequired[Nullable[bool]] + r"""Whether an invitation should be created if there is already an existing invitation for this email + address, or it's claimed by another user. + """ + expires_in_days: NotRequired[Nullable[int]] + r"""The number of days the invitation will be valid for. By default, the invitation expires after 30 days.""" + + +class RequestBody(BaseModel): + email_address: str + r"""The email address the invitation will be sent to""" + + public_metadata: Optional[Dict[str, Any]] = None + r"""Metadata that will be attached to the newly created invitation. + The value of this property should be a well-formed JSON object. + Once the user accepts the invitation and signs up, these metadata will end up in the user's public metadata. + """ + + redirect_url: Optional[str] = None + r"""The URL where the user is redirected upon visiting the invitation link, where they can accept the invitation. Required if you have implemented a [custom flow for handling application invitations](/docs/custom-flows/invitations).""" + + notify: OptionalNullable[bool] = True + r"""Optional flag which denotes whether an email invitation should be sent to the given email address. + Defaults to true. + """ + + ignore_existing: OptionalNullable[bool] = False + r"""Whether an invitation should be created if there is already an existing invitation for this email + address, or it's claimed by another user. + """ + + expires_in_days: OptionalNullable[int] = UNSET + r"""The number of days the invitation will be valid for. By default, the invitation expires after 30 days.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "public_metadata", + "redirect_url", + "notify", + "ignore_existing", + "expires_in_days", + ] + nullable_fields = ["notify", "ignore_existing", "expires_in_days"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/clerk_backend_api/models/createinvitationop.py b/src/clerk_backend_api/models/createinvitationop.py index 4f724c2..20ae0bf 100644 --- a/src/clerk_backend_api/models/createinvitationop.py +++ b/src/clerk_backend_api/models/createinvitationop.py @@ -8,11 +8,21 @@ UNSET, UNSET_SENTINEL, ) +from enum import Enum from pydantic import model_serializer from typing import Any, Dict, Optional from typing_extensions import NotRequired, TypedDict +class TemplateSlug(str, Enum): + r"""The slug of the email template to use for the invitation email. + If not provided, the \"invitation\" template will be used. + """ + + INVITATION = "invitation" + WAITLIST_INVITATION = "waitlist_invitation" + + class CreateInvitationRequestBodyTypedDict(TypedDict): r"""Required parameters""" @@ -29,12 +39,16 @@ class CreateInvitationRequestBodyTypedDict(TypedDict): """ notify: NotRequired[Nullable[bool]] r"""Optional flag which denotes whether an email invitation should be sent to the given email address. - Defaults to true. + Defaults to `true`. """ ignore_existing: NotRequired[Nullable[bool]] r"""Whether an invitation should be created if there is already an existing invitation for this email address, or it's claimed by another user.""" expires_in_days: NotRequired[Nullable[int]] - r"""The number of days the invitation will be valid for. By default, the invitation does not expire.""" + r"""The number of days the invitation will be valid for. By default, the invitation expires after 30 days.""" + template_slug: NotRequired[Nullable[TemplateSlug]] + r"""The slug of the email template to use for the invitation email. + If not provided, the \"invitation\" template will be used. + """ class CreateInvitationRequestBody(BaseModel): @@ -56,14 +70,19 @@ class CreateInvitationRequestBody(BaseModel): notify: OptionalNullable[bool] = True r"""Optional flag which denotes whether an email invitation should be sent to the given email address. - Defaults to true. + Defaults to `true`. """ ignore_existing: OptionalNullable[bool] = False r"""Whether an invitation should be created if there is already an existing invitation for this email address, or it's claimed by another user.""" expires_in_days: OptionalNullable[int] = UNSET - r"""The number of days the invitation will be valid for. By default, the invitation does not expire.""" + r"""The number of days the invitation will be valid for. By default, the invitation expires after 30 days.""" + + template_slug: OptionalNullable[TemplateSlug] = UNSET + r"""The slug of the email template to use for the invitation email. + If not provided, the \"invitation\" template will be used. + """ @model_serializer(mode="wrap") def serialize_model(self, handler): @@ -73,8 +92,14 @@ def serialize_model(self, handler): "notify", "ignore_existing", "expires_in_days", + "template_slug", + ] + nullable_fields = [ + "notify", + "ignore_existing", + "expires_in_days", + "template_slug", ] - nullable_fields = ["notify", "ignore_existing", "expires_in_days"] null_default_fields = [] serialized = handler(self) diff --git a/src/clerk_backend_api/models/createoauthapplicationop.py b/src/clerk_backend_api/models/createoauthapplicationop.py index 38022e6..9fdcfbe 100644 --- a/src/clerk_backend_api/models/createoauthapplicationop.py +++ b/src/clerk_backend_api/models/createoauthapplicationop.py @@ -9,7 +9,7 @@ class CreateOAuthApplicationRequestBodyTypedDict(TypedDict): name: str r"""The name of the new OAuth application""" - callback_url: str + callback_url: NotRequired[str] r"""The callback URL of the new OAuth application""" scopes: NotRequired[str] r"""Define the allowed scopes for the new OAuth applications that dictate the user payload of the OAuth user info endpoint. Available scopes are `profile`, `email`, `public_metadata`, `private_metadata`. Provide the requested scopes as a string, separated by spaces.""" @@ -24,7 +24,7 @@ class CreateOAuthApplicationRequestBody(BaseModel): name: str r"""The name of the new OAuth application""" - callback_url: str + callback_url: Optional[str] = None r"""The callback URL of the new OAuth application""" scopes: Optional[str] = "profile email" diff --git a/src/clerk_backend_api/models/createorganizationinvitationbulkop.py b/src/clerk_backend_api/models/createorganizationinvitationbulkop.py index fcd9f5d..c22ac82 100644 --- a/src/clerk_backend_api/models/createorganizationinvitationbulkop.py +++ b/src/clerk_backend_api/models/createorganizationinvitationbulkop.py @@ -14,7 +14,7 @@ from typing_extensions import Annotated, NotRequired, TypedDict -class RequestBodyTypedDict(TypedDict): +class CreateOrganizationInvitationBulkRequestBodyTypedDict(TypedDict): email_address: str r"""The email address of the new member that is going to be invited to the organization""" role: str @@ -24,14 +24,18 @@ class RequestBodyTypedDict(TypedDict): Must be an administrator in the organization. """ public_metadata: NotRequired[Dict[str, Any]] - r"""Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API.""" + r"""Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. + When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. + """ private_metadata: NotRequired[Dict[str, Any]] - r"""Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API.""" + r"""Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. + When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. + """ redirect_url: NotRequired[str] r"""Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email.""" -class RequestBody(BaseModel): +class CreateOrganizationInvitationBulkRequestBody(BaseModel): email_address: str r"""The email address of the new member that is going to be invited to the organization""" @@ -44,10 +48,14 @@ class RequestBody(BaseModel): """ public_metadata: Optional[Dict[str, Any]] = None - r"""Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API.""" + r"""Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. + When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. + """ private_metadata: Optional[Dict[str, Any]] = None - r"""Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API.""" + r"""Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. + When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. + """ redirect_url: Optional[str] = None r"""Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email.""" @@ -91,7 +99,7 @@ def serialize_model(self, handler): class CreateOrganizationInvitationBulkRequestTypedDict(TypedDict): organization_id: str r"""The organization ID.""" - request_body: List[RequestBodyTypedDict] + request_body: List[CreateOrganizationInvitationBulkRequestBodyTypedDict] class CreateOrganizationInvitationBulkRequest(BaseModel): @@ -101,6 +109,6 @@ class CreateOrganizationInvitationBulkRequest(BaseModel): r"""The organization ID.""" request_body: Annotated[ - List[RequestBody], + List[CreateOrganizationInvitationBulkRequestBody], FieldMetadata(request=RequestMetadata(media_type="application/json")), ] diff --git a/src/clerk_backend_api/models/createorganizationinvitationop.py b/src/clerk_backend_api/models/createorganizationinvitationop.py index f480332..70f2c42 100644 --- a/src/clerk_backend_api/models/createorganizationinvitationop.py +++ b/src/clerk_backend_api/models/createorganizationinvitationop.py @@ -24,11 +24,17 @@ class CreateOrganizationInvitationRequestBodyTypedDict(TypedDict): Must be an administrator in the organization. """ public_metadata: NotRequired[Dict[str, Any]] - r"""Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API.""" + r"""Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. + When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. + """ private_metadata: NotRequired[Dict[str, Any]] - r"""Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API.""" + r"""Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. + When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. + """ redirect_url: NotRequired[str] r"""Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email.""" + expires_in_days: NotRequired[Nullable[int]] + r"""The number of days the invitation will be valid for. By default, the invitation has a 30 days expire.""" class CreateOrganizationInvitationRequestBody(BaseModel): @@ -44,14 +50,21 @@ class CreateOrganizationInvitationRequestBody(BaseModel): """ public_metadata: Optional[Dict[str, Any]] = None - r"""Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API.""" + r"""Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. + When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. + """ private_metadata: Optional[Dict[str, Any]] = None - r"""Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API.""" + r"""Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. + When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. + """ redirect_url: Optional[str] = None r"""Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email.""" + expires_in_days: OptionalNullable[int] = UNSET + r"""The number of days the invitation will be valid for. By default, the invitation has a 30 days expire.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = [ @@ -59,8 +72,9 @@ def serialize_model(self, handler): "public_metadata", "private_metadata", "redirect_url", + "expires_in_days", ] - nullable_fields = ["inviter_user_id"] + nullable_fields = ["inviter_user_id", "expires_in_days"] null_default_fields = [] serialized = handler(self) @@ -91,7 +105,7 @@ def serialize_model(self, handler): class CreateOrganizationInvitationRequestTypedDict(TypedDict): organization_id: str r"""The ID of the organization for which to send the invitation""" - request_body: CreateOrganizationInvitationRequestBodyTypedDict + request_body: NotRequired[CreateOrganizationInvitationRequestBodyTypedDict] class CreateOrganizationInvitationRequest(BaseModel): @@ -101,6 +115,6 @@ class CreateOrganizationInvitationRequest(BaseModel): r"""The ID of the organization for which to send the invitation""" request_body: Annotated[ - CreateOrganizationInvitationRequestBody, + Optional[CreateOrganizationInvitationRequestBody], FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] + ] = None diff --git a/src/clerk_backend_api/models/createorganizationop.py b/src/clerk_backend_api/models/createorganizationop.py index d172a19..0bb3102 100644 --- a/src/clerk_backend_api/models/createorganizationop.py +++ b/src/clerk_backend_api/models/createorganizationop.py @@ -11,7 +11,7 @@ class CreateOrganizationRequestBodyTypedDict(TypedDict): r"""The name of the new organization. May not contain URLs or HTML. """ - created_by: str + created_by: NotRequired[str] r"""The ID of the User who will become the administrator for the new organization""" private_metadata: NotRequired[Dict[str, Any]] r"""Metadata saved on the organization, accessible only from the Backend API""" @@ -34,7 +34,7 @@ class CreateOrganizationRequestBody(BaseModel): May not contain URLs or HTML. """ - created_by: str + created_by: Optional[str] = None r"""The ID of the User who will become the administrator for the new organization""" private_metadata: Optional[Dict[str, Any]] = None diff --git a/src/clerk_backend_api/models/createsamlconnectionop.py b/src/clerk_backend_api/models/createsamlconnectionop.py index fb58e45..b378851 100644 --- a/src/clerk_backend_api/models/createsamlconnectionop.py +++ b/src/clerk_backend_api/models/createsamlconnectionop.py @@ -61,6 +61,8 @@ class CreateSAMLConnectionRequestBodyTypedDict(TypedDict): r"""The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties""" idp_metadata: NotRequired[Nullable[str]] r"""The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties""" + organization_id: NotRequired[Nullable[str]] + r"""The ID of the organization to which users of this SAML Connection will be added""" attribute_mapping: NotRequired[ Nullable[CreateSAMLConnectionAttributeMappingTypedDict] ] @@ -92,6 +94,9 @@ class CreateSAMLConnectionRequestBody(BaseModel): idp_metadata: OptionalNullable[str] = UNSET r"""The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties""" + organization_id: OptionalNullable[str] = UNSET + r"""The ID of the organization to which users of this SAML Connection will be added""" + attribute_mapping: OptionalNullable[CreateSAMLConnectionAttributeMapping] = UNSET r"""Define the attribute name mapping between Identity Provider and Clerk's user properties""" @@ -103,6 +108,7 @@ def serialize_model(self, handler): "idp_certificate", "idp_metadata_url", "idp_metadata", + "organization_id", "attribute_mapping", ] nullable_fields = [ @@ -111,6 +117,7 @@ def serialize_model(self, handler): "idp_certificate", "idp_metadata_url", "idp_metadata", + "organization_id", "attribute_mapping", ] null_default_fields = [] diff --git a/src/clerk_backend_api/models/createsessionop.py b/src/clerk_backend_api/models/createsessionop.py new file mode 100644 index 0000000..a78f6e6 --- /dev/null +++ b/src/clerk_backend_api/models/createsessionop.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from clerk_backend_api.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class CreateSessionRequestBodyTypedDict(TypedDict): + user_id: NotRequired[str] + r"""The ID representing the user""" + + +class CreateSessionRequestBody(BaseModel): + user_id: Optional[str] = None + r"""The ID representing the user""" diff --git a/src/clerk_backend_api/models/createsessiontokenfromtemplateop.py b/src/clerk_backend_api/models/createsessiontokenfromtemplateop.py index 15852db..d93fa7a 100644 --- a/src/clerk_backend_api/models/createsessiontokenfromtemplateop.py +++ b/src/clerk_backend_api/models/createsessiontokenfromtemplateop.py @@ -1,18 +1,66 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from clerk_backend_api.types import BaseModel -from clerk_backend_api.utils import FieldMetadata, PathParamMetadata +from clerk_backend_api.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from clerk_backend_api.utils import FieldMetadata, PathParamMetadata, RequestMetadata from enum import Enum +from pydantic import model_serializer from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict +class CreateSessionTokenFromTemplateRequestBodyTypedDict(TypedDict): + expires_in_seconds: NotRequired[Nullable[float]] + r"""Use this parameter to override the JWT token lifetime.""" + + +class CreateSessionTokenFromTemplateRequestBody(BaseModel): + expires_in_seconds: OptionalNullable[float] = UNSET + r"""Use this parameter to override the JWT token lifetime.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["expires_in_seconds"] + nullable_fields = ["expires_in_seconds"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + class CreateSessionTokenFromTemplateRequestTypedDict(TypedDict): session_id: str r"""The ID of the session""" template_name: str r"""The name of the JWT Template defined in your instance (e.g. `custom_hasura`).""" + request_body: NotRequired[CreateSessionTokenFromTemplateRequestBodyTypedDict] class CreateSessionTokenFromTemplateRequest(BaseModel): @@ -26,6 +74,11 @@ class CreateSessionTokenFromTemplateRequest(BaseModel): ] r"""The name of the JWT Template defined in your instance (e.g. `custom_hasura`).""" + request_body: Annotated[ + Optional[CreateSessionTokenFromTemplateRequestBody], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None + class CreateSessionTokenFromTemplateObject(str, Enum): TOKEN = "token" diff --git a/src/clerk_backend_api/models/createsessiontokenop.py b/src/clerk_backend_api/models/createsessiontokenop.py new file mode 100644 index 0000000..b3fd6bf --- /dev/null +++ b/src/clerk_backend_api/models/createsessiontokenop.py @@ -0,0 +1,92 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from clerk_backend_api.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from clerk_backend_api.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from enum import Enum +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateSessionTokenRequestBodyTypedDict(TypedDict): + expires_in_seconds: NotRequired[Nullable[float]] + r"""Use this parameter to override the default session token lifetime.""" + + +class CreateSessionTokenRequestBody(BaseModel): + expires_in_seconds: OptionalNullable[float] = UNSET + r"""Use this parameter to override the default session token lifetime.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["expires_in_seconds"] + nullable_fields = ["expires_in_seconds"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class CreateSessionTokenRequestTypedDict(TypedDict): + session_id: str + r"""The ID of the session""" + request_body: NotRequired[CreateSessionTokenRequestBodyTypedDict] + + +class CreateSessionTokenRequest(BaseModel): + session_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The ID of the session""" + + request_body: Annotated[ + Optional[CreateSessionTokenRequestBody], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None + + +class CreateSessionTokenObject(str, Enum): + TOKEN = "token" + + +class CreateSessionTokenResponseBodyTypedDict(TypedDict): + r"""OK""" + + object: NotRequired[CreateSessionTokenObject] + jwt: NotRequired[str] + + +class CreateSessionTokenResponseBody(BaseModel): + r"""OK""" + + object: Optional[CreateSessionTokenObject] = None + + jwt: Optional[str] = None diff --git a/src/clerk_backend_api/models/createwaitlistentryop.py b/src/clerk_backend_api/models/createwaitlistentryop.py new file mode 100644 index 0000000..077b0f0 --- /dev/null +++ b/src/clerk_backend_api/models/createwaitlistentryop.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from clerk_backend_api.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class CreateWaitlistEntryRequestBodyTypedDict(TypedDict): + email_address: str + r"""The email address to add to the waitlist""" + notify: NotRequired[bool] + r"""Optional flag which denotes whether an email invitation should be sent to the given email address. + Defaults to `true`. + """ + + +class CreateWaitlistEntryRequestBody(BaseModel): + email_address: str + r"""The email address to add to the waitlist""" + + notify: Optional[bool] = None + r"""Optional flag which denotes whether an email invitation should be sent to the given email address. + Defaults to `true`. + """ diff --git a/src/clerk_backend_api/models/emailaddress.py b/src/clerk_backend_api/models/emailaddress.py index 59e2870..df5e82d 100644 --- a/src/clerk_backend_api/models/emailaddress.py +++ b/src/clerk_backend_api/models/emailaddress.py @@ -24,24 +24,9 @@ class EmailAddressObject(str, Enum, metaclass=utils.OpenEnumMeta): EMAIL_ADDRESS = "email_address" -class OauthVerificationStatus(str, Enum, metaclass=utils.OpenEnumMeta): +class FromOAuthVerificationStatus(str, Enum): UNVERIFIED = "unverified" VERIFIED = "verified" - FAILED = "failed" - EXPIRED = "expired" - TRANSFERABLE = "transferable" - - -class OauthVerificationStrategy(str, Enum, metaclass=utils.OpenEnumMeta): - OAUTH_GOOGLE = "oauth_google" - OAUTH_MOCK = "oauth_mock" - FROM_OAUTH_GOOGLE = "from_oauth_google" - FROM_OAUTH_DISCORD = "from_oauth_discord" - FROM_OAUTH_MICROSOFT = "from_oauth_microsoft" - OAUTH_APPLE = "oauth_apple" - OAUTH_MICROSOFT = "oauth_microsoft" - OAUTH_GITHUB = "oauth_github" - EMAIL_LINK = "email_link" class ErrorMetaTypedDict(TypedDict): @@ -78,27 +63,20 @@ class ErrorClerkError(BaseModel): Error = ErrorClerkError -class OauthTypedDict(TypedDict): - status: OauthVerificationStatus - strategy: OauthVerificationStrategy - expire_at: int - external_verification_redirect_url: NotRequired[str] +class FromOAuthTypedDict(TypedDict): + status: FromOAuthVerificationStatus + strategy: str + expire_at: Nullable[int] error: NotRequired[Nullable[ErrorTypedDict]] attempts: NotRequired[Nullable[int]] -class Oauth(BaseModel): - status: Annotated[ - OauthVerificationStatus, PlainValidator(validate_open_enum(False)) - ] - - strategy: Annotated[ - OauthVerificationStrategy, PlainValidator(validate_open_enum(False)) - ] +class FromOAuth(BaseModel): + status: FromOAuthVerificationStatus - expire_at: int + strategy: str - external_verification_redirect_url: Optional[str] = None + expire_at: Nullable[int] error: OptionalNullable[Error] = UNSET @@ -106,8 +84,8 @@ class Oauth(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["external_verification_redirect_url", "error", "attempts"] - nullable_fields = ["error", "attempts"] + optional_fields = ["error", "attempts"] + nullable_fields = ["expire_at", "error", "attempts"] null_default_fields = [] serialized = handler(self) @@ -227,11 +205,11 @@ class Otp(BaseModel): VerificationTypedDict = TypeAliasType( - "VerificationTypedDict", Union[OtpTypedDict, AdminTypedDict, OauthTypedDict] + "VerificationTypedDict", Union[OtpTypedDict, AdminTypedDict, FromOAuthTypedDict] ) -Verification = TypeAliasType("Verification", Union[Otp, Admin, Oauth]) +Verification = TypeAliasType("Verification", Union[Otp, Admin, FromOAuth]) class EmailAddressTypedDict(TypedDict): @@ -254,6 +232,10 @@ class EmailAddressTypedDict(TypedDict): """ id: NotRequired[str] + matches_sso_connection: NotRequired[bool] + r"""Indicates whether this email address domain matches an active enterprise connection. + + """ class EmailAddress(BaseModel): @@ -284,9 +266,14 @@ class EmailAddress(BaseModel): id: Optional[str] = None + matches_sso_connection: Optional[bool] = None + r"""Indicates whether this email address domain matches an active enterprise connection. + + """ + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["id"] + optional_fields = ["id", "matches_sso_connection"] nullable_fields = ["verification"] null_default_fields = [] diff --git a/src/clerk_backend_api/models/getoauthaccesstokenop.py b/src/clerk_backend_api/models/getoauthaccesstokenop.py index 211cf57..2425955 100644 --- a/src/clerk_backend_api/models/getoauthaccesstokenop.py +++ b/src/clerk_backend_api/models/getoauthaccesstokenop.py @@ -51,6 +51,8 @@ class ResponseBodyTypedDict(TypedDict): """ token_secret: NotRequired[str] r"""The token secret. Only present for OAuth 1.0 tokens.""" + expires_at: NotRequired[Nullable[int]] + r"""Unix timestamp of the access token expiration.""" class ResponseBody(BaseModel): @@ -80,6 +82,9 @@ class ResponseBody(BaseModel): token_secret: Optional[str] = None r"""The token secret. Only present for OAuth 1.0 tokens.""" + expires_at: OptionalNullable[int] = UNSET + r"""Unix timestamp of the access token expiration.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = [ @@ -92,8 +97,9 @@ def serialize_model(self, handler): "label", "scopes", "token_secret", + "expires_at", ] - nullable_fields = ["label"] + nullable_fields = ["label", "expires_at"] null_default_fields = [] serialized = handler(self) diff --git a/src/clerk_backend_api/models/getuserlistop.py b/src/clerk_backend_api/models/getuserlistop.py index 1f6b58b..5f4111d 100644 --- a/src/clerk_backend_api/models/getuserlistop.py +++ b/src/clerk_backend_api/models/getuserlistop.py @@ -3,6 +3,7 @@ from __future__ import annotations from clerk_backend_api.types import BaseModel from clerk_backend_api.utils import FieldMetadata, QueryParamMetadata +import pydantic from typing import List, Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -60,10 +61,40 @@ class GetUserListRequestTypedDict(TypedDict): For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names. The query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well. """ + email_address_query: NotRequired[str] + r"""Returns users with emails that match the given query, via case-insensitive partial match. + For example, `email_address_query=ello` will match a user with the email `HELLO@example.com`. + """ + phone_number_query: NotRequired[str] + r"""Returns users with phone numbers that match the given query, via case-insensitive partial match. + For example, `phone_number_query=555` will match a user with the phone number `+1555xxxxxxx`. + """ + username_query: NotRequired[str] + r"""Returns users with usernames that match the given query, via case-insensitive partial match. + For example, `username_query=CoolUser` will match a user with the username `SomeCoolUser`. + """ + name_query: NotRequired[str] + r"""Returns users with names that match the given query, via case-insensitive partial match.""" + last_active_at_before: NotRequired[int] + r"""Returns users whose last session activity was before the given date (with millisecond precision). + Example: use 1700690400000 to retrieve users whose last session activity was before 2023-11-23. + """ + last_active_at_after: NotRequired[int] + r"""Returns users whose last session activity was after the given date (with millisecond precision). + Example: use 1700690400000 to retrieve users whose last session activity was after 2023-11-23. + """ last_active_at_since: NotRequired[int] - r"""Returns users that had session activity since the given date, with day precision. - Providing a value with higher precision than day will result in an error. + r"""Returns users that had session activity since the given date. Example: use 1700690400000 to retrieve users that had session activity from 2023-11-23 until the current day. + Deprecated in favor of `last_active_at_after`. + """ + created_at_before: NotRequired[int] + r"""Returns users who have been created before the given date (with millisecond precision). + Example: use 1730160000000 to retrieve users who have been created before 2024-10-29. + """ + created_at_after: NotRequired[int] + r"""Returns users who have been created after the given date (with millisecond precision). + Example: use 1730160000000 to retrieve users who have been created after 2024-10-29. """ limit: NotRequired[int] r"""Applies a limit to the number of results returned. @@ -169,13 +200,78 @@ class GetUserListRequest(BaseModel): The query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well. """ + email_address_query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Returns users with emails that match the given query, via case-insensitive partial match. + For example, `email_address_query=ello` will match a user with the email `HELLO@example.com`. + """ + + phone_number_query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Returns users with phone numbers that match the given query, via case-insensitive partial match. + For example, `phone_number_query=555` will match a user with the phone number `+1555xxxxxxx`. + """ + + username_query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Returns users with usernames that match the given query, via case-insensitive partial match. + For example, `username_query=CoolUser` will match a user with the username `SomeCoolUser`. + """ + + name_query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Returns users with names that match the given query, via case-insensitive partial match.""" + + last_active_at_before: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Returns users whose last session activity was before the given date (with millisecond precision). + Example: use 1700690400000 to retrieve users whose last session activity was before 2023-11-23. + """ + + last_active_at_after: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Returns users whose last session activity was after the given date (with millisecond precision). + Example: use 1700690400000 to retrieve users whose last session activity was after 2023-11-23. + """ + last_active_at_since: Annotated[ Optional[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ), FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None - r"""Returns users that had session activity since the given date, with day precision. - Providing a value with higher precision than day will result in an error. + r"""Returns users that had session activity since the given date. Example: use 1700690400000 to retrieve users that had session activity from 2023-11-23 until the current day. + Deprecated in favor of `last_active_at_after`. + """ + + created_at_before: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Returns users who have been created before the given date (with millisecond precision). + Example: use 1730160000000 to retrieve users who have been created before 2024-10-29. + """ + + created_at_after: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Returns users who have been created after the given date (with millisecond precision). + Example: use 1730160000000 to retrieve users who have been created after 2024-10-29. """ limit: Annotated[ diff --git a/src/clerk_backend_api/models/getuserscountop.py b/src/clerk_backend_api/models/getuserscountop.py index 7d14483..43122c9 100644 --- a/src/clerk_backend_api/models/getuserscountop.py +++ b/src/clerk_backend_api/models/getuserscountop.py @@ -43,6 +43,21 @@ class GetUsersCountRequestTypedDict(TypedDict): For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names. The query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well. """ + email_address_query: NotRequired[str] + r"""Counts users with emails that match the given query, via case-insensitive partial match. + For example, `email_address_query=ello` will match a user with the email `HELLO@example.com`, + and will be included in the resulting count. + """ + phone_number_query: NotRequired[str] + r"""Counts users with phone numbers that match the given query, via case-insensitive partial match. + For example, `phone_number_query=555` will match a user with the phone number `+1555xxxxxxx`, + and will be included in the resulting count. + """ + username_query: NotRequired[str] + r"""Counts users with usernames that match the given query, via case-insensitive partial match. + For example, `username_query=CoolUser` will match a user with the username `SomeCoolUser`, + and will be included in the resulting count. + """ class GetUsersCountRequest(BaseModel): @@ -108,3 +123,30 @@ class GetUsersCountRequest(BaseModel): For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names. The query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well. """ + + email_address_query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Counts users with emails that match the given query, via case-insensitive partial match. + For example, `email_address_query=ello` will match a user with the email `HELLO@example.com`, + and will be included in the resulting count. + """ + + phone_number_query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Counts users with phone numbers that match the given query, via case-insensitive partial match. + For example, `phone_number_query=555` will match a user with the phone number `+1555xxxxxxx`, + and will be included in the resulting count. + """ + + username_query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Counts users with usernames that match the given query, via case-insensitive partial match. + For example, `username_query=CoolUser` will match a user with the username `SomeCoolUser`, + and will be included in the resulting count. + """ diff --git a/src/clerk_backend_api/models/identificationlink.py b/src/clerk_backend_api/models/identificationlink.py index 76cb025..6287eda 100644 --- a/src/clerk_backend_api/models/identificationlink.py +++ b/src/clerk_backend_api/models/identificationlink.py @@ -13,10 +13,9 @@ class Type(str, Enum, metaclass=utils.OpenEnumMeta): OAUTH_GOOGLE = "oauth_google" OAUTH_MOCK = "oauth_mock" SAML = "saml" - OAUTH_MICROSOFT = "oauth_microsoft" - EMAIL_LINK = "email_link" OAUTH_APPLE = "oauth_apple" OAUTH_DISCORD = "oauth_discord" + OAUTH_MICROSOFT = "oauth_microsoft" OAUTH_GITHUB = "oauth_github" diff --git a/src/clerk_backend_api/models/instance.py b/src/clerk_backend_api/models/instance.py new file mode 100644 index 0000000..9ad9ed0 --- /dev/null +++ b/src/clerk_backend_api/models/instance.py @@ -0,0 +1,73 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from clerk_backend_api.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from enum import Enum +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class InstanceObject(str, Enum): + r"""String representing the object's type. Objects of the same type share the same value.""" + + INSTANCE = "instance" + + +class InstanceTypedDict(TypedDict): + r"""Success""" + + object: NotRequired[InstanceObject] + r"""String representing the object's type. Objects of the same type share the same value.""" + id: NotRequired[str] + environment_type: NotRequired[str] + allowed_origins: NotRequired[Nullable[List[str]]] + + +class Instance(BaseModel): + r"""Success""" + + object: Optional[InstanceObject] = None + r"""String representing the object's type. Objects of the same type share the same value.""" + + id: Optional[str] = None + + environment_type: Optional[str] = None + + allowed_origins: OptionalNullable[List[str]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["object", "id", "environment_type", "allowed_origins"] + nullable_fields = ["allowed_origins"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/clerk_backend_api/models/wellknown_jwks.py b/src/clerk_backend_api/models/jwks.py similarity index 82% rename from src/clerk_backend_api/models/wellknown_jwks.py rename to src/clerk_backend_api/models/jwks.py index 254cbd6..75ef182 100644 --- a/src/clerk_backend_api/models/wellknown_jwks.py +++ b/src/clerk_backend_api/models/jwks.py @@ -13,6 +13,8 @@ class KeysTypedDict(TypedDict): alg: NotRequired[str] n: NotRequired[str] e: NotRequired[str] + x: NotRequired[str] + crv: NotRequired[str] class Keys(BaseModel): @@ -28,14 +30,18 @@ class Keys(BaseModel): e: Optional[str] = None + x: Optional[str] = None -class WellKnownJWKSTypedDict(TypedDict): + crv: Optional[str] = None + + +class JwksTypedDict(TypedDict): r"""Get the JSON Web Key Set""" keys: NotRequired[List[KeysTypedDict]] -class WellKnownJWKS(BaseModel): +class Jwks(BaseModel): r"""Get the JSON Web Key Set""" keys: Optional[List[Keys]] = None diff --git a/src/clerk_backend_api/models/listinvitationsop.py b/src/clerk_backend_api/models/listinvitationsop.py index 7759157..092de60 100644 --- a/src/clerk_backend_api/models/listinvitationsop.py +++ b/src/clerk_backend_api/models/listinvitationsop.py @@ -29,6 +29,8 @@ class ListInvitationsRequestTypedDict(TypedDict): """ status: NotRequired[ListInvitationsQueryParamStatus] r"""Filter invitations based on their status""" + query: NotRequired[str] + r"""Filter invitations based on their `email_address` or `id`""" class ListInvitationsRequest(BaseModel): @@ -54,3 +56,9 @@ class ListInvitationsRequest(BaseModel): FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None r"""Filter invitations based on their status""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Filter invitations based on their `email_address` or `id`""" diff --git a/src/clerk_backend_api/models/listsamlconnectionsop.py b/src/clerk_backend_api/models/listsamlconnectionsop.py index 21da0f1..96033f5 100644 --- a/src/clerk_backend_api/models/listsamlconnectionsop.py +++ b/src/clerk_backend_api/models/listsamlconnectionsop.py @@ -3,7 +3,7 @@ from __future__ import annotations from clerk_backend_api.types import BaseModel from clerk_backend_api.utils import FieldMetadata, QueryParamMetadata -from typing import Optional +from typing import List, Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -17,6 +17,15 @@ class ListSAMLConnectionsRequestTypedDict(TypedDict): Needs to be an integer greater or equal to zero. To be used in conjunction with `limit`. """ + organization_id: NotRequired[List[str]] + r"""Returns SAML connections that have an associated organization ID to the + given organizations. + For each organization id, the `+` and `-` can be + prepended to the id, which denote whether the + respective organization should be included or + excluded from the result set. + Accepts up to 100 organization ids. + """ class ListSAMLConnectionsRequest(BaseModel): @@ -36,3 +45,16 @@ class ListSAMLConnectionsRequest(BaseModel): Needs to be an integer greater or equal to zero. To be used in conjunction with `limit`. """ + + organization_id: Annotated[ + Optional[List[str]], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Returns SAML connections that have an associated organization ID to the + given organizations. + For each organization id, the `+` and `-` can be + prepended to the id, which denote whether the + respective organization should be included or + excluded from the result set. + Accepts up to 100 organization ids. + """ diff --git a/src/clerk_backend_api/models/listwaitlistentriesop.py b/src/clerk_backend_api/models/listwaitlistentriesop.py new file mode 100644 index 0000000..d909c80 --- /dev/null +++ b/src/clerk_backend_api/models/listwaitlistentriesop.py @@ -0,0 +1,84 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from clerk_backend_api.types import BaseModel +from clerk_backend_api.utils import FieldMetadata, QueryParamMetadata +from enum import Enum +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListWaitlistEntriesQueryParamStatus(str, Enum): + r"""Filter waitlist entries by their status""" + + PENDING = "pending" + INVITED = "invited" + COMPLETED = "completed" + REJECTED = "rejected" + + +class ListWaitlistEntriesRequestTypedDict(TypedDict): + limit: NotRequired[int] + r"""Applies a limit to the number of results returned. + Can be used for paginating the results together with `offset`. + """ + offset: NotRequired[int] + r"""Skip the first `offset` results when paginating. + Needs to be an integer greater or equal to zero. + To be used in conjunction with `limit`. + """ + query: NotRequired[str] + r"""Filter waitlist entries by email address""" + status: NotRequired[ListWaitlistEntriesQueryParamStatus] + r"""Filter waitlist entries by their status""" + order_by: NotRequired[str] + r"""Specify the order of results. Supported values are: + - `created_at` + - `email_address` + - `invited_at` + + Use `+` for ascending or `-` for descending order. Defaults to `-created_at`. + """ + + +class ListWaitlistEntriesRequest(BaseModel): + limit: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 10 + r"""Applies a limit to the number of results returned. + Can be used for paginating the results together with `offset`. + """ + + offset: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 0 + r"""Skip the first `offset` results when paginating. + Needs to be an integer greater or equal to zero. + To be used in conjunction with `limit`. + """ + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Filter waitlist entries by email address""" + + status: Annotated[ + Optional[ListWaitlistEntriesQueryParamStatus], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Filter waitlist entries by their status""" + + order_by: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = "-created_at" + r"""Specify the order of results. Supported values are: + - `created_at` + - `email_address` + - `invited_at` + + Use `+` for ascending or `-` for descending order. Defaults to `-created_at`. + """ diff --git a/src/clerk_backend_api/models/oauthapplication.py b/src/clerk_backend_api/models/oauthapplication.py index 30f5321..23d9ecf 100644 --- a/src/clerk_backend_api/models/oauthapplication.py +++ b/src/clerk_backend_api/models/oauthapplication.py @@ -22,6 +22,8 @@ class OAuthApplicationTypedDict(TypedDict): authorize_url: str token_fetch_url: str user_info_url: str + discovery_url: str + token_introspection_url: str created_at: int r"""Unix timestamp of creation. @@ -55,6 +57,10 @@ class OAuthApplication(BaseModel): user_info_url: str + discovery_url: str + + token_introspection_url: str + created_at: int r"""Unix timestamp of creation. diff --git a/src/clerk_backend_api/models/oauthapplicationwithsecret.py b/src/clerk_backend_api/models/oauthapplicationwithsecret.py index 9038e0a..07fa398 100644 --- a/src/clerk_backend_api/models/oauthapplicationwithsecret.py +++ b/src/clerk_backend_api/models/oauthapplicationwithsecret.py @@ -23,6 +23,8 @@ class OAuthApplicationWithSecretTypedDict(TypedDict): authorize_url: str token_fetch_url: str user_info_url: str + discovery_url: str + token_introspection_url: str created_at: int r"""Unix timestamp of creation. @@ -60,6 +62,10 @@ class OAuthApplicationWithSecret(BaseModel): user_info_url: str + discovery_url: str + + token_introspection_url: str + created_at: int r"""Unix timestamp of creation. diff --git a/src/clerk_backend_api/models/organization.py b/src/clerk_backend_api/models/organization.py index 242fabc..9b7921f 100644 --- a/src/clerk_backend_api/models/organization.py +++ b/src/clerk_backend_api/models/organization.py @@ -36,7 +36,7 @@ class OrganizationTypedDict(TypedDict): """ members_count: NotRequired[Nullable[int]] admin_delete_enabled: NotRequired[bool] - created_by: NotRequired[str] + created_by: NotRequired[Nullable[str]] class Organization(BaseModel): @@ -68,12 +68,12 @@ class Organization(BaseModel): admin_delete_enabled: Optional[bool] = None - created_by: Optional[str] = None + created_by: OptionalNullable[str] = UNSET @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = ["members_count", "admin_delete_enabled", "created_by"] - nullable_fields = ["members_count"] + nullable_fields = ["members_count", "created_by"] null_default_fields = [] serialized = handler(self) diff --git a/src/clerk_backend_api/models/organizationinvitation.py b/src/clerk_backend_api/models/organizationinvitation.py index 9bf2ff8..4c90522 100644 --- a/src/clerk_backend_api/models/organizationinvitation.py +++ b/src/clerk_backend_api/models/organizationinvitation.py @@ -1,8 +1,15 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from clerk_backend_api.types import BaseModel +from clerk_backend_api.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) from enum import Enum +from pydantic import model_serializer from typing import Any, Dict, Optional from typing_extensions import NotRequired, TypedDict @@ -28,6 +35,11 @@ class OrganizationInvitationTypedDict(TypedDict): status: NotRequired[str] public_metadata: NotRequired[Dict[str, Any]] private_metadata: NotRequired[Dict[str, Any]] + url: NotRequired[Nullable[str]] + expires_at: NotRequired[Nullable[int]] + r"""Unix timestamp of expiration. + + """ created_at: NotRequired[int] r"""Unix timestamp of creation.""" updated_at: NotRequired[int] @@ -58,8 +70,59 @@ class OrganizationInvitation(BaseModel): private_metadata: Optional[Dict[str, Any]] = None + url: OptionalNullable[str] = UNSET + + expires_at: OptionalNullable[int] = UNSET + r"""Unix timestamp of expiration. + + """ + created_at: Optional[int] = None r"""Unix timestamp of creation.""" updated_at: Optional[int] = None r"""Unix timestamp of last update.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "id", + "object", + "email_address", + "role", + "role_name", + "organization_id", + "status", + "public_metadata", + "private_metadata", + "url", + "expires_at", + "created_at", + "updated_at", + ] + nullable_fields = ["url", "expires_at"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/clerk_backend_api/models/organizationinvitationwithpublicorganizationdata.py b/src/clerk_backend_api/models/organizationinvitationwithpublicorganizationdata.py index d74a63c..00b5bcb 100644 --- a/src/clerk_backend_api/models/organizationinvitationwithpublicorganizationdata.py +++ b/src/clerk_backend_api/models/organizationinvitationwithpublicorganizationdata.py @@ -1,8 +1,15 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from clerk_backend_api.types import BaseModel +from clerk_backend_api.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) from enum import Enum +from pydantic import model_serializer from typing import Any, Dict, Optional from typing_extensions import NotRequired, TypedDict @@ -48,6 +55,7 @@ class OrganizationInvitationWithPublicOrganizationDataTypedDict(TypedDict): status: NotRequired[str] public_metadata: NotRequired[Dict[str, Any]] private_metadata: NotRequired[Dict[str, Any]] + url: NotRequired[Nullable[str]] public_organization_data: NotRequired[PublicOrganizationDataTypedDict] created_at: NotRequired[int] r"""Unix timestamp of creation.""" @@ -79,6 +87,8 @@ class OrganizationInvitationWithPublicOrganizationData(BaseModel): private_metadata: Optional[Dict[str, Any]] = None + url: OptionalNullable[str] = UNSET + public_organization_data: Optional[PublicOrganizationData] = None created_at: Optional[int] = None @@ -86,3 +96,47 @@ class OrganizationInvitationWithPublicOrganizationData(BaseModel): updated_at: Optional[int] = None r"""Unix timestamp of last update.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "id", + "object", + "email_address", + "role", + "role_name", + "organization_id", + "status", + "public_metadata", + "private_metadata", + "url", + "public_organization_data", + "created_at", + "updated_at", + ] + nullable_fields = ["url"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/clerk_backend_api/models/organizationmembership.py b/src/clerk_backend_api/models/organizationmembership.py index 515dc2a6..f09aa76 100644 --- a/src/clerk_backend_api/models/organizationmembership.py +++ b/src/clerk_backend_api/models/organizationmembership.py @@ -43,7 +43,7 @@ class OrganizationMembershipOrganizationTypedDict(TypedDict): """ members_count: NotRequired[Nullable[int]] admin_delete_enabled: NotRequired[bool] - created_by: NotRequired[str] + created_by: NotRequired[Nullable[str]] class OrganizationMembershipOrganization(BaseModel): @@ -75,12 +75,12 @@ class OrganizationMembershipOrganization(BaseModel): admin_delete_enabled: Optional[bool] = None - created_by: Optional[str] = None + created_by: OptionalNullable[str] = UNSET @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = ["members_count", "admin_delete_enabled", "created_by"] - nullable_fields = ["members_count"] + nullable_fields = ["members_count", "created_by"] null_default_fields = [] serialized = handler(self) diff --git a/src/clerk_backend_api/models/organizationwithlogo.py b/src/clerk_backend_api/models/organizationwithlogo.py index 4323c0e..708506e 100644 --- a/src/clerk_backend_api/models/organizationwithlogo.py +++ b/src/clerk_backend_api/models/organizationwithlogo.py @@ -38,7 +38,7 @@ class OrganizationWithLogoTypedDict(TypedDict): image_url: str members_count: NotRequired[Nullable[int]] admin_delete_enabled: NotRequired[bool] - created_by: NotRequired[str] + created_by: NotRequired[Nullable[str]] logo_url: NotRequired[str] has_image: NotRequired[bool] @@ -74,7 +74,7 @@ class OrganizationWithLogo(BaseModel): admin_delete_enabled: Optional[bool] = None - created_by: Optional[str] = None + created_by: OptionalNullable[str] = UNSET logo_url: Annotated[ Optional[str], @@ -94,7 +94,7 @@ def serialize_model(self, handler): "logo_url", "has_image", ] - nullable_fields = ["members_count"] + nullable_fields = ["members_count", "created_by"] null_default_fields = [] serialized = handler(self) diff --git a/src/clerk_backend_api/models/schemas_samlconnection.py b/src/clerk_backend_api/models/schemas_samlconnection.py index 2c4e6ee..5a48002 100644 --- a/src/clerk_backend_api/models/schemas_samlconnection.py +++ b/src/clerk_backend_api/models/schemas_samlconnection.py @@ -60,6 +60,7 @@ class SchemasSAMLConnectionTypedDict(TypedDict): """ idp_metadata_url: NotRequired[Nullable[str]] idp_metadata: NotRequired[Nullable[str]] + organization_id: NotRequired[Nullable[str]] attribute_mapping: NotRequired[AttributeMappingTypedDict] allow_subdomains: NotRequired[bool] allow_idp_initiated: NotRequired[bool] @@ -109,6 +110,8 @@ class SchemasSAMLConnection(BaseModel): idp_metadata: OptionalNullable[str] = UNSET + organization_id: OptionalNullable[str] = UNSET + attribute_mapping: Optional[AttributeMapping] = None allow_subdomains: Optional[bool] = None @@ -122,6 +125,7 @@ def serialize_model(self, handler): optional_fields = [ "idp_metadata_url", "idp_metadata", + "organization_id", "attribute_mapping", "allow_subdomains", "allow_idp_initiated", @@ -133,6 +137,7 @@ def serialize_model(self, handler): "idp_certificate", "idp_metadata_url", "idp_metadata", + "organization_id", ] null_default_fields = [] diff --git a/src/clerk_backend_api/models/signup.py b/src/clerk_backend_api/models/signup.py index 3ae30ce..fab5086 100644 --- a/src/clerk_backend_api/models/signup.py +++ b/src/clerk_backend_api/models/signup.py @@ -65,6 +65,10 @@ class SignUpTypedDict(TypedDict): external_id: NotRequired[Nullable[str]] created_session_id: NotRequired[Nullable[str]] created_user_id: NotRequired[Nullable[str]] + legal_accepted_at: NotRequired[Nullable[int]] + r"""Unix timestamp at which the user accepted the legal requirements. + + """ external_account: NotRequired[ExternalAccountTypedDict] @@ -115,6 +119,11 @@ class SignUp(BaseModel): created_user_id: OptionalNullable[str] = UNSET + legal_accepted_at: OptionalNullable[int] = UNSET + r"""Unix timestamp at which the user accepted the legal requirements. + + """ + external_account: Optional[ExternalAccount] = None @model_serializer(mode="wrap") @@ -136,6 +145,7 @@ def serialize_model(self, handler): "external_id", "created_session_id", "created_user_id", + "legal_accepted_at", "external_account", ] nullable_fields = [ @@ -148,6 +158,7 @@ def serialize_model(self, handler): "external_id", "created_session_id", "created_user_id", + "legal_accepted_at", ] null_default_fields = [] diff --git a/src/clerk_backend_api/models/updateemailaddressop.py b/src/clerk_backend_api/models/updateemailaddressop.py index aeb22c4..6bbdf7b 100644 --- a/src/clerk_backend_api/models/updateemailaddressop.py +++ b/src/clerk_backend_api/models/updateemailaddressop.py @@ -10,6 +10,7 @@ ) from clerk_backend_api.utils import FieldMetadata, PathParamMetadata, RequestMetadata from pydantic import model_serializer +from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -61,7 +62,7 @@ def serialize_model(self, handler): class UpdateEmailAddressRequestTypedDict(TypedDict): email_address_id: str r"""The ID of the email address to update""" - request_body: UpdateEmailAddressRequestBodyTypedDict + request_body: NotRequired[UpdateEmailAddressRequestBodyTypedDict] class UpdateEmailAddressRequest(BaseModel): @@ -71,6 +72,6 @@ class UpdateEmailAddressRequest(BaseModel): r"""The ID of the email address to update""" request_body: Annotated[ - UpdateEmailAddressRequestBody, + Optional[UpdateEmailAddressRequestBody], FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] + ] = None diff --git a/src/clerk_backend_api/models/updatejwttemplateop.py b/src/clerk_backend_api/models/updatejwttemplateop.py index 226cf74..371b73c 100644 --- a/src/clerk_backend_api/models/updatejwttemplateop.py +++ b/src/clerk_backend_api/models/updatejwttemplateop.py @@ -108,7 +108,7 @@ def serialize_model(self, handler): class UpdateJWTTemplateRequestTypedDict(TypedDict): template_id: str r"""The ID of the JWT template to update""" - request_body: UpdateJWTTemplateRequestBodyTypedDict + request_body: NotRequired[UpdateJWTTemplateRequestBodyTypedDict] class UpdateJWTTemplateRequest(BaseModel): @@ -118,6 +118,6 @@ class UpdateJWTTemplateRequest(BaseModel): r"""The ID of the JWT template to update""" request_body: Annotated[ - UpdateJWTTemplateRequestBody, + Optional[UpdateJWTTemplateRequestBody], FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] + ] = None diff --git a/src/clerk_backend_api/models/updateorganizationmembershipmetadataop.py b/src/clerk_backend_api/models/updateorganizationmembershipmetadataop.py index 3a12f3f..93afc22 100644 --- a/src/clerk_backend_api/models/updateorganizationmembershipmetadataop.py +++ b/src/clerk_backend_api/models/updateorganizationmembershipmetadataop.py @@ -35,7 +35,7 @@ class UpdateOrganizationMembershipMetadataRequestTypedDict(TypedDict): r"""The ID of the organization the membership belongs to""" user_id: str r"""The ID of the user that this membership belongs to""" - request_body: UpdateOrganizationMembershipMetadataRequestBodyTypedDict + request_body: NotRequired[UpdateOrganizationMembershipMetadataRequestBodyTypedDict] class UpdateOrganizationMembershipMetadataRequest(BaseModel): @@ -50,6 +50,6 @@ class UpdateOrganizationMembershipMetadataRequest(BaseModel): r"""The ID of the user that this membership belongs to""" request_body: Annotated[ - UpdateOrganizationMembershipMetadataRequestBody, + Optional[UpdateOrganizationMembershipMetadataRequestBody], FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] + ] = None diff --git a/src/clerk_backend_api/models/updatephonenumberop.py b/src/clerk_backend_api/models/updatephonenumberop.py index 676ccaf..2fa520b 100644 --- a/src/clerk_backend_api/models/updatephonenumberop.py +++ b/src/clerk_backend_api/models/updatephonenumberop.py @@ -10,6 +10,7 @@ ) from clerk_backend_api.utils import FieldMetadata, PathParamMetadata, RequestMetadata from pydantic import model_serializer +from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -72,7 +73,7 @@ def serialize_model(self, handler): class UpdatePhoneNumberRequestTypedDict(TypedDict): phone_number_id: str r"""The ID of the phone number to update""" - request_body: UpdatePhoneNumberRequestBodyTypedDict + request_body: NotRequired[UpdatePhoneNumberRequestBodyTypedDict] class UpdatePhoneNumberRequest(BaseModel): @@ -82,6 +83,6 @@ class UpdatePhoneNumberRequest(BaseModel): r"""The ID of the phone number to update""" request_body: Annotated[ - UpdatePhoneNumberRequestBody, + Optional[UpdatePhoneNumberRequestBody], FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] + ] = None diff --git a/src/clerk_backend_api/models/updatesamlconnectionop.py b/src/clerk_backend_api/models/updatesamlconnectionop.py index cedcc9f..c09aaa1 100644 --- a/src/clerk_backend_api/models/updatesamlconnectionop.py +++ b/src/clerk_backend_api/models/updatesamlconnectionop.py @@ -50,6 +50,8 @@ class UpdateSAMLConnectionRequestBodyTypedDict(TypedDict): r"""The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties and replaces them""" idp_metadata: NotRequired[Nullable[str]] r"""The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties""" + organization_id: NotRequired[Nullable[str]] + r"""The ID of the organization to which users of this SAML Connection will be added""" attribute_mapping: NotRequired[ Nullable[UpdateSAMLConnectionAttributeMappingTypedDict] ] @@ -88,6 +90,9 @@ class UpdateSAMLConnectionRequestBody(BaseModel): idp_metadata: OptionalNullable[str] = UNSET r"""The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties""" + organization_id: OptionalNullable[str] = UNSET + r"""The ID of the organization to which users of this SAML Connection will be added""" + attribute_mapping: OptionalNullable[UpdateSAMLConnectionAttributeMapping] = UNSET r"""Define the atrtibute name mapping between Identity Provider and Clerk's user properties""" @@ -116,6 +121,7 @@ def serialize_model(self, handler): "idp_certificate", "idp_metadata_url", "idp_metadata", + "organization_id", "attribute_mapping", "active", "sync_user_attributes", @@ -131,6 +137,7 @@ def serialize_model(self, handler): "idp_certificate", "idp_metadata_url", "idp_metadata", + "organization_id", "attribute_mapping", "active", "sync_user_attributes", diff --git a/src/clerk_backend_api/models/updatesignupop.py b/src/clerk_backend_api/models/updatesignupop.py index 37c0041..6da63cc 100644 --- a/src/clerk_backend_api/models/updatesignupop.py +++ b/src/clerk_backend_api/models/updatesignupop.py @@ -10,6 +10,7 @@ ) from clerk_backend_api.utils import FieldMetadata, PathParamMetadata, RequestMetadata from pydantic import model_serializer +from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -60,7 +61,7 @@ def serialize_model(self, handler): class UpdateSignUpRequestTypedDict(TypedDict): id: str r"""The ID of the sign-up to update""" - request_body: UpdateSignUpRequestBodyTypedDict + request_body: NotRequired[UpdateSignUpRequestBodyTypedDict] class UpdateSignUpRequest(BaseModel): @@ -70,6 +71,6 @@ class UpdateSignUpRequest(BaseModel): r"""The ID of the sign-up to update""" request_body: Annotated[ - UpdateSignUpRequestBody, + Optional[UpdateSignUpRequestBody], FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] + ] = None diff --git a/src/clerk_backend_api/models/updateusermetadataop.py b/src/clerk_backend_api/models/updateusermetadataop.py index ba59ccf..189fc13 100644 --- a/src/clerk_backend_api/models/updateusermetadataop.py +++ b/src/clerk_backend_api/models/updateusermetadataop.py @@ -46,7 +46,7 @@ class UpdateUserMetadataRequestBody(BaseModel): class UpdateUserMetadataRequestTypedDict(TypedDict): user_id: str r"""The ID of the user whose metadata will be updated and merged""" - request_body: UpdateUserMetadataRequestBodyTypedDict + request_body: NotRequired[UpdateUserMetadataRequestBodyTypedDict] class UpdateUserMetadataRequest(BaseModel): @@ -56,6 +56,6 @@ class UpdateUserMetadataRequest(BaseModel): r"""The ID of the user whose metadata will be updated and merged""" request_body: Annotated[ - UpdateUserMetadataRequestBody, + Optional[UpdateUserMetadataRequestBody], FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] + ] = None diff --git a/src/clerk_backend_api/models/uploadorganizationlogoop.py b/src/clerk_backend_api/models/uploadorganizationlogoop.py index f9ad454..55688dd 100644 --- a/src/clerk_backend_api/models/uploadorganizationlogoop.py +++ b/src/clerk_backend_api/models/uploadorganizationlogoop.py @@ -57,7 +57,7 @@ class UploadOrganizationLogoRequestBody(BaseModel): class UploadOrganizationLogoRequestTypedDict(TypedDict): organization_id: str r"""The ID of the organization for which to upload a logo""" - request_body: UploadOrganizationLogoRequestBodyTypedDict + request_body: NotRequired[UploadOrganizationLogoRequestBodyTypedDict] class UploadOrganizationLogoRequest(BaseModel): @@ -67,6 +67,6 @@ class UploadOrganizationLogoRequest(BaseModel): r"""The ID of the organization for which to upload a logo""" request_body: Annotated[ - UploadOrganizationLogoRequestBody, + Optional[UploadOrganizationLogoRequestBody], FieldMetadata(request=RequestMetadata(media_type="multipart/form-data")), - ] + ] = None diff --git a/src/clerk_backend_api/models/verifyclientop.py b/src/clerk_backend_api/models/verifyclientop.py index 7f7c1c7..877e1e5 100644 --- a/src/clerk_backend_api/models/verifyclientop.py +++ b/src/clerk_backend_api/models/verifyclientop.py @@ -7,10 +7,14 @@ class VerifyClientRequestBodyTypedDict(TypedDict): + r"""Parameters.""" + token: NotRequired[str] r"""A JWT that represents the active client.""" class VerifyClientRequestBody(BaseModel): + r"""Parameters.""" + token: Optional[str] = None r"""A JWT that represents the active client.""" diff --git a/src/clerk_backend_api/models/verifypasswordop.py b/src/clerk_backend_api/models/verifypasswordop.py index 89abf41..1e13d00 100644 --- a/src/clerk_backend_api/models/verifypasswordop.py +++ b/src/clerk_backend_api/models/verifypasswordop.py @@ -20,7 +20,7 @@ class VerifyPasswordRequestBody(BaseModel): class VerifyPasswordRequestTypedDict(TypedDict): user_id: str r"""The ID of the user for whom to verify the password""" - request_body: VerifyPasswordRequestBodyTypedDict + request_body: NotRequired[VerifyPasswordRequestBodyTypedDict] class VerifyPasswordRequest(BaseModel): @@ -30,9 +30,9 @@ class VerifyPasswordRequest(BaseModel): r"""The ID of the user for whom to verify the password""" request_body: Annotated[ - VerifyPasswordRequestBody, + Optional[VerifyPasswordRequestBody], FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] + ] = None class VerifyPasswordResponseBodyTypedDict(TypedDict): diff --git a/src/clerk_backend_api/models/verifytotpop.py b/src/clerk_backend_api/models/verifytotpop.py index afceaa0..8532d8b 100644 --- a/src/clerk_backend_api/models/verifytotpop.py +++ b/src/clerk_backend_api/models/verifytotpop.py @@ -21,7 +21,7 @@ class VerifyTOTPRequestBody(BaseModel): class VerifyTOTPRequestTypedDict(TypedDict): user_id: str r"""The ID of the user for whom to verify the TOTP""" - request_body: VerifyTOTPRequestBodyTypedDict + request_body: NotRequired[VerifyTOTPRequestBodyTypedDict] class VerifyTOTPRequest(BaseModel): @@ -31,9 +31,9 @@ class VerifyTOTPRequest(BaseModel): r"""The ID of the user for whom to verify the TOTP""" request_body: Annotated[ - VerifyTOTPRequestBody, + Optional[VerifyTOTPRequestBody], FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] + ] = None class CodeType(str, Enum): diff --git a/src/clerk_backend_api/models/waitlistentries.py b/src/clerk_backend_api/models/waitlistentries.py new file mode 100644 index 0000000..de1e11b --- /dev/null +++ b/src/clerk_backend_api/models/waitlistentries.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .waitlistentry import WaitlistEntry, WaitlistEntryTypedDict +from clerk_backend_api.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class WaitlistEntriesTypedDict(TypedDict): + r"""List of waitlist entries""" + + data: List[WaitlistEntryTypedDict] + total_count: int + r"""Total number of waitlist entries""" + + +class WaitlistEntries(BaseModel): + r"""List of waitlist entries""" + + data: List[WaitlistEntry] + + total_count: int + r"""Total number of waitlist entries""" diff --git a/src/clerk_backend_api/models/waitlistentry.py b/src/clerk_backend_api/models/waitlistentry.py new file mode 100644 index 0000000..34bbaf3 --- /dev/null +++ b/src/clerk_backend_api/models/waitlistentry.py @@ -0,0 +1,196 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from clerk_backend_api.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from enum import Enum +from pydantic import model_serializer +from typing import Any, Dict, Optional +from typing_extensions import NotRequired, TypedDict + + +class WaitlistEntryObject(str, Enum): + WAITLIST_ENTRY = "waitlist_entry" + + +class WaitlistEntryStatus(str, Enum): + PENDING = "pending" + INVITED = "invited" + REJECTED = "rejected" + COMPLETED = "completed" + + +class WaitlistEntryInvitationObject(str, Enum): + INVITATION = "invitation" + + +class WaitlistEntryInvitationStatus(str, Enum): + PENDING = "pending" + ACCEPTED = "accepted" + REVOKED = "revoked" + EXPIRED = "expired" + + +class WaitlistEntryInvitationTypedDict(TypedDict): + object: WaitlistEntryInvitationObject + id: str + email_address: str + status: WaitlistEntryInvitationStatus + created_at: int + r"""Unix timestamp of creation. + + """ + updated_at: int + r"""Unix timestamp of last update. + + """ + public_metadata: NotRequired[Dict[str, Any]] + revoked: NotRequired[bool] + url: NotRequired[Nullable[str]] + expires_at: NotRequired[Nullable[int]] + r"""Unix timestamp of expiration. + + """ + + +class WaitlistEntryInvitation(BaseModel): + object: WaitlistEntryInvitationObject + + id: str + + email_address: str + + status: WaitlistEntryInvitationStatus + + created_at: int + r"""Unix timestamp of creation. + + """ + + updated_at: int + r"""Unix timestamp of last update. + + """ + + public_metadata: Optional[Dict[str, Any]] = None + + revoked: Optional[bool] = None + + url: OptionalNullable[str] = UNSET + + expires_at: OptionalNullable[int] = UNSET + r"""Unix timestamp of expiration. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["public_metadata", "revoked", "url", "expires_at"] + nullable_fields = ["url", "expires_at"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class WaitlistEntryTypedDict(TypedDict): + object: WaitlistEntryObject + id: str + email_address: str + status: WaitlistEntryStatus + created_at: int + r"""Unix timestamp of creation. + + """ + updated_at: int + r"""Unix timestamp of last update. + + """ + is_locked: NotRequired[bool] + r"""Indicates if the waitlist entry is locked. Locked entries are being processed in a batch action and are unavailable for other actions. + + """ + invitation: NotRequired[Nullable[WaitlistEntryInvitationTypedDict]] + + +class WaitlistEntry(BaseModel): + object: WaitlistEntryObject + + id: str + + email_address: str + + status: WaitlistEntryStatus + + created_at: int + r"""Unix timestamp of creation. + + """ + + updated_at: int + r"""Unix timestamp of last update. + + """ + + is_locked: Optional[bool] = None + r"""Indicates if the waitlist entry is locked. Locked entries are being processed in a batch action and are unavailable for other actions. + + """ + + invitation: OptionalNullable[WaitlistEntryInvitation] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["is_locked", "invitation"] + nullable_fields = ["invitation"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/clerk_backend_api/models/web3wallet.py b/src/clerk_backend_api/models/web3wallet.py index 6205814..f9bdfc6 100644 --- a/src/clerk_backend_api/models/web3wallet.py +++ b/src/clerk_backend_api/models/web3wallet.py @@ -90,6 +90,7 @@ class Web3SignatureVerificationStatus(str, Enum): class Web3SignatureVerificationStrategy(str, Enum): WEB3_METAMASK_SIGNATURE = "web3_metamask_signature" WEB3_COINBASE_WALLET_SIGNATURE = "web3_coinbase_wallet_signature" + WEB3_OKX_WALLET_SIGNATURE = "web3_okx_wallet_signature" class Web3SignatureTypedDict(TypedDict): diff --git a/src/clerk_backend_api/oauthapplications_sdk.py b/src/clerk_backend_api/oauthapplications_sdk.py index af7d5b8..25b9f3b 100644 --- a/src/clerk_backend_api/oauthapplications_sdk.py +++ b/src/clerk_backend_api/oauthapplications_sdk.py @@ -3,8 +3,8 @@ from .basesdk import BaseSDK from clerk_backend_api import models, utils from clerk_backend_api._hooks import HookContext -from clerk_backend_api.types import OptionalNullable, UNSET -from typing import Any, Mapping, Optional +from clerk_backend_api.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Mapping, Optional, Union, cast class OauthApplicationsSDK(BaseSDK): @@ -88,7 +88,12 @@ def list( if utils.match_response(http_res, ["400", "403", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -183,7 +188,12 @@ async def list_async( if utils.match_response(http_res, ["400", "403", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -201,10 +211,12 @@ async def list_async( def create( self, *, - name: str, - callback_url: str, - scopes: Optional[str] = "profile email", - public: Optional[bool] = None, + request: Optional[ + Union[ + models.CreateOAuthApplicationRequestBody, + models.CreateOAuthApplicationRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -216,10 +228,7 @@ def create( The callback URL must be a valid url. All URL schemes are allowed such as `http://`, `https://`, `myapp://`, etc... - :param name: The name of the new OAuth application - :param callback_url: The callback URL of the new OAuth application - :param scopes: Define the allowed scopes for the new OAuth applications that dictate the user payload of the OAuth user info endpoint. Available scopes are `profile`, `email`, `public_metadata`, `private_metadata`. Provide the requested scopes as a string, separated by spaces. - :param public: If true, this client is public and cannot securely store a client secret. Only the authorization code flow with proof key for code exchange (PKCE) may be used. Public clients cannot be updated to be confidential clients, and vice versa. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -233,12 +242,11 @@ def create( if server_url is not None: base_url = server_url - request = models.CreateOAuthApplicationRequestBody( - name=name, - callback_url=callback_url, - scopes=scopes, - public=public, - ) + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[models.CreateOAuthApplicationRequestBody] + ) + request = cast(Optional[models.CreateOAuthApplicationRequestBody], request) req = self._build_request( method="POST", @@ -246,7 +254,7 @@ def create( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -254,7 +262,11 @@ def create( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.CreateOAuthApplicationRequestBody + request, + False, + True, + "json", + Optional[models.CreateOAuthApplicationRequestBody], ), timeout_ms=timeout_ms, ) @@ -286,7 +298,12 @@ def create( if utils.match_response(http_res, ["400", "403", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -304,10 +321,12 @@ def create( async def create_async( self, *, - name: str, - callback_url: str, - scopes: Optional[str] = "profile email", - public: Optional[bool] = None, + request: Optional[ + Union[ + models.CreateOAuthApplicationRequestBody, + models.CreateOAuthApplicationRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -319,10 +338,7 @@ async def create_async( The callback URL must be a valid url. All URL schemes are allowed such as `http://`, `https://`, `myapp://`, etc... - :param name: The name of the new OAuth application - :param callback_url: The callback URL of the new OAuth application - :param scopes: Define the allowed scopes for the new OAuth applications that dictate the user payload of the OAuth user info endpoint. Available scopes are `profile`, `email`, `public_metadata`, `private_metadata`. Provide the requested scopes as a string, separated by spaces. - :param public: If true, this client is public and cannot securely store a client secret. Only the authorization code flow with proof key for code exchange (PKCE) may be used. Public clients cannot be updated to be confidential clients, and vice versa. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -336,12 +352,11 @@ async def create_async( if server_url is not None: base_url = server_url - request = models.CreateOAuthApplicationRequestBody( - name=name, - callback_url=callback_url, - scopes=scopes, - public=public, - ) + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[models.CreateOAuthApplicationRequestBody] + ) + request = cast(Optional[models.CreateOAuthApplicationRequestBody], request) req = self._build_request_async( method="POST", @@ -349,7 +364,7 @@ async def create_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -357,7 +372,11 @@ async def create_async( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.CreateOAuthApplicationRequestBody + request, + False, + True, + "json", + Optional[models.CreateOAuthApplicationRequestBody], ), timeout_ms=timeout_ms, ) @@ -389,7 +408,12 @@ async def create_async( if utils.match_response(http_res, ["400", "403", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -478,7 +502,12 @@ def get( if utils.match_response(http_res, ["403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -567,7 +596,12 @@ async def get_async( if utils.match_response(http_res, ["403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -674,7 +708,12 @@ def update( if utils.match_response(http_res, ["403", "404", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -781,7 +820,12 @@ async def update_async( if utils.match_response(http_res, ["403", "404", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -869,7 +913,12 @@ def delete( if utils.match_response(http_res, ["403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -957,7 +1006,12 @@ async def delete_async( if utils.match_response(http_res, ["403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1047,7 +1101,12 @@ def rotate_secret( if utils.match_response(http_res, ["403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1137,7 +1196,12 @@ async def rotate_secret_async( if utils.match_response(http_res, ["403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/organizationdomain_sdk.py b/src/clerk_backend_api/organizationdomain_sdk.py index 79961ce..1fd45fd 100644 --- a/src/clerk_backend_api/organizationdomain_sdk.py +++ b/src/clerk_backend_api/organizationdomain_sdk.py @@ -100,7 +100,12 @@ def update( if utils.match_response(http_res, ["400", "404", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -207,7 +212,12 @@ async def update_async( if utils.match_response(http_res, ["400", "404", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/organizationdomains_sdk.py b/src/clerk_backend_api/organizationdomains_sdk.py index d035391..b2af66f 100644 --- a/src/clerk_backend_api/organizationdomains_sdk.py +++ b/src/clerk_backend_api/organizationdomains_sdk.py @@ -102,7 +102,12 @@ def create( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -211,7 +216,12 @@ async def create_async( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -312,7 +322,12 @@ def list( if utils.match_response(http_res, ["401", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -413,7 +428,12 @@ async def list_async( if utils.match_response(http_res, ["401", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -503,7 +523,12 @@ def delete( if utils.match_response(http_res, ["400", "401", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -593,7 +618,12 @@ async def delete_async( if utils.match_response(http_res, ["400", "401", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/organizationinvitations_sdk.py b/src/clerk_backend_api/organizationinvitations_sdk.py index 08f9e9a..90c3034 100644 --- a/src/clerk_backend_api/organizationinvitations_sdk.py +++ b/src/clerk_backend_api/organizationinvitations_sdk.py @@ -100,12 +100,18 @@ def get_all( http_res.text, Optional[models.OrganizationInvitationsWithPublicOrganizationData], ) - if utils.match_response( - http_res, ["400", "404", "422", "500"], "application/json" - ): + if utils.match_response(http_res, ["400", "404", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "500", "application/json"): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -211,12 +217,18 @@ async def get_all_async( http_res.text, Optional[models.OrganizationInvitationsWithPublicOrganizationData], ) - if utils.match_response( - http_res, ["400", "404", "422", "500"], "application/json" - ): + if utils.match_response(http_res, ["400", "404", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "500", "application/json"): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -241,6 +253,7 @@ def create( public_metadata: Optional[Dict[str, Any]] = None, private_metadata: Optional[Dict[str, Any]] = None, redirect_url: Optional[str] = None, + expires_in_days: OptionalNullable[int] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -269,9 +282,10 @@ def create( :param email_address: The email address of the new member that is going to be invited to the organization :param role: The role of the new member in the organization :param inviter_user_id: The ID of the user that invites the new member to the organization. Must be an administrator in the organization. - :param public_metadata: Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. - :param private_metadata: Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. + :param public_metadata: Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. + :param private_metadata: Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. :param redirect_url: Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email. + :param expires_in_days: The number of days the invitation will be valid for. By default, the invitation has a 30 days expire. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -294,6 +308,7 @@ def create( public_metadata=public_metadata, private_metadata=private_metadata, redirect_url=redirect_url, + expires_in_days=expires_in_days, ), ) @@ -303,7 +318,7 @@ def create( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", @@ -313,9 +328,9 @@ def create( get_serialized_body=lambda: utils.serialize_request_body( request.request_body, False, - False, + True, "json", - models.CreateOrganizationInvitationRequestBody, + Optional[models.CreateOrganizationInvitationRequestBody], ), timeout_ms=timeout_ms, ) @@ -349,7 +364,12 @@ def create( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -374,6 +394,7 @@ async def create_async( public_metadata: Optional[Dict[str, Any]] = None, private_metadata: Optional[Dict[str, Any]] = None, redirect_url: Optional[str] = None, + expires_in_days: OptionalNullable[int] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -402,9 +423,10 @@ async def create_async( :param email_address: The email address of the new member that is going to be invited to the organization :param role: The role of the new member in the organization :param inviter_user_id: The ID of the user that invites the new member to the organization. Must be an administrator in the organization. - :param public_metadata: Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. - :param private_metadata: Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. + :param public_metadata: Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. + :param private_metadata: Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. :param redirect_url: Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email. + :param expires_in_days: The number of days the invitation will be valid for. By default, the invitation has a 30 days expire. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -427,6 +449,7 @@ async def create_async( public_metadata=public_metadata, private_metadata=private_metadata, redirect_url=redirect_url, + expires_in_days=expires_in_days, ), ) @@ -436,7 +459,7 @@ async def create_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", @@ -446,9 +469,9 @@ async def create_async( get_serialized_body=lambda: utils.serialize_request_body( request.request_body, False, - False, + True, "json", - models.CreateOrganizationInvitationRequestBody, + Optional[models.CreateOrganizationInvitationRequestBody], ), timeout_ms=timeout_ms, ) @@ -482,7 +505,12 @@ async def create_async( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -585,7 +613,12 @@ def list( if utils.match_response(http_res, ["400", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -688,7 +721,12 @@ async def list_async( if utils.match_response(http_res, ["400", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -708,7 +746,8 @@ def bulk_create( *, organization_id: str, request_body: Union[ - List[models.RequestBody], List[models.RequestBodyTypedDict] + List[models.CreateOrganizationInvitationBulkRequestBody], + List[models.CreateOrganizationInvitationBulkRequestBodyTypedDict], ], retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -749,7 +788,7 @@ def bulk_create( request = models.CreateOrganizationInvitationBulkRequest( organization_id=organization_id, request_body=utils.get_pydantic_model( - request_body, List[models.RequestBody] + request_body, List[models.CreateOrganizationInvitationBulkRequestBody] ), ) @@ -767,7 +806,11 @@ def bulk_create( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.request_body, False, False, "json", List[models.RequestBody] + request.request_body, + False, + False, + "json", + List[models.CreateOrganizationInvitationBulkRequestBody], ), timeout_ms=timeout_ms, ) @@ -801,7 +844,12 @@ def bulk_create( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -821,7 +869,8 @@ async def bulk_create_async( *, organization_id: str, request_body: Union[ - List[models.RequestBody], List[models.RequestBodyTypedDict] + List[models.CreateOrganizationInvitationBulkRequestBody], + List[models.CreateOrganizationInvitationBulkRequestBodyTypedDict], ], retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -862,7 +911,7 @@ async def bulk_create_async( request = models.CreateOrganizationInvitationBulkRequest( organization_id=organization_id, request_body=utils.get_pydantic_model( - request_body, List[models.RequestBody] + request_body, List[models.CreateOrganizationInvitationBulkRequestBody] ), ) @@ -880,7 +929,11 @@ async def bulk_create_async( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.request_body, False, False, "json", List[models.RequestBody] + request.request_body, + False, + False, + "json", + List[models.CreateOrganizationInvitationBulkRequestBody], ), timeout_ms=timeout_ms, ) @@ -914,7 +967,12 @@ async def bulk_create_async( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1017,7 +1075,12 @@ def list_pending( if utils.match_response(http_res, ["400", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1120,7 +1183,12 @@ async def list_pending_async( if utils.match_response(http_res, ["400", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1212,7 +1280,12 @@ def get( if utils.match_response(http_res, ["400", "403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1304,7 +1377,12 @@ async def get_async( if utils.match_response(http_res, ["400", "403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1412,7 +1490,12 @@ def revoke( if utils.match_response(http_res, ["400", "403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1520,7 +1603,12 @@ async def revoke_async( if utils.match_response(http_res, ["400", "403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/organizationmemberships_sdk.py b/src/clerk_backend_api/organizationmemberships_sdk.py index cd897b0..97f1e9f 100644 --- a/src/clerk_backend_api/organizationmemberships_sdk.py +++ b/src/clerk_backend_api/organizationmemberships_sdk.py @@ -99,7 +99,12 @@ def create( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -205,7 +210,12 @@ async def create_async( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -303,7 +313,12 @@ def list( if utils.match_response(http_res, ["401", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -401,7 +416,12 @@ async def list_async( if utils.match_response(http_res, ["401", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -493,7 +513,7 @@ def update( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["400", "404", "422", "4XX", "5XX"], + error_status_codes=["404", "422", "4XX", "5XX"], retry_config=retry_config, ) @@ -502,10 +522,15 @@ def update( return utils.unmarshal_json( http_res.text, Optional[models.OrganizationMembership] ) - if utils.match_response(http_res, ["400", "404", "422"], "application/json"): + if utils.match_response(http_res, ["404", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -597,7 +622,7 @@ async def update_async( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["400", "404", "422", "4XX", "5XX"], + error_status_codes=["404", "422", "4XX", "5XX"], retry_config=retry_config, ) @@ -606,10 +631,15 @@ async def update_async( return utils.unmarshal_json( http_res.text, Optional[models.OrganizationMembership] ) - if utils.match_response(http_res, ["400", "404", "422"], "application/json"): + if utils.match_response(http_res, ["404", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -689,7 +719,7 @@ def delete( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["400", "401", "404", "4XX", "5XX"], + error_status_codes=["401", "404", "4XX", "5XX"], retry_config=retry_config, ) @@ -698,10 +728,15 @@ def delete( return utils.unmarshal_json( http_res.text, Optional[models.OrganizationMembership] ) - if utils.match_response(http_res, ["400", "401", "404"], "application/json"): + if utils.match_response(http_res, ["401", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -781,7 +816,7 @@ async def delete_async( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["400", "401", "404", "4XX", "5XX"], + error_status_codes=["401", "404", "4XX", "5XX"], retry_config=retry_config, ) @@ -790,10 +825,15 @@ async def delete_async( return utils.unmarshal_json( http_res.text, Optional[models.OrganizationMembership] ) - if utils.match_response(http_res, ["400", "401", "404"], "application/json"): + if utils.match_response(http_res, ["401", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -858,7 +898,7 @@ def update_metadata( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", @@ -868,9 +908,9 @@ def update_metadata( get_serialized_body=lambda: utils.serialize_request_body( request.request_body, False, - False, + True, "json", - models.UpdateOrganizationMembershipMetadataRequestBody, + Optional[models.UpdateOrganizationMembershipMetadataRequestBody], ), timeout_ms=timeout_ms, ) @@ -902,7 +942,12 @@ def update_metadata( if utils.match_response(http_res, ["400", "404", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -967,7 +1012,7 @@ async def update_metadata_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", @@ -977,9 +1022,9 @@ async def update_metadata_async( get_serialized_body=lambda: utils.serialize_request_body( request.request_body, False, - False, + True, "json", - models.UpdateOrganizationMembershipMetadataRequestBody, + Optional[models.UpdateOrganizationMembershipMetadataRequestBody], ), timeout_ms=timeout_ms, ) @@ -1011,7 +1056,12 @@ async def update_metadata_async( if utils.match_response(http_res, ["400", "404", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1103,12 +1153,18 @@ def get_all( return utils.unmarshal_json( http_res.text, Optional[models.OrganizationMemberships] ) - if utils.match_response( - http_res, ["400", "401", "422", "500"], "application/json" - ): + if utils.match_response(http_res, ["400", "401", "422"], "application/json"): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "500", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1200,12 +1256,18 @@ async def get_all_async( return utils.unmarshal_json( http_res.text, Optional[models.OrganizationMemberships] ) - if utils.match_response( - http_res, ["400", "401", "422", "500"], "application/json" - ): + if utils.match_response(http_res, ["400", "401", "422"], "application/json"): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "500", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/organizations_sdk.py b/src/clerk_backend_api/organizations_sdk.py index 795608e..6a8f7d7 100644 --- a/src/clerk_backend_api/organizations_sdk.py +++ b/src/clerk_backend_api/organizations_sdk.py @@ -3,8 +3,8 @@ from .basesdk import BaseSDK from clerk_backend_api import models, utils from clerk_backend_api._hooks import HookContext -from clerk_backend_api.types import OptionalNullable, UNSET -from typing import Any, Dict, Mapping, Optional, Union +from clerk_backend_api.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Dict, Mapping, Optional, Union, cast class OrganizationsSDK(BaseSDK): @@ -99,7 +99,12 @@ def list( if utils.match_response(http_res, ["400", "403", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -201,7 +206,12 @@ async def list_async( if utils.match_response(http_res, ["400", "403", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -219,13 +229,12 @@ async def list_async( def create( self, *, - name: str, - created_by: str, - private_metadata: Optional[Dict[str, Any]] = None, - public_metadata: Optional[Dict[str, Any]] = None, - slug: Optional[str] = None, - max_allowed_memberships: Optional[int] = None, - created_at: Optional[str] = None, + request: Optional[ + Union[ + models.CreateOrganizationRequestBody, + models.CreateOrganizationRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -234,7 +243,6 @@ def create( r"""Create an organization Creates a new organization with the given name for an instance. - In order to successfully create an organization you need to provide the ID of the User who will become the organization administrator. You can specify an optional slug for the new organization. If provided, the organization slug can contain only lowercase alphanumeric characters (letters and digits) and the dash \"-\". Organization slugs must be unique for the instance. @@ -245,13 +253,7 @@ def create( The `created_by` user will see this as their [active organization] (https://clerk.com/docs/organizations/overview#active-organization) the next time they create a session, presuming they don't explicitly set a different organization as active before then. - :param name: The name of the new organization. May not contain URLs or HTML. - :param created_by: The ID of the User who will become the administrator for the new organization - :param private_metadata: Metadata saved on the organization, accessible only from the Backend API - :param public_metadata: Metadata saved on the organization, read-only from the Frontend API and fully accessible (read/write) from the Backend API - :param slug: A slug for the new organization. Can contain only lowercase alphanumeric characters and the dash \"-\". Must be unique for the instance. - :param max_allowed_memberships: The maximum number of memberships allowed for this organization - :param created_at: A custom date/time denoting _when_ the organization was created, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -265,15 +267,11 @@ def create( if server_url is not None: base_url = server_url - request = models.CreateOrganizationRequestBody( - name=name, - created_by=created_by, - private_metadata=private_metadata, - public_metadata=public_metadata, - slug=slug, - max_allowed_memberships=max_allowed_memberships, - created_at=created_at, - ) + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[models.CreateOrganizationRequestBody] + ) + request = cast(Optional[models.CreateOrganizationRequestBody], request) req = self._build_request( method="POST", @@ -281,7 +279,7 @@ def create( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -289,7 +287,11 @@ def create( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.CreateOrganizationRequestBody + request, + False, + True, + "json", + Optional[models.CreateOrganizationRequestBody], ), timeout_ms=timeout_ms, ) @@ -319,7 +321,12 @@ def create( if utils.match_response(http_res, ["400", "403", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -337,13 +344,12 @@ def create( async def create_async( self, *, - name: str, - created_by: str, - private_metadata: Optional[Dict[str, Any]] = None, - public_metadata: Optional[Dict[str, Any]] = None, - slug: Optional[str] = None, - max_allowed_memberships: Optional[int] = None, - created_at: Optional[str] = None, + request: Optional[ + Union[ + models.CreateOrganizationRequestBody, + models.CreateOrganizationRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -352,7 +358,6 @@ async def create_async( r"""Create an organization Creates a new organization with the given name for an instance. - In order to successfully create an organization you need to provide the ID of the User who will become the organization administrator. You can specify an optional slug for the new organization. If provided, the organization slug can contain only lowercase alphanumeric characters (letters and digits) and the dash \"-\". Organization slugs must be unique for the instance. @@ -363,13 +368,7 @@ async def create_async( The `created_by` user will see this as their [active organization] (https://clerk.com/docs/organizations/overview#active-organization) the next time they create a session, presuming they don't explicitly set a different organization as active before then. - :param name: The name of the new organization. May not contain URLs or HTML. - :param created_by: The ID of the User who will become the administrator for the new organization - :param private_metadata: Metadata saved on the organization, accessible only from the Backend API - :param public_metadata: Metadata saved on the organization, read-only from the Frontend API and fully accessible (read/write) from the Backend API - :param slug: A slug for the new organization. Can contain only lowercase alphanumeric characters and the dash \"-\". Must be unique for the instance. - :param max_allowed_memberships: The maximum number of memberships allowed for this organization - :param created_at: A custom date/time denoting _when_ the organization was created, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -383,15 +382,11 @@ async def create_async( if server_url is not None: base_url = server_url - request = models.CreateOrganizationRequestBody( - name=name, - created_by=created_by, - private_metadata=private_metadata, - public_metadata=public_metadata, - slug=slug, - max_allowed_memberships=max_allowed_memberships, - created_at=created_at, - ) + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[models.CreateOrganizationRequestBody] + ) + request = cast(Optional[models.CreateOrganizationRequestBody], request) req = self._build_request_async( method="POST", @@ -399,7 +394,7 @@ async def create_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -407,7 +402,11 @@ async def create_async( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.CreateOrganizationRequestBody + request, + False, + True, + "json", + Optional[models.CreateOrganizationRequestBody], ), timeout_ms=timeout_ms, ) @@ -437,7 +436,12 @@ async def create_async( if utils.match_response(http_res, ["400", "403", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -527,7 +531,12 @@ def get( if utils.match_response(http_res, ["403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -617,7 +626,12 @@ async def get_async( if utils.match_response(http_res, ["403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -737,7 +751,12 @@ def update( if utils.match_response(http_res, ["402", "404", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -857,7 +876,12 @@ async def update_async( if utils.match_response(http_res, ["402", "404", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -946,7 +970,12 @@ def delete( if utils.match_response(http_res, "404", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1035,7 +1064,12 @@ async def delete_async( if utils.match_response(http_res, "404", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1145,7 +1179,12 @@ def merge_metadata( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1255,7 +1294,12 @@ async def merge_metadata_async( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1321,7 +1365,7 @@ def upload_logo( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", @@ -1331,9 +1375,9 @@ def upload_logo( get_serialized_body=lambda: utils.serialize_request_body( request.request_body, False, - False, + True, "multipart", - models.UploadOrganizationLogoRequestBody, + Optional[models.UploadOrganizationLogoRequestBody], ), timeout_ms=timeout_ms, ) @@ -1367,7 +1411,12 @@ def upload_logo( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1433,7 +1482,7 @@ async def upload_logo_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", @@ -1443,9 +1492,9 @@ async def upload_logo_async( get_serialized_body=lambda: utils.serialize_request_body( request.request_body, False, - False, + True, "multipart", - models.UploadOrganizationLogoRequestBody, + Optional[models.UploadOrganizationLogoRequestBody], ), timeout_ms=timeout_ms, ) @@ -1479,7 +1528,12 @@ async def upload_logo_async( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1564,7 +1618,12 @@ def delete_logo( if utils.match_response(http_res, "404", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1649,7 +1708,12 @@ async def delete_logo_async( if utils.match_response(http_res, "404", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/phonenumbers.py b/src/clerk_backend_api/phonenumbers.py index fba64dd..3127910 100644 --- a/src/clerk_backend_api/phonenumbers.py +++ b/src/clerk_backend_api/phonenumbers.py @@ -11,10 +11,12 @@ class PhoneNumbers(BaseSDK): def create( self, *, - request: Union[ - models.CreatePhoneNumberRequestBody, - models.CreatePhoneNumberRequestBodyTypedDict, - ] = models.CreatePhoneNumberRequestBody(), + request: Optional[ + Union[ + models.CreatePhoneNumberRequestBody, + models.CreatePhoneNumberRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -39,8 +41,10 @@ def create( base_url = server_url if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CreatePhoneNumberRequestBody) - request = cast(models.CreatePhoneNumberRequestBody, request) + request = utils.unmarshal( + request, Optional[models.CreatePhoneNumberRequestBody] + ) + request = cast(Optional[models.CreatePhoneNumberRequestBody], request) req = self._build_request( method="POST", @@ -48,7 +52,7 @@ def create( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -92,7 +96,12 @@ def create( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -110,10 +119,12 @@ def create( async def create_async( self, *, - request: Union[ - models.CreatePhoneNumberRequestBody, - models.CreatePhoneNumberRequestBodyTypedDict, - ] = models.CreatePhoneNumberRequestBody(), + request: Optional[ + Union[ + models.CreatePhoneNumberRequestBody, + models.CreatePhoneNumberRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -138,8 +149,10 @@ async def create_async( base_url = server_url if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CreatePhoneNumberRequestBody) - request = cast(models.CreatePhoneNumberRequestBody, request) + request = utils.unmarshal( + request, Optional[models.CreatePhoneNumberRequestBody] + ) + request = cast(Optional[models.CreatePhoneNumberRequestBody], request) req = self._build_request_async( method="POST", @@ -147,7 +160,7 @@ async def create_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -191,7 +204,12 @@ async def create_async( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -280,7 +298,12 @@ def get( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -369,7 +392,12 @@ async def get_async( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -458,7 +486,12 @@ def delete( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -547,7 +580,12 @@ async def delete_async( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -610,7 +648,7 @@ def update( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", @@ -620,9 +658,9 @@ def update( get_serialized_body=lambda: utils.serialize_request_body( request.request_body, False, - False, + True, "json", - models.UpdatePhoneNumberRequestBody, + Optional[models.UpdatePhoneNumberRequestBody], ), timeout_ms=timeout_ms, ) @@ -654,7 +692,12 @@ def update( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -717,7 +760,7 @@ async def update_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", @@ -727,9 +770,9 @@ async def update_async( get_serialized_body=lambda: utils.serialize_request_body( request.request_body, False, - False, + True, "json", - models.UpdatePhoneNumberRequestBody, + Optional[models.UpdatePhoneNumberRequestBody], ), timeout_ms=timeout_ms, ) @@ -761,7 +804,12 @@ async def update_async( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/proxychecks.py b/src/clerk_backend_api/proxychecks.py index 1d1e39c..8e7c457 100644 --- a/src/clerk_backend_api/proxychecks.py +++ b/src/clerk_backend_api/proxychecks.py @@ -11,10 +11,12 @@ class ProxyChecks(BaseSDK): def verify( self, *, - request: Union[ - models.VerifyDomainProxyRequestBody, - models.VerifyDomainProxyRequestBodyTypedDict, - ] = models.VerifyDomainProxyRequestBody(), + request: Optional[ + Union[ + models.VerifyDomainProxyRequestBody, + models.VerifyDomainProxyRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -46,8 +48,10 @@ def verify( base_url = server_url if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.VerifyDomainProxyRequestBody) - request = cast(models.VerifyDomainProxyRequestBody, request) + request = utils.unmarshal( + request, Optional[models.VerifyDomainProxyRequestBody] + ) + request = cast(Optional[models.VerifyDomainProxyRequestBody], request) req = self._build_request( method="POST", @@ -55,7 +59,7 @@ def verify( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -97,7 +101,12 @@ def verify( if utils.match_response(http_res, ["400", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -115,10 +124,12 @@ def verify( async def verify_async( self, *, - request: Union[ - models.VerifyDomainProxyRequestBody, - models.VerifyDomainProxyRequestBodyTypedDict, - ] = models.VerifyDomainProxyRequestBody(), + request: Optional[ + Union[ + models.VerifyDomainProxyRequestBody, + models.VerifyDomainProxyRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -150,8 +161,10 @@ async def verify_async( base_url = server_url if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.VerifyDomainProxyRequestBody) - request = cast(models.VerifyDomainProxyRequestBody, request) + request = utils.unmarshal( + request, Optional[models.VerifyDomainProxyRequestBody] + ) + request = cast(Optional[models.VerifyDomainProxyRequestBody], request) req = self._build_request_async( method="POST", @@ -159,7 +172,7 @@ async def verify_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -201,7 +214,12 @@ async def verify_async( if utils.match_response(http_res, ["400", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/redirecturls.py b/src/clerk_backend_api/redirecturls.py index ac867a7..0a0ea05 100644 --- a/src/clerk_backend_api/redirecturls.py +++ b/src/clerk_backend_api/redirecturls.py @@ -71,7 +71,12 @@ def list( return utils.unmarshal_json( http_res.text, Optional[List[models.RedirectURL]] ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -149,7 +154,12 @@ async def list_async( return utils.unmarshal_json( http_res.text, Optional[List[models.RedirectURL]] ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/samlconnections_sdk.py b/src/clerk_backend_api/samlconnections_sdk.py index 98dddc4..8e1ace7 100644 --- a/src/clerk_backend_api/samlconnections_sdk.py +++ b/src/clerk_backend_api/samlconnections_sdk.py @@ -3,8 +3,8 @@ from .basesdk import BaseSDK from clerk_backend_api import models, utils from clerk_backend_api._hooks import HookContext -from clerk_backend_api.types import OptionalNullable, UNSET -from typing import Any, Mapping, Optional, Union +from clerk_backend_api.types import BaseModel, OptionalNullable, UNSET +from typing import Any, List, Mapping, Optional, Union, cast class SamlConnectionsSDK(BaseSDK): @@ -13,6 +13,7 @@ def list( *, limit: Optional[int] = 10, offset: Optional[int] = 0, + organization_id: Optional[List[str]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -26,6 +27,7 @@ def list( :param limit: Applies a limit to the number of results returned. Can be used for paginating the results together with `offset`. :param offset: Skip the first `offset` results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with `limit`. + :param organization_id: Returns SAML connections that have an associated organization ID to the given organizations. For each organization id, the `+` and `-` can be prepended to the id, which denote whether the respective organization should be included or excluded from the result set. Accepts up to 100 organization ids. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -42,6 +44,7 @@ def list( request = models.ListSAMLConnectionsRequest( limit=limit, offset=offset, + organization_id=organization_id, ) req = self._build_request( @@ -85,7 +88,12 @@ def list( if utils.match_response(http_res, ["402", "403", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -105,6 +113,7 @@ async def list_async( *, limit: Optional[int] = 10, offset: Optional[int] = 0, + organization_id: Optional[List[str]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -118,6 +127,7 @@ async def list_async( :param limit: Applies a limit to the number of results returned. Can be used for paginating the results together with `offset`. :param offset: Skip the first `offset` results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with `limit`. + :param organization_id: Returns SAML connections that have an associated organization ID to the given organizations. For each organization id, the `+` and `-` can be prepended to the id, which denote whether the respective organization should be included or excluded from the result set. Accepts up to 100 organization ids. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -134,6 +144,7 @@ async def list_async( request = models.ListSAMLConnectionsRequest( limit=limit, offset=offset, + organization_id=organization_id, ) req = self._build_request_async( @@ -177,7 +188,12 @@ async def list_async( if utils.match_response(http_res, ["402", "403", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -195,20 +211,12 @@ async def list_async( def create( self, *, - name: str, - domain: str, - provider: models.Provider, - idp_entity_id: OptionalNullable[str] = UNSET, - idp_sso_url: OptionalNullable[str] = UNSET, - idp_certificate: OptionalNullable[str] = UNSET, - idp_metadata_url: OptionalNullable[str] = UNSET, - idp_metadata: OptionalNullable[str] = UNSET, - attribute_mapping: OptionalNullable[ + request: Optional[ Union[ - models.CreateSAMLConnectionAttributeMapping, - models.CreateSAMLConnectionAttributeMappingTypedDict, + models.CreateSAMLConnectionRequestBody, + models.CreateSAMLConnectionRequestBodyTypedDict, ] - ] = UNSET, + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -218,15 +226,7 @@ def create( Create a new SAML Connection. - :param name: The name to use as a label for this SAML Connection - :param domain: The domain of your organization. Sign in flows using an email with this domain, will use this SAML Connection. - :param provider: The IdP provider of the connection. - :param idp_entity_id: The Entity ID as provided by the IdP - :param idp_sso_url: The Single-Sign On URL as provided by the IdP - :param idp_certificate: The X.509 certificate as provided by the IdP - :param idp_metadata_url: The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties - :param idp_metadata: The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties - :param attribute_mapping: Define the attribute name mapping between Identity Provider and Clerk's user properties + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -240,20 +240,11 @@ def create( if server_url is not None: base_url = server_url - request = models.CreateSAMLConnectionRequestBody( - name=name, - domain=domain, - provider=provider, - idp_entity_id=idp_entity_id, - idp_sso_url=idp_sso_url, - idp_certificate=idp_certificate, - idp_metadata_url=idp_metadata_url, - idp_metadata=idp_metadata, - attribute_mapping=utils.get_pydantic_model( - attribute_mapping, - OptionalNullable[models.CreateSAMLConnectionAttributeMapping], - ), - ) + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[models.CreateSAMLConnectionRequestBody] + ) + request = cast(Optional[models.CreateSAMLConnectionRequestBody], request) req = self._build_request( method="POST", @@ -261,7 +252,7 @@ def create( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -269,7 +260,11 @@ def create( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.CreateSAMLConnectionRequestBody + request, + False, + True, + "json", + Optional[models.CreateSAMLConnectionRequestBody], ), timeout_ms=timeout_ms, ) @@ -289,7 +284,7 @@ def create( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["402", "403", "422", "4XX", "5XX"], + error_status_codes=["402", "403", "404", "422", "4XX", "5XX"], retry_config=retry_config, ) @@ -298,10 +293,17 @@ def create( return utils.unmarshal_json( http_res.text, Optional[models.SchemasSAMLConnection] ) - if utils.match_response(http_res, ["402", "403", "422"], "application/json"): + if utils.match_response( + http_res, ["402", "403", "404", "422"], "application/json" + ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -319,20 +321,12 @@ def create( async def create_async( self, *, - name: str, - domain: str, - provider: models.Provider, - idp_entity_id: OptionalNullable[str] = UNSET, - idp_sso_url: OptionalNullable[str] = UNSET, - idp_certificate: OptionalNullable[str] = UNSET, - idp_metadata_url: OptionalNullable[str] = UNSET, - idp_metadata: OptionalNullable[str] = UNSET, - attribute_mapping: OptionalNullable[ + request: Optional[ Union[ - models.CreateSAMLConnectionAttributeMapping, - models.CreateSAMLConnectionAttributeMappingTypedDict, + models.CreateSAMLConnectionRequestBody, + models.CreateSAMLConnectionRequestBodyTypedDict, ] - ] = UNSET, + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -342,15 +336,7 @@ async def create_async( Create a new SAML Connection. - :param name: The name to use as a label for this SAML Connection - :param domain: The domain of your organization. Sign in flows using an email with this domain, will use this SAML Connection. - :param provider: The IdP provider of the connection. - :param idp_entity_id: The Entity ID as provided by the IdP - :param idp_sso_url: The Single-Sign On URL as provided by the IdP - :param idp_certificate: The X.509 certificate as provided by the IdP - :param idp_metadata_url: The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties - :param idp_metadata: The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties - :param attribute_mapping: Define the attribute name mapping between Identity Provider and Clerk's user properties + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -364,20 +350,11 @@ async def create_async( if server_url is not None: base_url = server_url - request = models.CreateSAMLConnectionRequestBody( - name=name, - domain=domain, - provider=provider, - idp_entity_id=idp_entity_id, - idp_sso_url=idp_sso_url, - idp_certificate=idp_certificate, - idp_metadata_url=idp_metadata_url, - idp_metadata=idp_metadata, - attribute_mapping=utils.get_pydantic_model( - attribute_mapping, - OptionalNullable[models.CreateSAMLConnectionAttributeMapping], - ), - ) + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[models.CreateSAMLConnectionRequestBody] + ) + request = cast(Optional[models.CreateSAMLConnectionRequestBody], request) req = self._build_request_async( method="POST", @@ -385,7 +362,7 @@ async def create_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -393,7 +370,11 @@ async def create_async( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.CreateSAMLConnectionRequestBody + request, + False, + True, + "json", + Optional[models.CreateSAMLConnectionRequestBody], ), timeout_ms=timeout_ms, ) @@ -413,7 +394,7 @@ async def create_async( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["402", "403", "422", "4XX", "5XX"], + error_status_codes=["402", "403", "404", "422", "4XX", "5XX"], retry_config=retry_config, ) @@ -422,10 +403,17 @@ async def create_async( return utils.unmarshal_json( http_res.text, Optional[models.SchemasSAMLConnection] ) - if utils.match_response(http_res, ["402", "403", "422"], "application/json"): + if utils.match_response( + http_res, ["402", "403", "404", "422"], "application/json" + ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -514,7 +502,12 @@ def get( if utils.match_response(http_res, ["402", "403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -603,7 +596,12 @@ async def get_async( if utils.match_response(http_res, ["402", "403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -629,6 +627,7 @@ def update( idp_certificate: OptionalNullable[str] = UNSET, idp_metadata_url: OptionalNullable[str] = UNSET, idp_metadata: OptionalNullable[str] = UNSET, + organization_id: OptionalNullable[str] = UNSET, attribute_mapping: OptionalNullable[ Union[ models.UpdateSAMLConnectionAttributeMapping, @@ -657,6 +656,7 @@ def update( :param idp_certificate: The x509 certificated as provided by the IdP :param idp_metadata_url: The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties and replaces them :param idp_metadata: The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties + :param organization_id: The ID of the organization to which users of this SAML Connection will be added :param attribute_mapping: Define the atrtibute name mapping between Identity Provider and Clerk's user properties :param active: Activate or de-activate the SAML Connection :param sync_user_attributes: Controls whether to update the user's attributes in each sign-in @@ -686,6 +686,7 @@ def update( idp_certificate=idp_certificate, idp_metadata_url=idp_metadata_url, idp_metadata=idp_metadata, + organization_id=organization_id, attribute_mapping=utils.get_pydantic_model( attribute_mapping, OptionalNullable[models.UpdateSAMLConnectionAttributeMapping], @@ -750,7 +751,12 @@ def update( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -776,6 +782,7 @@ async def update_async( idp_certificate: OptionalNullable[str] = UNSET, idp_metadata_url: OptionalNullable[str] = UNSET, idp_metadata: OptionalNullable[str] = UNSET, + organization_id: OptionalNullable[str] = UNSET, attribute_mapping: OptionalNullable[ Union[ models.UpdateSAMLConnectionAttributeMapping, @@ -804,6 +811,7 @@ async def update_async( :param idp_certificate: The x509 certificated as provided by the IdP :param idp_metadata_url: The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties and replaces them :param idp_metadata: The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties + :param organization_id: The ID of the organization to which users of this SAML Connection will be added :param attribute_mapping: Define the atrtibute name mapping between Identity Provider and Clerk's user properties :param active: Activate or de-activate the SAML Connection :param sync_user_attributes: Controls whether to update the user's attributes in each sign-in @@ -833,6 +841,7 @@ async def update_async( idp_certificate=idp_certificate, idp_metadata_url=idp_metadata_url, idp_metadata=idp_metadata, + organization_id=organization_id, attribute_mapping=utils.get_pydantic_model( attribute_mapping, OptionalNullable[models.UpdateSAMLConnectionAttributeMapping], @@ -897,7 +906,12 @@ async def update_async( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -984,7 +998,12 @@ def delete( if utils.match_response(http_res, ["402", "403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1071,7 +1090,12 @@ async def delete_async( if utils.match_response(http_res, ["402", "403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/sdk.py b/src/clerk_backend_api/sdk.py index 48df145..9170ac1 100644 --- a/src/clerk_backend_api/sdk.py +++ b/src/clerk_backend_api/sdk.py @@ -18,9 +18,9 @@ from clerk_backend_api.emailaddresses import EmailAddresses from clerk_backend_api.emailandsmstemplates import EmailAndSmsTemplates from clerk_backend_api.emailsmstemplates import EmailSMSTemplates -from clerk_backend_api.instancesettings_sdk import InstanceSettingsSDK +from clerk_backend_api.instance_settings_sdk import InstanceSettingsSDK from clerk_backend_api.invitations import Invitations -from clerk_backend_api.jwks import Jwks +from clerk_backend_api.jwks_sdk import JwksSDK from clerk_backend_api.jwttemplates import JwtTemplates from clerk_backend_api.miscellaneous import Miscellaneous from clerk_backend_api.oauthapplications_sdk import OauthApplicationsSDK @@ -40,6 +40,7 @@ from clerk_backend_api.testingtokens import TestingTokens from clerk_backend_api.types import OptionalNullable, UNSET from clerk_backend_api.users import Users +from clerk_backend_api.waitlist_entries_sdk import WaitlistEntriesSDK from clerk_backend_api.webhooks import Webhooks import httpx from typing import Any, Callable, Dict, Optional, Union @@ -61,7 +62,7 @@ class Clerk(BaseSDK): miscellaneous: Miscellaneous r"""Various endpoints that do not belong in any particular category.""" - jwks: Jwks + jwks: JwksSDK clients: Clients r"""The Client object tracks sessions, as well as the state of any sign in and sign up attempts, for a given device. https://clerk.com/docs/reference/clerkjs/client @@ -114,6 +115,7 @@ class Clerk(BaseSDK): oauth_applications: OauthApplicationsSDK saml_connections: SamlConnectionsSDK testing_tokens: TestingTokens + waitlist_entries: WaitlistEntriesSDK def __init__( self, @@ -157,7 +159,8 @@ def __init__( security: Any = None if callable(bearer_auth): - security = lambda: models.Security(bearer_auth=bearer_auth()) # pylint: disable=unnecessary-lambda-assignment + # pylint: disable=unnecessary-lambda-assignment + security = lambda: models.Security(bearer_auth=bearer_auth()) else: security = models.Security(bearer_auth=bearer_auth) @@ -195,7 +198,7 @@ def __init__( def _init_sdks(self): self.miscellaneous = Miscellaneous(self.sdk_configuration) - self.jwks = Jwks(self.sdk_configuration) + self.jwks = JwksSDK(self.sdk_configuration) self.clients = Clients(self.sdk_configuration) self.email_addresses = EmailAddresses(self.sdk_configuration) self.phone_numbers = PhoneNumbers(self.sdk_configuration) @@ -231,6 +234,7 @@ def _init_sdks(self): self.oauth_applications = OauthApplicationsSDK(self.sdk_configuration) self.saml_connections = SamlConnectionsSDK(self.sdk_configuration) self.testing_tokens = TestingTokens(self.sdk_configuration) + self.waitlist_entries = WaitlistEntriesSDK(self.sdk_configuration) def __enter__(self): return self diff --git a/src/clerk_backend_api/sdkconfiguration.py b/src/clerk_backend_api/sdkconfiguration.py index 1e28821..83ff0d7 100644 --- a/src/clerk_backend_api/sdkconfiguration.py +++ b/src/clerk_backend_api/sdkconfiguration.py @@ -1,6 +1,12 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from ._hooks import SDKHooks +from ._version import ( + __gen_version__, + __openapi_doc_version__, + __user_agent__, + __version__, +) from .httpclient import AsyncHttpClient, HttpClient from .utils import Logger, RetryConfig, remove_suffix from clerk_backend_api import models @@ -25,10 +31,10 @@ class SDKConfiguration: server_url: Optional[str] = "" server_idx: Optional[int] = 0 language: str = "python" - openapi_doc_version: str = "v1" - sdk_version: str = "1.6.0" - gen_version: str = "2.484.4" - user_agent: str = "speakeasy-sdk/python 1.6.0 2.484.4 v1 clerk-backend-api" + openapi_doc_version: str = __openapi_doc_version__ + sdk_version: str = __version__ + gen_version: str = __gen_version__ + user_agent: str = __user_agent__ retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET) timeout_ms: Optional[int] = None diff --git a/src/clerk_backend_api/sessions.py b/src/clerk_backend_api/sessions.py index 64642a8..23938df 100644 --- a/src/clerk_backend_api/sessions.py +++ b/src/clerk_backend_api/sessions.py @@ -3,8 +3,8 @@ from .basesdk import BaseSDK from clerk_backend_api import models, utils from clerk_backend_api._hooks import HookContext -from clerk_backend_api.types import OptionalNullable, UNSET -from typing import Any, List, Mapping, Optional +from clerk_backend_api.types import BaseModel, OptionalNullable, UNSET +from typing import Any, List, Mapping, Optional, Union, cast from typing_extensions import deprecated @@ -102,7 +102,12 @@ def list( if utils.match_response(http_res, ["400", "401", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -204,7 +209,224 @@ async def list_async( if utils.match_response(http_res, ["400", "401", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def create_session( + self, + *, + request: Optional[ + Union[ + models.CreateSessionRequestBody, + models.CreateSessionRequestBodyTypedDict, + ] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.Session]: + r"""Create a new active session + + Create a new active session for the provided user ID. + + This operation is only available for Clerk Development instances. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[models.CreateSessionRequestBody] + ) + request = cast(Optional[models.CreateSessionRequestBody], request) + + req = self._build_request( + method="POST", + path="/sessions", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, True, "json", Optional[models.CreateSessionRequestBody] + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="createSession", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["400", "401", "404", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[models.Session]) + if utils.match_response( + http_res, ["400", "401", "404", "422"], "application/json" + ): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def create_session_async( + self, + *, + request: Optional[ + Union[ + models.CreateSessionRequestBody, + models.CreateSessionRequestBodyTypedDict, + ] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.Session]: + r"""Create a new active session + + Create a new active session for the provided user ID. + + This operation is only available for Clerk Development instances. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[models.CreateSessionRequestBody] + ) + request = cast(Optional[models.CreateSessionRequestBody], request) + + req = self._build_request_async( + method="POST", + path="/sessions", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, True, "json", Optional[models.CreateSessionRequestBody] + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="createSession", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["400", "401", "404", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[models.Session]) + if utils.match_response( + http_res, ["400", "401", "404", "422"], "application/json" + ): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -291,7 +513,12 @@ def get( if utils.match_response(http_res, ["400", "401", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -378,7 +605,12 @@ async def get_async( if utils.match_response(http_res, ["400", "401", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -466,7 +698,12 @@ def revoke( if utils.match_response(http_res, ["400", "401", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -554,7 +791,12 @@ async def revoke_async( if utils.match_response(http_res, ["400", "401", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -661,7 +903,12 @@ def verify( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -768,7 +1015,224 @@ async def verify_async( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def create_session_token( + self, + *, + session_id: str, + expires_in_seconds: OptionalNullable[float] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.CreateSessionTokenResponseBody]: + r"""Create a session token + + Creates a session JSON Web Token (JWT) based on a session. + + :param session_id: The ID of the session + :param expires_in_seconds: Use this parameter to override the default session token lifetime. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.CreateSessionTokenRequest( + session_id=session_id, + request_body=models.CreateSessionTokenRequestBody( + expires_in_seconds=expires_in_seconds, + ), + ) + + req = self._build_request( + method="POST", + path="/sessions/{session_id}/tokens", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + True, + "json", + Optional[models.CreateSessionTokenRequestBody], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="CreateSessionToken", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["401", "404", "4XX", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[models.CreateSessionTokenResponseBody] + ) + if utils.match_response(http_res, ["401", "404"], "application/json"): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def create_session_token_async( + self, + *, + session_id: str, + expires_in_seconds: OptionalNullable[float] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.CreateSessionTokenResponseBody]: + r"""Create a session token + + Creates a session JSON Web Token (JWT) based on a session. + + :param session_id: The ID of the session + :param expires_in_seconds: Use this parameter to override the default session token lifetime. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.CreateSessionTokenRequest( + session_id=session_id, + request_body=models.CreateSessionTokenRequestBody( + expires_in_seconds=expires_in_seconds, + ), + ) + + req = self._build_request_async( + method="POST", + path="/sessions/{session_id}/tokens", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + True, + "json", + Optional[models.CreateSessionTokenRequestBody], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="CreateSessionToken", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["401", "404", "4XX", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[models.CreateSessionTokenResponseBody] + ) + if utils.match_response(http_res, ["401", "404"], "application/json"): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -788,6 +1252,7 @@ def create_token_from_template( *, session_id: str, template_name: str, + expires_in_seconds: OptionalNullable[float] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -799,6 +1264,7 @@ def create_token_from_template( :param session_id: The ID of the session :param template_name: The name of the JWT Template defined in your instance (e.g. `custom_hasura`). + :param expires_in_seconds: Use this parameter to override the JWT token lifetime. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -815,6 +1281,9 @@ def create_token_from_template( request = models.CreateSessionTokenFromTemplateRequest( session_id=session_id, template_name=template_name, + request_body=models.CreateSessionTokenFromTemplateRequestBody( + expires_in_seconds=expires_in_seconds, + ), ) req = self._build_request( @@ -830,6 +1299,13 @@ def create_token_from_template( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + True, + "json", + Optional[models.CreateSessionTokenFromTemplateRequestBody], + ), timeout_ms=timeout_ms, ) @@ -861,7 +1337,12 @@ def create_token_from_template( if utils.match_response(http_res, ["401", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -881,6 +1362,7 @@ async def create_token_from_template_async( *, session_id: str, template_name: str, + expires_in_seconds: OptionalNullable[float] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -892,6 +1374,7 @@ async def create_token_from_template_async( :param session_id: The ID of the session :param template_name: The name of the JWT Template defined in your instance (e.g. `custom_hasura`). + :param expires_in_seconds: Use this parameter to override the JWT token lifetime. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -908,6 +1391,9 @@ async def create_token_from_template_async( request = models.CreateSessionTokenFromTemplateRequest( session_id=session_id, template_name=template_name, + request_body=models.CreateSessionTokenFromTemplateRequestBody( + expires_in_seconds=expires_in_seconds, + ), ) req = self._build_request_async( @@ -923,6 +1409,13 @@ async def create_token_from_template_async( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + True, + "json", + Optional[models.CreateSessionTokenFromTemplateRequestBody], + ), timeout_ms=timeout_ms, ) @@ -954,7 +1447,12 @@ async def create_token_from_template_async( if utils.match_response(http_res, ["401", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/signintokens.py b/src/clerk_backend_api/signintokens.py index 7d3ec1f..b5ea80c 100644 --- a/src/clerk_backend_api/signintokens.py +++ b/src/clerk_backend_api/signintokens.py @@ -11,10 +11,12 @@ class SignInTokens(BaseSDK): def create( self, *, - request: Union[ - models.CreateSignInTokenRequestBody, - models.CreateSignInTokenRequestBodyTypedDict, - ] = models.CreateSignInTokenRequestBody(), + request: Optional[ + Union[ + models.CreateSignInTokenRequestBody, + models.CreateSignInTokenRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -41,8 +43,10 @@ def create( base_url = server_url if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CreateSignInTokenRequestBody) - request = cast(models.CreateSignInTokenRequestBody, request) + request = utils.unmarshal( + request, Optional[models.CreateSignInTokenRequestBody] + ) + request = cast(Optional[models.CreateSignInTokenRequestBody], request) req = self._build_request( method="POST", @@ -50,7 +54,7 @@ def create( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -92,7 +96,12 @@ def create( if utils.match_response(http_res, ["404", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -110,10 +119,12 @@ def create( async def create_async( self, *, - request: Union[ - models.CreateSignInTokenRequestBody, - models.CreateSignInTokenRequestBodyTypedDict, - ] = models.CreateSignInTokenRequestBody(), + request: Optional[ + Union[ + models.CreateSignInTokenRequestBody, + models.CreateSignInTokenRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -140,8 +151,10 @@ async def create_async( base_url = server_url if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CreateSignInTokenRequestBody) - request = cast(models.CreateSignInTokenRequestBody, request) + request = utils.unmarshal( + request, Optional[models.CreateSignInTokenRequestBody] + ) + request = cast(Optional[models.CreateSignInTokenRequestBody], request) req = self._build_request_async( method="POST", @@ -149,7 +162,7 @@ async def create_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", @@ -191,7 +204,12 @@ async def create_async( if utils.match_response(http_res, ["404", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -278,7 +296,12 @@ def revoke( if utils.match_response(http_res, ["400", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -365,7 +388,12 @@ async def revoke_async( if utils.match_response(http_res, ["400", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/signups.py b/src/clerk_backend_api/signups.py index 3f8dace..ddd8963 100644 --- a/src/clerk_backend_api/signups.py +++ b/src/clerk_backend_api/signups.py @@ -50,7 +50,7 @@ def update( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", @@ -60,9 +60,9 @@ def update( get_serialized_body=lambda: utils.serialize_request_body( request.request_body, False, - False, + True, "json", - models.UpdateSignUpRequestBody, + Optional[models.UpdateSignUpRequestBody], ), timeout_ms=timeout_ms, ) @@ -92,7 +92,12 @@ def update( if utils.match_response(http_res, "403", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -149,7 +154,7 @@ async def update_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", @@ -159,9 +164,9 @@ async def update_async( get_serialized_body=lambda: utils.serialize_request_body( request.request_body, False, - False, + True, "json", - models.UpdateSignUpRequestBody, + Optional[models.UpdateSignUpRequestBody], ), timeout_ms=timeout_ms, ) @@ -191,7 +196,12 @@ async def update_async( if utils.match_response(http_res, "403", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/templates.py b/src/clerk_backend_api/templates.py index 7fddee3..a72987a 100644 --- a/src/clerk_backend_api/templates.py +++ b/src/clerk_backend_api/templates.py @@ -112,7 +112,12 @@ def preview( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -230,7 +235,12 @@ async def preview_async( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/testingtokens.py b/src/clerk_backend_api/testingtokens.py index 87f6bc5..49e61b7 100644 --- a/src/clerk_backend_api/testingtokens.py +++ b/src/clerk_backend_api/testingtokens.py @@ -18,7 +18,7 @@ def create( ) -> Optional[models.TestingToken]: r"""Retrieve a new testing token - Retrieve a new testing token. Only available for development instances. + Retrieve a new testing token. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -63,13 +63,18 @@ def create( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["400", "4XX", "5XX"], + error_status_codes=["4XX", "5XX"], retry_config=retry_config, ) if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, Optional[models.TestingToken]) - if utils.match_response(http_res, ["400", "4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -94,7 +99,7 @@ async def create_async( ) -> Optional[models.TestingToken]: r"""Retrieve a new testing token - Retrieve a new testing token. Only available for development instances. + Retrieve a new testing token. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -139,13 +144,18 @@ async def create_async( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["400", "4XX", "5XX"], + error_status_codes=["4XX", "5XX"], retry_config=retry_config, ) if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, Optional[models.TestingToken]) - if utils.match_response(http_res, ["400", "4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/users.py b/src/clerk_backend_api/users.py index 3a57946..0159472 100644 --- a/src/clerk_backend_api/users.py +++ b/src/clerk_backend_api/users.py @@ -23,7 +23,15 @@ def list( user_id: Optional[List[str]] = None, organization_id: Optional[List[str]] = None, query: Optional[str] = None, + email_address_query: Optional[str] = None, + phone_number_query: Optional[str] = None, + username_query: Optional[str] = None, + name_query: Optional[str] = None, + last_active_at_before: Optional[int] = None, + last_active_at_after: Optional[int] = None, last_active_at_since: Optional[int] = None, + created_at_before: Optional[int] = None, + created_at_after: Optional[int] = None, limit: Optional[int] = 10, offset: Optional[int] = 0, order_by: Optional[str] = "-created_at", @@ -45,7 +53,15 @@ def list( :param user_id: Returns users with the user ids specified. For each user id, the `+` and `-` can be prepended to the id, which denote whether the respective user id should be included or excluded from the result set. Accepts up to 100 user ids. Any user ids not found are ignored. :param organization_id: Returns users that have memberships to the given organizations. For each organization id, the `+` and `-` can be prepended to the id, which denote whether the respective organization should be included or excluded from the result set. Accepts up to 100 organization ids. :param query: Returns users that match the given query. For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names. The query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well. - :param last_active_at_since: Returns users that had session activity since the given date, with day precision. Providing a value with higher precision than day will result in an error. Example: use 1700690400000 to retrieve users that had session activity from 2023-11-23 until the current day. + :param email_address_query: Returns users with emails that match the given query, via case-insensitive partial match. For example, `email_address_query=ello` will match a user with the email `HELLO@example.com`. + :param phone_number_query: Returns users with phone numbers that match the given query, via case-insensitive partial match. For example, `phone_number_query=555` will match a user with the phone number `+1555xxxxxxx`. + :param username_query: Returns users with usernames that match the given query, via case-insensitive partial match. For example, `username_query=CoolUser` will match a user with the username `SomeCoolUser`. + :param name_query: Returns users with names that match the given query, via case-insensitive partial match. + :param last_active_at_before: Returns users whose last session activity was before the given date (with millisecond precision). Example: use 1700690400000 to retrieve users whose last session activity was before 2023-11-23. + :param last_active_at_after: Returns users whose last session activity was after the given date (with millisecond precision). Example: use 1700690400000 to retrieve users whose last session activity was after 2023-11-23. + :param last_active_at_since: Returns users that had session activity since the given date. Example: use 1700690400000 to retrieve users that had session activity from 2023-11-23 until the current day. Deprecated in favor of `last_active_at_after`. + :param created_at_before: Returns users who have been created before the given date (with millisecond precision). Example: use 1730160000000 to retrieve users who have been created before 2024-10-29. + :param created_at_after: Returns users who have been created after the given date (with millisecond precision). Example: use 1730160000000 to retrieve users who have been created after 2024-10-29. :param limit: Applies a limit to the number of results returned. Can be used for paginating the results together with `offset`. :param offset: Skip the first `offset` results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with `limit`. :param order_by: Allows to return users in a particular order. At the moment, you can order the returned users by their `created_at`,`updated_at`,`email_address`,`web3wallet`,`first_name`,`last_name`,`phone_number`,`username`,`last_active_at`,`last_sign_in_at`. In order to specify the direction, you can use the `+/-` symbols prepended in the property to order by. For example, if you want users to be returned in descending order according to their `created_at` property, you can use `-created_at`. If you don't use `+` or `-`, then `+` is implied. We only support one `order_by` parameter, and if multiple `order_by` parameters are provided, we will only keep the first one. For example, if you pass `order_by=username&order_by=created_at`, we will consider only the first `order_by` parameter, which is `username`. The `created_at` parameter will be ignored in this case. @@ -71,7 +87,15 @@ def list( user_id=user_id, organization_id=organization_id, query=query, + email_address_query=email_address_query, + phone_number_query=phone_number_query, + username_query=username_query, + name_query=name_query, + last_active_at_before=last_active_at_before, + last_active_at_after=last_active_at_after, last_active_at_since=last_active_at_since, + created_at_before=created_at_before, + created_at_after=created_at_after, limit=limit, offset=offset, order_by=order_by, @@ -118,7 +142,12 @@ def list( if utils.match_response(http_res, ["400", "401", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -144,7 +173,15 @@ async def list_async( user_id: Optional[List[str]] = None, organization_id: Optional[List[str]] = None, query: Optional[str] = None, + email_address_query: Optional[str] = None, + phone_number_query: Optional[str] = None, + username_query: Optional[str] = None, + name_query: Optional[str] = None, + last_active_at_before: Optional[int] = None, + last_active_at_after: Optional[int] = None, last_active_at_since: Optional[int] = None, + created_at_before: Optional[int] = None, + created_at_after: Optional[int] = None, limit: Optional[int] = 10, offset: Optional[int] = 0, order_by: Optional[str] = "-created_at", @@ -166,7 +203,15 @@ async def list_async( :param user_id: Returns users with the user ids specified. For each user id, the `+` and `-` can be prepended to the id, which denote whether the respective user id should be included or excluded from the result set. Accepts up to 100 user ids. Any user ids not found are ignored. :param organization_id: Returns users that have memberships to the given organizations. For each organization id, the `+` and `-` can be prepended to the id, which denote whether the respective organization should be included or excluded from the result set. Accepts up to 100 organization ids. :param query: Returns users that match the given query. For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names. The query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well. - :param last_active_at_since: Returns users that had session activity since the given date, with day precision. Providing a value with higher precision than day will result in an error. Example: use 1700690400000 to retrieve users that had session activity from 2023-11-23 until the current day. + :param email_address_query: Returns users with emails that match the given query, via case-insensitive partial match. For example, `email_address_query=ello` will match a user with the email `HELLO@example.com`. + :param phone_number_query: Returns users with phone numbers that match the given query, via case-insensitive partial match. For example, `phone_number_query=555` will match a user with the phone number `+1555xxxxxxx`. + :param username_query: Returns users with usernames that match the given query, via case-insensitive partial match. For example, `username_query=CoolUser` will match a user with the username `SomeCoolUser`. + :param name_query: Returns users with names that match the given query, via case-insensitive partial match. + :param last_active_at_before: Returns users whose last session activity was before the given date (with millisecond precision). Example: use 1700690400000 to retrieve users whose last session activity was before 2023-11-23. + :param last_active_at_after: Returns users whose last session activity was after the given date (with millisecond precision). Example: use 1700690400000 to retrieve users whose last session activity was after 2023-11-23. + :param last_active_at_since: Returns users that had session activity since the given date. Example: use 1700690400000 to retrieve users that had session activity from 2023-11-23 until the current day. Deprecated in favor of `last_active_at_after`. + :param created_at_before: Returns users who have been created before the given date (with millisecond precision). Example: use 1730160000000 to retrieve users who have been created before 2024-10-29. + :param created_at_after: Returns users who have been created after the given date (with millisecond precision). Example: use 1730160000000 to retrieve users who have been created after 2024-10-29. :param limit: Applies a limit to the number of results returned. Can be used for paginating the results together with `offset`. :param offset: Skip the first `offset` results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with `limit`. :param order_by: Allows to return users in a particular order. At the moment, you can order the returned users by their `created_at`,`updated_at`,`email_address`,`web3wallet`,`first_name`,`last_name`,`phone_number`,`username`,`last_active_at`,`last_sign_in_at`. In order to specify the direction, you can use the `+/-` symbols prepended in the property to order by. For example, if you want users to be returned in descending order according to their `created_at` property, you can use `-created_at`. If you don't use `+` or `-`, then `+` is implied. We only support one `order_by` parameter, and if multiple `order_by` parameters are provided, we will only keep the first one. For example, if you pass `order_by=username&order_by=created_at`, we will consider only the first `order_by` parameter, which is `username`. The `created_at` parameter will be ignored in this case. @@ -192,7 +237,15 @@ async def list_async( user_id=user_id, organization_id=organization_id, query=query, + email_address_query=email_address_query, + phone_number_query=phone_number_query, + username_query=username_query, + name_query=name_query, + last_active_at_before=last_active_at_before, + last_active_at_after=last_active_at_after, last_active_at_since=last_active_at_since, + created_at_before=created_at_before, + created_at_after=created_at_after, limit=limit, offset=offset, order_by=order_by, @@ -239,7 +292,12 @@ async def list_async( if utils.match_response(http_res, ["400", "401", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -339,7 +397,12 @@ def create( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -439,7 +502,12 @@ async def create_async( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -464,6 +532,9 @@ def count( web3_wallet: Optional[List[str]] = None, user_id: Optional[List[str]] = None, query: Optional[str] = None, + email_address_query: Optional[str] = None, + phone_number_query: Optional[str] = None, + username_query: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -480,6 +551,9 @@ def count( :param web3_wallet: Counts users with the specified web3 wallet addresses. Accepts up to 100 web3 wallet addresses. Any web3 wallet addressed not found are ignored. :param user_id: Counts users with the user ids specified. Accepts up to 100 user ids. Any user ids not found are ignored. :param query: Counts users that match the given query. For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names. The query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well. + :param email_address_query: Counts users with emails that match the given query, via case-insensitive partial match. For example, `email_address_query=ello` will match a user with the email `HELLO@example.com`, and will be included in the resulting count. + :param phone_number_query: Counts users with phone numbers that match the given query, via case-insensitive partial match. For example, `phone_number_query=555` will match a user with the phone number `+1555xxxxxxx`, and will be included in the resulting count. + :param username_query: Counts users with usernames that match the given query, via case-insensitive partial match. For example, `username_query=CoolUser` will match a user with the username `SomeCoolUser`, and will be included in the resulting count. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -501,6 +575,9 @@ def count( web3_wallet=web3_wallet, user_id=user_id, query=query, + email_address_query=email_address_query, + phone_number_query=phone_number_query, + username_query=username_query, ) req = self._build_request( @@ -544,7 +621,12 @@ def count( if utils.match_response(http_res, "422", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -569,6 +651,9 @@ async def count_async( web3_wallet: Optional[List[str]] = None, user_id: Optional[List[str]] = None, query: Optional[str] = None, + email_address_query: Optional[str] = None, + phone_number_query: Optional[str] = None, + username_query: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -585,6 +670,9 @@ async def count_async( :param web3_wallet: Counts users with the specified web3 wallet addresses. Accepts up to 100 web3 wallet addresses. Any web3 wallet addressed not found are ignored. :param user_id: Counts users with the user ids specified. Accepts up to 100 user ids. Any user ids not found are ignored. :param query: Counts users that match the given query. For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names. The query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well. + :param email_address_query: Counts users with emails that match the given query, via case-insensitive partial match. For example, `email_address_query=ello` will match a user with the email `HELLO@example.com`, and will be included in the resulting count. + :param phone_number_query: Counts users with phone numbers that match the given query, via case-insensitive partial match. For example, `phone_number_query=555` will match a user with the phone number `+1555xxxxxxx`, and will be included in the resulting count. + :param username_query: Counts users with usernames that match the given query, via case-insensitive partial match. For example, `username_query=CoolUser` will match a user with the username `SomeCoolUser`, and will be included in the resulting count. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -606,6 +694,9 @@ async def count_async( web3_wallet=web3_wallet, user_id=user_id, query=query, + email_address_query=email_address_query, + phone_number_query=phone_number_query, + username_query=username_query, ) req = self._build_request_async( @@ -649,7 +740,12 @@ async def count_async( if utils.match_response(http_res, "422", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -736,7 +832,12 @@ def get( if utils.match_response(http_res, ["400", "401", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -823,7 +924,12 @@ async def get_async( if utils.match_response(http_res, ["400", "401", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1003,7 +1109,12 @@ def update( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1183,7 +1294,12 @@ async def update_async( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1270,7 +1386,12 @@ def delete( if utils.match_response(http_res, ["400", "401", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1357,7 +1478,12 @@ async def delete_async( if utils.match_response(http_res, ["400", "401", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1444,7 +1570,12 @@ def ban( if utils.match_response(http_res, "402", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1531,7 +1662,12 @@ async def ban_async( if utils.match_response(http_res, "402", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1618,7 +1754,12 @@ def unban( if utils.match_response(http_res, "402", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1705,7 +1846,12 @@ async def unban_async( if utils.match_response(http_res, "402", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1793,7 +1939,12 @@ def lock( if utils.match_response(http_res, "403", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1881,7 +2032,12 @@ async def lock_async( if utils.match_response(http_res, "403", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -1968,7 +2124,12 @@ def unlock( if utils.match_response(http_res, "403", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -2055,7 +2216,12 @@ async def unlock_async( if utils.match_response(http_res, "403", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -2154,7 +2320,12 @@ def set_profile_image( if utils.match_response(http_res, ["400", "401", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -2253,7 +2424,12 @@ async def set_profile_image_async( if utils.match_response(http_res, ["400", "401", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -2340,7 +2516,12 @@ def delete_profile_image( if utils.match_response(http_res, "404", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -2427,7 +2608,12 @@ async def delete_profile_image_async( if utils.match_response(http_res, "404", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -2497,7 +2683,7 @@ def update_metadata( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", @@ -2507,9 +2693,9 @@ def update_metadata( get_serialized_body=lambda: utils.serialize_request_body( request.request_body, False, - False, + True, "json", - models.UpdateUserMetadataRequestBody, + Optional[models.UpdateUserMetadataRequestBody], ), timeout_ms=timeout_ms, ) @@ -2541,7 +2727,12 @@ def update_metadata( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -2611,7 +2802,7 @@ async def update_metadata_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", @@ -2621,9 +2812,9 @@ async def update_metadata_async( get_serialized_body=lambda: utils.serialize_request_body( request.request_body, False, - False, + True, "json", - models.UpdateUserMetadataRequestBody, + Optional[models.UpdateUserMetadataRequestBody], ), timeout_ms=timeout_ms, ) @@ -2655,7 +2846,12 @@ async def update_metadata_async( ): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -2736,7 +2932,7 @@ def get_o_auth_access_token( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["400", "422", "4XX", "5XX"], + error_status_codes=["400", "404", "422", "4XX", "5XX"], retry_config=retry_config, ) @@ -2745,10 +2941,15 @@ def get_o_auth_access_token( return utils.unmarshal_json( http_res.text, Optional[List[models.ResponseBody]] ) - if utils.match_response(http_res, ["400", "422"], "application/json"): + if utils.match_response(http_res, ["400", "404", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -2829,7 +3030,7 @@ async def get_o_auth_access_token_async( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["400", "422", "4XX", "5XX"], + error_status_codes=["400", "404", "422", "4XX", "5XX"], retry_config=retry_config, ) @@ -2838,10 +3039,15 @@ async def get_o_auth_access_token_async( return utils.unmarshal_json( http_res.text, Optional[List[models.ResponseBody]] ) - if utils.match_response(http_res, ["400", "422"], "application/json"): + if utils.match_response(http_res, ["400", "404", "422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -2936,7 +3142,12 @@ def get_organization_memberships( if utils.match_response(http_res, "403", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -3031,7 +3242,12 @@ async def get_organization_memberships_async( if utils.match_response(http_res, "403", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -3130,7 +3346,12 @@ def get_organization_invitations( if utils.match_response(http_res, ["400", "403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -3229,7 +3450,12 @@ async def get_organization_invitations_async( if utils.match_response(http_res, ["400", "403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -3287,7 +3513,7 @@ def verify_password( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", @@ -3297,9 +3523,9 @@ def verify_password( get_serialized_body=lambda: utils.serialize_request_body( request.request_body, False, - False, + True, "json", - models.VerifyPasswordRequestBody, + Optional[models.VerifyPasswordRequestBody], ), timeout_ms=timeout_ms, ) @@ -3328,7 +3554,7 @@ def verify_password( return utils.unmarshal_json( http_res.text, Optional[models.VerifyPasswordResponseBody] ) - if utils.match_response(http_res, ["400", "404", "422", "4XX", "5XX"], "*"): + if utils.match_response(http_res, ["400", "404", "422", "4XX"], "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -3336,6 +3562,11 @@ def verify_password( if utils.match_response(http_res, "500", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -3389,7 +3620,7 @@ async def verify_password_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", @@ -3399,9 +3630,9 @@ async def verify_password_async( get_serialized_body=lambda: utils.serialize_request_body( request.request_body, False, - False, + True, "json", - models.VerifyPasswordRequestBody, + Optional[models.VerifyPasswordRequestBody], ), timeout_ms=timeout_ms, ) @@ -3430,7 +3661,7 @@ async def verify_password_async( return utils.unmarshal_json( http_res.text, Optional[models.VerifyPasswordResponseBody] ) - if utils.match_response(http_res, ["400", "404", "422", "4XX", "5XX"], "*"): + if utils.match_response(http_res, ["400", "404", "422", "4XX"], "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -3438,6 +3669,11 @@ async def verify_password_async( if utils.match_response(http_res, "500", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -3493,7 +3729,7 @@ def verify_totp( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", @@ -3501,7 +3737,11 @@ def verify_totp( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.request_body, False, False, "json", models.VerifyTOTPRequestBody + request.request_body, + False, + True, + "json", + Optional[models.VerifyTOTPRequestBody], ), timeout_ms=timeout_ms, ) @@ -3530,7 +3770,7 @@ def verify_totp( return utils.unmarshal_json( http_res.text, Optional[models.VerifyTOTPResponseBody] ) - if utils.match_response(http_res, ["400", "404", "422", "4XX", "5XX"], "*"): + if utils.match_response(http_res, ["400", "404", "422", "4XX"], "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -3538,6 +3778,11 @@ def verify_totp( if utils.match_response(http_res, "500", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -3593,7 +3838,7 @@ async def verify_totp_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", @@ -3601,7 +3846,11 @@ async def verify_totp_async( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.request_body, False, False, "json", models.VerifyTOTPRequestBody + request.request_body, + False, + True, + "json", + Optional[models.VerifyTOTPRequestBody], ), timeout_ms=timeout_ms, ) @@ -3630,7 +3879,7 @@ async def verify_totp_async( return utils.unmarshal_json( http_res.text, Optional[models.VerifyTOTPResponseBody] ) - if utils.match_response(http_res, ["400", "404", "422", "4XX", "5XX"], "*"): + if utils.match_response(http_res, ["400", "404", "422", "4XX"], "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -3638,6 +3887,11 @@ async def verify_totp_async( if utils.match_response(http_res, "500", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -3719,10 +3973,18 @@ def disable_mfa( return utils.unmarshal_json( http_res.text, Optional[models.DisableMFAResponseBody] ) - if utils.match_response(http_res, ["404", "500"], "application/json"): + if utils.match_response(http_res, "404", "application/json"): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "500", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -3808,10 +4070,18 @@ async def disable_mfa_async( return utils.unmarshal_json( http_res.text, Optional[models.DisableMFAResponseBody] ) - if utils.match_response(http_res, ["404", "500"], "application/json"): + if utils.match_response(http_res, "404", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "500", "application/json"): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -3897,10 +4167,18 @@ def delete_backup_codes( return utils.unmarshal_json( http_res.text, Optional[models.DeleteBackupCodeResponseBody] ) - if utils.match_response(http_res, ["404", "500"], "application/json"): + if utils.match_response(http_res, "404", "application/json"): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "500", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -3986,10 +4264,18 @@ async def delete_backup_codes_async( return utils.unmarshal_json( http_res.text, Optional[models.DeleteBackupCodeResponseBody] ) - if utils.match_response(http_res, ["404", "500"], "application/json"): + if utils.match_response(http_res, "404", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "500", "application/json"): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -4076,10 +4362,18 @@ def delete_passkey( data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, Optional[models.DeletedObject]) - if utils.match_response(http_res, ["403", "404", "500"], "application/json"): + if utils.match_response(http_res, ["403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "500", "application/json"): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -4166,10 +4460,18 @@ async def delete_passkey_async( data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, Optional[models.DeletedObject]) - if utils.match_response(http_res, ["403", "404", "500"], "application/json"): + if utils.match_response(http_res, ["403", "404"], "application/json"): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "500", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -4256,12 +4558,18 @@ def delete_web3_wallet( data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, Optional[models.DeletedObject]) - if utils.match_response( - http_res, ["400", "403", "404", "500"], "application/json" - ): + if utils.match_response(http_res, ["400", "403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "500", "application/json"): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -4348,12 +4656,18 @@ async def delete_web3_wallet_async( data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, Optional[models.DeletedObject]) - if utils.match_response( - http_res, ["400", "403", "404", "500"], "application/json" - ): + if utils.match_response(http_res, ["400", "403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "500", "application/json"): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -4438,10 +4752,18 @@ def create_totp( data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, Optional[models.Totp]) - if utils.match_response(http_res, ["403", "404", "500"], "application/json"): + if utils.match_response(http_res, ["403", "404"], "application/json"): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "500", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -4526,10 +4848,18 @@ async def create_totp_async( data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, Optional[models.Totp]) - if utils.match_response(http_res, ["403", "404", "500"], "application/json"): + if utils.match_response(http_res, ["403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "500", "application/json"): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -4615,10 +4945,18 @@ def delete_totp( return utils.unmarshal_json( http_res.text, Optional[models.DeleteTOTPResponseBody] ) - if utils.match_response(http_res, ["404", "500"], "application/json"): + if utils.match_response(http_res, "404", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "500", "application/json"): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -4704,10 +5042,18 @@ async def delete_totp_async( return utils.unmarshal_json( http_res.text, Optional[models.DeleteTOTPResponseBody] ) - if utils.match_response(http_res, ["404", "500"], "application/json"): + if utils.match_response(http_res, "404", "application/json"): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "500", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -4794,12 +5140,18 @@ def delete_external_account( data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, Optional[models.DeletedObject]) - if utils.match_response( - http_res, ["400", "403", "404", "500"], "application/json" - ): + if utils.match_response(http_res, ["400", "403", "404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "500", "application/json"): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -4886,12 +5238,18 @@ async def delete_external_account_async( data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, Optional[models.DeletedObject]) - if utils.match_response( - http_res, ["400", "403", "404", "500"], "application/json" - ): + if utils.match_response(http_res, ["400", "403", "404"], "application/json"): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "500", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/clerk_backend_api/waitlist_entries_sdk.py b/src/clerk_backend_api/waitlist_entries_sdk.py new file mode 100644 index 0000000..5960550 --- /dev/null +++ b/src/clerk_backend_api/waitlist_entries_sdk.py @@ -0,0 +1,427 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from clerk_backend_api import models, utils +from clerk_backend_api._hooks import HookContext +from clerk_backend_api.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Mapping, Optional, Union, cast + + +class WaitlistEntriesSDK(BaseSDK): + def list_waitlist_entries( + self, + *, + limit: Optional[int] = 10, + offset: Optional[int] = 0, + query: Optional[str] = None, + status: Optional[models.ListWaitlistEntriesQueryParamStatus] = None, + order_by: Optional[str] = "-created_at", + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.WaitlistEntries]: + r"""List all waitlist entries + + Retrieve a list of waitlist entries for the instance. + Entries are ordered by creation date in descending order by default. + Supports filtering by email address or status and pagination with limit and offset parameters. + + :param limit: Applies a limit to the number of results returned. Can be used for paginating the results together with `offset`. + :param offset: Skip the first `offset` results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with `limit`. + :param query: Filter waitlist entries by email address + :param status: Filter waitlist entries by their status + :param order_by: Specify the order of results. Supported values are: - `created_at` - `email_address` - `invited_at` Use `+` for ascending or `-` for descending order. Defaults to `-created_at`. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.ListWaitlistEntriesRequest( + limit=limit, + offset=offset, + query=query, + status=status, + order_by=order_by, + ) + + req = self._build_request( + method="GET", + path="/waitlist_entries", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="ListWaitlistEntries", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[models.WaitlistEntries]) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def list_waitlist_entries_async( + self, + *, + limit: Optional[int] = 10, + offset: Optional[int] = 0, + query: Optional[str] = None, + status: Optional[models.ListWaitlistEntriesQueryParamStatus] = None, + order_by: Optional[str] = "-created_at", + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.WaitlistEntries]: + r"""List all waitlist entries + + Retrieve a list of waitlist entries for the instance. + Entries are ordered by creation date in descending order by default. + Supports filtering by email address or status and pagination with limit and offset parameters. + + :param limit: Applies a limit to the number of results returned. Can be used for paginating the results together with `offset`. + :param offset: Skip the first `offset` results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with `limit`. + :param query: Filter waitlist entries by email address + :param status: Filter waitlist entries by their status + :param order_by: Specify the order of results. Supported values are: - `created_at` - `email_address` - `invited_at` Use `+` for ascending or `-` for descending order. Defaults to `-created_at`. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.ListWaitlistEntriesRequest( + limit=limit, + offset=offset, + query=query, + status=status, + order_by=order_by, + ) + + req = self._build_request_async( + method="GET", + path="/waitlist_entries", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="ListWaitlistEntries", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[models.WaitlistEntries]) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def create_waitlist_entry( + self, + *, + request: Optional[ + Union[ + models.CreateWaitlistEntryRequestBody, + models.CreateWaitlistEntryRequestBodyTypedDict, + ] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.WaitlistEntry]: + r"""Create a waitlist entry + + Creates a new waitlist entry for the given email address. + If the email address is already on the waitlist, no new entry will be created and the existing waitlist entry will be returned. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[models.CreateWaitlistEntryRequestBody] + ) + request = cast(Optional[models.CreateWaitlistEntryRequestBody], request) + + req = self._build_request( + method="POST", + path="/waitlist_entries", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, + False, + True, + "json", + Optional[models.CreateWaitlistEntryRequestBody], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="CreateWaitlistEntry", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["400", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[models.WaitlistEntry]) + if utils.match_response(http_res, ["400", "422"], "application/json"): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def create_waitlist_entry_async( + self, + *, + request: Optional[ + Union[ + models.CreateWaitlistEntryRequestBody, + models.CreateWaitlistEntryRequestBodyTypedDict, + ] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.WaitlistEntry]: + r"""Create a waitlist entry + + Creates a new waitlist entry for the given email address. + If the email address is already on the waitlist, no new entry will be created and the existing waitlist entry will be returned. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[models.CreateWaitlistEntryRequestBody] + ) + request = cast(Optional[models.CreateWaitlistEntryRequestBody], request) + + req = self._build_request_async( + method="POST", + path="/waitlist_entries", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, + False, + True, + "json", + Optional[models.CreateWaitlistEntryRequestBody], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="CreateWaitlistEntry", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["400", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[models.WaitlistEntry]) + if utils.match_response(http_res, ["400", "422"], "application/json"): + data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) + raise models.ClerkErrors(data=data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) diff --git a/src/clerk_backend_api/webhooks.py b/src/clerk_backend_api/webhooks.py index 8781a67..93a473a 100644 --- a/src/clerk_backend_api/webhooks.py +++ b/src/clerk_backend_api/webhooks.py @@ -77,7 +77,12 @@ def create_svix_app( if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -157,7 +162,12 @@ async def create_svix_app_async( if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -237,7 +247,12 @@ def delete_svix_app( if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -317,7 +332,12 @@ async def delete_svix_app_async( if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -397,7 +417,12 @@ def generate_svix_auth_url( if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -477,7 +502,12 @@ async def generate_svix_auth_url_async( if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res