diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 67e08c3..979c2dd 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,18 +1,19 @@ lockVersion: 2.0.0 id: bfe29c99-6e67-43fe-b928-64d6a5ed6aa8 management: - docChecksum: fae7f7a09c243660c1f412f56e7e9e5a + docChecksum: 13a24fca7e232a3f889cb2e130c9611f docVersion: v1 speakeasyVersion: 1.385.0 generationVersion: 2.407.2 - releaseVersion: 0.5.0 - configChecksum: 0f690552e0fb9523c04a7f5017e28525 + releaseVersion: 1.0.0 + configChecksum: 4aff20ae5943af7882208dce8eacd52d repoURL: https://github.com/clerk/clerk-sdk-python.git installationURL: https://github.com/clerk/clerk-sdk-python.git published: true features: python: additionalDependencies: 1.0.0 + additionalProperties: 1.0.0 constsAndDefaults: 1.0.2 core: 5.4.2 defaultEnabledRetries: 0.2.0 @@ -29,7 +30,6 @@ features: multipartFileContentType: 1.0.0 nameOverrides: 3.0.0 nullables: 1.0.0 - pagination: 3.0.1 responseFormat: 1.0.0 retries: 3.0.0 sdkHooks: 1.0.0 @@ -37,15 +37,19 @@ features: uploadStreams: 1.0.0 generatedFiles: - src/clerk_backend_api/sdkconfiguration.py - - src/clerk_backend_api/misc.py + - src/clerk_backend_api/miscellaneous.py - src/clerk_backend_api/jwks.py - src/clerk_backend_api/clients.py - src/clerk_backend_api/emailaddresses.py - src/clerk_backend_api/phonenumbers.py - src/clerk_backend_api/sessions.py + - src/clerk_backend_api/emailsmstemplates.py + - src/clerk_backend_api/emailandsmstemplates.py - src/clerk_backend_api/templates.py - src/clerk_backend_api/users.py - src/clerk_backend_api/invitations.py + - src/clerk_backend_api/organizationinvitations_sdk.py + - src/clerk_backend_api/allowlistblocklist.py - src/clerk_backend_api/allowlistidentifiers.py - src/clerk_backend_api/blocklistidentifiers_sdk.py - src/clerk_backend_api/betafeatures.py @@ -55,10 +59,12 @@ generatedFiles: - src/clerk_backend_api/webhooks.py - src/clerk_backend_api/jwttemplates.py - src/clerk_backend_api/organizations_sdk.py - - src/clerk_backend_api/organizationinvitations_sdk.py - src/clerk_backend_api/organizationmemberships_sdk.py + - src/clerk_backend_api/organizationdomains_sdk.py + - src/clerk_backend_api/organizationdomain_sdk.py - src/clerk_backend_api/proxychecks.py - src/clerk_backend_api/redirecturls.py + - src/clerk_backend_api/clerk_redirecturls.py - src/clerk_backend_api/signintokens.py - src/clerk_backend_api/signups.py - src/clerk_backend_api/oauthapplications_sdk.py @@ -96,11 +102,12 @@ generatedFiles: - src/clerk_backend_api/utils/values.py - src/clerk_backend_api/models/sdkerror.py - src/clerk_backend_api/models/getpublicinterstitialop.py - - src/clerk_backend_api/models/getclientlistop.py + - src/clerk_backend_api/models/wellknown_jwks.py - src/clerk_backend_api/models/client.py - src/clerk_backend_api/models/session.py - src/clerk_backend_api/models/clerkerrors.py - src/clerk_backend_api/models/clerkerror.py + - src/clerk_backend_api/models/getclientlistop.py - src/clerk_backend_api/models/verifyclientop.py - src/clerk_backend_api/models/getclientop.py - src/clerk_backend_api/models/emailaddress.py @@ -121,12 +128,10 @@ generatedFiles: - src/clerk_backend_api/models/verifysessionop.py - src/clerk_backend_api/models/createsessiontokenfromtemplateop.py - src/clerk_backend_api/models/template.py - - src/clerk_backend_api/models/gettemplatelistop.py - src/clerk_backend_api/models/gettemplateop.py + - src/clerk_backend_api/models/toggletemplatedeliveryop.py - src/clerk_backend_api/models/upserttemplateop.py - - src/clerk_backend_api/models/reverttemplateop.py - src/clerk_backend_api/models/previewtemplateop.py - - src/clerk_backend_api/models/toggletemplatedeliveryop.py - src/clerk_backend_api/models/user.py - src/clerk_backend_api/models/samlaccount.py - src/clerk_backend_api/models/schemas_passkey.py @@ -146,24 +151,43 @@ generatedFiles: - src/clerk_backend_api/models/deleteuserprofileimageop.py - src/clerk_backend_api/models/updateusermetadataop.py - src/clerk_backend_api/models/getoauthaccesstokenop.py - - src/clerk_backend_api/models/usersgetorganizationmembershipsop.py - src/clerk_backend_api/models/organizationmemberships.py - src/clerk_backend_api/models/organizationmembership.py + - src/clerk_backend_api/models/usersgetorganizationmembershipsop.py + - src/clerk_backend_api/models/organizationinvitationswithpublicorganizationdata.py + - src/clerk_backend_api/models/organizationinvitationwithpublicorganizationdata.py + - src/clerk_backend_api/models/usersgetorganizationinvitationsop.py - src/clerk_backend_api/models/verifypasswordop.py - src/clerk_backend_api/models/verifytotpop.py - src/clerk_backend_api/models/disablemfaop.py + - src/clerk_backend_api/models/deletebackupcodeop.py + - src/clerk_backend_api/models/userpasskeydeleteop.py + - src/clerk_backend_api/models/userweb3walletdeleteop.py + - src/clerk_backend_api/models/totp.py + - src/clerk_backend_api/models/createusertotpop.py + - src/clerk_backend_api/models/deletetotpop.py + - src/clerk_backend_api/models/deleteexternalaccountop.py - src/clerk_backend_api/models/invitation.py - src/clerk_backend_api/models/createinvitationop.py - src/clerk_backend_api/models/listinvitationsop.py - src/clerk_backend_api/models/invitation_revoked.py - src/clerk_backend_api/models/revokeinvitationop.py + - src/clerk_backend_api/models/listinstanceorganizationinvitationsop.py + - src/clerk_backend_api/models/organizationinvitation.py + - src/clerk_backend_api/models/createorganizationinvitationop.py + - src/clerk_backend_api/models/organizationinvitations.py + - src/clerk_backend_api/models/listorganizationinvitationsop.py + - src/clerk_backend_api/models/createorganizationinvitationbulkop.py + - src/clerk_backend_api/models/listpendingorganizationinvitationsop.py + - src/clerk_backend_api/models/getorganizationinvitationop.py + - src/clerk_backend_api/models/revokeorganizationinvitationop.py - src/clerk_backend_api/models/allowlistidentifier.py - src/clerk_backend_api/models/createallowlistidentifierop.py - - src/clerk_backend_api/models/deleteallowlistidentifierop.py - - src/clerk_backend_api/models/blocklistidentifiers.py - src/clerk_backend_api/models/blocklistidentifier.py - src/clerk_backend_api/models/createblocklistidentifierop.py - src/clerk_backend_api/models/deleteblocklistidentifierop.py + - src/clerk_backend_api/models/deleteallowlistidentifierop.py + - src/clerk_backend_api/models/blocklistidentifiers.py - src/clerk_backend_api/models/instancesettings.py - src/clerk_backend_api/models/updateinstanceauthconfigop.py - src/clerk_backend_api/models/updateproductioninstancedomainop.py @@ -199,19 +223,18 @@ generatedFiles: - src/clerk_backend_api/models/organizationwithlogo.py - src/clerk_backend_api/models/uploadorganizationlogoop.py - src/clerk_backend_api/models/deleteorganizationlogoop.py - - src/clerk_backend_api/models/organizationinvitation.py - - src/clerk_backend_api/models/createorganizationinvitationop.py - - src/clerk_backend_api/models/listorganizationinvitationsop.py - - src/clerk_backend_api/models/organizationinvitations.py - - src/clerk_backend_api/models/createorganizationinvitationbulkop.py - - src/clerk_backend_api/models/listpendingorganizationinvitationsop.py - - src/clerk_backend_api/models/getorganizationinvitationop.py - - src/clerk_backend_api/models/revokeorganizationinvitationop.py - src/clerk_backend_api/models/createorganizationmembershipop.py - src/clerk_backend_api/models/listorganizationmembershipsop.py - src/clerk_backend_api/models/updateorganizationmembershipop.py - src/clerk_backend_api/models/deleteorganizationmembershipop.py - src/clerk_backend_api/models/updateorganizationmembershipmetadataop.py + - src/clerk_backend_api/models/instancegetorganizationmembershipsop.py + - src/clerk_backend_api/models/organizationdomain.py + - src/clerk_backend_api/models/createorganizationdomainop.py + - src/clerk_backend_api/models/organizationdomains.py + - src/clerk_backend_api/models/listorganizationdomainsop.py + - src/clerk_backend_api/models/deleteorganizationdomainop.py + - src/clerk_backend_api/models/updateorganizationdomainop.py - src/clerk_backend_api/models/proxycheck.py - src/clerk_backend_api/models/verifydomainproxyop.py - src/clerk_backend_api/models/redirecturl.py @@ -223,18 +246,18 @@ generatedFiles: - src/clerk_backend_api/models/revokesignintokenop.py - src/clerk_backend_api/models/signup.py - src/clerk_backend_api/models/updatesignupop.py - - src/clerk_backend_api/models/listoauthapplicationsop.py - src/clerk_backend_api/models/oauthapplications.py - src/clerk_backend_api/models/oauthapplication.py + - src/clerk_backend_api/models/listoauthapplicationsop.py - src/clerk_backend_api/models/oauthapplicationwithsecret.py - src/clerk_backend_api/models/createoauthapplicationop.py - src/clerk_backend_api/models/getoauthapplicationop.py - src/clerk_backend_api/models/updateoauthapplicationop.py - src/clerk_backend_api/models/deleteoauthapplicationop.py - src/clerk_backend_api/models/rotateoauthapplicationsecretop.py - - src/clerk_backend_api/models/listsamlconnectionsop.py - src/clerk_backend_api/models/samlconnections.py - - src/clerk_backend_api/models/samlconnection.py + - src/clerk_backend_api/models/schemas_samlconnection.py + - src/clerk_backend_api/models/listsamlconnectionsop.py - src/clerk_backend_api/models/createsamlconnectionop.py - src/clerk_backend_api/models/getsamlconnectionop.py - src/clerk_backend_api/models/updatesamlconnectionop.py @@ -243,18 +266,20 @@ generatedFiles: - src/clerk_backend_api/models/security.py - src/clerk_backend_api/models/__init__.py - docs/models/getpublicinterstitialrequest.md - - docs/models/getclientlistrequest.md - - docs/models/getclientlistresponse.md + - docs/models/keys.md + - docs/models/wellknownjwks.md - docs/models/object.md - docs/models/client.md - docs/models/sessionobject.md - docs/models/actor.md - docs/models/status.md + - docs/models/latestactivity.md - docs/models/session.md - docs/models/clerkerrorsmeta.md - docs/models/clerkerrors.md - docs/models/meta.md - docs/models/clerkerror.md + - docs/models/getclientlistrequest.md - docs/models/verifyclientrequestbody.md - docs/models/getclientrequest.md - docs/models/emailaddressobject.md @@ -305,21 +330,17 @@ generatedFiles: - docs/models/createsessiontokenfromtemplateresponsebody.md - docs/models/templateobject.md - docs/models/template.md - - docs/models/templatetype.md - - docs/models/gettemplatelistrequest.md - docs/models/pathparamtemplatetype.md - docs/models/gettemplaterequest.md + - docs/models/toggletemplatedeliverypathparamtemplatetype.md + - docs/models/toggletemplatedeliveryrequestbody.md + - docs/models/toggletemplatedeliveryrequest.md - docs/models/upserttemplatepathparamtemplatetype.md - docs/models/upserttemplaterequestbody.md - docs/models/upserttemplaterequest.md - - docs/models/reverttemplatepathparamtemplatetype.md - - docs/models/reverttemplaterequest.md - docs/models/previewtemplaterequestbody.md - docs/models/previewtemplaterequest.md - docs/models/previewtemplateresponsebody.md - - docs/models/toggletemplatedeliverypathparamtemplatetype.md - - docs/models/toggletemplatedeliveryrequestbody.md - - docs/models/toggletemplatedeliveryrequest.md - docs/models/userobject.md - docs/models/publicmetadata.md - docs/models/privatemetadata.md @@ -338,11 +359,13 @@ generatedFiles: - docs/models/verificationerror.md - docs/models/saml.md - docs/models/samlaccountverification.md + - docs/models/samlconnectionsamlconnection.md + - docs/models/samlconnection.md - docs/models/samlaccount.md - docs/models/schemaspasskeyobject.md - docs/models/passkeyverificationstatus.md - docs/models/passkeyverificationstrategy.md - - docs/models/verificationnonce.md + - docs/models/nonce.md - docs/models/passkey.md - docs/models/schemaspasskeyverification.md - docs/models/schemaspasskey.md @@ -352,12 +375,10 @@ generatedFiles: - docs/models/web3walletverificationadmin.md - docs/models/web3signatureverificationstatus.md - docs/models/web3signatureverificationstrategy.md - - docs/models/nonce.md - docs/models/web3signature.md - docs/models/web3walletverification.md - docs/models/web3wallet.md - docs/models/getuserlistrequest.md - - docs/models/passwordhasher.md - docs/models/createuserpublicmetadata.md - docs/models/createuserprivatemetadata.md - docs/models/createuserunsafemetadata.md @@ -366,7 +387,6 @@ generatedFiles: - docs/models/totalcount.md - docs/models/getuserscountrequest.md - docs/models/getuserrequest.md - - docs/models/updateuserpasswordhasher.md - docs/models/updateuserpublicmetadata.md - docs/models/updateuserprivatemetadata.md - docs/models/updateuserunsafemetadata.md @@ -381,15 +401,11 @@ generatedFiles: - docs/models/setuserprofileimagerequestbody.md - docs/models/setuserprofileimagerequest.md - docs/models/deleteuserprofileimagerequest.md - - docs/models/updateusermetadataprivatemetadata.md - - docs/models/updateusermetadataunsafemetadata.md - docs/models/updateusermetadatarequestbody.md - docs/models/updateusermetadatarequest.md - docs/models/getoauthaccesstokenrequest.md - docs/models/getoauthaccesstokenpublicmetadata.md - docs/models/responsebody.md - - docs/models/usersgetorganizationmembershipsrequest.md - - docs/models/usersgetorganizationmembershipsresponse.md - docs/models/organizationmemberships.md - docs/models/organizationmembershipobject.md - docs/models/organizationmembershippublicmetadata.md @@ -400,6 +416,15 @@ generatedFiles: - docs/models/organizationmembershiporganization.md - docs/models/publicuserdata.md - docs/models/organizationmembership.md + - docs/models/usersgetorganizationmembershipsrequest.md + - docs/models/organizationinvitationswithpublicorganizationdata.md + - docs/models/organizationinvitationwithpublicorganizationdataobject.md + - docs/models/organizationinvitationwithpublicorganizationdatapublicmetadata.md + - docs/models/organizationinvitationwithpublicorganizationdataprivatemetadata.md + - docs/models/publicorganizationdata.md + - docs/models/organizationinvitationwithpublicorganizationdata.md + - docs/models/usersgetorganizationinvitationsqueryparamstatus.md + - docs/models/usersgetorganizationinvitationsrequest.md - docs/models/verifypasswordrequestbody.md - docs/models/verifypasswordrequest.md - docs/models/verifypasswordresponsebody.md @@ -409,6 +434,15 @@ generatedFiles: - docs/models/verifytotpresponsebody.md - docs/models/disablemfarequest.md - docs/models/disablemfaresponsebody.md + - docs/models/deletebackupcoderequest.md + - docs/models/deletebackupcoderesponsebody.md + - docs/models/userpasskeydeleterequest.md + - docs/models/userweb3walletdeleterequest.md + - docs/models/totp.md + - docs/models/createusertotprequest.md + - docs/models/deletetotprequest.md + - docs/models/deletetotpresponsebody.md + - docs/models/deleteexternalaccountrequest.md - docs/models/invitationobject.md - docs/models/invitationpublicmetadata.md - docs/models/invitationstatus.md @@ -417,23 +451,43 @@ generatedFiles: - docs/models/createinvitationrequestbody.md - docs/models/listinvitationsqueryparamstatus.md - docs/models/listinvitationsrequest.md - - docs/models/listinvitationsresponse.md - docs/models/invitationrevokedobject.md - docs/models/invitationrevokedpublicmetadata.md - docs/models/invitationrevokedstatus.md - docs/models/invitationrevoked.md - docs/models/revokeinvitationrequest.md + - docs/models/listinstanceorganizationinvitationsqueryparamstatus.md + - docs/models/listinstanceorganizationinvitationsrequest.md + - docs/models/organizationinvitationobject.md + - docs/models/organizationinvitationpublicmetadata.md + - docs/models/organizationinvitationprivatemetadata.md + - docs/models/organizationinvitation.md + - docs/models/createorganizationinvitationpublicmetadata.md + - docs/models/createorganizationinvitationprivatemetadata.md + - docs/models/createorganizationinvitationrequestbody.md + - docs/models/createorganizationinvitationrequest.md + - docs/models/organizationinvitations.md + - docs/models/listorganizationinvitationsqueryparamstatus.md + - docs/models/listorganizationinvitationsrequest.md + - docs/models/createorganizationinvitationbulkpublicmetadata.md + - docs/models/createorganizationinvitationbulkprivatemetadata.md + - docs/models/requestbody.md + - docs/models/createorganizationinvitationbulkrequest.md + - docs/models/listpendingorganizationinvitationsrequest.md + - docs/models/getorganizationinvitationrequest.md + - docs/models/revokeorganizationinvitationrequestbody.md + - docs/models/revokeorganizationinvitationrequest.md - docs/models/allowlistidentifierobject.md - docs/models/identifiertype.md - docs/models/allowlistidentifier.md - docs/models/createallowlistidentifierrequestbody.md - - docs/models/deleteallowlistidentifierrequest.md - - docs/models/blocklistidentifiers.md - docs/models/blocklistidentifierobject.md - docs/models/blocklistidentifieridentifiertype.md - docs/models/blocklistidentifier.md - docs/models/createblocklistidentifierrequestbody.md - docs/models/deleteblocklistidentifierrequest.md + - docs/models/deleteallowlistidentifierrequest.md + - docs/models/blocklistidentifiers.md - docs/models/instancesettingsobject.md - docs/models/instancesettings.md - docs/models/updateinstanceauthconfigrequestbody.md @@ -443,6 +497,7 @@ generatedFiles: - docs/models/actortokenstatus.md - docs/models/actortokenactor.md - docs/models/actortoken.md + - docs/models/createactortokenactor.md - docs/models/createactortokenrequestbody.md - docs/models/revokeactortokenrequest.md - docs/models/domains.md @@ -499,31 +554,9 @@ generatedFiles: - docs/models/uploadorganizationlogorequestbody.md - docs/models/uploadorganizationlogorequest.md - docs/models/deleteorganizationlogorequest.md - - docs/models/organizationinvitationobject.md - - docs/models/organizationinvitationpublicmetadata.md - - docs/models/organizationinvitationprivatemetadata.md - - docs/models/organizationinvitation.md - - docs/models/createorganizationinvitationpublicmetadata.md - - docs/models/createorganizationinvitationprivatemetadata.md - - docs/models/createorganizationinvitationrequestbody.md - - docs/models/createorganizationinvitationrequest.md - - docs/models/listorganizationinvitationsqueryparamstatus.md - - docs/models/listorganizationinvitationsrequest.md - - docs/models/listorganizationinvitationsresponse.md - - docs/models/organizationinvitations.md - - docs/models/createorganizationinvitationbulkpublicmetadata.md - - docs/models/createorganizationinvitationbulkprivatemetadata.md - - docs/models/requestbody.md - - docs/models/createorganizationinvitationbulkrequest.md - - docs/models/listpendingorganizationinvitationsrequest.md - - docs/models/listpendingorganizationinvitationsresponse.md - - docs/models/getorganizationinvitationrequest.md - - docs/models/revokeorganizationinvitationrequestbody.md - - docs/models/revokeorganizationinvitationrequest.md - docs/models/createorganizationmembershiprequestbody.md - docs/models/createorganizationmembershiprequest.md - docs/models/listorganizationmembershipsrequest.md - - docs/models/listorganizationmembershipsresponse.md - docs/models/updateorganizationmembershiprequestbody.md - docs/models/updateorganizationmembershiprequest.md - docs/models/deleteorganizationmembershiprequest.md @@ -531,6 +564,19 @@ generatedFiles: - docs/models/updateorganizationmembershipmetadataprivatemetadata.md - docs/models/updateorganizationmembershipmetadatarequestbody.md - docs/models/updateorganizationmembershipmetadatarequest.md + - docs/models/instancegetorganizationmembershipsrequest.md + - docs/models/organizationdomainobject.md + - docs/models/enrollmentmode.md + - docs/models/organizationdomainstatus.md + - docs/models/organizationdomainverification.md + - docs/models/organizationdomain.md + - docs/models/createorganizationdomainrequestbody.md + - docs/models/createorganizationdomainrequest.md + - docs/models/organizationdomains.md + - docs/models/listorganizationdomainsrequest.md + - docs/models/deleteorganizationdomainrequest.md + - docs/models/updateorganizationdomainrequestbody.md + - docs/models/updateorganizationdomainrequest.md - docs/models/proxycheckobject.md - docs/models/proxycheck.md - docs/models/verifydomainproxyrequestbody.md @@ -553,11 +599,10 @@ generatedFiles: - docs/models/signup.md - docs/models/updatesignuprequestbody.md - docs/models/updatesignuprequest.md - - docs/models/listoauthapplicationsrequest.md - - docs/models/listoauthapplicationsresponse.md - docs/models/oauthapplications.md - docs/models/oauthapplicationobject.md - docs/models/oauthapplication.md + - docs/models/listoauthapplicationsrequest.md - docs/models/oauthapplicationwithsecretobject.md - docs/models/oauthapplicationwithsecret.md - docs/models/createoauthapplicationrequestbody.md @@ -566,12 +611,11 @@ generatedFiles: - docs/models/updateoauthapplicationrequest.md - docs/models/deleteoauthapplicationrequest.md - docs/models/rotateoauthapplicationsecretrequest.md - - docs/models/listsamlconnectionsrequest.md - - docs/models/listsamlconnectionsresponse.md - docs/models/samlconnections.md - - docs/models/samlconnectionobject.md + - docs/models/schemassamlconnectionobject.md - docs/models/attributemapping.md - - docs/models/samlconnection.md + - docs/models/schemassamlconnection.md + - docs/models/listsamlconnectionsrequest.md - docs/models/provider.md - docs/models/createsamlconnectionattributemapping.md - docs/models/createsamlconnectionrequestbody.md @@ -585,15 +629,19 @@ generatedFiles: - docs/models/security.md - docs/sdks/clerk/README.md - docs/models/utils/retryconfig.md - - docs/sdks/misc/README.md + - docs/sdks/miscellaneous/README.md - docs/sdks/jwks/README.md - docs/sdks/clients/README.md - docs/sdks/emailaddresses/README.md - docs/sdks/phonenumbers/README.md - docs/sdks/sessions/README.md + - docs/sdks/emailsmstemplates/README.md + - docs/sdks/emailandsmstemplates/README.md - docs/sdks/templates/README.md - docs/sdks/users/README.md - docs/sdks/invitations/README.md + - docs/sdks/organizationinvitationssdk/README.md + - docs/sdks/allowlistblocklist/README.md - docs/sdks/allowlistidentifiers/README.md - docs/sdks/blocklistidentifierssdk/README.md - docs/sdks/betafeatures/README.md @@ -603,10 +651,12 @@ generatedFiles: - docs/sdks/webhooks/README.md - docs/sdks/jwttemplates/README.md - docs/sdks/organizationssdk/README.md - - docs/sdks/organizationinvitationssdk/README.md - docs/sdks/organizationmembershipssdk/README.md + - docs/sdks/organizationdomainssdk/README.md + - docs/sdks/organizationdomainsdk/README.md - docs/sdks/proxychecks/README.md - docs/sdks/redirecturls/README.md + - docs/sdks/clerkredirecturls/README.md - docs/sdks/signintokens/README.md - docs/sdks/signups/README.md - docs/sdks/oauthapplicationssdk/README.md diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 38f1c75..db6c203 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true python: - version: 0.5.0 + version: 1.0.0 additionalDependencies: dev: pytest: ^8.3.3 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index c3e6980..555a607 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.385.0 sources: clerk-openapi: sourceNamespace: clerk-openapi - sourceRevisionDigest: sha256:6119b87229a597625b72db9000ea183ae53c14abf71976f5198f9f384cebc415 - sourceBlobDigest: sha256:18aae668583e7fea915d4b01912c8f93532ed71703e5d485052a39dffc0e7e1c + sourceRevisionDigest: sha256:80e76fbeeada366104bd0054f5f99a6e046202f93a5c3b5331e468afc3dd4b4d + sourceBlobDigest: sha256:5973f4930511cc94f06052b98484a93dc07822f035843d1e5ea2a8f40188e68d tags: - latest - main @@ -11,8 +11,8 @@ targets: clerk-sdk-python: source: clerk-openapi sourceNamespace: clerk-openapi - sourceRevisionDigest: sha256:6119b87229a597625b72db9000ea183ae53c14abf71976f5198f9f384cebc415 - sourceBlobDigest: sha256:18aae668583e7fea915d4b01912c8f93532ed71703e5d485052a39dffc0e7e1c + sourceRevisionDigest: sha256:80e76fbeeada366104bd0054f5f99a6e046202f93a5c3b5331e468afc3dd4b4d + sourceBlobDigest: sha256:5973f4930511cc94f06052b98484a93dc07822f035843d1e5ea2a8f40188e68d outLocation: . workflow: workflowVersion: 1.0.0 @@ -20,10 +20,11 @@ workflow: sources: clerk-openapi: inputs: - - location: openapi.yaml + - location: https://raw.githubusercontent.com/clerk/openapi-specs/refs/heads/main/bapi/2021-02-05.yml overlays: - location: ./fixes.yaml - location: ./examples.yaml + - location: .speakeasy/speakeasy-suggestions.yaml registry: location: registry.speakeasyapi.dev/clerk/clerk/clerk-openapi targets: diff --git a/README.md b/README.md index afbc8c3..e8a053c 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,6 @@ More information about the API can be found at https://clerk.com/docs * [IDE Support](#ide-support) * [SDK Example Usage](#sdk-example-usage) * [Available Resources and Operations](#available-resources-and-operations) -* [Pagination](#pagination) * [File uploads](#file-uploads) * [Retries](#retries) * [Error Handling](#error-handling) @@ -125,9 +124,9 @@ asyncio.run(main()) ## Available Resources and Operations -### [misc](docs/sdks/misc/README.md) +### [miscellaneous](docs/sdks/miscellaneous/README.md) -* [get_public_interstitial](docs/sdks/misc/README.md#get_public_interstitial) - Returns the markup for the interstitial page +* [get_interstitial](docs/sdks/miscellaneous/README.md#get_interstitial) - Returns the markup for the interstitial page ### [jwks](docs/sdks/jwks/README.md) @@ -161,14 +160,18 @@ asyncio.run(main()) * [~~verify~~](docs/sdks/sessions/README.md#verify) - Verify a session :warning: **Deprecated** * [create_token_from_template](docs/sdks/sessions/README.md#create_token_from_template) - Create a session token from a jwt template +### [email_sms_templates](docs/sdks/emailsmstemplates/README.md) + +* [~~get~~](docs/sdks/emailsmstemplates/README.md#get) - Retrieve a template :warning: **Deprecated** +* [~~toggle_template_delivery~~](docs/sdks/emailsmstemplates/README.md#toggle_template_delivery) - Toggle the delivery by Clerk for a template of a given type and slug :warning: **Deprecated** + +### [email_and_sms_templates](docs/sdks/emailandsmstemplates/README.md) + +* [~~upsert~~](docs/sdks/emailandsmstemplates/README.md#upsert) - Update a template for a given type and slug :warning: **Deprecated** + ### [templates](docs/sdks/templates/README.md) -* [list](docs/sdks/templates/README.md#list) - List all templates -* [get](docs/sdks/templates/README.md#get) - Retrieve a template -* [upsert](docs/sdks/templates/README.md#upsert) - Update a template for a given type and slug -* [revert](docs/sdks/templates/README.md#revert) - Revert a template -* [preview](docs/sdks/templates/README.md#preview) - Preview changes to a template -* [toggle_delivery](docs/sdks/templates/README.md#toggle_delivery) - Toggle the delivery by Clerk for a template of a given type and slug +* [~~preview~~](docs/sdks/templates/README.md#preview) - Preview changes to a template :warning: **Deprecated** ### [users](docs/sdks/users/README.md) @@ -187,9 +190,16 @@ asyncio.run(main()) * [update_metadata](docs/sdks/users/README.md#update_metadata) - Merge and update a user's metadata * [get_o_auth_access_token](docs/sdks/users/README.md#get_o_auth_access_token) - Retrieve the OAuth access token of a user * [get_organization_memberships](docs/sdks/users/README.md#get_organization_memberships) - Retrieve all memberships for a user +* [get_organization_invitations](docs/sdks/users/README.md#get_organization_invitations) - Retrieve all invitations for a user * [verify_password](docs/sdks/users/README.md#verify_password) - Verify the password of a user * [verify_totp](docs/sdks/users/README.md#verify_totp) - Verify a TOTP or backup code for a user * [disable_mfa](docs/sdks/users/README.md#disable_mfa) - Disable a user's MFA methods +* [delete_backup_codes](docs/sdks/users/README.md#delete_backup_codes) - Disable all user's Backup codes +* [delete_passkey](docs/sdks/users/README.md#delete_passkey) - Delete a user passkey +* [delete_web3_wallet](docs/sdks/users/README.md#delete_web3_wallet) - Delete a user web3 wallet +* [create_totp](docs/sdks/users/README.md#create_totp) - Create a TOTP for a user +* [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 ### [invitations](docs/sdks/invitations/README.md) @@ -197,22 +207,35 @@ asyncio.run(main()) * [list](docs/sdks/invitations/README.md#list) - List all invitations * [revoke](docs/sdks/invitations/README.md#revoke) - Revokes an invitation +### [organization_invitations](docs/sdks/organizationinvitationssdk/README.md) + +* [get_all](docs/sdks/organizationinvitationssdk/README.md#get_all) - Get a list of organization invitations for the current instance +* [create](docs/sdks/organizationinvitationssdk/README.md#create) - Create and send an organization invitation +* [list](docs/sdks/organizationinvitationssdk/README.md#list) - Get a list of organization invitations +* [bulk_create](docs/sdks/organizationinvitationssdk/README.md#bulk_create) - Bulk create and send organization invitations +* [~~list_pending~~](docs/sdks/organizationinvitationssdk/README.md#list_pending) - Get a list of pending organization invitations :warning: **Deprecated** +* [get](docs/sdks/organizationinvitationssdk/README.md#get) - Retrieve an organization invitation by ID +* [revoke](docs/sdks/organizationinvitationssdk/README.md#revoke) - Revoke a pending organization invitation + +### [allowlist_blocklist](docs/sdks/allowlistblocklist/README.md) + +* [list_allowlist_identifiers](docs/sdks/allowlistblocklist/README.md#list_allowlist_identifiers) - List all identifiers on the allow-list +* [create_allowlist_identifier](docs/sdks/allowlistblocklist/README.md#create_allowlist_identifier) - Add identifier to the allow-list +* [create_blocklist_identifier](docs/sdks/allowlistblocklist/README.md#create_blocklist_identifier) - Add identifier to the block-list +* [delete_blocklist_identifier](docs/sdks/allowlistblocklist/README.md#delete_blocklist_identifier) - Delete identifier from block-list + ### [allowlist_identifiers](docs/sdks/allowlistidentifiers/README.md) -* [list](docs/sdks/allowlistidentifiers/README.md#list) - List all identifiers on the allow-list -* [create](docs/sdks/allowlistidentifiers/README.md#create) - Add identifier to the allow-list * [delete](docs/sdks/allowlistidentifiers/README.md#delete) - Delete identifier from allow-list ### [blocklist_identifiers](docs/sdks/blocklistidentifierssdk/README.md) * [list](docs/sdks/blocklistidentifierssdk/README.md#list) - List all identifiers on the block-list -* [create](docs/sdks/blocklistidentifierssdk/README.md#create) - Add identifier to the block-list -* [delete](docs/sdks/blocklistidentifierssdk/README.md#delete) - Delete identifier from block-list ### [beta_features](docs/sdks/betafeatures/README.md) -* [update_instance_auth_config](docs/sdks/betafeatures/README.md#update_instance_auth_config) - Update instance settings -* [~~update_production_instance_domain~~](docs/sdks/betafeatures/README.md#update_production_instance_domain) - Update production instance domain :warning: **Deprecated** +* [update_instance_settings](docs/sdks/betafeatures/README.md#update_instance_settings) - Update instance settings +* [~~update_domain~~](docs/sdks/betafeatures/README.md#update_domain) - Update production instance domain :warning: **Deprecated** * [change_production_instance_domain](docs/sdks/betafeatures/README.md#change_production_instance_domain) - Update production instance domain ### [actor_tokens](docs/sdks/actortokens/README.md) @@ -258,15 +281,6 @@ asyncio.run(main()) * [upload_logo](docs/sdks/organizationssdk/README.md#upload_logo) - Upload a logo for the organization * [delete_logo](docs/sdks/organizationssdk/README.md#delete_logo) - Delete the organization's logo. -### [organization_invitations](docs/sdks/organizationinvitationssdk/README.md) - -* [create](docs/sdks/organizationinvitationssdk/README.md#create) - Create and send an organization invitation -* [list](docs/sdks/organizationinvitationssdk/README.md#list) - Get a list of organization invitations -* [create_bulk](docs/sdks/organizationinvitationssdk/README.md#create_bulk) - Bulk create and send organization invitations -* [~~list_pending~~](docs/sdks/organizationinvitationssdk/README.md#list_pending) - Get a list of pending organization invitations :warning: **Deprecated** -* [get](docs/sdks/organizationinvitationssdk/README.md#get) - Retrieve an organization invitation by ID -* [revoke](docs/sdks/organizationinvitationssdk/README.md#revoke) - Revoke a pending organization invitation - ### [organization_memberships](docs/sdks/organizationmembershipssdk/README.md) * [create](docs/sdks/organizationmembershipssdk/README.md#create) - Create a new organization membership @@ -274,17 +288,31 @@ asyncio.run(main()) * [update](docs/sdks/organizationmembershipssdk/README.md#update) - Update an organization membership * [delete](docs/sdks/organizationmembershipssdk/README.md#delete) - Remove a member from an organization * [update_metadata](docs/sdks/organizationmembershipssdk/README.md#update_metadata) - Merge and update organization membership metadata +* [get_all](docs/sdks/organizationmembershipssdk/README.md#get_all) - Get a list of all organization memberships within an instance. + +### [organization_domains](docs/sdks/organizationdomainssdk/README.md) + +* [create](docs/sdks/organizationdomainssdk/README.md#create) - Create a new organization domain. +* [list](docs/sdks/organizationdomainssdk/README.md#list) - Get a list of all domains of an organization. +* [delete](docs/sdks/organizationdomainssdk/README.md#delete) - Remove a domain from an organization. + +### [organization_domain](docs/sdks/organizationdomainsdk/README.md) + +* [update](docs/sdks/organizationdomainsdk/README.md#update) - Update an organization domain. ### [proxy_checks](docs/sdks/proxychecks/README.md) * [verify](docs/sdks/proxychecks/README.md#verify) - Verify the proxy configuration for your domain -### [redirect_urls](docs/sdks/redirecturls/README.md) +### [redirect_ur_ls](docs/sdks/redirecturls/README.md) * [list](docs/sdks/redirecturls/README.md#list) - List all redirect URLs -* [create](docs/sdks/redirecturls/README.md#create) - Create a redirect URL -* [get](docs/sdks/redirecturls/README.md#get) - Retrieve a redirect URL -* [delete](docs/sdks/redirecturls/README.md#delete) - Delete a redirect URL + +### [redirect_urls](docs/sdks/clerkredirecturls/README.md) + +* [create](docs/sdks/clerkredirecturls/README.md#create) - Create a redirect URL +* [get](docs/sdks/clerkredirecturls/README.md#get) - Retrieve a redirect URL +* [delete](docs/sdks/clerkredirecturls/README.md#delete) - Delete a redirect URL ### [sign_in_tokens](docs/sdks/signintokens/README.md) @@ -295,7 +323,7 @@ asyncio.run(main()) * [update](docs/sdks/signups/README.md#update) - Update a sign-up -### [o_auth_applications](docs/sdks/oauthapplicationssdk/README.md) +### [oauth_applications](docs/sdks/oauthapplicationssdk/README.md) * [list](docs/sdks/oauthapplicationssdk/README.md#list) - Get a list of OAuth applications for an instance * [create](docs/sdks/oauthapplicationssdk/README.md#create) - Create an OAuth application @@ -317,36 +345,6 @@ asyncio.run(main()) * [create](docs/sdks/testingtokens/README.md#create) - Retrieve a new testing token - -## Pagination - -Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the -returned response object will have a `Next` method that can be called to pull down the next group of results. If the -return value of `Next` is `None`, then there are no more pages to be fetched. - -Here's an example of one such pagination call: -```python -from clerk_backend_api import Clerk - -s = Clerk( - bearer_auth="", -) - - -res = s.clients.list(limit=20, offset=10) - -if res is not None: - while True: - # handle items - - res = res.Next() - if res is None: - break - - -``` - - ## File uploads @@ -391,7 +389,7 @@ from clerk_backend_api import Clerk s = Clerk() -s.misc.get_public_interstitial(frontend_api="frontend-api_1a2b3c4d", publishable_key="pub_1a2b3c4d", +s.miscellaneous.get_interstitial(frontend_api="frontend-api_1a2b3c4d", publishable_key="pub_1a2b3c4d", RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False)) # Use the SDK ... @@ -408,7 +406,7 @@ s = Clerk( ) -s.misc.get_public_interstitial(frontend_api="frontend-api_1a2b3c4d", publishable_key="pub_1a2b3c4d") +s.miscellaneous.get_interstitial(frontend_api="frontend-api_1a2b3c4d", publishable_key="pub_1a2b3c4d") # Use the SDK ... @@ -446,13 +444,8 @@ except models.SDKError as e: raise(e) if res is not None: - while True: - # handle items - - res = res.Next() - if res is None: - break - + # handle response + pass ``` @@ -478,7 +471,7 @@ s = Clerk( ) -s.misc.get_public_interstitial(frontend_api="frontend-api_1a2b3c4d", publishable_key="pub_1a2b3c4d") +s.miscellaneous.get_interstitial(frontend_api="frontend-api_1a2b3c4d", publishable_key="pub_1a2b3c4d") # Use the SDK ... @@ -496,7 +489,7 @@ s = Clerk( ) -s.misc.get_public_interstitial(frontend_api="frontend-api_1a2b3c4d", publishable_key="pub_1a2b3c4d") +s.miscellaneous.get_interstitial(frontend_api="frontend-api_1a2b3c4d", publishable_key="pub_1a2b3c4d") # Use the SDK ... @@ -604,7 +597,7 @@ s = Clerk( ) -s.misc.get_public_interstitial(frontend_api="frontend-api_1a2b3c4d", publishable_key="pub_1a2b3c4d") +s.miscellaneous.get_interstitial(frontend_api="frontend-api_1a2b3c4d", publishable_key="pub_1a2b3c4d") # Use the SDK ... diff --git a/RELEASES.md b/RELEASES.md index fcb7681..fca122b 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -88,4 +88,14 @@ Based on: ### Generated - [python v0.5.0] . ### Releases -- [PyPI v0.5.0] https://pypi.org/project/clerk-backend-api/0.5.0 - . \ No newline at end of file +- [PyPI v0.5.0] https://pypi.org/project/clerk-backend-api/0.5.0 - . + +## 2024-10-18 14:54:20 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.385.0 (2.407.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.0.0] . +### Releases +- [PyPI v1.0.0] https://pypi.org/project/clerk-backend-api/1.0.0 - . \ No newline at end of file diff --git a/docs/models/adminverificationstrategy.md b/docs/models/adminverificationstrategy.md index a4c1800..e517d40 100644 --- a/docs/models/adminverificationstrategy.md +++ b/docs/models/adminverificationstrategy.md @@ -3,7 +3,6 @@ ## Values -| Name | Value | -| -------------------- | -------------------- | -| `ADMIN` | admin | -| `FROM_OAUTH_DISCORD` | from_oauth_discord | \ No newline at end of file +| Name | Value | +| ------- | ------- | +| `ADMIN` | admin | \ No newline at end of file diff --git a/docs/models/adminverificationweb3walletstrategy.md b/docs/models/adminverificationweb3walletstrategy.md index 5d5f9f6..9dfa905 100644 --- a/docs/models/adminverificationweb3walletstrategy.md +++ b/docs/models/adminverificationweb3walletstrategy.md @@ -3,7 +3,6 @@ ## Values -| Name | Value | -| -------------------- | -------------------- | -| `ADMIN` | admin | -| `FROM_OAUTH_DISCORD` | from_oauth_discord | \ No newline at end of file +| Name | Value | +| ------- | ------- | +| `ADMIN` | admin | \ No newline at end of file diff --git a/docs/models/attributemapping.md b/docs/models/attributemapping.md index 672999f..872fa6d 100644 --- a/docs/models/attributemapping.md +++ b/docs/models/attributemapping.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `user_id` | *Optional[str]* | :heavy_minus_sign: | N/A | nameid | -| `email_address` | *Optional[str]* | :heavy_minus_sign: | N/A | email | -| `first_name` | *Optional[str]* | :heavy_minus_sign: | N/A | firstName | -| `last_name` | *Optional[str]* | :heavy_minus_sign: | N/A | lastName | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `user_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `email_address` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `first_name` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `last_name` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/changeproductioninstancedomainrequestbody.md b/docs/models/changeproductioninstancedomainrequestbody.md index 386b122..07d39c2 100644 --- a/docs/models/changeproductioninstancedomainrequestbody.md +++ b/docs/models/changeproductioninstancedomainrequestbody.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | -| `home_url` | *Optional[str]* | :heavy_minus_sign: | The new home URL of the production instance e.g. https://www.example.com | https://www.newdomain.com | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `home_url` | *Optional[str]* | :heavy_minus_sign: | The new home URL of the production instance e.g. https://www.example.com | https://www.newdomain.com | +| `is_secondary` | *Optional[bool]* | :heavy_minus_sign: | Whether this is a domain for a secondary app, meaning that any subdomain provided is significant and
will be stored as part of the domain. This is useful for supporting multiple apps (one primary and
multiple secondaries) on the same root domain (eTLD+1). | | \ No newline at end of file diff --git a/docs/models/createactortokenactor.md b/docs/models/createactortokenactor.md new file mode 100644 index 0000000..27cb022 --- /dev/null +++ b/docs/models/createactortokenactor.md @@ -0,0 +1,10 @@ +# CreateActorTokenActor + +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. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/createactortokenrequestbody.md b/docs/models/createactortokenrequestbody.md index 02055db..b55034f 100644 --- a/docs/models/createactortokenrequestbody.md +++ b/docs/models/createactortokenrequestbody.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `user_id` | *str* | :heavy_check_mark: | The ID of the user that can use the newly created sign in token. | user_1a2b3c | -| `actor` | Dict[str, *Any*] | :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"
} | +| `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 | \ No newline at end of file diff --git a/docs/models/createinvitationrequestbody.md b/docs/models/createinvitationrequestbody.md index ff46f37..574ab15 100644 --- a/docs/models/createinvitationrequestbody.md +++ b/docs/models/createinvitationrequestbody.md @@ -11,4 +11,5 @@ Required parameters | `public_metadata` | [Optional[models.CreateInvitationPublicMetadata]](../models/createinvitationpublicmetadata.md) | :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 | \ No newline at end of file +| `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 diff --git a/docs/models/reverttemplaterequest.md b/docs/models/createorganizationdomainrequest.md similarity index 52% rename from docs/models/reverttemplaterequest.md rename to docs/models/createorganizationdomainrequest.md index 84ae08a..56b7fd1 100644 --- a/docs/models/reverttemplaterequest.md +++ b/docs/models/createorganizationdomainrequest.md @@ -1,9 +1,9 @@ -# RevertTemplateRequest +# CreateOrganizationDomainRequest ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `template_type` | [models.RevertTemplatePathParamTemplateType](../models/reverttemplatepathparamtemplatetype.md) | :heavy_check_mark: | The type of template to revert | email | -| `slug` | *str* | :heavy_check_mark: | The slug of the template to revert | welcome-email | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization where the new domain will be created. | +| `request_body` | [models.CreateOrganizationDomainRequestBody](../models/createorganizationdomainrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/createorganizationdomainrequestbody.md b/docs/models/createorganizationdomainrequestbody.md new file mode 100644 index 0000000..66443af --- /dev/null +++ b/docs/models/createorganizationdomainrequestbody.md @@ -0,0 +1,10 @@ +# CreateOrganizationDomainRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `name` | *Optional[str]* | :heavy_minus_sign: | The name of the new domain | +| `enrollment_mode` | *Optional[str]* | :heavy_minus_sign: | The enrollment_mode for the new domain. This can be `automatic_invitation`, `automatic_suggestion` or `manual_invitation` | +| `verified` | *OptionalNullable[bool]* | :heavy_minus_sign: | The status of domain's verification. Defaults to true | \ No newline at end of file diff --git a/docs/models/createorganizationinvitationrequestbody.md b/docs/models/createorganizationinvitationrequestbody.md index 6497982..b3c1130 100644 --- a/docs/models/createorganizationinvitationrequestbody.md +++ b/docs/models/createorganizationinvitationrequestbody.md @@ -6,8 +6,8 @@ | 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 | -| `inviter_user_id` | *str* | :heavy_check_mark: | The ID of the user that invites the new member to the organization.
Must be an administrator in the organization. | user_67890 | | `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` | [Optional[models.CreateOrganizationInvitationPublicMetadata]](../models/createorganizationinvitationpublicmetadata.md) | :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` | [Optional[models.CreateOrganizationInvitationPrivateMetadata]](../models/createorganizationinvitationprivatemetadata.md) | :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 diff --git a/docs/models/createorganizationrequestbody.md b/docs/models/createorganizationrequestbody.md index aabe9f6..7ea1b18 100644 --- a/docs/models/createorganizationrequestbody.md +++ b/docs/models/createorganizationrequestbody.md @@ -5,9 +5,10 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -| `name` | *str* | :heavy_check_mark: | The name of the new organization | NewOrg | +| `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` | [Optional[models.CreateOrganizationPrivateMetadata]](../models/createorganizationprivatemetadata.md) | :heavy_minus_sign: | Metadata saved on the organization, accessible only from the Backend API | {
"internal_code": "ABC123"
} | | `public_metadata` | [Optional[models.CreateOrganizationPublicMetadata]](../models/createorganizationpublicmetadata.md) | :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 | \ No newline at end of file +| `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`). | | \ No newline at end of file diff --git a/docs/models/createuserrequestbody.md b/docs/models/createuserrequestbody.md index c63bdc1..7eb26ce 100644 --- a/docs/models/createuserrequestbody.md +++ b/docs/models/createuserrequestbody.md @@ -3,23 +3,28 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `external_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the user as used in your external systems or your previous authentication solution.
Must be unique across your instance. | ext-id-001 | -| `first_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The first name to assign to the user | John | -| `last_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The last name to assign to the user | Doe | -| `email_address` | List[*str*] | :heavy_minus_sign: | Email addresses to add to the user.
Must be unique across your instance.
The first email address will be set as the user's primary email address. | | -| `phone_number` | List[*str*] | :heavy_minus_sign: | Phone numbers to add to the user.
Must be unique across your instance.
The first phone number will be set as the user's primary phone number. | | -| `web3_wallet` | List[*str*] | :heavy_minus_sign: | Web3 wallets to add to the user.
Must be unique across your instance.
The first wallet will be set as the user's primary wallet. | | -| `username` | *OptionalNullable[str]* | :heavy_minus_sign: | The username to give to the user.
It must be unique across your instance. | johndoe123 | -| `password` | *OptionalNullable[str]* | :heavy_minus_sign: | The plaintext password to give the user.
Must be at least 8 characters long, and can not be in any list of hacked passwords. | Secure*Pass4 | -| `password_digest` | *Optional[str]* | :heavy_minus_sign: | In case you already have the password digests and not the passwords, you can use them for the newly created user via this property.
The digests should be generated with one of the supported algorithms.
The hashing algorithm can be specified using the `password_hasher` property. | $argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc | -| `password_hasher` | [Optional[models.PasswordHasher]](../models/passwordhasher.md) | :heavy_minus_sign: | The hashing algorithm that was used to generate the password digest.
The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/),
[md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/),
[phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/),
[scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [sha256](https://en.wikipedia.org/wiki/SHA-2)
and the [argon2](https://argon2.online/) variants argon2i and argon2id.

If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support).

Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in.
Insecure schemes are marked with `(insecure)` in the list below.

Each of the supported hashers expects the incoming digest to be in a particular format. Specifically:

**bcrypt:** The digest should be of the following form:

`$$$`

**bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django):

`bcrypt_sha256$$$$`

**md5** (insecure): The digest should follow the regular form e.g.:

`5f4dcc3b5aa765d61d8327deb882cf99`

**pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows:

`pbkdf2_sha256$$$`

Note: Both the salt and the hash are expected to be base64-encoded.

**pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows:

`pbkdf2_sha512$$$`

_iterations:_ The number of iterations used. Must be an integer less than 420000.
_salt:_ The salt used when generating the hash. Must be less than 1024 bytes.
_hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes.

**pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django):

`pbkdf2_sha256$$$`

Note: The salt is expected to be un-encoded, the hash is expected base64-encoded.

**pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences:
1. uses sha1 instead of sha256
2. accepts the hash as a hex-encoded string

The format is the following:

`pbkdf2_sha1$$$`

**phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections:

The format is the following:

`$P$`

- $P$ is the prefix used to identify phpass hashes.
- rounds is a single character encoding a 6-bit integer representing the number of rounds used.
- salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt.
- checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5.

**scrypt_firebase:** The Firebase-specific variant of scrypt.
The value is expected to have 6 segments separated by the $ character and include the following information:

_hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase.
_salt:_ The salt used to generate the above hash. Again, this is given when exporting the user.
_signer key:_ The base64 encoded signer key.
_salt separator:_ The base64 encoded salt separator.
_rounds:_ The number of rounds the algorithm needs to run.
_memory cost:_ The cost of the algorithm run

The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase.
The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters.

Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it:

`$$$$$`

**scrypt_werkzeug:** The Werkzeug-specific variant of scrypt.

The value is expected to have 3 segments separated by the $ character and include the following information:

_algorithm args:_ The algorithm used to generate the hash.
_salt:_ The salt used to generate the above hash.
_hash:_ The actual Base64 hash.

The algorithm args are the parameters used to generate the hash and are included in the digest.

**argon2i:** Algorithms in the argon2 family generate digests that encode the following information:

_version (v):_ The argon version, version 19 is assumed
_memory (m):_ The memory used by the algorithm (in kibibytes)
_iterations (t):_ The number of iterations to perform
_parallelism (p):_ The number of threads to use

Parts are demarcated by the `$` character, with the first part identifying the algorithm variant.
The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism).
The final part is the actual digest.

`$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc`

**argon2id:** See the previous algorithm for an explanation of the formatting.

For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`:

`$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU`

**sha256** (insecure): The digest should be a 64-length hex string, e.g.:

`9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08`

**sha256_salted** (insecure): The digest should be a 64-length hex string with a salt.

The format is the following:
`$`

The value is expected to have 2 segments separated by the $ character and include the following information:
_hash:_ The sha256 hash, a 64-length hex string.
_salt:_ The salt used to generate the above hash. Must be between 1 and 1024 bits. | argon2i | -| `skip_password_checks` | *Optional[bool]* | :heavy_minus_sign: | When set to `true` all password checks are skipped.
It is recommended to use this method only when migrating plaintext passwords to Clerk.
Upon migration the user base should be prompted to pick stronger password. | false | -| `skip_password_requirement` | *Optional[bool]* | :heavy_minus_sign: | When set to `true`, `password` is not required anymore when creating the user and can be omitted.
This is useful when you are trying to create a user that doesn't have a password, in an instance that is using passwords.
Please note that you cannot use this flag if password is the only way for a user to sign into your instance. | false | -| `totp_secret` | *Optional[str]* | :heavy_minus_sign: | In case TOTP is configured on the instance, you can provide the secret to enable it on the newly created user without the need to reset it.
Please note that currently the supported options are:
* Period: 30 seconds
* Code length: 6 digits
* Algorithm: SHA1 | base32totpsecretkey | -| `backup_codes` | List[*str*] | :heavy_minus_sign: | If Backup Codes are configured on the instance, you can provide them to enable it on the newly created user without the need to reset them.
You must provide the backup codes in plain format or the corresponding bcrypt digest. | [
"123456",
"654321"
] | -| `public_metadata` | [Optional[models.CreateUserPublicMetadata]](../models/createuserpublicmetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that is visible to both your Frontend and Backend APIs | {
"role": "user"
} | -| `private_metadata` | [Optional[models.CreateUserPrivateMetadata]](../models/createuserprivatemetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that is only visible to your Backend API | {
"internal_id": "789"
} | -| `unsafe_metadata` | [Optional[models.CreateUserUnsafeMetadata]](../models/createuserunsafemetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that can be updated from both the Frontend and Backend APIs.
Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. | {
"preferences": {
"theme": "dark"
}
} | -| `created_at` | *Optional[str]* | :heavy_minus_sign: | A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). | 2023-03-15T07:15:20.902Z | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `external_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the user as used in your external systems or your previous authentication solution.
Must be unique across your instance. | ext-id-001 | +| `first_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The first name to assign to the user | John | +| `last_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The last name to assign to the user | Doe | +| `email_address` | List[*str*] | :heavy_minus_sign: | Email addresses to add to the user.
Must be unique across your instance.
The first email address will be set as the user's primary email address. | | +| `phone_number` | List[*str*] | :heavy_minus_sign: | Phone numbers to add to the user.
Must be unique across your instance.
The first phone number will be set as the user's primary phone number. | | +| `web3_wallet` | List[*str*] | :heavy_minus_sign: | Web3 wallets to add to the user.
Must be unique across your instance.
The first wallet will be set as the user's primary wallet. | | +| `username` | *OptionalNullable[str]* | :heavy_minus_sign: | The username to give to the user.
It must be unique across your instance. | johndoe123 | +| `password` | *OptionalNullable[str]* | :heavy_minus_sign: | The plaintext password to give the user.
Must be at least 8 characters long, and can not be in any list of hacked passwords. | Secure*Pass4 | +| `password_digest` | *Optional[str]* | :heavy_minus_sign: | In case you already have the password digests and not the passwords, you can use them for the newly created user via this property.
The digests should be generated with one of the supported algorithms.
The hashing algorithm can be specified using the `password_hasher` property. | $argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc | +| `password_hasher` | *Optional[str]* | :heavy_minus_sign: | The hashing algorithm that was used to generate the password digest.

The algorithms we support at the moment are [`bcrypt`](https://en.wikipedia.org/wiki/Bcrypt), [`bcrypt_sha256_django`](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [`md5`](https://en.wikipedia.org/wiki/MD5), `pbkdf2_sha1`, `pbkdf2_sha256`, [`pbkdf2_sha256_django`](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/),
[`phpass`](https://www.openwall.com/phpass/), [`scrypt_firebase`](https://firebaseopensource.com/projects/firebase/scrypt/),
[`scrypt_werkzeug`](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [`sha256`](https://en.wikipedia.org/wiki/SHA-2),
and the [`argon2`](https://argon2.online/) variants: `argon2i` and `argon2id`.

Each of the supported hashers expects the incoming digest to be in a particular format. See the [Clerk docs](https://clerk.com/docs/references/backend/user/create-user) for more information. | | +| `skip_password_checks` | *Optional[bool]* | :heavy_minus_sign: | When set to `true` all password checks are skipped.
It is recommended to use this method only when migrating plaintext passwords to Clerk.
Upon migration the user base should be prompted to pick stronger password. | false | +| `skip_password_requirement` | *Optional[bool]* | :heavy_minus_sign: | When set to `true`, `password` is not required anymore when creating the user and can be omitted.
This is useful when you are trying to create a user that doesn't have a password, in an instance that is using passwords.
Please note that you cannot use this flag if password is the only way for a user to sign into your instance. | false | +| `totp_secret` | *Optional[str]* | :heavy_minus_sign: | In case TOTP is configured on the instance, you can provide the secret to enable it on the newly created user without the need to reset it.
Please note that currently the supported options are:
* Period: 30 seconds
* Code length: 6 digits
* Algorithm: SHA1 | base32totpsecretkey | +| `backup_codes` | List[*str*] | :heavy_minus_sign: | If Backup Codes are configured on the instance, you can provide them to enable it on the newly created user without the need to reset them.
You must provide the backup codes in plain format or the corresponding bcrypt digest. | [
"123456",
"654321"
] | +| `public_metadata` | [Optional[models.CreateUserPublicMetadata]](../models/createuserpublicmetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that is visible to both your Frontend and Backend APIs | {
"role": "user"
} | +| `private_metadata` | [Optional[models.CreateUserPrivateMetadata]](../models/createuserprivatemetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that is only visible to your Backend API | {
"internal_id": "789"
} | +| `unsafe_metadata` | [Optional[models.CreateUserUnsafeMetadata]](../models/createuserunsafemetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that can be updated from both the Frontend and Backend APIs.
Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. | {
"preferences": {
"theme": "dark"
}
} | +| `delete_self_enabled` | *OptionalNullable[bool]* | :heavy_minus_sign: | If enabled, user can delete themselves via FAPI.
| | +| `legal_accepted_at` | *OptionalNullable[str]* | :heavy_minus_sign: | A custom timestamp denoting _when_ the user accepted legal requirements, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). | | +| `skip_legal_checks` | *OptionalNullable[bool]* | :heavy_minus_sign: | When set to `true` all legal checks are skipped.
It is not recommended to skip legal checks unless you are migrating a user to Clerk. | | +| `create_organization_enabled` | *OptionalNullable[bool]* | :heavy_minus_sign: | If enabled, user can create organizations via FAPI.
| | +| `create_organizations_limit` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of organizations the user can create. 0 means unlimited.
| | +| `created_at` | *Optional[str]* | :heavy_minus_sign: | A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). | 2023-03-15T07:15:20.902Z | \ No newline at end of file diff --git a/docs/models/listsamlconnectionsresponse.md b/docs/models/createusertotprequest.md similarity index 64% rename from docs/models/listsamlconnectionsresponse.md rename to docs/models/createusertotprequest.md index 94843b6..6c0c1c4 100644 --- a/docs/models/listsamlconnectionsresponse.md +++ b/docs/models/createusertotprequest.md @@ -1,8 +1,8 @@ -# ListSAMLConnectionsResponse +# CreateUserTOTPRequest ## Fields | Field | Type | Required | Description | | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `result` | [models.SAMLConnections](../models/samlconnections.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| `user_id` | *str* | :heavy_check_mark: | The ID of the user for whom the TOTP is being created. | \ No newline at end of file diff --git a/docs/models/deletebackupcoderequest.md b/docs/models/deletebackupcoderequest.md new file mode 100644 index 0000000..f9b7849 --- /dev/null +++ b/docs/models/deletebackupcoderequest.md @@ -0,0 +1,8 @@ +# DeleteBackupCodeRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `user_id` | *str* | :heavy_check_mark: | The ID of the user whose backup codes are to be deleted. | \ No newline at end of file diff --git a/docs/models/deletebackupcoderesponsebody.md b/docs/models/deletebackupcoderesponsebody.md new file mode 100644 index 0000000..6cc708a --- /dev/null +++ b/docs/models/deletebackupcoderesponsebody.md @@ -0,0 +1,10 @@ +# DeleteBackupCodeResponseBody + +Successful operation. + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `user_id` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/deleteexternalaccountrequest.md b/docs/models/deleteexternalaccountrequest.md new file mode 100644 index 0000000..ce365cb --- /dev/null +++ b/docs/models/deleteexternalaccountrequest.md @@ -0,0 +1,9 @@ +# DeleteExternalAccountRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `user_id` | *str* | :heavy_check_mark: | The ID of the user's external account | +| `external_account_id` | *str* | :heavy_check_mark: | The ID of the external account to delete | \ No newline at end of file diff --git a/docs/models/deleteorganizationdomainrequest.md b/docs/models/deleteorganizationdomainrequest.md new file mode 100644 index 0000000..1106ebd --- /dev/null +++ b/docs/models/deleteorganizationdomainrequest.md @@ -0,0 +1,9 @@ +# DeleteOrganizationDomainRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization the domain belongs to | +| `domain_id` | *str* | :heavy_check_mark: | The ID of the domain | \ No newline at end of file diff --git a/docs/models/deletetotprequest.md b/docs/models/deletetotprequest.md new file mode 100644 index 0000000..21e5f3c --- /dev/null +++ b/docs/models/deletetotprequest.md @@ -0,0 +1,8 @@ +# DeleteTOTPRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `user_id` | *str* | :heavy_check_mark: | The ID of the user whose TOTPs are to be deleted | \ No newline at end of file diff --git a/docs/models/deletetotpresponsebody.md b/docs/models/deletetotpresponsebody.md new file mode 100644 index 0000000..4f5c181 --- /dev/null +++ b/docs/models/deletetotpresponsebody.md @@ -0,0 +1,10 @@ +# DeleteTOTPResponseBody + +Successful operation. + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `user_id` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/enrollmentmode.md b/docs/models/enrollmentmode.md new file mode 100644 index 0000000..6888eb2 --- /dev/null +++ b/docs/models/enrollmentmode.md @@ -0,0 +1,12 @@ +# EnrollmentMode + +Mode of enrollment for the domain + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `MANUAL_INVITATION` | manual_invitation | +| `AUTOMATIC_INVITATION` | automatic_invitation | +| `AUTOMATIC_SUGGESTION` | automatic_suggestion | \ No newline at end of file diff --git a/docs/models/getclientlistresponse.md b/docs/models/getclientlistresponse.md deleted file mode 100644 index 835d685..0000000 --- a/docs/models/getclientlistresponse.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetClientListResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| `result` | List[[models.Client](../models/client.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getorganizationrequest.md b/docs/models/getorganizationrequest.md index 7972fd3..7161cf0 100644 --- a/docs/models/getorganizationrequest.md +++ b/docs/models/getorganizationrequest.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | -| `organization_id` | *str* | :heavy_check_mark: | The ID or slug of the organization | org_123 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `organization_id` | *str* | :heavy_check_mark: | The ID or slug of the organization | org_123 | +| `include_members_count` | *Optional[bool]* | :heavy_minus_sign: | Flag to denote whether or not the organization's members count should be included in the response. | | \ No newline at end of file diff --git a/docs/models/gettemplatelistrequest.md b/docs/models/gettemplatelistrequest.md deleted file mode 100644 index 9c82aea..0000000 --- a/docs/models/gettemplatelistrequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetTemplateListRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | -| `template_type` | [models.TemplateType](../models/templatetype.md) | :heavy_check_mark: | The type of templates to list (email or SMS) | email | \ No newline at end of file diff --git a/docs/models/instancegetorganizationmembershipsrequest.md b/docs/models/instancegetorganizationmembershipsrequest.md new file mode 100644 index 0000000..48cc0ff --- /dev/null +++ b/docs/models/instancegetorganizationmembershipsrequest.md @@ -0,0 +1,10 @@ +# InstanceGetOrganizationMembershipsRequest + + +## 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 | +| `order_by` | *Optional[str]* | :heavy_minus_sign: | Sorts organizations memberships by phone_number, email_address, created_at, first_name, last_name or username.
By prepending one of those values with + or -,
we can choose to sort in ascending (ASC) or descending (DESC) order. | | \ No newline at end of file diff --git a/docs/models/invitation.md b/docs/models/invitation.md index 6cd6d18..26908da 100644 --- a/docs/models/invitation.md +++ b/docs/models/invitation.md @@ -13,4 +13,5 @@ | `updated_at` | *int* | :heavy_check_mark: | Unix timestamp of last update.
| 1622553200 | | `public_metadata` | [Optional[models.InvitationPublicMetadata]](../models/invitationpublicmetadata.md) | :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 | \ No newline at end of file +| `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/invitationrevoked.md b/docs/models/invitationrevoked.md index dc09d26..a5f17aa 100644 --- a/docs/models/invitationrevoked.md +++ b/docs/models/invitationrevoked.md @@ -13,4 +13,5 @@ | `updated_at` | *int* | :heavy_check_mark: | Unix timestamp of last update.
| 1622553200 | | `public_metadata` | [Optional[models.InvitationRevokedPublicMetadata]](../models/invitationrevokedpublicmetadata.md) | :heavy_minus_sign: | N/A | {} | | `revoked` | *Optional[bool]* | :heavy_minus_sign: | N/A | true | -| `url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | https://example.com/invitations/accept?code=abcd1234 | \ No newline at end of file +| `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/invitationstatus.md b/docs/models/invitationstatus.md index fa867b7..9d487c0 100644 --- a/docs/models/invitationstatus.md +++ b/docs/models/invitationstatus.md @@ -7,4 +7,5 @@ | ---------- | ---------- | | `PENDING` | pending | | `ACCEPTED` | accepted | -| `REVOKED` | revoked | \ No newline at end of file +| `REVOKED` | revoked | +| `EXPIRED` | expired | \ No newline at end of file diff --git a/docs/models/keys.md b/docs/models/keys.md new file mode 100644 index 0000000..1137917 --- /dev/null +++ b/docs/models/keys.md @@ -0,0 +1,13 @@ +# Keys + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `use` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `kty` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `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 diff --git a/docs/models/latestactivity.md b/docs/models/latestactivity.md new file mode 100644 index 0000000..b52b813 --- /dev/null +++ b/docs/models/latestactivity.md @@ -0,0 +1,16 @@ +# LatestActivity + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `object` | *str* | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `device_type` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `is_mobile` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `browser_name` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `browser_version` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `ip_address` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `city` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `country` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/listinstanceorganizationinvitationsqueryparamstatus.md b/docs/models/listinstanceorganizationinvitationsqueryparamstatus.md new file mode 100644 index 0000000..8c478eb --- /dev/null +++ b/docs/models/listinstanceorganizationinvitationsqueryparamstatus.md @@ -0,0 +1,12 @@ +# ListInstanceOrganizationInvitationsQueryParamStatus + +Filter organization invitations based on their status + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `PENDING` | pending | +| `ACCEPTED` | accepted | +| `REVOKED` | revoked | \ No newline at end of file diff --git a/docs/models/listinstanceorganizationinvitationsrequest.md b/docs/models/listinstanceorganizationinvitationsrequest.md new file mode 100644 index 0000000..770e3fc --- /dev/null +++ b/docs/models/listinstanceorganizationinvitationsrequest.md @@ -0,0 +1,12 @@ +# ListInstanceOrganizationInvitationsRequest + + +## 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 | +| `order_by` | *Optional[str]* | :heavy_minus_sign: | Allows to return organization invitations in a particular order.
At the moment, you can order the returned organization invitations either by their `created_at` or `email_address`.
In order to specify the direction, you can use the `+/-` symbols prepended in the property to order by.
For example, if you want organization invitations 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.
Defaults to `-created_at`. | | +| `status` | [Optional[models.ListInstanceOrganizationInvitationsQueryParamStatus]](../models/listinstanceorganizationinvitationsqueryparamstatus.md) | :heavy_minus_sign: | Filter organization invitations based on their status | | +| `query` | *Optional[str]* | :heavy_minus_sign: | Filter organization invitations based on their `email_address` | | \ No newline at end of file diff --git a/docs/models/listinvitationsqueryparamstatus.md b/docs/models/listinvitationsqueryparamstatus.md index a251218..610b2d6 100644 --- a/docs/models/listinvitationsqueryparamstatus.md +++ b/docs/models/listinvitationsqueryparamstatus.md @@ -9,4 +9,5 @@ Filter invitations based on their status | ---------- | ---------- | | `PENDING` | pending | | `ACCEPTED` | accepted | -| `REVOKED` | revoked | \ No newline at end of file +| `REVOKED` | revoked | +| `EXPIRED` | expired | \ No newline at end of file diff --git a/docs/models/listinvitationsresponse.md b/docs/models/listinvitationsresponse.md deleted file mode 100644 index 67064ed..0000000 --- a/docs/models/listinvitationsresponse.md +++ /dev/null @@ -1,8 +0,0 @@ -# ListInvitationsResponse - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -| `result` | List[[models.Invitation](../models/invitation.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listoauthapplicationsresponse.md b/docs/models/listoauthapplicationsresponse.md deleted file mode 100644 index c86847a..0000000 --- a/docs/models/listoauthapplicationsresponse.md +++ /dev/null @@ -1,8 +0,0 @@ -# ListOAuthApplicationsResponse - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `result` | [models.OAuthApplications](../models/oauthapplications.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listorganizationdomainsrequest.md b/docs/models/listorganizationdomainsrequest.md new file mode 100644 index 0000000..b04e37c --- /dev/null +++ b/docs/models/listorganizationdomainsrequest.md @@ -0,0 +1,12 @@ +# ListOrganizationDomainsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | *str* | :heavy_check_mark: | The organization ID. | | +| `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 | +| `verified` | *Optional[str]* | :heavy_minus_sign: | Filter domains by their verification status. `true` or `false` | | +| `enrollment_mode` | *Optional[str]* | :heavy_minus_sign: | Filter domains by their enrollment mode | | \ No newline at end of file diff --git a/docs/models/listorganizationinvitationsresponse.md b/docs/models/listorganizationinvitationsresponse.md deleted file mode 100644 index 7f3f773..0000000 --- a/docs/models/listorganizationinvitationsresponse.md +++ /dev/null @@ -1,8 +0,0 @@ -# ListOrganizationInvitationsResponse - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `result` | [models.OrganizationInvitations](../models/organizationinvitations.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listorganizationmembershipsresponse.md b/docs/models/listorganizationmembershipsresponse.md deleted file mode 100644 index cab9c22..0000000 --- a/docs/models/listorganizationmembershipsresponse.md +++ /dev/null @@ -1,8 +0,0 @@ -# ListOrganizationMembershipsResponse - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `result` | [models.OrganizationMemberships](../models/organizationmemberships.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listpendingorganizationinvitationsresponse.md b/docs/models/listpendingorganizationinvitationsresponse.md deleted file mode 100644 index 666b08a..0000000 --- a/docs/models/listpendingorganizationinvitationsresponse.md +++ /dev/null @@ -1,8 +0,0 @@ -# ListPendingOrganizationInvitationsResponse - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `result` | [models.OrganizationInvitations](../models/organizationinvitations.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/oauth.md b/docs/models/oauth.md index 2325365..404fbae 100644 --- a/docs/models/oauth.md +++ b/docs/models/oauth.md @@ -7,7 +7,7 @@ | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | | `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` | *Nullable[int]* | :heavy_check_mark: | N/A | 1615462399 | +| `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/organizationdomain.md b/docs/models/organizationdomain.md new file mode 100644 index 0000000..f14aaf5 --- /dev/null +++ b/docs/models/organizationdomain.md @@ -0,0 +1,20 @@ +# OrganizationDomain + +An organization domain + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the organization domain | +| `object` | [Optional[models.OrganizationDomainObject]](../models/organizationdomainobject.md) | :heavy_minus_sign: | String representing the object's type. Objects of the same type share the same value. Always `organization_domain`
| +| `organization_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the organization | +| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the organization domain | +| `enrollment_mode` | [Optional[models.EnrollmentMode]](../models/enrollmentmode.md) | :heavy_minus_sign: | Mode of enrollment for the domain | +| `affiliation_email_address` | *OptionalNullable[str]* | :heavy_minus_sign: | Affiliation email address for the domain, if available. | +| `verification` | [OptionalNullable[models.OrganizationDomainVerification]](../models/organizationdomainverification.md) | :heavy_minus_sign: | Verification details for the domain | +| `total_pending_invitations` | *Optional[int]* | :heavy_minus_sign: | Total number of pending invitations associated with this domain | +| `total_pending_suggestions` | *Optional[int]* | :heavy_minus_sign: | Total number of pending suggestions associated with this domain | +| `created_at` | *Optional[int]* | :heavy_minus_sign: | Unix timestamp when the domain was created | +| `updated_at` | *Optional[int]* | :heavy_minus_sign: | Unix timestamp of the last update to the domain | \ No newline at end of file diff --git a/docs/models/organizationdomainobject.md b/docs/models/organizationdomainobject.md new file mode 100644 index 0000000..60cf426 --- /dev/null +++ b/docs/models/organizationdomainobject.md @@ -0,0 +1,11 @@ +# OrganizationDomainObject + +String representing the object's type. Objects of the same type share the same value. Always `organization_domain` + + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `ORGANIZATION_DOMAIN` | organization_domain | \ No newline at end of file diff --git a/docs/models/organizationdomains.md b/docs/models/organizationdomains.md new file mode 100644 index 0000000..4d911fd --- /dev/null +++ b/docs/models/organizationdomains.md @@ -0,0 +1,9 @@ +# OrganizationDomains + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `data` | List[[models.OrganizationDomain](../models/organizationdomain.md)] | :heavy_check_mark: | N/A | +| `total_count` | *int* | :heavy_check_mark: | Total number of organization domains
| \ No newline at end of file diff --git a/docs/models/organizationdomainstatus.md b/docs/models/organizationdomainstatus.md new file mode 100644 index 0000000..1b2a5f0 --- /dev/null +++ b/docs/models/organizationdomainstatus.md @@ -0,0 +1,11 @@ +# OrganizationDomainStatus + +Status of the verification. It can be `unverified` or `verified` + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `UNVERIFIED` | unverified | +| `VERIFIED` | verified | \ No newline at end of file diff --git a/docs/models/organizationdomainverification.md b/docs/models/organizationdomainverification.md new file mode 100644 index 0000000..7339ef9 --- /dev/null +++ b/docs/models/organizationdomainverification.md @@ -0,0 +1,13 @@ +# OrganizationDomainVerification + +Verification details for the domain + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `status` | [Optional[models.OrganizationDomainStatus]](../models/organizationdomainstatus.md) | :heavy_minus_sign: | Status of the verification. It can be `unverified` or `verified` | +| `strategy` | *Optional[str]* | :heavy_minus_sign: | Name of the strategy used to verify the domain | +| `attempts` | *Optional[int]* | :heavy_minus_sign: | How many attempts have been made to verify the domain | +| `expire_at` | *OptionalNullable[int]* | :heavy_minus_sign: | Unix timestamp of when the verification will expire | \ No newline at end of file diff --git a/docs/models/organizationinvitation.md b/docs/models/organizationinvitation.md index 0a76125..471b737 100644 --- a/docs/models/organizationinvitation.md +++ b/docs/models/organizationinvitation.md @@ -11,6 +11,7 @@ An organization invitation | `object` | [Optional[models.OrganizationInvitationObject]](../models/organizationinvitationobject.md) | :heavy_minus_sign: | String representing the object's type. Objects of the same type share the same value.
| organization_invitation | | `email_address` | *Optional[str]* | :heavy_minus_sign: | N/A | user@example.com | | `role` | *Optional[str]* | :heavy_minus_sign: | N/A | admin | +| `role_name` | *Optional[str]* | :heavy_minus_sign: | N/A | | | `organization_id` | *Optional[str]* | :heavy_minus_sign: | N/A | org_12345 | | `status` | *Optional[str]* | :heavy_minus_sign: | N/A | pending | | `public_metadata` | [Optional[models.OrganizationInvitationPublicMetadata]](../models/organizationinvitationpublicmetadata.md) | :heavy_minus_sign: | N/A | {
"key": "value"
} | diff --git a/docs/models/organizationinvitationswithpublicorganizationdata.md b/docs/models/organizationinvitationswithpublicorganizationdata.md new file mode 100644 index 0000000..e407a00 --- /dev/null +++ b/docs/models/organizationinvitationswithpublicorganizationdata.md @@ -0,0 +1,9 @@ +# OrganizationInvitationsWithPublicOrganizationData + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `data` | List[[models.OrganizationInvitationWithPublicOrganizationData](../models/organizationinvitationwithpublicorganizationdata.md)] | :heavy_check_mark: | N/A | +| `total_count` | *int* | :heavy_check_mark: | Total number of organization invitations
| \ No newline at end of file diff --git a/docs/models/organizationinvitationwithpublicorganizationdata.md b/docs/models/organizationinvitationwithpublicorganizationdata.md new file mode 100644 index 0000000..1c65b54 --- /dev/null +++ b/docs/models/organizationinvitationwithpublicorganizationdata.md @@ -0,0 +1,21 @@ +# OrganizationInvitationWithPublicOrganizationData + +An organization invitation with public organization data populated + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `object` | [Optional[models.OrganizationInvitationWithPublicOrganizationDataObject]](../models/organizationinvitationwithpublicorganizationdataobject.md) | :heavy_minus_sign: | String representing the object's type. Objects of the same type share the same value.
| +| `email_address` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `role` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `role_name` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `organization_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `status` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `public_metadata` | [Optional[models.OrganizationInvitationWithPublicOrganizationDataPublicMetadata]](../models/organizationinvitationwithpublicorganizationdatapublicmetadata.md) | :heavy_minus_sign: | N/A | +| `private_metadata` | [Optional[models.OrganizationInvitationWithPublicOrganizationDataPrivateMetadata]](../models/organizationinvitationwithpublicorganizationdataprivatemetadata.md) | :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/organizationinvitationwithpublicorganizationdataobject.md b/docs/models/organizationinvitationwithpublicorganizationdataobject.md new file mode 100644 index 0000000..f801fbd --- /dev/null +++ b/docs/models/organizationinvitationwithpublicorganizationdataobject.md @@ -0,0 +1,11 @@ +# OrganizationInvitationWithPublicOrganizationDataObject + +String representing the object's type. Objects of the same type share the same value. + + + +## Values + +| Name | Value | +| ------------------------- | ------------------------- | +| `ORGANIZATION_INVITATION` | organization_invitation | \ No newline at end of file diff --git a/docs/models/organizationinvitationwithpublicorganizationdataprivatemetadata.md b/docs/models/organizationinvitationwithpublicorganizationdataprivatemetadata.md new file mode 100644 index 0000000..3b53742 --- /dev/null +++ b/docs/models/organizationinvitationwithpublicorganizationdataprivatemetadata.md @@ -0,0 +1,7 @@ +# OrganizationInvitationWithPublicOrganizationDataPrivateMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/organizationinvitationwithpublicorganizationdatapublicmetadata.md b/docs/models/organizationinvitationwithpublicorganizationdatapublicmetadata.md new file mode 100644 index 0000000..f2ca2b2 --- /dev/null +++ b/docs/models/organizationinvitationwithpublicorganizationdatapublicmetadata.md @@ -0,0 +1,7 @@ +# OrganizationInvitationWithPublicOrganizationDataPublicMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/organizationmembership.md b/docs/models/organizationmembership.md index 9c6befd..0d0fddc 100644 --- a/docs/models/organizationmembership.md +++ b/docs/models/organizationmembership.md @@ -10,6 +10,7 @@ Hello world | `id` | *Optional[str]* | :heavy_minus_sign: | N/A | org_mem_123 | | `object` | [Optional[models.OrganizationMembershipObject]](../models/organizationmembershipobject.md) | :heavy_minus_sign: | String representing the object's type. Objects of the same type share the same value.
| organization_membership | | `role` | *Optional[str]* | :heavy_minus_sign: | N/A | member | +| `role_name` | *Optional[str]* | :heavy_minus_sign: | N/A | | | `permissions` | List[*str*] | :heavy_minus_sign: | N/A | [
"read",
"write"
] | | `public_metadata` | [Optional[models.OrganizationMembershipPublicMetadata]](../models/organizationmembershippublicmetadata.md) | :heavy_minus_sign: | Metadata saved on the organization membership, accessible from both Frontend and Backend APIs | {} | | `private_metadata` | [Optional[models.OrganizationMembershipPrivateMetadata]](../models/organizationmembershipprivatemetadata.md) | :heavy_minus_sign: | Metadata saved on the organization membership, accessible only from the Backend API | {} | diff --git a/docs/models/otp.md b/docs/models/otp.md index af11182..0069b59 100644 --- a/docs/models/otp.md +++ b/docs/models/otp.md @@ -7,5 +7,5 @@ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | `status` | [models.VerificationStatus](../models/verificationstatus.md) | :heavy_check_mark: | N/A | verified | | `strategy` | [models.Strategy](../models/strategy.md) | :heavy_check_mark: | N/A | email_code | -| `attempts` | *Nullable[int]* | :heavy_check_mark: | N/A | 1 | -| `expire_at` | *Nullable[int]* | :heavy_check_mark: | N/A | 1615462399 | \ No newline at end of file +| `attempts` | *int* | :heavy_check_mark: | N/A | 1 | +| `expire_at` | *int* | :heavy_check_mark: | N/A | 1615462399 | \ No newline at end of file diff --git a/docs/models/passkey.md b/docs/models/passkey.md index 79fbafa..f04d2e4 100644 --- a/docs/models/passkey.md +++ b/docs/models/passkey.md @@ -7,6 +7,6 @@ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | | `status` | [models.PasskeyVerificationStatus](../models/passkeyverificationstatus.md) | :heavy_check_mark: | N/A | verified | | `strategy` | [models.PasskeyVerificationStrategy](../models/passkeyverificationstrategy.md) | :heavy_check_mark: | N/A | passkey | -| `nonce` | [Optional[models.VerificationNonce]](../models/verificationnonce.md) | :heavy_minus_sign: | N/A | nonce_value | +| `nonce` | [Optional[models.Nonce]](../models/nonce.md) | :heavy_minus_sign: | N/A | nonce_value | | `attempts` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | | `expire_at` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/passwordhasher.md b/docs/models/passwordhasher.md deleted file mode 100644 index 6eb3113..0000000 --- a/docs/models/passwordhasher.md +++ /dev/null @@ -1,145 +0,0 @@ -# PasswordHasher - -The hashing algorithm that was used to generate the password digest. -The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), -[md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), -[phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), -[scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [sha256](https://en.wikipedia.org/wiki/SHA-2) -and the [argon2](https://argon2.online/) variants argon2i and argon2id. - -If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). - -Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. -Insecure schemes are marked with `(insecure)` in the list below. - -Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: - -**bcrypt:** The digest should be of the following form: - -`$$$` - -**bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): - -`bcrypt_sha256$$$$` - -**md5** (insecure): The digest should follow the regular form e.g.: - -`5f4dcc3b5aa765d61d8327deb882cf99` - -**pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: - -`pbkdf2_sha256$$$` - -Note: Both the salt and the hash are expected to be base64-encoded. - -**pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: - -`pbkdf2_sha512$$$` - - _iterations:_ The number of iterations used. Must be an integer less than 420000. - _salt:_ The salt used when generating the hash. Must be less than 1024 bytes. - _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. - -**pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): - -`pbkdf2_sha256$$$` - -Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. - -**pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: -1. uses sha1 instead of sha256 -2. accepts the hash as a hex-encoded string - -The format is the following: - -`pbkdf2_sha1$$$` - -**phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: - -The format is the following: - -`$P$` - -- $P$ is the prefix used to identify phpass hashes. -- rounds is a single character encoding a 6-bit integer representing the number of rounds used. -- salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. -- checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. - -**scrypt_firebase:** The Firebase-specific variant of scrypt. -The value is expected to have 6 segments separated by the $ character and include the following information: - -_hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. -_salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. -_signer key:_ The base64 encoded signer key. -_salt separator:_ The base64 encoded salt separator. -_rounds:_ The number of rounds the algorithm needs to run. -_memory cost:_ The cost of the algorithm run - -The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. -The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. - -Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: - -`$$$$$` - -**scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. - - The value is expected to have 3 segments separated by the $ character and include the following information: - - _algorithm args:_ The algorithm used to generate the hash. - _salt:_ The salt used to generate the above hash. - _hash:_ The actual Base64 hash. - - The algorithm args are the parameters used to generate the hash and are included in the digest. - -**argon2i:** Algorithms in the argon2 family generate digests that encode the following information: - -_version (v):_ The argon version, version 19 is assumed -_memory (m):_ The memory used by the algorithm (in kibibytes) -_iterations (t):_ The number of iterations to perform -_parallelism (p):_ The number of threads to use - -Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. -The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). -The final part is the actual digest. - -`$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` - -**argon2id:** See the previous algorithm for an explanation of the formatting. - -For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: - -`$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` - -**sha256** (insecure): The digest should be a 64-length hex string, e.g.: - -`9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` - -**sha256_salted** (insecure): The digest should be a 64-length hex string with a salt. - -The format is the following: - `$` - -The value is expected to have 2 segments separated by the $ character and include the following information: - _hash:_ The sha256 hash, a 64-length hex string. - _salt:_ The salt used to generate the above hash. Must be between 1 and 1024 bits. - - -## Values - -| Name | Value | -| ---------------------- | ---------------------- | -| `ARGON2I` | argon2i | -| `ARGON2ID` | argon2id | -| `BCRYPT` | bcrypt | -| `BCRYPT_SHA256_DJANGO` | bcrypt_sha256_django | -| `MD5` | md5 | -| `PBKDF2_SHA256` | pbkdf2_sha256 | -| `PBKDF2_SHA512` | pbkdf2_sha512 | -| `PBKDF2_SHA256_DJANGO` | pbkdf2_sha256_django | -| `PBKDF2_SHA1` | pbkdf2_sha1 | -| `PHPASS` | phpass | -| `SCRYPT_FIREBASE` | scrypt_firebase | -| `SCRYPT_WERKZEUG` | scrypt_werkzeug | -| `SHA256` | sha256 | -| `SHA256_SALTED` | sha256_salted | \ No newline at end of file diff --git a/docs/models/publicorganizationdata.md b/docs/models/publicorganizationdata.md new file mode 100644 index 0000000..6a00082 --- /dev/null +++ b/docs/models/publicorganizationdata.md @@ -0,0 +1,12 @@ +# PublicOrganizationData + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `name` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `slug` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `image_url` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `has_image` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/requestbody.md b/docs/models/requestbody.md index be635a1..e9d3914 100644 --- a/docs/models/requestbody.md +++ b/docs/models/requestbody.md @@ -6,8 +6,8 @@ | 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 | -| `inviter_user_id` | *str* | :heavy_check_mark: | The ID of the user that invites the new member to the organization.
Must be an administrator in the organization. | user_67890 | | `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` | [Optional[models.CreateOrganizationInvitationBulkPublicMetadata]](../models/createorganizationinvitationbulkpublicmetadata.md) | :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` | [Optional[models.CreateOrganizationInvitationBulkPrivateMetadata]](../models/createorganizationinvitationbulkprivatemetadata.md) | :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 diff --git a/docs/models/reverttemplatepathparamtemplatetype.md b/docs/models/reverttemplatepathparamtemplatetype.md deleted file mode 100644 index f93ca38..0000000 --- a/docs/models/reverttemplatepathparamtemplatetype.md +++ /dev/null @@ -1,11 +0,0 @@ -# RevertTemplatePathParamTemplateType - -The type of template to revert - - -## Values - -| Name | Value | -| ------- | ------- | -| `EMAIL` | email | -| `SMS` | sms | \ No newline at end of file diff --git a/docs/models/revokeorganizationinvitationrequest.md b/docs/models/revokeorganizationinvitationrequest.md index f1dece0..98d658f 100644 --- a/docs/models/revokeorganizationinvitationrequest.md +++ b/docs/models/revokeorganizationinvitationrequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `organization_id` | *str* | :heavy_check_mark: | The organization ID. | org_123456 | -| `invitation_id` | *str* | :heavy_check_mark: | The organization invitation ID. | inv_123456 | -| `request_body` | [models.RevokeOrganizationInvitationRequestBody](../models/revokeorganizationinvitationrequestbody.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_123456 | +| `invitation_id` | *str* | :heavy_check_mark: | The organization invitation ID. | inv_123456 | +| `request_body` | [Optional[models.RevokeOrganizationInvitationRequestBody]](../models/revokeorganizationinvitationrequestbody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/revokeorganizationinvitationrequestbody.md b/docs/models/revokeorganizationinvitationrequestbody.md index f4c67c7..e214f10 100644 --- a/docs/models/revokeorganizationinvitationrequestbody.md +++ b/docs/models/revokeorganizationinvitationrequestbody.md @@ -5,4 +5,4 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `requesting_user_id` | *str* | :heavy_check_mark: | The ID of the user that revokes the invitation.
Must be an administrator in the organization. | usr_12345 | \ No newline at end of file +| `requesting_user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the user that revokes the invitation.
Must be an administrator in the organization. | usr_12345 | \ No newline at end of file diff --git a/docs/models/samlaccount.md b/docs/models/samlaccount.md index 0ee7f2a..55b3e4d 100644 --- a/docs/models/samlaccount.md +++ b/docs/models/samlaccount.md @@ -14,4 +14,5 @@ | `first_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | John | | `last_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | Doe | | `provider_user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | prov_user_id_123 | -| `public_metadata` | [Optional[models.SAMLAccountPublicMetadata]](../models/samlaccountpublicmetadata.md) | :heavy_minus_sign: | N/A | {
"department": "IT"
} | \ No newline at end of file +| `public_metadata` | [Optional[models.SAMLAccountPublicMetadata]](../models/samlaccountpublicmetadata.md) | :heavy_minus_sign: | N/A | {
"department": "IT"
} | +| `saml_connection` | [OptionalNullable[models.SamlConnection]](../models/samlconnection.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/samlconnection.md b/docs/models/samlconnection.md index 95d467d..d8f507b 100644 --- a/docs/models/samlconnection.md +++ b/docs/models/samlconnection.md @@ -1,28 +1,11 @@ -# SAMLConnection +# SamlConnection -## Fields +## Supported Types + +### `models.SAMLConnectionSAMLConnection` + +```python +value: models.SAMLConnectionSAMLConnection = /* values here */ +``` -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `object` | [models.SAMLConnectionObject](../models/samlconnectionobject.md) | :heavy_check_mark: | N/A | saml_connection | -| `id` | *str* | :heavy_check_mark: | N/A | sc_1234567890 | -| `name` | *str* | :heavy_check_mark: | N/A | My Company SAML Config | -| `domain` | *str* | :heavy_check_mark: | N/A | mycompany.com | -| `idp_entity_id` | *Nullable[str]* | :heavy_check_mark: | N/A | idp-entity-id | -| `idp_sso_url` | *Nullable[str]* | :heavy_check_mark: | N/A | https://sso.mycompany.com | -| `idp_certificate` | *Nullable[str]* | :heavy_check_mark: | N/A | MIIDdzCCAl+gAwIBAgIJAKcyBaiiz+DT... | -| `acs_url` | *str* | :heavy_check_mark: | N/A | https://mycompany.clerk.com/saml/callback | -| `sp_entity_id` | *str* | :heavy_check_mark: | N/A | sp-entity-id | -| `sp_metadata_url` | *str* | :heavy_check_mark: | N/A | https://mycompany.clerk.com/saml/metadata | -| `active` | *bool* | :heavy_check_mark: | N/A | true | -| `provider` | *str* | :heavy_check_mark: | N/A | saml_custom | -| `user_count` | *int* | :heavy_check_mark: | N/A | 150 | -| `sync_user_attributes` | *bool* | :heavy_check_mark: | N/A | true | -| `created_at` | *int* | :heavy_check_mark: | Unix timestamp of creation.
| 1614768000 | -| `updated_at` | *int* | :heavy_check_mark: | Unix timestamp of last update.
| 1622540800 | -| `idp_metadata_url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | https://sso.mycompany.com/metadata | -| `idp_metadata` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | 5 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `data` | List[[models.SchemasSAMLConnection](../models/schemassamlconnection.md)] | :heavy_check_mark: | N/A | | +| `total_count` | *int* | :heavy_check_mark: | Total number of SAML Connections
| 5 | \ No newline at end of file diff --git a/docs/models/samlconnectionsamlconnection.md b/docs/models/samlconnectionsamlconnection.md new file mode 100644 index 0000000..fbddfa0 --- /dev/null +++ b/docs/models/samlconnectionsamlconnection.md @@ -0,0 +1,18 @@ +# SAMLConnectionSAMLConnection + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `id` | *str* | :heavy_check_mark: | N/A | sc_1234567890 | +| `name` | *str* | :heavy_check_mark: | N/A | My Company SAML Config | +| `domain` | *str* | :heavy_check_mark: | N/A | mycompany.com | +| `active` | *bool* | :heavy_check_mark: | N/A | true | +| `provider` | *str* | :heavy_check_mark: | N/A | saml_custom | +| `sync_user_attributes` | *bool* | :heavy_check_mark: | N/A | true | +| `created_at` | *int* | :heavy_check_mark: | Unix timestamp of creation.
| 1614768000 | +| `updated_at` | *int* | :heavy_check_mark: | Unix timestamp of last update.
| 1622540800 | +| `allow_subdomains` | *Optional[bool]* | :heavy_minus_sign: | N/A | false | +| `allow_idp_initiated` | *Optional[bool]* | :heavy_minus_sign: | N/A | true | +| `disable_additional_identifications` | *Optional[bool]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/schemassamlconnection.md b/docs/models/schemassamlconnection.md new file mode 100644 index 0000000..6b45898 --- /dev/null +++ b/docs/models/schemassamlconnection.md @@ -0,0 +1,29 @@ +# SchemasSAMLConnection + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `object` | [models.SchemasSAMLConnectionObject](../models/schemassamlconnectionobject.md) | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `domain` | *str* | :heavy_check_mark: | N/A | +| `idp_entity_id` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `idp_sso_url` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `idp_certificate` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `acs_url` | *str* | :heavy_check_mark: | N/A | +| `sp_entity_id` | *str* | :heavy_check_mark: | N/A | +| `sp_metadata_url` | *str* | :heavy_check_mark: | N/A | +| `active` | *bool* | :heavy_check_mark: | N/A | +| `provider` | *str* | :heavy_check_mark: | N/A | +| `user_count` | *int* | :heavy_check_mark: | N/A | +| `sync_user_attributes` | *bool* | :heavy_check_mark: | N/A | +| `created_at` | *int* | :heavy_check_mark: | Unix timestamp of creation.
| +| `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 | +| `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 | +| `disable_additional_identifications` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/samlconnectionobject.md b/docs/models/schemassamlconnectionobject.md similarity index 82% rename from docs/models/samlconnectionobject.md rename to docs/models/schemassamlconnectionobject.md index 152e30a..2fa22f8 100644 --- a/docs/models/samlconnectionobject.md +++ b/docs/models/schemassamlconnectionobject.md @@ -1,4 +1,4 @@ -# SAMLConnectionObject +# SchemasSAMLConnectionObject ## Values diff --git a/docs/models/session.md b/docs/models/session.md index fe0fc4f..2d0d23b 100644 --- a/docs/models/session.md +++ b/docs/models/session.md @@ -16,4 +16,5 @@ | `updated_at` | *int* | :heavy_check_mark: | Unix timestamp of last update.
| 1622532323 | | `created_at` | *int* | :heavy_check_mark: | Unix timestamp of creation.
| 1622470000 | | `actor` | [OptionalNullable[models.Actor]](../models/actor.md) | :heavy_minus_sign: | N/A | | -| `last_active_organization_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | org_123456789abcd | \ No newline at end of file +| `last_active_organization_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | org_123456789abcd | +| `latest_activity` | [OptionalNullable[models.LatestActivity]](../models/latestactivity.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/template.md b/docs/models/template.md index 49b31fc..ed49d26 100644 --- a/docs/models/template.md +++ b/docs/models/template.md @@ -3,26 +3,27 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | temp_12345 | -| `object` | [Optional[models.TemplateObject]](../models/templateobject.md) | :heavy_minus_sign: | String representing the object's type. Objects of the same type share the same value.
| template | -| `instance_id` | *OptionalNullable[str]* | :heavy_minus_sign: | the id of the instance the template belongs to | inst_67890 | -| `resource_type` | *Optional[str]* | :heavy_minus_sign: | whether this is a system (default) or user overridden) template | system | -| `template_type` | *Optional[str]* | :heavy_minus_sign: | whether this is an email or SMS template | email | -| `name` | *Optional[str]* | :heavy_minus_sign: | user-friendly name of the template | Welcome Email | -| `slug` | *Optional[str]* | :heavy_minus_sign: | machine-friendly name of the template | welcome_email | -| `position` | *Optional[int]* | :heavy_minus_sign: | position with the listing of templates | 1 | -| `can_revert` | *Optional[bool]* | :heavy_minus_sign: | whether this template can be reverted to the corresponding system default | false | -| `can_delete` | *Optional[bool]* | :heavy_minus_sign: | whether this template can be deleted | true | -| `can_disable` | *Optional[bool]* | :heavy_minus_sign: | whether this template can be disabled, true only for notification SMS templates | false | -| `subject` | *OptionalNullable[str]* | :heavy_minus_sign: | email subject | Welcome to our service! | -| `markup` | *Optional[str]* | :heavy_minus_sign: | the editor markup used to generate the body of the template |

Hello, {{ user.name }}

| -| `body` | *Optional[str]* | :heavy_minus_sign: | the template body before variable interpolation | You are now signed up. Welcome! | -| `available_variables` | List[*str*] | :heavy_minus_sign: | list of variables that are available for use in the template body | [
"user.name",
"user.email"
] | -| `required_variables` | List[*str*] | :heavy_minus_sign: | list of variables that must be contained in the template body | [
"user.name"
] | -| `from_email_name` | *Optional[str]* | :heavy_minus_sign: | N/A | Clerk Support | -| `reply_to_email_name` | *Optional[str]* | :heavy_minus_sign: | N/A | support@clerk.com | -| `delivered_by_clerk` | *Optional[bool]* | :heavy_minus_sign: | N/A | true | -| `updated_at` | *Optional[int]* | :heavy_minus_sign: | Unix timestamp of last update.
| 1610000000 | -| `created_at` | *Optional[int]* | :heavy_minus_sign: | Unix timestamp of creation.
| 1600000000 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | temp_12345 | +| `object` | [Optional[models.TemplateObject]](../models/templateobject.md) | :heavy_minus_sign: | String representing the object's type. Objects of the same type share the same value.
| template | +| `instance_id` | *OptionalNullable[str]* | :heavy_minus_sign: | the id of the instance the template belongs to | inst_67890 | +| `resource_type` | *Optional[str]* | :heavy_minus_sign: | whether this is a system (default) or user overridden) template | system | +| `template_type` | *Optional[str]* | :heavy_minus_sign: | whether this is an email or SMS template | email | +| `name` | *Optional[str]* | :heavy_minus_sign: | user-friendly name of the template | Welcome Email | +| `slug` | *Optional[str]* | :heavy_minus_sign: | machine-friendly name of the template | welcome_email | +| `position` | *Optional[int]* | :heavy_minus_sign: | position with the listing of templates | 1 | +| `can_revert` | *Optional[bool]* | :heavy_minus_sign: | whether this template can be reverted to the corresponding system default | false | +| `can_delete` | *Optional[bool]* | :heavy_minus_sign: | whether this template can be deleted | true | +| `can_toggle` | *Optional[bool]* | :heavy_minus_sign: | whether this template can be enabled or disabled, true only for notification SMS templates | | +| `subject` | *OptionalNullable[str]* | :heavy_minus_sign: | email subject | Welcome to our service! | +| `markup` | *Optional[str]* | :heavy_minus_sign: | the editor markup used to generate the body of the template |

Hello, {{ user.name }}

| +| `body` | *Optional[str]* | :heavy_minus_sign: | the template body before variable interpolation | You are now signed up. Welcome! | +| `available_variables` | List[*str*] | :heavy_minus_sign: | list of variables that are available for use in the template body | [
"user.name",
"user.email"
] | +| `required_variables` | List[*str*] | :heavy_minus_sign: | list of variables that must be contained in the template body | [
"user.name"
] | +| `from_email_name` | *Optional[str]* | :heavy_minus_sign: | N/A | Clerk Support | +| `reply_to_email_name` | *Optional[str]* | :heavy_minus_sign: | N/A | support@clerk.com | +| `delivered_by_clerk` | *Optional[bool]* | :heavy_minus_sign: | N/A | true | +| `enabled` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `updated_at` | *Optional[int]* | :heavy_minus_sign: | Unix timestamp of last update.
| 1610000000 | +| `created_at` | *Optional[int]* | :heavy_minus_sign: | Unix timestamp of creation.
| 1600000000 | \ No newline at end of file diff --git a/docs/models/templatetype.md b/docs/models/templatetype.md deleted file mode 100644 index cabd96a..0000000 --- a/docs/models/templatetype.md +++ /dev/null @@ -1,11 +0,0 @@ -# TemplateType - -The type of templates to list (email or SMS) - - -## Values - -| Name | Value | -| ------- | ------- | -| `EMAIL` | email | -| `SMS` | sms | \ No newline at end of file diff --git a/docs/models/totp.md b/docs/models/totp.md new file mode 100644 index 0000000..e604b68 --- /dev/null +++ b/docs/models/totp.md @@ -0,0 +1,14 @@ +# Totp + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `object` | *str* | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `secret` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `uri` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `verified` | *bool* | :heavy_check_mark: | N/A | +| `backup_codes` | List[*str*] | :heavy_minus_sign: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/type.md b/docs/models/type.md index 7435e1e..6831d91 100644 --- a/docs/models/type.md +++ b/docs/models/type.md @@ -8,5 +8,5 @@ | `OAUTH_GOOGLE` | oauth_google | | `OAUTH_MOCK` | oauth_mock | | `SAML` | saml | -| `OAUTH_DISCORD` | oauth_discord | -| `OAUTH_APPLE` | oauth_apple | \ No newline at end of file +| `OAUTH_APPLE` | oauth_apple | +| `OAUTH_DISCORD` | oauth_discord | \ No newline at end of file diff --git a/docs/models/updatedomainrequestbody.md b/docs/models/updatedomainrequestbody.md index df00f0f..9f93da7 100644 --- a/docs/models/updatedomainrequestbody.md +++ b/docs/models/updatedomainrequestbody.md @@ -3,7 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The new domain name. For development instances, can contain the port,
i.e `myhostname:3000`. For production instances, must be a valid FQDN,
i.e `mysite.com`. Cannot contain protocol scheme. | example.com | -| `proxy_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The full URL of the proxy that will forward requests to Clerk's Frontend API.
Can only be updated for production instances. | http://proxy.example.com | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The new domain name. For development instances, can contain the port,
i.e `myhostname:3000`. For production instances, must be a valid FQDN,
i.e `mysite.com`. Cannot contain protocol scheme. | example.com | +| `proxy_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The full URL of the proxy that will forward requests to Clerk's Frontend API.
Can only be updated for production instances. | http://proxy.example.com | +| `is_secondary` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether this is a domain for a secondary app, meaning that any subdomain provided is significant and
will be stored as part of the domain. This is useful for supporting multiple apps (one primary and
multiple secondaries) on the same root domain (eTLD+1). | | \ No newline at end of file diff --git a/docs/models/updateorganizationdomainrequest.md b/docs/models/updateorganizationdomainrequest.md new file mode 100644 index 0000000..b8e529d --- /dev/null +++ b/docs/models/updateorganizationdomainrequest.md @@ -0,0 +1,10 @@ +# UpdateOrganizationDomainRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization the domain belongs to | +| `domain_id` | *str* | :heavy_check_mark: | The ID of the domain | +| `request_body` | [models.UpdateOrganizationDomainRequestBody](../models/updateorganizationdomainrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/updateorganizationdomainrequestbody.md b/docs/models/updateorganizationdomainrequestbody.md new file mode 100644 index 0000000..507bfd3 --- /dev/null +++ b/docs/models/updateorganizationdomainrequestbody.md @@ -0,0 +1,9 @@ +# UpdateOrganizationDomainRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `enrollment_mode` | *OptionalNullable[str]* | :heavy_minus_sign: | The enrollment_mode for the new domain. This can be `automatic_invitation`, `automatic_suggestion` or `manual_invitation` | +| `verified` | *OptionalNullable[bool]* | :heavy_minus_sign: | The status of the domain's verification | \ No newline at end of file diff --git a/docs/models/updateorganizationrequestbody.md b/docs/models/updateorganizationrequestbody.md index 1bcac5d..214df07 100644 --- a/docs/models/updateorganizationrequestbody.md +++ b/docs/models/updateorganizationrequestbody.md @@ -3,11 +3,12 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `public_metadata` | [Optional[models.UpdateOrganizationPublicMetadata]](../models/updateorganizationpublicmetadata.md) | :heavy_minus_sign: | Metadata saved on the organization, that is visible to both your frontend and backend. | {} | -| `private_metadata` | [Optional[models.UpdateOrganizationPrivateMetadata]](../models/updateorganizationprivatemetadata.md) | :heavy_minus_sign: | Metadata saved on the organization that is only visible to your backend. | {} | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The new name of the organization | New Organization Name | -| `slug` | *OptionalNullable[str]* | :heavy_minus_sign: | The new slug of the organization, which needs to be unique in the instance | new-org-slug | -| `max_allowed_memberships` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of memberships allowed for this organization | 100 | -| `admin_delete_enabled` | *OptionalNullable[bool]* | :heavy_minus_sign: | If true, an admin can delete this organization with the Frontend API. | true | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `public_metadata` | [Optional[models.UpdateOrganizationPublicMetadata]](../models/updateorganizationpublicmetadata.md) | :heavy_minus_sign: | Metadata saved on the organization, that is visible to both your frontend and backend. | {} | +| `private_metadata` | [Optional[models.UpdateOrganizationPrivateMetadata]](../models/updateorganizationprivatemetadata.md) | :heavy_minus_sign: | Metadata saved on the organization that is only visible to your backend. | {} | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The new name of the organization.
May not contain URLs or HTML. | New Organization Name | +| `slug` | *OptionalNullable[str]* | :heavy_minus_sign: | The new slug of the organization, which needs to be unique in the instance | new-org-slug | +| `max_allowed_memberships` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of memberships allowed for this organization | 100 | +| `admin_delete_enabled` | *OptionalNullable[bool]* | :heavy_minus_sign: | If true, an admin can delete this organization with the Frontend API. | true | +| `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`). | | \ No newline at end of file diff --git a/docs/models/updatesamlconnectionrequestbody.md b/docs/models/updatesamlconnectionrequestbody.md index 466b671..1d767b3 100644 --- a/docs/models/updatesamlconnectionrequestbody.md +++ b/docs/models/updatesamlconnectionrequestbody.md @@ -16,4 +16,5 @@ | `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 | | `allow_subdomains` | *OptionalNullable[bool]* | :heavy_minus_sign: | Allow users with an email address subdomain to use this connection in order to authenticate | true | -| `allow_idp_initiated` | *OptionalNullable[bool]* | :heavy_minus_sign: | Enable or deactivate IdP-initiated flows | false | \ No newline at end of file +| `allow_idp_initiated` | *OptionalNullable[bool]* | :heavy_minus_sign: | Enable or deactivate IdP-initiated flows | false | +| `disable_additional_identifications` | *OptionalNullable[bool]* | :heavy_minus_sign: | Enable or deactivate additional identifications | | \ No newline at end of file diff --git a/docs/models/updatesignuprequestbody.md b/docs/models/updatesignuprequestbody.md index 77cfe06..babd5aa 100644 --- a/docs/models/updatesignuprequestbody.md +++ b/docs/models/updatesignuprequestbody.md @@ -3,7 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `custom_action` | *Optional[bool]* | :heavy_minus_sign: | Specifies whether a custom action has run for this sign-up attempt.
This is important when your instance has been configured to require a custom action to run before converting a sign-up into a user.
After executing any external business logic you deem necessary, you can mark the sign-up as ready-to-convert by setting `custom_action` to `true`. | false | -| `external_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the guest attempting to sign up as used in your external systems or your previous authentication solution.
This will be copied to the resulting user when the sign-up is completed. | ext_id_7890abcdef123456 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `external_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the guest attempting to sign up as used in your external systems or your previous authentication solution.
This will be copied to the resulting user when the sign-up is completed. | ext_id_7890abcdef123456 | \ No newline at end of file diff --git a/docs/models/updateusermetadataprivatemetadata.md b/docs/models/updateusermetadataprivatemetadata.md deleted file mode 100644 index 628afe0..0000000 --- a/docs/models/updateusermetadataprivatemetadata.md +++ /dev/null @@ -1,10 +0,0 @@ -# UpdateUserMetadataPrivateMetadata - -Metadata saved on the user that is only visible to your backend. -The new object will be merged with the existing value. - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/updateusermetadatarequestbody.md b/docs/models/updateusermetadatarequestbody.md index 95a9208..2cd3f0a 100644 --- a/docs/models/updateusermetadatarequestbody.md +++ b/docs/models/updateusermetadatarequestbody.md @@ -6,5 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `public_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata saved on the user, that is visible to both your frontend and backend.
The new object will be merged with the existing value. | -| `private_metadata` | [Optional[models.UpdateUserMetadataPrivateMetadata]](../models/updateusermetadataprivatemetadata.md) | :heavy_minus_sign: | Metadata saved on the user that is only visible to your backend.
The new object will be merged with the existing value. | -| `unsafe_metadata` | [Optional[models.UpdateUserMetadataUnsafeMetadata]](../models/updateusermetadataunsafemetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that can be updated from both the Frontend and Backend APIs.
The new object will be merged with the existing value.

Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. | \ No newline at end of file +| `private_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata saved on the user that is only visible to your backend.
The new object will be merged with the existing value. | +| `unsafe_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata saved on the user, that can be updated from both the Frontend and Backend APIs.
The new object will be merged with the existing value.

Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. | \ No newline at end of file diff --git a/docs/models/updateusermetadataunsafemetadata.md b/docs/models/updateusermetadataunsafemetadata.md deleted file mode 100644 index 3a59249..0000000 --- a/docs/models/updateusermetadataunsafemetadata.md +++ /dev/null @@ -1,12 +0,0 @@ -# UpdateUserMetadataUnsafeMetadata - -Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. -The new object will be merged with the existing value. - -Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/updateuserpasswordhasher.md b/docs/models/updateuserpasswordhasher.md deleted file mode 100644 index becdfbc..0000000 --- a/docs/models/updateuserpasswordhasher.md +++ /dev/null @@ -1,135 +0,0 @@ -# UpdateUserPasswordHasher - -The hashing algorithm that was used to generate the password digest. -The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), -[md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), -[phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), -[sha256](https://en.wikipedia.org/wiki/SHA-2), [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash) -and the [argon2](https://argon2.online/) variants argon2i and argon2id. - -If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). - -Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. -Insecure schemes are marked with `(insecure)` in the list below. - -Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: - -**bcrypt:** The digest should be of the following form: - -`$$$` - -**bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): - -`bcrypt_sha256$$$$` - -**md5** (insecure): The digest should follow the regular form e.g.: - -`5f4dcc3b5aa765d61d8327deb882cf99` - -**pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: - -`pbkdf2_sha256$$$` - -Note: Both the salt and the hash are expected to be base64-encoded. - -**pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: - -`pbkdf2_sha512$$$` - - _iterations:_ The number of iterations used. Must be an integer less than 420000. - _salt:_ The salt used when generating the hash. Must be less than bytes. - _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. - -**pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): - -`pbkdf2_sha256$$$` - -Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. - -**pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: -1. uses sha1 instead of sha256 -2. accepts the hash as a hex-encoded string - -The format is the following: - -`pbkdf2_sha1$$$` - -**phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: - -The format is the following: - -`$P$` - -- $P$ is the prefix used to identify phpass hashes. -- rounds is a single character encoding a 6-bit integer representing the number of rounds used. -- salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. -- checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. - -**scrypt_firebase:** The Firebase-specific variant of scrypt. -The value is expected to have 6 segments separated by the $ character and include the following information: - -_hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. -_salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. -_signer key:_ The base64 encoded signer key. -_salt separator:_ The base64 encoded salt separator. -_rounds:_ The number of rounds the algorithm needs to run. -_memory cost:_ The cost of the algorithm run - -The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. -The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. - -Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: - -`$$$$$` - -**scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. - -The value is expected to have 3 segments separated by the $ character and include the following information: - -_algorithm args:_ The algorithm used to generate the hash. -_salt:_ The salt used to generate the above hash. -_hash:_ The actual Base64 hash. - -The algorithm args are the parameters used to generate the hash and are included in the digest. - -**argon2i:** Algorithms in the argon2 family generate digests that encode the following information: - -_version (v):_ The argon version, version 19 is assumed -_memory (m):_ The memory used by the algorithm (in kibibytes) -_iterations (t):_ The number of iterations to perform -_parallelism (p):_ The number of threads to use - -Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. -The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). -The final part is the actual digest. - -`$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` - -**argon2id:** See the previous algorithm for an explanation of the formatting. - -For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: - -`$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` - -**sha256** (insecure): The digest should be a 64-length hex string, e.g.: - -`9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` - - -## Values - -| Name | Value | -| ---------------------- | ---------------------- | -| `ARGON2I` | argon2i | -| `ARGON2ID` | argon2id | -| `BCRYPT` | bcrypt | -| `BCRYPT_SHA256_DJANGO` | bcrypt_sha256_django | -| `MD5` | md5 | -| `PBKDF2_SHA256` | pbkdf2_sha256 | -| `PBKDF2_SHA512` | pbkdf2_sha512 | -| `PBKDF2_SHA256_DJANGO` | pbkdf2_sha256_django | -| `PBKDF2_SHA1` | pbkdf2_sha1 | -| `PHPASS` | phpass | -| `SCRYPT_FIREBASE` | scrypt_firebase | -| `SCRYPT_WERKZEUG` | scrypt_werkzeug | -| `SHA256` | sha256 | \ No newline at end of file diff --git a/docs/models/updateuserrequestbody.md b/docs/models/updateuserrequestbody.md index cb5d387..e16e1cd 100644 --- a/docs/models/updateuserrequestbody.md +++ b/docs/models/updateuserrequestbody.md @@ -3,27 +3,30 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `external_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the user as used in your external systems or your previous authentication solution.
Must be unique across your instance. | ext_123 | -| `first_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The first name to assign to the user | Jane | -| `last_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The last name to assign to the user | Doe | -| `primary_email_address_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the email address to set as primary.
It must be verified, and present on the current user. | eml_12345 | -| `notify_primary_email_address_changed` | *Optional[bool]* | :heavy_minus_sign: | If set to `true`, the user will be notified that their primary email address has changed.
By default, no notification is sent. | true | -| `primary_phone_number_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the phone number to set as primary.
It must be verified, and present on the current user. | phn_67890 | -| `primary_web3_wallet_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the web3 wallets to set as primary.
It must be verified, and present on the current user. | wlt_123 | -| `username` | *OptionalNullable[str]* | :heavy_minus_sign: | The username to give to the user.
It must be unique across your instance. | janedoe | -| `profile_image_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the image to set as the user's profile image | img_789 | -| `password` | *OptionalNullable[str]* | :heavy_minus_sign: | The plaintext password to give the user.
Must be at least 8 characters long, and can not be in any list of hacked passwords. | secretPass123! | -| `password_digest` | *Optional[str]* | :heavy_minus_sign: | In case you already have the password digests and not the passwords, you can use them for the newly created user via this property.
The digests should be generated with one of the supported algorithms.
The hashing algorithm can be specified using the `password_hasher` property. | $argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc | -| `password_hasher` | [Optional[models.UpdateUserPasswordHasher]](../models/updateuserpasswordhasher.md) | :heavy_minus_sign: | The hashing algorithm that was used to generate the password digest.
The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/),
[md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/),
[phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/),
[sha256](https://en.wikipedia.org/wiki/SHA-2), [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash)
and the [argon2](https://argon2.online/) variants argon2i and argon2id.

If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support).

Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in.
Insecure schemes are marked with `(insecure)` in the list below.

Each of the supported hashers expects the incoming digest to be in a particular format. Specifically:

**bcrypt:** The digest should be of the following form:

`$$$`

**bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django):

`bcrypt_sha256$$$$`

**md5** (insecure): The digest should follow the regular form e.g.:

`5f4dcc3b5aa765d61d8327deb882cf99`

**pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows:

`pbkdf2_sha256$$$`

Note: Both the salt and the hash are expected to be base64-encoded.

**pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows:

`pbkdf2_sha512$$$`

_iterations:_ The number of iterations used. Must be an integer less than 420000.
_salt:_ The salt used when generating the hash. Must be less than bytes.
_hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes.

**pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django):

`pbkdf2_sha256$$$`

Note: The salt is expected to be un-encoded, the hash is expected base64-encoded.

**pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences:
1. uses sha1 instead of sha256
2. accepts the hash as a hex-encoded string

The format is the following:

`pbkdf2_sha1$$$`

**phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections:

The format is the following:

`$P$`

- $P$ is the prefix used to identify phpass hashes.
- rounds is a single character encoding a 6-bit integer representing the number of rounds used.
- salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt.
- checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5.

**scrypt_firebase:** The Firebase-specific variant of scrypt.
The value is expected to have 6 segments separated by the $ character and include the following information:

_hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase.
_salt:_ The salt used to generate the above hash. Again, this is given when exporting the user.
_signer key:_ The base64 encoded signer key.
_salt separator:_ The base64 encoded salt separator.
_rounds:_ The number of rounds the algorithm needs to run.
_memory cost:_ The cost of the algorithm run

The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase.
The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters.

Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it:

`$$$$$`

**scrypt_werkzeug:** The Werkzeug-specific variant of scrypt.

The value is expected to have 3 segments separated by the $ character and include the following information:

_algorithm args:_ The algorithm used to generate the hash.
_salt:_ The salt used to generate the above hash.
_hash:_ The actual Base64 hash.

The algorithm args are the parameters used to generate the hash and are included in the digest.

**argon2i:** Algorithms in the argon2 family generate digests that encode the following information:

_version (v):_ The argon version, version 19 is assumed
_memory (m):_ The memory used by the algorithm (in kibibytes)
_iterations (t):_ The number of iterations to perform
_parallelism (p):_ The number of threads to use

Parts are demarcated by the `$` character, with the first part identifying the algorithm variant.
The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism).
The final part is the actual digest.

`$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc`

**argon2id:** See the previous algorithm for an explanation of the formatting.

For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`:

`$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU`

**sha256** (insecure): The digest should be a 64-length hex string, e.g.:

`9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` | argon2i | -| `skip_password_checks` | *OptionalNullable[bool]* | :heavy_minus_sign: | Set it to `true` if you're updating the user's password and want to skip any password policy settings check. This parameter can only be used when providing a `password`. | false | -| `sign_out_of_other_sessions` | *OptionalNullable[bool]* | :heavy_minus_sign: | Set to `true` to sign out the user from all their active sessions once their password is updated. This parameter can only be used when providing a `password`. | true | -| `totp_secret` | *Optional[str]* | :heavy_minus_sign: | In case TOTP is configured on the instance, you can provide the secret to enable it on the specific user without the need to reset it.
Please note that currently the supported options are:
* Period: 30 seconds
* Code length: 6 digits
* Algorithm: SHA1 | ABCD1234EFGH5678 | -| `backup_codes` | List[*str*] | :heavy_minus_sign: | If Backup Codes are configured on the instance, you can provide them to enable it on the specific user without the need to reset them.
You must provide the backup codes in plain format or the corresponding bcrypt digest. | [
"123456",
"654321"
] | -| `public_metadata` | [Optional[models.UpdateUserPublicMetadata]](../models/updateuserpublicmetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that is visible to both your Frontend and Backend APIs | {
"theme": "dark"
} | -| `private_metadata` | [Optional[models.UpdateUserPrivateMetadata]](../models/updateuserprivatemetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that is only visible to your Backend API | {
"vip": true
} | -| `unsafe_metadata` | [Optional[models.UpdateUserUnsafeMetadata]](../models/updateuserunsafemetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that can be updated from both the Frontend and Backend APIs.
Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. | {
"age": 30
} | -| `delete_self_enabled` | *OptionalNullable[bool]* | :heavy_minus_sign: | If true, the user can delete themselves with the Frontend API. | true | -| `create_organization_enabled` | *OptionalNullable[bool]* | :heavy_minus_sign: | If true, the user can create organizations with the Frontend API. | false | -| `created_at` | *Optional[str]* | :heavy_minus_sign: | A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). | 2021-04-05T14:30:00.000Z | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `external_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the user as used in your external systems or your previous authentication solution.
Must be unique across your instance. | ext_123 | +| `first_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The first name to assign to the user | Jane | +| `last_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The last name to assign to the user | Doe | +| `primary_email_address_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the email address to set as primary.
It must be verified, and present on the current user. | eml_12345 | +| `notify_primary_email_address_changed` | *Optional[bool]* | :heavy_minus_sign: | If set to `true`, the user will be notified that their primary email address has changed.
By default, no notification is sent. | true | +| `primary_phone_number_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the phone number to set as primary.
It must be verified, and present on the current user. | phn_67890 | +| `primary_web3_wallet_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the web3 wallets to set as primary.
It must be verified, and present on the current user. | wlt_123 | +| `username` | *OptionalNullable[str]* | :heavy_minus_sign: | The username to give to the user.
It must be unique across your instance. | janedoe | +| `profile_image_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the image to set as the user's profile image | img_789 | +| `password` | *OptionalNullable[str]* | :heavy_minus_sign: | The plaintext password to give the user.
Must be at least 8 characters long, and can not be in any list of hacked passwords. | secretPass123! | +| `password_digest` | *Optional[str]* | :heavy_minus_sign: | In case you already have the password digests and not the passwords, you can use them for the newly created user via this property.
The digests should be generated with one of the supported algorithms.
The hashing algorithm can be specified using the `password_hasher` property. | $argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc | +| `password_hasher` | *Optional[str]* | :heavy_minus_sign: | The hashing algorithm that was used to generate the password digest.

The algorithms we support at the moment are [`bcrypt`](https://en.wikipedia.org/wiki/Bcrypt), [`bcrypt_sha256_django`](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [`md5`](https://en.wikipedia.org/wiki/MD5), `pbkdf2_sha1`, `pbkdf2_sha256`, [`pbkdf2_sha256_django`](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/),
[`phpass`](https://www.openwall.com/phpass/), [`scrypt_firebase`](https://firebaseopensource.com/projects/firebase/scrypt/),
[`scrypt_werkzeug`](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [`sha256`](https://en.wikipedia.org/wiki/SHA-2),
and the [`argon2`](https://argon2.online/) variants: `argon2i` and `argon2id`.

Each of the supported hashers expects the incoming digest to be in a particular format. See the [Clerk docs](https://clerk.com/docs/references/backend/user/create-user) for more information. | | +| `skip_password_checks` | *OptionalNullable[bool]* | :heavy_minus_sign: | Set it to `true` if you're updating the user's password and want to skip any password policy settings check. This parameter can only be used when providing a `password`. | false | +| `sign_out_of_other_sessions` | *OptionalNullable[bool]* | :heavy_minus_sign: | Set to `true` to sign out the user from all their active sessions once their password is updated. This parameter can only be used when providing a `password`. | true | +| `totp_secret` | *Optional[str]* | :heavy_minus_sign: | In case TOTP is configured on the instance, you can provide the secret to enable it on the specific user without the need to reset it.
Please note that currently the supported options are:
* Period: 30 seconds
* Code length: 6 digits
* Algorithm: SHA1 | ABCD1234EFGH5678 | +| `backup_codes` | List[*str*] | :heavy_minus_sign: | If Backup Codes are configured on the instance, you can provide them to enable it on the specific user without the need to reset them.
You must provide the backup codes in plain format or the corresponding bcrypt digest. | [
"123456",
"654321"
] | +| `public_metadata` | [Optional[models.UpdateUserPublicMetadata]](../models/updateuserpublicmetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that is visible to both your Frontend and Backend APIs | {
"theme": "dark"
} | +| `private_metadata` | [Optional[models.UpdateUserPrivateMetadata]](../models/updateuserprivatemetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that is only visible to your Backend API | {
"vip": true
} | +| `unsafe_metadata` | [Optional[models.UpdateUserUnsafeMetadata]](../models/updateuserunsafemetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that can be updated from both the Frontend and Backend APIs.
Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. | {
"age": 30
} | +| `delete_self_enabled` | *OptionalNullable[bool]* | :heavy_minus_sign: | If true, the user can delete themselves with the Frontend API. | true | +| `create_organization_enabled` | *OptionalNullable[bool]* | :heavy_minus_sign: | If true, the user can create organizations with the Frontend API. | false | +| `legal_accepted_at` | *OptionalNullable[str]* | :heavy_minus_sign: | A custom timestamps denoting _when_ the user accepted legal requirements, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). | | +| `skip_legal_checks` | *OptionalNullable[bool]* | :heavy_minus_sign: | When set to `true` all legal checks are skipped.
It is not recommended to skip legal checks unless you are migrating a user to Clerk. | | +| `create_organizations_limit` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of organizations the user can create. 0 means unlimited. | | +| `created_at` | *Optional[str]* | :heavy_minus_sign: | A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). | 2021-04-05T14:30:00.000Z | \ No newline at end of file diff --git a/docs/models/uploadorganizationlogorequestbody.md b/docs/models/uploadorganizationlogorequestbody.md index 7c43ad7..bc1a1da 100644 --- a/docs/models/uploadorganizationlogorequestbody.md +++ b/docs/models/uploadorganizationlogorequestbody.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `uploader_user_id` | *str* | :heavy_check_mark: | The ID of the user that will be credited with the image upload. | user_67890 | -| `file` | [models.UploadOrganizationLogoFile](../models/uploadorganizationlogofile.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| `file` | [models.UploadOrganizationLogoFile](../models/uploadorganizationlogofile.md) | :heavy_check_mark: | N/A | | +| `uploader_user_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the user that will be credited with the image upload. | user_67890 | \ No newline at end of file diff --git a/docs/models/user.md b/docs/models/user.md index 653cca0..6fd8af6 100644 --- a/docs/models/user.md +++ b/docs/models/user.md @@ -41,4 +41,6 @@ | `created_at` | *Optional[int]* | :heavy_minus_sign: | Unix timestamp of creation.
| 1609459200 | | `delete_self_enabled` | *Optional[bool]* | :heavy_minus_sign: | If enabled, user can delete themselves via FAPI.
| true | | `create_organization_enabled` | *Optional[bool]* | :heavy_minus_sign: | If enabled, user can create organizations via FAPI.
| true | -| `last_active_at` | *OptionalNullable[int]* | :heavy_minus_sign: | Unix timestamp of the latest session activity, with day precision.
| 1700690400000 | \ No newline at end of file +| `create_organizations_limit` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of organizations the user can create. 0 means unlimited.
| | +| `last_active_at` | *OptionalNullable[int]* | :heavy_minus_sign: | Unix timestamp of the latest session activity, with day precision.
| 1700690400000 | +| `legal_accepted_at` | *OptionalNullable[int]* | :heavy_minus_sign: | Unix timestamp of when the user accepted the legal requirements.
| 1700690400000 | \ No newline at end of file diff --git a/docs/models/userpasskeydeleterequest.md b/docs/models/userpasskeydeleterequest.md new file mode 100644 index 0000000..5598b7f --- /dev/null +++ b/docs/models/userpasskeydeleterequest.md @@ -0,0 +1,9 @@ +# UserPasskeyDeleteRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `user_id` | *str* | :heavy_check_mark: | The ID of the user that owns the passkey identity | +| `passkey_identification_id` | *str* | :heavy_check_mark: | The ID of the passkey identity to be deleted | \ No newline at end of file diff --git a/docs/models/usersgetorganizationinvitationsqueryparamstatus.md b/docs/models/usersgetorganizationinvitationsqueryparamstatus.md new file mode 100644 index 0000000..e59b4c3 --- /dev/null +++ b/docs/models/usersgetorganizationinvitationsqueryparamstatus.md @@ -0,0 +1,12 @@ +# UsersGetOrganizationInvitationsQueryParamStatus + +Filter organization invitations based on their status + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `PENDING` | pending | +| `ACCEPTED` | accepted | +| `REVOKED` | revoked | \ No newline at end of file diff --git a/docs/models/usersgetorganizationinvitationsrequest.md b/docs/models/usersgetorganizationinvitationsrequest.md new file mode 100644 index 0000000..3a40971 --- /dev/null +++ b/docs/models/usersgetorganizationinvitationsrequest.md @@ -0,0 +1,11 @@ +# UsersGetOrganizationInvitationsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `user_id` | *str* | :heavy_check_mark: | The ID of the user whose organization invitations we want to retrieve | | +| `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.UsersGetOrganizationInvitationsQueryParamStatus]](../models/usersgetorganizationinvitationsqueryparamstatus.md) | :heavy_minus_sign: | Filter organization invitations based on their status | | \ No newline at end of file diff --git a/docs/models/usersgetorganizationmembershipsresponse.md b/docs/models/usersgetorganizationmembershipsresponse.md deleted file mode 100644 index 7d98c9f..0000000 --- a/docs/models/usersgetorganizationmembershipsresponse.md +++ /dev/null @@ -1,8 +0,0 @@ -# UsersGetOrganizationMembershipsResponse - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `result` | [models.OrganizationMemberships](../models/organizationmemberships.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/userweb3walletdeleterequest.md b/docs/models/userweb3walletdeleterequest.md new file mode 100644 index 0000000..7212d1e --- /dev/null +++ b/docs/models/userweb3walletdeleterequest.md @@ -0,0 +1,9 @@ +# UserWeb3WalletDeleteRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `user_id` | *str* | :heavy_check_mark: | The ID of the user that owns the web3 wallet | +| `web3_wallet_identification_id` | *str* | :heavy_check_mark: | The ID of the web3 wallet identity to be deleted | \ No newline at end of file diff --git a/docs/models/verificationnonce.md b/docs/models/verificationnonce.md deleted file mode 100644 index 87cd5b9..0000000 --- a/docs/models/verificationnonce.md +++ /dev/null @@ -1,8 +0,0 @@ -# VerificationNonce - - -## Values - -| Name | Value | -| ------- | ------- | -| `NONCE` | nonce | \ No newline at end of file diff --git a/docs/models/verificationotp.md b/docs/models/verificationotp.md index bcb3975..0055117 100644 --- a/docs/models/verificationotp.md +++ b/docs/models/verificationotp.md @@ -7,5 +7,5 @@ | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | | `status` | [models.OTPVerificationStatus](../models/otpverificationstatus.md) | :heavy_check_mark: | N/A | verified | | `strategy` | [models.OTPVerificationStrategy](../models/otpverificationstrategy.md) | :heavy_check_mark: | N/A | email_code | -| `attempts` | *Nullable[int]* | :heavy_check_mark: | N/A | 1 | -| `expire_at` | *Nullable[int]* | :heavy_check_mark: | N/A | 1615462399 | \ No newline at end of file +| `attempts` | *int* | :heavy_check_mark: | N/A | 1 | +| `expire_at` | *int* | :heavy_check_mark: | N/A | 1615462399 | \ No newline at end of file diff --git a/docs/models/verificationstrategy.md b/docs/models/verificationstrategy.md index 5e58032..4cc127f 100644 --- a/docs/models/verificationstrategy.md +++ b/docs/models/verificationstrategy.md @@ -3,7 +3,6 @@ ## Values -| Name | Value | -| -------------------- | -------------------- | -| `ADMIN` | admin | -| `FROM_OAUTH_DISCORD` | from_oauth_discord | \ No newline at end of file +| Name | Value | +| ------- | ------- | +| `ADMIN` | admin | \ No newline at end of file diff --git a/docs/models/verifyclientrequestbody.md b/docs/models/verifyclientrequestbody.md index 5bcdafe..59d6125 100644 --- a/docs/models/verifyclientrequestbody.md +++ b/docs/models/verifyclientrequestbody.md @@ -5,6 +5,6 @@ Parameters. ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| `token` | *Optional[str]* | :heavy_minus_sign: | A JWT Token that represents the active client. | jwt_token_example | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `token` | *Optional[str]* | :heavy_minus_sign: | A JWT that represents the active client. | jwt_token_example | \ No newline at end of file diff --git a/docs/models/web3signature.md b/docs/models/web3signature.md index e8b8738..db108ab 100644 --- a/docs/models/web3signature.md +++ b/docs/models/web3signature.md @@ -7,6 +7,7 @@ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | | `status` | [models.Web3SignatureVerificationStatus](../models/web3signatureverificationstatus.md) | :heavy_check_mark: | N/A | verified | | `strategy` | [models.Web3SignatureVerificationStrategy](../models/web3signatureverificationstrategy.md) | :heavy_check_mark: | N/A | web3_metamask_signature | -| `nonce` | [models.Nonce](../models/nonce.md) | :heavy_check_mark: | N/A | nonce_value | +| `nonce` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | nonce_value | +| `message` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | | `attempts` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | | `expire_at` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/web3signatureverificationstatus.md b/docs/models/web3signatureverificationstatus.md index 357fd05..c7e24d3 100644 --- a/docs/models/web3signatureverificationstatus.md +++ b/docs/models/web3signatureverificationstatus.md @@ -3,6 +3,9 @@ ## Values -| Name | Value | -| ---------- | ---------- | -| `VERIFIED` | verified | \ No newline at end of file +| Name | Value | +| ------------ | ------------ | +| `UNVERIFIED` | unverified | +| `VERIFIED` | verified | +| `FAILED` | failed | +| `EXPIRED` | expired | \ No newline at end of file diff --git a/docs/models/web3signatureverificationstrategy.md b/docs/models/web3signatureverificationstrategy.md index 0a4e6bd..0a96340 100644 --- a/docs/models/web3signatureverificationstrategy.md +++ b/docs/models/web3signatureverificationstrategy.md @@ -3,6 +3,7 @@ ## Values -| Name | Value | -| ------------------------- | ------------------------- | -| `WEB3_METAMASK_SIGNATURE` | web3_metamask_signature | \ No newline at end of file +| Name | Value | +| -------------------------------- | -------------------------------- | +| `WEB3_METAMASK_SIGNATURE` | web3_metamask_signature | +| `WEB3_COINBASE_WALLET_SIGNATURE` | web3_coinbase_wallet_signature | \ No newline at end of file diff --git a/docs/models/wellknownjwks.md b/docs/models/wellknownjwks.md new file mode 100644 index 0000000..c290d1c --- /dev/null +++ b/docs/models/wellknownjwks.md @@ -0,0 +1,8 @@ +# WellKnownJWKS + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `keys` | List[[models.Keys](../models/keys.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdks/actortokens/README.md b/docs/sdks/actortokens/README.md index 3ea410e..48b1d2b 100644 --- a/docs/sdks/actortokens/README.md +++ b/docs/sdks/actortokens/README.md @@ -25,9 +25,7 @@ s = Clerk( res = s.actor_tokens.create(request={ "user_id": "user_1a2b3c", - "actor": { - "sub": "user_2OEpKhcCN1Lat9NQ0G6puh7q5Rb", - }, + "actor": {}, "expires_in_seconds": 3600, "session_max_duration_in_seconds": 1800, }) diff --git a/docs/sdks/allowlistblocklist/README.md b/docs/sdks/allowlistblocklist/README.md new file mode 100644 index 0000000..da9acbf --- /dev/null +++ b/docs/sdks/allowlistblocklist/README.md @@ -0,0 +1,178 @@ +# AllowlistBlocklist +(*allowlist_blocklist*) + +## Overview + +### Available Operations + +* [list_allowlist_identifiers](#list_allowlist_identifiers) - List all identifiers on the allow-list +* [create_allowlist_identifier](#create_allowlist_identifier) - Add identifier to the allow-list +* [create_blocklist_identifier](#create_blocklist_identifier) - Add identifier to the block-list +* [delete_blocklist_identifier](#delete_blocklist_identifier) - Delete identifier from block-list + +## list_allowlist_identifiers + +Get a list of all identifiers allowed to sign up to an instance + +### Example Usage + +```python +from clerk_backend_api import Clerk + +s = Clerk( + bearer_auth="", +) + + +res = s.allowlist_blocklist.list_allowlist_identifiers() + +if res is not None: + # handle response + pass + +``` + +### 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 + +**[List[models.AllowlistIdentifier]](../../models/.md)** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 401,402 | application/json | +| models.SDKError | 4xx-5xx | */* | + + +## create_allowlist_identifier + +Create an identifier allowed to sign up to an instance + +### Example Usage + +```python +from clerk_backend_api import Clerk + +s = Clerk( + bearer_auth="", +) + + +res = s.allowlist_blocklist.create_allowlist_identifier(request={ + "identifier": "user@example.com", + "notify": True, +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| 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 + +**[models.AllowlistIdentifier](../../models/allowlistidentifier.md)** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 400,402,422 | application/json | +| models.SDKError | 4xx-5xx | */* | + + +## create_blocklist_identifier + +Create an identifier that is blocked from accessing an instance + +### Example Usage + +```python +from clerk_backend_api import Clerk + +s = Clerk( + bearer_auth="", +) + + +res = s.allowlist_blocklist.create_blocklist_identifier(request={ + "identifier": "example@example.com", +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| 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 + +**[models.BlocklistIdentifier](../../models/blocklistidentifier.md)** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 400,402,422 | application/json | +| models.SDKError | 4xx-5xx | */* | + + +## delete_blocklist_identifier + +Delete an identifier from the instance block-list + +### Example Usage + +```python +from clerk_backend_api import Clerk + +s = Clerk( + bearer_auth="", +) + + +res = s.allowlist_blocklist.delete_blocklist_identifier(identifier_id="identifier123") + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `identifier_id` | *str* | :heavy_check_mark: | The ID of the identifier to delete from the block-list | identifier123 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.DeletedObject](../../models/deletedobject.md)** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 402,404 | application/json | +| models.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/allowlistidentifiers/README.md b/docs/sdks/allowlistidentifiers/README.md index 57e063a..5aef139 100644 --- a/docs/sdks/allowlistidentifiers/README.md +++ b/docs/sdks/allowlistidentifiers/README.md @@ -5,94 +5,8 @@ ### Available Operations -* [list](#list) - List all identifiers on the allow-list -* [create](#create) - Add identifier to the allow-list * [delete](#delete) - Delete identifier from allow-list -## list - -Get a list of all identifiers allowed to sign up to an instance - -### Example Usage - -```python -from clerk_backend_api import Clerk - -s = Clerk( - bearer_auth="", -) - - -res = s.allowlist_identifiers.list() - -if res is not None: - # handle response - pass - -``` - -### 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 - -**[List[models.AllowlistIdentifier]](../../models/.md)** - -### Errors - -| Error Object | Status Code | Content Type | -| ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 401,402 | application/json | -| models.SDKError | 4xx-5xx | */* | - - -## create - -Create an identifier allowed to sign up to an instance - -### Example Usage - -```python -from clerk_backend_api import Clerk - -s = Clerk( - bearer_auth="", -) - - -res = s.allowlist_identifiers.create(request={ - "identifier": "user@example.com", - "notify": True, -}) - -if res is not None: - # handle response - pass - -``` - -### Parameters - -| 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 - -**[models.AllowlistIdentifier](../../models/allowlistidentifier.md)** - -### Errors - -| Error Object | Status Code | Content Type | -| ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 400,402,422 | application/json | -| models.SDKError | 4xx-5xx | */* | - - ## delete Delete an identifier from the instance allow-list diff --git a/docs/sdks/betafeatures/README.md b/docs/sdks/betafeatures/README.md index 942c7cd..98984b5 100644 --- a/docs/sdks/betafeatures/README.md +++ b/docs/sdks/betafeatures/README.md @@ -5,11 +5,11 @@ ### Available Operations -* [update_instance_auth_config](#update_instance_auth_config) - Update instance settings -* [~~update_production_instance_domain~~](#update_production_instance_domain) - Update production instance domain :warning: **Deprecated** +* [update_instance_settings](#update_instance_settings) - Update instance settings +* [~~update_domain~~](#update_domain) - Update production instance domain :warning: **Deprecated** * [change_production_instance_domain](#change_production_instance_domain) - Update production instance domain -## update_instance_auth_config +## update_instance_settings Updates the settings of an instance @@ -23,7 +23,7 @@ s = Clerk( ) -res = s.beta_features.update_instance_auth_config(request={ +res = s.beta_features.update_instance_settings(request={ "restricted_to_allowlist": False, "from_email_address": "noreply", "progressive_sign_up": True, @@ -57,7 +57,7 @@ if res is not None: | models.SDKError | 4xx-5xx | */* | -## ~~update_production_instance_domain~~ +## ~~update_domain~~ Change the domain of a production instance. @@ -77,7 +77,7 @@ s = Clerk( ) -s.beta_features.update_production_instance_domain(request={ +s.beta_features.update_domain(request={ "home_url": "https://www.example.com", }) @@ -120,6 +120,7 @@ s = Clerk( s.beta_features.change_production_instance_domain(request={ "home_url": "https://www.newdomain.com", + "is_secondary": False, }) # Use the SDK ... diff --git a/docs/sdks/blocklistidentifierssdk/README.md b/docs/sdks/blocklistidentifierssdk/README.md index f6fb6ab..c6450e5 100644 --- a/docs/sdks/blocklistidentifierssdk/README.md +++ b/docs/sdks/blocklistidentifierssdk/README.md @@ -6,8 +6,6 @@ ### Available Operations * [list](#list) - List all identifiers on the block-list -* [create](#create) - Add identifier to the block-list -* [delete](#delete) - Delete identifier from block-list ## list @@ -47,87 +45,3 @@ if res is not None: | ------------------ | ------------------ | ------------------ | | models.ClerkErrors | 401,402 | application/json | | models.SDKError | 4xx-5xx | */* | - - -## create - -Create an identifier that is blocked from accessing an instance - -### Example Usage - -```python -from clerk_backend_api import Clerk - -s = Clerk( - bearer_auth="", -) - - -res = s.blocklist_identifiers.create(request={ - "identifier": "example@example.com", -}) - -if res is not None: - # handle response - pass - -``` - -### Parameters - -| 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 - -**[models.BlocklistIdentifier](../../models/blocklistidentifier.md)** - -### Errors - -| Error Object | Status Code | Content Type | -| ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 400,402,422 | application/json | -| models.SDKError | 4xx-5xx | */* | - - -## delete - -Delete an identifier from the instance block-list - -### Example Usage - -```python -from clerk_backend_api import Clerk - -s = Clerk( - bearer_auth="", -) - - -res = s.blocklist_identifiers.delete(identifier_id="identifier123") - -if res is not None: - # handle response - pass - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `identifier_id` | *str* | :heavy_check_mark: | The ID of the identifier to delete from the block-list | identifier123 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | - -### Response - -**[models.DeletedObject](../../models/deletedobject.md)** - -### Errors - -| Error Object | Status Code | Content Type | -| ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 402,404 | application/json | -| models.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/clerkredirecturls/README.md b/docs/sdks/clerkredirecturls/README.md new file mode 100644 index 0000000..a41f830 --- /dev/null +++ b/docs/sdks/clerkredirecturls/README.md @@ -0,0 +1,134 @@ +# ClerkRedirectUrls +(*redirect_urls*) + +## Overview + +### Available Operations + +* [create](#create) - Create a redirect URL +* [get](#get) - Retrieve a redirect URL +* [delete](#delete) - Delete a redirect URL + +## create + +Create a redirect URL + +### Example Usage + +```python +from clerk_backend_api import Clerk + +s = Clerk( + bearer_auth="", +) + + +res = s.redirect_urls.create(request={ + "url": "https://my-app.com/oauth-callback", +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `request` | [models.CreateRedirectURLRequestBody](../../models/createredirecturlrequestbody.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.RedirectURL](../../models/redirecturl.md)** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 400,422 | application/json | +| models.SDKError | 4xx-5xx | */* | + + +## get + +Retrieve the details of the redirect URL with the given ID + +### Example Usage + +```python +from clerk_backend_api import Clerk + +s = Clerk( + bearer_auth="", +) + + +res = s.redirect_urls.get(id="redir_01FG4K9G5NWSQ4ZPT4TQE4Z7G3") + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The ID of the redirect URL | redir_01FG4K9G5NWSQ4ZPT4TQE4Z7G3 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.RedirectURL](../../models/redirecturl.md)** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 404 | application/json | +| models.SDKError | 4xx-5xx | */* | + + +## delete + +Remove the selected redirect URL from the whitelist of the instance + +### Example Usage + +```python +from clerk_backend_api import Clerk + +s = Clerk( + bearer_auth="", +) + + +res = s.redirect_urls.delete(id="redir_01FG4K9G5NWSQ4ZPT4TQE4Z7G3") + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The ID of the redirect URL | redir_01FG4K9G5NWSQ4ZPT4TQE4Z7G3 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.DeletedObject](../../models/deletedobject.md)** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 404 | application/json | +| models.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/clients/README.md b/docs/sdks/clients/README.md index f77e505..052c680 100644 --- a/docs/sdks/clients/README.md +++ b/docs/sdks/clients/README.md @@ -3,6 +3,9 @@ ## Overview +The Client object tracks sessions, as well as the state of any sign in and sign up attempts, for a given device. + + ### Available Operations * [~~list~~](#list) - List all clients :warning: **Deprecated** @@ -30,13 +33,8 @@ s = Clerk( res = s.clients.list(limit=20, offset=10) if res is not None: - while True: - # handle items - - res = res.Next() - if res is None: - break - + # handle response + pass ``` @@ -50,7 +48,7 @@ if res is not None: ### Response -**[models.GetClientListResponse](../../models/getclientlistresponse.md)** +**[List[models.Client]](../../models/.md)** ### Errors diff --git a/docs/sdks/domainssdk/README.md b/docs/sdks/domainssdk/README.md index 6db84a0..0840b67 100644 --- a/docs/sdks/domainssdk/README.md +++ b/docs/sdks/domainssdk/README.md @@ -3,6 +3,8 @@ ## Overview +Domains represent each instance's URLs and DNS setup. + ### Available Operations * [list](#list) - List all instance domains @@ -162,7 +164,7 @@ s = Clerk( ) -res = s.domains.update(domain_id="domain_12345", name="example.com", proxy_url="http://proxy.example.com") +res = s.domains.update(domain_id="domain_12345", name="example.com", proxy_url="http://proxy.example.com", is_secondary=False) if res is not None: # handle response @@ -172,12 +174,13 @@ if res is not None: ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `domain_id` | *str* | :heavy_check_mark: | The ID of the domain that will be updated. | domain_12345 | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The new domain name. For development instances, can contain the port,
i.e `myhostname:3000`. For production instances, must be a valid FQDN,
i.e `mysite.com`. Cannot contain protocol scheme. | example.com | -| `proxy_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The full URL of the proxy that will forward requests to Clerk's Frontend API.
Can only be updated for production instances. | http://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 | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `domain_id` | *str* | :heavy_check_mark: | The ID of the domain that will be updated. | domain_12345 | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The new domain name. For development instances, can contain the port,
i.e `myhostname:3000`. For production instances, must be a valid FQDN,
i.e `mysite.com`. Cannot contain protocol scheme. | example.com | +| `proxy_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The full URL of the proxy that will forward requests to Clerk's Frontend API.
Can only be updated for production instances. | http://proxy.example.com | +| `is_secondary` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether this is a domain for a secondary app, meaning that any subdomain provided is significant and
will be stored as part of the domain. This is useful for supporting multiple apps (one primary and
multiple secondaries) on the same root domain (eTLD+1). | | +| `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/emailandsmstemplates/README.md b/docs/sdks/emailandsmstemplates/README.md new file mode 100644 index 0000000..53ffd5a --- /dev/null +++ b/docs/sdks/emailandsmstemplates/README.md @@ -0,0 +1,61 @@ +# EmailAndSmsTemplates +(*email_and_sms_templates*) + +## Overview + +### Available Operations + +* [~~upsert~~](#upsert) - Update a template for a given type and slug :warning: **Deprecated** + +## ~~upsert~~ + +Updates the existing template of the given type and slug + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + +### Example Usage + +```python +import clerk_backend_api +from clerk_backend_api import Clerk + +s = Clerk( + bearer_auth="", +) + + +res = s.email_and_sms_templates.upsert(template_type=clerk_backend_api.UpsertTemplatePathParamTemplateType.SMS, slug="verification-code", request_body={ + "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", +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `template_type` | [models.UpsertTemplatePathParamTemplateType](../../models/upserttemplatepathparamtemplatetype.md) | :heavy_check_mark: | The type of template to update | sms | +| `slug` | *str* | :heavy_check_mark: | The slug of the template to update | verification-code | +| `request_body` | [Optional[models.UpsertTemplateRequestBody]](../../models/upserttemplaterequestbody.md) | :heavy_minus_sign: | N/A | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.Template](../../models/template.md)** + +### Errors + +| Error Object | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| models.ClerkErrors | 400,401,402,403,404,422 | application/json | +| models.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/emailsmstemplates/README.md b/docs/sdks/emailsmstemplates/README.md new file mode 100644 index 0000000..4d57eca --- /dev/null +++ b/docs/sdks/emailsmstemplates/README.md @@ -0,0 +1,103 @@ +# EmailSMSTemplates +(*email_sms_templates*) + +## Overview + +### Available Operations + +* [~~get~~](#get) - Retrieve a template :warning: **Deprecated** +* [~~toggle_template_delivery~~](#toggle_template_delivery) - Toggle the delivery by Clerk for a template of a given type and slug :warning: **Deprecated** + +## ~~get~~ + +Returns the details of a template + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + +### Example Usage + +```python +import clerk_backend_api +from clerk_backend_api import Clerk + +s = Clerk( + bearer_auth="", +) + + +res = s.email_sms_templates.get(template_type=clerk_backend_api.PathParamTemplateType.EMAIL, slug="welcome-email") + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `template_type` | [models.PathParamTemplateType](../../models/pathparamtemplatetype.md) | :heavy_check_mark: | The type of templates to retrieve (email or SMS) | email | +| `slug` | *str* | :heavy_check_mark: | The slug (i.e. machine-friendly name) of the template to retrieve | welcome-email | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.Template](../../models/template.md)** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 400,401,404 | application/json | +| models.SDKError | 4xx-5xx | */* | + + +## ~~toggle_template_delivery~~ + +Toggles the delivery by Clerk for a template of a given type and slug. +If disabled, Clerk will not deliver the resulting email or SMS. +The app developer will need to listen to the `email.created` or `sms.created` webhooks in order to handle delivery themselves. + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + +### Example Usage + +```python +import clerk_backend_api +from clerk_backend_api import Clerk + +s = Clerk( + bearer_auth="", +) + + +res = s.email_sms_templates.toggle_template_delivery(template_type=clerk_backend_api.ToggleTemplateDeliveryPathParamTemplateType.EMAIL, slug="welcome-email", request_body={ + "delivered_by_clerk": True, +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `template_type` | [models.ToggleTemplateDeliveryPathParamTemplateType](../../models/toggletemplatedeliverypathparamtemplatetype.md) | :heavy_check_mark: | The type of template to toggle delivery for | email | +| `slug` | *str* | :heavy_check_mark: | The slug of the template for which to toggle delivery | welcome-email | +| `request_body` | [Optional[models.ToggleTemplateDeliveryRequestBody]](../../models/toggletemplatedeliveryrequestbody.md) | :heavy_minus_sign: | N/A | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.Template](../../models/template.md)** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 400,401,404 | application/json | +| models.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/invitations/README.md b/docs/sdks/invitations/README.md index 54de5a9..5008c9d 100644 --- a/docs/sdks/invitations/README.md +++ b/docs/sdks/invitations/README.md @@ -3,6 +3,9 @@ ## Overview +Invitations allow you to invite someone to sign up to your application, via email. + + ### Available Operations * [create](#create) - Create an invitation @@ -31,6 +34,7 @@ res = s.invitations.create(request={ "redirect_url": "https://example.com/welcome", "notify": True, "ignore_existing": True, + "expires_in_days": 486589, }) if res is not None: @@ -76,13 +80,8 @@ s = Clerk( res = s.invitations.list(limit=20, offset=10, status=clerk_backend_api.ListInvitationsQueryParamStatus.PENDING) if res is not None: - while True: - # handle items - - res = res.Next() - if res is None: - break - + # handle response + pass ``` @@ -97,7 +96,7 @@ if res is not None: ### Response -**[models.ListInvitationsResponse](../../models/listinvitationsresponse.md)** +**[List[models.Invitation]](../../models/.md)** ### Errors diff --git a/docs/sdks/jwks/README.md b/docs/sdks/jwks/README.md index 816ffea..15e07f1 100644 --- a/docs/sdks/jwks/README.md +++ b/docs/sdks/jwks/README.md @@ -21,9 +21,11 @@ s = Clerk( ) -s.jwks.get() +res = s.jwks.get() -# Use the SDK ... +if res is not None: + # handle response + pass ``` @@ -33,6 +35,10 @@ s.jwks.get() | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +### Response + +**[models.WellKnownJWKS](../../models/wellknownjwks.md)** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/misc/README.md b/docs/sdks/miscellaneous/README.md similarity index 88% rename from docs/sdks/misc/README.md rename to docs/sdks/miscellaneous/README.md index dacbdc5..2be53c4 100644 --- a/docs/sdks/misc/README.md +++ b/docs/sdks/miscellaneous/README.md @@ -1,13 +1,15 @@ -# Misc -(*misc*) +# Miscellaneous +(*miscellaneous*) ## Overview +Various endpoints that do not belong in any particular category. + ### Available Operations -* [get_public_interstitial](#get_public_interstitial) - Returns the markup for the interstitial page +* [get_interstitial](#get_interstitial) - Returns the markup for the interstitial page -## get_public_interstitial +## get_interstitial The Clerk interstitial endpoint serves an html page that loads clerk.js in order to check the user's authentication state. It is used by Clerk SDKs when the user's authentication state cannot be immediately determined. @@ -20,7 +22,7 @@ from clerk_backend_api import Clerk s = Clerk() -s.misc.get_public_interstitial(frontend_api="frontend-api_1a2b3c4d", publishable_key="pub_1a2b3c4d") +s.miscellaneous.get_interstitial(frontend_api="frontend-api_1a2b3c4d", publishable_key="pub_1a2b3c4d") # Use the SDK ... diff --git a/docs/sdks/oauthapplicationssdk/README.md b/docs/sdks/oauthapplicationssdk/README.md index 4c302c8..f008320 100644 --- a/docs/sdks/oauthapplicationssdk/README.md +++ b/docs/sdks/oauthapplicationssdk/README.md @@ -1,5 +1,5 @@ -# OAuthApplicationsSDK -(*o_auth_applications*) +# OauthApplicationsSDK +(*oauth_applications*) ## Overview @@ -29,16 +29,11 @@ s = Clerk( ) -res = s.o_auth_applications.list(limit=20, offset=10) +res = s.oauth_applications.list(limit=20, offset=10) if res is not None: - while True: - # handle items - - res = res.Next() - if res is None: - break - + # handle response + pass ``` @@ -52,7 +47,7 @@ if res is not None: ### Response -**[models.ListOAuthApplicationsResponse](../../models/listoauthapplicationsresponse.md)** +**[models.OAuthApplications](../../models/oauthapplications.md)** ### Errors @@ -78,7 +73,7 @@ s = Clerk( ) -res = s.o_auth_applications.create(request={ +res = s.oauth_applications.create(request={ "name": "Example App", "callback_url": "https://example.com/oauth/callback", "scopes": "profile email public_metadata", @@ -124,7 +119,7 @@ s = Clerk( ) -res = s.o_auth_applications.get(oauth_application_id="oauth_app_12345") +res = s.oauth_applications.get(oauth_application_id="oauth_app_12345") if res is not None: # handle response @@ -165,7 +160,7 @@ s = Clerk( ) -res = s.o_auth_applications.update(oauth_application_id="oauth_app_67890", name="Updated OAuth App Name", callback_url="https://example.com/oauth/callback", scopes="profile email public_metadata private_metadata") +res = s.oauth_applications.update(oauth_application_id="oauth_app_67890", name="Updated OAuth App Name", callback_url="https://example.com/oauth/callback", scopes="profile email public_metadata private_metadata") if res is not None: # handle response @@ -210,7 +205,7 @@ s = Clerk( ) -res = s.o_auth_applications.delete(oauth_application_id="oauth_app_09876") +res = s.oauth_applications.delete(oauth_application_id="oauth_app_09876") if res is not None: # handle response @@ -252,7 +247,7 @@ s = Clerk( ) -res = s.o_auth_applications.rotate_secret(oauth_application_id="oauth_application_12345") +res = s.oauth_applications.rotate_secret(oauth_application_id="oauth_application_12345") if res is not None: # handle response diff --git a/docs/sdks/organizationdomainsdk/README.md b/docs/sdks/organizationdomainsdk/README.md new file mode 100644 index 0000000..90cef25 --- /dev/null +++ b/docs/sdks/organizationdomainsdk/README.md @@ -0,0 +1,51 @@ +# OrganizationDomainSDK +(*organization_domain*) + +## Overview + +### Available Operations + +* [update](#update) - Update an organization domain. + +## update + +Updates the properties of an existing organization domain. + +### Example Usage + +```python +from clerk_backend_api import Clerk + +s = Clerk( + bearer_auth="", +) + + +res = s.organization_domain.update(organization_id="", domain_id="", enrollment_mode="", verified=False) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization the domain belongs to | +| `domain_id` | *str* | :heavy_check_mark: | The ID of the domain | +| `enrollment_mode` | *OptionalNullable[str]* | :heavy_minus_sign: | The enrollment_mode for the new domain. This can be `automatic_invitation`, `automatic_suggestion` or `manual_invitation` | +| `verified` | *OptionalNullable[bool]* | :heavy_minus_sign: | The status of the domain's verification | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.OrganizationDomain](../../models/organizationdomain.md)** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 400,404,422 | application/json | +| models.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/organizationdomainssdk/README.md b/docs/sdks/organizationdomainssdk/README.md new file mode 100644 index 0000000..1e8b21f --- /dev/null +++ b/docs/sdks/organizationdomainssdk/README.md @@ -0,0 +1,140 @@ +# OrganizationDomainsSDK +(*organization_domains*) + +## Overview + +### Available Operations + +* [create](#create) - Create a new organization domain. +* [list](#list) - Get a list of all domains of an organization. +* [delete](#delete) - Remove a domain from an organization. + +## create + +Creates a new organization domain. By default the domain is verified, but can be optionally set to unverified. + +### Example Usage + +```python +from clerk_backend_api import Clerk + +s = Clerk( + bearer_auth="", +) + + +res = s.organization_domains.create(organization_id="", name="", enrollment_mode="", verified=False) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization where the new domain will be created. | +| `name` | *Optional[str]* | :heavy_minus_sign: | The name of the new domain | +| `enrollment_mode` | *Optional[str]* | :heavy_minus_sign: | The enrollment_mode for the new domain. This can be `automatic_invitation`, `automatic_suggestion` or `manual_invitation` | +| `verified` | *OptionalNullable[bool]* | :heavy_minus_sign: | The status of domain's verification. Defaults to true | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.OrganizationDomain](../../models/organizationdomain.md)** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 400,403,404,422 | application/json | +| models.SDKError | 4xx-5xx | */* | + + +## list + +Get a list of all domains of an organization. + +### Example Usage + +```python +from clerk_backend_api import Clerk + +s = Clerk( + bearer_auth="", +) + + +res = s.organization_domains.list(organization_id="", limit=20, offset=10, verified="", enrollment_mode="") + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | *str* | :heavy_check_mark: | The organization ID. | | +| `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 | +| `verified` | *Optional[str]* | :heavy_minus_sign: | Filter domains by their verification status. `true` or `false` | | +| `enrollment_mode` | *Optional[str]* | :heavy_minus_sign: | Filter domains by their enrollment mode | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.OrganizationDomains](../../models/organizationdomains.md)** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 401,422 | application/json | +| models.SDKError | 4xx-5xx | */* | + + +## delete + +Removes the given domain from the organization. + +### Example Usage + +```python +from clerk_backend_api import Clerk + +s = Clerk( + bearer_auth="", +) + + +res = s.organization_domains.delete(organization_id="", domain_id="") + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization the domain belongs to | +| `domain_id` | *str* | :heavy_check_mark: | The ID of the domain | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.DeletedObject](../../models/deletedobject.md)** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 400,401,404 | application/json | +| models.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/organizationinvitationssdk/README.md b/docs/sdks/organizationinvitationssdk/README.md index 097b70a..f8214be 100644 --- a/docs/sdks/organizationinvitationssdk/README.md +++ b/docs/sdks/organizationinvitationssdk/README.md @@ -5,13 +5,65 @@ ### Available Operations +* [get_all](#get_all) - Get a list of organization invitations for the current instance * [create](#create) - Create and send an organization invitation * [list](#list) - Get a list of organization invitations -* [create_bulk](#create_bulk) - Bulk create and send organization invitations +* [bulk_create](#bulk_create) - Bulk create and send organization invitations * [~~list_pending~~](#list_pending) - Get a list of pending organization invitations :warning: **Deprecated** * [get](#get) - Retrieve an organization invitation by ID * [revoke](#revoke) - Revoke a pending organization invitation +## get_all + +This request returns the list of organization invitations for the instance. +Results can be paginated using the optional `limit` and `offset` query parameters. +You can filter them by providing the 'status' query parameter, that accepts multiple values. +You can change the order by providing the 'order' query parameter, that accepts multiple values. +You can filter by the invited user email address providing the `query` query parameter. +The organization invitations are ordered by descending creation date by default. + +### Example Usage + +```python +import clerk_backend_api +from clerk_backend_api import Clerk + +s = Clerk( + bearer_auth="", +) + + +res = s.organization_invitations.get_all(limit=20, offset=10, order_by="-created_at", status=clerk_backend_api.ListInstanceOrganizationInvitationsQueryParamStatus.ACCEPTED, query="") + +if res is not None: + # handle response + pass + +``` + +### 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 | +| `order_by` | *Optional[str]* | :heavy_minus_sign: | Allows to return organization invitations in a particular order.
At the moment, you can order the returned organization invitations either by their `created_at` or `email_address`.
In order to specify the direction, you can use the `+/-` symbols prepended in the property to order by.
For example, if you want organization invitations 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.
Defaults to `-created_at`. | | +| `status` | [Optional[models.ListInstanceOrganizationInvitationsQueryParamStatus]](../../models/listinstanceorganizationinvitationsqueryparamstatus.md) | :heavy_minus_sign: | Filter organization invitations based on their status | | +| `query` | *Optional[str]* | :heavy_minus_sign: | Filter organization invitations based on their `email_address` | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.OrganizationInvitationsWithPublicOrganizationData](../../models/organizationinvitationswithpublicorganizationdata.md)** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 400,404,422,500 | application/json | +| models.SDKError | 4xx-5xx | */* | + + ## create Creates a new organization invitation and sends an email to the provided `email_address` with a link to accept the invitation and join the organization. @@ -23,7 +75,7 @@ The request body supports passing an optional `redirect_url` parameter. When the invited user clicks the link to accept the invitation, they will be redirected to the URL provided. Use this parameter to implement a custom invitation acceptance flow. -You must specify the ID of the user that will send the invitation with the `inviter_user_id` parameter. +You can specify the ID of the user that will send the invitation with the `inviter_user_id` parameter. That user must be a member with administrator privileges in the organization. Only "admin" members can create organization invitations. @@ -41,7 +93,7 @@ s = Clerk( ) -res = s.organization_invitations.create(organization_id="org_12345", email_address="user@example.com", inviter_user_id="user_67890", role="admin", public_metadata={}, private_metadata={}, redirect_url="https://example.com/welcome") +res = s.organization_invitations.create(organization_id="org_12345", email_address="user@example.com", role="admin", inviter_user_id="user_67890", public_metadata={}, private_metadata={}, redirect_url="https://example.com/welcome") if res is not None: # handle response @@ -55,8 +107,8 @@ if res is not None: | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | `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 | -| `inviter_user_id` | *str* | :heavy_check_mark: | The ID of the user that invites the new member to the organization.
Must be an administrator in the organization. | user_67890 | | `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` | [Optional[models.CreateOrganizationInvitationPublicMetadata]](../../models/createorganizationinvitationpublicmetadata.md) | :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` | [Optional[models.CreateOrganizationInvitationPrivateMetadata]](../../models/createorganizationinvitationprivatemetadata.md) | :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 | @@ -97,13 +149,8 @@ s = Clerk( res = s.organization_invitations.list(organization_id="org_12345", limit=20, offset=10, status=clerk_backend_api.ListOrganizationInvitationsQueryParamStatus.PENDING) if res is not None: - while True: - # handle items - - res = res.Next() - if res is None: - break - + # handle response + pass ``` @@ -119,7 +166,7 @@ if res is not None: ### Response -**[models.ListOrganizationInvitationsResponse](../../models/listorganizationinvitationsresponse.md)** +**[models.OrganizationInvitations](../../models/organizationinvitations.md)** ### Errors @@ -129,7 +176,7 @@ if res is not None: | models.SDKError | 4xx-5xx | */* | -## create_bulk +## bulk_create Creates new organization invitations in bulk and sends out emails to the provided email addresses with a link to accept the invitation and join the organization. You can specify a different `role` for each invited organization member. @@ -137,7 +184,7 @@ New organization invitations get a "pending" status until they are revoked by an The request body supports passing an optional `redirect_url` parameter for each invitation. When the invited user clicks the link to accept the invitation, they will be redirected to the provided URL. Use this parameter to implement a custom invitation acceptance flow. -You must specify the ID of the user that will send the invitation with the `inviter_user_id` parameter. Each invitation +You can specify the ID of the user that will send the invitation with the `inviter_user_id` parameter. Each invitation can have a different inviter user. Inviter users must be members with administrator privileges in the organization. Only "admin" members can create organization invitations. @@ -155,11 +202,11 @@ s = Clerk( ) -res = s.organization_invitations.create_bulk(organization_id="org_12345", request_body=[ +res = s.organization_invitations.bulk_create(organization_id="org_12345", request_body=[ { "email_address": "newmember@example.com", - "inviter_user_id": "user_67890", "role": "admin", + "inviter_user_id": "user_67890", "public_metadata": {}, "private_metadata": {}, "redirect_url": "https://example.com/welcome", @@ -216,13 +263,8 @@ s = Clerk( res = s.organization_invitations.list_pending(organization_id="org_12345", limit=20, offset=10) if res is not None: - while True: - # handle items - - res = res.Next() - if res is None: - break - + # handle response + pass ``` @@ -237,7 +279,7 @@ if res is not None: ### Response -**[models.ListPendingOrganizationInvitationsResponse](../../models/listpendingorganizationinvitationsresponse.md)** +**[models.OrganizationInvitations](../../models/organizationinvitations.md)** ### Errors @@ -294,7 +336,7 @@ if res is not None: Use this request to revoke a previously issued organization invitation. Revoking an organization invitation makes it invalid; the invited user will no longer be able to join the organization with the revoked invitation. Only organization invitations with "pending" status can be revoked. -The request needs the `requesting_user_id` parameter to specify the user which revokes the invitation. +The request accepts the `requesting_user_id` parameter to specify the user which revokes the invitation. Only users with "admin" role can revoke invitations. ### Example Usage @@ -307,7 +349,9 @@ s = Clerk( ) -res = s.organization_invitations.revoke(organization_id="org_123456", invitation_id="inv_123456", requesting_user_id="usr_12345") +res = s.organization_invitations.revoke(organization_id="org_123456", invitation_id="inv_123456", request_body={ + "requesting_user_id": "usr_12345", +}) if res is not None: # handle response @@ -317,12 +361,12 @@ if res is not None: ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `organization_id` | *str* | :heavy_check_mark: | The organization ID. | org_123456 | -| `invitation_id` | *str* | :heavy_check_mark: | The organization invitation ID. | inv_123456 | -| `requesting_user_id` | *str* | :heavy_check_mark: | The ID of the user that revokes the invitation.
Must be an administrator in the organization. | usr_12345 | -| `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_123456 | +| `invitation_id` | *str* | :heavy_check_mark: | The organization invitation ID. | inv_123456 | +| `request_body` | [Optional[models.RevokeOrganizationInvitationRequestBody]](../../models/revokeorganizationinvitationrequestbody.md) | :heavy_minus_sign: | 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 da883bc..0086e5d 100644 --- a/docs/sdks/organizationmembershipssdk/README.md +++ b/docs/sdks/organizationmembershipssdk/README.md @@ -10,6 +10,7 @@ * [update](#update) - Update an organization membership * [delete](#delete) - Remove a member from an organization * [update_metadata](#update_metadata) - Merge and update organization membership metadata +* [get_all](#get_all) - Get a list of all organization memberships within an instance. ## create @@ -71,13 +72,8 @@ s = Clerk( res = s.organization_memberships.list(organization_id="org_789", limit=20, offset=10, order_by="+created_at") if res is not None: - while True: - # handle items - - res = res.Next() - if res is None: - break - + # handle response + pass ``` @@ -93,7 +89,7 @@ if res is not None: ### Response -**[models.ListOrganizationMembershipsResponse](../../models/listorganizationmembershipsresponse.md)** +**[models.OrganizationMemberships](../../models/organizationmemberships.md)** ### Errors @@ -232,3 +228,46 @@ if res is not None: | ------------------ | ------------------ | ------------------ | | models.ClerkErrors | 400,404,422 | application/json | | models.SDKError | 4xx-5xx | */* | + + +## get_all + +Retrieves all organization user memberships for the given instance. + +### Example Usage + +```python +from clerk_backend_api import Clerk + +s = Clerk( + bearer_auth="", +) + + +res = s.organization_memberships.get_all(limit=20, offset=10, order_by="") + +if res is not None: + # handle response + pass + +``` + +### 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 | +| `order_by` | *Optional[str]* | :heavy_minus_sign: | Sorts organizations memberships by phone_number, email_address, created_at, first_name, last_name or username.
By prepending one of those values with + or -,
we can choose to sort in ascending (ASC) or descending (DESC) order. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.OrganizationMemberships](../../models/organizationmemberships.md)** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 400,401,422,500 | application/json | +| models.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/organizationssdk/README.md b/docs/sdks/organizationssdk/README.md index 4d1bb69..6430460 100644 --- a/docs/sdks/organizationssdk/README.md +++ b/docs/sdks/organizationssdk/README.md @@ -3,6 +3,9 @@ ## Overview +Organizations are used to group members under a common entity and provide shared access to resources. + + ### Available Operations * [list](#list) - Get a list of organizations for an instance @@ -73,6 +76,8 @@ You can provide additional metadata for the organization and set any custom attr Organizations support private and public metadata. Private metadata can only be accessed from the Backend API. Public metadata can be accessed from the Backend API, and are read-only from the Frontend API. +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. ### Example Usage @@ -91,6 +96,7 @@ res = s.organizations.create(request={ "public_metadata": {}, "slug": "neworg", "max_allowed_memberships": 100, + "created_at": "", }) if res is not None: @@ -132,7 +138,7 @@ s = Clerk( ) -res = s.organizations.get(organization_id="org_123") +res = s.organizations.get(organization_id="org_123", include_members_count=False) if res is not None: # handle response @@ -142,10 +148,11 @@ if res is not None: ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `organization_id` | *str* | :heavy_check_mark: | The ID or slug of the organization | org_123 | -| `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 or slug of the organization | org_123 | +| `include_members_count` | *Optional[bool]* | :heavy_minus_sign: | Flag to denote whether or not the organization's members count should be included in the response. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -173,7 +180,7 @@ s = Clerk( ) -res = s.organizations.update(organization_id="org_123_update", public_metadata={}, private_metadata={}, name="New Organization Name", slug="new-org-slug", max_allowed_memberships=100, admin_delete_enabled=True) +res = s.organizations.update(organization_id="org_123_update", public_metadata={}, private_metadata={}, name="New Organization Name", slug="new-org-slug", max_allowed_memberships=100, admin_delete_enabled=True, created_at="") if res is not None: # handle response @@ -183,16 +190,17 @@ if res is not None: ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization to update | org_123_update | -| `public_metadata` | [Optional[models.UpdateOrganizationPublicMetadata]](../../models/updateorganizationpublicmetadata.md) | :heavy_minus_sign: | Metadata saved on the organization, that is visible to both your frontend and backend. | {} | -| `private_metadata` | [Optional[models.UpdateOrganizationPrivateMetadata]](../../models/updateorganizationprivatemetadata.md) | :heavy_minus_sign: | Metadata saved on the organization that is only visible to your backend. | {} | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The new name of the organization | New Organization Name | -| `slug` | *OptionalNullable[str]* | :heavy_minus_sign: | The new slug of the organization, which needs to be unique in the instance | new-org-slug | -| `max_allowed_memberships` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of memberships allowed for this organization | 100 | -| `admin_delete_enabled` | *OptionalNullable[bool]* | :heavy_minus_sign: | If true, an admin can delete this organization with the Frontend API. | 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 | Example | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization to update | org_123_update | +| `public_metadata` | [Optional[models.UpdateOrganizationPublicMetadata]](../../models/updateorganizationpublicmetadata.md) | :heavy_minus_sign: | Metadata saved on the organization, that is visible to both your frontend and backend. | {} | +| `private_metadata` | [Optional[models.UpdateOrganizationPrivateMetadata]](../../models/updateorganizationprivatemetadata.md) | :heavy_minus_sign: | Metadata saved on the organization that is only visible to your backend. | {} | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The new name of the organization.
May not contain URLs or HTML. | New Organization Name | +| `slug` | *OptionalNullable[str]* | :heavy_minus_sign: | The new slug of the organization, which needs to be unique in the instance | new-org-slug | +| `max_allowed_memberships` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of memberships allowed for this organization | 100 | +| `admin_delete_enabled` | *OptionalNullable[bool]* | :heavy_minus_sign: | If true, an admin can delete this organization with the Frontend API. | true | +| `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. | | ### Response @@ -313,12 +321,12 @@ s = Clerk( res = s.organizations.upload_logo(organization_id="org_12345", request_body={ - "uploader_user_id": "user_67890", "file": { "file_name": "your_file_here", "content": open("", "rb"), "content_type": "", }, + "uploader_user_id": "user_67890", }) if res is not None: diff --git a/docs/sdks/redirecturls/README.md b/docs/sdks/redirecturls/README.md index 4847cc7..0b4b8b5 100644 --- a/docs/sdks/redirecturls/README.md +++ b/docs/sdks/redirecturls/README.md @@ -1,14 +1,11 @@ -# RedirectUrls -(*redirect_urls*) +# RedirectURLs +(*redirect_ur_ls*) ## Overview ### Available Operations * [list](#list) - List all redirect URLs -* [create](#create) - Create a redirect URL -* [get](#get) - Retrieve a redirect URL -* [delete](#delete) - Delete a redirect URL ## list @@ -24,7 +21,7 @@ s = Clerk( ) -res = s.redirect_urls.list() +res = s.redirect_ur_ls.list() if res is not None: # handle response @@ -47,128 +44,3 @@ if res is not None: | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | models.SDKError | 4xx-5xx | */* | - - -## create - -Create a redirect URL - -### Example Usage - -```python -from clerk_backend_api import Clerk - -s = Clerk( - bearer_auth="", -) - - -res = s.redirect_urls.create(request={ - "url": "https://my-app.com/oauth-callback", -}) - -if res is not None: - # handle response - pass - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `request` | [models.CreateRedirectURLRequestBody](../../models/createredirecturlrequestbody.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.RedirectURL](../../models/redirecturl.md)** - -### Errors - -| Error Object | Status Code | Content Type | -| ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 400,422 | application/json | -| models.SDKError | 4xx-5xx | */* | - - -## get - -Retrieve the details of the redirect URL with the given ID - -### Example Usage - -```python -from clerk_backend_api import Clerk - -s = Clerk( - bearer_auth="", -) - - -res = s.redirect_urls.get(id="redir_01FG4K9G5NWSQ4ZPT4TQE4Z7G3") - -if res is not None: - # handle response - pass - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The ID of the redirect URL | redir_01FG4K9G5NWSQ4ZPT4TQE4Z7G3 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | - -### Response - -**[models.RedirectURL](../../models/redirecturl.md)** - -### Errors - -| Error Object | Status Code | Content Type | -| ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 404 | application/json | -| models.SDKError | 4xx-5xx | */* | - - -## delete - -Remove the selected redirect URL from the whitelist of the instance - -### Example Usage - -```python -from clerk_backend_api import Clerk - -s = Clerk( - bearer_auth="", -) - - -res = s.redirect_urls.delete(id="redir_01FG4K9G5NWSQ4ZPT4TQE4Z7G3") - -if res is not None: - # handle response - pass - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The ID of the redirect URL | redir_01FG4K9G5NWSQ4ZPT4TQE4Z7G3 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | - -### Response - -**[models.DeletedObject](../../models/deletedobject.md)** - -### Errors - -| Error Object | Status Code | Content Type | -| ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 404 | application/json | -| models.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/samlconnectionssdk/README.md b/docs/sdks/samlconnectionssdk/README.md index e9eb7d3..290daa5 100644 --- a/docs/sdks/samlconnectionssdk/README.md +++ b/docs/sdks/samlconnectionssdk/README.md @@ -30,13 +30,8 @@ s = Clerk( res = s.saml_connections.list(limit=20, offset=10) if res is not None: - while True: - # handle items - - res = res.Next() - if res is None: - break - + # handle response + pass ``` @@ -50,7 +45,7 @@ if res is not None: ### Response -**[models.ListSAMLConnectionsResponse](../../models/listsamlconnectionsresponse.md)** +**[models.SAMLConnections](../../models/samlconnections.md)** ### Errors @@ -107,7 +102,7 @@ if res is not None: ### Response -**[models.SAMLConnection](../../models/samlconnection.md)** +**[models.SchemasSAMLConnection](../../models/schemassamlconnection.md)** ### Errors @@ -148,7 +143,7 @@ if res is not None: ### Response -**[models.SAMLConnection](../../models/samlconnection.md)** +**[models.SchemasSAMLConnection](../../models/schemassamlconnection.md)** ### Errors @@ -177,7 +172,7 @@ res = s.saml_connections.update(saml_connection_id="saml_conn_123_update", name= "email_address": "user@example.com", "first_name": "Jane", "last_name": "Doe", -}, active=True, sync_user_attributes=False, allow_subdomains=True, allow_idp_initiated=False) +}, active=True, sync_user_attributes=False, allow_subdomains=True, allow_idp_initiated=False, disable_additional_identifications=False) if res is not None: # handle response @@ -202,11 +197,12 @@ if res is not None: | `sync_user_attributes` | *OptionalNullable[bool]* | :heavy_minus_sign: | Controls whether to update the user's attributes in each sign-in | false | | `allow_subdomains` | *OptionalNullable[bool]* | :heavy_minus_sign: | Allow users with an email address subdomain to use this connection in order to authenticate | true | | `allow_idp_initiated` | *OptionalNullable[bool]* | :heavy_minus_sign: | Enable or deactivate IdP-initiated flows | false | +| `disable_additional_identifications` | *OptionalNullable[bool]* | :heavy_minus_sign: | Enable or deactivate additional identifications | | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response -**[models.SAMLConnection](../../models/samlconnection.md)** +**[models.SchemasSAMLConnection](../../models/schemassamlconnection.md)** ### Errors diff --git a/docs/sdks/sessions/README.md b/docs/sdks/sessions/README.md index fa49029..b59a108 100644 --- a/docs/sdks/sessions/README.md +++ b/docs/sdks/sessions/README.md @@ -3,6 +3,11 @@ ## Overview +The Session object is an abstraction over an HTTP session. +It models the period of information exchange between a user and the server. +Sessions are created when a user successfully goes through the sign in or sign up flows. + + ### Available Operations * [list](#list) - List all sessions diff --git a/docs/sdks/signups/README.md b/docs/sdks/signups/README.md index 6d9036a..a11f43b 100644 --- a/docs/sdks/signups/README.md +++ b/docs/sdks/signups/README.md @@ -22,7 +22,6 @@ s = Clerk( res = s.sign_ups.update(id="signup_1234567890abcdef", request_body={ - "custom_action": False, "external_id": "ext_id_7890abcdef123456", }) diff --git a/docs/sdks/templates/README.md b/docs/sdks/templates/README.md index 858a777..ed0e9d4 100644 --- a/docs/sdks/templates/README.md +++ b/docs/sdks/templates/README.md @@ -5,198 +5,14 @@ ### Available Operations -* [list](#list) - List all templates -* [get](#get) - Retrieve a template -* [upsert](#upsert) - Update a template for a given type and slug -* [revert](#revert) - Revert a template -* [preview](#preview) - Preview changes to a template -* [toggle_delivery](#toggle_delivery) - Toggle the delivery by Clerk for a template of a given type and slug +* [~~preview~~](#preview) - Preview changes to a template :warning: **Deprecated** -## list - -Returns a list of all templates. -The templates are returned sorted by position. - -### Example Usage - -```python -import clerk_backend_api -from clerk_backend_api import Clerk - -s = Clerk( - bearer_auth="", -) - - -res = s.templates.list(template_type=clerk_backend_api.TemplateType.EMAIL) - -if res is not None: - # handle response - pass - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `template_type` | [models.TemplateType](../../models/templatetype.md) | :heavy_check_mark: | The type of templates to list (email or SMS) | email | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | - -### Response - -**[List[models.Template]](../../models/.md)** - -### Errors - -| Error Object | Status Code | Content Type | -| ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 400,401,422 | application/json | -| models.SDKError | 4xx-5xx | */* | - - -## get - -Returns the details of a template - -### Example Usage - -```python -import clerk_backend_api -from clerk_backend_api import Clerk - -s = Clerk( - bearer_auth="", -) - - -res = s.templates.get(template_type=clerk_backend_api.PathParamTemplateType.EMAIL, slug="welcome-email") - -if res is not None: - # handle response - pass - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `template_type` | [models.PathParamTemplateType](../../models/pathparamtemplatetype.md) | :heavy_check_mark: | The type of templates to retrieve (email or SMS) | email | -| `slug` | *str* | :heavy_check_mark: | The slug (i.e. machine-friendly name) of the template to retrieve | welcome-email | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | - -### Response - -**[models.Template](../../models/template.md)** - -### Errors - -| Error Object | Status Code | Content Type | -| ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 400,401,404 | application/json | -| models.SDKError | 4xx-5xx | */* | - - -## upsert - -Updates the existing template of the given type and slug - -### Example Usage - -```python -import clerk_backend_api -from clerk_backend_api import Clerk - -s = Clerk( - bearer_auth="", -) - - -res = s.templates.upsert(template_type=clerk_backend_api.UpsertTemplatePathParamTemplateType.SMS, slug="verification-code", request_body={ - "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", -}) - -if res is not None: - # handle response - pass - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `template_type` | [models.UpsertTemplatePathParamTemplateType](../../models/upserttemplatepathparamtemplatetype.md) | :heavy_check_mark: | The type of template to update | sms | -| `slug` | *str* | :heavy_check_mark: | The slug of the template to update | verification-code | -| `request_body` | [Optional[models.UpsertTemplateRequestBody]](../../models/upserttemplaterequestbody.md) | :heavy_minus_sign: | N/A | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | - -### Response - -**[models.Template](../../models/template.md)** - -### Errors - -| Error Object | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| models.ClerkErrors | 400,401,402,403,404,422 | application/json | -| models.SDKError | 4xx-5xx | */* | - - -## revert - -Reverts an updated template to its default state - -### Example Usage - -```python -import clerk_backend_api -from clerk_backend_api import Clerk - -s = Clerk( - bearer_auth="", -) - - -res = s.templates.revert(template_type=clerk_backend_api.RevertTemplatePathParamTemplateType.EMAIL, slug="welcome-email") - -if res is not None: - # handle response - pass - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `template_type` | [models.RevertTemplatePathParamTemplateType](../../models/reverttemplatepathparamtemplatetype.md) | :heavy_check_mark: | The type of template to revert | email | -| `slug` | *str* | :heavy_check_mark: | The slug of the template to revert | welcome-email | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | - -### Response - -**[models.Template](../../models/template.md)** - -### Errors - -| Error Object | Status Code | Content Type | -| ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 400,401,402,404 | application/json | -| models.SDKError | 4xx-5xx | */* | - - -## preview +## ~~preview~~ Returns a preview of a template for a given template_type, slug and body +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + ### Example Usage ```python @@ -239,51 +55,3 @@ if res is not None: | ------------------ | ------------------ | ------------------ | | models.ClerkErrors | 400,401,404,422 | application/json | | models.SDKError | 4xx-5xx | */* | - - -## toggle_delivery - -Toggles the delivery by Clerk for a template of a given type and slug. -If disabled, Clerk will not deliver the resulting email or SMS. -The app developer will need to listen to the `email.created` or `sms.created` webhooks in order to handle delivery themselves. - -### Example Usage - -```python -import clerk_backend_api -from clerk_backend_api import Clerk - -s = Clerk( - bearer_auth="", -) - - -res = s.templates.toggle_delivery(template_type=clerk_backend_api.ToggleTemplateDeliveryPathParamTemplateType.EMAIL, slug="welcome-email", request_body={ - "delivered_by_clerk": True, -}) - -if res is not None: - # handle response - pass - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| `template_type` | [models.ToggleTemplateDeliveryPathParamTemplateType](../../models/toggletemplatedeliverypathparamtemplatetype.md) | :heavy_check_mark: | The type of template to toggle delivery for | email | -| `slug` | *str* | :heavy_check_mark: | The slug of the template for which to toggle delivery | welcome-email | -| `request_body` | [Optional[models.ToggleTemplateDeliveryRequestBody]](../../models/toggletemplatedeliveryrequestbody.md) | :heavy_minus_sign: | N/A | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | - -### Response - -**[models.Template](../../models/template.md)** - -### Errors - -| Error Object | Status Code | Content Type | -| ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 400,401,404 | application/json | -| models.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/users/README.md b/docs/sdks/users/README.md index 0909348..66d9267 100644 --- a/docs/sdks/users/README.md +++ b/docs/sdks/users/README.md @@ -3,6 +3,9 @@ ## Overview +The user object represents a user that has successfully signed up to your application. + + ### Available Operations * [list](#list) - List all users @@ -20,9 +23,16 @@ * [update_metadata](#update_metadata) - Merge and update a user's metadata * [get_o_auth_access_token](#get_o_auth_access_token) - Retrieve the OAuth access token of a user * [get_organization_memberships](#get_organization_memberships) - Retrieve all memberships for a user +* [get_organization_invitations](#get_organization_invitations) - Retrieve all invitations for a user * [verify_password](#verify_password) - Verify the password of a user * [verify_totp](#verify_totp) - Verify a TOTP or backup code for a user * [disable_mfa](#disable_mfa) - Disable a user's MFA methods +* [delete_backup_codes](#delete_backup_codes) - Disable all user's Backup codes +* [delete_passkey](#delete_passkey) - Delete a user passkey +* [delete_web3_wallet](#delete_web3_wallet) - Delete a user web3 wallet +* [create_totp](#create_totp) - Create a TOTP for a user +* [delete_totp](#delete_totp) - Delete all the user's TOTPs +* [delete_external_account](#delete_external_account) - Delete External Account ## list @@ -104,7 +114,6 @@ A rate limit rule of 20 requests per 10 seconds is applied to this endpoint. ### Example Usage ```python -import clerk_backend_api from clerk_backend_api import Clerk s = Clerk( @@ -118,10 +127,10 @@ res = s.users.create(external_id="ext-id-001", first_name="John", last_name="Doe "+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=clerk_backend_api.PasswordHasher.ARGON2I, skip_password_checks=False, skip_password_requirement=False, totp_secret="base32totpsecretkey", backup_codes=[ +], 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={}, private_metadata={}, unsafe_metadata={}, created_at="2023-03-15T07:15:20.902Z") +], public_metadata={}, private_metadata={}, unsafe_metadata={}, delete_self_enabled=False, legal_accepted_at="", skip_legal_checks=False, create_organization_enabled=False, create_organizations_limit=486589, created_at="2023-03-15T07:15:20.902Z") if res is not None: # handle response @@ -131,27 +140,32 @@ if res is not None: ### Parameters -| Parameter | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `external_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the user as used in your external systems or your previous authentication solution.
Must be unique across your instance. | ext-id-001 | -| `first_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The first name to assign to the user | John | -| `last_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The last name to assign to the user | Doe | -| `email_address` | List[*str*] | :heavy_minus_sign: | Email addresses to add to the user.
Must be unique across your instance.
The first email address will be set as the user's primary email address. | | -| `phone_number` | List[*str*] | :heavy_minus_sign: | Phone numbers to add to the user.
Must be unique across your instance.
The first phone number will be set as the user's primary phone number. | | -| `web3_wallet` | List[*str*] | :heavy_minus_sign: | Web3 wallets to add to the user.
Must be unique across your instance.
The first wallet will be set as the user's primary wallet. | | -| `username` | *OptionalNullable[str]* | :heavy_minus_sign: | The username to give to the user.
It must be unique across your instance. | johndoe123 | -| `password` | *OptionalNullable[str]* | :heavy_minus_sign: | The plaintext password to give the user.
Must be at least 8 characters long, and can not be in any list of hacked passwords. | Secure*Pass4 | -| `password_digest` | *Optional[str]* | :heavy_minus_sign: | In case you already have the password digests and not the passwords, you can use them for the newly created user via this property.
The digests should be generated with one of the supported algorithms.
The hashing algorithm can be specified using the `password_hasher` property. | $argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc | -| `password_hasher` | [Optional[models.PasswordHasher]](../../models/passwordhasher.md) | :heavy_minus_sign: | The hashing algorithm that was used to generate the password digest.
The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/),
[md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/),
[phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/),
[scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [sha256](https://en.wikipedia.org/wiki/SHA-2)
and the [argon2](https://argon2.online/) variants argon2i and argon2id.

If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support).

Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in.
Insecure schemes are marked with `(insecure)` in the list below.

Each of the supported hashers expects the incoming digest to be in a particular format. Specifically:

**bcrypt:** The digest should be of the following form:

`$$$`

**bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django):

`bcrypt_sha256$$$$`

**md5** (insecure): The digest should follow the regular form e.g.:

`5f4dcc3b5aa765d61d8327deb882cf99`

**pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows:

`pbkdf2_sha256$$$`

Note: Both the salt and the hash are expected to be base64-encoded.

**pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows:

`pbkdf2_sha512$$$`

_iterations:_ The number of iterations used. Must be an integer less than 420000.
_salt:_ The salt used when generating the hash. Must be less than 1024 bytes.
_hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes.

**pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django):

`pbkdf2_sha256$$$`

Note: The salt is expected to be un-encoded, the hash is expected base64-encoded.

**pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences:
1. uses sha1 instead of sha256
2. accepts the hash as a hex-encoded string

The format is the following:

`pbkdf2_sha1$$$`

**phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections:

The format is the following:

`$P$`

- $P$ is the prefix used to identify phpass hashes.
- rounds is a single character encoding a 6-bit integer representing the number of rounds used.
- salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt.
- checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5.

**scrypt_firebase:** The Firebase-specific variant of scrypt.
The value is expected to have 6 segments separated by the $ character and include the following information:

_hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase.
_salt:_ The salt used to generate the above hash. Again, this is given when exporting the user.
_signer key:_ The base64 encoded signer key.
_salt separator:_ The base64 encoded salt separator.
_rounds:_ The number of rounds the algorithm needs to run.
_memory cost:_ The cost of the algorithm run

The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase.
The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters.

Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it:

`$$$$$`

**scrypt_werkzeug:** The Werkzeug-specific variant of scrypt.

The value is expected to have 3 segments separated by the $ character and include the following information:

_algorithm args:_ The algorithm used to generate the hash.
_salt:_ The salt used to generate the above hash.
_hash:_ The actual Base64 hash.

The algorithm args are the parameters used to generate the hash and are included in the digest.

**argon2i:** Algorithms in the argon2 family generate digests that encode the following information:

_version (v):_ The argon version, version 19 is assumed
_memory (m):_ The memory used by the algorithm (in kibibytes)
_iterations (t):_ The number of iterations to perform
_parallelism (p):_ The number of threads to use

Parts are demarcated by the `$` character, with the first part identifying the algorithm variant.
The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism).
The final part is the actual digest.

`$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc`

**argon2id:** See the previous algorithm for an explanation of the formatting.

For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`:

`$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU`

**sha256** (insecure): The digest should be a 64-length hex string, e.g.:

`9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08`

**sha256_salted** (insecure): The digest should be a 64-length hex string with a salt.

The format is the following:
`$`

The value is expected to have 2 segments separated by the $ character and include the following information:
_hash:_ The sha256 hash, a 64-length hex string.
_salt:_ The salt used to generate the above hash. Must be between 1 and 1024 bits. | argon2i | -| `skip_password_checks` | *Optional[bool]* | :heavy_minus_sign: | When set to `true` all password checks are skipped.
It is recommended to use this method only when migrating plaintext passwords to Clerk.
Upon migration the user base should be prompted to pick stronger password. | false | -| `skip_password_requirement` | *Optional[bool]* | :heavy_minus_sign: | When set to `true`, `password` is not required anymore when creating the user and can be omitted.
This is useful when you are trying to create a user that doesn't have a password, in an instance that is using passwords.
Please note that you cannot use this flag if password is the only way for a user to sign into your instance. | false | -| `totp_secret` | *Optional[str]* | :heavy_minus_sign: | In case TOTP is configured on the instance, you can provide the secret to enable it on the newly created user without the need to reset it.
Please note that currently the supported options are:
* Period: 30 seconds
* Code length: 6 digits
* Algorithm: SHA1 | base32totpsecretkey | -| `backup_codes` | List[*str*] | :heavy_minus_sign: | If Backup Codes are configured on the instance, you can provide them to enable it on the newly created user without the need to reset them.
You must provide the backup codes in plain format or the corresponding bcrypt digest. | [
"123456",
"654321"
] | -| `public_metadata` | [Optional[models.CreateUserPublicMetadata]](../../models/createuserpublicmetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that is visible to both your Frontend and Backend APIs | {
"role": "user"
} | -| `private_metadata` | [Optional[models.CreateUserPrivateMetadata]](../../models/createuserprivatemetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that is only visible to your Backend API | {
"internal_id": "789"
} | -| `unsafe_metadata` | [Optional[models.CreateUserUnsafeMetadata]](../../models/createuserunsafemetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that can be updated from both the Frontend and Backend APIs.
Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. | {
"preferences": {
"theme": "dark"
}
} | -| `created_at` | *Optional[str]* | :heavy_minus_sign: | A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). | 2023-03-15T07: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 | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `external_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the user as used in your external systems or your previous authentication solution.
Must be unique across your instance. | ext-id-001 | +| `first_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The first name to assign to the user | John | +| `last_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The last name to assign to the user | Doe | +| `email_address` | List[*str*] | :heavy_minus_sign: | Email addresses to add to the user.
Must be unique across your instance.
The first email address will be set as the user's primary email address. | | +| `phone_number` | List[*str*] | :heavy_minus_sign: | Phone numbers to add to the user.
Must be unique across your instance.
The first phone number will be set as the user's primary phone number. | | +| `web3_wallet` | List[*str*] | :heavy_minus_sign: | Web3 wallets to add to the user.
Must be unique across your instance.
The first wallet will be set as the user's primary wallet. | | +| `username` | *OptionalNullable[str]* | :heavy_minus_sign: | The username to give to the user.
It must be unique across your instance. | johndoe123 | +| `password` | *OptionalNullable[str]* | :heavy_minus_sign: | The plaintext password to give the user.
Must be at least 8 characters long, and can not be in any list of hacked passwords. | Secure*Pass4 | +| `password_digest` | *Optional[str]* | :heavy_minus_sign: | In case you already have the password digests and not the passwords, you can use them for the newly created user via this property.
The digests should be generated with one of the supported algorithms.
The hashing algorithm can be specified using the `password_hasher` property. | $argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc | +| `password_hasher` | *Optional[str]* | :heavy_minus_sign: | The hashing algorithm that was used to generate the password digest.

The algorithms we support at the moment are [`bcrypt`](https://en.wikipedia.org/wiki/Bcrypt), [`bcrypt_sha256_django`](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [`md5`](https://en.wikipedia.org/wiki/MD5), `pbkdf2_sha1`, `pbkdf2_sha256`, [`pbkdf2_sha256_django`](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/),
[`phpass`](https://www.openwall.com/phpass/), [`scrypt_firebase`](https://firebaseopensource.com/projects/firebase/scrypt/),
[`scrypt_werkzeug`](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [`sha256`](https://en.wikipedia.org/wiki/SHA-2),
and the [`argon2`](https://argon2.online/) variants: `argon2i` and `argon2id`.

Each of the supported hashers expects the incoming digest to be in a particular format. See the [Clerk docs](https://clerk.com/docs/references/backend/user/create-user) for more information. | | +| `skip_password_checks` | *Optional[bool]* | :heavy_minus_sign: | When set to `true` all password checks are skipped.
It is recommended to use this method only when migrating plaintext passwords to Clerk.
Upon migration the user base should be prompted to pick stronger password. | false | +| `skip_password_requirement` | *Optional[bool]* | :heavy_minus_sign: | When set to `true`, `password` is not required anymore when creating the user and can be omitted.
This is useful when you are trying to create a user that doesn't have a password, in an instance that is using passwords.
Please note that you cannot use this flag if password is the only way for a user to sign into your instance. | false | +| `totp_secret` | *Optional[str]* | :heavy_minus_sign: | In case TOTP is configured on the instance, you can provide the secret to enable it on the newly created user without the need to reset it.
Please note that currently the supported options are:
* Period: 30 seconds
* Code length: 6 digits
* Algorithm: SHA1 | base32totpsecretkey | +| `backup_codes` | List[*str*] | :heavy_minus_sign: | If Backup Codes are configured on the instance, you can provide them to enable it on the newly created user without the need to reset them.
You must provide the backup codes in plain format or the corresponding bcrypt digest. | [
"123456",
"654321"
] | +| `public_metadata` | [Optional[models.CreateUserPublicMetadata]](../../models/createuserpublicmetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that is visible to both your Frontend and Backend APIs | {
"role": "user"
} | +| `private_metadata` | [Optional[models.CreateUserPrivateMetadata]](../../models/createuserprivatemetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that is only visible to your Backend API | {
"internal_id": "789"
} | +| `unsafe_metadata` | [Optional[models.CreateUserUnsafeMetadata]](../../models/createuserunsafemetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that can be updated from both the Frontend and Backend APIs.
Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. | {
"preferences": {
"theme": "dark"
}
} | +| `delete_self_enabled` | *OptionalNullable[bool]* | :heavy_minus_sign: | If enabled, user can delete themselves via FAPI.
| | +| `legal_accepted_at` | *OptionalNullable[str]* | :heavy_minus_sign: | A custom timestamp denoting _when_ the user accepted legal requirements, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). | | +| `skip_legal_checks` | *OptionalNullable[bool]* | :heavy_minus_sign: | When set to `true` all legal checks are skipped.
It is not recommended to skip legal checks unless you are migrating a user to Clerk. | | +| `create_organization_enabled` | *OptionalNullable[bool]* | :heavy_minus_sign: | If enabled, user can create organizations via FAPI.
| | +| `create_organizations_limit` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of organizations the user can create. 0 means unlimited.
| | +| `created_at` | *Optional[str]* | :heavy_minus_sign: | A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). | 2023-03-15T07:15:20.902Z | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -283,7 +297,6 @@ You can also choose to sign the user out of all their active sessions on any dev ### Example Usage ```python -import clerk_backend_api from clerk_backend_api import Clerk s = Clerk( @@ -291,10 +304,10 @@ s = Clerk( ) -res = s.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=clerk_backend_api.UpdateUserPasswordHasher.ARGON2I, skip_password_checks=False, sign_out_of_other_sessions=True, totp_secret="ABCD1234EFGH5678", backup_codes=[ +res = s.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={}, private_metadata={}, unsafe_metadata={}, delete_self_enabled=True, create_organization_enabled=False, created_at="2021-04-05T14:30:00.000Z") +], public_metadata={}, private_metadata={}, unsafe_metadata={}, delete_self_enabled=True, create_organization_enabled=False, legal_accepted_at="", skip_legal_checks=False, create_organizations_limit=857478, created_at="2021-04-05T14:30:00.000Z") if res is not None: # handle response @@ -304,32 +317,35 @@ if res is not None: ### Parameters -| Parameter | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `user_id` | *str* | :heavy_check_mark: | The ID of the user to update | usr_1 | -| `external_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the user as used in your external systems or your previous authentication solution.
Must be unique across your instance. | ext_123 | -| `first_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The first name to assign to the user | Jane | -| `last_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The last name to assign to the user | Doe | -| `primary_email_address_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the email address to set as primary.
It must be verified, and present on the current user. | eml_12345 | -| `notify_primary_email_address_changed` | *Optional[bool]* | :heavy_minus_sign: | If set to `true`, the user will be notified that their primary email address has changed.
By default, no notification is sent. | true | -| `primary_phone_number_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the phone number to set as primary.
It must be verified, and present on the current user. | phn_67890 | -| `primary_web3_wallet_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the web3 wallets to set as primary.
It must be verified, and present on the current user. | wlt_123 | -| `username` | *OptionalNullable[str]* | :heavy_minus_sign: | The username to give to the user.
It must be unique across your instance. | janedoe | -| `profile_image_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the image to set as the user's profile image | img_789 | -| `password` | *OptionalNullable[str]* | :heavy_minus_sign: | The plaintext password to give the user.
Must be at least 8 characters long, and can not be in any list of hacked passwords. | secretPass123! | -| `password_digest` | *Optional[str]* | :heavy_minus_sign: | In case you already have the password digests and not the passwords, you can use them for the newly created user via this property.
The digests should be generated with one of the supported algorithms.
The hashing algorithm can be specified using the `password_hasher` property. | $argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc | -| `password_hasher` | [Optional[models.UpdateUserPasswordHasher]](../../models/updateuserpasswordhasher.md) | :heavy_minus_sign: | The hashing algorithm that was used to generate the password digest.
The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/),
[md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/),
[phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/),
[sha256](https://en.wikipedia.org/wiki/SHA-2), [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash)
and the [argon2](https://argon2.online/) variants argon2i and argon2id.

If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support).

Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in.
Insecure schemes are marked with `(insecure)` in the list below.

Each of the supported hashers expects the incoming digest to be in a particular format. Specifically:

**bcrypt:** The digest should be of the following form:

`$$$`

**bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django):

`bcrypt_sha256$$$$`

**md5** (insecure): The digest should follow the regular form e.g.:

`5f4dcc3b5aa765d61d8327deb882cf99`

**pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows:

`pbkdf2_sha256$$$`

Note: Both the salt and the hash are expected to be base64-encoded.

**pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows:

`pbkdf2_sha512$$$`

_iterations:_ The number of iterations used. Must be an integer less than 420000.
_salt:_ The salt used when generating the hash. Must be less than bytes.
_hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes.

**pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django):

`pbkdf2_sha256$$$`

Note: The salt is expected to be un-encoded, the hash is expected base64-encoded.

**pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences:
1. uses sha1 instead of sha256
2. accepts the hash as a hex-encoded string

The format is the following:

`pbkdf2_sha1$$$`

**phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections:

The format is the following:

`$P$`

- $P$ is the prefix used to identify phpass hashes.
- rounds is a single character encoding a 6-bit integer representing the number of rounds used.
- salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt.
- checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5.

**scrypt_firebase:** The Firebase-specific variant of scrypt.
The value is expected to have 6 segments separated by the $ character and include the following information:

_hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase.
_salt:_ The salt used to generate the above hash. Again, this is given when exporting the user.
_signer key:_ The base64 encoded signer key.
_salt separator:_ The base64 encoded salt separator.
_rounds:_ The number of rounds the algorithm needs to run.
_memory cost:_ The cost of the algorithm run

The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase.
The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters.

Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it:

`$$$$$`

**scrypt_werkzeug:** The Werkzeug-specific variant of scrypt.

The value is expected to have 3 segments separated by the $ character and include the following information:

_algorithm args:_ The algorithm used to generate the hash.
_salt:_ The salt used to generate the above hash.
_hash:_ The actual Base64 hash.

The algorithm args are the parameters used to generate the hash and are included in the digest.

**argon2i:** Algorithms in the argon2 family generate digests that encode the following information:

_version (v):_ The argon version, version 19 is assumed
_memory (m):_ The memory used by the algorithm (in kibibytes)
_iterations (t):_ The number of iterations to perform
_parallelism (p):_ The number of threads to use

Parts are demarcated by the `$` character, with the first part identifying the algorithm variant.
The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism).
The final part is the actual digest.

`$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc`

**argon2id:** See the previous algorithm for an explanation of the formatting.

For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`:

`$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU`

**sha256** (insecure): The digest should be a 64-length hex string, e.g.:

`9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` | argon2i | -| `skip_password_checks` | *OptionalNullable[bool]* | :heavy_minus_sign: | Set it to `true` if you're updating the user's password and want to skip any password policy settings check. This parameter can only be used when providing a `password`. | false | -| `sign_out_of_other_sessions` | *OptionalNullable[bool]* | :heavy_minus_sign: | Set to `true` to sign out the user from all their active sessions once their password is updated. This parameter can only be used when providing a `password`. | true | -| `totp_secret` | *Optional[str]* | :heavy_minus_sign: | In case TOTP is configured on the instance, you can provide the secret to enable it on the specific user without the need to reset it.
Please note that currently the supported options are:
* Period: 30 seconds
* Code length: 6 digits
* Algorithm: SHA1 | ABCD1234EFGH5678 | -| `backup_codes` | List[*str*] | :heavy_minus_sign: | If Backup Codes are configured on the instance, you can provide them to enable it on the specific user without the need to reset them.
You must provide the backup codes in plain format or the corresponding bcrypt digest. | [
"123456",
"654321"
] | -| `public_metadata` | [Optional[models.UpdateUserPublicMetadata]](../../models/updateuserpublicmetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that is visible to both your Frontend and Backend APIs | {
"theme": "dark"
} | -| `private_metadata` | [Optional[models.UpdateUserPrivateMetadata]](../../models/updateuserprivatemetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that is only visible to your Backend API | {
"vip": true
} | -| `unsafe_metadata` | [Optional[models.UpdateUserUnsafeMetadata]](../../models/updateuserunsafemetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that can be updated from both the Frontend and Backend APIs.
Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. | {
"age": 30
} | -| `delete_self_enabled` | *OptionalNullable[bool]* | :heavy_minus_sign: | If true, the user can delete themselves with the Frontend API. | true | -| `create_organization_enabled` | *OptionalNullable[bool]* | :heavy_minus_sign: | If true, the user can create organizations with the Frontend API. | false | -| `created_at` | *Optional[str]* | :heavy_minus_sign: | A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). | 2021-04-05T14:30:00.000Z | -| `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 | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `user_id` | *str* | :heavy_check_mark: | The ID of the user to update | usr_1 | +| `external_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the user as used in your external systems or your previous authentication solution.
Must be unique across your instance. | ext_123 | +| `first_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The first name to assign to the user | Jane | +| `last_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The last name to assign to the user | Doe | +| `primary_email_address_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the email address to set as primary.
It must be verified, and present on the current user. | eml_12345 | +| `notify_primary_email_address_changed` | *Optional[bool]* | :heavy_minus_sign: | If set to `true`, the user will be notified that their primary email address has changed.
By default, no notification is sent. | true | +| `primary_phone_number_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the phone number to set as primary.
It must be verified, and present on the current user. | phn_67890 | +| `primary_web3_wallet_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the web3 wallets to set as primary.
It must be verified, and present on the current user. | wlt_123 | +| `username` | *OptionalNullable[str]* | :heavy_minus_sign: | The username to give to the user.
It must be unique across your instance. | janedoe | +| `profile_image_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the image to set as the user's profile image | img_789 | +| `password` | *OptionalNullable[str]* | :heavy_minus_sign: | The plaintext password to give the user.
Must be at least 8 characters long, and can not be in any list of hacked passwords. | secretPass123! | +| `password_digest` | *Optional[str]* | :heavy_minus_sign: | In case you already have the password digests and not the passwords, you can use them for the newly created user via this property.
The digests should be generated with one of the supported algorithms.
The hashing algorithm can be specified using the `password_hasher` property. | $argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc | +| `password_hasher` | *Optional[str]* | :heavy_minus_sign: | The hashing algorithm that was used to generate the password digest.

The algorithms we support at the moment are [`bcrypt`](https://en.wikipedia.org/wiki/Bcrypt), [`bcrypt_sha256_django`](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [`md5`](https://en.wikipedia.org/wiki/MD5), `pbkdf2_sha1`, `pbkdf2_sha256`, [`pbkdf2_sha256_django`](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/),
[`phpass`](https://www.openwall.com/phpass/), [`scrypt_firebase`](https://firebaseopensource.com/projects/firebase/scrypt/),
[`scrypt_werkzeug`](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [`sha256`](https://en.wikipedia.org/wiki/SHA-2),
and the [`argon2`](https://argon2.online/) variants: `argon2i` and `argon2id`.

Each of the supported hashers expects the incoming digest to be in a particular format. See the [Clerk docs](https://clerk.com/docs/references/backend/user/create-user) for more information. | | +| `skip_password_checks` | *OptionalNullable[bool]* | :heavy_minus_sign: | Set it to `true` if you're updating the user's password and want to skip any password policy settings check. This parameter can only be used when providing a `password`. | false | +| `sign_out_of_other_sessions` | *OptionalNullable[bool]* | :heavy_minus_sign: | Set to `true` to sign out the user from all their active sessions once their password is updated. This parameter can only be used when providing a `password`. | true | +| `totp_secret` | *Optional[str]* | :heavy_minus_sign: | In case TOTP is configured on the instance, you can provide the secret to enable it on the specific user without the need to reset it.
Please note that currently the supported options are:
* Period: 30 seconds
* Code length: 6 digits
* Algorithm: SHA1 | ABCD1234EFGH5678 | +| `backup_codes` | List[*str*] | :heavy_minus_sign: | If Backup Codes are configured on the instance, you can provide them to enable it on the specific user without the need to reset them.
You must provide the backup codes in plain format or the corresponding bcrypt digest. | [
"123456",
"654321"
] | +| `public_metadata` | [Optional[models.UpdateUserPublicMetadata]](../../models/updateuserpublicmetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that is visible to both your Frontend and Backend APIs | {
"theme": "dark"
} | +| `private_metadata` | [Optional[models.UpdateUserPrivateMetadata]](../../models/updateuserprivatemetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that is only visible to your Backend API | {
"vip": true
} | +| `unsafe_metadata` | [Optional[models.UpdateUserUnsafeMetadata]](../../models/updateuserunsafemetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that can be updated from both the Frontend and Backend APIs.
Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. | {
"age": 30
} | +| `delete_self_enabled` | *OptionalNullable[bool]* | :heavy_minus_sign: | If true, the user can delete themselves with the Frontend API. | true | +| `create_organization_enabled` | *OptionalNullable[bool]* | :heavy_minus_sign: | If true, the user can create organizations with the Frontend API. | false | +| `legal_accepted_at` | *OptionalNullable[str]* | :heavy_minus_sign: | A custom timestamps denoting _when_ the user accepted legal requirements, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). | | +| `skip_legal_checks` | *OptionalNullable[bool]* | :heavy_minus_sign: | When set to `true` all legal checks are skipped.
It is not recommended to skip legal checks unless you are migrating a user to Clerk. | | +| `create_organizations_limit` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of organizations the user can create. 0 means unlimited. | | +| `created_at` | *Optional[str]* | :heavy_minus_sign: | A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). | 2021-04-05T14:30:00.000Z | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -661,8 +677,12 @@ res = s.users.update_metadata(user_id="user_123456789", request_body={ "public_metadata": { "key": "", }, - "private_metadata": {}, - "unsafe_metadata": {}, + "private_metadata": { + "key": "", + }, + "unsafe_metadata": { + "key": "", + }, }) if res is not None: @@ -730,7 +750,7 @@ if res is not None: | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | -| models.ClerkErrors | 422 | application/json | +| models.ClerkErrors | 400,422 | application/json | | models.SDKError | 4xx-5xx | */* | @@ -751,13 +771,8 @@ s = Clerk( res = s.users.get_organization_memberships(user_id="usr_1234567890", limit=20, offset=10) if res is not None: - while True: - # handle items - - res = res.Next() - if res is None: - break - + # handle response + pass ``` @@ -772,7 +787,7 @@ if res is not None: ### Response -**[models.UsersGetOrganizationMembershipsResponse](../../models/usersgetorganizationmembershipsresponse.md)** +**[models.OrganizationMemberships](../../models/organizationmemberships.md)** ### Errors @@ -782,6 +797,51 @@ if res is not None: | models.SDKError | 4xx-5xx | */* | +## get_organization_invitations + +Retrieve a paginated list of the user's organization invitations + +### Example Usage + +```python +import clerk_backend_api +from clerk_backend_api import Clerk + +s = Clerk( + bearer_auth="", +) + + +res = s.users.get_organization_invitations(user_id="", limit=20, offset=10, status=clerk_backend_api.UsersGetOrganizationInvitationsQueryParamStatus.PENDING) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `user_id` | *str* | :heavy_check_mark: | The ID of the user whose organization invitations we want to retrieve | | +| `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.UsersGetOrganizationInvitationsQueryParamStatus]](../../models/usersgetorganizationinvitationsqueryparamstatus.md) | :heavy_minus_sign: | Filter organization invitations based on their status | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.OrganizationInvitationsWithPublicOrganizationData](../../models/organizationinvitationswithpublicorganizationdata.md)** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 400,403,404 | application/json | +| models.SDKError | 4xx-5xx | */* | + + ## verify_password Check that the user's password matches the supplied input. @@ -913,3 +973,253 @@ if res is not None: | ------------------ | ------------------ | ------------------ | | models.ClerkErrors | 404,500 | application/json | | models.SDKError | 4xx-5xx | */* | + + +## delete_backup_codes + +Disable all of a user's backup codes. + +### Example Usage + +```python +from clerk_backend_api import Clerk + +s = Clerk( + bearer_auth="", +) + + +res = s.users.delete_backup_codes(user_id="") + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `user_id` | *str* | :heavy_check_mark: | The ID of the user whose backup codes are to be deleted. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.DeleteBackupCodeResponseBody](../../models/deletebackupcoderesponsebody.md)** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 404,500 | application/json | +| models.SDKError | 4xx-5xx | */* | + + +## delete_passkey + +Delete the passkey identification for a given user and notify them through email. + +### Example Usage + +```python +from clerk_backend_api import Clerk + +s = Clerk( + bearer_auth="", +) + + +res = s.users.delete_passkey(user_id="", passkey_identification_id="") + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `user_id` | *str* | :heavy_check_mark: | The ID of the user that owns the passkey identity | +| `passkey_identification_id` | *str* | :heavy_check_mark: | The ID of the passkey identity to be deleted | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.DeletedObject](../../models/deletedobject.md)** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 403,404,500 | application/json | +| models.SDKError | 4xx-5xx | */* | + + +## delete_web3_wallet + +Delete the web3 wallet identification for a given user. + +### Example Usage + +```python +from clerk_backend_api import Clerk + +s = Clerk( + bearer_auth="", +) + + +res = s.users.delete_web3_wallet(user_id="", web3_wallet_identification_id="") + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `user_id` | *str* | :heavy_check_mark: | The ID of the user that owns the web3 wallet | +| `web3_wallet_identification_id` | *str* | :heavy_check_mark: | The ID of the web3 wallet identity to be deleted | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.DeletedObject](../../models/deletedobject.md)** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 400,403,404,500 | application/json | +| models.SDKError | 4xx-5xx | */* | + + +## create_totp + +Creates a TOTP (Time-based One-Time Password) for a given user, returning both the TOTP secret and the URI. + + +### Example Usage + +```python +from clerk_backend_api import Clerk + +s = Clerk( + bearer_auth="", +) + + +res = s.users.create_totp(user_id="") + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `user_id` | *str* | :heavy_check_mark: | The ID of the user for whom the TOTP is being created. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.Totp](../../models/totp.md)** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 403,404,500 | application/json | +| models.SDKError | 4xx-5xx | */* | + + +## delete_totp + +Deletes all of the user's TOTPs. + +### Example Usage + +```python +from clerk_backend_api import Clerk + +s = Clerk( + bearer_auth="", +) + + +res = s.users.delete_totp(user_id="") + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `user_id` | *str* | :heavy_check_mark: | The ID of the user whose TOTPs are to be deleted | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.DeleteTOTPResponseBody](../../models/deletetotpresponsebody.md)** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 404,500 | application/json | +| models.SDKError | 4xx-5xx | */* | + + +## delete_external_account + +Delete an external account by ID. + +### Example Usage + +```python +from clerk_backend_api import Clerk + +s = Clerk( + bearer_auth="", +) + + +res = s.users.delete_external_account(user_id="", external_account_id="") + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `user_id` | *str* | :heavy_check_mark: | The ID of the user's external account | +| `external_account_id` | *str* | :heavy_check_mark: | The ID of the external account to delete | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.DeletedObject](../../models/deletedobject.md)** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| models.ClerkErrors | 400,403,404,500 | application/json | +| models.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/webhooks/README.md b/docs/sdks/webhooks/README.md index 4658298..21c3b7b 100644 --- a/docs/sdks/webhooks/README.md +++ b/docs/sdks/webhooks/README.md @@ -3,6 +3,9 @@ ## Overview +You can configure webhooks to be notified about various events that happen on your instance. + + ### Available Operations * [create_svix_app](#create_svix_app) - Create a Svix app diff --git a/poetry.lock b/poetry.lock index a02403a..bd47254 100644 --- a/poetry.lock +++ b/poetry.lock @@ -487,8 +487,8 @@ files = [ annotated-types = ">=0.4.0" pydantic-core = "2.20.1" typing-extensions = [ - {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, {version = ">=4.6.1", markers = "python_version < \"3.13\""}, + {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, ] [package.extras] @@ -627,8 +627,8 @@ files = [ astroid = ">=3.2.2,<=3.3.0-dev0" colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} dill = [ - {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, {version = ">=0.2", markers = "python_version < \"3.11\""}, + {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, {version = ">=0.3.6", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, ] isort = ">=4.2.5,<5.13.0 || >5.13.0,<6" diff --git a/pylintrc b/pylintrc index 5080038..94f4492 100644 --- a/pylintrc +++ b/pylintrc @@ -188,7 +188,8 @@ good-names=i, Run, _, e, - id + id, + n # 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 bd2fd28..3fc5e86 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "clerk-backend-api" -version = "0.5.0" +version = "1.0.0" description = "Python Client SDK for clerk.dev" authors = ["Clerk",] readme = "README-PYPI.md" diff --git a/src/clerk_backend_api/allowlistblocklist.py b/src/clerk_backend_api/allowlistblocklist.py new file mode 100644 index 0000000..c77ccdb --- /dev/null +++ b/src/clerk_backend_api/allowlistblocklist.py @@ -0,0 +1,624 @@ +"""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, List, Optional, Union, cast + +class AllowlistBlocklist(BaseSDK): + + + def list_allowlist_identifiers( + self, *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[List[models.AllowlistIdentifier]]: + r"""List all identifiers on the allow-list + + Get a list of all identifiers allowed to sign up to an 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 + """ + 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="/allowlist_identifiers", + 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", + 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="ListAllowlistIdentifiers", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["401","402","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.AllowlistIdentifier]]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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_allowlist_identifiers_async( + self, *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[List[models.AllowlistIdentifier]]: + r"""List all identifiers on the allow-list + + Get a list of all identifiers allowed to sign up to an 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 + """ + 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="/allowlist_identifiers", + 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", + 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="ListAllowlistIdentifiers", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["401","402","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.AllowlistIdentifier]]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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_allowlist_identifier( + self, *, + request: Optional[Union[models.CreateAllowlistIdentifierRequestBody, models.CreateAllowlistIdentifierRequestBodyTypedDict]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.AllowlistIdentifier]: + r"""Add identifier to the allow-list + + Create an identifier allowed to sign up to an instance + + :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 + """ + 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) and request is not None: + request = utils.unmarshal(request, models.CreateAllowlistIdentifierRequestBody) + request = cast(models.CreateAllowlistIdentifierRequestBody, request) + + req = self.build_request( + method="POST", + path="/allowlist_identifiers", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body(request, False, True, "json", Optional[models.CreateAllowlistIdentifierRequestBody]), + 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="CreateAllowlistIdentifier", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","402","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.AllowlistIdentifier]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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_allowlist_identifier_async( + self, *, + request: Optional[Union[models.CreateAllowlistIdentifierRequestBody, models.CreateAllowlistIdentifierRequestBodyTypedDict]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.AllowlistIdentifier]: + r"""Add identifier to the allow-list + + Create an identifier allowed to sign up to an instance + + :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 + """ + 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) and request is not None: + request = utils.unmarshal(request, models.CreateAllowlistIdentifierRequestBody) + request = cast(models.CreateAllowlistIdentifierRequestBody, request) + + req = self.build_request( + method="POST", + path="/allowlist_identifiers", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body(request, False, True, "json", Optional[models.CreateAllowlistIdentifierRequestBody]), + 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="CreateAllowlistIdentifier", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","402","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.AllowlistIdentifier]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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_blocklist_identifier( + self, *, + request: Optional[Union[models.CreateBlocklistIdentifierRequestBody, models.CreateBlocklistIdentifierRequestBodyTypedDict]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.BlocklistIdentifier]: + r"""Add identifier to the block-list + + Create an identifier that is blocked from accessing an instance + + :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 + """ + 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) and request is not None: + request = utils.unmarshal(request, models.CreateBlocklistIdentifierRequestBody) + request = cast(models.CreateBlocklistIdentifierRequestBody, request) + + req = self.build_request( + method="POST", + path="/blocklist_identifiers", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body(request, False, True, "json", Optional[models.CreateBlocklistIdentifierRequestBody]), + 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="CreateBlocklistIdentifier", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","402","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.BlocklistIdentifier]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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_blocklist_identifier_async( + self, *, + request: Optional[Union[models.CreateBlocklistIdentifierRequestBody, models.CreateBlocklistIdentifierRequestBodyTypedDict]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.BlocklistIdentifier]: + r"""Add identifier to the block-list + + Create an identifier that is blocked from accessing an instance + + :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 + """ + 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) and request is not None: + request = utils.unmarshal(request, models.CreateBlocklistIdentifierRequestBody) + request = cast(models.CreateBlocklistIdentifierRequestBody, request) + + req = self.build_request( + method="POST", + path="/blocklist_identifiers", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body(request, False, True, "json", Optional[models.CreateBlocklistIdentifierRequestBody]), + 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="CreateBlocklistIdentifier", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","402","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.BlocklistIdentifier]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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 delete_blocklist_identifier( + self, *, + identifier_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.DeletedObject]: + r"""Delete identifier from block-list + + Delete an identifier from the instance block-list + + :param identifier_id: The ID of the identifier to delete from the block-list + :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 + """ + 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.DeleteBlocklistIdentifierRequest( + identifier_id=identifier_id, + ) + + req = self.build_request( + method="DELETE", + path="/blocklist_identifiers/{identifier_id}", + 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", + 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="DeleteBlocklistIdentifier", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["402","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.DeletedObject]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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 delete_blocklist_identifier_async( + self, *, + identifier_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.DeletedObject]: + r"""Delete identifier from block-list + + Delete an identifier from the instance block-list + + :param identifier_id: The ID of the identifier to delete from the block-list + :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 + """ + 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.DeleteBlocklistIdentifierRequest( + identifier_id=identifier_id, + ) + + req = self.build_request( + method="DELETE", + path="/blocklist_identifiers/{identifier_id}", + 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", + 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="DeleteBlocklistIdentifier", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["402","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.DeletedObject]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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/allowlistidentifiers.py b/src/clerk_backend_api/allowlistidentifiers.py index 241bbc4..91d9095 100644 --- a/src/clerk_backend_api/allowlistidentifiers.py +++ b/src/clerk_backend_api/allowlistidentifiers.py @@ -3,312 +3,12 @@ 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, List, Optional, Union, cast +from clerk_backend_api.types import OptionalNullable, UNSET +from typing import Any, Optional class AllowlistIdentifiers(BaseSDK): - def list( - self, *, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - ) -> Optional[List[models.AllowlistIdentifier]]: - r"""List all identifiers on the allow-list - - Get a list of all identifiers allowed to sign up to an 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 - """ - 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="/allowlist_identifiers", - 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", - 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="ListAllowlistIdentifiers", oauth2_scopes=[], security_source=self.sdk_configuration.security), - request=req, - error_status_codes=["401","402","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.AllowlistIdentifier]]) - 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"], "*"): - raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) - - content_type = http_res.headers.get("Content-Type") - 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_async( - self, *, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - ) -> Optional[List[models.AllowlistIdentifier]]: - r"""List all identifiers on the allow-list - - Get a list of all identifiers allowed to sign up to an 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 - """ - 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="/allowlist_identifiers", - 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", - 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="ListAllowlistIdentifiers", oauth2_scopes=[], security_source=self.sdk_configuration.security), - request=req, - error_status_codes=["401","402","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.AllowlistIdentifier]]) - 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"], "*"): - raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) - - content_type = http_res.headers.get("Content-Type") - 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( - self, *, - request: Optional[Union[models.CreateAllowlistIdentifierRequestBody, models.CreateAllowlistIdentifierRequestBodyTypedDict]] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - ) -> Optional[models.AllowlistIdentifier]: - r"""Add identifier to the allow-list - - Create an identifier allowed to sign up to an instance - - :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 - """ - 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) and request is not None: - request = utils.unmarshal(request, models.CreateAllowlistIdentifierRequestBody) - request = cast(models.CreateAllowlistIdentifierRequestBody, request) - - req = self.build_request( - method="POST", - path="/allowlist_identifiers", - 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", - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body(request, False, True, "json", Optional[models.CreateAllowlistIdentifierRequestBody]), - 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="CreateAllowlistIdentifier", oauth2_scopes=[], security_source=self.sdk_configuration.security), - request=req, - error_status_codes=["400","402","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.AllowlistIdentifier]) - 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"], "*"): - raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) - - content_type = http_res.headers.get("Content-Type") - 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_async( - self, *, - request: Optional[Union[models.CreateAllowlistIdentifierRequestBody, models.CreateAllowlistIdentifierRequestBodyTypedDict]] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - ) -> Optional[models.AllowlistIdentifier]: - r"""Add identifier to the allow-list - - Create an identifier allowed to sign up to an instance - - :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 - """ - 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) and request is not None: - request = utils.unmarshal(request, models.CreateAllowlistIdentifierRequestBody) - request = cast(models.CreateAllowlistIdentifierRequestBody, request) - - req = self.build_request( - method="POST", - path="/allowlist_identifiers", - 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", - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body(request, False, True, "json", Optional[models.CreateAllowlistIdentifierRequestBody]), - 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="CreateAllowlistIdentifier", oauth2_scopes=[], security_source=self.sdk_configuration.security), - request=req, - error_status_codes=["400","402","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.AllowlistIdentifier]) - 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"], "*"): - raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) - - content_type = http_res.headers.get("Content-Type") - 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 delete( self, *, identifier_id: str, diff --git a/src/clerk_backend_api/betafeatures.py b/src/clerk_backend_api/betafeatures.py index 49c5758..9512cbc 100644 --- a/src/clerk_backend_api/betafeatures.py +++ b/src/clerk_backend_api/betafeatures.py @@ -10,7 +10,7 @@ class BetaFeatures(BaseSDK): - def update_instance_auth_config( + def update_instance_settings( self, *, request: Optional[Union[models.UpdateInstanceAuthConfigRequestBody, models.UpdateInstanceAuthConfigRequestBodyTypedDict]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -89,7 +89,7 @@ def update_instance_auth_config( - async def update_instance_auth_config_async( + async def update_instance_settings_async( self, *, request: Optional[Union[models.UpdateInstanceAuthConfigRequestBody, models.UpdateInstanceAuthConfigRequestBodyTypedDict]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -169,7 +169,7 @@ async def update_instance_auth_config_async( @deprecated("warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.") - def update_production_instance_domain( + def update_domain( self, *, request: Optional[Union[models.UpdateProductionInstanceDomainRequestBody, models.UpdateProductionInstanceDomainRequestBodyTypedDict]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -253,7 +253,7 @@ def update_production_instance_domain( @deprecated("warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.") - async def update_production_instance_domain_async( + async def update_domain_async( self, *, request: Optional[Union[models.UpdateProductionInstanceDomainRequestBody, models.UpdateProductionInstanceDomainRequestBodyTypedDict]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, diff --git a/src/clerk_backend_api/blocklistidentifiers_sdk.py b/src/clerk_backend_api/blocklistidentifiers_sdk.py index a0b6e66..13c328c 100644 --- a/src/clerk_backend_api/blocklistidentifiers_sdk.py +++ b/src/clerk_backend_api/blocklistidentifiers_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 BaseModel, OptionalNullable, UNSET -from typing import Any, Optional, Union, cast +from clerk_backend_api.types import OptionalNullable, UNSET +from typing import Any, Optional class BlocklistIdentifiersSDK(BaseSDK): @@ -150,317 +150,3 @@ async def list_async( 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( - self, *, - request: Optional[Union[models.CreateBlocklistIdentifierRequestBody, models.CreateBlocklistIdentifierRequestBodyTypedDict]] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - ) -> Optional[models.BlocklistIdentifier]: - r"""Add identifier to the block-list - - Create an identifier that is blocked from accessing an instance - - :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 - """ - 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) and request is not None: - request = utils.unmarshal(request, models.CreateBlocklistIdentifierRequestBody) - request = cast(models.CreateBlocklistIdentifierRequestBody, request) - - req = self.build_request( - method="POST", - path="/blocklist_identifiers", - 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", - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body(request, False, True, "json", Optional[models.CreateBlocklistIdentifierRequestBody]), - 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="CreateBlocklistIdentifier", oauth2_scopes=[], security_source=self.sdk_configuration.security), - request=req, - error_status_codes=["400","402","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.BlocklistIdentifier]) - 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"], "*"): - raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) - - content_type = http_res.headers.get("Content-Type") - 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_async( - self, *, - request: Optional[Union[models.CreateBlocklistIdentifierRequestBody, models.CreateBlocklistIdentifierRequestBodyTypedDict]] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - ) -> Optional[models.BlocklistIdentifier]: - r"""Add identifier to the block-list - - Create an identifier that is blocked from accessing an instance - - :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 - """ - 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) and request is not None: - request = utils.unmarshal(request, models.CreateBlocklistIdentifierRequestBody) - request = cast(models.CreateBlocklistIdentifierRequestBody, request) - - req = self.build_request( - method="POST", - path="/blocklist_identifiers", - 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", - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body(request, False, True, "json", Optional[models.CreateBlocklistIdentifierRequestBody]), - 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="CreateBlocklistIdentifier", oauth2_scopes=[], security_source=self.sdk_configuration.security), - request=req, - error_status_codes=["400","402","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.BlocklistIdentifier]) - 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"], "*"): - raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) - - content_type = http_res.headers.get("Content-Type") - 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 delete( - self, *, - identifier_id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - ) -> Optional[models.DeletedObject]: - r"""Delete identifier from block-list - - Delete an identifier from the instance block-list - - :param identifier_id: The ID of the identifier to delete from the block-list - :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 - """ - 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.DeleteBlocklistIdentifierRequest( - identifier_id=identifier_id, - ) - - req = self.build_request( - method="DELETE", - path="/blocklist_identifiers/{identifier_id}", - 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", - 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="DeleteBlocklistIdentifier", oauth2_scopes=[], security_source=self.sdk_configuration.security), - request=req, - error_status_codes=["402","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.DeletedObject]) - 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"], "*"): - raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) - - content_type = http_res.headers.get("Content-Type") - 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 delete_async( - self, *, - identifier_id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - ) -> Optional[models.DeletedObject]: - r"""Delete identifier from block-list - - Delete an identifier from the instance block-list - - :param identifier_id: The ID of the identifier to delete from the block-list - :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 - """ - 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.DeleteBlocklistIdentifierRequest( - identifier_id=identifier_id, - ) - - req = self.build_request( - method="DELETE", - path="/blocklist_identifiers/{identifier_id}", - 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", - 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="DeleteBlocklistIdentifier", oauth2_scopes=[], security_source=self.sdk_configuration.security), - request=req, - error_status_codes=["402","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.DeletedObject]) - 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"], "*"): - raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) - - content_type = http_res.headers.get("Content-Type") - 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/clerk_redirecturls.py b/src/clerk_backend_api/clerk_redirecturls.py new file mode 100644 index 0000000..def56ec --- /dev/null +++ b/src/clerk_backend_api/clerk_redirecturls.py @@ -0,0 +1,480 @@ +"""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, Optional, Union, cast + +class ClerkRedirectUrls(BaseSDK): + + + def create( + self, *, + request: Optional[Union[models.CreateRedirectURLRequestBody, models.CreateRedirectURLRequestBodyTypedDict]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.RedirectURL]: + r"""Create a redirect URL + + Create a redirect URL + + :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 + """ + 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) and request is not None: + request = utils.unmarshal(request, models.CreateRedirectURLRequestBody) + request = cast(models.CreateRedirectURLRequestBody, request) + + req = self.build_request( + method="POST", + path="/redirect_urls", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body(request, False, True, "json", Optional[models.CreateRedirectURLRequestBody]), + 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="CreateRedirectURL", 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.RedirectURL]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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_async( + self, *, + request: Optional[Union[models.CreateRedirectURLRequestBody, models.CreateRedirectURLRequestBodyTypedDict]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.RedirectURL]: + r"""Create a redirect URL + + Create a redirect URL + + :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 + """ + 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) and request is not None: + request = utils.unmarshal(request, models.CreateRedirectURLRequestBody) + request = cast(models.CreateRedirectURLRequestBody, request) + + req = self.build_request( + method="POST", + path="/redirect_urls", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body(request, False, True, "json", Optional[models.CreateRedirectURLRequestBody]), + 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="CreateRedirectURL", 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.RedirectURL]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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 get( + self, *, + id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.RedirectURL]: + r"""Retrieve a redirect URL + + Retrieve the details of the redirect URL with the given ID + + :param id: The ID of the redirect URL + :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 + """ + 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.GetRedirectURLRequest( + id=id, + ) + + req = self.build_request( + method="GET", + path="/redirect_urls/{id}", + 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", + 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="GetRedirectURL", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["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.RedirectURL]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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_async( + self, *, + id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.RedirectURL]: + r"""Retrieve a redirect URL + + Retrieve the details of the redirect URL with the given ID + + :param id: The ID of the redirect URL + :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 + """ + 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.GetRedirectURLRequest( + id=id, + ) + + req = self.build_request( + method="GET", + path="/redirect_urls/{id}", + 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", + 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="GetRedirectURL", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["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.RedirectURL]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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 delete( + self, *, + id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.DeletedObject]: + r"""Delete a redirect URL + + Remove the selected redirect URL from the whitelist of the instance + + :param id: The ID of the redirect URL + :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 + """ + 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.DeleteRedirectURLRequest( + id=id, + ) + + req = self.build_request( + method="DELETE", + path="/redirect_urls/{id}", + 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", + 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="DeleteRedirectURL", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["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.DeletedObject]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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 delete_async( + self, *, + id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.DeletedObject]: + r"""Delete a redirect URL + + Remove the selected redirect URL from the whitelist of the instance + + :param id: The ID of the redirect URL + :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 + """ + 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.DeleteRedirectURLRequest( + id=id, + ) + + req = self.build_request( + method="DELETE", + path="/redirect_urls/{id}", + 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", + 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="DeleteRedirectURL", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["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.DeletedObject]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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/clients.py b/src/clerk_backend_api/clients.py index a5babe1..bf54b1d 100644 --- a/src/clerk_backend_api/clients.py +++ b/src/clerk_backend_api/clients.py @@ -4,11 +4,13 @@ from clerk_backend_api import models, utils from clerk_backend_api._hooks import HookContext from clerk_backend_api.types import BaseModel, OptionalNullable, UNSET -from jsonpath import JSONPath -from typing import Any, Dict, List, Optional, Union, cast +from typing import Any, List, Optional, Union, cast from typing_extensions import deprecated class Clients(BaseSDK): + 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 + """ @deprecated("warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.") @@ -19,7 +21,7 @@ def list( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.GetClientListResponse: + ) -> Optional[List[models.Client]]: r"""List all clients Returns a list of all clients. The clients are returned sorted by creation date, @@ -81,29 +83,9 @@ def list( retry_config=retry_config ) - def next_func() -> Optional[models.GetClientListResponse]: - body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) - offset = request.offset if not request.offset is None else 0 - - if not http_res.text: - return None - results = JSONPath("$").parse(body) - if len(results) == 0 or len(results[0]) == 0: - return None - limit = request.limit if not request.limit is None else 0 - if len(results[0]) < limit: - return None - next_offset = offset + len(results[0]) - - return self.list( - limit=limit, - offset=next_offset, - retries=retries, - ) - data: Any = None if utils.match_response(http_res, "200", "application/json"): - return models.GetClientListResponse(result=utils.unmarshal_json(http_res.text, Optional[List[models.Client]]), next=next_func) + return utils.unmarshal_json(http_res.text, Optional[List[models.Client]]) if utils.match_response(http_res, ["400","401","410","422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) @@ -123,7 +105,7 @@ async def list_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.GetClientListResponse: + ) -> Optional[List[models.Client]]: r"""List all clients Returns a list of all clients. The clients are returned sorted by creation date, @@ -185,29 +167,9 @@ async def list_async( retry_config=retry_config ) - def next_func() -> Optional[models.GetClientListResponse]: - body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) - offset = request.offset if not request.offset is None else 0 - - if not http_res.text: - return None - results = JSONPath("$").parse(body) - if len(results) == 0 or len(results[0]) == 0: - return None - limit = request.limit if not request.limit is None else 0 - if len(results[0]) < limit: - return None - next_offset = offset + len(results[0]) - - return self.list( - limit=limit, - offset=next_offset, - retries=retries, - ) - data: Any = None if utils.match_response(http_res, "200", "application/json"): - return models.GetClientListResponse(result=utils.unmarshal_json(http_res.text, Optional[List[models.Client]]), next=next_func) + return utils.unmarshal_json(http_res.text, Optional[List[models.Client]]) if utils.match_response(http_res, ["400","401","410","422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) diff --git a/src/clerk_backend_api/domains_sdk.py b/src/clerk_backend_api/domains_sdk.py index 345ee27..d72e137 100644 --- a/src/clerk_backend_api/domains_sdk.py +++ b/src/clerk_backend_api/domains_sdk.py @@ -7,6 +7,7 @@ from typing import Any, Optional, Union, cast class DomainsSDK(BaseSDK): + r"""Domains represent each instance's URLs and DNS setup.""" def list( @@ -474,6 +475,7 @@ def update( domain_id: str, name: OptionalNullable[str] = UNSET, proxy_url: OptionalNullable[str] = UNSET, + is_secondary: OptionalNullable[bool] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -492,6 +494,7 @@ def update( :param domain_id: The ID of the domain that will be updated. :param name: The new domain name. For development instances, can contain the port, i.e `myhostname:3000`. For production instances, must be a valid FQDN, i.e `mysite.com`. Cannot contain protocol scheme. :param proxy_url: The full URL of the proxy that will forward requests to Clerk's Frontend API. Can only be updated for production instances. + :param is_secondary: Whether this is a domain for a secondary app, meaning that any subdomain provided is significant and will be stored as part of the domain. This is useful for supporting multiple apps (one primary and multiple secondaries) on the same root domain (eTLD+1). :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 @@ -509,6 +512,7 @@ def update( request_body=models.UpdateDomainRequestBody( name=name, proxy_url=proxy_url, + is_secondary=is_secondary, ), ) @@ -568,6 +572,7 @@ async def update_async( domain_id: str, name: OptionalNullable[str] = UNSET, proxy_url: OptionalNullable[str] = UNSET, + is_secondary: OptionalNullable[bool] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -586,6 +591,7 @@ async def update_async( :param domain_id: The ID of the domain that will be updated. :param name: The new domain name. For development instances, can contain the port, i.e `myhostname:3000`. For production instances, must be a valid FQDN, i.e `mysite.com`. Cannot contain protocol scheme. :param proxy_url: The full URL of the proxy that will forward requests to Clerk's Frontend API. Can only be updated for production instances. + :param is_secondary: Whether this is a domain for a secondary app, meaning that any subdomain provided is significant and will be stored as part of the domain. This is useful for supporting multiple apps (one primary and multiple secondaries) on the same root domain (eTLD+1). :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 @@ -603,6 +609,7 @@ async def update_async( request_body=models.UpdateDomainRequestBody( name=name, proxy_url=proxy_url, + is_secondary=is_secondary, ), ) diff --git a/src/clerk_backend_api/emailandsmstemplates.py b/src/clerk_backend_api/emailandsmstemplates.py new file mode 100644 index 0000000..772f3ec --- /dev/null +++ b/src/clerk_backend_api/emailandsmstemplates.py @@ -0,0 +1,183 @@ +"""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 OptionalNullable, UNSET +from typing import Any, Optional, Union +from typing_extensions import deprecated + +class EmailAndSmsTemplates(BaseSDK): + + + @deprecated("warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.") + def upsert( + self, *, + template_type: models.UpsertTemplatePathParamTemplateType, + slug: str, + request_body: Optional[Union[models.UpsertTemplateRequestBody, models.UpsertTemplateRequestBodyTypedDict]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.Template]: + r"""Update a template for a given type and slug + + Updates the existing template of the given type and slug + + :param template_type: The type of template to update + :param slug: The slug of the template to update + :param request_body: + :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 + """ + 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.UpsertTemplateRequest( + template_type=template_type, + slug=slug, + request_body=utils.get_pydantic_model(request_body, Optional[models.UpsertTemplateRequestBody]), + ) + + req = self.build_request( + method="PUT", + path="/templates/{template_type}/{slug}", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body(request.request_body, False, True, "json", Optional[models.UpsertTemplateRequestBody]), + 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="UpsertTemplate", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","401","402","403","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.Template]) + if utils.match_response(http_res, ["400","401","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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + raise models.SDKError(f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, http_res.text, http_res) + + + + @deprecated("warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.") + async def upsert_async( + self, *, + template_type: models.UpsertTemplatePathParamTemplateType, + slug: str, + request_body: Optional[Union[models.UpsertTemplateRequestBody, models.UpsertTemplateRequestBodyTypedDict]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.Template]: + r"""Update a template for a given type and slug + + Updates the existing template of the given type and slug + + :param template_type: The type of template to update + :param slug: The slug of the template to update + :param request_body: + :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 + """ + 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.UpsertTemplateRequest( + template_type=template_type, + slug=slug, + request_body=utils.get_pydantic_model(request_body, Optional[models.UpsertTemplateRequestBody]), + ) + + req = self.build_request( + method="PUT", + path="/templates/{template_type}/{slug}", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body(request.request_body, False, True, "json", Optional[models.UpsertTemplateRequestBody]), + 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="UpsertTemplate", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","401","402","403","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.Template]) + if utils.match_response(http_res, ["400","401","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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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/emailsmstemplates.py b/src/clerk_backend_api/emailsmstemplates.py new file mode 100644 index 0000000..bf2844f --- /dev/null +++ b/src/clerk_backend_api/emailsmstemplates.py @@ -0,0 +1,351 @@ +"""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 OptionalNullable, UNSET +from typing import Any, Optional, Union +from typing_extensions import deprecated + +class EmailSMSTemplates(BaseSDK): + + + @deprecated("warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.") + def get( + self, *, + template_type: models.PathParamTemplateType, + slug: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.Template]: + r"""Retrieve a template + + Returns the details of a template + + :param template_type: The type of templates to retrieve (email or SMS) + :param slug: The slug (i.e. machine-friendly name) of the template to retrieve + :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 + """ + 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.GetTemplateRequest( + template_type=template_type, + slug=slug, + ) + + req = self.build_request( + method="GET", + path="/templates/{template_type}/{slug}", + 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", + 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="GetTemplate", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","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.Template]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + raise models.SDKError(f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, http_res.text, http_res) + + + + @deprecated("warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.") + async def get_async( + self, *, + template_type: models.PathParamTemplateType, + slug: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.Template]: + r"""Retrieve a template + + Returns the details of a template + + :param template_type: The type of templates to retrieve (email or SMS) + :param slug: The slug (i.e. machine-friendly name) of the template to retrieve + :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 + """ + 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.GetTemplateRequest( + template_type=template_type, + slug=slug, + ) + + req = self.build_request( + method="GET", + path="/templates/{template_type}/{slug}", + 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", + 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="GetTemplate", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","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.Template]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + raise models.SDKError(f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, http_res.text, http_res) + + + + @deprecated("warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.") + def toggle_template_delivery( + self, *, + template_type: models.ToggleTemplateDeliveryPathParamTemplateType, + slug: str, + request_body: Optional[Union[models.ToggleTemplateDeliveryRequestBody, models.ToggleTemplateDeliveryRequestBodyTypedDict]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.Template]: + r"""Toggle the delivery by Clerk for a template of a given type and slug + + Toggles the delivery by Clerk for a template of a given type and slug. + If disabled, Clerk will not deliver the resulting email or SMS. + The app developer will need to listen to the `email.created` or `sms.created` webhooks in order to handle delivery themselves. + + :param template_type: The type of template to toggle delivery for + :param slug: The slug of the template for which to toggle delivery + :param request_body: + :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 + """ + 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.ToggleTemplateDeliveryRequest( + template_type=template_type, + slug=slug, + request_body=utils.get_pydantic_model(request_body, Optional[models.ToggleTemplateDeliveryRequestBody]), + ) + + req = self.build_request( + method="POST", + path="/templates/{template_type}/{slug}/toggle_delivery", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body(request.request_body, False, True, "json", Optional[models.ToggleTemplateDeliveryRequestBody]), + 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="ToggleTemplateDelivery", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","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.Template]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + raise models.SDKError(f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, http_res.text, http_res) + + + + @deprecated("warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.") + async def toggle_template_delivery_async( + self, *, + template_type: models.ToggleTemplateDeliveryPathParamTemplateType, + slug: str, + request_body: Optional[Union[models.ToggleTemplateDeliveryRequestBody, models.ToggleTemplateDeliveryRequestBodyTypedDict]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.Template]: + r"""Toggle the delivery by Clerk for a template of a given type and slug + + Toggles the delivery by Clerk for a template of a given type and slug. + If disabled, Clerk will not deliver the resulting email or SMS. + The app developer will need to listen to the `email.created` or `sms.created` webhooks in order to handle delivery themselves. + + :param template_type: The type of template to toggle delivery for + :param slug: The slug of the template for which to toggle delivery + :param request_body: + :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 + """ + 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.ToggleTemplateDeliveryRequest( + template_type=template_type, + slug=slug, + request_body=utils.get_pydantic_model(request_body, Optional[models.ToggleTemplateDeliveryRequestBody]), + ) + + req = self.build_request( + method="POST", + path="/templates/{template_type}/{slug}/toggle_delivery", + 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", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body(request.request_body, False, True, "json", Optional[models.ToggleTemplateDeliveryRequestBody]), + 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="ToggleTemplateDelivery", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","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.Template]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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/invitations.py b/src/clerk_backend_api/invitations.py index 3bfae12..3431c9f 100644 --- a/src/clerk_backend_api/invitations.py +++ b/src/clerk_backend_api/invitations.py @@ -4,10 +4,12 @@ from clerk_backend_api import models, utils from clerk_backend_api._hooks import HookContext from clerk_backend_api.types import BaseModel, OptionalNullable, UNSET -from jsonpath import JSONPath -from typing import Any, Dict, List, Optional, Union, cast +from typing import Any, List, Optional, Union, cast class Invitations(BaseSDK): + r"""Invitations allow you to invite someone to sign up to your application, via email. + https://clerk.com/docs/authentication/invitations + """ def create( @@ -180,7 +182,7 @@ def list( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.ListInvitationsResponse: + ) -> Optional[List[models.Invitation]]: r"""List all invitations Returns all non-revoked invitations for your application, sorted by creation date @@ -242,29 +244,8 @@ def list( retry_config=retry_config ) - def next_func() -> Optional[models.ListInvitationsResponse]: - body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) - offset = request.offset if not request.offset is None else 0 - - if not http_res.text: - return None - results = JSONPath("$").parse(body) - if len(results) == 0 or len(results[0]) == 0: - return None - limit = request.limit if not request.limit is None else 0 - if len(results[0]) < limit: - return None - next_offset = offset + len(results[0]) - - return self.list( - limit=limit, - offset=next_offset, - status=status, - retries=retries, - ) - if utils.match_response(http_res, "200", "application/json"): - return models.ListInvitationsResponse(result=utils.unmarshal_json(http_res.text, Optional[List[models.Invitation]]), next=next_func) + return utils.unmarshal_json(http_res.text, Optional[List[models.Invitation]]) if utils.match_response(http_res, ["4XX","5XX"], "*"): raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) @@ -281,7 +262,7 @@ async def list_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.ListInvitationsResponse: + ) -> Optional[List[models.Invitation]]: r"""List all invitations Returns all non-revoked invitations for your application, sorted by creation date @@ -343,29 +324,8 @@ async def list_async( retry_config=retry_config ) - def next_func() -> Optional[models.ListInvitationsResponse]: - body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) - offset = request.offset if not request.offset is None else 0 - - if not http_res.text: - return None - results = JSONPath("$").parse(body) - if len(results) == 0 or len(results[0]) == 0: - return None - limit = request.limit if not request.limit is None else 0 - if len(results[0]) < limit: - return None - next_offset = offset + len(results[0]) - - return self.list( - limit=limit, - offset=next_offset, - status=status, - retries=retries, - ) - if utils.match_response(http_res, "200", "application/json"): - return models.ListInvitationsResponse(result=utils.unmarshal_json(http_res.text, Optional[List[models.Invitation]]), next=next_func) + return utils.unmarshal_json(http_res.text, Optional[List[models.Invitation]]) if utils.match_response(http_res, ["4XX","5XX"], "*"): 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.py index f476dfd..f4fa37a 100644 --- a/src/clerk_backend_api/jwks.py +++ b/src/clerk_backend_api/jwks.py @@ -14,7 +14,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ): + ) -> Optional[models.WellKnownJWKS]: r"""Retrieve the JSON Web Key Set of the instance Retrieve the JSON Web Key Set of the instance @@ -40,7 +40,7 @@ def get( request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", - accept_header_value="*/*", + accept_header_value="application/json", security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -66,8 +66,8 @@ def get( retry_config=retry_config ) - if utils.match_response(http_res, "200", "*"): - return + 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"], "*"): raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) @@ -81,7 +81,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ): + ) -> Optional[models.WellKnownJWKS]: r"""Retrieve the JSON Web Key Set of the instance Retrieve the JSON Web Key Set of the instance @@ -107,7 +107,7 @@ async def get_async( request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", - accept_header_value="*/*", + accept_header_value="application/json", security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -133,8 +133,8 @@ async def get_async( retry_config=retry_config ) - if utils.match_response(http_res, "200", "*"): - return + 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"], "*"): raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) diff --git a/src/clerk_backend_api/misc.py b/src/clerk_backend_api/miscellaneous.py similarity index 97% rename from src/clerk_backend_api/misc.py rename to src/clerk_backend_api/miscellaneous.py index d685326..0119e22 100644 --- a/src/clerk_backend_api/misc.py +++ b/src/clerk_backend_api/miscellaneous.py @@ -6,10 +6,11 @@ from clerk_backend_api.types import OptionalNullable, UNSET from typing import Optional -class Misc(BaseSDK): +class Miscellaneous(BaseSDK): + r"""Various endpoints that do not belong in any particular category.""" - def get_public_interstitial( + def get_interstitial( self, *, frontend_api: Optional[str] = None, publishable_key: Optional[str] = None, @@ -86,7 +87,7 @@ def get_public_interstitial( - async def get_public_interstitial_async( + async def get_interstitial_async( self, *, frontend_api: Optional[str] = None, publishable_key: Optional[str] = None, diff --git a/src/clerk_backend_api/models/__init__.py b/src/clerk_backend_api/models/__init__.py index dad739f..fbe3e73 100644 --- a/src/clerk_backend_api/models/__init__.py +++ b/src/clerk_backend_api/models/__init__.py @@ -11,13 +11,14 @@ from .clerkerrors import ClerkErrors, ClerkErrorsData, ClerkErrorsMeta, ClerkErrorsMetaTypedDict from .client import Client, ClientTypedDict, Object from .cnametarget import CNameTarget, CNameTargetTypedDict -from .createactortokenop import CreateActorTokenRequestBody, CreateActorTokenRequestBodyTypedDict +from .createactortokenop import CreateActorTokenActor, CreateActorTokenActorTypedDict, CreateActorTokenRequestBody, CreateActorTokenRequestBodyTypedDict from .createallowlistidentifierop import CreateAllowlistIdentifierRequestBody, CreateAllowlistIdentifierRequestBodyTypedDict from .createblocklistidentifierop import CreateBlocklistIdentifierRequestBody, CreateBlocklistIdentifierRequestBodyTypedDict from .createemailaddressop import CreateEmailAddressRequestBody, CreateEmailAddressRequestBodyTypedDict from .createinvitationop import CreateInvitationPublicMetadata, CreateInvitationPublicMetadataTypedDict, CreateInvitationRequestBody, CreateInvitationRequestBodyTypedDict from .createjwttemplateop import CreateJWTTemplateClaims, CreateJWTTemplateClaimsTypedDict, CreateJWTTemplateRequestBody, CreateJWTTemplateRequestBodyTypedDict from .createoauthapplicationop import CreateOAuthApplicationRequestBody, CreateOAuthApplicationRequestBodyTypedDict +from .createorganizationdomainop import CreateOrganizationDomainRequest, CreateOrganizationDomainRequestBody, CreateOrganizationDomainRequestBodyTypedDict, CreateOrganizationDomainRequestTypedDict from .createorganizationinvitationbulkop import CreateOrganizationInvitationBulkPrivateMetadata, CreateOrganizationInvitationBulkPrivateMetadataTypedDict, CreateOrganizationInvitationBulkPublicMetadata, CreateOrganizationInvitationBulkPublicMetadataTypedDict, CreateOrganizationInvitationBulkRequest, CreateOrganizationInvitationBulkRequestTypedDict, RequestBody, RequestBodyTypedDict from .createorganizationinvitationop import CreateOrganizationInvitationPrivateMetadata, CreateOrganizationInvitationPrivateMetadataTypedDict, CreateOrganizationInvitationPublicMetadata, CreateOrganizationInvitationPublicMetadataTypedDict, CreateOrganizationInvitationRequest, CreateOrganizationInvitationRequestBody, CreateOrganizationInvitationRequestBodyTypedDict, CreateOrganizationInvitationRequestTypedDict from .createorganizationmembershipop import CreateOrganizationMembershipRequest, CreateOrganizationMembershipRequestBody, CreateOrganizationMembershipRequestBodyTypedDict, CreateOrganizationMembershipRequestTypedDict @@ -27,27 +28,32 @@ from .createsamlconnectionop import CreateSAMLConnectionAttributeMapping, CreateSAMLConnectionAttributeMappingTypedDict, CreateSAMLConnectionRequestBody, CreateSAMLConnectionRequestBodyTypedDict, Provider from .createsessiontokenfromtemplateop import CreateSessionTokenFromTemplateObject, CreateSessionTokenFromTemplateRequest, CreateSessionTokenFromTemplateRequestTypedDict, CreateSessionTokenFromTemplateResponseBody, CreateSessionTokenFromTemplateResponseBodyTypedDict from .createsignintokenop import CreateSignInTokenRequestBody, CreateSignInTokenRequestBodyTypedDict -from .createuserop import CreateUserPrivateMetadata, CreateUserPrivateMetadataTypedDict, CreateUserPublicMetadata, CreateUserPublicMetadataTypedDict, CreateUserRequestBody, CreateUserRequestBodyTypedDict, CreateUserUnsafeMetadata, CreateUserUnsafeMetadataTypedDict, PasswordHasher +from .createuserop import CreateUserPrivateMetadata, CreateUserPrivateMetadataTypedDict, CreateUserPublicMetadata, CreateUserPublicMetadataTypedDict, CreateUserRequestBody, CreateUserRequestBodyTypedDict, CreateUserUnsafeMetadata, CreateUserUnsafeMetadataTypedDict +from .createusertotpop import CreateUserTOTPRequest, CreateUserTOTPRequestTypedDict from .deleteallowlistidentifierop import DeleteAllowlistIdentifierRequest, DeleteAllowlistIdentifierRequestTypedDict +from .deletebackupcodeop import DeleteBackupCodeRequest, DeleteBackupCodeRequestTypedDict, DeleteBackupCodeResponseBody, DeleteBackupCodeResponseBodyTypedDict from .deleteblocklistidentifierop import DeleteBlocklistIdentifierRequest, DeleteBlocklistIdentifierRequestTypedDict from .deletedobject import DeletedObject, DeletedObjectTypedDict from .deletedomainop import DeleteDomainRequest, DeleteDomainRequestTypedDict from .deleteemailaddressop import DeleteEmailAddressRequest, DeleteEmailAddressRequestTypedDict +from .deleteexternalaccountop import DeleteExternalAccountRequest, DeleteExternalAccountRequestTypedDict from .deletejwttemplateop import DeleteJWTTemplateRequest, DeleteJWTTemplateRequestTypedDict from .deleteoauthapplicationop import DeleteOAuthApplicationRequest, DeleteOAuthApplicationRequestTypedDict +from .deleteorganizationdomainop import DeleteOrganizationDomainRequest, DeleteOrganizationDomainRequestTypedDict from .deleteorganizationlogoop import DeleteOrganizationLogoRequest, DeleteOrganizationLogoRequestTypedDict from .deleteorganizationmembershipop import DeleteOrganizationMembershipRequest, DeleteOrganizationMembershipRequestTypedDict from .deleteorganizationop import DeleteOrganizationRequest, DeleteOrganizationRequestTypedDict from .deletephonenumberop import DeletePhoneNumberRequest, DeletePhoneNumberRequestTypedDict from .deleteredirecturlop import DeleteRedirectURLRequest, DeleteRedirectURLRequestTypedDict from .deletesamlconnectionop import DeleteSAMLConnectionRequest, DeleteSAMLConnectionRequestTypedDict +from .deletetotpop import DeleteTOTPRequest, DeleteTOTPRequestTypedDict, DeleteTOTPResponseBody, DeleteTOTPResponseBodyTypedDict from .deleteuserop import DeleteUserRequest, DeleteUserRequestTypedDict from .deleteuserprofileimageop import DeleteUserProfileImageRequest, DeleteUserProfileImageRequestTypedDict from .disablemfaop import DisableMFARequest, DisableMFARequestTypedDict, DisableMFAResponseBody, DisableMFAResponseBodyTypedDict from .domain import Domain, DomainObject, DomainTypedDict from .domains import Domains, DomainsTypedDict from .emailaddress import Admin, AdminTypedDict, AdminVerificationStatus, EmailAddress, EmailAddressObject, EmailAddressTypedDict, Error, ErrorClerkError, ErrorClerkErrorTypedDict, ErrorMeta, ErrorMetaTypedDict, ErrorTypedDict, Oauth, OauthTypedDict, OauthVerificationStatus, OauthVerificationStrategy, Otp, OtpTypedDict, Strategy, Verification, VerificationStatus, VerificationStrategy, VerificationTypedDict -from .getclientlistop import GetClientListRequest, GetClientListRequestTypedDict, GetClientListResponse, GetClientListResponseTypedDict +from .getclientlistop import GetClientListRequest, GetClientListRequestTypedDict from .getclientop import GetClientRequest, GetClientRequestTypedDict from .getemailaddressop import GetEmailAddressRequest, GetEmailAddressRequestTypedDict from .getjwttemplateop import GetJWTTemplateRequest, GetJWTTemplateRequestTypedDict @@ -61,32 +67,38 @@ from .getsamlconnectionop import GetSAMLConnectionRequest, GetSAMLConnectionRequestTypedDict from .getsessionlistop import GetSessionListRequest, GetSessionListRequestTypedDict, QueryParamStatus from .getsessionop import GetSessionRequest, GetSessionRequestTypedDict -from .gettemplatelistop import GetTemplateListRequest, GetTemplateListRequestTypedDict, TemplateType from .gettemplateop import GetTemplateRequest, GetTemplateRequestTypedDict, PathParamTemplateType from .getuserlistop import GetUserListRequest, GetUserListRequestTypedDict from .getuserop import GetUserRequest, GetUserRequestTypedDict from .getuserscountop import GetUsersCountRequest, GetUsersCountRequestTypedDict from .identificationlink import IdentificationLink, IdentificationLinkTypedDict, Type +from .instancegetorganizationmembershipsop import InstanceGetOrganizationMembershipsRequest, InstanceGetOrganizationMembershipsRequestTypedDict from .instancerestrictions import InstanceRestrictions, InstanceRestrictionsObject, InstanceRestrictionsTypedDict from .instancesettings import InstanceSettings, InstanceSettingsObject, InstanceSettingsTypedDict from .invitation import Invitation, InvitationObject, InvitationPublicMetadata, InvitationPublicMetadataTypedDict, InvitationStatus, InvitationTypedDict from .invitation_revoked import InvitationRevoked, InvitationRevokedObject, InvitationRevokedPublicMetadata, InvitationRevokedPublicMetadataTypedDict, InvitationRevokedStatus, InvitationRevokedTypedDict from .jwttemplate import Claims, ClaimsTypedDict, JWTTemplate, JWTTemplateObject, JWTTemplateTypedDict -from .listinvitationsop import ListInvitationsQueryParamStatus, ListInvitationsRequest, ListInvitationsRequestTypedDict, ListInvitationsResponse, ListInvitationsResponseTypedDict -from .listoauthapplicationsop import ListOAuthApplicationsRequest, ListOAuthApplicationsRequestTypedDict, ListOAuthApplicationsResponse, ListOAuthApplicationsResponseTypedDict -from .listorganizationinvitationsop import ListOrganizationInvitationsQueryParamStatus, ListOrganizationInvitationsRequest, ListOrganizationInvitationsRequestTypedDict, ListOrganizationInvitationsResponse, ListOrganizationInvitationsResponseTypedDict -from .listorganizationmembershipsop import ListOrganizationMembershipsRequest, ListOrganizationMembershipsRequestTypedDict, ListOrganizationMembershipsResponse, ListOrganizationMembershipsResponseTypedDict +from .listinstanceorganizationinvitationsop import ListInstanceOrganizationInvitationsQueryParamStatus, ListInstanceOrganizationInvitationsRequest, ListInstanceOrganizationInvitationsRequestTypedDict +from .listinvitationsop import ListInvitationsQueryParamStatus, ListInvitationsRequest, ListInvitationsRequestTypedDict +from .listoauthapplicationsop import ListOAuthApplicationsRequest, ListOAuthApplicationsRequestTypedDict +from .listorganizationdomainsop import ListOrganizationDomainsRequest, ListOrganizationDomainsRequestTypedDict +from .listorganizationinvitationsop import ListOrganizationInvitationsQueryParamStatus, ListOrganizationInvitationsRequest, ListOrganizationInvitationsRequestTypedDict +from .listorganizationmembershipsop import ListOrganizationMembershipsRequest, ListOrganizationMembershipsRequestTypedDict from .listorganizationsop import ListOrganizationsRequest, ListOrganizationsRequestTypedDict -from .listpendingorganizationinvitationsop import ListPendingOrganizationInvitationsRequest, ListPendingOrganizationInvitationsRequestTypedDict, ListPendingOrganizationInvitationsResponse, ListPendingOrganizationInvitationsResponseTypedDict -from .listsamlconnectionsop import ListSAMLConnectionsRequest, ListSAMLConnectionsRequestTypedDict, ListSAMLConnectionsResponse, ListSAMLConnectionsResponseTypedDict +from .listpendingorganizationinvitationsop import ListPendingOrganizationInvitationsRequest, ListPendingOrganizationInvitationsRequestTypedDict +from .listsamlconnectionsop import ListSAMLConnectionsRequest, ListSAMLConnectionsRequestTypedDict from .lockuserop import LockUserRequest, LockUserRequestTypedDict from .mergeorganizationmetadataop import MergeOrganizationMetadataPrivateMetadata, MergeOrganizationMetadataPrivateMetadataTypedDict, MergeOrganizationMetadataPublicMetadata, MergeOrganizationMetadataPublicMetadataTypedDict, MergeOrganizationMetadataRequest, MergeOrganizationMetadataRequestBody, MergeOrganizationMetadataRequestBodyTypedDict, MergeOrganizationMetadataRequestTypedDict from .oauthapplication import OAuthApplication, OAuthApplicationObject, OAuthApplicationTypedDict from .oauthapplications import OAuthApplications, OAuthApplicationsTypedDict from .oauthapplicationwithsecret import OAuthApplicationWithSecret, OAuthApplicationWithSecretObject, OAuthApplicationWithSecretTypedDict from .organization import Organization, OrganizationObject, OrganizationPrivateMetadata, OrganizationPrivateMetadataTypedDict, OrganizationPublicMetadata, OrganizationPublicMetadataTypedDict, OrganizationTypedDict +from .organizationdomain import EnrollmentMode, OrganizationDomain, OrganizationDomainObject, OrganizationDomainStatus, OrganizationDomainTypedDict, OrganizationDomainVerification, OrganizationDomainVerificationTypedDict +from .organizationdomains import OrganizationDomains, OrganizationDomainsTypedDict from .organizationinvitation import OrganizationInvitation, OrganizationInvitationObject, OrganizationInvitationPrivateMetadata, OrganizationInvitationPrivateMetadataTypedDict, OrganizationInvitationPublicMetadata, OrganizationInvitationPublicMetadataTypedDict, OrganizationInvitationTypedDict from .organizationinvitations import OrganizationInvitations, OrganizationInvitationsTypedDict +from .organizationinvitationswithpublicorganizationdata import OrganizationInvitationsWithPublicOrganizationData, OrganizationInvitationsWithPublicOrganizationDataTypedDict +from .organizationinvitationwithpublicorganizationdata import OrganizationInvitationWithPublicOrganizationData, OrganizationInvitationWithPublicOrganizationDataObject, OrganizationInvitationWithPublicOrganizationDataPrivateMetadata, OrganizationInvitationWithPublicOrganizationDataPrivateMetadataTypedDict, OrganizationInvitationWithPublicOrganizationDataPublicMetadata, OrganizationInvitationWithPublicOrganizationDataPublicMetadataTypedDict, OrganizationInvitationWithPublicOrganizationDataTypedDict, PublicOrganizationData, PublicOrganizationDataTypedDict from .organizationmembership import OrganizationMembership, OrganizationMembershipObject, OrganizationMembershipOrganization, OrganizationMembershipOrganizationObject, OrganizationMembershipOrganizationPrivateMetadata, OrganizationMembershipOrganizationPrivateMetadataTypedDict, OrganizationMembershipOrganizationPublicMetadata, OrganizationMembershipOrganizationPublicMetadataTypedDict, OrganizationMembershipOrganizationTypedDict, OrganizationMembershipPrivateMetadata, OrganizationMembershipPrivateMetadataTypedDict, OrganizationMembershipPublicMetadata, OrganizationMembershipPublicMetadataTypedDict, OrganizationMembershipTypedDict, PublicUserData, PublicUserDataTypedDict from .organizationmemberships import OrganizationMemberships, OrganizationMembershipsTypedDict from .organizations import Organizations, OrganizationsTypedDict @@ -96,20 +108,19 @@ from .previewtemplateop import PreviewTemplateRequest, PreviewTemplateRequestBody, PreviewTemplateRequestBodyTypedDict, PreviewTemplateRequestTypedDict, PreviewTemplateResponseBody, PreviewTemplateResponseBodyTypedDict from .proxycheck import ProxyCheck, ProxyCheckObject, ProxyCheckTypedDict from .redirecturl import RedirectURL, RedirectURLObject, RedirectURLTypedDict -from .reverttemplateop import RevertTemplatePathParamTemplateType, RevertTemplateRequest, RevertTemplateRequestTypedDict from .revokeactortokenop import RevokeActorTokenRequest, RevokeActorTokenRequestTypedDict from .revokeinvitationop import RevokeInvitationRequest, RevokeInvitationRequestTypedDict from .revokeorganizationinvitationop import RevokeOrganizationInvitationRequest, RevokeOrganizationInvitationRequestBody, RevokeOrganizationInvitationRequestBodyTypedDict, RevokeOrganizationInvitationRequestTypedDict from .revokesessionop import RevokeSessionRequest, RevokeSessionRequestTypedDict from .revokesignintokenop import RevokeSignInTokenRequest, RevokeSignInTokenRequestTypedDict from .rotateoauthapplicationsecretop import RotateOAuthApplicationSecretRequest, RotateOAuthApplicationSecretRequestTypedDict -from .samlaccount import ClerkErrorErrorMeta, ClerkErrorErrorMetaTypedDict, SAMLAccount, SAMLAccountObject, SAMLAccountPublicMetadata, SAMLAccountPublicMetadataTypedDict, SAMLAccountTypedDict, SAMLAccountVerification, SAMLAccountVerificationTypedDict, SAMLErrorClerkError, SAMLErrorClerkErrorTypedDict, SAMLVerificationStatus, SAMLVerificationStrategy, Saml, SamlTypedDict, Ticket, TicketTypedDict, TicketVerificationStatus, TicketVerificationStrategy, VerificationError, VerificationErrorTypedDict -from .samlconnection import AttributeMapping, AttributeMappingTypedDict, SAMLConnection, SAMLConnectionObject, SAMLConnectionTypedDict +from .samlaccount import ClerkErrorErrorMeta, ClerkErrorErrorMetaTypedDict, SAMLAccount, SAMLAccountObject, SAMLAccountPublicMetadata, SAMLAccountPublicMetadataTypedDict, SAMLAccountTypedDict, SAMLAccountVerification, SAMLAccountVerificationTypedDict, SAMLConnectionSAMLConnection, SAMLConnectionSAMLConnectionTypedDict, SAMLErrorClerkError, SAMLErrorClerkErrorTypedDict, SAMLVerificationStatus, SAMLVerificationStrategy, Saml, SamlConnection, SamlConnectionTypedDict, SamlTypedDict, Ticket, TicketTypedDict, TicketVerificationStatus, TicketVerificationStrategy, VerificationError, VerificationErrorTypedDict from .samlconnections import SAMLConnections, SAMLConnectionsTypedDict -from .schemas_passkey import Passkey, PasskeyTypedDict, PasskeyVerificationStatus, PasskeyVerificationStrategy, SchemasPasskey, SchemasPasskeyObject, SchemasPasskeyTypedDict, SchemasPasskeyVerification, SchemasPasskeyVerificationTypedDict, VerificationNonce +from .schemas_passkey import Nonce, Passkey, PasskeyTypedDict, PasskeyVerificationStatus, PasskeyVerificationStrategy, SchemasPasskey, SchemasPasskeyObject, SchemasPasskeyTypedDict, SchemasPasskeyVerification, SchemasPasskeyVerificationTypedDict +from .schemas_samlconnection import AttributeMapping, AttributeMappingTypedDict, SchemasSAMLConnection, SchemasSAMLConnectionObject, SchemasSAMLConnectionTypedDict from .sdkerror import SDKError from .security import Security, SecurityTypedDict -from .session import Actor, ActorTypedDict, Session, SessionObject, SessionTypedDict, Status +from .session import Actor, ActorTypedDict, LatestActivity, LatestActivityTypedDict, Session, SessionObject, SessionTypedDict, Status from .setuserprofileimageop import File, FileTypedDict, SetUserProfileImageRequest, SetUserProfileImageRequestBody, SetUserProfileImageRequestBodyTypedDict, SetUserProfileImageRequestTypedDict from .signintoken import SignInToken, SignInTokenObject, SignInTokenStatus, SignInTokenTypedDict from .signup import ExternalAccount, ExternalAccountTypedDict, SignUp, SignUpObject, SignUpPublicMetadata, SignUpPublicMetadataTypedDict, SignUpStatus, SignUpTypedDict, SignUpUnsafeMetadata, SignUpUnsafeMetadataTypedDict, Verifications, VerificationsTypedDict @@ -118,6 +129,7 @@ from .testingtoken import TestingToken, TestingTokenObject, TestingTokenTypedDict from .toggletemplatedeliveryop import ToggleTemplateDeliveryPathParamTemplateType, ToggleTemplateDeliveryRequest, ToggleTemplateDeliveryRequestBody, ToggleTemplateDeliveryRequestBodyTypedDict, ToggleTemplateDeliveryRequestTypedDict from .totalcount import TotalCount, TotalCountObject, TotalCountTypedDict +from .totp import Totp, TotpTypedDict from .unbanuserop import UnbanUserRequest, UnbanUserRequestTypedDict from .unlockuserop import UnlockUserRequest, UnlockUserRequestTypedDict from .updatedomainop import UpdateDomainRequest, UpdateDomainRequestBody, UpdateDomainRequestBodyTypedDict, UpdateDomainRequestTypedDict @@ -128,6 +140,7 @@ from .updateinstancerestrictionsop import UpdateInstanceRestrictionsRequestBody, UpdateInstanceRestrictionsRequestBodyTypedDict from .updatejwttemplateop import UpdateJWTTemplateClaims, UpdateJWTTemplateClaimsTypedDict, UpdateJWTTemplateRequest, UpdateJWTTemplateRequestBody, UpdateJWTTemplateRequestBodyTypedDict, UpdateJWTTemplateRequestTypedDict from .updateoauthapplicationop import UpdateOAuthApplicationRequest, UpdateOAuthApplicationRequestBody, UpdateOAuthApplicationRequestBodyTypedDict, UpdateOAuthApplicationRequestTypedDict +from .updateorganizationdomainop import UpdateOrganizationDomainRequest, UpdateOrganizationDomainRequestBody, UpdateOrganizationDomainRequestBodyTypedDict, UpdateOrganizationDomainRequestTypedDict from .updateorganizationmembershipmetadataop import UpdateOrganizationMembershipMetadataPrivateMetadata, UpdateOrganizationMembershipMetadataPrivateMetadataTypedDict, UpdateOrganizationMembershipMetadataPublicMetadata, UpdateOrganizationMembershipMetadataPublicMetadataTypedDict, UpdateOrganizationMembershipMetadataRequest, UpdateOrganizationMembershipMetadataRequestBody, UpdateOrganizationMembershipMetadataRequestBodyTypedDict, UpdateOrganizationMembershipMetadataRequestTypedDict from .updateorganizationmembershipop import UpdateOrganizationMembershipRequest, UpdateOrganizationMembershipRequestBody, UpdateOrganizationMembershipRequestBodyTypedDict, UpdateOrganizationMembershipRequestTypedDict from .updateorganizationop import UpdateOrganizationPrivateMetadata, UpdateOrganizationPrivateMetadataTypedDict, UpdateOrganizationPublicMetadata, UpdateOrganizationPublicMetadataTypedDict, UpdateOrganizationRequest, UpdateOrganizationRequestBody, UpdateOrganizationRequestBodyTypedDict, UpdateOrganizationRequestTypedDict @@ -135,17 +148,21 @@ from .updateproductioninstancedomainop import UpdateProductionInstanceDomainRequestBody, UpdateProductionInstanceDomainRequestBodyTypedDict from .updatesamlconnectionop import UpdateSAMLConnectionAttributeMapping, UpdateSAMLConnectionAttributeMappingTypedDict, UpdateSAMLConnectionRequest, UpdateSAMLConnectionRequestBody, UpdateSAMLConnectionRequestBodyTypedDict, UpdateSAMLConnectionRequestTypedDict from .updatesignupop import UpdateSignUpRequest, UpdateSignUpRequestBody, UpdateSignUpRequestBodyTypedDict, UpdateSignUpRequestTypedDict -from .updateusermetadataop import UpdateUserMetadataPrivateMetadata, UpdateUserMetadataPrivateMetadataTypedDict, UpdateUserMetadataRequest, UpdateUserMetadataRequestBody, UpdateUserMetadataRequestBodyTypedDict, UpdateUserMetadataRequestTypedDict, UpdateUserMetadataUnsafeMetadata, UpdateUserMetadataUnsafeMetadataTypedDict -from .updateuserop import UpdateUserPasswordHasher, UpdateUserPrivateMetadata, UpdateUserPrivateMetadataTypedDict, UpdateUserPublicMetadata, UpdateUserPublicMetadataTypedDict, UpdateUserRequest, UpdateUserRequestBody, UpdateUserRequestBodyTypedDict, UpdateUserRequestTypedDict, UpdateUserUnsafeMetadata, UpdateUserUnsafeMetadataTypedDict +from .updateusermetadataop import UpdateUserMetadataRequest, UpdateUserMetadataRequestBody, UpdateUserMetadataRequestBodyTypedDict, UpdateUserMetadataRequestTypedDict +from .updateuserop import UpdateUserPrivateMetadata, UpdateUserPrivateMetadataTypedDict, UpdateUserPublicMetadata, UpdateUserPublicMetadataTypedDict, UpdateUserRequest, UpdateUserRequestBody, UpdateUserRequestBodyTypedDict, UpdateUserRequestTypedDict, UpdateUserUnsafeMetadata, UpdateUserUnsafeMetadataTypedDict from .uploadorganizationlogoop import UploadOrganizationLogoFile, UploadOrganizationLogoFileTypedDict, UploadOrganizationLogoRequest, UploadOrganizationLogoRequestBody, UploadOrganizationLogoRequestBodyTypedDict, UploadOrganizationLogoRequestTypedDict from .upserttemplateop import UpsertTemplatePathParamTemplateType, UpsertTemplateRequest, UpsertTemplateRequestBody, UpsertTemplateRequestBodyTypedDict, UpsertTemplateRequestTypedDict from .user import ExternalAccounts, ExternalAccountsTypedDict, PrivateMetadata, PrivateMetadataTypedDict, PublicMetadata, PublicMetadataTypedDict, UnsafeMetadata, UnsafeMetadataTypedDict, User, UserObject, UserTypedDict -from .usersgetorganizationmembershipsop import UsersGetOrganizationMembershipsRequest, UsersGetOrganizationMembershipsRequestTypedDict, UsersGetOrganizationMembershipsResponse, UsersGetOrganizationMembershipsResponseTypedDict +from .userpasskeydeleteop import UserPasskeyDeleteRequest, UserPasskeyDeleteRequestTypedDict +from .usersgetorganizationinvitationsop import UsersGetOrganizationInvitationsQueryParamStatus, UsersGetOrganizationInvitationsRequest, UsersGetOrganizationInvitationsRequestTypedDict +from .usersgetorganizationmembershipsop import UsersGetOrganizationMembershipsRequest, UsersGetOrganizationMembershipsRequestTypedDict +from .userweb3walletdeleteop import UserWeb3WalletDeleteRequest, UserWeb3WalletDeleteRequestTypedDict from .verifyclientop import VerifyClientRequestBody, VerifyClientRequestBodyTypedDict from .verifydomainproxyop import VerifyDomainProxyRequestBody, VerifyDomainProxyRequestBodyTypedDict from .verifypasswordop import VerifyPasswordRequest, VerifyPasswordRequestBody, VerifyPasswordRequestBodyTypedDict, VerifyPasswordRequestTypedDict, VerifyPasswordResponseBody, VerifyPasswordResponseBodyTypedDict from .verifysessionop import VerifySessionRequest, VerifySessionRequestBody, VerifySessionRequestBodyTypedDict, VerifySessionRequestTypedDict from .verifytotpop import CodeType, VerifyTOTPRequest, VerifyTOTPRequestBody, VerifyTOTPRequestBodyTypedDict, VerifyTOTPRequestTypedDict, VerifyTOTPResponseBody, VerifyTOTPResponseBodyTypedDict -from .web3wallet import AdminVerificationWeb3WalletStatus, AdminVerificationWeb3WalletStrategy, Nonce, Web3Signature, Web3SignatureTypedDict, Web3SignatureVerificationStatus, Web3SignatureVerificationStrategy, Web3Wallet, Web3WalletObject, Web3WalletTypedDict, Web3WalletVerification, Web3WalletVerificationAdmin, Web3WalletVerificationAdminTypedDict, Web3WalletVerificationTypedDict +from .web3wallet import AdminVerificationWeb3WalletStatus, AdminVerificationWeb3WalletStrategy, Web3Signature, Web3SignatureTypedDict, Web3SignatureVerificationStatus, Web3SignatureVerificationStrategy, Web3Wallet, Web3WalletObject, Web3WalletTypedDict, Web3WalletVerification, Web3WalletVerificationAdmin, Web3WalletVerificationAdminTypedDict, Web3WalletVerificationTypedDict +from .wellknown_jwks import Keys, KeysTypedDict, WellKnownJWKS, WellKnownJWKSTypedDict -__all__ = ["Actor", "ActorToken", "ActorTokenActor", "ActorTokenActorTypedDict", "ActorTokenObject", "ActorTokenStatus", "ActorTokenTypedDict", "ActorTypedDict", "AddDomainRequestBody", "AddDomainRequestBodyTypedDict", "Admin", "AdminTypedDict", "AdminVerificationPhoneNumberStatus", "AdminVerificationStatus", "AdminVerificationStrategy", "AdminVerificationWeb3WalletStatus", "AdminVerificationWeb3WalletStrategy", "AllowlistIdentifier", "AllowlistIdentifierObject", "AllowlistIdentifierTypedDict", "AttributeMapping", "AttributeMappingTypedDict", "BanUserRequest", "BanUserRequestTypedDict", "BlocklistIdentifier", "BlocklistIdentifierIdentifierType", "BlocklistIdentifierObject", "BlocklistIdentifierTypedDict", "BlocklistIdentifiers", "BlocklistIdentifiersTypedDict", "CNameTarget", "CNameTargetTypedDict", "ChangeProductionInstanceDomainRequestBody", "ChangeProductionInstanceDomainRequestBodyTypedDict", "Claims", "ClaimsTypedDict", "ClerkError", "ClerkErrorErrorMeta", "ClerkErrorErrorMetaTypedDict", "ClerkErrorTypedDict", "ClerkErrors", "ClerkErrorsData", "ClerkErrorsMeta", "ClerkErrorsMetaTypedDict", "Client", "ClientTypedDict", "CodeType", "CreateActorTokenRequestBody", "CreateActorTokenRequestBodyTypedDict", "CreateAllowlistIdentifierRequestBody", "CreateAllowlistIdentifierRequestBodyTypedDict", "CreateBlocklistIdentifierRequestBody", "CreateBlocklistIdentifierRequestBodyTypedDict", "CreateEmailAddressRequestBody", "CreateEmailAddressRequestBodyTypedDict", "CreateInvitationPublicMetadata", "CreateInvitationPublicMetadataTypedDict", "CreateInvitationRequestBody", "CreateInvitationRequestBodyTypedDict", "CreateJWTTemplateClaims", "CreateJWTTemplateClaimsTypedDict", "CreateJWTTemplateRequestBody", "CreateJWTTemplateRequestBodyTypedDict", "CreateOAuthApplicationRequestBody", "CreateOAuthApplicationRequestBodyTypedDict", "CreateOrganizationInvitationBulkPrivateMetadata", "CreateOrganizationInvitationBulkPrivateMetadataTypedDict", "CreateOrganizationInvitationBulkPublicMetadata", "CreateOrganizationInvitationBulkPublicMetadataTypedDict", "CreateOrganizationInvitationBulkRequest", "CreateOrganizationInvitationBulkRequestTypedDict", "CreateOrganizationInvitationPrivateMetadata", "CreateOrganizationInvitationPrivateMetadataTypedDict", "CreateOrganizationInvitationPublicMetadata", "CreateOrganizationInvitationPublicMetadataTypedDict", "CreateOrganizationInvitationRequest", "CreateOrganizationInvitationRequestBody", "CreateOrganizationInvitationRequestBodyTypedDict", "CreateOrganizationInvitationRequestTypedDict", "CreateOrganizationMembershipRequest", "CreateOrganizationMembershipRequestBody", "CreateOrganizationMembershipRequestBodyTypedDict", "CreateOrganizationMembershipRequestTypedDict", "CreateOrganizationPrivateMetadata", "CreateOrganizationPrivateMetadataTypedDict", "CreateOrganizationPublicMetadata", "CreateOrganizationPublicMetadataTypedDict", "CreateOrganizationRequestBody", "CreateOrganizationRequestBodyTypedDict", "CreatePhoneNumberRequestBody", "CreatePhoneNumberRequestBodyTypedDict", "CreateRedirectURLRequestBody", "CreateRedirectURLRequestBodyTypedDict", "CreateSAMLConnectionAttributeMapping", "CreateSAMLConnectionAttributeMappingTypedDict", "CreateSAMLConnectionRequestBody", "CreateSAMLConnectionRequestBodyTypedDict", "CreateSessionTokenFromTemplateObject", "CreateSessionTokenFromTemplateRequest", "CreateSessionTokenFromTemplateRequestTypedDict", "CreateSessionTokenFromTemplateResponseBody", "CreateSessionTokenFromTemplateResponseBodyTypedDict", "CreateSignInTokenRequestBody", "CreateSignInTokenRequestBodyTypedDict", "CreateUserPrivateMetadata", "CreateUserPrivateMetadataTypedDict", "CreateUserPublicMetadata", "CreateUserPublicMetadataTypedDict", "CreateUserRequestBody", "CreateUserRequestBodyTypedDict", "CreateUserUnsafeMetadata", "CreateUserUnsafeMetadataTypedDict", "DeleteAllowlistIdentifierRequest", "DeleteAllowlistIdentifierRequestTypedDict", "DeleteBlocklistIdentifierRequest", "DeleteBlocklistIdentifierRequestTypedDict", "DeleteDomainRequest", "DeleteDomainRequestTypedDict", "DeleteEmailAddressRequest", "DeleteEmailAddressRequestTypedDict", "DeleteJWTTemplateRequest", "DeleteJWTTemplateRequestTypedDict", "DeleteOAuthApplicationRequest", "DeleteOAuthApplicationRequestTypedDict", "DeleteOrganizationLogoRequest", "DeleteOrganizationLogoRequestTypedDict", "DeleteOrganizationMembershipRequest", "DeleteOrganizationMembershipRequestTypedDict", "DeleteOrganizationRequest", "DeleteOrganizationRequestTypedDict", "DeletePhoneNumberRequest", "DeletePhoneNumberRequestTypedDict", "DeleteRedirectURLRequest", "DeleteRedirectURLRequestTypedDict", "DeleteSAMLConnectionRequest", "DeleteSAMLConnectionRequestTypedDict", "DeleteUserProfileImageRequest", "DeleteUserProfileImageRequestTypedDict", "DeleteUserRequest", "DeleteUserRequestTypedDict", "DeletedObject", "DeletedObjectTypedDict", "DisableMFARequest", "DisableMFARequestTypedDict", "DisableMFAResponseBody", "DisableMFAResponseBodyTypedDict", "Domain", "DomainObject", "DomainTypedDict", "Domains", "DomainsEnrollmentModes", "DomainsTypedDict", "EmailAddress", "EmailAddressObject", "EmailAddressTypedDict", "Error", "ErrorClerkError", "ErrorClerkErrorTypedDict", "ErrorMeta", "ErrorMetaTypedDict", "ErrorTypedDict", "ExternalAccount", "ExternalAccountTypedDict", "ExternalAccounts", "ExternalAccountsTypedDict", "File", "FileTypedDict", "GetClientListRequest", "GetClientListRequestTypedDict", "GetClientListResponse", "GetClientListResponseTypedDict", "GetClientRequest", "GetClientRequestTypedDict", "GetEmailAddressRequest", "GetEmailAddressRequestTypedDict", "GetJWTTemplateRequest", "GetJWTTemplateRequestTypedDict", "GetOAuthAccessTokenPublicMetadata", "GetOAuthAccessTokenPublicMetadataTypedDict", "GetOAuthAccessTokenRequest", "GetOAuthAccessTokenRequestTypedDict", "GetOAuthApplicationRequest", "GetOAuthApplicationRequestTypedDict", "GetOrganizationInvitationRequest", "GetOrganizationInvitationRequestTypedDict", "GetOrganizationRequest", "GetOrganizationRequestTypedDict", "GetPhoneNumberRequest", "GetPhoneNumberRequestTypedDict", "GetPublicInterstitialRequest", "GetPublicInterstitialRequestTypedDict", "GetRedirectURLRequest", "GetRedirectURLRequestTypedDict", "GetSAMLConnectionRequest", "GetSAMLConnectionRequestTypedDict", "GetSessionListRequest", "GetSessionListRequestTypedDict", "GetSessionRequest", "GetSessionRequestTypedDict", "GetTemplateListRequest", "GetTemplateListRequestTypedDict", "GetTemplateRequest", "GetTemplateRequestTypedDict", "GetUserListRequest", "GetUserListRequestTypedDict", "GetUserRequest", "GetUserRequestTypedDict", "GetUsersCountRequest", "GetUsersCountRequestTypedDict", "IdentificationLink", "IdentificationLinkTypedDict", "IdentifierType", "InstanceRestrictions", "InstanceRestrictionsObject", "InstanceRestrictionsTypedDict", "InstanceSettings", "InstanceSettingsObject", "InstanceSettingsTypedDict", "Invitation", "InvitationObject", "InvitationPublicMetadata", "InvitationPublicMetadataTypedDict", "InvitationRevoked", "InvitationRevokedObject", "InvitationRevokedPublicMetadata", "InvitationRevokedPublicMetadataTypedDict", "InvitationRevokedStatus", "InvitationRevokedTypedDict", "InvitationStatus", "InvitationTypedDict", "JWTTemplate", "JWTTemplateObject", "JWTTemplateTypedDict", "ListInvitationsQueryParamStatus", "ListInvitationsRequest", "ListInvitationsRequestTypedDict", "ListInvitationsResponse", "ListInvitationsResponseTypedDict", "ListOAuthApplicationsRequest", "ListOAuthApplicationsRequestTypedDict", "ListOAuthApplicationsResponse", "ListOAuthApplicationsResponseTypedDict", "ListOrganizationInvitationsQueryParamStatus", "ListOrganizationInvitationsRequest", "ListOrganizationInvitationsRequestTypedDict", "ListOrganizationInvitationsResponse", "ListOrganizationInvitationsResponseTypedDict", "ListOrganizationMembershipsRequest", "ListOrganizationMembershipsRequestTypedDict", "ListOrganizationMembershipsResponse", "ListOrganizationMembershipsResponseTypedDict", "ListOrganizationsRequest", "ListOrganizationsRequestTypedDict", "ListPendingOrganizationInvitationsRequest", "ListPendingOrganizationInvitationsRequestTypedDict", "ListPendingOrganizationInvitationsResponse", "ListPendingOrganizationInvitationsResponseTypedDict", "ListSAMLConnectionsRequest", "ListSAMLConnectionsRequestTypedDict", "ListSAMLConnectionsResponse", "ListSAMLConnectionsResponseTypedDict", "LockUserRequest", "LockUserRequestTypedDict", "MergeOrganizationMetadataPrivateMetadata", "MergeOrganizationMetadataPrivateMetadataTypedDict", "MergeOrganizationMetadataPublicMetadata", "MergeOrganizationMetadataPublicMetadataTypedDict", "MergeOrganizationMetadataRequest", "MergeOrganizationMetadataRequestBody", "MergeOrganizationMetadataRequestBodyTypedDict", "MergeOrganizationMetadataRequestTypedDict", "Meta", "MetaTypedDict", "Nonce", "OAuthApplication", "OAuthApplicationObject", "OAuthApplicationTypedDict", "OAuthApplicationWithSecret", "OAuthApplicationWithSecretObject", "OAuthApplicationWithSecretTypedDict", "OAuthApplications", "OAuthApplicationsTypedDict", "OTPVerificationStatus", "OTPVerificationStrategy", "Oauth", "OauthTypedDict", "OauthVerificationStatus", "OauthVerificationStrategy", "Object", "Organization", "OrganizationInvitation", "OrganizationInvitationObject", "OrganizationInvitationPrivateMetadata", "OrganizationInvitationPrivateMetadataTypedDict", "OrganizationInvitationPublicMetadata", "OrganizationInvitationPublicMetadataTypedDict", "OrganizationInvitationTypedDict", "OrganizationInvitations", "OrganizationInvitationsTypedDict", "OrganizationMembership", "OrganizationMembershipObject", "OrganizationMembershipOrganization", "OrganizationMembershipOrganizationObject", "OrganizationMembershipOrganizationPrivateMetadata", "OrganizationMembershipOrganizationPrivateMetadataTypedDict", "OrganizationMembershipOrganizationPublicMetadata", "OrganizationMembershipOrganizationPublicMetadataTypedDict", "OrganizationMembershipOrganizationTypedDict", "OrganizationMembershipPrivateMetadata", "OrganizationMembershipPrivateMetadataTypedDict", "OrganizationMembershipPublicMetadata", "OrganizationMembershipPublicMetadataTypedDict", "OrganizationMembershipTypedDict", "OrganizationMemberships", "OrganizationMembershipsTypedDict", "OrganizationObject", "OrganizationPrivateMetadata", "OrganizationPrivateMetadataTypedDict", "OrganizationPublicMetadata", "OrganizationPublicMetadataTypedDict", "OrganizationSettings", "OrganizationSettingsObject", "OrganizationSettingsTypedDict", "OrganizationTypedDict", "OrganizationWithLogo", "OrganizationWithLogoObject", "OrganizationWithLogoPrivateMetadata", "OrganizationWithLogoPrivateMetadataTypedDict", "OrganizationWithLogoPublicMetadata", "OrganizationWithLogoPublicMetadataTypedDict", "OrganizationWithLogoTypedDict", "Organizations", "OrganizationsTypedDict", "Otp", "OtpTypedDict", "Passkey", "PasskeyTypedDict", "PasskeyVerificationStatus", "PasskeyVerificationStrategy", "PasswordHasher", "PathParamTemplateType", "PhoneNumber", "PhoneNumberObject", "PhoneNumberTypedDict", "PhoneNumberVerification", "PhoneNumberVerificationTypedDict", "PreviewTemplateRequest", "PreviewTemplateRequestBody", "PreviewTemplateRequestBodyTypedDict", "PreviewTemplateRequestTypedDict", "PreviewTemplateResponseBody", "PreviewTemplateResponseBodyTypedDict", "PrivateMetadata", "PrivateMetadataTypedDict", "Provider", "ProxyCheck", "ProxyCheckObject", "ProxyCheckTypedDict", "PublicMetadata", "PublicMetadataTypedDict", "PublicUserData", "PublicUserDataTypedDict", "QueryParamStatus", "RedirectURL", "RedirectURLObject", "RedirectURLTypedDict", "RequestBody", "RequestBodyTypedDict", "ResponseBody", "ResponseBodyTypedDict", "RevertTemplatePathParamTemplateType", "RevertTemplateRequest", "RevertTemplateRequestTypedDict", "RevokeActorTokenRequest", "RevokeActorTokenRequestTypedDict", "RevokeInvitationRequest", "RevokeInvitationRequestTypedDict", "RevokeOrganizationInvitationRequest", "RevokeOrganizationInvitationRequestBody", "RevokeOrganizationInvitationRequestBodyTypedDict", "RevokeOrganizationInvitationRequestTypedDict", "RevokeSessionRequest", "RevokeSessionRequestTypedDict", "RevokeSignInTokenRequest", "RevokeSignInTokenRequestTypedDict", "RotateOAuthApplicationSecretRequest", "RotateOAuthApplicationSecretRequestTypedDict", "SAMLAccount", "SAMLAccountObject", "SAMLAccountPublicMetadata", "SAMLAccountPublicMetadataTypedDict", "SAMLAccountTypedDict", "SAMLAccountVerification", "SAMLAccountVerificationTypedDict", "SAMLConnection", "SAMLConnectionObject", "SAMLConnectionTypedDict", "SAMLConnections", "SAMLConnectionsTypedDict", "SAMLErrorClerkError", "SAMLErrorClerkErrorTypedDict", "SAMLVerificationStatus", "SAMLVerificationStrategy", "SDKError", "Saml", "SamlTypedDict", "SchemasPasskey", "SchemasPasskeyObject", "SchemasPasskeyTypedDict", "SchemasPasskeyVerification", "SchemasPasskeyVerificationTypedDict", "Security", "SecurityTypedDict", "Session", "SessionObject", "SessionTypedDict", "SetUserProfileImageRequest", "SetUserProfileImageRequestBody", "SetUserProfileImageRequestBodyTypedDict", "SetUserProfileImageRequestTypedDict", "SignInToken", "SignInTokenObject", "SignInTokenStatus", "SignInTokenTypedDict", "SignUp", "SignUpObject", "SignUpPublicMetadata", "SignUpPublicMetadataTypedDict", "SignUpStatus", "SignUpTypedDict", "SignUpUnsafeMetadata", "SignUpUnsafeMetadataTypedDict", "Status", "Strategy", "SvixURL", "SvixURLTypedDict", "Template", "TemplateObject", "TemplateType", "TemplateTypedDict", "TestingToken", "TestingTokenObject", "TestingTokenTypedDict", "Ticket", "TicketTypedDict", "TicketVerificationStatus", "TicketVerificationStrategy", "ToggleTemplateDeliveryPathParamTemplateType", "ToggleTemplateDeliveryRequest", "ToggleTemplateDeliveryRequestBody", "ToggleTemplateDeliveryRequestBodyTypedDict", "ToggleTemplateDeliveryRequestTypedDict", "TotalCount", "TotalCountObject", "TotalCountTypedDict", "Type", "UnbanUserRequest", "UnbanUserRequestTypedDict", "UnlockUserRequest", "UnlockUserRequestTypedDict", "UnsafeMetadata", "UnsafeMetadataTypedDict", "UpdateDomainRequest", "UpdateDomainRequestBody", "UpdateDomainRequestBodyTypedDict", "UpdateDomainRequestTypedDict", "UpdateEmailAddressRequest", "UpdateEmailAddressRequestBody", "UpdateEmailAddressRequestBodyTypedDict", "UpdateEmailAddressRequestTypedDict", "UpdateInstanceAuthConfigRequestBody", "UpdateInstanceAuthConfigRequestBodyTypedDict", "UpdateInstanceOrganizationSettingsRequestBody", "UpdateInstanceOrganizationSettingsRequestBodyTypedDict", "UpdateInstanceRequestBody", "UpdateInstanceRequestBodyTypedDict", "UpdateInstanceRestrictionsRequestBody", "UpdateInstanceRestrictionsRequestBodyTypedDict", "UpdateJWTTemplateClaims", "UpdateJWTTemplateClaimsTypedDict", "UpdateJWTTemplateRequest", "UpdateJWTTemplateRequestBody", "UpdateJWTTemplateRequestBodyTypedDict", "UpdateJWTTemplateRequestTypedDict", "UpdateOAuthApplicationRequest", "UpdateOAuthApplicationRequestBody", "UpdateOAuthApplicationRequestBodyTypedDict", "UpdateOAuthApplicationRequestTypedDict", "UpdateOrganizationMembershipMetadataPrivateMetadata", "UpdateOrganizationMembershipMetadataPrivateMetadataTypedDict", "UpdateOrganizationMembershipMetadataPublicMetadata", "UpdateOrganizationMembershipMetadataPublicMetadataTypedDict", "UpdateOrganizationMembershipMetadataRequest", "UpdateOrganizationMembershipMetadataRequestBody", "UpdateOrganizationMembershipMetadataRequestBodyTypedDict", "UpdateOrganizationMembershipMetadataRequestTypedDict", "UpdateOrganizationMembershipRequest", "UpdateOrganizationMembershipRequestBody", "UpdateOrganizationMembershipRequestBodyTypedDict", "UpdateOrganizationMembershipRequestTypedDict", "UpdateOrganizationPrivateMetadata", "UpdateOrganizationPrivateMetadataTypedDict", "UpdateOrganizationPublicMetadata", "UpdateOrganizationPublicMetadataTypedDict", "UpdateOrganizationRequest", "UpdateOrganizationRequestBody", "UpdateOrganizationRequestBodyTypedDict", "UpdateOrganizationRequestTypedDict", "UpdatePhoneNumberRequest", "UpdatePhoneNumberRequestBody", "UpdatePhoneNumberRequestBodyTypedDict", "UpdatePhoneNumberRequestTypedDict", "UpdateProductionInstanceDomainRequestBody", "UpdateProductionInstanceDomainRequestBodyTypedDict", "UpdateSAMLConnectionAttributeMapping", "UpdateSAMLConnectionAttributeMappingTypedDict", "UpdateSAMLConnectionRequest", "UpdateSAMLConnectionRequestBody", "UpdateSAMLConnectionRequestBodyTypedDict", "UpdateSAMLConnectionRequestTypedDict", "UpdateSignUpRequest", "UpdateSignUpRequestBody", "UpdateSignUpRequestBodyTypedDict", "UpdateSignUpRequestTypedDict", "UpdateUserMetadataPrivateMetadata", "UpdateUserMetadataPrivateMetadataTypedDict", "UpdateUserMetadataRequest", "UpdateUserMetadataRequestBody", "UpdateUserMetadataRequestBodyTypedDict", "UpdateUserMetadataRequestTypedDict", "UpdateUserMetadataUnsafeMetadata", "UpdateUserMetadataUnsafeMetadataTypedDict", "UpdateUserPasswordHasher", "UpdateUserPrivateMetadata", "UpdateUserPrivateMetadataTypedDict", "UpdateUserPublicMetadata", "UpdateUserPublicMetadataTypedDict", "UpdateUserRequest", "UpdateUserRequestBody", "UpdateUserRequestBodyTypedDict", "UpdateUserRequestTypedDict", "UpdateUserUnsafeMetadata", "UpdateUserUnsafeMetadataTypedDict", "UploadOrganizationLogoFile", "UploadOrganizationLogoFileTypedDict", "UploadOrganizationLogoRequest", "UploadOrganizationLogoRequestBody", "UploadOrganizationLogoRequestBodyTypedDict", "UploadOrganizationLogoRequestTypedDict", "UpsertTemplatePathParamTemplateType", "UpsertTemplateRequest", "UpsertTemplateRequestBody", "UpsertTemplateRequestBodyTypedDict", "UpsertTemplateRequestTypedDict", "User", "UserObject", "UserTypedDict", "UsersGetOrganizationMembershipsRequest", "UsersGetOrganizationMembershipsRequestTypedDict", "UsersGetOrganizationMembershipsResponse", "UsersGetOrganizationMembershipsResponseTypedDict", "Verification", "VerificationAdmin", "VerificationAdminTypedDict", "VerificationError", "VerificationErrorTypedDict", "VerificationNonce", "VerificationOTP", "VerificationOTPTypedDict", "VerificationStatus", "VerificationStrategy", "VerificationTypedDict", "Verifications", "VerificationsTypedDict", "VerifyClientRequestBody", "VerifyClientRequestBodyTypedDict", "VerifyDomainProxyRequestBody", "VerifyDomainProxyRequestBodyTypedDict", "VerifyPasswordRequest", "VerifyPasswordRequestBody", "VerifyPasswordRequestBodyTypedDict", "VerifyPasswordRequestTypedDict", "VerifyPasswordResponseBody", "VerifyPasswordResponseBodyTypedDict", "VerifySessionRequest", "VerifySessionRequestBody", "VerifySessionRequestBodyTypedDict", "VerifySessionRequestTypedDict", "VerifyTOTPRequest", "VerifyTOTPRequestBody", "VerifyTOTPRequestBodyTypedDict", "VerifyTOTPRequestTypedDict", "VerifyTOTPResponseBody", "VerifyTOTPResponseBodyTypedDict", "Web3Signature", "Web3SignatureTypedDict", "Web3SignatureVerificationStatus", "Web3SignatureVerificationStrategy", "Web3Wallet", "Web3WalletObject", "Web3WalletTypedDict", "Web3WalletVerification", "Web3WalletVerificationAdmin", "Web3WalletVerificationAdminTypedDict", "Web3WalletVerificationTypedDict"] +__all__ = ["Actor", "ActorToken", "ActorTokenActor", "ActorTokenActorTypedDict", "ActorTokenObject", "ActorTokenStatus", "ActorTokenTypedDict", "ActorTypedDict", "AddDomainRequestBody", "AddDomainRequestBodyTypedDict", "Admin", "AdminTypedDict", "AdminVerificationPhoneNumberStatus", "AdminVerificationStatus", "AdminVerificationStrategy", "AdminVerificationWeb3WalletStatus", "AdminVerificationWeb3WalletStrategy", "AllowlistIdentifier", "AllowlistIdentifierObject", "AllowlistIdentifierTypedDict", "AttributeMapping", "AttributeMappingTypedDict", "BanUserRequest", "BanUserRequestTypedDict", "BlocklistIdentifier", "BlocklistIdentifierIdentifierType", "BlocklistIdentifierObject", "BlocklistIdentifierTypedDict", "BlocklistIdentifiers", "BlocklistIdentifiersTypedDict", "CNameTarget", "CNameTargetTypedDict", "ChangeProductionInstanceDomainRequestBody", "ChangeProductionInstanceDomainRequestBodyTypedDict", "Claims", "ClaimsTypedDict", "ClerkError", "ClerkErrorErrorMeta", "ClerkErrorErrorMetaTypedDict", "ClerkErrorTypedDict", "ClerkErrors", "ClerkErrorsData", "ClerkErrorsMeta", "ClerkErrorsMetaTypedDict", "Client", "ClientTypedDict", "CodeType", "CreateActorTokenActor", "CreateActorTokenActorTypedDict", "CreateActorTokenRequestBody", "CreateActorTokenRequestBodyTypedDict", "CreateAllowlistIdentifierRequestBody", "CreateAllowlistIdentifierRequestBodyTypedDict", "CreateBlocklistIdentifierRequestBody", "CreateBlocklistIdentifierRequestBodyTypedDict", "CreateEmailAddressRequestBody", "CreateEmailAddressRequestBodyTypedDict", "CreateInvitationPublicMetadata", "CreateInvitationPublicMetadataTypedDict", "CreateInvitationRequestBody", "CreateInvitationRequestBodyTypedDict", "CreateJWTTemplateClaims", "CreateJWTTemplateClaimsTypedDict", "CreateJWTTemplateRequestBody", "CreateJWTTemplateRequestBodyTypedDict", "CreateOAuthApplicationRequestBody", "CreateOAuthApplicationRequestBodyTypedDict", "CreateOrganizationDomainRequest", "CreateOrganizationDomainRequestBody", "CreateOrganizationDomainRequestBodyTypedDict", "CreateOrganizationDomainRequestTypedDict", "CreateOrganizationInvitationBulkPrivateMetadata", "CreateOrganizationInvitationBulkPrivateMetadataTypedDict", "CreateOrganizationInvitationBulkPublicMetadata", "CreateOrganizationInvitationBulkPublicMetadataTypedDict", "CreateOrganizationInvitationBulkRequest", "CreateOrganizationInvitationBulkRequestTypedDict", "CreateOrganizationInvitationPrivateMetadata", "CreateOrganizationInvitationPrivateMetadataTypedDict", "CreateOrganizationInvitationPublicMetadata", "CreateOrganizationInvitationPublicMetadataTypedDict", "CreateOrganizationInvitationRequest", "CreateOrganizationInvitationRequestBody", "CreateOrganizationInvitationRequestBodyTypedDict", "CreateOrganizationInvitationRequestTypedDict", "CreateOrganizationMembershipRequest", "CreateOrganizationMembershipRequestBody", "CreateOrganizationMembershipRequestBodyTypedDict", "CreateOrganizationMembershipRequestTypedDict", "CreateOrganizationPrivateMetadata", "CreateOrganizationPrivateMetadataTypedDict", "CreateOrganizationPublicMetadata", "CreateOrganizationPublicMetadataTypedDict", "CreateOrganizationRequestBody", "CreateOrganizationRequestBodyTypedDict", "CreatePhoneNumberRequestBody", "CreatePhoneNumberRequestBodyTypedDict", "CreateRedirectURLRequestBody", "CreateRedirectURLRequestBodyTypedDict", "CreateSAMLConnectionAttributeMapping", "CreateSAMLConnectionAttributeMappingTypedDict", "CreateSAMLConnectionRequestBody", "CreateSAMLConnectionRequestBodyTypedDict", "CreateSessionTokenFromTemplateObject", "CreateSessionTokenFromTemplateRequest", "CreateSessionTokenFromTemplateRequestTypedDict", "CreateSessionTokenFromTemplateResponseBody", "CreateSessionTokenFromTemplateResponseBodyTypedDict", "CreateSignInTokenRequestBody", "CreateSignInTokenRequestBodyTypedDict", "CreateUserPrivateMetadata", "CreateUserPrivateMetadataTypedDict", "CreateUserPublicMetadata", "CreateUserPublicMetadataTypedDict", "CreateUserRequestBody", "CreateUserRequestBodyTypedDict", "CreateUserTOTPRequest", "CreateUserTOTPRequestTypedDict", "CreateUserUnsafeMetadata", "CreateUserUnsafeMetadataTypedDict", "DeleteAllowlistIdentifierRequest", "DeleteAllowlistIdentifierRequestTypedDict", "DeleteBackupCodeRequest", "DeleteBackupCodeRequestTypedDict", "DeleteBackupCodeResponseBody", "DeleteBackupCodeResponseBodyTypedDict", "DeleteBlocklistIdentifierRequest", "DeleteBlocklistIdentifierRequestTypedDict", "DeleteDomainRequest", "DeleteDomainRequestTypedDict", "DeleteEmailAddressRequest", "DeleteEmailAddressRequestTypedDict", "DeleteExternalAccountRequest", "DeleteExternalAccountRequestTypedDict", "DeleteJWTTemplateRequest", "DeleteJWTTemplateRequestTypedDict", "DeleteOAuthApplicationRequest", "DeleteOAuthApplicationRequestTypedDict", "DeleteOrganizationDomainRequest", "DeleteOrganizationDomainRequestTypedDict", "DeleteOrganizationLogoRequest", "DeleteOrganizationLogoRequestTypedDict", "DeleteOrganizationMembershipRequest", "DeleteOrganizationMembershipRequestTypedDict", "DeleteOrganizationRequest", "DeleteOrganizationRequestTypedDict", "DeletePhoneNumberRequest", "DeletePhoneNumberRequestTypedDict", "DeleteRedirectURLRequest", "DeleteRedirectURLRequestTypedDict", "DeleteSAMLConnectionRequest", "DeleteSAMLConnectionRequestTypedDict", "DeleteTOTPRequest", "DeleteTOTPRequestTypedDict", "DeleteTOTPResponseBody", "DeleteTOTPResponseBodyTypedDict", "DeleteUserProfileImageRequest", "DeleteUserProfileImageRequestTypedDict", "DeleteUserRequest", "DeleteUserRequestTypedDict", "DeletedObject", "DeletedObjectTypedDict", "DisableMFARequest", "DisableMFARequestTypedDict", "DisableMFAResponseBody", "DisableMFAResponseBodyTypedDict", "Domain", "DomainObject", "DomainTypedDict", "Domains", "DomainsEnrollmentModes", "DomainsTypedDict", "EmailAddress", "EmailAddressObject", "EmailAddressTypedDict", "EnrollmentMode", "Error", "ErrorClerkError", "ErrorClerkErrorTypedDict", "ErrorMeta", "ErrorMetaTypedDict", "ErrorTypedDict", "ExternalAccount", "ExternalAccountTypedDict", "ExternalAccounts", "ExternalAccountsTypedDict", "File", "FileTypedDict", "GetClientListRequest", "GetClientListRequestTypedDict", "GetClientRequest", "GetClientRequestTypedDict", "GetEmailAddressRequest", "GetEmailAddressRequestTypedDict", "GetJWTTemplateRequest", "GetJWTTemplateRequestTypedDict", "GetOAuthAccessTokenPublicMetadata", "GetOAuthAccessTokenPublicMetadataTypedDict", "GetOAuthAccessTokenRequest", "GetOAuthAccessTokenRequestTypedDict", "GetOAuthApplicationRequest", "GetOAuthApplicationRequestTypedDict", "GetOrganizationInvitationRequest", "GetOrganizationInvitationRequestTypedDict", "GetOrganizationRequest", "GetOrganizationRequestTypedDict", "GetPhoneNumberRequest", "GetPhoneNumberRequestTypedDict", "GetPublicInterstitialRequest", "GetPublicInterstitialRequestTypedDict", "GetRedirectURLRequest", "GetRedirectURLRequestTypedDict", "GetSAMLConnectionRequest", "GetSAMLConnectionRequestTypedDict", "GetSessionListRequest", "GetSessionListRequestTypedDict", "GetSessionRequest", "GetSessionRequestTypedDict", "GetTemplateRequest", "GetTemplateRequestTypedDict", "GetUserListRequest", "GetUserListRequestTypedDict", "GetUserRequest", "GetUserRequestTypedDict", "GetUsersCountRequest", "GetUsersCountRequestTypedDict", "IdentificationLink", "IdentificationLinkTypedDict", "IdentifierType", "InstanceGetOrganizationMembershipsRequest", "InstanceGetOrganizationMembershipsRequestTypedDict", "InstanceRestrictions", "InstanceRestrictionsObject", "InstanceRestrictionsTypedDict", "InstanceSettings", "InstanceSettingsObject", "InstanceSettingsTypedDict", "Invitation", "InvitationObject", "InvitationPublicMetadata", "InvitationPublicMetadataTypedDict", "InvitationRevoked", "InvitationRevokedObject", "InvitationRevokedPublicMetadata", "InvitationRevokedPublicMetadataTypedDict", "InvitationRevokedStatus", "InvitationRevokedTypedDict", "InvitationStatus", "InvitationTypedDict", "JWTTemplate", "JWTTemplateObject", "JWTTemplateTypedDict", "Keys", "KeysTypedDict", "LatestActivity", "LatestActivityTypedDict", "ListInstanceOrganizationInvitationsQueryParamStatus", "ListInstanceOrganizationInvitationsRequest", "ListInstanceOrganizationInvitationsRequestTypedDict", "ListInvitationsQueryParamStatus", "ListInvitationsRequest", "ListInvitationsRequestTypedDict", "ListOAuthApplicationsRequest", "ListOAuthApplicationsRequestTypedDict", "ListOrganizationDomainsRequest", "ListOrganizationDomainsRequestTypedDict", "ListOrganizationInvitationsQueryParamStatus", "ListOrganizationInvitationsRequest", "ListOrganizationInvitationsRequestTypedDict", "ListOrganizationMembershipsRequest", "ListOrganizationMembershipsRequestTypedDict", "ListOrganizationsRequest", "ListOrganizationsRequestTypedDict", "ListPendingOrganizationInvitationsRequest", "ListPendingOrganizationInvitationsRequestTypedDict", "ListSAMLConnectionsRequest", "ListSAMLConnectionsRequestTypedDict", "LockUserRequest", "LockUserRequestTypedDict", "MergeOrganizationMetadataPrivateMetadata", "MergeOrganizationMetadataPrivateMetadataTypedDict", "MergeOrganizationMetadataPublicMetadata", "MergeOrganizationMetadataPublicMetadataTypedDict", "MergeOrganizationMetadataRequest", "MergeOrganizationMetadataRequestBody", "MergeOrganizationMetadataRequestBodyTypedDict", "MergeOrganizationMetadataRequestTypedDict", "Meta", "MetaTypedDict", "Nonce", "OAuthApplication", "OAuthApplicationObject", "OAuthApplicationTypedDict", "OAuthApplicationWithSecret", "OAuthApplicationWithSecretObject", "OAuthApplicationWithSecretTypedDict", "OAuthApplications", "OAuthApplicationsTypedDict", "OTPVerificationStatus", "OTPVerificationStrategy", "Oauth", "OauthTypedDict", "OauthVerificationStatus", "OauthVerificationStrategy", "Object", "Organization", "OrganizationDomain", "OrganizationDomainObject", "OrganizationDomainStatus", "OrganizationDomainTypedDict", "OrganizationDomainVerification", "OrganizationDomainVerificationTypedDict", "OrganizationDomains", "OrganizationDomainsTypedDict", "OrganizationInvitation", "OrganizationInvitationObject", "OrganizationInvitationPrivateMetadata", "OrganizationInvitationPrivateMetadataTypedDict", "OrganizationInvitationPublicMetadata", "OrganizationInvitationPublicMetadataTypedDict", "OrganizationInvitationTypedDict", "OrganizationInvitationWithPublicOrganizationData", "OrganizationInvitationWithPublicOrganizationDataObject", "OrganizationInvitationWithPublicOrganizationDataPrivateMetadata", "OrganizationInvitationWithPublicOrganizationDataPrivateMetadataTypedDict", "OrganizationInvitationWithPublicOrganizationDataPublicMetadata", "OrganizationInvitationWithPublicOrganizationDataPublicMetadataTypedDict", "OrganizationInvitationWithPublicOrganizationDataTypedDict", "OrganizationInvitations", "OrganizationInvitationsTypedDict", "OrganizationInvitationsWithPublicOrganizationData", "OrganizationInvitationsWithPublicOrganizationDataTypedDict", "OrganizationMembership", "OrganizationMembershipObject", "OrganizationMembershipOrganization", "OrganizationMembershipOrganizationObject", "OrganizationMembershipOrganizationPrivateMetadata", "OrganizationMembershipOrganizationPrivateMetadataTypedDict", "OrganizationMembershipOrganizationPublicMetadata", "OrganizationMembershipOrganizationPublicMetadataTypedDict", "OrganizationMembershipOrganizationTypedDict", "OrganizationMembershipPrivateMetadata", "OrganizationMembershipPrivateMetadataTypedDict", "OrganizationMembershipPublicMetadata", "OrganizationMembershipPublicMetadataTypedDict", "OrganizationMembershipTypedDict", "OrganizationMemberships", "OrganizationMembershipsTypedDict", "OrganizationObject", "OrganizationPrivateMetadata", "OrganizationPrivateMetadataTypedDict", "OrganizationPublicMetadata", "OrganizationPublicMetadataTypedDict", "OrganizationSettings", "OrganizationSettingsObject", "OrganizationSettingsTypedDict", "OrganizationTypedDict", "OrganizationWithLogo", "OrganizationWithLogoObject", "OrganizationWithLogoPrivateMetadata", "OrganizationWithLogoPrivateMetadataTypedDict", "OrganizationWithLogoPublicMetadata", "OrganizationWithLogoPublicMetadataTypedDict", "OrganizationWithLogoTypedDict", "Organizations", "OrganizationsTypedDict", "Otp", "OtpTypedDict", "Passkey", "PasskeyTypedDict", "PasskeyVerificationStatus", "PasskeyVerificationStrategy", "PathParamTemplateType", "PhoneNumber", "PhoneNumberObject", "PhoneNumberTypedDict", "PhoneNumberVerification", "PhoneNumberVerificationTypedDict", "PreviewTemplateRequest", "PreviewTemplateRequestBody", "PreviewTemplateRequestBodyTypedDict", "PreviewTemplateRequestTypedDict", "PreviewTemplateResponseBody", "PreviewTemplateResponseBodyTypedDict", "PrivateMetadata", "PrivateMetadataTypedDict", "Provider", "ProxyCheck", "ProxyCheckObject", "ProxyCheckTypedDict", "PublicMetadata", "PublicMetadataTypedDict", "PublicOrganizationData", "PublicOrganizationDataTypedDict", "PublicUserData", "PublicUserDataTypedDict", "QueryParamStatus", "RedirectURL", "RedirectURLObject", "RedirectURLTypedDict", "RequestBody", "RequestBodyTypedDict", "ResponseBody", "ResponseBodyTypedDict", "RevokeActorTokenRequest", "RevokeActorTokenRequestTypedDict", "RevokeInvitationRequest", "RevokeInvitationRequestTypedDict", "RevokeOrganizationInvitationRequest", "RevokeOrganizationInvitationRequestBody", "RevokeOrganizationInvitationRequestBodyTypedDict", "RevokeOrganizationInvitationRequestTypedDict", "RevokeSessionRequest", "RevokeSessionRequestTypedDict", "RevokeSignInTokenRequest", "RevokeSignInTokenRequestTypedDict", "RotateOAuthApplicationSecretRequest", "RotateOAuthApplicationSecretRequestTypedDict", "SAMLAccount", "SAMLAccountObject", "SAMLAccountPublicMetadata", "SAMLAccountPublicMetadataTypedDict", "SAMLAccountTypedDict", "SAMLAccountVerification", "SAMLAccountVerificationTypedDict", "SAMLConnectionSAMLConnection", "SAMLConnectionSAMLConnectionTypedDict", "SAMLConnections", "SAMLConnectionsTypedDict", "SAMLErrorClerkError", "SAMLErrorClerkErrorTypedDict", "SAMLVerificationStatus", "SAMLVerificationStrategy", "SDKError", "Saml", "SamlConnection", "SamlConnectionTypedDict", "SamlTypedDict", "SchemasPasskey", "SchemasPasskeyObject", "SchemasPasskeyTypedDict", "SchemasPasskeyVerification", "SchemasPasskeyVerificationTypedDict", "SchemasSAMLConnection", "SchemasSAMLConnectionObject", "SchemasSAMLConnectionTypedDict", "Security", "SecurityTypedDict", "Session", "SessionObject", "SessionTypedDict", "SetUserProfileImageRequest", "SetUserProfileImageRequestBody", "SetUserProfileImageRequestBodyTypedDict", "SetUserProfileImageRequestTypedDict", "SignInToken", "SignInTokenObject", "SignInTokenStatus", "SignInTokenTypedDict", "SignUp", "SignUpObject", "SignUpPublicMetadata", "SignUpPublicMetadataTypedDict", "SignUpStatus", "SignUpTypedDict", "SignUpUnsafeMetadata", "SignUpUnsafeMetadataTypedDict", "Status", "Strategy", "SvixURL", "SvixURLTypedDict", "Template", "TemplateObject", "TemplateTypedDict", "TestingToken", "TestingTokenObject", "TestingTokenTypedDict", "Ticket", "TicketTypedDict", "TicketVerificationStatus", "TicketVerificationStrategy", "ToggleTemplateDeliveryPathParamTemplateType", "ToggleTemplateDeliveryRequest", "ToggleTemplateDeliveryRequestBody", "ToggleTemplateDeliveryRequestBodyTypedDict", "ToggleTemplateDeliveryRequestTypedDict", "TotalCount", "TotalCountObject", "TotalCountTypedDict", "Totp", "TotpTypedDict", "Type", "UnbanUserRequest", "UnbanUserRequestTypedDict", "UnlockUserRequest", "UnlockUserRequestTypedDict", "UnsafeMetadata", "UnsafeMetadataTypedDict", "UpdateDomainRequest", "UpdateDomainRequestBody", "UpdateDomainRequestBodyTypedDict", "UpdateDomainRequestTypedDict", "UpdateEmailAddressRequest", "UpdateEmailAddressRequestBody", "UpdateEmailAddressRequestBodyTypedDict", "UpdateEmailAddressRequestTypedDict", "UpdateInstanceAuthConfigRequestBody", "UpdateInstanceAuthConfigRequestBodyTypedDict", "UpdateInstanceOrganizationSettingsRequestBody", "UpdateInstanceOrganizationSettingsRequestBodyTypedDict", "UpdateInstanceRequestBody", "UpdateInstanceRequestBodyTypedDict", "UpdateInstanceRestrictionsRequestBody", "UpdateInstanceRestrictionsRequestBodyTypedDict", "UpdateJWTTemplateClaims", "UpdateJWTTemplateClaimsTypedDict", "UpdateJWTTemplateRequest", "UpdateJWTTemplateRequestBody", "UpdateJWTTemplateRequestBodyTypedDict", "UpdateJWTTemplateRequestTypedDict", "UpdateOAuthApplicationRequest", "UpdateOAuthApplicationRequestBody", "UpdateOAuthApplicationRequestBodyTypedDict", "UpdateOAuthApplicationRequestTypedDict", "UpdateOrganizationDomainRequest", "UpdateOrganizationDomainRequestBody", "UpdateOrganizationDomainRequestBodyTypedDict", "UpdateOrganizationDomainRequestTypedDict", "UpdateOrganizationMembershipMetadataPrivateMetadata", "UpdateOrganizationMembershipMetadataPrivateMetadataTypedDict", "UpdateOrganizationMembershipMetadataPublicMetadata", "UpdateOrganizationMembershipMetadataPublicMetadataTypedDict", "UpdateOrganizationMembershipMetadataRequest", "UpdateOrganizationMembershipMetadataRequestBody", "UpdateOrganizationMembershipMetadataRequestBodyTypedDict", "UpdateOrganizationMembershipMetadataRequestTypedDict", "UpdateOrganizationMembershipRequest", "UpdateOrganizationMembershipRequestBody", "UpdateOrganizationMembershipRequestBodyTypedDict", "UpdateOrganizationMembershipRequestTypedDict", "UpdateOrganizationPrivateMetadata", "UpdateOrganizationPrivateMetadataTypedDict", "UpdateOrganizationPublicMetadata", "UpdateOrganizationPublicMetadataTypedDict", "UpdateOrganizationRequest", "UpdateOrganizationRequestBody", "UpdateOrganizationRequestBodyTypedDict", "UpdateOrganizationRequestTypedDict", "UpdatePhoneNumberRequest", "UpdatePhoneNumberRequestBody", "UpdatePhoneNumberRequestBodyTypedDict", "UpdatePhoneNumberRequestTypedDict", "UpdateProductionInstanceDomainRequestBody", "UpdateProductionInstanceDomainRequestBodyTypedDict", "UpdateSAMLConnectionAttributeMapping", "UpdateSAMLConnectionAttributeMappingTypedDict", "UpdateSAMLConnectionRequest", "UpdateSAMLConnectionRequestBody", "UpdateSAMLConnectionRequestBodyTypedDict", "UpdateSAMLConnectionRequestTypedDict", "UpdateSignUpRequest", "UpdateSignUpRequestBody", "UpdateSignUpRequestBodyTypedDict", "UpdateSignUpRequestTypedDict", "UpdateUserMetadataRequest", "UpdateUserMetadataRequestBody", "UpdateUserMetadataRequestBodyTypedDict", "UpdateUserMetadataRequestTypedDict", "UpdateUserPrivateMetadata", "UpdateUserPrivateMetadataTypedDict", "UpdateUserPublicMetadata", "UpdateUserPublicMetadataTypedDict", "UpdateUserRequest", "UpdateUserRequestBody", "UpdateUserRequestBodyTypedDict", "UpdateUserRequestTypedDict", "UpdateUserUnsafeMetadata", "UpdateUserUnsafeMetadataTypedDict", "UploadOrganizationLogoFile", "UploadOrganizationLogoFileTypedDict", "UploadOrganizationLogoRequest", "UploadOrganizationLogoRequestBody", "UploadOrganizationLogoRequestBodyTypedDict", "UploadOrganizationLogoRequestTypedDict", "UpsertTemplatePathParamTemplateType", "UpsertTemplateRequest", "UpsertTemplateRequestBody", "UpsertTemplateRequestBodyTypedDict", "UpsertTemplateRequestTypedDict", "User", "UserObject", "UserPasskeyDeleteRequest", "UserPasskeyDeleteRequestTypedDict", "UserTypedDict", "UserWeb3WalletDeleteRequest", "UserWeb3WalletDeleteRequestTypedDict", "UsersGetOrganizationInvitationsQueryParamStatus", "UsersGetOrganizationInvitationsRequest", "UsersGetOrganizationInvitationsRequestTypedDict", "UsersGetOrganizationMembershipsRequest", "UsersGetOrganizationMembershipsRequestTypedDict", "Verification", "VerificationAdmin", "VerificationAdminTypedDict", "VerificationError", "VerificationErrorTypedDict", "VerificationOTP", "VerificationOTPTypedDict", "VerificationStatus", "VerificationStrategy", "VerificationTypedDict", "Verifications", "VerificationsTypedDict", "VerifyClientRequestBody", "VerifyClientRequestBodyTypedDict", "VerifyDomainProxyRequestBody", "VerifyDomainProxyRequestBodyTypedDict", "VerifyPasswordRequest", "VerifyPasswordRequestBody", "VerifyPasswordRequestBodyTypedDict", "VerifyPasswordRequestTypedDict", "VerifyPasswordResponseBody", "VerifyPasswordResponseBodyTypedDict", "VerifySessionRequest", "VerifySessionRequestBody", "VerifySessionRequestBodyTypedDict", "VerifySessionRequestTypedDict", "VerifyTOTPRequest", "VerifyTOTPRequestBody", "VerifyTOTPRequestBodyTypedDict", "VerifyTOTPRequestTypedDict", "VerifyTOTPResponseBody", "VerifyTOTPResponseBodyTypedDict", "Web3Signature", "Web3SignatureTypedDict", "Web3SignatureVerificationStatus", "Web3SignatureVerificationStrategy", "Web3Wallet", "Web3WalletObject", "Web3WalletTypedDict", "Web3WalletVerification", "Web3WalletVerificationAdmin", "Web3WalletVerificationAdminTypedDict", "Web3WalletVerificationTypedDict", "WellKnownJWKS", "WellKnownJWKSTypedDict"] diff --git a/src/clerk_backend_api/models/changeproductioninstancedomainop.py b/src/clerk_backend_api/models/changeproductioninstancedomainop.py index 076bd46..4a51eee 100644 --- a/src/clerk_backend_api/models/changeproductioninstancedomainop.py +++ b/src/clerk_backend_api/models/changeproductioninstancedomainop.py @@ -9,9 +9,19 @@ class ChangeProductionInstanceDomainRequestBodyTypedDict(TypedDict): home_url: NotRequired[str] r"""The new home URL of the production instance e.g. https://www.example.com""" + is_secondary: NotRequired[bool] + r"""Whether this is a domain for a secondary app, meaning that any subdomain provided is significant and + will be stored as part of the domain. This is useful for supporting multiple apps (one primary and + multiple secondaries) on the same root domain (eTLD+1). + """ class ChangeProductionInstanceDomainRequestBody(BaseModel): home_url: Optional[str] = None r"""The new home URL of the production instance e.g. https://www.example.com""" + is_secondary: Optional[bool] = None + r"""Whether this is a domain for a secondary app, meaning that any subdomain provided is significant and + will be stored as part of the domain. This is useful for supporting multiple apps (one primary and + multiple secondaries) on the same root domain (eTLD+1). + """ diff --git a/src/clerk_backend_api/models/createactortokenop.py b/src/clerk_backend_api/models/createactortokenop.py index 4737ed7..068a6e9 100644 --- a/src/clerk_backend_api/models/createactortokenop.py +++ b/src/clerk_backend_api/models/createactortokenop.py @@ -2,14 +2,28 @@ from __future__ import annotations from clerk_backend_api.types import BaseModel -from typing import Any, Dict, Optional, TypedDict +from typing import Optional, TypedDict from typing_extensions import NotRequired +class CreateActorTokenActorTypedDict(TypedDict): + r"""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. + """ + + + +class CreateActorTokenActor(BaseModel): + r"""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. + """ + + + class CreateActorTokenRequestBodyTypedDict(TypedDict): user_id: str - r"""The ID of the user that can use the newly created sign in token.""" - actor: Dict[str, Any] + r"""The ID of the user being impersonated.""" + actor: CreateActorTokenActorTypedDict r"""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. """ @@ -25,8 +39,8 @@ class CreateActorTokenRequestBodyTypedDict(TypedDict): class CreateActorTokenRequestBody(BaseModel): user_id: str - r"""The ID of the user that can use the newly created sign in token.""" - actor: Dict[str, Any] + r"""The ID of the user being impersonated.""" + actor: CreateActorTokenActor r"""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. """ diff --git a/src/clerk_backend_api/models/createinvitationop.py b/src/clerk_backend_api/models/createinvitationop.py index b4b7e2c..bf20aaa 100644 --- a/src/clerk_backend_api/models/createinvitationop.py +++ b/src/clerk_backend_api/models/createinvitationop.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from clerk_backend_api.types import BaseModel, Nullable, OptionalNullable, UNSET_SENTINEL +from clerk_backend_api.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL from pydantic import model_serializer from typing import Optional, TypedDict from typing_extensions import NotRequired @@ -43,6 +43,8 @@ class CreateInvitationRequestBodyTypedDict(TypedDict): """ 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.""" class CreateInvitationRequestBody(BaseModel): @@ -65,11 +67,13 @@ class CreateInvitationRequestBody(BaseModel): """ 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.""" @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["public_metadata", "redirect_url", "notify", "ignore_existing"] - nullable_fields = ["notify", "ignore_existing"] + 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) diff --git a/src/clerk_backend_api/models/createorganizationdomainop.py b/src/clerk_backend_api/models/createorganizationdomainop.py new file mode 100644 index 0000000..9a82f03 --- /dev/null +++ b/src/clerk_backend_api/models/createorganizationdomainop.py @@ -0,0 +1,65 @@ +"""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 pydantic import model_serializer +from typing import Optional, TypedDict +from typing_extensions import Annotated, NotRequired + + +class CreateOrganizationDomainRequestBodyTypedDict(TypedDict): + name: NotRequired[str] + r"""The name of the new domain""" + enrollment_mode: NotRequired[str] + r"""The enrollment_mode for the new domain. This can be `automatic_invitation`, `automatic_suggestion` or `manual_invitation`""" + verified: NotRequired[Nullable[bool]] + r"""The status of domain's verification. Defaults to true""" + + +class CreateOrganizationDomainRequestBody(BaseModel): + name: Optional[str] = None + r"""The name of the new domain""" + enrollment_mode: Optional[str] = None + r"""The enrollment_mode for the new domain. This can be `automatic_invitation`, `automatic_suggestion` or `manual_invitation`""" + verified: OptionalNullable[bool] = UNSET + r"""The status of domain's verification. Defaults to true""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["name", "enrollment_mode", "verified"] + nullable_fields = ["verified"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + 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 CreateOrganizationDomainRequestTypedDict(TypedDict): + organization_id: str + r"""The ID of the organization where the new domain will be created.""" + request_body: CreateOrganizationDomainRequestBodyTypedDict + + +class CreateOrganizationDomainRequest(BaseModel): + organization_id: Annotated[str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))] + r"""The ID of the organization where the new domain will be created.""" + request_body: Annotated[CreateOrganizationDomainRequestBody, FieldMetadata(request=RequestMetadata(media_type="application/json"))] + diff --git a/src/clerk_backend_api/models/createorganizationinvitationbulkop.py b/src/clerk_backend_api/models/createorganizationinvitationbulkop.py index e393d96..f3de52b 100644 --- a/src/clerk_backend_api/models/createorganizationinvitationbulkop.py +++ b/src/clerk_backend_api/models/createorganizationinvitationbulkop.py @@ -1,8 +1,9 @@ """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 clerk_backend_api.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from pydantic import model_serializer from typing import List, Optional, TypedDict from typing_extensions import Annotated, NotRequired @@ -30,12 +31,12 @@ class CreateOrganizationInvitationBulkPrivateMetadata(BaseModel): class RequestBodyTypedDict(TypedDict): email_address: str r"""The email address of the new member that is going to be invited to the organization""" - inviter_user_id: str + role: str + r"""The role of the new member in the organization.""" + inviter_user_id: NotRequired[Nullable[str]] r"""The ID of the user that invites the new member to the organization. Must be an administrator in the organization. """ - role: str - r"""The role of the new member in the organization.""" public_metadata: NotRequired[CreateOrganizationInvitationBulkPublicMetadataTypedDict] r"""Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API.""" private_metadata: NotRequired[CreateOrganizationInvitationBulkPrivateMetadataTypedDict] @@ -47,12 +48,12 @@ class RequestBodyTypedDict(TypedDict): class RequestBody(BaseModel): email_address: str r"""The email address of the new member that is going to be invited to the organization""" - inviter_user_id: str + role: str + r"""The role of the new member in the organization.""" + inviter_user_id: OptionalNullable[str] = UNSET r"""The ID of the user that invites the new member to the organization. Must be an administrator in the organization. """ - role: str - r"""The role of the new member in the organization.""" public_metadata: Optional[CreateOrganizationInvitationBulkPublicMetadata] = None r"""Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API.""" private_metadata: Optional[CreateOrganizationInvitationBulkPrivateMetadata] = None @@ -60,6 +61,32 @@ class RequestBody(BaseModel): 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.""" + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["inviter_user_id", "public_metadata", "private_metadata", "redirect_url"] + nullable_fields = ["inviter_user_id"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + 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 CreateOrganizationInvitationBulkRequestTypedDict(TypedDict): organization_id: str diff --git a/src/clerk_backend_api/models/createorganizationinvitationop.py b/src/clerk_backend_api/models/createorganizationinvitationop.py index cd74b39..feba7a3 100644 --- a/src/clerk_backend_api/models/createorganizationinvitationop.py +++ b/src/clerk_backend_api/models/createorganizationinvitationop.py @@ -1,8 +1,9 @@ """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 clerk_backend_api.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from pydantic import model_serializer from typing import Optional, TypedDict from typing_extensions import Annotated, NotRequired @@ -30,12 +31,12 @@ class CreateOrganizationInvitationPrivateMetadata(BaseModel): class CreateOrganizationInvitationRequestBodyTypedDict(TypedDict): email_address: str r"""The email address of the new member that is going to be invited to the organization""" - inviter_user_id: str + role: str + r"""The role of the new member in the organization""" + inviter_user_id: NotRequired[Nullable[str]] r"""The ID of the user that invites the new member to the organization. Must be an administrator in the organization. """ - role: str - r"""The role of the new member in the organization""" public_metadata: NotRequired[CreateOrganizationInvitationPublicMetadataTypedDict] r"""Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API.""" private_metadata: NotRequired[CreateOrganizationInvitationPrivateMetadataTypedDict] @@ -47,12 +48,12 @@ class CreateOrganizationInvitationRequestBodyTypedDict(TypedDict): class CreateOrganizationInvitationRequestBody(BaseModel): email_address: str r"""The email address of the new member that is going to be invited to the organization""" - inviter_user_id: str + role: str + r"""The role of the new member in the organization""" + inviter_user_id: OptionalNullable[str] = UNSET r"""The ID of the user that invites the new member to the organization. Must be an administrator in the organization. """ - role: str - r"""The role of the new member in the organization""" public_metadata: Optional[CreateOrganizationInvitationPublicMetadata] = None r"""Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API.""" private_metadata: Optional[CreateOrganizationInvitationPrivateMetadata] = None @@ -60,6 +61,32 @@ class CreateOrganizationInvitationRequestBody(BaseModel): 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.""" + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["inviter_user_id", "public_metadata", "private_metadata", "redirect_url"] + nullable_fields = ["inviter_user_id"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + 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 CreateOrganizationInvitationRequestTypedDict(TypedDict): organization_id: str diff --git a/src/clerk_backend_api/models/createorganizationop.py b/src/clerk_backend_api/models/createorganizationop.py index 5e14487..7edb08d 100644 --- a/src/clerk_backend_api/models/createorganizationop.py +++ b/src/clerk_backend_api/models/createorganizationop.py @@ -28,7 +28,9 @@ class CreateOrganizationPublicMetadata(BaseModel): class CreateOrganizationRequestBodyTypedDict(TypedDict): name: str - r"""The name of the new organization""" + r"""The name of the new organization. + May not contain URLs or HTML. + """ created_by: str r"""The ID of the User who will become the administrator for the new organization""" private_metadata: NotRequired[CreateOrganizationPrivateMetadataTypedDict] @@ -42,11 +44,15 @@ class CreateOrganizationRequestBodyTypedDict(TypedDict): """ max_allowed_memberships: NotRequired[int] r"""The maximum number of memberships allowed for this organization""" + created_at: NotRequired[str] + r"""A custom date/time denoting _when_ the organization was created, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`).""" class CreateOrganizationRequestBody(BaseModel): name: str - r"""The name of the new organization""" + r"""The name of the new organization. + May not contain URLs or HTML. + """ created_by: str r"""The ID of the User who will become the administrator for the new organization""" private_metadata: Optional[CreateOrganizationPrivateMetadata] = None @@ -60,4 +66,6 @@ class CreateOrganizationRequestBody(BaseModel): """ max_allowed_memberships: Optional[int] = None r"""The maximum number of memberships allowed for this organization""" + created_at: Optional[str] = None + r"""A custom date/time denoting _when_ the organization was created, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`).""" diff --git a/src/clerk_backend_api/models/createuserop.py b/src/clerk_backend_api/models/createuserop.py index 515dc2a2..c16405d 100644 --- a/src/clerk_backend_api/models/createuserop.py +++ b/src/clerk_backend_api/models/createuserop.py @@ -2,152 +2,11 @@ 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, TypedDict from typing_extensions import NotRequired -class PasswordHasher(str, Enum): - r"""The hashing algorithm that was used to generate the password digest. - The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), - [md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), - [phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), - [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [sha256](https://en.wikipedia.org/wiki/SHA-2) - and the [argon2](https://argon2.online/) variants argon2i and argon2id. - - If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). - - Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. - Insecure schemes are marked with `(insecure)` in the list below. - - Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: - - **bcrypt:** The digest should be of the following form: - - `$$$` - - **bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): - - `bcrypt_sha256$$$$` - - **md5** (insecure): The digest should follow the regular form e.g.: - - `5f4dcc3b5aa765d61d8327deb882cf99` - - **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: - - `pbkdf2_sha256$$$` - - Note: Both the salt and the hash are expected to be base64-encoded. - - **pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: - - `pbkdf2_sha512$$$` - - _iterations:_ The number of iterations used. Must be an integer less than 420000. - _salt:_ The salt used when generating the hash. Must be less than 1024 bytes. - _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. - - **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): - - `pbkdf2_sha256$$$` - - Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. - - **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: - 1. uses sha1 instead of sha256 - 2. accepts the hash as a hex-encoded string - - The format is the following: - - `pbkdf2_sha1$$$` - - **phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: - - The format is the following: - - `$P$` - - - $P$ is the prefix used to identify phpass hashes. - - rounds is a single character encoding a 6-bit integer representing the number of rounds used. - - salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. - - checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. - - **scrypt_firebase:** The Firebase-specific variant of scrypt. - The value is expected to have 6 segments separated by the $ character and include the following information: - - _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. - _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. - _signer key:_ The base64 encoded signer key. - _salt separator:_ The base64 encoded salt separator. - _rounds:_ The number of rounds the algorithm needs to run. - _memory cost:_ The cost of the algorithm run - - The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. - The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. - - Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: - - `$$$$$` - - **scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. - - The value is expected to have 3 segments separated by the $ character and include the following information: - - _algorithm args:_ The algorithm used to generate the hash. - _salt:_ The salt used to generate the above hash. - _hash:_ The actual Base64 hash. - - The algorithm args are the parameters used to generate the hash and are included in the digest. - - **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: - - _version (v):_ The argon version, version 19 is assumed - _memory (m):_ The memory used by the algorithm (in kibibytes) - _iterations (t):_ The number of iterations to perform - _parallelism (p):_ The number of threads to use - - Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. - The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). - The final part is the actual digest. - - `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` - - **argon2id:** See the previous algorithm for an explanation of the formatting. - - For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: - - `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` - - **sha256** (insecure): The digest should be a 64-length hex string, e.g.: - - `9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` - - **sha256_salted** (insecure): The digest should be a 64-length hex string with a salt. - - The format is the following: - `$` - - The value is expected to have 2 segments separated by the $ character and include the following information: - _hash:_ The sha256 hash, a 64-length hex string. - _salt:_ The salt used to generate the above hash. Must be between 1 and 1024 bits. - """ - ARGON2I = "argon2i" - ARGON2ID = "argon2id" - BCRYPT = "bcrypt" - BCRYPT_SHA256_DJANGO = "bcrypt_sha256_django" - MD5 = "md5" - PBKDF2_SHA256 = "pbkdf2_sha256" - PBKDF2_SHA512 = "pbkdf2_sha512" - PBKDF2_SHA256_DJANGO = "pbkdf2_sha256_django" - PBKDF2_SHA1 = "pbkdf2_sha1" - PHPASS = "phpass" - SCRYPT_FIREBASE = "scrypt_firebase" - SCRYPT_WERKZEUG = "scrypt_werkzeug" - SHA256 = "sha256" - SHA256_SALTED = "sha256_salted" - class CreateUserPublicMetadataTypedDict(TypedDict): r"""Metadata saved on the user, that is visible to both your Frontend and Backend APIs""" @@ -219,130 +78,15 @@ class CreateUserRequestBodyTypedDict(TypedDict): The digests should be generated with one of the supported algorithms. The hashing algorithm can be specified using the `password_hasher` property. """ - password_hasher: NotRequired[PasswordHasher] + password_hasher: NotRequired[str] r"""The hashing algorithm that was used to generate the password digest. - The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), - [md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), - [phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), - [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [sha256](https://en.wikipedia.org/wiki/SHA-2) - and the [argon2](https://argon2.online/) variants argon2i and argon2id. - - If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). - - Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. - Insecure schemes are marked with `(insecure)` in the list below. - - Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: - - **bcrypt:** The digest should be of the following form: - - `$$$` - - **bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): - - `bcrypt_sha256$$$$` - - **md5** (insecure): The digest should follow the regular form e.g.: - - `5f4dcc3b5aa765d61d8327deb882cf99` - - **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: - - `pbkdf2_sha256$$$` - - Note: Both the salt and the hash are expected to be base64-encoded. - - **pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: - - `pbkdf2_sha512$$$` - - _iterations:_ The number of iterations used. Must be an integer less than 420000. - _salt:_ The salt used when generating the hash. Must be less than 1024 bytes. - _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. - - **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): - - `pbkdf2_sha256$$$` - - Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. - - **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: - 1. uses sha1 instead of sha256 - 2. accepts the hash as a hex-encoded string - - The format is the following: - - `pbkdf2_sha1$$$` - - **phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: - - The format is the following: - - `$P$` - - - $P$ is the prefix used to identify phpass hashes. - - rounds is a single character encoding a 6-bit integer representing the number of rounds used. - - salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. - - checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. - - **scrypt_firebase:** The Firebase-specific variant of scrypt. - The value is expected to have 6 segments separated by the $ character and include the following information: - - _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. - _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. - _signer key:_ The base64 encoded signer key. - _salt separator:_ The base64 encoded salt separator. - _rounds:_ The number of rounds the algorithm needs to run. - _memory cost:_ The cost of the algorithm run - The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. - The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. + The algorithms we support at the moment are [`bcrypt`](https://en.wikipedia.org/wiki/Bcrypt), [`bcrypt_sha256_django`](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [`md5`](https://en.wikipedia.org/wiki/MD5), `pbkdf2_sha1`, `pbkdf2_sha256`, [`pbkdf2_sha256_django`](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + [`phpass`](https://www.openwall.com/phpass/), [`scrypt_firebase`](https://firebaseopensource.com/projects/firebase/scrypt/), + [`scrypt_werkzeug`](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [`sha256`](https://en.wikipedia.org/wiki/SHA-2), + and the [`argon2`](https://argon2.online/) variants: `argon2i` and `argon2id`. - Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: - - `$$$$$` - - **scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. - - The value is expected to have 3 segments separated by the $ character and include the following information: - - _algorithm args:_ The algorithm used to generate the hash. - _salt:_ The salt used to generate the above hash. - _hash:_ The actual Base64 hash. - - The algorithm args are the parameters used to generate the hash and are included in the digest. - - **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: - - _version (v):_ The argon version, version 19 is assumed - _memory (m):_ The memory used by the algorithm (in kibibytes) - _iterations (t):_ The number of iterations to perform - _parallelism (p):_ The number of threads to use - - Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. - The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). - The final part is the actual digest. - - `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` - - **argon2id:** See the previous algorithm for an explanation of the formatting. - - For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: - - `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` - - **sha256** (insecure): The digest should be a 64-length hex string, e.g.: - - `9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` - - **sha256_salted** (insecure): The digest should be a 64-length hex string with a salt. - - The format is the following: - `$` - - The value is expected to have 2 segments separated by the $ character and include the following information: - _hash:_ The sha256 hash, a 64-length hex string. - _salt:_ The salt used to generate the above hash. Must be between 1 and 1024 bits. + Each of the supported hashers expects the incoming digest to be in a particular format. See the [Clerk docs](https://clerk.com/docs/references/backend/user/create-user) for more information. """ skip_password_checks: NotRequired[bool] r"""When set to `true` all password checks are skipped. @@ -372,6 +116,24 @@ class CreateUserRequestBodyTypedDict(TypedDict): unsafe_metadata: NotRequired[CreateUserUnsafeMetadataTypedDict] r"""Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + """ + delete_self_enabled: NotRequired[Nullable[bool]] + r"""If enabled, user can delete themselves via FAPI. + + """ + legal_accepted_at: NotRequired[Nullable[str]] + r"""A custom timestamp denoting _when_ the user accepted legal requirements, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`).""" + skip_legal_checks: NotRequired[Nullable[bool]] + r"""When set to `true` all legal checks are skipped. + It is not recommended to skip legal checks unless you are migrating a user to Clerk. + """ + create_organization_enabled: NotRequired[Nullable[bool]] + r"""If enabled, user can create organizations via FAPI. + + """ + create_organizations_limit: NotRequired[Nullable[int]] + r"""The maximum number of organizations the user can create. 0 means unlimited. + """ created_at: NotRequired[str] r"""A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`).""" @@ -414,130 +176,15 @@ class CreateUserRequestBody(BaseModel): The digests should be generated with one of the supported algorithms. The hashing algorithm can be specified using the `password_hasher` property. """ - password_hasher: Optional[PasswordHasher] = None + password_hasher: Optional[str] = None r"""The hashing algorithm that was used to generate the password digest. - The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), - [md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), - [phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), - [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [sha256](https://en.wikipedia.org/wiki/SHA-2) - and the [argon2](https://argon2.online/) variants argon2i and argon2id. - - If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). - - Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. - Insecure schemes are marked with `(insecure)` in the list below. - - Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: - - **bcrypt:** The digest should be of the following form: - - `$$$` - - **bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): - - `bcrypt_sha256$$$$` - - **md5** (insecure): The digest should follow the regular form e.g.: - - `5f4dcc3b5aa765d61d8327deb882cf99` - - **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: - - `pbkdf2_sha256$$$` - - Note: Both the salt and the hash are expected to be base64-encoded. - - **pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: - - `pbkdf2_sha512$$$` - _iterations:_ The number of iterations used. Must be an integer less than 420000. - _salt:_ The salt used when generating the hash. Must be less than 1024 bytes. - _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. + The algorithms we support at the moment are [`bcrypt`](https://en.wikipedia.org/wiki/Bcrypt), [`bcrypt_sha256_django`](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [`md5`](https://en.wikipedia.org/wiki/MD5), `pbkdf2_sha1`, `pbkdf2_sha256`, [`pbkdf2_sha256_django`](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + [`phpass`](https://www.openwall.com/phpass/), [`scrypt_firebase`](https://firebaseopensource.com/projects/firebase/scrypt/), + [`scrypt_werkzeug`](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [`sha256`](https://en.wikipedia.org/wiki/SHA-2), + and the [`argon2`](https://argon2.online/) variants: `argon2i` and `argon2id`. - **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): - - `pbkdf2_sha256$$$` - - Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. - - **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: - 1. uses sha1 instead of sha256 - 2. accepts the hash as a hex-encoded string - - The format is the following: - - `pbkdf2_sha1$$$` - - **phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: - - The format is the following: - - `$P$` - - - $P$ is the prefix used to identify phpass hashes. - - rounds is a single character encoding a 6-bit integer representing the number of rounds used. - - salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. - - checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. - - **scrypt_firebase:** The Firebase-specific variant of scrypt. - The value is expected to have 6 segments separated by the $ character and include the following information: - - _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. - _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. - _signer key:_ The base64 encoded signer key. - _salt separator:_ The base64 encoded salt separator. - _rounds:_ The number of rounds the algorithm needs to run. - _memory cost:_ The cost of the algorithm run - - The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. - The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. - - Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: - - `$$$$$` - - **scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. - - The value is expected to have 3 segments separated by the $ character and include the following information: - - _algorithm args:_ The algorithm used to generate the hash. - _salt:_ The salt used to generate the above hash. - _hash:_ The actual Base64 hash. - - The algorithm args are the parameters used to generate the hash and are included in the digest. - - **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: - - _version (v):_ The argon version, version 19 is assumed - _memory (m):_ The memory used by the algorithm (in kibibytes) - _iterations (t):_ The number of iterations to perform - _parallelism (p):_ The number of threads to use - - Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. - The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). - The final part is the actual digest. - - `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` - - **argon2id:** See the previous algorithm for an explanation of the formatting. - - For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: - - `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` - - **sha256** (insecure): The digest should be a 64-length hex string, e.g.: - - `9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` - - **sha256_salted** (insecure): The digest should be a 64-length hex string with a salt. - - The format is the following: - `$` - - The value is expected to have 2 segments separated by the $ character and include the following information: - _hash:_ The sha256 hash, a 64-length hex string. - _salt:_ The salt used to generate the above hash. Must be between 1 and 1024 bits. + Each of the supported hashers expects the incoming digest to be in a particular format. See the [Clerk docs](https://clerk.com/docs/references/backend/user/create-user) for more information. """ skip_password_checks: Optional[bool] = None r"""When set to `true` all password checks are skipped. @@ -567,14 +214,32 @@ class CreateUserRequestBody(BaseModel): unsafe_metadata: Optional[CreateUserUnsafeMetadata] = None r"""Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + """ + delete_self_enabled: OptionalNullable[bool] = UNSET + r"""If enabled, user can delete themselves via FAPI. + + """ + legal_accepted_at: OptionalNullable[str] = UNSET + r"""A custom timestamp denoting _when_ the user accepted legal requirements, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`).""" + skip_legal_checks: OptionalNullable[bool] = UNSET + r"""When set to `true` all legal checks are skipped. + It is not recommended to skip legal checks unless you are migrating a user to Clerk. + """ + create_organization_enabled: OptionalNullable[bool] = UNSET + r"""If enabled, user can create organizations via FAPI. + + """ + create_organizations_limit: OptionalNullable[int] = UNSET + r"""The maximum number of organizations the user can create. 0 means unlimited. + """ created_at: Optional[str] = None r"""A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`).""" @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["external_id", "first_name", "last_name", "email_address", "phone_number", "web3_wallet", "username", "password", "password_digest", "password_hasher", "skip_password_checks", "skip_password_requirement", "totp_secret", "backup_codes", "public_metadata", "private_metadata", "unsafe_metadata", "created_at"] - nullable_fields = ["external_id", "first_name", "last_name", "username", "password"] + optional_fields = ["external_id", "first_name", "last_name", "email_address", "phone_number", "web3_wallet", "username", "password", "password_digest", "password_hasher", "skip_password_checks", "skip_password_requirement", "totp_secret", "backup_codes", "public_metadata", "private_metadata", "unsafe_metadata", "delete_self_enabled", "legal_accepted_at", "skip_legal_checks", "create_organization_enabled", "create_organizations_limit", "created_at"] + nullable_fields = ["external_id", "first_name", "last_name", "username", "password", "delete_self_enabled", "legal_accepted_at", "skip_legal_checks", "create_organization_enabled", "create_organizations_limit"] null_default_fields = [] serialized = handler(self) diff --git a/src/clerk_backend_api/models/createusertotpop.py b/src/clerk_backend_api/models/createusertotpop.py new file mode 100644 index 0000000..c8f480a --- /dev/null +++ b/src/clerk_backend_api/models/createusertotpop.py @@ -0,0 +1,18 @@ +"""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 typing import TypedDict +from typing_extensions import Annotated + + +class CreateUserTOTPRequestTypedDict(TypedDict): + user_id: str + r"""The ID of the user for whom the TOTP is being created.""" + + +class CreateUserTOTPRequest(BaseModel): + user_id: Annotated[str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))] + r"""The ID of the user for whom the TOTP is being created.""" + diff --git a/src/clerk_backend_api/models/deletebackupcodeop.py b/src/clerk_backend_api/models/deletebackupcodeop.py new file mode 100644 index 0000000..335ff19 --- /dev/null +++ b/src/clerk_backend_api/models/deletebackupcodeop.py @@ -0,0 +1,30 @@ +"""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 typing import Optional, TypedDict +from typing_extensions import Annotated, NotRequired + + +class DeleteBackupCodeRequestTypedDict(TypedDict): + user_id: str + r"""The ID of the user whose backup codes are to be deleted.""" + + +class DeleteBackupCodeRequest(BaseModel): + user_id: Annotated[str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))] + r"""The ID of the user whose backup codes are to be deleted.""" + + +class DeleteBackupCodeResponseBodyTypedDict(TypedDict): + r"""Successful operation.""" + + user_id: NotRequired[str] + + +class DeleteBackupCodeResponseBody(BaseModel): + r"""Successful operation.""" + + user_id: Optional[str] = None + diff --git a/src/clerk_backend_api/models/deleteexternalaccountop.py b/src/clerk_backend_api/models/deleteexternalaccountop.py new file mode 100644 index 0000000..d608f73 --- /dev/null +++ b/src/clerk_backend_api/models/deleteexternalaccountop.py @@ -0,0 +1,22 @@ +"""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 typing import TypedDict +from typing_extensions import Annotated + + +class DeleteExternalAccountRequestTypedDict(TypedDict): + user_id: str + r"""The ID of the user's external account""" + external_account_id: str + r"""The ID of the external account to delete""" + + +class DeleteExternalAccountRequest(BaseModel): + user_id: Annotated[str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))] + r"""The ID of the user's external account""" + external_account_id: Annotated[str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))] + r"""The ID of the external account to delete""" + diff --git a/src/clerk_backend_api/models/deleteorganizationdomainop.py b/src/clerk_backend_api/models/deleteorganizationdomainop.py new file mode 100644 index 0000000..2039c63 --- /dev/null +++ b/src/clerk_backend_api/models/deleteorganizationdomainop.py @@ -0,0 +1,22 @@ +"""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 typing import TypedDict +from typing_extensions import Annotated + + +class DeleteOrganizationDomainRequestTypedDict(TypedDict): + organization_id: str + r"""The ID of the organization the domain belongs to""" + domain_id: str + r"""The ID of the domain""" + + +class DeleteOrganizationDomainRequest(BaseModel): + organization_id: Annotated[str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))] + r"""The ID of the organization the domain belongs to""" + domain_id: Annotated[str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))] + r"""The ID of the domain""" + diff --git a/src/clerk_backend_api/models/deletetotpop.py b/src/clerk_backend_api/models/deletetotpop.py new file mode 100644 index 0000000..ffdff3a --- /dev/null +++ b/src/clerk_backend_api/models/deletetotpop.py @@ -0,0 +1,30 @@ +"""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 typing import Optional, TypedDict +from typing_extensions import Annotated, NotRequired + + +class DeleteTOTPRequestTypedDict(TypedDict): + user_id: str + r"""The ID of the user whose TOTPs are to be deleted""" + + +class DeleteTOTPRequest(BaseModel): + user_id: Annotated[str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))] + r"""The ID of the user whose TOTPs are to be deleted""" + + +class DeleteTOTPResponseBodyTypedDict(TypedDict): + r"""Successful operation.""" + + user_id: NotRequired[str] + + +class DeleteTOTPResponseBody(BaseModel): + r"""Successful operation.""" + + user_id: Optional[str] = None + diff --git a/src/clerk_backend_api/models/emailaddress.py b/src/clerk_backend_api/models/emailaddress.py index 58b571a..24ab57a 100644 --- a/src/clerk_backend_api/models/emailaddress.py +++ b/src/clerk_backend_api/models/emailaddress.py @@ -62,7 +62,7 @@ class ErrorClerkError(BaseModel): class OauthTypedDict(TypedDict): status: OauthVerificationStatus strategy: OauthVerificationStrategy - expire_at: Nullable[int] + expire_at: int external_verification_redirect_url: NotRequired[str] error: NotRequired[Nullable[ErrorTypedDict]] attempts: NotRequired[Nullable[int]] @@ -71,7 +71,7 @@ class OauthTypedDict(TypedDict): class Oauth(BaseModel): status: OauthVerificationStatus strategy: OauthVerificationStrategy - expire_at: Nullable[int] + expire_at: int external_verification_redirect_url: Optional[str] = None error: OptionalNullable[Error] = UNSET attempts: OptionalNullable[int] = UNSET @@ -79,7 +79,7 @@ class Oauth(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = ["external_verification_redirect_url", "error", "attempts"] - nullable_fields = ["expire_at", "error", "attempts"] + nullable_fields = ["error", "attempts"] null_default_fields = [] serialized = handler(self) @@ -108,7 +108,6 @@ class AdminVerificationStatus(str, Enum): class VerificationStrategy(str, Enum): ADMIN = "admin" - FROM_OAUTH_DISCORD = "from_oauth_discord" class AdminTypedDict(TypedDict): status: AdminVerificationStatus @@ -167,42 +166,16 @@ class Strategy(str, Enum): class OtpTypedDict(TypedDict): status: VerificationStatus strategy: Strategy - attempts: Nullable[int] - expire_at: Nullable[int] + attempts: int + expire_at: int class Otp(BaseModel): status: VerificationStatus strategy: Strategy - attempts: Nullable[int] - expire_at: Nullable[int] + attempts: int + expire_at: int - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [] - nullable_fields = ["attempts", "expire_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) - - 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 - VerificationTypedDict = Union[OtpTypedDict, AdminTypedDict, OauthTypedDict] diff --git a/src/clerk_backend_api/models/getclientlistop.py b/src/clerk_backend_api/models/getclientlistop.py index dcc0eb9..fd79458 100644 --- a/src/clerk_backend_api/models/getclientlistop.py +++ b/src/clerk_backend_api/models/getclientlistop.py @@ -1,10 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .client import Client, ClientTypedDict from clerk_backend_api.types import BaseModel from clerk_backend_api.utils import FieldMetadata, QueryParamMetadata -from typing import Callable, List, Optional, TypedDict +from typing import Optional, TypedDict from typing_extensions import Annotated, NotRequired @@ -31,13 +30,3 @@ class GetClientListRequest(BaseModel): To be used in conjunction with `limit`. """ - -class GetClientListResponseTypedDict(TypedDict): - result: List[ClientTypedDict] - - -class GetClientListResponse(BaseModel): - next: Callable[[], Optional[GetClientListResponse]] - - result: List[Client] - diff --git a/src/clerk_backend_api/models/getorganizationop.py b/src/clerk_backend_api/models/getorganizationop.py index 45d5393..dadaa82 100644 --- a/src/clerk_backend_api/models/getorganizationop.py +++ b/src/clerk_backend_api/models/getorganizationop.py @@ -2,17 +2,21 @@ from __future__ import annotations from clerk_backend_api.types import BaseModel -from clerk_backend_api.utils import FieldMetadata, PathParamMetadata -from typing import TypedDict -from typing_extensions import Annotated +from clerk_backend_api.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from typing import Optional, TypedDict +from typing_extensions import Annotated, NotRequired class GetOrganizationRequestTypedDict(TypedDict): organization_id: str r"""The ID or slug of the organization""" + include_members_count: NotRequired[bool] + r"""Flag to denote whether or not the organization's members count should be included in the response.""" class GetOrganizationRequest(BaseModel): organization_id: Annotated[str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))] r"""The ID or slug of the organization""" + include_members_count: Annotated[Optional[bool], FieldMetadata(query=QueryParamMetadata(style="form", explode=True))] = None + r"""Flag to denote whether or not the organization's members count should be included in the response.""" diff --git a/src/clerk_backend_api/models/gettemplatelistop.py b/src/clerk_backend_api/models/gettemplatelistop.py deleted file mode 100644 index a52b31c..0000000 --- a/src/clerk_backend_api/models/gettemplatelistop.py +++ /dev/null @@ -1,24 +0,0 @@ -"""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 enum import Enum -from typing import TypedDict -from typing_extensions import Annotated - - -class TemplateType(str, Enum): - r"""The type of templates to list (email or SMS)""" - EMAIL = "email" - SMS = "sms" - -class GetTemplateListRequestTypedDict(TypedDict): - template_type: TemplateType - r"""The type of templates to list (email or SMS)""" - - -class GetTemplateListRequest(BaseModel): - template_type: Annotated[TemplateType, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))] - r"""The type of templates to list (email or SMS)""" - diff --git a/src/clerk_backend_api/models/identificationlink.py b/src/clerk_backend_api/models/identificationlink.py index cb4aa38..801dc08 100644 --- a/src/clerk_backend_api/models/identificationlink.py +++ b/src/clerk_backend_api/models/identificationlink.py @@ -10,8 +10,8 @@ class Type(str, Enum): OAUTH_GOOGLE = "oauth_google" OAUTH_MOCK = "oauth_mock" SAML = "saml" - OAUTH_DISCORD = "oauth_discord" OAUTH_APPLE = "oauth_apple" + OAUTH_DISCORD = "oauth_discord" class IdentificationLinkTypedDict(TypedDict): type: Type diff --git a/src/clerk_backend_api/models/instancegetorganizationmembershipsop.py b/src/clerk_backend_api/models/instancegetorganizationmembershipsop.py new file mode 100644 index 0000000..d947833 --- /dev/null +++ b/src/clerk_backend_api/models/instancegetorganizationmembershipsop.py @@ -0,0 +1,42 @@ +"""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 typing import Optional, TypedDict +from typing_extensions import Annotated, NotRequired + + +class InstanceGetOrganizationMembershipsRequestTypedDict(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`. + """ + order_by: NotRequired[str] + r"""Sorts organizations memberships by phone_number, email_address, created_at, first_name, last_name or username. + By prepending one of those values with + or -, + we can choose to sort in ascending (ASC) or descending (DESC) order. + """ + + +class InstanceGetOrganizationMembershipsRequest(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`. + """ + order_by: Annotated[Optional[str], FieldMetadata(query=QueryParamMetadata(style="form", explode=True))] = None + r"""Sorts organizations memberships by phone_number, email_address, created_at, first_name, last_name or username. + By prepending one of those values with + or -, + we can choose to sort in ascending (ASC) or descending (DESC) order. + """ + diff --git a/src/clerk_backend_api/models/invitation.py b/src/clerk_backend_api/models/invitation.py index 446e60b..044a869 100644 --- a/src/clerk_backend_api/models/invitation.py +++ b/src/clerk_backend_api/models/invitation.py @@ -23,6 +23,7 @@ class InvitationStatus(str, Enum): PENDING = "pending" ACCEPTED = "accepted" REVOKED = "revoked" + EXPIRED = "expired" class InvitationTypedDict(TypedDict): object: InvitationObject @@ -40,6 +41,10 @@ class InvitationTypedDict(TypedDict): public_metadata: NotRequired[InvitationPublicMetadataTypedDict] revoked: NotRequired[bool] url: NotRequired[Nullable[str]] + expires_at: NotRequired[Nullable[int]] + r"""Unix timestamp of expiration. + + """ class Invitation(BaseModel): @@ -58,11 +63,15 @@ class Invitation(BaseModel): public_metadata: Optional[InvitationPublicMetadata] = 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"] - nullable_fields = ["url"] + optional_fields = ["public_metadata", "revoked", "url", "expires_at"] + nullable_fields = ["url", "expires_at"] null_default_fields = [] serialized = handler(self) diff --git a/src/clerk_backend_api/models/invitation_revoked.py b/src/clerk_backend_api/models/invitation_revoked.py index 50de06b..c9b2b57 100644 --- a/src/clerk_backend_api/models/invitation_revoked.py +++ b/src/clerk_backend_api/models/invitation_revoked.py @@ -38,6 +38,10 @@ class InvitationRevokedTypedDict(TypedDict): public_metadata: NotRequired[InvitationRevokedPublicMetadataTypedDict] revoked: NotRequired[bool] url: NotRequired[Nullable[str]] + expires_at: NotRequired[Nullable[int]] + r"""Unix timestamp of expiration. + + """ class InvitationRevoked(BaseModel): @@ -56,11 +60,15 @@ class InvitationRevoked(BaseModel): public_metadata: Optional[InvitationRevokedPublicMetadata] = 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"] - nullable_fields = ["url"] + optional_fields = ["public_metadata", "revoked", "url", "expires_at"] + nullable_fields = ["url", "expires_at"] null_default_fields = [] serialized = handler(self) diff --git a/src/clerk_backend_api/models/listinstanceorganizationinvitationsop.py b/src/clerk_backend_api/models/listinstanceorganizationinvitationsop.py new file mode 100644 index 0000000..f34a56b --- /dev/null +++ b/src/clerk_backend_api/models/listinstanceorganizationinvitationsop.py @@ -0,0 +1,63 @@ +"""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, TypedDict +from typing_extensions import Annotated, NotRequired + + +class ListInstanceOrganizationInvitationsQueryParamStatus(str, Enum): + r"""Filter organization invitations based on their status""" + PENDING = "pending" + ACCEPTED = "accepted" + REVOKED = "revoked" + +class ListInstanceOrganizationInvitationsRequestTypedDict(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`. + """ + order_by: NotRequired[str] + r"""Allows to return organization invitations in a particular order. + At the moment, you can order the returned organization invitations either by their `created_at` or `email_address`. + In order to specify the direction, you can use the `+/-` symbols prepended in the property to order by. + For example, if you want organization invitations 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. + Defaults to `-created_at`. + """ + status: NotRequired[ListInstanceOrganizationInvitationsQueryParamStatus] + r"""Filter organization invitations based on their status""" + query: NotRequired[str] + r"""Filter organization invitations based on their `email_address`""" + + +class ListInstanceOrganizationInvitationsRequest(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`. + """ + order_by: Annotated[Optional[str], FieldMetadata(query=QueryParamMetadata(style="form", explode=True))] = "-created_at" + r"""Allows to return organization invitations in a particular order. + At the moment, you can order the returned organization invitations either by their `created_at` or `email_address`. + In order to specify the direction, you can use the `+/-` symbols prepended in the property to order by. + For example, if you want organization invitations 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. + Defaults to `-created_at`. + """ + status: Annotated[Optional[ListInstanceOrganizationInvitationsQueryParamStatus], FieldMetadata(query=QueryParamMetadata(style="form", explode=True))] = None + r"""Filter organization invitations based on their status""" + query: Annotated[Optional[str], FieldMetadata(query=QueryParamMetadata(style="form", explode=True))] = None + r"""Filter organization invitations based on their `email_address`""" + diff --git a/src/clerk_backend_api/models/listinvitationsop.py b/src/clerk_backend_api/models/listinvitationsop.py index f335eb2..b691175 100644 --- a/src/clerk_backend_api/models/listinvitationsop.py +++ b/src/clerk_backend_api/models/listinvitationsop.py @@ -1,11 +1,10 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .invitation import Invitation, InvitationTypedDict from clerk_backend_api.types import BaseModel from clerk_backend_api.utils import FieldMetadata, QueryParamMetadata from enum import Enum -from typing import Callable, List, Optional, TypedDict +from typing import Optional, TypedDict from typing_extensions import Annotated, NotRequired @@ -14,6 +13,7 @@ class ListInvitationsQueryParamStatus(str, Enum): PENDING = "pending" ACCEPTED = "accepted" REVOKED = "revoked" + EXPIRED = "expired" class ListInvitationsRequestTypedDict(TypedDict): limit: NotRequired[int] @@ -42,13 +42,3 @@ class ListInvitationsRequest(BaseModel): status: Annotated[Optional[ListInvitationsQueryParamStatus], FieldMetadata(query=QueryParamMetadata(style="form", explode=True))] = None r"""Filter invitations based on their status""" - -class ListInvitationsResponseTypedDict(TypedDict): - result: List[InvitationTypedDict] - - -class ListInvitationsResponse(BaseModel): - next: Callable[[], Optional[ListInvitationsResponse]] - - result: List[Invitation] - diff --git a/src/clerk_backend_api/models/listoauthapplicationsop.py b/src/clerk_backend_api/models/listoauthapplicationsop.py index 4a7c6dd..bfb2201 100644 --- a/src/clerk_backend_api/models/listoauthapplicationsop.py +++ b/src/clerk_backend_api/models/listoauthapplicationsop.py @@ -1,10 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .oauthapplications import OAuthApplications, OAuthApplicationsTypedDict from clerk_backend_api.types import BaseModel from clerk_backend_api.utils import FieldMetadata, QueryParamMetadata -from typing import Callable, Optional, TypedDict +from typing import Optional, TypedDict from typing_extensions import Annotated, NotRequired @@ -31,13 +30,3 @@ class ListOAuthApplicationsRequest(BaseModel): To be used in conjunction with `limit`. """ - -class ListOAuthApplicationsResponseTypedDict(TypedDict): - result: OAuthApplicationsTypedDict - - -class ListOAuthApplicationsResponse(BaseModel): - next: Callable[[], Optional[ListOAuthApplicationsResponse]] - - result: OAuthApplications - diff --git a/src/clerk_backend_api/models/listorganizationdomainsop.py b/src/clerk_backend_api/models/listorganizationdomainsop.py new file mode 100644 index 0000000..0f74c70 --- /dev/null +++ b/src/clerk_backend_api/models/listorganizationdomainsop.py @@ -0,0 +1,44 @@ +"""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, QueryParamMetadata +from typing import Optional, TypedDict +from typing_extensions import Annotated, NotRequired + + +class ListOrganizationDomainsRequestTypedDict(TypedDict): + organization_id: str + r"""The organization ID.""" + 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`. + """ + verified: NotRequired[str] + r"""Filter domains by their verification status. `true` or `false`""" + enrollment_mode: NotRequired[str] + r"""Filter domains by their enrollment mode""" + + +class ListOrganizationDomainsRequest(BaseModel): + organization_id: Annotated[str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))] + r"""The organization ID.""" + 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`. + """ + verified: Annotated[Optional[str], FieldMetadata(query=QueryParamMetadata(style="form", explode=True))] = None + r"""Filter domains by their verification status. `true` or `false`""" + enrollment_mode: Annotated[Optional[str], FieldMetadata(query=QueryParamMetadata(style="form", explode=True))] = None + r"""Filter domains by their enrollment mode""" + diff --git a/src/clerk_backend_api/models/listorganizationinvitationsop.py b/src/clerk_backend_api/models/listorganizationinvitationsop.py index 57e82b6..3c2a8fc 100644 --- a/src/clerk_backend_api/models/listorganizationinvitationsop.py +++ b/src/clerk_backend_api/models/listorganizationinvitationsop.py @@ -1,11 +1,10 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .organizationinvitations import OrganizationInvitations, OrganizationInvitationsTypedDict from clerk_backend_api.types import BaseModel from clerk_backend_api.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata from enum import Enum -from typing import Callable, Optional, TypedDict +from typing import Optional, TypedDict from typing_extensions import Annotated, NotRequired @@ -46,13 +45,3 @@ class ListOrganizationInvitationsRequest(BaseModel): status: Annotated[Optional[ListOrganizationInvitationsQueryParamStatus], FieldMetadata(query=QueryParamMetadata(style="form", explode=True))] = None r"""Filter organization invitations based on their status""" - -class ListOrganizationInvitationsResponseTypedDict(TypedDict): - result: OrganizationInvitationsTypedDict - - -class ListOrganizationInvitationsResponse(BaseModel): - next: Callable[[], Optional[ListOrganizationInvitationsResponse]] - - result: OrganizationInvitations - diff --git a/src/clerk_backend_api/models/listorganizationmembershipsop.py b/src/clerk_backend_api/models/listorganizationmembershipsop.py index be5dd26..527dc55 100644 --- a/src/clerk_backend_api/models/listorganizationmembershipsop.py +++ b/src/clerk_backend_api/models/listorganizationmembershipsop.py @@ -1,10 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .organizationmemberships import OrganizationMemberships, OrganizationMembershipsTypedDict from clerk_backend_api.types import BaseModel from clerk_backend_api.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata -from typing import Callable, Optional, TypedDict +from typing import Optional, TypedDict from typing_extensions import Annotated, NotRequired @@ -45,13 +44,3 @@ class ListOrganizationMembershipsRequest(BaseModel): we can choose to sort in ascending (ASC) or descending (DESC) order.\" """ - -class ListOrganizationMembershipsResponseTypedDict(TypedDict): - result: OrganizationMembershipsTypedDict - - -class ListOrganizationMembershipsResponse(BaseModel): - next: Callable[[], Optional[ListOrganizationMembershipsResponse]] - - result: OrganizationMemberships - diff --git a/src/clerk_backend_api/models/listpendingorganizationinvitationsop.py b/src/clerk_backend_api/models/listpendingorganizationinvitationsop.py index 9f7779b..e5fe4fe 100644 --- a/src/clerk_backend_api/models/listpendingorganizationinvitationsop.py +++ b/src/clerk_backend_api/models/listpendingorganizationinvitationsop.py @@ -1,10 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .organizationinvitations import OrganizationInvitations, OrganizationInvitationsTypedDict from clerk_backend_api.types import BaseModel from clerk_backend_api.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata -from typing import Callable, Optional, TypedDict +from typing import Optional, TypedDict from typing_extensions import Annotated, NotRequired @@ -35,13 +34,3 @@ class ListPendingOrganizationInvitationsRequest(BaseModel): To be used in conjunction with `limit`. """ - -class ListPendingOrganizationInvitationsResponseTypedDict(TypedDict): - result: OrganizationInvitationsTypedDict - - -class ListPendingOrganizationInvitationsResponse(BaseModel): - next: Callable[[], Optional[ListPendingOrganizationInvitationsResponse]] - - result: OrganizationInvitations - diff --git a/src/clerk_backend_api/models/listsamlconnectionsop.py b/src/clerk_backend_api/models/listsamlconnectionsop.py index 52a4c48..cbb90c4 100644 --- a/src/clerk_backend_api/models/listsamlconnectionsop.py +++ b/src/clerk_backend_api/models/listsamlconnectionsop.py @@ -1,10 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .samlconnections import SAMLConnections, SAMLConnectionsTypedDict from clerk_backend_api.types import BaseModel from clerk_backend_api.utils import FieldMetadata, QueryParamMetadata -from typing import Callable, Optional, TypedDict +from typing import Optional, TypedDict from typing_extensions import Annotated, NotRequired @@ -31,13 +30,3 @@ class ListSAMLConnectionsRequest(BaseModel): To be used in conjunction with `limit`. """ - -class ListSAMLConnectionsResponseTypedDict(TypedDict): - result: SAMLConnectionsTypedDict - - -class ListSAMLConnectionsResponse(BaseModel): - next: Callable[[], Optional[ListSAMLConnectionsResponse]] - - result: SAMLConnections - diff --git a/src/clerk_backend_api/models/organizationdomain.py b/src/clerk_backend_api/models/organizationdomain.py new file mode 100644 index 0000000..efbcdf3 --- /dev/null +++ b/src/clerk_backend_api/models/organizationdomain.py @@ -0,0 +1,162 @@ +"""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 Optional, TypedDict +from typing_extensions import NotRequired + + +class OrganizationDomainObject(str, Enum): + r"""String representing the object's type. Objects of the same type share the same value. Always `organization_domain` + + """ + ORGANIZATION_DOMAIN = "organization_domain" + +class EnrollmentMode(str, Enum): + r"""Mode of enrollment for the domain""" + MANUAL_INVITATION = "manual_invitation" + AUTOMATIC_INVITATION = "automatic_invitation" + AUTOMATIC_SUGGESTION = "automatic_suggestion" + +class OrganizationDomainStatus(str, Enum): + r"""Status of the verification. It can be `unverified` or `verified`""" + UNVERIFIED = "unverified" + VERIFIED = "verified" + +class OrganizationDomainVerificationTypedDict(TypedDict): + r"""Verification details for the domain""" + + status: NotRequired[OrganizationDomainStatus] + r"""Status of the verification. It can be `unverified` or `verified`""" + strategy: NotRequired[str] + r"""Name of the strategy used to verify the domain""" + attempts: NotRequired[int] + r"""How many attempts have been made to verify the domain""" + expire_at: NotRequired[Nullable[int]] + r"""Unix timestamp of when the verification will expire""" + + +class OrganizationDomainVerification(BaseModel): + r"""Verification details for the domain""" + + status: Optional[OrganizationDomainStatus] = None + r"""Status of the verification. It can be `unverified` or `verified`""" + strategy: Optional[str] = None + r"""Name of the strategy used to verify the domain""" + attempts: Optional[int] = None + r"""How many attempts have been made to verify the domain""" + expire_at: OptionalNullable[int] = UNSET + r"""Unix timestamp of when the verification will expire""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["status", "strategy", "attempts", "expire_at"] + nullable_fields = ["expire_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) + + 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 OrganizationDomainTypedDict(TypedDict): + r"""An organization domain""" + + id: NotRequired[str] + r"""Unique identifier for the organization domain""" + object: NotRequired[OrganizationDomainObject] + r"""String representing the object's type. Objects of the same type share the same value. Always `organization_domain` + + """ + organization_id: NotRequired[str] + r"""Unique identifier for the organization""" + name: NotRequired[str] + r"""Name of the organization domain""" + enrollment_mode: NotRequired[EnrollmentMode] + r"""Mode of enrollment for the domain""" + affiliation_email_address: NotRequired[Nullable[str]] + r"""Affiliation email address for the domain, if available.""" + verification: NotRequired[Nullable[OrganizationDomainVerificationTypedDict]] + r"""Verification details for the domain""" + total_pending_invitations: NotRequired[int] + r"""Total number of pending invitations associated with this domain""" + total_pending_suggestions: NotRequired[int] + r"""Total number of pending suggestions associated with this domain""" + created_at: NotRequired[int] + r"""Unix timestamp when the domain was created""" + updated_at: NotRequired[int] + r"""Unix timestamp of the last update to the domain""" + + +class OrganizationDomain(BaseModel): + r"""An organization domain""" + + id: Optional[str] = None + r"""Unique identifier for the organization domain""" + object: Optional[OrganizationDomainObject] = None + r"""String representing the object's type. Objects of the same type share the same value. Always `organization_domain` + + """ + organization_id: Optional[str] = None + r"""Unique identifier for the organization""" + name: Optional[str] = None + r"""Name of the organization domain""" + enrollment_mode: Optional[EnrollmentMode] = None + r"""Mode of enrollment for the domain""" + affiliation_email_address: OptionalNullable[str] = UNSET + r"""Affiliation email address for the domain, if available.""" + verification: OptionalNullable[OrganizationDomainVerification] = UNSET + r"""Verification details for the domain""" + total_pending_invitations: Optional[int] = None + r"""Total number of pending invitations associated with this domain""" + total_pending_suggestions: Optional[int] = None + r"""Total number of pending suggestions associated with this domain""" + created_at: Optional[int] = None + r"""Unix timestamp when the domain was created""" + updated_at: Optional[int] = None + r"""Unix timestamp of the last update to the domain""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["id", "object", "organization_id", "name", "enrollment_mode", "affiliation_email_address", "verification", "total_pending_invitations", "total_pending_suggestions", "created_at", "updated_at"] + nullable_fields = ["affiliation_email_address", "verification"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + 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/organizationdomains.py b/src/clerk_backend_api/models/organizationdomains.py new file mode 100644 index 0000000..0e7804a --- /dev/null +++ b/src/clerk_backend_api/models/organizationdomains.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .organizationdomain import OrganizationDomain, OrganizationDomainTypedDict +from clerk_backend_api.types import BaseModel +from typing import List, TypedDict + + +class OrganizationDomainsTypedDict(TypedDict): + data: List[OrganizationDomainTypedDict] + total_count: int + r"""Total number of organization domains + + """ + + +class OrganizationDomains(BaseModel): + data: List[OrganizationDomain] + total_count: int + r"""Total number of organization domains + + """ + diff --git a/src/clerk_backend_api/models/organizationinvitation.py b/src/clerk_backend_api/models/organizationinvitation.py index cb626ae..a7c03d1 100644 --- a/src/clerk_backend_api/models/organizationinvitation.py +++ b/src/clerk_backend_api/models/organizationinvitation.py @@ -39,6 +39,7 @@ class OrganizationInvitationTypedDict(TypedDict): """ email_address: NotRequired[str] role: NotRequired[str] + role_name: NotRequired[str] organization_id: NotRequired[str] status: NotRequired[str] public_metadata: NotRequired[OrganizationInvitationPublicMetadataTypedDict] @@ -59,6 +60,7 @@ class OrganizationInvitation(BaseModel): """ email_address: Optional[str] = None role: Optional[str] = None + role_name: Optional[str] = None organization_id: Optional[str] = None status: Optional[str] = None public_metadata: Optional[OrganizationInvitationPublicMetadata] = None diff --git a/src/clerk_backend_api/models/organizationinvitationswithpublicorganizationdata.py b/src/clerk_backend_api/models/organizationinvitationswithpublicorganizationdata.py new file mode 100644 index 0000000..65105c0 --- /dev/null +++ b/src/clerk_backend_api/models/organizationinvitationswithpublicorganizationdata.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .organizationinvitationwithpublicorganizationdata import OrganizationInvitationWithPublicOrganizationData, OrganizationInvitationWithPublicOrganizationDataTypedDict +from clerk_backend_api.types import BaseModel +from typing import List, TypedDict + + +class OrganizationInvitationsWithPublicOrganizationDataTypedDict(TypedDict): + data: List[OrganizationInvitationWithPublicOrganizationDataTypedDict] + total_count: int + r"""Total number of organization invitations + + """ + + +class OrganizationInvitationsWithPublicOrganizationData(BaseModel): + data: List[OrganizationInvitationWithPublicOrganizationData] + total_count: int + r"""Total number of organization invitations + + """ + diff --git a/src/clerk_backend_api/models/organizationinvitationwithpublicorganizationdata.py b/src/clerk_backend_api/models/organizationinvitationwithpublicorganizationdata.py new file mode 100644 index 0000000..57b7c24 --- /dev/null +++ b/src/clerk_backend_api/models/organizationinvitationwithpublicorganizationdata.py @@ -0,0 +1,90 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from clerk_backend_api.types import BaseModel +from enum import Enum +from typing import Optional, TypedDict +from typing_extensions import NotRequired + + +class OrganizationInvitationWithPublicOrganizationDataObject(str, Enum): + r"""String representing the object's type. Objects of the same type share the same value. + + """ + ORGANIZATION_INVITATION = "organization_invitation" + +class OrganizationInvitationWithPublicOrganizationDataPublicMetadataTypedDict(TypedDict): + pass + + +class OrganizationInvitationWithPublicOrganizationDataPublicMetadata(BaseModel): + pass + + +class OrganizationInvitationWithPublicOrganizationDataPrivateMetadataTypedDict(TypedDict): + pass + + +class OrganizationInvitationWithPublicOrganizationDataPrivateMetadata(BaseModel): + pass + + +class PublicOrganizationDataTypedDict(TypedDict): + id: NotRequired[str] + name: NotRequired[str] + slug: NotRequired[str] + image_url: NotRequired[str] + has_image: NotRequired[bool] + + +class PublicOrganizationData(BaseModel): + id: Optional[str] = None + name: Optional[str] = None + slug: Optional[str] = None + image_url: Optional[str] = None + has_image: Optional[bool] = None + + +class OrganizationInvitationWithPublicOrganizationDataTypedDict(TypedDict): + r"""An organization invitation with public organization data populated""" + + id: NotRequired[str] + object: NotRequired[OrganizationInvitationWithPublicOrganizationDataObject] + r"""String representing the object's type. Objects of the same type share the same value. + + """ + email_address: NotRequired[str] + role: NotRequired[str] + role_name: NotRequired[str] + organization_id: NotRequired[str] + status: NotRequired[str] + public_metadata: NotRequired[OrganizationInvitationWithPublicOrganizationDataPublicMetadataTypedDict] + private_metadata: NotRequired[OrganizationInvitationWithPublicOrganizationDataPrivateMetadataTypedDict] + public_organization_data: NotRequired[PublicOrganizationDataTypedDict] + created_at: NotRequired[int] + r"""Unix timestamp of creation.""" + updated_at: NotRequired[int] + r"""Unix timestamp of last update.""" + + +class OrganizationInvitationWithPublicOrganizationData(BaseModel): + r"""An organization invitation with public organization data populated""" + + id: Optional[str] = None + object: Optional[OrganizationInvitationWithPublicOrganizationDataObject] = None + r"""String representing the object's type. Objects of the same type share the same value. + + """ + email_address: Optional[str] = None + role: Optional[str] = None + role_name: Optional[str] = None + organization_id: Optional[str] = None + status: Optional[str] = None + public_metadata: Optional[OrganizationInvitationWithPublicOrganizationDataPublicMetadata] = None + private_metadata: Optional[OrganizationInvitationWithPublicOrganizationDataPrivateMetadata] = None + public_organization_data: Optional[PublicOrganizationData] = None + created_at: Optional[int] = None + r"""Unix timestamp of creation.""" + updated_at: Optional[int] = None + r"""Unix timestamp of last update.""" + diff --git a/src/clerk_backend_api/models/organizationmembership.py b/src/clerk_backend_api/models/organizationmembership.py index a0cbb81..ba1f8b5 100644 --- a/src/clerk_backend_api/models/organizationmembership.py +++ b/src/clerk_backend_api/models/organizationmembership.py @@ -177,6 +177,7 @@ class OrganizationMembershipTypedDict(TypedDict): """ role: NotRequired[str] + role_name: NotRequired[str] permissions: NotRequired[List[str]] public_metadata: NotRequired[OrganizationMembershipPublicMetadataTypedDict] r"""Metadata saved on the organization membership, accessible from both Frontend and Backend APIs""" @@ -199,6 +200,7 @@ class OrganizationMembership(BaseModel): """ role: Optional[str] = None + role_name: Optional[str] = None permissions: Optional[List[str]] = None public_metadata: Optional[OrganizationMembershipPublicMetadata] = None r"""Metadata saved on the organization membership, accessible from both Frontend and Backend APIs""" diff --git a/src/clerk_backend_api/models/phonenumber.py b/src/clerk_backend_api/models/phonenumber.py index 9204556..cac0ddf 100644 --- a/src/clerk_backend_api/models/phonenumber.py +++ b/src/clerk_backend_api/models/phonenumber.py @@ -20,7 +20,6 @@ class AdminVerificationPhoneNumberStatus(str, Enum): class AdminVerificationStrategy(str, Enum): ADMIN = "admin" - FROM_OAUTH_DISCORD = "from_oauth_discord" class VerificationAdminTypedDict(TypedDict): status: AdminVerificationPhoneNumberStatus @@ -79,42 +78,16 @@ class OTPVerificationStrategy(str, Enum): class VerificationOTPTypedDict(TypedDict): status: OTPVerificationStatus strategy: OTPVerificationStrategy - attempts: Nullable[int] - expire_at: Nullable[int] + attempts: int + expire_at: int class VerificationOTP(BaseModel): status: OTPVerificationStatus strategy: OTPVerificationStrategy - attempts: Nullable[int] - expire_at: Nullable[int] + attempts: int + expire_at: int - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [] - nullable_fields = ["attempts", "expire_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) - - 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 - PhoneNumberVerificationTypedDict = Union[VerificationOTPTypedDict, VerificationAdminTypedDict] diff --git a/src/clerk_backend_api/models/reverttemplateop.py b/src/clerk_backend_api/models/reverttemplateop.py deleted file mode 100644 index be6a292..0000000 --- a/src/clerk_backend_api/models/reverttemplateop.py +++ /dev/null @@ -1,28 +0,0 @@ -"""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 enum import Enum -from typing import TypedDict -from typing_extensions import Annotated - - -class RevertTemplatePathParamTemplateType(str, Enum): - r"""The type of template to revert""" - EMAIL = "email" - SMS = "sms" - -class RevertTemplateRequestTypedDict(TypedDict): - template_type: RevertTemplatePathParamTemplateType - r"""The type of template to revert""" - slug: str - r"""The slug of the template to revert""" - - -class RevertTemplateRequest(BaseModel): - template_type: Annotated[RevertTemplatePathParamTemplateType, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))] - r"""The type of template to revert""" - slug: Annotated[str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))] - r"""The slug of the template to revert""" - diff --git a/src/clerk_backend_api/models/revokeorganizationinvitationop.py b/src/clerk_backend_api/models/revokeorganizationinvitationop.py index 2c3c706..10b3643 100644 --- a/src/clerk_backend_api/models/revokeorganizationinvitationop.py +++ b/src/clerk_backend_api/models/revokeorganizationinvitationop.py @@ -1,32 +1,59 @@ """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 clerk_backend_api.utils import FieldMetadata, PathParamMetadata, RequestMetadata -from typing import TypedDict -from typing_extensions import Annotated +from pydantic import model_serializer +from typing import Optional, TypedDict +from typing_extensions import Annotated, NotRequired class RevokeOrganizationInvitationRequestBodyTypedDict(TypedDict): - requesting_user_id: str + requesting_user_id: NotRequired[Nullable[str]] r"""The ID of the user that revokes the invitation. Must be an administrator in the organization. """ class RevokeOrganizationInvitationRequestBody(BaseModel): - requesting_user_id: str + requesting_user_id: OptionalNullable[str] = UNSET r"""The ID of the user that revokes the invitation. Must be an administrator in the organization. """ + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["requesting_user_id"] + nullable_fields = ["requesting_user_id"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + 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 RevokeOrganizationInvitationRequestTypedDict(TypedDict): organization_id: str r"""The organization ID.""" invitation_id: str r"""The organization invitation ID.""" - request_body: RevokeOrganizationInvitationRequestBodyTypedDict + request_body: NotRequired[RevokeOrganizationInvitationRequestBodyTypedDict] class RevokeOrganizationInvitationRequest(BaseModel): @@ -34,5 +61,5 @@ class RevokeOrganizationInvitationRequest(BaseModel): r"""The organization ID.""" invitation_id: Annotated[str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))] r"""The organization invitation ID.""" - request_body: Annotated[RevokeOrganizationInvitationRequestBody, FieldMetadata(request=RequestMetadata(media_type="application/json"))] + request_body: Annotated[Optional[RevokeOrganizationInvitationRequestBody], FieldMetadata(request=RequestMetadata(media_type="application/json"))] = None diff --git a/src/clerk_backend_api/models/samlaccount.py b/src/clerk_backend_api/models/samlaccount.py index e83e193..78f0d81 100644 --- a/src/clerk_backend_api/models/samlaccount.py +++ b/src/clerk_backend_api/models/samlaccount.py @@ -160,6 +160,52 @@ def serialize_model(self, handler): SAMLAccountVerification = Union[Ticket, Saml] +class SAMLConnectionSAMLConnectionTypedDict(TypedDict): + id: str + name: str + domain: str + active: bool + provider: str + sync_user_attributes: bool + created_at: int + r"""Unix timestamp of creation. + + """ + updated_at: int + r"""Unix timestamp of last update. + + """ + allow_subdomains: NotRequired[bool] + allow_idp_initiated: NotRequired[bool] + disable_additional_identifications: NotRequired[bool] + + +class SAMLConnectionSAMLConnection(BaseModel): + id: str + name: str + domain: str + active: bool + provider: str + sync_user_attributes: bool + created_at: int + r"""Unix timestamp of creation. + + """ + updated_at: int + r"""Unix timestamp of last update. + + """ + allow_subdomains: Optional[bool] = None + allow_idp_initiated: Optional[bool] = None + disable_additional_identifications: Optional[bool] = None + + +SamlConnectionTypedDict = SAMLConnectionSAMLConnectionTypedDict + + +SamlConnection = SAMLConnectionSAMLConnection + + class SAMLAccountTypedDict(TypedDict): id: str object: SAMLAccountObject @@ -174,6 +220,7 @@ class SAMLAccountTypedDict(TypedDict): last_name: NotRequired[Nullable[str]] provider_user_id: NotRequired[Nullable[str]] public_metadata: NotRequired[SAMLAccountPublicMetadataTypedDict] + saml_connection: NotRequired[Nullable[SamlConnectionTypedDict]] class SAMLAccount(BaseModel): @@ -190,11 +237,12 @@ class SAMLAccount(BaseModel): last_name: OptionalNullable[str] = UNSET provider_user_id: OptionalNullable[str] = UNSET public_metadata: Optional[SAMLAccountPublicMetadata] = None + saml_connection: OptionalNullable[SamlConnection] = UNSET @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["first_name", "last_name", "provider_user_id", "public_metadata"] - nullable_fields = ["verification", "first_name", "last_name", "provider_user_id"] + optional_fields = ["first_name", "last_name", "provider_user_id", "public_metadata", "saml_connection"] + nullable_fields = ["verification", "first_name", "last_name", "provider_user_id", "saml_connection"] null_default_fields = [] serialized = handler(self) diff --git a/src/clerk_backend_api/models/samlconnections.py b/src/clerk_backend_api/models/samlconnections.py index d18ea22..0d078df 100644 --- a/src/clerk_backend_api/models/samlconnections.py +++ b/src/clerk_backend_api/models/samlconnections.py @@ -1,13 +1,13 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .samlconnection import SAMLConnection, SAMLConnectionTypedDict +from .schemas_samlconnection import SchemasSAMLConnection, SchemasSAMLConnectionTypedDict from clerk_backend_api.types import BaseModel from typing import List, TypedDict class SAMLConnectionsTypedDict(TypedDict): - data: List[SAMLConnectionTypedDict] + data: List[SchemasSAMLConnectionTypedDict] total_count: int r"""Total number of SAML Connections @@ -15,7 +15,7 @@ class SAMLConnectionsTypedDict(TypedDict): class SAMLConnections(BaseModel): - data: List[SAMLConnection] + data: List[SchemasSAMLConnection] total_count: int r"""Total number of SAML Connections diff --git a/src/clerk_backend_api/models/schemas_passkey.py b/src/clerk_backend_api/models/schemas_passkey.py index 467811c..d5ac4f4 100644 --- a/src/clerk_backend_api/models/schemas_passkey.py +++ b/src/clerk_backend_api/models/schemas_passkey.py @@ -20,13 +20,13 @@ class PasskeyVerificationStatus(str, Enum): class PasskeyVerificationStrategy(str, Enum): PASSKEY = "passkey" -class VerificationNonce(str, Enum): +class Nonce(str, Enum): NONCE = "nonce" class PasskeyTypedDict(TypedDict): status: PasskeyVerificationStatus strategy: PasskeyVerificationStrategy - nonce: NotRequired[VerificationNonce] + nonce: NotRequired[Nonce] attempts: NotRequired[Nullable[int]] expire_at: NotRequired[Nullable[int]] @@ -34,7 +34,7 @@ class PasskeyTypedDict(TypedDict): class Passkey(BaseModel): status: PasskeyVerificationStatus strategy: PasskeyVerificationStrategy - nonce: Optional[VerificationNonce] = None + nonce: Optional[Nonce] = None attempts: OptionalNullable[int] = UNSET expire_at: OptionalNullable[int] = UNSET diff --git a/src/clerk_backend_api/models/samlconnection.py b/src/clerk_backend_api/models/schemas_samlconnection.py similarity index 87% rename from src/clerk_backend_api/models/samlconnection.py rename to src/clerk_backend_api/models/schemas_samlconnection.py index 9e3bfee..fb28964 100644 --- a/src/clerk_backend_api/models/samlconnection.py +++ b/src/clerk_backend_api/models/schemas_samlconnection.py @@ -8,7 +8,7 @@ from typing_extensions import NotRequired -class SAMLConnectionObject(str, Enum): +class SchemasSAMLConnectionObject(str, Enum): SAML_CONNECTION = "saml_connection" class AttributeMappingTypedDict(TypedDict): @@ -25,8 +25,8 @@ class AttributeMapping(BaseModel): last_name: Optional[str] = None -class SAMLConnectionTypedDict(TypedDict): - object: SAMLConnectionObject +class SchemasSAMLConnectionTypedDict(TypedDict): + object: SchemasSAMLConnectionObject id: str name: str domain: str @@ -53,10 +53,11 @@ class SAMLConnectionTypedDict(TypedDict): attribute_mapping: NotRequired[AttributeMappingTypedDict] allow_subdomains: NotRequired[bool] allow_idp_initiated: NotRequired[bool] + disable_additional_identifications: NotRequired[bool] -class SAMLConnection(BaseModel): - object: SAMLConnectionObject +class SchemasSAMLConnection(BaseModel): + object: SchemasSAMLConnectionObject id: str name: str domain: str @@ -83,10 +84,11 @@ class SAMLConnection(BaseModel): attribute_mapping: Optional[AttributeMapping] = None allow_subdomains: Optional[bool] = None allow_idp_initiated: Optional[bool] = None + disable_additional_identifications: Optional[bool] = None @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["idp_metadata_url", "idp_metadata", "attribute_mapping", "allow_subdomains", "allow_idp_initiated"] + optional_fields = ["idp_metadata_url", "idp_metadata", "attribute_mapping", "allow_subdomains", "allow_idp_initiated", "disable_additional_identifications"] nullable_fields = ["idp_entity_id", "idp_sso_url", "idp_certificate", "idp_metadata_url", "idp_metadata"] null_default_fields = [] diff --git a/src/clerk_backend_api/models/session.py b/src/clerk_backend_api/models/session.py index 1185f85..19fb926 100644 --- a/src/clerk_backend_api/models/session.py +++ b/src/clerk_backend_api/models/session.py @@ -4,7 +4,7 @@ from clerk_backend_api.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL from enum import Enum from pydantic import model_serializer -from typing import TypedDict +from typing import Optional, TypedDict from typing_extensions import NotRequired @@ -31,6 +31,30 @@ class Status(str, Enum): ABANDONED = "abandoned" REPLACED = "replaced" +class LatestActivityTypedDict(TypedDict): + object: str + id: str + device_type: NotRequired[str] + is_mobile: NotRequired[bool] + browser_name: NotRequired[str] + browser_version: NotRequired[str] + ip_address: NotRequired[str] + city: NotRequired[str] + country: NotRequired[str] + + +class LatestActivity(BaseModel): + object: str + id: str + device_type: Optional[str] = None + is_mobile: Optional[bool] = None + browser_name: Optional[str] = None + browser_version: Optional[str] = None + ip_address: Optional[str] = None + city: Optional[str] = None + country: Optional[str] = None + + class SessionTypedDict(TypedDict): object: SessionObject r"""String representing the object's type. Objects of the same type share the same value. @@ -53,6 +77,7 @@ class SessionTypedDict(TypedDict): """ actor: NotRequired[Nullable[ActorTypedDict]] last_active_organization_id: NotRequired[Nullable[str]] + latest_activity: NotRequired[Nullable[LatestActivityTypedDict]] class Session(BaseModel): @@ -77,11 +102,12 @@ class Session(BaseModel): """ actor: OptionalNullable[Actor] = UNSET last_active_organization_id: OptionalNullable[str] = UNSET + latest_activity: OptionalNullable[LatestActivity] = UNSET @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["actor", "last_active_organization_id"] - nullable_fields = ["actor", "last_active_organization_id"] + optional_fields = ["actor", "last_active_organization_id", "latest_activity"] + nullable_fields = ["actor", "last_active_organization_id", "latest_activity"] null_default_fields = [] serialized = handler(self) diff --git a/src/clerk_backend_api/models/template.py b/src/clerk_backend_api/models/template.py index d638d6c..11371bd 100644 --- a/src/clerk_backend_api/models/template.py +++ b/src/clerk_backend_api/models/template.py @@ -36,8 +36,8 @@ class TemplateTypedDict(TypedDict): r"""whether this template can be reverted to the corresponding system default""" can_delete: NotRequired[bool] r"""whether this template can be deleted""" - can_disable: NotRequired[bool] - r"""whether this template can be disabled, true only for notification SMS templates""" + can_toggle: NotRequired[bool] + r"""whether this template can be enabled or disabled, true only for notification SMS templates""" subject: NotRequired[Nullable[str]] r"""email subject""" markup: NotRequired[str] @@ -51,6 +51,7 @@ class TemplateTypedDict(TypedDict): from_email_name: NotRequired[str] reply_to_email_name: NotRequired[str] delivered_by_clerk: NotRequired[bool] + enabled: NotRequired[bool] updated_at: NotRequired[int] r"""Unix timestamp of last update. @@ -83,8 +84,8 @@ class Template(BaseModel): r"""whether this template can be reverted to the corresponding system default""" can_delete: Optional[bool] = None r"""whether this template can be deleted""" - can_disable: Optional[bool] = None - r"""whether this template can be disabled, true only for notification SMS templates""" + can_toggle: Optional[bool] = None + r"""whether this template can be enabled or disabled, true only for notification SMS templates""" subject: OptionalNullable[str] = UNSET r"""email subject""" markup: Optional[str] = None @@ -98,6 +99,7 @@ class Template(BaseModel): from_email_name: Optional[str] = None reply_to_email_name: Optional[str] = None delivered_by_clerk: Optional[bool] = None + enabled: Optional[bool] = None updated_at: Optional[int] = None r"""Unix timestamp of last update. @@ -109,7 +111,7 @@ class Template(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["id", "object", "instance_id", "resource_type", "template_type", "name", "slug", "position", "can_revert", "can_delete", "can_disable", "subject", "markup", "body", "available_variables", "required_variables", "from_email_name", "reply_to_email_name", "delivered_by_clerk", "updated_at", "created_at"] + optional_fields = ["id", "object", "instance_id", "resource_type", "template_type", "name", "slug", "position", "can_revert", "can_delete", "can_toggle", "subject", "markup", "body", "available_variables", "required_variables", "from_email_name", "reply_to_email_name", "delivered_by_clerk", "enabled", "updated_at", "created_at"] nullable_fields = ["instance_id", "subject"] null_default_fields = [] diff --git a/src/clerk_backend_api/models/totp.py b/src/clerk_backend_api/models/totp.py new file mode 100644 index 0000000..718e7dc --- /dev/null +++ b/src/clerk_backend_api/models/totp.py @@ -0,0 +1,64 @@ +"""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 +import pydantic +from pydantic import ConfigDict, model_serializer +from typing import Any, Dict, List, TypedDict +from typing_extensions import NotRequired + + +class TotpTypedDict(TypedDict): + object: str + id: str + secret: Nullable[str] + uri: Nullable[str] + verified: bool + backup_codes: NotRequired[Nullable[List[str]]] + + +class Totp(BaseModel): + model_config = ConfigDict(populate_by_name=True, arbitrary_types_allowed=True, extra="allow") + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + object: str + id: str + secret: Nullable[str] + uri: Nullable[str] + verified: bool + backup_codes: OptionalNullable[List[str]] = UNSET + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["backup_codes"] + nullable_fields = ["secret", "uri", "backup_codes"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + 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/updatedomainop.py b/src/clerk_backend_api/models/updatedomainop.py index 607f9d8..dc1f362 100644 --- a/src/clerk_backend_api/models/updatedomainop.py +++ b/src/clerk_backend_api/models/updatedomainop.py @@ -18,6 +18,11 @@ class UpdateDomainRequestBodyTypedDict(TypedDict): r"""The full URL of the proxy that will forward requests to Clerk's Frontend API. Can only be updated for production instances. """ + is_secondary: NotRequired[Nullable[bool]] + r"""Whether this is a domain for a secondary app, meaning that any subdomain provided is significant and + will be stored as part of the domain. This is useful for supporting multiple apps (one primary and + multiple secondaries) on the same root domain (eTLD+1). + """ class UpdateDomainRequestBody(BaseModel): @@ -30,11 +35,16 @@ class UpdateDomainRequestBody(BaseModel): r"""The full URL of the proxy that will forward requests to Clerk's Frontend API. Can only be updated for production instances. """ + is_secondary: OptionalNullable[bool] = UNSET + r"""Whether this is a domain for a secondary app, meaning that any subdomain provided is significant and + will be stored as part of the domain. This is useful for supporting multiple apps (one primary and + multiple secondaries) on the same root domain (eTLD+1). + """ @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["name", "proxy_url"] - nullable_fields = ["name", "proxy_url"] + optional_fields = ["name", "proxy_url", "is_secondary"] + nullable_fields = ["name", "proxy_url", "is_secondary"] null_default_fields = [] serialized = handler(self) diff --git a/src/clerk_backend_api/models/updateorganizationdomainop.py b/src/clerk_backend_api/models/updateorganizationdomainop.py new file mode 100644 index 0000000..69db094 --- /dev/null +++ b/src/clerk_backend_api/models/updateorganizationdomainop.py @@ -0,0 +1,65 @@ +"""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 pydantic import model_serializer +from typing import TypedDict +from typing_extensions import Annotated, NotRequired + + +class UpdateOrganizationDomainRequestBodyTypedDict(TypedDict): + enrollment_mode: NotRequired[Nullable[str]] + r"""The enrollment_mode for the new domain. This can be `automatic_invitation`, `automatic_suggestion` or `manual_invitation`""" + verified: NotRequired[Nullable[bool]] + r"""The status of the domain's verification""" + + +class UpdateOrganizationDomainRequestBody(BaseModel): + enrollment_mode: OptionalNullable[str] = UNSET + r"""The enrollment_mode for the new domain. This can be `automatic_invitation`, `automatic_suggestion` or `manual_invitation`""" + verified: OptionalNullable[bool] = UNSET + r"""The status of the domain's verification""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["enrollment_mode", "verified"] + nullable_fields = ["enrollment_mode", "verified"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + 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 UpdateOrganizationDomainRequestTypedDict(TypedDict): + organization_id: str + r"""The ID of the organization the domain belongs to""" + domain_id: str + r"""The ID of the domain""" + request_body: UpdateOrganizationDomainRequestBodyTypedDict + + +class UpdateOrganizationDomainRequest(BaseModel): + organization_id: Annotated[str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))] + r"""The ID of the organization the domain belongs to""" + domain_id: Annotated[str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))] + r"""The ID of the domain""" + request_body: Annotated[UpdateOrganizationDomainRequestBody, FieldMetadata(request=RequestMetadata(media_type="application/json"))] + diff --git a/src/clerk_backend_api/models/updateorganizationop.py b/src/clerk_backend_api/models/updateorganizationop.py index cffe61f..334502e 100644 --- a/src/clerk_backend_api/models/updateorganizationop.py +++ b/src/clerk_backend_api/models/updateorganizationop.py @@ -34,13 +34,17 @@ class UpdateOrganizationRequestBodyTypedDict(TypedDict): private_metadata: NotRequired[UpdateOrganizationPrivateMetadataTypedDict] r"""Metadata saved on the organization that is only visible to your backend.""" name: NotRequired[Nullable[str]] - r"""The new name of the organization""" + r"""The new name of the organization. + May not contain URLs or HTML. + """ slug: NotRequired[Nullable[str]] r"""The new slug of the organization, which needs to be unique in the instance""" max_allowed_memberships: NotRequired[Nullable[int]] r"""The maximum number of memberships allowed for this organization""" admin_delete_enabled: NotRequired[Nullable[bool]] r"""If true, an admin can delete this organization with the Frontend API.""" + created_at: NotRequired[str] + r"""A custom date/time denoting _when_ the organization was created, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`).""" class UpdateOrganizationRequestBody(BaseModel): @@ -49,17 +53,21 @@ class UpdateOrganizationRequestBody(BaseModel): private_metadata: Optional[UpdateOrganizationPrivateMetadata] = None r"""Metadata saved on the organization that is only visible to your backend.""" name: OptionalNullable[str] = UNSET - r"""The new name of the organization""" + r"""The new name of the organization. + May not contain URLs or HTML. + """ slug: OptionalNullable[str] = UNSET r"""The new slug of the organization, which needs to be unique in the instance""" max_allowed_memberships: OptionalNullable[int] = UNSET r"""The maximum number of memberships allowed for this organization""" admin_delete_enabled: OptionalNullable[bool] = UNSET r"""If true, an admin can delete this organization with the Frontend API.""" + created_at: Optional[str] = None + r"""A custom date/time denoting _when_ the organization was created, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`).""" @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["public_metadata", "private_metadata", "name", "slug", "max_allowed_memberships", "admin_delete_enabled"] + optional_fields = ["public_metadata", "private_metadata", "name", "slug", "max_allowed_memberships", "admin_delete_enabled", "created_at"] nullable_fields = ["name", "slug", "max_allowed_memberships", "admin_delete_enabled"] null_default_fields = [] diff --git a/src/clerk_backend_api/models/updatesamlconnectionop.py b/src/clerk_backend_api/models/updatesamlconnectionop.py index 776cda3..9aeda27 100644 --- a/src/clerk_backend_api/models/updatesamlconnectionop.py +++ b/src/clerk_backend_api/models/updatesamlconnectionop.py @@ -51,6 +51,8 @@ class UpdateSAMLConnectionRequestBodyTypedDict(TypedDict): r"""Allow users with an email address subdomain to use this connection in order to authenticate""" allow_idp_initiated: NotRequired[Nullable[bool]] r"""Enable or deactivate IdP-initiated flows""" + disable_additional_identifications: NotRequired[Nullable[bool]] + r"""Enable or deactivate additional identifications""" class UpdateSAMLConnectionRequestBody(BaseModel): @@ -78,11 +80,13 @@ class UpdateSAMLConnectionRequestBody(BaseModel): r"""Allow users with an email address subdomain to use this connection in order to authenticate""" allow_idp_initiated: OptionalNullable[bool] = UNSET r"""Enable or deactivate IdP-initiated flows""" + disable_additional_identifications: OptionalNullable[bool] = UNSET + r"""Enable or deactivate additional identifications""" @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["name", "domain", "idp_entity_id", "idp_sso_url", "idp_certificate", "idp_metadata_url", "idp_metadata", "attribute_mapping", "active", "sync_user_attributes", "allow_subdomains", "allow_idp_initiated"] - nullable_fields = ["name", "domain", "idp_entity_id", "idp_sso_url", "idp_certificate", "idp_metadata_url", "idp_metadata", "attribute_mapping", "active", "sync_user_attributes", "allow_subdomains", "allow_idp_initiated"] + optional_fields = ["name", "domain", "idp_entity_id", "idp_sso_url", "idp_certificate", "idp_metadata_url", "idp_metadata", "attribute_mapping", "active", "sync_user_attributes", "allow_subdomains", "allow_idp_initiated", "disable_additional_identifications"] + nullable_fields = ["name", "domain", "idp_entity_id", "idp_sso_url", "idp_certificate", "idp_metadata_url", "idp_metadata", "attribute_mapping", "active", "sync_user_attributes", "allow_subdomains", "allow_idp_initiated", "disable_additional_identifications"] null_default_fields = [] serialized = handler(self) diff --git a/src/clerk_backend_api/models/updatesignupop.py b/src/clerk_backend_api/models/updatesignupop.py index a1a5291..94749ce 100644 --- a/src/clerk_backend_api/models/updatesignupop.py +++ b/src/clerk_backend_api/models/updatesignupop.py @@ -9,11 +9,6 @@ class UpdateSignUpRequestBodyTypedDict(TypedDict): - custom_action: NotRequired[bool] - r"""Specifies whether a custom action has run for this sign-up attempt. - This is important when your instance has been configured to require a custom action to run before converting a sign-up into a user. - After executing any external business logic you deem necessary, you can mark the sign-up as ready-to-convert by setting `custom_action` to `true`. - """ external_id: NotRequired[Nullable[str]] r"""The ID of the guest attempting to sign up as used in your external systems or your previous authentication solution. This will be copied to the resulting user when the sign-up is completed. @@ -21,11 +16,6 @@ class UpdateSignUpRequestBodyTypedDict(TypedDict): class UpdateSignUpRequestBody(BaseModel): - custom_action: Optional[bool] = None - r"""Specifies whether a custom action has run for this sign-up attempt. - This is important when your instance has been configured to require a custom action to run before converting a sign-up into a user. - After executing any external business logic you deem necessary, you can mark the sign-up as ready-to-convert by setting `custom_action` to `true`. - """ external_id: OptionalNullable[str] = UNSET r"""The ID of the guest attempting to sign up as used in your external systems or your previous authentication solution. This will be copied to the resulting user when the sign-up is completed. @@ -33,7 +23,7 @@ class UpdateSignUpRequestBody(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["custom_action", "external_id"] + optional_fields = ["external_id"] nullable_fields = ["external_id"] null_default_fields = [] diff --git a/src/clerk_backend_api/models/updateusermetadataop.py b/src/clerk_backend_api/models/updateusermetadataop.py index 0a0756b..09021e6 100644 --- a/src/clerk_backend_api/models/updateusermetadataop.py +++ b/src/clerk_backend_api/models/updateusermetadataop.py @@ -7,48 +7,16 @@ from typing_extensions import Annotated, NotRequired -class UpdateUserMetadataPrivateMetadataTypedDict(TypedDict): - r"""Metadata saved on the user that is only visible to your backend. - The new object will be merged with the existing value. - """ - - - -class UpdateUserMetadataPrivateMetadata(BaseModel): - r"""Metadata saved on the user that is only visible to your backend. - The new object will be merged with the existing value. - """ - - - -class UpdateUserMetadataUnsafeMetadataTypedDict(TypedDict): - r"""Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. - The new object will be merged with the existing value. - - Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. - """ - - - -class UpdateUserMetadataUnsafeMetadata(BaseModel): - r"""Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. - The new object will be merged with the existing value. - - Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. - """ - - - class UpdateUserMetadataRequestBodyTypedDict(TypedDict): public_metadata: NotRequired[Dict[str, Any]] r"""Metadata saved on the user, that is visible to both your frontend and backend. The new object will be merged with the existing value. """ - private_metadata: NotRequired[UpdateUserMetadataPrivateMetadataTypedDict] + private_metadata: NotRequired[Dict[str, Any]] r"""Metadata saved on the user that is only visible to your backend. The new object will be merged with the existing value. """ - unsafe_metadata: NotRequired[UpdateUserMetadataUnsafeMetadataTypedDict] + unsafe_metadata: NotRequired[Dict[str, Any]] r"""Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. The new object will be merged with the existing value. @@ -61,11 +29,11 @@ class UpdateUserMetadataRequestBody(BaseModel): r"""Metadata saved on the user, that is visible to both your frontend and backend. The new object will be merged with the existing value. """ - private_metadata: Optional[UpdateUserMetadataPrivateMetadata] = None + private_metadata: Optional[Dict[str, Any]] = None r"""Metadata saved on the user that is only visible to your backend. The new object will be merged with the existing value. """ - unsafe_metadata: Optional[UpdateUserMetadataUnsafeMetadata] = None + unsafe_metadata: Optional[Dict[str, Any]] = None r"""Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. The new object will be merged with the existing value. diff --git a/src/clerk_backend_api/models/updateuserop.py b/src/clerk_backend_api/models/updateuserop.py index ecacacf..ae94ee8 100644 --- a/src/clerk_backend_api/models/updateuserop.py +++ b/src/clerk_backend_api/models/updateuserop.py @@ -3,142 +3,11 @@ 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 List, Optional, TypedDict from typing_extensions import Annotated, NotRequired -class UpdateUserPasswordHasher(str, Enum): - r"""The hashing algorithm that was used to generate the password digest. - The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), - [md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), - [phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), - [sha256](https://en.wikipedia.org/wiki/SHA-2), [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash) - and the [argon2](https://argon2.online/) variants argon2i and argon2id. - - If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). - - Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. - Insecure schemes are marked with `(insecure)` in the list below. - - Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: - - **bcrypt:** The digest should be of the following form: - - `$$$` - - **bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): - - `bcrypt_sha256$$$$` - - **md5** (insecure): The digest should follow the regular form e.g.: - - `5f4dcc3b5aa765d61d8327deb882cf99` - - **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: - - `pbkdf2_sha256$$$` - - Note: Both the salt and the hash are expected to be base64-encoded. - - **pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: - - `pbkdf2_sha512$$$` - - _iterations:_ The number of iterations used. Must be an integer less than 420000. - _salt:_ The salt used when generating the hash. Must be less than bytes. - _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. - - **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): - - `pbkdf2_sha256$$$` - - Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. - - **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: - 1. uses sha1 instead of sha256 - 2. accepts the hash as a hex-encoded string - - The format is the following: - - `pbkdf2_sha1$$$` - - **phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: - - The format is the following: - - `$P$` - - - $P$ is the prefix used to identify phpass hashes. - - rounds is a single character encoding a 6-bit integer representing the number of rounds used. - - salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. - - checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. - - **scrypt_firebase:** The Firebase-specific variant of scrypt. - The value is expected to have 6 segments separated by the $ character and include the following information: - - _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. - _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. - _signer key:_ The base64 encoded signer key. - _salt separator:_ The base64 encoded salt separator. - _rounds:_ The number of rounds the algorithm needs to run. - _memory cost:_ The cost of the algorithm run - - The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. - The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. - - Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: - - `$$$$$` - - **scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. - - The value is expected to have 3 segments separated by the $ character and include the following information: - - _algorithm args:_ The algorithm used to generate the hash. - _salt:_ The salt used to generate the above hash. - _hash:_ The actual Base64 hash. - - The algorithm args are the parameters used to generate the hash and are included in the digest. - - **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: - - _version (v):_ The argon version, version 19 is assumed - _memory (m):_ The memory used by the algorithm (in kibibytes) - _iterations (t):_ The number of iterations to perform - _parallelism (p):_ The number of threads to use - - Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. - The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). - The final part is the actual digest. - - `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` - - **argon2id:** See the previous algorithm for an explanation of the formatting. - - For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: - - `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` - - **sha256** (insecure): The digest should be a 64-length hex string, e.g.: - - `9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` - """ - ARGON2I = "argon2i" - ARGON2ID = "argon2id" - BCRYPT = "bcrypt" - BCRYPT_SHA256_DJANGO = "bcrypt_sha256_django" - MD5 = "md5" - PBKDF2_SHA256 = "pbkdf2_sha256" - PBKDF2_SHA512 = "pbkdf2_sha512" - PBKDF2_SHA256_DJANGO = "pbkdf2_sha256_django" - PBKDF2_SHA1 = "pbkdf2_sha1" - PHPASS = "phpass" - SCRYPT_FIREBASE = "scrypt_firebase" - SCRYPT_WERKZEUG = "scrypt_werkzeug" - SHA256 = "sha256" - class UpdateUserPublicMetadataTypedDict(TypedDict): r"""Metadata saved on the user, that is visible to both your Frontend and Backend APIs""" @@ -213,121 +82,15 @@ class UpdateUserRequestBodyTypedDict(TypedDict): The digests should be generated with one of the supported algorithms. The hashing algorithm can be specified using the `password_hasher` property. """ - password_hasher: NotRequired[UpdateUserPasswordHasher] + password_hasher: NotRequired[str] r"""The hashing algorithm that was used to generate the password digest. - The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), - [md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), - [phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), - [sha256](https://en.wikipedia.org/wiki/SHA-2), [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash) - and the [argon2](https://argon2.online/) variants argon2i and argon2id. - - If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). - - Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. - Insecure schemes are marked with `(insecure)` in the list below. - - Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: - - **bcrypt:** The digest should be of the following form: - - `$$$` - - **bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): - - `bcrypt_sha256$$$$` - - **md5** (insecure): The digest should follow the regular form e.g.: - - `5f4dcc3b5aa765d61d8327deb882cf99` - - **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: - - `pbkdf2_sha256$$$` - - Note: Both the salt and the hash are expected to be base64-encoded. - - **pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: - - `pbkdf2_sha512$$$` - - _iterations:_ The number of iterations used. Must be an integer less than 420000. - _salt:_ The salt used when generating the hash. Must be less than bytes. - _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. - - **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): - - `pbkdf2_sha256$$$` - - Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. - - **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: - 1. uses sha1 instead of sha256 - 2. accepts the hash as a hex-encoded string - The format is the following: + The algorithms we support at the moment are [`bcrypt`](https://en.wikipedia.org/wiki/Bcrypt), [`bcrypt_sha256_django`](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [`md5`](https://en.wikipedia.org/wiki/MD5), `pbkdf2_sha1`, `pbkdf2_sha256`, [`pbkdf2_sha256_django`](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + [`phpass`](https://www.openwall.com/phpass/), [`scrypt_firebase`](https://firebaseopensource.com/projects/firebase/scrypt/), + [`scrypt_werkzeug`](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [`sha256`](https://en.wikipedia.org/wiki/SHA-2), + and the [`argon2`](https://argon2.online/) variants: `argon2i` and `argon2id`. - `pbkdf2_sha1$$$` - - **phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: - - The format is the following: - - `$P$` - - - $P$ is the prefix used to identify phpass hashes. - - rounds is a single character encoding a 6-bit integer representing the number of rounds used. - - salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. - - checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. - - **scrypt_firebase:** The Firebase-specific variant of scrypt. - The value is expected to have 6 segments separated by the $ character and include the following information: - - _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. - _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. - _signer key:_ The base64 encoded signer key. - _salt separator:_ The base64 encoded salt separator. - _rounds:_ The number of rounds the algorithm needs to run. - _memory cost:_ The cost of the algorithm run - - The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. - The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. - - Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: - - `$$$$$` - - **scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. - - The value is expected to have 3 segments separated by the $ character and include the following information: - - _algorithm args:_ The algorithm used to generate the hash. - _salt:_ The salt used to generate the above hash. - _hash:_ The actual Base64 hash. - - The algorithm args are the parameters used to generate the hash and are included in the digest. - - **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: - - _version (v):_ The argon version, version 19 is assumed - _memory (m):_ The memory used by the algorithm (in kibibytes) - _iterations (t):_ The number of iterations to perform - _parallelism (p):_ The number of threads to use - - Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. - The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). - The final part is the actual digest. - - `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` - - **argon2id:** See the previous algorithm for an explanation of the formatting. - - For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: - - `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` - - **sha256** (insecure): The digest should be a 64-length hex string, e.g.: - - `9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` + Each of the supported hashers expects the incoming digest to be in a particular format. See the [Clerk docs](https://clerk.com/docs/references/backend/user/create-user) for more information. """ skip_password_checks: NotRequired[Nullable[bool]] r"""Set it to `true` if you're updating the user's password and want to skip any password policy settings check. This parameter can only be used when providing a `password`.""" @@ -356,6 +119,14 @@ class UpdateUserRequestBodyTypedDict(TypedDict): r"""If true, the user can delete themselves with the Frontend API.""" create_organization_enabled: NotRequired[Nullable[bool]] r"""If true, the user can create organizations with the Frontend API.""" + legal_accepted_at: NotRequired[Nullable[str]] + r"""A custom timestamps denoting _when_ the user accepted legal requirements, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`).""" + skip_legal_checks: NotRequired[Nullable[bool]] + r"""When set to `true` all legal checks are skipped. + It is not recommended to skip legal checks unless you are migrating a user to Clerk. + """ + create_organizations_limit: NotRequired[Nullable[int]] + r"""The maximum number of organizations the user can create. 0 means unlimited.""" created_at: NotRequired[str] r"""A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`).""" @@ -400,121 +171,15 @@ class UpdateUserRequestBody(BaseModel): The digests should be generated with one of the supported algorithms. The hashing algorithm can be specified using the `password_hasher` property. """ - password_hasher: Optional[UpdateUserPasswordHasher] = None + password_hasher: Optional[str] = None r"""The hashing algorithm that was used to generate the password digest. - The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), - [md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), - [phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), - [sha256](https://en.wikipedia.org/wiki/SHA-2), [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash) - and the [argon2](https://argon2.online/) variants argon2i and argon2id. - - If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). - - Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. - Insecure schemes are marked with `(insecure)` in the list below. - - Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: - - **bcrypt:** The digest should be of the following form: - - `$$$` - - **bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): - - `bcrypt_sha256$$$$` - - **md5** (insecure): The digest should follow the regular form e.g.: - - `5f4dcc3b5aa765d61d8327deb882cf99` - - **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: - `pbkdf2_sha256$$$` + The algorithms we support at the moment are [`bcrypt`](https://en.wikipedia.org/wiki/Bcrypt), [`bcrypt_sha256_django`](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [`md5`](https://en.wikipedia.org/wiki/MD5), `pbkdf2_sha1`, `pbkdf2_sha256`, [`pbkdf2_sha256_django`](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + [`phpass`](https://www.openwall.com/phpass/), [`scrypt_firebase`](https://firebaseopensource.com/projects/firebase/scrypt/), + [`scrypt_werkzeug`](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [`sha256`](https://en.wikipedia.org/wiki/SHA-2), + and the [`argon2`](https://argon2.online/) variants: `argon2i` and `argon2id`. - Note: Both the salt and the hash are expected to be base64-encoded. - - **pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: - - `pbkdf2_sha512$$$` - - _iterations:_ The number of iterations used. Must be an integer less than 420000. - _salt:_ The salt used when generating the hash. Must be less than bytes. - _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. - - **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): - - `pbkdf2_sha256$$$` - - Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. - - **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: - 1. uses sha1 instead of sha256 - 2. accepts the hash as a hex-encoded string - - The format is the following: - - `pbkdf2_sha1$$$` - - **phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: - - The format is the following: - - `$P$` - - - $P$ is the prefix used to identify phpass hashes. - - rounds is a single character encoding a 6-bit integer representing the number of rounds used. - - salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. - - checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. - - **scrypt_firebase:** The Firebase-specific variant of scrypt. - The value is expected to have 6 segments separated by the $ character and include the following information: - - _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. - _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. - _signer key:_ The base64 encoded signer key. - _salt separator:_ The base64 encoded salt separator. - _rounds:_ The number of rounds the algorithm needs to run. - _memory cost:_ The cost of the algorithm run - - The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. - The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. - - Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: - - `$$$$$` - - **scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. - - The value is expected to have 3 segments separated by the $ character and include the following information: - - _algorithm args:_ The algorithm used to generate the hash. - _salt:_ The salt used to generate the above hash. - _hash:_ The actual Base64 hash. - - The algorithm args are the parameters used to generate the hash and are included in the digest. - - **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: - - _version (v):_ The argon version, version 19 is assumed - _memory (m):_ The memory used by the algorithm (in kibibytes) - _iterations (t):_ The number of iterations to perform - _parallelism (p):_ The number of threads to use - - Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. - The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). - The final part is the actual digest. - - `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` - - **argon2id:** See the previous algorithm for an explanation of the formatting. - - For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: - - `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` - - **sha256** (insecure): The digest should be a 64-length hex string, e.g.: - - `9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` + Each of the supported hashers expects the incoming digest to be in a particular format. See the [Clerk docs](https://clerk.com/docs/references/backend/user/create-user) for more information. """ skip_password_checks: OptionalNullable[bool] = UNSET r"""Set it to `true` if you're updating the user's password and want to skip any password policy settings check. This parameter can only be used when providing a `password`.""" @@ -543,13 +208,21 @@ class UpdateUserRequestBody(BaseModel): r"""If true, the user can delete themselves with the Frontend API.""" create_organization_enabled: OptionalNullable[bool] = UNSET r"""If true, the user can create organizations with the Frontend API.""" + legal_accepted_at: OptionalNullable[str] = UNSET + r"""A custom timestamps denoting _when_ the user accepted legal requirements, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`).""" + skip_legal_checks: OptionalNullable[bool] = UNSET + r"""When set to `true` all legal checks are skipped. + It is not recommended to skip legal checks unless you are migrating a user to Clerk. + """ + create_organizations_limit: OptionalNullable[int] = UNSET + r"""The maximum number of organizations the user can create. 0 means unlimited.""" created_at: Optional[str] = None r"""A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`).""" @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["external_id", "first_name", "last_name", "primary_email_address_id", "notify_primary_email_address_changed", "primary_phone_number_id", "primary_web3_wallet_id", "username", "profile_image_id", "password", "password_digest", "password_hasher", "skip_password_checks", "sign_out_of_other_sessions", "totp_secret", "backup_codes", "public_metadata", "private_metadata", "unsafe_metadata", "delete_self_enabled", "create_organization_enabled", "created_at"] - nullable_fields = ["external_id", "first_name", "last_name", "username", "profile_image_id", "password", "skip_password_checks", "sign_out_of_other_sessions", "delete_self_enabled", "create_organization_enabled"] + optional_fields = ["external_id", "first_name", "last_name", "primary_email_address_id", "notify_primary_email_address_changed", "primary_phone_number_id", "primary_web3_wallet_id", "username", "profile_image_id", "password", "password_digest", "password_hasher", "skip_password_checks", "sign_out_of_other_sessions", "totp_secret", "backup_codes", "public_metadata", "private_metadata", "unsafe_metadata", "delete_self_enabled", "create_organization_enabled", "legal_accepted_at", "skip_legal_checks", "create_organizations_limit", "created_at"] + nullable_fields = ["external_id", "first_name", "last_name", "username", "profile_image_id", "password", "skip_password_checks", "sign_out_of_other_sessions", "delete_self_enabled", "create_organization_enabled", "legal_accepted_at", "skip_legal_checks", "create_organizations_limit"] null_default_fields = [] serialized = handler(self) diff --git a/src/clerk_backend_api/models/uploadorganizationlogoop.py b/src/clerk_backend_api/models/uploadorganizationlogoop.py index cbb8fbf..39e9a3e 100644 --- a/src/clerk_backend_api/models/uploadorganizationlogoop.py +++ b/src/clerk_backend_api/models/uploadorganizationlogoop.py @@ -22,15 +22,15 @@ class UploadOrganizationLogoFile(BaseModel): class UploadOrganizationLogoRequestBodyTypedDict(TypedDict): - uploader_user_id: str - r"""The ID of the user that will be credited with the image upload.""" file: UploadOrganizationLogoFileTypedDict + uploader_user_id: NotRequired[str] + r"""The ID of the user that will be credited with the image upload.""" class UploadOrganizationLogoRequestBody(BaseModel): - uploader_user_id: Annotated[str, FieldMetadata(multipart=True)] - r"""The ID of the user that will be credited with the image upload.""" file: Annotated[UploadOrganizationLogoFile, pydantic.Field(alias=""), FieldMetadata(multipart=MultipartFormMetadata(file=True))] + uploader_user_id: Annotated[Optional[str], FieldMetadata(multipart=True)] = None + r"""The ID of the user that will be credited with the image upload.""" class UploadOrganizationLogoRequestTypedDict(TypedDict): diff --git a/src/clerk_backend_api/models/user.py b/src/clerk_backend_api/models/user.py index e4bf286..a12fb8e 100644 --- a/src/clerk_backend_api/models/user.py +++ b/src/clerk_backend_api/models/user.py @@ -124,11 +124,19 @@ class UserTypedDict(TypedDict): create_organization_enabled: NotRequired[bool] r"""If enabled, user can create organizations via FAPI. + """ + create_organizations_limit: NotRequired[Nullable[int]] + r"""The maximum number of organizations the user can create. 0 means unlimited. + """ last_active_at: NotRequired[Nullable[int]] r"""Unix timestamp of the latest session activity, with day precision. """ + legal_accepted_at: NotRequired[Nullable[int]] + r"""Unix timestamp of when the user accepted the legal requirements. + + """ class User(BaseModel): @@ -203,16 +211,24 @@ class User(BaseModel): create_organization_enabled: Optional[bool] = None r"""If enabled, user can create organizations via FAPI. + """ + create_organizations_limit: OptionalNullable[int] = UNSET + r"""The maximum number of organizations the user can create. 0 means unlimited. + """ last_active_at: OptionalNullable[int] = UNSET r"""Unix timestamp of the latest session activity, with day precision. + """ + legal_accepted_at: OptionalNullable[int] = UNSET + r"""Unix timestamp of when the user accepted the legal requirements. + """ @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["id", "object", "external_id", "primary_email_address_id", "primary_phone_number_id", "primary_web3_wallet_id", "username", "first_name", "last_name", "profile_image_url", "image_url", "has_image", "public_metadata", "private_metadata", "unsafe_metadata", "email_addresses", "phone_numbers", "web3_wallets", "passkeys", "password_enabled", "two_factor_enabled", "totp_enabled", "backup_code_enabled", "mfa_enabled_at", "mfa_disabled_at", "external_accounts", "saml_accounts", "last_sign_in_at", "banned", "locked", "lockout_expires_in_seconds", "verification_attempts_remaining", "updated_at", "created_at", "delete_self_enabled", "create_organization_enabled", "last_active_at"] - nullable_fields = ["external_id", "primary_email_address_id", "primary_phone_number_id", "primary_web3_wallet_id", "username", "first_name", "last_name", "private_metadata", "mfa_enabled_at", "mfa_disabled_at", "last_sign_in_at", "lockout_expires_in_seconds", "verification_attempts_remaining", "last_active_at"] + optional_fields = ["id", "object", "external_id", "primary_email_address_id", "primary_phone_number_id", "primary_web3_wallet_id", "username", "first_name", "last_name", "profile_image_url", "image_url", "has_image", "public_metadata", "private_metadata", "unsafe_metadata", "email_addresses", "phone_numbers", "web3_wallets", "passkeys", "password_enabled", "two_factor_enabled", "totp_enabled", "backup_code_enabled", "mfa_enabled_at", "mfa_disabled_at", "external_accounts", "saml_accounts", "last_sign_in_at", "banned", "locked", "lockout_expires_in_seconds", "verification_attempts_remaining", "updated_at", "created_at", "delete_self_enabled", "create_organization_enabled", "create_organizations_limit", "last_active_at", "legal_accepted_at"] + nullable_fields = ["external_id", "primary_email_address_id", "primary_phone_number_id", "primary_web3_wallet_id", "username", "first_name", "last_name", "private_metadata", "mfa_enabled_at", "mfa_disabled_at", "last_sign_in_at", "lockout_expires_in_seconds", "verification_attempts_remaining", "create_organizations_limit", "last_active_at", "legal_accepted_at"] null_default_fields = [] serialized = handler(self) diff --git a/src/clerk_backend_api/models/userpasskeydeleteop.py b/src/clerk_backend_api/models/userpasskeydeleteop.py new file mode 100644 index 0000000..0762e1a --- /dev/null +++ b/src/clerk_backend_api/models/userpasskeydeleteop.py @@ -0,0 +1,22 @@ +"""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 typing import TypedDict +from typing_extensions import Annotated + + +class UserPasskeyDeleteRequestTypedDict(TypedDict): + user_id: str + r"""The ID of the user that owns the passkey identity""" + passkey_identification_id: str + r"""The ID of the passkey identity to be deleted""" + + +class UserPasskeyDeleteRequest(BaseModel): + user_id: Annotated[str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))] + r"""The ID of the user that owns the passkey identity""" + passkey_identification_id: Annotated[str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))] + r"""The ID of the passkey identity to be deleted""" + diff --git a/src/clerk_backend_api/models/usersgetorganizationinvitationsop.py b/src/clerk_backend_api/models/usersgetorganizationinvitationsop.py new file mode 100644 index 0000000..a98e289 --- /dev/null +++ b/src/clerk_backend_api/models/usersgetorganizationinvitationsop.py @@ -0,0 +1,47 @@ +"""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, QueryParamMetadata +from enum import Enum +from typing import Optional, TypedDict +from typing_extensions import Annotated, NotRequired + + +class UsersGetOrganizationInvitationsQueryParamStatus(str, Enum): + r"""Filter organization invitations based on their status""" + PENDING = "pending" + ACCEPTED = "accepted" + REVOKED = "revoked" + +class UsersGetOrganizationInvitationsRequestTypedDict(TypedDict): + user_id: str + r"""The ID of the user whose organization invitations we want to retrieve""" + 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`. + """ + status: NotRequired[UsersGetOrganizationInvitationsQueryParamStatus] + r"""Filter organization invitations based on their status""" + + +class UsersGetOrganizationInvitationsRequest(BaseModel): + user_id: Annotated[str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))] + r"""The ID of the user whose organization invitations we want to retrieve""" + 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`. + """ + status: Annotated[Optional[UsersGetOrganizationInvitationsQueryParamStatus], FieldMetadata(query=QueryParamMetadata(style="form", explode=True))] = None + r"""Filter organization invitations based on their status""" + diff --git a/src/clerk_backend_api/models/usersgetorganizationmembershipsop.py b/src/clerk_backend_api/models/usersgetorganizationmembershipsop.py index bc5a369..547ec6f 100644 --- a/src/clerk_backend_api/models/usersgetorganizationmembershipsop.py +++ b/src/clerk_backend_api/models/usersgetorganizationmembershipsop.py @@ -1,10 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .organizationmemberships import OrganizationMemberships, OrganizationMembershipsTypedDict from clerk_backend_api.types import BaseModel from clerk_backend_api.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata -from typing import Callable, Optional, TypedDict +from typing import Optional, TypedDict from typing_extensions import Annotated, NotRequired @@ -35,13 +34,3 @@ class UsersGetOrganizationMembershipsRequest(BaseModel): To be used in conjunction with `limit`. """ - -class UsersGetOrganizationMembershipsResponseTypedDict(TypedDict): - result: OrganizationMembershipsTypedDict - - -class UsersGetOrganizationMembershipsResponse(BaseModel): - next: Callable[[], Optional[UsersGetOrganizationMembershipsResponse]] - - result: OrganizationMemberships - diff --git a/src/clerk_backend_api/models/userweb3walletdeleteop.py b/src/clerk_backend_api/models/userweb3walletdeleteop.py new file mode 100644 index 0000000..2bbf288 --- /dev/null +++ b/src/clerk_backend_api/models/userweb3walletdeleteop.py @@ -0,0 +1,22 @@ +"""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 typing import TypedDict +from typing_extensions import Annotated + + +class UserWeb3WalletDeleteRequestTypedDict(TypedDict): + user_id: str + r"""The ID of the user that owns the web3 wallet""" + web3_wallet_identification_id: str + r"""The ID of the web3 wallet identity to be deleted""" + + +class UserWeb3WalletDeleteRequest(BaseModel): + user_id: Annotated[str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))] + r"""The ID of the user that owns the web3 wallet""" + web3_wallet_identification_id: Annotated[str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))] + r"""The ID of the web3 wallet identity to be deleted""" + diff --git a/src/clerk_backend_api/models/verifyclientop.py b/src/clerk_backend_api/models/verifyclientop.py index 21b5904..f8884f0 100644 --- a/src/clerk_backend_api/models/verifyclientop.py +++ b/src/clerk_backend_api/models/verifyclientop.py @@ -10,12 +10,12 @@ class VerifyClientRequestBodyTypedDict(TypedDict): r"""Parameters.""" token: NotRequired[str] - r"""A JWT Token that represents the active client.""" + r"""A JWT that represents the active client.""" class VerifyClientRequestBody(BaseModel): r"""Parameters.""" token: Optional[str] = None - r"""A JWT Token that represents the active client.""" + r"""A JWT that represents the active client.""" diff --git a/src/clerk_backend_api/models/web3wallet.py b/src/clerk_backend_api/models/web3wallet.py index 07bfef2..e923b59 100644 --- a/src/clerk_backend_api/models/web3wallet.py +++ b/src/clerk_backend_api/models/web3wallet.py @@ -19,7 +19,6 @@ class AdminVerificationWeb3WalletStatus(str, Enum): class AdminVerificationWeb3WalletStrategy(str, Enum): ADMIN = "admin" - FROM_OAUTH_DISCORD = "from_oauth_discord" class Web3WalletVerificationAdminTypedDict(TypedDict): status: AdminVerificationWeb3WalletStatus @@ -62,18 +61,20 @@ def serialize_model(self, handler): class Web3SignatureVerificationStatus(str, Enum): + UNVERIFIED = "unverified" VERIFIED = "verified" + FAILED = "failed" + EXPIRED = "expired" class Web3SignatureVerificationStrategy(str, Enum): WEB3_METAMASK_SIGNATURE = "web3_metamask_signature" - -class Nonce(str, Enum): - NONCE = "nonce" + WEB3_COINBASE_WALLET_SIGNATURE = "web3_coinbase_wallet_signature" class Web3SignatureTypedDict(TypedDict): status: Web3SignatureVerificationStatus strategy: Web3SignatureVerificationStrategy - nonce: Nonce + nonce: NotRequired[Nullable[str]] + message: NotRequired[Nullable[str]] attempts: NotRequired[Nullable[int]] expire_at: NotRequired[Nullable[int]] @@ -81,14 +82,15 @@ class Web3SignatureTypedDict(TypedDict): class Web3Signature(BaseModel): status: Web3SignatureVerificationStatus strategy: Web3SignatureVerificationStrategy - nonce: Nonce + nonce: OptionalNullable[str] = UNSET + message: OptionalNullable[str] = UNSET attempts: OptionalNullable[int] = UNSET expire_at: OptionalNullable[int] = UNSET @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["attempts", "expire_at"] - nullable_fields = ["attempts", "expire_at"] + optional_fields = ["nonce", "message", "attempts", "expire_at"] + nullable_fields = ["nonce", "message", "attempts", "expire_at"] null_default_fields = [] serialized = handler(self) diff --git a/src/clerk_backend_api/models/wellknown_jwks.py b/src/clerk_backend_api/models/wellknown_jwks.py new file mode 100644 index 0000000..6f267a1 --- /dev/null +++ b/src/clerk_backend_api/models/wellknown_jwks.py @@ -0,0 +1,33 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from clerk_backend_api.types import BaseModel +from typing import List, Optional, TypedDict +from typing_extensions import NotRequired + + +class KeysTypedDict(TypedDict): + use: NotRequired[str] + kty: NotRequired[str] + kid: NotRequired[str] + alg: NotRequired[str] + n: NotRequired[str] + e: NotRequired[str] + + +class Keys(BaseModel): + use: Optional[str] = None + kty: Optional[str] = None + kid: Optional[str] = None + alg: Optional[str] = None + n: Optional[str] = None + e: Optional[str] = None + + +class WellKnownJWKSTypedDict(TypedDict): + keys: NotRequired[List[KeysTypedDict]] + + +class WellKnownJWKS(BaseModel): + keys: Optional[List[Keys]] = None + diff --git a/src/clerk_backend_api/oauthapplications_sdk.py b/src/clerk_backend_api/oauthapplications_sdk.py index 12cdfa3..f6ef701 100644 --- a/src/clerk_backend_api/oauthapplications_sdk.py +++ b/src/clerk_backend_api/oauthapplications_sdk.py @@ -4,10 +4,9 @@ from clerk_backend_api import models, utils from clerk_backend_api._hooks import HookContext from clerk_backend_api.types import BaseModel, OptionalNullable, UNSET -from jsonpath import JSONPath -from typing import Any, Dict, Optional, Union, cast +from typing import Any, Optional, Union, cast -class OAuthApplicationsSDK(BaseSDK): +class OauthApplicationsSDK(BaseSDK): def list( @@ -17,7 +16,7 @@ def list( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.ListOAuthApplicationsResponse: + ) -> Optional[models.OAuthApplications]: r"""Get a list of OAuth applications for an instance This request returns the list of OAuth applications for an instance. @@ -80,29 +79,9 @@ def list( retry_config=retry_config ) - def next_func() -> Optional[models.ListOAuthApplicationsResponse]: - body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) - offset = request.offset if not request.offset is None else 0 - - if not http_res.text: - return None - results = JSONPath("$").parse(body) - if len(results) == 0 or len(results[0]) == 0: - return None - limit = request.limit if not request.limit is None else 0 - if len(results[0]) < limit: - return None - next_offset = offset + len(results[0]) - - return self.list( - limit=limit, - offset=next_offset, - retries=retries, - ) - data: Any = None if utils.match_response(http_res, "200", "application/json"): - return models.ListOAuthApplicationsResponse(result=utils.unmarshal_json(http_res.text, Optional[models.OAuthApplications]), next=next_func) + return utils.unmarshal_json(http_res.text, Optional[models.OAuthApplications]) 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) @@ -121,7 +100,7 @@ async def list_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.ListOAuthApplicationsResponse: + ) -> Optional[models.OAuthApplications]: r"""Get a list of OAuth applications for an instance This request returns the list of OAuth applications for an instance. @@ -184,29 +163,9 @@ async def list_async( retry_config=retry_config ) - def next_func() -> Optional[models.ListOAuthApplicationsResponse]: - body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) - offset = request.offset if not request.offset is None else 0 - - if not http_res.text: - return None - results = JSONPath("$").parse(body) - if len(results) == 0 or len(results[0]) == 0: - return None - limit = request.limit if not request.limit is None else 0 - if len(results[0]) < limit: - return None - next_offset = offset + len(results[0]) - - return self.list( - limit=limit, - offset=next_offset, - retries=retries, - ) - data: Any = None if utils.match_response(http_res, "200", "application/json"): - return models.ListOAuthApplicationsResponse(result=utils.unmarshal_json(http_res.text, Optional[models.OAuthApplications]), next=next_func) + return utils.unmarshal_json(http_res.text, Optional[models.OAuthApplications]) 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) diff --git a/src/clerk_backend_api/organizationdomain_sdk.py b/src/clerk_backend_api/organizationdomain_sdk.py new file mode 100644 index 0000000..39a1730 --- /dev/null +++ b/src/clerk_backend_api/organizationdomain_sdk.py @@ -0,0 +1,190 @@ +"""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 OptionalNullable, UNSET +from typing import Any, Optional + +class OrganizationDomainSDK(BaseSDK): + + + def update( + self, *, + organization_id: str, + domain_id: str, + enrollment_mode: OptionalNullable[str] = UNSET, + verified: OptionalNullable[bool] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.OrganizationDomain]: + r"""Update an organization domain. + + Updates the properties of an existing organization domain. + + :param organization_id: The ID of the organization the domain belongs to + :param domain_id: The ID of the domain + :param enrollment_mode: The enrollment_mode for the new domain. This can be `automatic_invitation`, `automatic_suggestion` or `manual_invitation` + :param verified: The status of the domain's verification + :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 + """ + 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.UpdateOrganizationDomainRequest( + organization_id=organization_id, + domain_id=domain_id, + request_body=models.UpdateOrganizationDomainRequestBody( + enrollment_mode=enrollment_mode, + verified=verified, + ), + ) + + req = self.build_request( + method="PATCH", + path="/organizations/{organization_id}/domains/{domain_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body(request.request_body, False, False, "json", models.UpdateOrganizationDomainRequestBody), + 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="UpdateOrganizationDomain", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","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.OrganizationDomain]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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 update_async( + self, *, + organization_id: str, + domain_id: str, + enrollment_mode: OptionalNullable[str] = UNSET, + verified: OptionalNullable[bool] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.OrganizationDomain]: + r"""Update an organization domain. + + Updates the properties of an existing organization domain. + + :param organization_id: The ID of the organization the domain belongs to + :param domain_id: The ID of the domain + :param enrollment_mode: The enrollment_mode for the new domain. This can be `automatic_invitation`, `automatic_suggestion` or `manual_invitation` + :param verified: The status of the domain's verification + :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 + """ + 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.UpdateOrganizationDomainRequest( + organization_id=organization_id, + domain_id=domain_id, + request_body=models.UpdateOrganizationDomainRequestBody( + enrollment_mode=enrollment_mode, + verified=verified, + ), + ) + + req = self.build_request( + method="PATCH", + path="/organizations/{organization_id}/domains/{domain_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body(request.request_body, False, False, "json", models.UpdateOrganizationDomainRequestBody), + 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="UpdateOrganizationDomain", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","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.OrganizationDomain]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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/organizationdomains_sdk.py b/src/clerk_backend_api/organizationdomains_sdk.py new file mode 100644 index 0000000..9caab4b --- /dev/null +++ b/src/clerk_backend_api/organizationdomains_sdk.py @@ -0,0 +1,532 @@ +"""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 OptionalNullable, UNSET +from typing import Any, Optional + +class OrganizationDomainsSDK(BaseSDK): + + + def create( + self, *, + organization_id: str, + name: Optional[str] = None, + enrollment_mode: Optional[str] = None, + verified: OptionalNullable[bool] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.OrganizationDomain]: + r"""Create a new organization domain. + + Creates a new organization domain. By default the domain is verified, but can be optionally set to unverified. + + :param organization_id: The ID of the organization where the new domain will be created. + :param name: The name of the new domain + :param enrollment_mode: The enrollment_mode for the new domain. This can be `automatic_invitation`, `automatic_suggestion` or `manual_invitation` + :param verified: The status of domain's verification. Defaults to true + :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 + """ + 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.CreateOrganizationDomainRequest( + organization_id=organization_id, + request_body=models.CreateOrganizationDomainRequestBody( + name=name, + enrollment_mode=enrollment_mode, + verified=verified, + ), + ) + + req = self.build_request( + method="POST", + path="/organizations/{organization_id}/domains", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body(request.request_body, False, False, "json", models.CreateOrganizationDomainRequestBody), + 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="CreateOrganizationDomain", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","403","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.OrganizationDomain]) + if utils.match_response(http_res, ["400","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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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_async( + self, *, + organization_id: str, + name: Optional[str] = None, + enrollment_mode: Optional[str] = None, + verified: OptionalNullable[bool] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.OrganizationDomain]: + r"""Create a new organization domain. + + Creates a new organization domain. By default the domain is verified, but can be optionally set to unverified. + + :param organization_id: The ID of the organization where the new domain will be created. + :param name: The name of the new domain + :param enrollment_mode: The enrollment_mode for the new domain. This can be `automatic_invitation`, `automatic_suggestion` or `manual_invitation` + :param verified: The status of domain's verification. Defaults to true + :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 + """ + 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.CreateOrganizationDomainRequest( + organization_id=organization_id, + request_body=models.CreateOrganizationDomainRequestBody( + name=name, + enrollment_mode=enrollment_mode, + verified=verified, + ), + ) + + req = self.build_request( + method="POST", + path="/organizations/{organization_id}/domains", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body(request.request_body, False, False, "json", models.CreateOrganizationDomainRequestBody), + 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="CreateOrganizationDomain", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","403","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.OrganizationDomain]) + if utils.match_response(http_res, ["400","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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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 list( + self, *, + organization_id: str, + limit: Optional[int] = 10, + offset: Optional[int] = 0, + verified: Optional[str] = None, + enrollment_mode: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.OrganizationDomains]: + r"""Get a list of all domains of an organization. + + Get a list of all domains of an organization. + + :param organization_id: The organization ID. + :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 verified: Filter domains by their verification status. `true` or `false` + :param enrollment_mode: Filter domains by their enrollment mode + :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 + """ + 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.ListOrganizationDomainsRequest( + organization_id=organization_id, + limit=limit, + offset=offset, + verified=verified, + enrollment_mode=enrollment_mode, + ) + + req = self.build_request( + method="GET", + path="/organizations/{organization_id}/domains", + 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", + 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="ListOrganizationDomains", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["401","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.OrganizationDomains]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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_async( + self, *, + organization_id: str, + limit: Optional[int] = 10, + offset: Optional[int] = 0, + verified: Optional[str] = None, + enrollment_mode: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.OrganizationDomains]: + r"""Get a list of all domains of an organization. + + Get a list of all domains of an organization. + + :param organization_id: The organization ID. + :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 verified: Filter domains by their verification status. `true` or `false` + :param enrollment_mode: Filter domains by their enrollment mode + :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 + """ + 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.ListOrganizationDomainsRequest( + organization_id=organization_id, + limit=limit, + offset=offset, + verified=verified, + enrollment_mode=enrollment_mode, + ) + + req = self.build_request( + method="GET", + path="/organizations/{organization_id}/domains", + 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", + 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="ListOrganizationDomains", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["401","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.OrganizationDomains]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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 delete( + self, *, + organization_id: str, + domain_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.DeletedObject]: + r"""Remove a domain from an organization. + + Removes the given domain from the organization. + + :param organization_id: The ID of the organization the domain belongs to + :param domain_id: The ID of the domain + :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 + """ + 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.DeleteOrganizationDomainRequest( + organization_id=organization_id, + domain_id=domain_id, + ) + + req = self.build_request( + method="DELETE", + path="/organizations/{organization_id}/domains/{domain_id}", + 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", + 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="DeleteOrganizationDomain", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","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.DeletedObject]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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 delete_async( + self, *, + organization_id: str, + domain_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.DeletedObject]: + r"""Remove a domain from an organization. + + Removes the given domain from the organization. + + :param organization_id: The ID of the organization the domain belongs to + :param domain_id: The ID of the domain + :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 + """ + 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.DeleteOrganizationDomainRequest( + organization_id=organization_id, + domain_id=domain_id, + ) + + req = self.build_request( + method="DELETE", + path="/organizations/{organization_id}/domains/{domain_id}", + 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", + 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="DeleteOrganizationDomain", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","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.DeletedObject]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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/organizationinvitations_sdk.py b/src/clerk_backend_api/organizationinvitations_sdk.py index c7857c9..c5d611a 100644 --- a/src/clerk_backend_api/organizationinvitations_sdk.py +++ b/src/clerk_backend_api/organizationinvitations_sdk.py @@ -4,19 +4,208 @@ from clerk_backend_api import models, utils from clerk_backend_api._hooks import HookContext from clerk_backend_api.types import OptionalNullable, UNSET -from jsonpath import JSONPath -from typing import Any, Dict, List, Optional, Union +from typing import Any, List, Optional, Union from typing_extensions import deprecated class OrganizationInvitationsSDK(BaseSDK): + def get_all( + self, *, + limit: Optional[int] = 10, + offset: Optional[int] = 0, + order_by: Optional[str] = "-created_at", + status: Optional[models.ListInstanceOrganizationInvitationsQueryParamStatus] = None, + query: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.OrganizationInvitationsWithPublicOrganizationData]: + r"""Get a list of organization invitations for the current instance + + This request returns the list of organization invitations for the instance. + Results can be paginated using the optional `limit` and `offset` query parameters. + You can filter them by providing the 'status' query parameter, that accepts multiple values. + You can change the order by providing the 'order' query parameter, that accepts multiple values. + You can filter by the invited user email address providing the `query` query parameter. + The organization invitations are ordered by descending creation date by default. + + :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 organization invitations in a particular order. At the moment, you can order the returned organization invitations either by their `created_at` or `email_address`. In order to specify the direction, you can use the `+/-` symbols prepended in the property to order by. For example, if you want organization invitations 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. Defaults to `-created_at`. + :param status: Filter organization invitations based on their status + :param query: Filter organization invitations based on their `email_address` + :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 + """ + 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.ListInstanceOrganizationInvitationsRequest( + limit=limit, + offset=offset, + order_by=order_by, + status=status, + query=query, + ) + + req = self.build_request( + method="GET", + path="/organization_invitations", + 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", + 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="ListInstanceOrganizationInvitations", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","404","422","4XX","500","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.OrganizationInvitationsWithPublicOrganizationData]) + if utils.match_response(http_res, ["400","404","422","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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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_all_async( + self, *, + limit: Optional[int] = 10, + offset: Optional[int] = 0, + order_by: Optional[str] = "-created_at", + status: Optional[models.ListInstanceOrganizationInvitationsQueryParamStatus] = None, + query: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.OrganizationInvitationsWithPublicOrganizationData]: + r"""Get a list of organization invitations for the current instance + + This request returns the list of organization invitations for the instance. + Results can be paginated using the optional `limit` and `offset` query parameters. + You can filter them by providing the 'status' query parameter, that accepts multiple values. + You can change the order by providing the 'order' query parameter, that accepts multiple values. + You can filter by the invited user email address providing the `query` query parameter. + The organization invitations are ordered by descending creation date by default. + + :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 organization invitations in a particular order. At the moment, you can order the returned organization invitations either by their `created_at` or `email_address`. In order to specify the direction, you can use the `+/-` symbols prepended in the property to order by. For example, if you want organization invitations 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. Defaults to `-created_at`. + :param status: Filter organization invitations based on their status + :param query: Filter organization invitations based on their `email_address` + :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 + """ + 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.ListInstanceOrganizationInvitationsRequest( + limit=limit, + offset=offset, + order_by=order_by, + status=status, + query=query, + ) + + req = self.build_request( + method="GET", + path="/organization_invitations", + 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", + 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="ListInstanceOrganizationInvitations", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","404","422","4XX","500","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.OrganizationInvitationsWithPublicOrganizationData]) + if utils.match_response(http_res, ["400","404","422","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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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( self, *, organization_id: str, email_address: str, - inviter_user_id: str, role: str, + inviter_user_id: OptionalNullable[str] = UNSET, public_metadata: Optional[Union[models.CreateOrganizationInvitationPublicMetadata, models.CreateOrganizationInvitationPublicMetadataTypedDict]] = None, private_metadata: Optional[Union[models.CreateOrganizationInvitationPrivateMetadata, models.CreateOrganizationInvitationPrivateMetadataTypedDict]] = None, redirect_url: Optional[str] = None, @@ -35,7 +224,7 @@ def create( When the invited user clicks the link to accept the invitation, they will be redirected to the URL provided. Use this parameter to implement a custom invitation acceptance flow. - You must specify the ID of the user that will send the invitation with the `inviter_user_id` parameter. + You can specify the ID of the user that will send the invitation with the `inviter_user_id` parameter. That user must be a member with administrator privileges in the organization. Only \"admin\" members can create organization invitations. @@ -45,8 +234,8 @@ def create( :param organization_id: The ID of the organization for which to send the invitation :param email_address: The email address of the new member that is going to be invited to 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 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 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. @@ -129,8 +318,8 @@ async def create_async( self, *, organization_id: str, email_address: str, - inviter_user_id: str, role: str, + inviter_user_id: OptionalNullable[str] = UNSET, public_metadata: Optional[Union[models.CreateOrganizationInvitationPublicMetadata, models.CreateOrganizationInvitationPublicMetadataTypedDict]] = None, private_metadata: Optional[Union[models.CreateOrganizationInvitationPrivateMetadata, models.CreateOrganizationInvitationPrivateMetadataTypedDict]] = None, redirect_url: Optional[str] = None, @@ -149,7 +338,7 @@ async def create_async( When the invited user clicks the link to accept the invitation, they will be redirected to the URL provided. Use this parameter to implement a custom invitation acceptance flow. - You must specify the ID of the user that will send the invitation with the `inviter_user_id` parameter. + You can specify the ID of the user that will send the invitation with the `inviter_user_id` parameter. That user must be a member with administrator privileges in the organization. Only \"admin\" members can create organization invitations. @@ -159,8 +348,8 @@ async def create_async( :param organization_id: The ID of the organization for which to send the invitation :param email_address: The email address of the new member that is going to be invited to 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 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 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. @@ -248,7 +437,7 @@ def list( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.ListOrganizationInvitationsResponse: + ) -> Optional[models.OrganizationInvitations]: r"""Get a list of organization invitations This request returns the list of organization invitations. @@ -317,31 +506,9 @@ def list( retry_config=retry_config ) - def next_func() -> Optional[models.ListOrganizationInvitationsResponse]: - body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) - offset = request.offset if not request.offset is None else 0 - - if not http_res.text: - return None - results = JSONPath("$").parse(body) - if len(results) == 0 or len(results[0]) == 0: - return None - limit = request.limit if not request.limit is None else 0 - if len(results[0]) < limit: - return None - next_offset = offset + len(results[0]) - - return self.list( - organization_id=organization_id, - limit=limit, - offset=next_offset, - status=status, - retries=retries, - ) - data: Any = None if utils.match_response(http_res, "200", "application/json"): - return models.ListOrganizationInvitationsResponse(result=utils.unmarshal_json(http_res.text, Optional[models.OrganizationInvitations]), next=next_func) + return utils.unmarshal_json(http_res.text, Optional[models.OrganizationInvitations]) if utils.match_response(http_res, ["400","404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) @@ -362,7 +529,7 @@ async def list_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.ListOrganizationInvitationsResponse: + ) -> Optional[models.OrganizationInvitations]: r"""Get a list of organization invitations This request returns the list of organization invitations. @@ -431,31 +598,9 @@ async def list_async( retry_config=retry_config ) - def next_func() -> Optional[models.ListOrganizationInvitationsResponse]: - body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) - offset = request.offset if not request.offset is None else 0 - - if not http_res.text: - return None - results = JSONPath("$").parse(body) - if len(results) == 0 or len(results[0]) == 0: - return None - limit = request.limit if not request.limit is None else 0 - if len(results[0]) < limit: - return None - next_offset = offset + len(results[0]) - - return self.list( - organization_id=organization_id, - limit=limit, - offset=next_offset, - status=status, - retries=retries, - ) - data: Any = None if utils.match_response(http_res, "200", "application/json"): - return models.ListOrganizationInvitationsResponse(result=utils.unmarshal_json(http_res.text, Optional[models.OrganizationInvitations]), next=next_func) + return utils.unmarshal_json(http_res.text, Optional[models.OrganizationInvitations]) if utils.match_response(http_res, ["400","404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) @@ -467,7 +612,7 @@ def next_func() -> Optional[models.ListOrganizationInvitationsResponse]: - def create_bulk( + def bulk_create( self, *, organization_id: str, request_body: Union[List[models.RequestBody], List[models.RequestBodyTypedDict]], @@ -483,7 +628,7 @@ def create_bulk( The request body supports passing an optional `redirect_url` parameter for each invitation. When the invited user clicks the link to accept the invitation, they will be redirected to the provided URL. Use this parameter to implement a custom invitation acceptance flow. - You must specify the ID of the user that will send the invitation with the `inviter_user_id` parameter. Each invitation + You can specify the ID of the user that will send the invitation with the `inviter_user_id` parameter. Each invitation can have a different inviter user. Inviter users must be members with administrator privileges in the organization. Only \"admin\" members can create organization invitations. @@ -561,7 +706,7 @@ def create_bulk( - async def create_bulk_async( + async def bulk_create_async( self, *, organization_id: str, request_body: Union[List[models.RequestBody], List[models.RequestBodyTypedDict]], @@ -577,7 +722,7 @@ async def create_bulk_async( The request body supports passing an optional `redirect_url` parameter for each invitation. When the invited user clicks the link to accept the invitation, they will be redirected to the provided URL. Use this parameter to implement a custom invitation acceptance flow. - You must specify the ID of the user that will send the invitation with the `inviter_user_id` parameter. Each invitation + You can specify the ID of the user that will send the invitation with the `inviter_user_id` parameter. Each invitation can have a different inviter user. Inviter users must be members with administrator privileges in the organization. Only \"admin\" members can create organization invitations. @@ -664,7 +809,7 @@ def list_pending( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.ListPendingOrganizationInvitationsResponse: + ) -> Optional[models.OrganizationInvitations]: r"""Get a list of pending organization invitations This request returns the list of organization invitations with \"pending\" status. @@ -731,30 +876,9 @@ def list_pending( retry_config=retry_config ) - def next_func() -> Optional[models.ListPendingOrganizationInvitationsResponse]: - body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) - offset = request.offset if not request.offset is None else 0 - - if not http_res.text: - return None - results = JSONPath("$").parse(body) - if len(results) == 0 or len(results[0]) == 0: - return None - limit = request.limit if not request.limit is None else 0 - if len(results[0]) < limit: - return None - next_offset = offset + len(results[0]) - - return self.list_pending( - organization_id=organization_id, - limit=limit, - offset=next_offset, - retries=retries, - ) - data: Any = None if utils.match_response(http_res, "200", "application/json"): - return models.ListPendingOrganizationInvitationsResponse(result=utils.unmarshal_json(http_res.text, Optional[models.OrganizationInvitations]), next=next_func) + return utils.unmarshal_json(http_res.text, Optional[models.OrganizationInvitations]) if utils.match_response(http_res, ["400","404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) @@ -775,7 +899,7 @@ async def list_pending_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.ListPendingOrganizationInvitationsResponse: + ) -> Optional[models.OrganizationInvitations]: r"""Get a list of pending organization invitations This request returns the list of organization invitations with \"pending\" status. @@ -842,30 +966,9 @@ async def list_pending_async( retry_config=retry_config ) - def next_func() -> Optional[models.ListPendingOrganizationInvitationsResponse]: - body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) - offset = request.offset if not request.offset is None else 0 - - if not http_res.text: - return None - results = JSONPath("$").parse(body) - if len(results) == 0 or len(results[0]) == 0: - return None - limit = request.limit if not request.limit is None else 0 - if len(results[0]) < limit: - return None - next_offset = offset + len(results[0]) - - return self.list_pending( - organization_id=organization_id, - limit=limit, - offset=next_offset, - retries=retries, - ) - data: Any = None if utils.match_response(http_res, "200", "application/json"): - return models.ListPendingOrganizationInvitationsResponse(result=utils.unmarshal_json(http_res.text, Optional[models.OrganizationInvitations]), next=next_func) + return utils.unmarshal_json(http_res.text, Optional[models.OrganizationInvitations]) if utils.match_response(http_res, ["400","404"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) @@ -1043,7 +1146,7 @@ def revoke( self, *, organization_id: str, invitation_id: str, - requesting_user_id: str, + request_body: Optional[Union[models.RevokeOrganizationInvitationRequestBody, models.RevokeOrganizationInvitationRequestBodyTypedDict]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1053,12 +1156,12 @@ def revoke( Use this request to revoke a previously issued organization invitation. Revoking an organization invitation makes it invalid; the invited user will no longer be able to join the organization with the revoked invitation. Only organization invitations with \"pending\" status can be revoked. - The request needs the `requesting_user_id` parameter to specify the user which revokes the invitation. + The request accepts the `requesting_user_id` parameter to specify the user which revokes the invitation. Only users with \"admin\" role can revoke invitations. :param organization_id: The organization ID. :param invitation_id: The organization invitation ID. - :param requesting_user_id: The ID of the user that revokes the invitation. Must be an administrator in the organization. + :param request_body: :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 @@ -1074,9 +1177,7 @@ def revoke( request = models.RevokeOrganizationInvitationRequest( organization_id=organization_id, invitation_id=invitation_id, - request_body=models.RevokeOrganizationInvitationRequestBody( - requesting_user_id=requesting_user_id, - ), + request_body=utils.get_pydantic_model(request_body, Optional[models.RevokeOrganizationInvitationRequestBody]), ) req = self.build_request( @@ -1085,13 +1186,13 @@ def revoke( 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", accept_header_value="application/json", security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body(request.request_body, False, False, "json", models.RevokeOrganizationInvitationRequestBody), + get_serialized_body=lambda: utils.serialize_request_body(request.request_body, False, True, "json", Optional[models.RevokeOrganizationInvitationRequestBody]), timeout_ms=timeout_ms, ) @@ -1134,7 +1235,7 @@ async def revoke_async( self, *, organization_id: str, invitation_id: str, - requesting_user_id: str, + request_body: Optional[Union[models.RevokeOrganizationInvitationRequestBody, models.RevokeOrganizationInvitationRequestBodyTypedDict]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1144,12 +1245,12 @@ async def revoke_async( Use this request to revoke a previously issued organization invitation. Revoking an organization invitation makes it invalid; the invited user will no longer be able to join the organization with the revoked invitation. Only organization invitations with \"pending\" status can be revoked. - The request needs the `requesting_user_id` parameter to specify the user which revokes the invitation. + The request accepts the `requesting_user_id` parameter to specify the user which revokes the invitation. Only users with \"admin\" role can revoke invitations. :param organization_id: The organization ID. :param invitation_id: The organization invitation ID. - :param requesting_user_id: The ID of the user that revokes the invitation. Must be an administrator in the organization. + :param request_body: :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 @@ -1165,9 +1266,7 @@ async def revoke_async( request = models.RevokeOrganizationInvitationRequest( organization_id=organization_id, invitation_id=invitation_id, - request_body=models.RevokeOrganizationInvitationRequestBody( - requesting_user_id=requesting_user_id, - ), + request_body=utils.get_pydantic_model(request_body, Optional[models.RevokeOrganizationInvitationRequestBody]), ) req = self.build_request( @@ -1176,13 +1275,13 @@ async def revoke_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", accept_header_value="application/json", security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body(request.request_body, False, False, "json", models.RevokeOrganizationInvitationRequestBody), + get_serialized_body=lambda: utils.serialize_request_body(request.request_body, False, True, "json", Optional[models.RevokeOrganizationInvitationRequestBody]), timeout_ms=timeout_ms, ) diff --git a/src/clerk_backend_api/organizationmemberships_sdk.py b/src/clerk_backend_api/organizationmemberships_sdk.py index 379d5e1..9e9111e 100644 --- a/src/clerk_backend_api/organizationmemberships_sdk.py +++ b/src/clerk_backend_api/organizationmemberships_sdk.py @@ -4,8 +4,7 @@ from clerk_backend_api import models, utils from clerk_backend_api._hooks import HookContext from clerk_backend_api.types import OptionalNullable, UNSET -from jsonpath import JSONPath -from typing import Any, Dict, Optional, Union +from typing import Any, Optional, Union class OrganizationMembershipsSDK(BaseSDK): @@ -193,7 +192,7 @@ def list( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.ListOrganizationMembershipsResponse: + ) -> Optional[models.OrganizationMemberships]: r"""Get a list of all members of an organization Retrieves all user memberships for the given organization @@ -257,31 +256,9 @@ def list( retry_config=retry_config ) - def next_func() -> Optional[models.ListOrganizationMembershipsResponse]: - body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) - offset = request.offset if not request.offset is None else 0 - - if not http_res.text: - return None - results = JSONPath("$").parse(body) - if len(results) == 0 or len(results[0]) == 0: - return None - limit = request.limit if not request.limit is None else 0 - if len(results[0]) < limit: - return None - next_offset = offset + len(results[0]) - - return self.list( - organization_id=organization_id, - limit=limit, - offset=next_offset, - order_by=order_by, - retries=retries, - ) - data: Any = None if utils.match_response(http_res, "200", "application/json"): - return models.ListOrganizationMembershipsResponse(result=utils.unmarshal_json(http_res.text, Optional[models.OrganizationMemberships]), next=next_func) + return utils.unmarshal_json(http_res.text, Optional[models.OrganizationMemberships]) if utils.match_response(http_res, ["401","422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) @@ -302,7 +279,7 @@ async def list_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.ListOrganizationMembershipsResponse: + ) -> Optional[models.OrganizationMemberships]: r"""Get a list of all members of an organization Retrieves all user memberships for the given organization @@ -366,31 +343,9 @@ async def list_async( retry_config=retry_config ) - def next_func() -> Optional[models.ListOrganizationMembershipsResponse]: - body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) - offset = request.offset if not request.offset is None else 0 - - if not http_res.text: - return None - results = JSONPath("$").parse(body) - if len(results) == 0 or len(results[0]) == 0: - return None - limit = request.limit if not request.limit is None else 0 - if len(results[0]) < limit: - return None - next_offset = offset + len(results[0]) - - return self.list( - organization_id=organization_id, - limit=limit, - offset=next_offset, - order_by=order_by, - retries=retries, - ) - data: Any = None if utils.match_response(http_res, "200", "application/json"): - return models.ListOrganizationMembershipsResponse(result=utils.unmarshal_json(http_res.text, Optional[models.OrganizationMemberships]), next=next_func) + return utils.unmarshal_json(http_res.text, Optional[models.OrganizationMemberships]) if utils.match_response(http_res, ["401","422"], "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) @@ -921,3 +876,171 @@ async def update_metadata_async( 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 get_all( + self, *, + limit: Optional[int] = 10, + offset: Optional[int] = 0, + order_by: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.OrganizationMemberships]: + r"""Get a list of all organization memberships within an instance. + + Retrieves all organization user memberships for the given instance. + + :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: Sorts organizations memberships by phone_number, email_address, created_at, first_name, last_name or username. By prepending one of those values with + or -, we can choose to sort in ascending (ASC) or descending (DESC) order. + :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 + """ + 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.InstanceGetOrganizationMembershipsRequest( + limit=limit, + offset=offset, + order_by=order_by, + ) + + req = self.build_request( + method="GET", + path="/organization_memberships", + 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", + 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="InstanceGetOrganizationMemberships", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","401","422","4XX","500","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.OrganizationMemberships]) + if utils.match_response(http_res, ["400","401","422","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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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_all_async( + self, *, + limit: Optional[int] = 10, + offset: Optional[int] = 0, + order_by: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.OrganizationMemberships]: + r"""Get a list of all organization memberships within an instance. + + Retrieves all organization user memberships for the given instance. + + :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: Sorts organizations memberships by phone_number, email_address, created_at, first_name, last_name or username. By prepending one of those values with + or -, we can choose to sort in ascending (ASC) or descending (DESC) order. + :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 + """ + 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.InstanceGetOrganizationMembershipsRequest( + limit=limit, + offset=offset, + order_by=order_by, + ) + + req = self.build_request( + method="GET", + path="/organization_memberships", + 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", + 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="InstanceGetOrganizationMemberships", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","401","422","4XX","500","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.OrganizationMemberships]) + if utils.match_response(http_res, ["400","401","422","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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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/organizations_sdk.py b/src/clerk_backend_api/organizations_sdk.py index 8a152d7..2316e9f 100644 --- a/src/clerk_backend_api/organizations_sdk.py +++ b/src/clerk_backend_api/organizations_sdk.py @@ -7,6 +7,9 @@ from typing import Any, Optional, Union, cast class OrganizationsSDK(BaseSDK): + r"""Organizations are used to group members under a common entity and provide shared access to resources. + https://clerk.com/docs/organizations/overview + """ def list( @@ -213,6 +216,8 @@ def create( Organizations support private and public metadata. Private metadata can only be accessed from the Backend API. Public metadata can be accessed from the Backend API, and are read-only from the Frontend API. + 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 request: The request object to send. :param retries: Override the default retry configuration for this method @@ -300,6 +305,8 @@ async def create_async( Organizations support private and public metadata. Private metadata can only be accessed from the Backend API. Public metadata can be accessed from the Backend API, and are read-only from the Frontend API. + 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 request: The request object to send. :param retries: Override the default retry configuration for this method @@ -372,6 +379,7 @@ async def create_async( def get( self, *, organization_id: str, + include_members_count: Optional[bool] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -381,6 +389,7 @@ def get( Fetches the organization whose ID or slug matches the provided `id_or_slug` URL query parameter. :param organization_id: The ID or slug of the organization + :param include_members_count: Flag to denote whether or not the organization's members count should be included in the response. :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 @@ -395,6 +404,7 @@ def get( request = models.GetOrganizationRequest( organization_id=organization_id, + include_members_count=include_members_count, ) req = self.build_request( @@ -450,6 +460,7 @@ def get( async def get_async( self, *, organization_id: str, + include_members_count: Optional[bool] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -459,6 +470,7 @@ async def get_async( Fetches the organization whose ID or slug matches the provided `id_or_slug` URL query parameter. :param organization_id: The ID or slug of the organization + :param include_members_count: Flag to denote whether or not the organization's members count should be included in the response. :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 @@ -473,6 +485,7 @@ async def get_async( request = models.GetOrganizationRequest( organization_id=organization_id, + include_members_count=include_members_count, ) req = self.build_request( @@ -534,6 +547,7 @@ def update( slug: OptionalNullable[str] = UNSET, max_allowed_memberships: OptionalNullable[int] = UNSET, admin_delete_enabled: OptionalNullable[bool] = UNSET, + created_at: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -545,10 +559,11 @@ def update( :param organization_id: The ID of the organization to update :param public_metadata: Metadata saved on the organization, that is visible to both your frontend and backend. :param private_metadata: Metadata saved on the organization that is only visible to your backend. - :param name: The new name of the organization + :param name: The new name of the organization. May not contain URLs or HTML. :param slug: The new slug of the organization, which needs to be unique in the instance :param max_allowed_memberships: The maximum number of memberships allowed for this organization :param admin_delete_enabled: If true, an admin can delete this organization with the Frontend API. + :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 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 @@ -570,6 +585,7 @@ def update( slug=slug, max_allowed_memberships=max_allowed_memberships, admin_delete_enabled=admin_delete_enabled, + created_at=created_at, ), ) @@ -633,6 +649,7 @@ async def update_async( slug: OptionalNullable[str] = UNSET, max_allowed_memberships: OptionalNullable[int] = UNSET, admin_delete_enabled: OptionalNullable[bool] = UNSET, + created_at: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -644,10 +661,11 @@ async def update_async( :param organization_id: The ID of the organization to update :param public_metadata: Metadata saved on the organization, that is visible to both your frontend and backend. :param private_metadata: Metadata saved on the organization that is only visible to your backend. - :param name: The new name of the organization + :param name: The new name of the organization. May not contain URLs or HTML. :param slug: The new slug of the organization, which needs to be unique in the instance :param max_allowed_memberships: The maximum number of memberships allowed for this organization :param admin_delete_enabled: If true, an admin can delete this organization with the Frontend API. + :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 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 @@ -669,6 +687,7 @@ async def update_async( slug=slug, max_allowed_memberships=max_allowed_memberships, admin_delete_enabled=admin_delete_enabled, + created_at=created_at, ), ) diff --git a/src/clerk_backend_api/redirecturls.py b/src/clerk_backend_api/redirecturls.py index c36bc7c..7afcdae 100644 --- a/src/clerk_backend_api/redirecturls.py +++ b/src/clerk_backend_api/redirecturls.py @@ -3,10 +3,10 @@ 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, List, Optional, Union, cast +from clerk_backend_api.types import OptionalNullable, UNSET +from typing import List, Optional -class RedirectUrls(BaseSDK): +class RedirectURLs(BaseSDK): def list( @@ -142,473 +142,3 @@ async def list_async( 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( - self, *, - request: Optional[Union[models.CreateRedirectURLRequestBody, models.CreateRedirectURLRequestBodyTypedDict]] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - ) -> Optional[models.RedirectURL]: - r"""Create a redirect URL - - Create a redirect URL - - :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 - """ - 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) and request is not None: - request = utils.unmarshal(request, models.CreateRedirectURLRequestBody) - request = cast(models.CreateRedirectURLRequestBody, request) - - req = self.build_request( - method="POST", - path="/redirect_urls", - 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", - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body(request, False, True, "json", Optional[models.CreateRedirectURLRequestBody]), - 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="CreateRedirectURL", 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.RedirectURL]) - 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"], "*"): - raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) - - content_type = http_res.headers.get("Content-Type") - 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_async( - self, *, - request: Optional[Union[models.CreateRedirectURLRequestBody, models.CreateRedirectURLRequestBodyTypedDict]] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - ) -> Optional[models.RedirectURL]: - r"""Create a redirect URL - - Create a redirect URL - - :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 - """ - 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) and request is not None: - request = utils.unmarshal(request, models.CreateRedirectURLRequestBody) - request = cast(models.CreateRedirectURLRequestBody, request) - - req = self.build_request( - method="POST", - path="/redirect_urls", - 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", - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body(request, False, True, "json", Optional[models.CreateRedirectURLRequestBody]), - 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="CreateRedirectURL", 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.RedirectURL]) - 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"], "*"): - raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) - - content_type = http_res.headers.get("Content-Type") - 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 get( - self, *, - id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - ) -> Optional[models.RedirectURL]: - r"""Retrieve a redirect URL - - Retrieve the details of the redirect URL with the given ID - - :param id: The ID of the redirect URL - :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 - """ - 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.GetRedirectURLRequest( - id=id, - ) - - req = self.build_request( - method="GET", - path="/redirect_urls/{id}", - 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", - 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="GetRedirectURL", oauth2_scopes=[], security_source=self.sdk_configuration.security), - request=req, - error_status_codes=["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.RedirectURL]) - 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"], "*"): - raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) - - content_type = http_res.headers.get("Content-Type") - 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_async( - self, *, - id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - ) -> Optional[models.RedirectURL]: - r"""Retrieve a redirect URL - - Retrieve the details of the redirect URL with the given ID - - :param id: The ID of the redirect URL - :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 - """ - 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.GetRedirectURLRequest( - id=id, - ) - - req = self.build_request( - method="GET", - path="/redirect_urls/{id}", - 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", - 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="GetRedirectURL", oauth2_scopes=[], security_source=self.sdk_configuration.security), - request=req, - error_status_codes=["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.RedirectURL]) - 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"], "*"): - raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) - - content_type = http_res.headers.get("Content-Type") - 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 delete( - self, *, - id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - ) -> Optional[models.DeletedObject]: - r"""Delete a redirect URL - - Remove the selected redirect URL from the whitelist of the instance - - :param id: The ID of the redirect URL - :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 - """ - 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.DeleteRedirectURLRequest( - id=id, - ) - - req = self.build_request( - method="DELETE", - path="/redirect_urls/{id}", - 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", - 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="DeleteRedirectURL", oauth2_scopes=[], security_source=self.sdk_configuration.security), - request=req, - error_status_codes=["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.DeletedObject]) - 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"], "*"): - raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) - - content_type = http_res.headers.get("Content-Type") - 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 delete_async( - self, *, - id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - ) -> Optional[models.DeletedObject]: - r"""Delete a redirect URL - - Remove the selected redirect URL from the whitelist of the instance - - :param id: The ID of the redirect URL - :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 - """ - 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.DeleteRedirectURLRequest( - id=id, - ) - - req = self.build_request( - method="DELETE", - path="/redirect_urls/{id}", - 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", - 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="DeleteRedirectURL", oauth2_scopes=[], security_source=self.sdk_configuration.security), - request=req, - error_status_codes=["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.DeletedObject]) - 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"], "*"): - raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) - - content_type = http_res.headers.get("Content-Type") - 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/samlconnections_sdk.py b/src/clerk_backend_api/samlconnections_sdk.py index 632a83f..128ad9f 100644 --- a/src/clerk_backend_api/samlconnections_sdk.py +++ b/src/clerk_backend_api/samlconnections_sdk.py @@ -4,8 +4,7 @@ from clerk_backend_api import models, utils from clerk_backend_api._hooks import HookContext from clerk_backend_api.types import BaseModel, OptionalNullable, UNSET -from jsonpath import JSONPath -from typing import Any, Dict, Optional, Union, cast +from typing import Any, Optional, Union, cast class SamlConnectionsSDK(BaseSDK): @@ -17,7 +16,7 @@ def list( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.ListSAMLConnectionsResponse: + ) -> Optional[models.SAMLConnections]: r"""Get a list of SAML Connections for an instance Returns the list of SAML Connections for an instance. @@ -79,29 +78,9 @@ def list( retry_config=retry_config ) - def next_func() -> Optional[models.ListSAMLConnectionsResponse]: - body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) - offset = request.offset if not request.offset is None else 0 - - if not http_res.text: - return None - results = JSONPath("$").parse(body) - if len(results) == 0 or len(results[0]) == 0: - return None - limit = request.limit if not request.limit is None else 0 - if len(results[0]) < limit: - return None - next_offset = offset + len(results[0]) - - return self.list( - limit=limit, - offset=next_offset, - retries=retries, - ) - data: Any = None if utils.match_response(http_res, "200", "application/json"): - return models.ListSAMLConnectionsResponse(result=utils.unmarshal_json(http_res.text, Optional[models.SAMLConnections]), next=next_func) + return utils.unmarshal_json(http_res.text, Optional[models.SAMLConnections]) 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) @@ -120,7 +99,7 @@ async def list_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.ListSAMLConnectionsResponse: + ) -> Optional[models.SAMLConnections]: r"""Get a list of SAML Connections for an instance Returns the list of SAML Connections for an instance. @@ -182,29 +161,9 @@ async def list_async( retry_config=retry_config ) - def next_func() -> Optional[models.ListSAMLConnectionsResponse]: - body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) - offset = request.offset if not request.offset is None else 0 - - if not http_res.text: - return None - results = JSONPath("$").parse(body) - if len(results) == 0 or len(results[0]) == 0: - return None - limit = request.limit if not request.limit is None else 0 - if len(results[0]) < limit: - return None - next_offset = offset + len(results[0]) - - return self.list( - limit=limit, - offset=next_offset, - retries=retries, - ) - data: Any = None if utils.match_response(http_res, "200", "application/json"): - return models.ListSAMLConnectionsResponse(result=utils.unmarshal_json(http_res.text, Optional[models.SAMLConnections]), next=next_func) + return utils.unmarshal_json(http_res.text, Optional[models.SAMLConnections]) 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) @@ -222,7 +181,7 @@ def create( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> Optional[models.SAMLConnection]: + ) -> Optional[models.SchemasSAMLConnection]: r"""Create a SAML Connection Create a new SAML Connection. @@ -283,7 +242,7 @@ def create( data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, Optional[models.SAMLConnection]) + return utils.unmarshal_json(http_res.text, Optional[models.SchemasSAMLConnection]) 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) @@ -301,7 +260,7 @@ async def create_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> Optional[models.SAMLConnection]: + ) -> Optional[models.SchemasSAMLConnection]: r"""Create a SAML Connection Create a new SAML Connection. @@ -362,7 +321,7 @@ async def create_async( data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, Optional[models.SAMLConnection]) + return utils.unmarshal_json(http_res.text, Optional[models.SchemasSAMLConnection]) 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) @@ -380,7 +339,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> Optional[models.SAMLConnection]: + ) -> Optional[models.SchemasSAMLConnection]: r"""Retrieve a SAML Connection by ID Fetches the SAML Connection whose ID matches the provided `saml_connection_id` in the path. @@ -440,7 +399,7 @@ def get( data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, Optional[models.SAMLConnection]) + return utils.unmarshal_json(http_res.text, Optional[models.SchemasSAMLConnection]) 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) @@ -458,7 +417,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> Optional[models.SAMLConnection]: + ) -> Optional[models.SchemasSAMLConnection]: r"""Retrieve a SAML Connection by ID Fetches the SAML Connection whose ID matches the provided `saml_connection_id` in the path. @@ -518,7 +477,7 @@ async def get_async( data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, Optional[models.SAMLConnection]) + return utils.unmarshal_json(http_res.text, Optional[models.SchemasSAMLConnection]) 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) @@ -545,10 +504,11 @@ def update( sync_user_attributes: OptionalNullable[bool] = UNSET, allow_subdomains: OptionalNullable[bool] = UNSET, allow_idp_initiated: OptionalNullable[bool] = UNSET, + disable_additional_identifications: OptionalNullable[bool] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> Optional[models.SAMLConnection]: + ) -> Optional[models.SchemasSAMLConnection]: r"""Update a SAML Connection Updates the SAML Connection whose ID matches the provided `id` in the path. @@ -566,6 +526,7 @@ def update( :param sync_user_attributes: Controls whether to update the user's attributes in each sign-in :param allow_subdomains: Allow users with an email address subdomain to use this connection in order to authenticate :param allow_idp_initiated: Enable or deactivate IdP-initiated flows + :param disable_additional_identifications: Enable or deactivate additional identifications :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 @@ -593,6 +554,7 @@ def update( sync_user_attributes=sync_user_attributes, allow_subdomains=allow_subdomains, allow_idp_initiated=allow_idp_initiated, + disable_additional_identifications=disable_additional_identifications, ), ) @@ -635,7 +597,7 @@ def update( data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, Optional[models.SAMLConnection]) + return utils.unmarshal_json(http_res.text, Optional[models.SchemasSAMLConnection]) 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) @@ -662,10 +624,11 @@ async def update_async( sync_user_attributes: OptionalNullable[bool] = UNSET, allow_subdomains: OptionalNullable[bool] = UNSET, allow_idp_initiated: OptionalNullable[bool] = UNSET, + disable_additional_identifications: OptionalNullable[bool] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> Optional[models.SAMLConnection]: + ) -> Optional[models.SchemasSAMLConnection]: r"""Update a SAML Connection Updates the SAML Connection whose ID matches the provided `id` in the path. @@ -683,6 +646,7 @@ async def update_async( :param sync_user_attributes: Controls whether to update the user's attributes in each sign-in :param allow_subdomains: Allow users with an email address subdomain to use this connection in order to authenticate :param allow_idp_initiated: Enable or deactivate IdP-initiated flows + :param disable_additional_identifications: Enable or deactivate additional identifications :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 @@ -710,6 +674,7 @@ async def update_async( sync_user_attributes=sync_user_attributes, allow_subdomains=allow_subdomains, allow_idp_initiated=allow_idp_initiated, + disable_additional_identifications=disable_additional_identifications, ), ) @@ -752,7 +717,7 @@ async def update_async( data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, Optional[models.SAMLConnection]) + return utils.unmarshal_json(http_res.text, Optional[models.SchemasSAMLConnection]) 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) diff --git a/src/clerk_backend_api/sdk.py b/src/clerk_backend_api/sdk.py index b56c1c0..15a2bc0 100644 --- a/src/clerk_backend_api/sdk.py +++ b/src/clerk_backend_api/sdk.py @@ -8,24 +8,30 @@ from clerk_backend_api import models, utils from clerk_backend_api._hooks import SDKHooks from clerk_backend_api.actortokens import ActorTokens +from clerk_backend_api.allowlistblocklist import AllowlistBlocklist from clerk_backend_api.allowlistidentifiers import AllowlistIdentifiers from clerk_backend_api.betafeatures import BetaFeatures from clerk_backend_api.blocklistidentifiers_sdk import BlocklistIdentifiersSDK +from clerk_backend_api.clerk_redirecturls import ClerkRedirectUrls from clerk_backend_api.clients import Clients from clerk_backend_api.domains_sdk import DomainsSDK 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.invitations import Invitations from clerk_backend_api.jwks import Jwks from clerk_backend_api.jwttemplates import JwtTemplates -from clerk_backend_api.misc import Misc -from clerk_backend_api.oauthapplications_sdk import OAuthApplicationsSDK +from clerk_backend_api.miscellaneous import Miscellaneous +from clerk_backend_api.oauthapplications_sdk import OauthApplicationsSDK +from clerk_backend_api.organizationdomain_sdk import OrganizationDomainSDK +from clerk_backend_api.organizationdomains_sdk import OrganizationDomainsSDK from clerk_backend_api.organizationinvitations_sdk import OrganizationInvitationsSDK from clerk_backend_api.organizationmemberships_sdk import OrganizationMembershipsSDK from clerk_backend_api.organizations_sdk import OrganizationsSDK from clerk_backend_api.phonenumbers import PhoneNumbers from clerk_backend_api.proxychecks import ProxyChecks -from clerk_backend_api.redirecturls import RedirectUrls +from clerk_backend_api.redirecturls import RedirectURLs from clerk_backend_api.samlconnections_sdk import SamlConnectionsSDK from clerk_backend_api.sessions import Sessions from clerk_backend_api.signintokens import SignInTokens @@ -51,31 +57,59 @@ class Clerk(BaseSDK): Please see https://clerk.com/docs for more information. https://clerk.com/docs """ - misc: Misc + miscellaneous: Miscellaneous + r"""Various endpoints that do not belong in any particular category.""" jwks: Jwks 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 + """ email_addresses: EmailAddresses phone_numbers: PhoneNumbers sessions: Sessions + r"""The Session object is an abstraction over an HTTP session. + It models the period of information exchange between a user and the server. + Sessions are created when a user successfully goes through the sign in or sign up flows. + https://clerk.com/docs/reference/clerkjs/session + """ + email_sms_templates: EmailSMSTemplates + email_and_sms_templates: EmailAndSmsTemplates templates: Templates users: Users + r"""The user object represents a user that has successfully signed up to your application. + https://clerk.com/docs/reference/clerkjs/user + """ invitations: Invitations + r"""Invitations allow you to invite someone to sign up to your application, via email. + https://clerk.com/docs/authentication/invitations + """ + organization_invitations: OrganizationInvitationsSDK + allowlist_blocklist: AllowlistBlocklist allowlist_identifiers: AllowlistIdentifiers blocklist_identifiers: BlocklistIdentifiersSDK beta_features: BetaFeatures actor_tokens: ActorTokens domains: DomainsSDK + r"""Domains represent each instance's URLs and DNS setup.""" instance_settings: InstanceSettingsSDK webhooks: Webhooks + r"""You can configure webhooks to be notified about various events that happen on your instance. + https://clerk.com/docs/integration/webhooks + """ jwt_templates: JwtTemplates organizations: OrganizationsSDK - organization_invitations: OrganizationInvitationsSDK + r"""Organizations are used to group members under a common entity and provide shared access to resources. + https://clerk.com/docs/organizations/overview + """ organization_memberships: OrganizationMembershipsSDK + organization_domains: OrganizationDomainsSDK + organization_domain: OrganizationDomainSDK proxy_checks: ProxyChecks - redirect_urls: RedirectUrls + redirect_ur_ls: RedirectURLs + redirect_urls: ClerkRedirectUrls sign_in_tokens: SignInTokens sign_ups: SignUps - o_auth_applications: OAuthApplicationsSDK + oauth_applications: OauthApplicationsSDK saml_connections: SamlConnectionsSDK testing_tokens: TestingTokens def __init__( @@ -154,15 +188,19 @@ def __init__( def _init_sdks(self): - self.misc = Misc(self.sdk_configuration) + self.miscellaneous = Miscellaneous(self.sdk_configuration) self.jwks = Jwks(self.sdk_configuration) self.clients = Clients(self.sdk_configuration) self.email_addresses = EmailAddresses(self.sdk_configuration) self.phone_numbers = PhoneNumbers(self.sdk_configuration) self.sessions = Sessions(self.sdk_configuration) + self.email_sms_templates = EmailSMSTemplates(self.sdk_configuration) + self.email_and_sms_templates = EmailAndSmsTemplates(self.sdk_configuration) self.templates = Templates(self.sdk_configuration) self.users = Users(self.sdk_configuration) self.invitations = Invitations(self.sdk_configuration) + self.organization_invitations = OrganizationInvitationsSDK(self.sdk_configuration) + self.allowlist_blocklist = AllowlistBlocklist(self.sdk_configuration) self.allowlist_identifiers = AllowlistIdentifiers(self.sdk_configuration) self.blocklist_identifiers = BlocklistIdentifiersSDK(self.sdk_configuration) self.beta_features = BetaFeatures(self.sdk_configuration) @@ -172,13 +210,15 @@ def _init_sdks(self): self.webhooks = Webhooks(self.sdk_configuration) self.jwt_templates = JwtTemplates(self.sdk_configuration) self.organizations = OrganizationsSDK(self.sdk_configuration) - self.organization_invitations = OrganizationInvitationsSDK(self.sdk_configuration) self.organization_memberships = OrganizationMembershipsSDK(self.sdk_configuration) + self.organization_domains = OrganizationDomainsSDK(self.sdk_configuration) + self.organization_domain = OrganizationDomainSDK(self.sdk_configuration) self.proxy_checks = ProxyChecks(self.sdk_configuration) - self.redirect_urls = RedirectUrls(self.sdk_configuration) + self.redirect_ur_ls = RedirectURLs(self.sdk_configuration) + self.redirect_urls = ClerkRedirectUrls(self.sdk_configuration) self.sign_in_tokens = SignInTokens(self.sdk_configuration) self.sign_ups = SignUps(self.sdk_configuration) - self.o_auth_applications = OAuthApplicationsSDK(self.sdk_configuration) + self.oauth_applications = OauthApplicationsSDK(self.sdk_configuration) self.saml_connections = SamlConnectionsSDK(self.sdk_configuration) self.testing_tokens = TestingTokens(self.sdk_configuration) diff --git a/src/clerk_backend_api/sdkconfiguration.py b/src/clerk_backend_api/sdkconfiguration.py index b8c1385..b96659f 100644 --- a/src/clerk_backend_api/sdkconfiguration.py +++ b/src/clerk_backend_api/sdkconfiguration.py @@ -26,9 +26,9 @@ class SDKConfiguration: server_idx: Optional[int] = 0 language: str = "python" openapi_doc_version: str = "v1" - sdk_version: str = "0.5.0" + sdk_version: str = "1.0.0" gen_version: str = "2.407.2" - user_agent: str = "speakeasy-sdk/python 0.5.0 2.407.2 v1 clerk-backend-api" + user_agent: str = "speakeasy-sdk/python 1.0.0 2.407.2 v1 clerk-backend-api" 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 deff6b5..59ba449 100644 --- a/src/clerk_backend_api/sessions.py +++ b/src/clerk_backend_api/sessions.py @@ -8,6 +8,11 @@ from typing_extensions import deprecated class Sessions(BaseSDK): + r"""The Session object is an abstraction over an HTTP session. + It models the period of information exchange between a user and the server. + Sessions are created when a user successfully goes through the sign in or sign up flows. + https://clerk.com/docs/reference/clerkjs/session + """ def list( diff --git a/src/clerk_backend_api/templates.py b/src/clerk_backend_api/templates.py index b8a64e6..101a08a 100644 --- a/src/clerk_backend_api/templates.py +++ b/src/clerk_backend_api/templates.py @@ -4,663 +4,13 @@ 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, Optional, Union +from typing import Any, Optional, Union +from typing_extensions import deprecated class Templates(BaseSDK): - def list( - self, *, - template_type: models.TemplateType, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - ) -> Optional[List[models.Template]]: - r"""List all templates - - Returns a list of all templates. - The templates are returned sorted by position. - - :param template_type: The type of templates to list (email or SMS) - :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 - """ - 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.GetTemplateListRequest( - template_type=template_type, - ) - - req = self.build_request( - method="GET", - path="/templates/{template_type}", - 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", - 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="GetTemplateList", oauth2_scopes=[], security_source=self.sdk_configuration.security), - request=req, - error_status_codes=["400","401","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.Template]]) - 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"], "*"): - raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) - - content_type = http_res.headers.get("Content-Type") - 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_async( - self, *, - template_type: models.TemplateType, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - ) -> Optional[List[models.Template]]: - r"""List all templates - - Returns a list of all templates. - The templates are returned sorted by position. - - :param template_type: The type of templates to list (email or SMS) - :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 - """ - 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.GetTemplateListRequest( - template_type=template_type, - ) - - req = self.build_request( - method="GET", - path="/templates/{template_type}", - 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", - 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="GetTemplateList", oauth2_scopes=[], security_source=self.sdk_configuration.security), - request=req, - error_status_codes=["400","401","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.Template]]) - 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"], "*"): - raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) - - content_type = http_res.headers.get("Content-Type") - 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 get( - self, *, - template_type: models.PathParamTemplateType, - slug: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - ) -> Optional[models.Template]: - r"""Retrieve a template - - Returns the details of a template - - :param template_type: The type of templates to retrieve (email or SMS) - :param slug: The slug (i.e. machine-friendly name) of the template to retrieve - :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 - """ - 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.GetTemplateRequest( - template_type=template_type, - slug=slug, - ) - - req = self.build_request( - method="GET", - path="/templates/{template_type}/{slug}", - 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", - 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="GetTemplate", oauth2_scopes=[], security_source=self.sdk_configuration.security), - request=req, - error_status_codes=["400","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.Template]) - 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"], "*"): - raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) - - content_type = http_res.headers.get("Content-Type") - 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_async( - self, *, - template_type: models.PathParamTemplateType, - slug: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - ) -> Optional[models.Template]: - r"""Retrieve a template - - Returns the details of a template - - :param template_type: The type of templates to retrieve (email or SMS) - :param slug: The slug (i.e. machine-friendly name) of the template to retrieve - :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 - """ - 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.GetTemplateRequest( - template_type=template_type, - slug=slug, - ) - - req = self.build_request( - method="GET", - path="/templates/{template_type}/{slug}", - 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", - 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="GetTemplate", oauth2_scopes=[], security_source=self.sdk_configuration.security), - request=req, - error_status_codes=["400","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.Template]) - 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"], "*"): - raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) - - content_type = http_res.headers.get("Content-Type") - 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 upsert( - self, *, - template_type: models.UpsertTemplatePathParamTemplateType, - slug: str, - request_body: Optional[Union[models.UpsertTemplateRequestBody, models.UpsertTemplateRequestBodyTypedDict]] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - ) -> Optional[models.Template]: - r"""Update a template for a given type and slug - - Updates the existing template of the given type and slug - - :param template_type: The type of template to update - :param slug: The slug of the template to update - :param request_body: - :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 - """ - 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.UpsertTemplateRequest( - template_type=template_type, - slug=slug, - request_body=utils.get_pydantic_model(request_body, Optional[models.UpsertTemplateRequestBody]), - ) - - req = self.build_request( - method="PUT", - path="/templates/{template_type}/{slug}", - 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", - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body(request.request_body, False, True, "json", Optional[models.UpsertTemplateRequestBody]), - 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="UpsertTemplate", oauth2_scopes=[], security_source=self.sdk_configuration.security), - request=req, - error_status_codes=["400","401","402","403","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.Template]) - if utils.match_response(http_res, ["400","401","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"], "*"): - raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) - - content_type = http_res.headers.get("Content-Type") - 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 upsert_async( - self, *, - template_type: models.UpsertTemplatePathParamTemplateType, - slug: str, - request_body: Optional[Union[models.UpsertTemplateRequestBody, models.UpsertTemplateRequestBodyTypedDict]] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - ) -> Optional[models.Template]: - r"""Update a template for a given type and slug - - Updates the existing template of the given type and slug - - :param template_type: The type of template to update - :param slug: The slug of the template to update - :param request_body: - :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 - """ - 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.UpsertTemplateRequest( - template_type=template_type, - slug=slug, - request_body=utils.get_pydantic_model(request_body, Optional[models.UpsertTemplateRequestBody]), - ) - - req = self.build_request( - method="PUT", - path="/templates/{template_type}/{slug}", - 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", - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body(request.request_body, False, True, "json", Optional[models.UpsertTemplateRequestBody]), - 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="UpsertTemplate", oauth2_scopes=[], security_source=self.sdk_configuration.security), - request=req, - error_status_codes=["400","401","402","403","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.Template]) - if utils.match_response(http_res, ["400","401","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"], "*"): - raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) - - content_type = http_res.headers.get("Content-Type") - 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 revert( - self, *, - template_type: models.RevertTemplatePathParamTemplateType, - slug: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - ) -> Optional[models.Template]: - r"""Revert a template - - Reverts an updated template to its default state - - :param template_type: The type of template to revert - :param slug: The slug of the template to revert - :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 - """ - 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.RevertTemplateRequest( - template_type=template_type, - slug=slug, - ) - - req = self.build_request( - method="POST", - path="/templates/{template_type}/{slug}/revert", - 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", - 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="RevertTemplate", oauth2_scopes=[], security_source=self.sdk_configuration.security), - request=req, - error_status_codes=["400","401","402","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.Template]) - if utils.match_response(http_res, ["400","401","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"], "*"): - raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) - - content_type = http_res.headers.get("Content-Type") - 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 revert_async( - self, *, - template_type: models.RevertTemplatePathParamTemplateType, - slug: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - ) -> Optional[models.Template]: - r"""Revert a template - - Reverts an updated template to its default state - - :param template_type: The type of template to revert - :param slug: The slug of the template to revert - :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 - """ - 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.RevertTemplateRequest( - template_type=template_type, - slug=slug, - ) - - req = self.build_request( - method="POST", - path="/templates/{template_type}/{slug}/revert", - 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", - 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="RevertTemplate", oauth2_scopes=[], security_source=self.sdk_configuration.security), - request=req, - error_status_codes=["400","401","402","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.Template]) - if utils.match_response(http_res, ["400","401","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"], "*"): - raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) - - content_type = http_res.headers.get("Content-Type") - raise models.SDKError(f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, http_res.text, http_res) - - - + @deprecated("warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.") def preview( self, *, template_type: str, @@ -746,6 +96,7 @@ def preview( + @deprecated("warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.") async def preview_async( self, *, template_type: str, @@ -830,177 +181,3 @@ async def preview_async( 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 toggle_delivery( - self, *, - template_type: models.ToggleTemplateDeliveryPathParamTemplateType, - slug: str, - request_body: Optional[Union[models.ToggleTemplateDeliveryRequestBody, models.ToggleTemplateDeliveryRequestBodyTypedDict]] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - ) -> Optional[models.Template]: - r"""Toggle the delivery by Clerk for a template of a given type and slug - - Toggles the delivery by Clerk for a template of a given type and slug. - If disabled, Clerk will not deliver the resulting email or SMS. - The app developer will need to listen to the `email.created` or `sms.created` webhooks in order to handle delivery themselves. - - :param template_type: The type of template to toggle delivery for - :param slug: The slug of the template for which to toggle delivery - :param request_body: - :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 - """ - 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.ToggleTemplateDeliveryRequest( - template_type=template_type, - slug=slug, - request_body=utils.get_pydantic_model(request_body, Optional[models.ToggleTemplateDeliveryRequestBody]), - ) - - req = self.build_request( - method="POST", - path="/templates/{template_type}/{slug}/toggle_delivery", - 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", - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body(request.request_body, False, True, "json", Optional[models.ToggleTemplateDeliveryRequestBody]), - 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="ToggleTemplateDelivery", oauth2_scopes=[], security_source=self.sdk_configuration.security), - request=req, - error_status_codes=["400","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.Template]) - 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"], "*"): - raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) - - content_type = http_res.headers.get("Content-Type") - 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 toggle_delivery_async( - self, *, - template_type: models.ToggleTemplateDeliveryPathParamTemplateType, - slug: str, - request_body: Optional[Union[models.ToggleTemplateDeliveryRequestBody, models.ToggleTemplateDeliveryRequestBodyTypedDict]] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - ) -> Optional[models.Template]: - r"""Toggle the delivery by Clerk for a template of a given type and slug - - Toggles the delivery by Clerk for a template of a given type and slug. - If disabled, Clerk will not deliver the resulting email or SMS. - The app developer will need to listen to the `email.created` or `sms.created` webhooks in order to handle delivery themselves. - - :param template_type: The type of template to toggle delivery for - :param slug: The slug of the template for which to toggle delivery - :param request_body: - :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 - """ - 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.ToggleTemplateDeliveryRequest( - template_type=template_type, - slug=slug, - request_body=utils.get_pydantic_model(request_body, Optional[models.ToggleTemplateDeliveryRequestBody]), - ) - - req = self.build_request( - method="POST", - path="/templates/{template_type}/{slug}/toggle_delivery", - 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", - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body(request.request_body, False, True, "json", Optional[models.ToggleTemplateDeliveryRequestBody]), - 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="ToggleTemplateDelivery", oauth2_scopes=[], security_source=self.sdk_configuration.security), - request=req, - error_status_codes=["400","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.Template]) - 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"], "*"): - raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) - - content_type = http_res.headers.get("Content-Type") - 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/users.py b/src/clerk_backend_api/users.py index 00de43a..e10dc42 100644 --- a/src/clerk_backend_api/users.py +++ b/src/clerk_backend_api/users.py @@ -4,10 +4,12 @@ from clerk_backend_api import models, utils from clerk_backend_api._hooks import HookContext from clerk_backend_api.types import OptionalNullable, UNSET -from jsonpath import JSONPath -from typing import Any, Dict, List, Optional, Union +from typing import Any, List, Optional, Union class Users(BaseSDK): + r"""The user object represents a user that has successfully signed up to your application. + https://clerk.com/docs/reference/clerkjs/user + """ def list( @@ -245,7 +247,7 @@ def create( username: OptionalNullable[str] = UNSET, password: OptionalNullable[str] = UNSET, password_digest: Optional[str] = None, - password_hasher: Optional[models.PasswordHasher] = None, + password_hasher: Optional[str] = None, skip_password_checks: Optional[bool] = None, skip_password_requirement: Optional[bool] = None, totp_secret: Optional[str] = None, @@ -253,6 +255,11 @@ def create( public_metadata: Optional[Union[models.CreateUserPublicMetadata, models.CreateUserPublicMetadataTypedDict]] = None, private_metadata: Optional[Union[models.CreateUserPrivateMetadata, models.CreateUserPrivateMetadataTypedDict]] = None, unsafe_metadata: Optional[Union[models.CreateUserUnsafeMetadata, models.CreateUserUnsafeMetadataTypedDict]] = None, + delete_self_enabled: OptionalNullable[bool] = UNSET, + legal_accepted_at: OptionalNullable[str] = UNSET, + skip_legal_checks: OptionalNullable[bool] = UNSET, + create_organization_enabled: OptionalNullable[bool] = UNSET, + create_organizations_limit: OptionalNullable[int] = UNSET, created_at: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -277,7 +284,7 @@ def create( :param username: The username to give to the user. It must be unique across your instance. :param password: The plaintext password to give the user. Must be at least 8 characters long, and can not be in any list of hacked passwords. :param password_digest: In case you already have the password digests and not the passwords, you can use them for the newly created user via this property. The digests should be generated with one of the supported algorithms. The hashing algorithm can be specified using the `password_hasher` property. - :param password_hasher: The hashing algorithm that was used to generate the password digest. The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [sha256](https://en.wikipedia.org/wiki/SHA-2) and the [argon2](https://argon2.online/) variants argon2i and argon2id. If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. Insecure schemes are marked with `(insecure)` in the list below. Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: **bcrypt:** The digest should be of the following form: `$$$` **bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): `bcrypt_sha256$$$$` **md5** (insecure): The digest should follow the regular form e.g.: `5f4dcc3b5aa765d61d8327deb882cf99` **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: `pbkdf2_sha256$$$` Note: Both the salt and the hash are expected to be base64-encoded. **pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: `pbkdf2_sha512$$$` _iterations:_ The number of iterations used. Must be an integer less than 420000. _salt:_ The salt used when generating the hash. Must be less than 1024 bytes. _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): `pbkdf2_sha256$$$` Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: 1. uses sha1 instead of sha256 2. accepts the hash as a hex-encoded string The format is the following: `pbkdf2_sha1$$$` **phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: The format is the following: `$P$` - $P$ is the prefix used to identify phpass hashes. - rounds is a single character encoding a 6-bit integer representing the number of rounds used. - salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. - checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. **scrypt_firebase:** The Firebase-specific variant of scrypt. The value is expected to have 6 segments separated by the $ character and include the following information: _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. _signer key:_ The base64 encoded signer key. _salt separator:_ The base64 encoded salt separator. _rounds:_ The number of rounds the algorithm needs to run. _memory cost:_ The cost of the algorithm run The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: `$$$$$` **scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. The value is expected to have 3 segments separated by the $ character and include the following information: _algorithm args:_ The algorithm used to generate the hash. _salt:_ The salt used to generate the above hash. _hash:_ The actual Base64 hash. The algorithm args are the parameters used to generate the hash and are included in the digest. **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: _version (v):_ The argon version, version 19 is assumed _memory (m):_ The memory used by the algorithm (in kibibytes) _iterations (t):_ The number of iterations to perform _parallelism (p):_ The number of threads to use Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). The final part is the actual digest. `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` **argon2id:** See the previous algorithm for an explanation of the formatting. For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` **sha256** (insecure): The digest should be a 64-length hex string, e.g.: `9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` **sha256_salted** (insecure): The digest should be a 64-length hex string with a salt. The format is the following: `$` The value is expected to have 2 segments separated by the $ character and include the following information: _hash:_ The sha256 hash, a 64-length hex string. _salt:_ The salt used to generate the above hash. Must be between 1 and 1024 bits. + :param password_hasher: The hashing algorithm that was used to generate the password digest. The algorithms we support at the moment are [`bcrypt`](https://en.wikipedia.org/wiki/Bcrypt), [`bcrypt_sha256_django`](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [`md5`](https://en.wikipedia.org/wiki/MD5), `pbkdf2_sha1`, `pbkdf2_sha256`, [`pbkdf2_sha256_django`](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [`phpass`](https://www.openwall.com/phpass/), [`scrypt_firebase`](https://firebaseopensource.com/projects/firebase/scrypt/), [`scrypt_werkzeug`](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [`sha256`](https://en.wikipedia.org/wiki/SHA-2), and the [`argon2`](https://argon2.online/) variants: `argon2i` and `argon2id`. Each of the supported hashers expects the incoming digest to be in a particular format. See the [Clerk docs](https://clerk.com/docs/references/backend/user/create-user) for more information. :param skip_password_checks: When set to `true` all password checks are skipped. It is recommended to use this method only when migrating plaintext passwords to Clerk. Upon migration the user base should be prompted to pick stronger password. :param skip_password_requirement: When set to `true`, `password` is not required anymore when creating the user and can be omitted. This is useful when you are trying to create a user that doesn't have a password, in an instance that is using passwords. Please note that you cannot use this flag if password is the only way for a user to sign into your instance. :param totp_secret: In case TOTP is configured on the instance, you can provide the secret to enable it on the newly created user without the need to reset it. Please note that currently the supported options are: * Period: 30 seconds * Code length: 6 digits * Algorithm: SHA1 @@ -285,6 +292,11 @@ def create( :param public_metadata: Metadata saved on the user, that is visible to both your Frontend and Backend APIs :param private_metadata: Metadata saved on the user, that is only visible to your Backend API :param unsafe_metadata: Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + :param delete_self_enabled: If enabled, user can delete themselves via FAPI. + :param legal_accepted_at: A custom timestamp denoting _when_ the user accepted legal requirements, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). + :param skip_legal_checks: When set to `true` all legal checks are skipped. It is not recommended to skip legal checks unless you are migrating a user to Clerk. + :param create_organization_enabled: If enabled, user can create organizations via FAPI. + :param create_organizations_limit: The maximum number of organizations the user can create. 0 means unlimited. :param created_at: A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -316,6 +328,11 @@ def create( public_metadata=utils.get_pydantic_model(public_metadata, Optional[models.CreateUserPublicMetadata]), private_metadata=utils.get_pydantic_model(private_metadata, Optional[models.CreateUserPrivateMetadata]), unsafe_metadata=utils.get_pydantic_model(unsafe_metadata, Optional[models.CreateUserUnsafeMetadata]), + delete_self_enabled=delete_self_enabled, + legal_accepted_at=legal_accepted_at, + skip_legal_checks=skip_legal_checks, + create_organization_enabled=create_organization_enabled, + create_organizations_limit=create_organizations_limit, created_at=created_at, ) @@ -381,7 +398,7 @@ async def create_async( username: OptionalNullable[str] = UNSET, password: OptionalNullable[str] = UNSET, password_digest: Optional[str] = None, - password_hasher: Optional[models.PasswordHasher] = None, + password_hasher: Optional[str] = None, skip_password_checks: Optional[bool] = None, skip_password_requirement: Optional[bool] = None, totp_secret: Optional[str] = None, @@ -389,6 +406,11 @@ async def create_async( public_metadata: Optional[Union[models.CreateUserPublicMetadata, models.CreateUserPublicMetadataTypedDict]] = None, private_metadata: Optional[Union[models.CreateUserPrivateMetadata, models.CreateUserPrivateMetadataTypedDict]] = None, unsafe_metadata: Optional[Union[models.CreateUserUnsafeMetadata, models.CreateUserUnsafeMetadataTypedDict]] = None, + delete_self_enabled: OptionalNullable[bool] = UNSET, + legal_accepted_at: OptionalNullable[str] = UNSET, + skip_legal_checks: OptionalNullable[bool] = UNSET, + create_organization_enabled: OptionalNullable[bool] = UNSET, + create_organizations_limit: OptionalNullable[int] = UNSET, created_at: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -413,7 +435,7 @@ async def create_async( :param username: The username to give to the user. It must be unique across your instance. :param password: The plaintext password to give the user. Must be at least 8 characters long, and can not be in any list of hacked passwords. :param password_digest: In case you already have the password digests and not the passwords, you can use them for the newly created user via this property. The digests should be generated with one of the supported algorithms. The hashing algorithm can be specified using the `password_hasher` property. - :param password_hasher: The hashing algorithm that was used to generate the password digest. The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [sha256](https://en.wikipedia.org/wiki/SHA-2) and the [argon2](https://argon2.online/) variants argon2i and argon2id. If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. Insecure schemes are marked with `(insecure)` in the list below. Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: **bcrypt:** The digest should be of the following form: `$$$` **bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): `bcrypt_sha256$$$$` **md5** (insecure): The digest should follow the regular form e.g.: `5f4dcc3b5aa765d61d8327deb882cf99` **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: `pbkdf2_sha256$$$` Note: Both the salt and the hash are expected to be base64-encoded. **pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: `pbkdf2_sha512$$$` _iterations:_ The number of iterations used. Must be an integer less than 420000. _salt:_ The salt used when generating the hash. Must be less than 1024 bytes. _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): `pbkdf2_sha256$$$` Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: 1. uses sha1 instead of sha256 2. accepts the hash as a hex-encoded string The format is the following: `pbkdf2_sha1$$$` **phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: The format is the following: `$P$` - $P$ is the prefix used to identify phpass hashes. - rounds is a single character encoding a 6-bit integer representing the number of rounds used. - salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. - checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. **scrypt_firebase:** The Firebase-specific variant of scrypt. The value is expected to have 6 segments separated by the $ character and include the following information: _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. _signer key:_ The base64 encoded signer key. _salt separator:_ The base64 encoded salt separator. _rounds:_ The number of rounds the algorithm needs to run. _memory cost:_ The cost of the algorithm run The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: `$$$$$` **scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. The value is expected to have 3 segments separated by the $ character and include the following information: _algorithm args:_ The algorithm used to generate the hash. _salt:_ The salt used to generate the above hash. _hash:_ The actual Base64 hash. The algorithm args are the parameters used to generate the hash and are included in the digest. **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: _version (v):_ The argon version, version 19 is assumed _memory (m):_ The memory used by the algorithm (in kibibytes) _iterations (t):_ The number of iterations to perform _parallelism (p):_ The number of threads to use Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). The final part is the actual digest. `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` **argon2id:** See the previous algorithm for an explanation of the formatting. For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` **sha256** (insecure): The digest should be a 64-length hex string, e.g.: `9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` **sha256_salted** (insecure): The digest should be a 64-length hex string with a salt. The format is the following: `$` The value is expected to have 2 segments separated by the $ character and include the following information: _hash:_ The sha256 hash, a 64-length hex string. _salt:_ The salt used to generate the above hash. Must be between 1 and 1024 bits. + :param password_hasher: The hashing algorithm that was used to generate the password digest. The algorithms we support at the moment are [`bcrypt`](https://en.wikipedia.org/wiki/Bcrypt), [`bcrypt_sha256_django`](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [`md5`](https://en.wikipedia.org/wiki/MD5), `pbkdf2_sha1`, `pbkdf2_sha256`, [`pbkdf2_sha256_django`](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [`phpass`](https://www.openwall.com/phpass/), [`scrypt_firebase`](https://firebaseopensource.com/projects/firebase/scrypt/), [`scrypt_werkzeug`](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [`sha256`](https://en.wikipedia.org/wiki/SHA-2), and the [`argon2`](https://argon2.online/) variants: `argon2i` and `argon2id`. Each of the supported hashers expects the incoming digest to be in a particular format. See the [Clerk docs](https://clerk.com/docs/references/backend/user/create-user) for more information. :param skip_password_checks: When set to `true` all password checks are skipped. It is recommended to use this method only when migrating plaintext passwords to Clerk. Upon migration the user base should be prompted to pick stronger password. :param skip_password_requirement: When set to `true`, `password` is not required anymore when creating the user and can be omitted. This is useful when you are trying to create a user that doesn't have a password, in an instance that is using passwords. Please note that you cannot use this flag if password is the only way for a user to sign into your instance. :param totp_secret: In case TOTP is configured on the instance, you can provide the secret to enable it on the newly created user without the need to reset it. Please note that currently the supported options are: * Period: 30 seconds * Code length: 6 digits * Algorithm: SHA1 @@ -421,6 +443,11 @@ async def create_async( :param public_metadata: Metadata saved on the user, that is visible to both your Frontend and Backend APIs :param private_metadata: Metadata saved on the user, that is only visible to your Backend API :param unsafe_metadata: Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + :param delete_self_enabled: If enabled, user can delete themselves via FAPI. + :param legal_accepted_at: A custom timestamp denoting _when_ the user accepted legal requirements, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). + :param skip_legal_checks: When set to `true` all legal checks are skipped. It is not recommended to skip legal checks unless you are migrating a user to Clerk. + :param create_organization_enabled: If enabled, user can create organizations via FAPI. + :param create_organizations_limit: The maximum number of organizations the user can create. 0 means unlimited. :param created_at: A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -452,6 +479,11 @@ async def create_async( public_metadata=utils.get_pydantic_model(public_metadata, Optional[models.CreateUserPublicMetadata]), private_metadata=utils.get_pydantic_model(private_metadata, Optional[models.CreateUserPrivateMetadata]), unsafe_metadata=utils.get_pydantic_model(unsafe_metadata, Optional[models.CreateUserUnsafeMetadata]), + delete_self_enabled=delete_self_enabled, + legal_accepted_at=legal_accepted_at, + skip_legal_checks=skip_legal_checks, + create_organization_enabled=create_organization_enabled, + create_organizations_limit=create_organizations_limit, created_at=created_at, ) @@ -868,7 +900,7 @@ def update( profile_image_id: OptionalNullable[str] = UNSET, password: OptionalNullable[str] = UNSET, password_digest: Optional[str] = None, - password_hasher: Optional[models.UpdateUserPasswordHasher] = None, + password_hasher: Optional[str] = None, skip_password_checks: OptionalNullable[bool] = UNSET, sign_out_of_other_sessions: OptionalNullable[bool] = UNSET, totp_secret: Optional[str] = None, @@ -878,6 +910,9 @@ def update( unsafe_metadata: Optional[Union[models.UpdateUserUnsafeMetadata, models.UpdateUserUnsafeMetadataTypedDict]] = None, delete_self_enabled: OptionalNullable[bool] = UNSET, create_organization_enabled: OptionalNullable[bool] = UNSET, + legal_accepted_at: OptionalNullable[str] = UNSET, + skip_legal_checks: OptionalNullable[bool] = UNSET, + create_organizations_limit: OptionalNullable[int] = UNSET, created_at: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -910,7 +945,7 @@ def update( :param profile_image_id: The ID of the image to set as the user's profile image :param password: The plaintext password to give the user. Must be at least 8 characters long, and can not be in any list of hacked passwords. :param password_digest: In case you already have the password digests and not the passwords, you can use them for the newly created user via this property. The digests should be generated with one of the supported algorithms. The hashing algorithm can be specified using the `password_hasher` property. - :param password_hasher: The hashing algorithm that was used to generate the password digest. The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), [sha256](https://en.wikipedia.org/wiki/SHA-2), [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash) and the [argon2](https://argon2.online/) variants argon2i and argon2id. If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. Insecure schemes are marked with `(insecure)` in the list below. Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: **bcrypt:** The digest should be of the following form: `$$$` **bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): `bcrypt_sha256$$$$` **md5** (insecure): The digest should follow the regular form e.g.: `5f4dcc3b5aa765d61d8327deb882cf99` **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: `pbkdf2_sha256$$$` Note: Both the salt and the hash are expected to be base64-encoded. **pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: `pbkdf2_sha512$$$` _iterations:_ The number of iterations used. Must be an integer less than 420000. _salt:_ The salt used when generating the hash. Must be less than bytes. _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): `pbkdf2_sha256$$$` Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: 1. uses sha1 instead of sha256 2. accepts the hash as a hex-encoded string The format is the following: `pbkdf2_sha1$$$` **phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: The format is the following: `$P$` - $P$ is the prefix used to identify phpass hashes. - rounds is a single character encoding a 6-bit integer representing the number of rounds used. - salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. - checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. **scrypt_firebase:** The Firebase-specific variant of scrypt. The value is expected to have 6 segments separated by the $ character and include the following information: _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. _signer key:_ The base64 encoded signer key. _salt separator:_ The base64 encoded salt separator. _rounds:_ The number of rounds the algorithm needs to run. _memory cost:_ The cost of the algorithm run The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: `$$$$$` **scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. The value is expected to have 3 segments separated by the $ character and include the following information: _algorithm args:_ The algorithm used to generate the hash. _salt:_ The salt used to generate the above hash. _hash:_ The actual Base64 hash. The algorithm args are the parameters used to generate the hash and are included in the digest. **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: _version (v):_ The argon version, version 19 is assumed _memory (m):_ The memory used by the algorithm (in kibibytes) _iterations (t):_ The number of iterations to perform _parallelism (p):_ The number of threads to use Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). The final part is the actual digest. `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` **argon2id:** See the previous algorithm for an explanation of the formatting. For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` **sha256** (insecure): The digest should be a 64-length hex string, e.g.: `9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` + :param password_hasher: The hashing algorithm that was used to generate the password digest. The algorithms we support at the moment are [`bcrypt`](https://en.wikipedia.org/wiki/Bcrypt), [`bcrypt_sha256_django`](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [`md5`](https://en.wikipedia.org/wiki/MD5), `pbkdf2_sha1`, `pbkdf2_sha256`, [`pbkdf2_sha256_django`](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [`phpass`](https://www.openwall.com/phpass/), [`scrypt_firebase`](https://firebaseopensource.com/projects/firebase/scrypt/), [`scrypt_werkzeug`](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [`sha256`](https://en.wikipedia.org/wiki/SHA-2), and the [`argon2`](https://argon2.online/) variants: `argon2i` and `argon2id`. Each of the supported hashers expects the incoming digest to be in a particular format. See the [Clerk docs](https://clerk.com/docs/references/backend/user/create-user) for more information. :param skip_password_checks: Set it to `true` if you're updating the user's password and want to skip any password policy settings check. This parameter can only be used when providing a `password`. :param sign_out_of_other_sessions: Set to `true` to sign out the user from all their active sessions once their password is updated. This parameter can only be used when providing a `password`. :param totp_secret: In case TOTP is configured on the instance, you can provide the secret to enable it on the specific user without the need to reset it. Please note that currently the supported options are: * Period: 30 seconds * Code length: 6 digits * Algorithm: SHA1 @@ -920,6 +955,9 @@ def update( :param unsafe_metadata: Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. :param delete_self_enabled: If true, the user can delete themselves with the Frontend API. :param create_organization_enabled: If true, the user can create organizations with the Frontend API. + :param legal_accepted_at: A custom timestamps denoting _when_ the user accepted legal requirements, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). + :param skip_legal_checks: When set to `true` all legal checks are skipped. It is not recommended to skip legal checks unless you are migrating a user to Clerk. + :param create_organizations_limit: The maximum number of organizations the user can create. 0 means unlimited. :param created_at: A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -957,6 +995,9 @@ def update( unsafe_metadata=utils.get_pydantic_model(unsafe_metadata, Optional[models.UpdateUserUnsafeMetadata]), delete_self_enabled=delete_self_enabled, create_organization_enabled=create_organization_enabled, + legal_accepted_at=legal_accepted_at, + skip_legal_checks=skip_legal_checks, + create_organizations_limit=create_organizations_limit, created_at=created_at, ), ) @@ -1026,7 +1067,7 @@ async def update_async( profile_image_id: OptionalNullable[str] = UNSET, password: OptionalNullable[str] = UNSET, password_digest: Optional[str] = None, - password_hasher: Optional[models.UpdateUserPasswordHasher] = None, + password_hasher: Optional[str] = None, skip_password_checks: OptionalNullable[bool] = UNSET, sign_out_of_other_sessions: OptionalNullable[bool] = UNSET, totp_secret: Optional[str] = None, @@ -1036,6 +1077,9 @@ async def update_async( unsafe_metadata: Optional[Union[models.UpdateUserUnsafeMetadata, models.UpdateUserUnsafeMetadataTypedDict]] = None, delete_self_enabled: OptionalNullable[bool] = UNSET, create_organization_enabled: OptionalNullable[bool] = UNSET, + legal_accepted_at: OptionalNullable[str] = UNSET, + skip_legal_checks: OptionalNullable[bool] = UNSET, + create_organizations_limit: OptionalNullable[int] = UNSET, created_at: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -1068,7 +1112,7 @@ async def update_async( :param profile_image_id: The ID of the image to set as the user's profile image :param password: The plaintext password to give the user. Must be at least 8 characters long, and can not be in any list of hacked passwords. :param password_digest: In case you already have the password digests and not the passwords, you can use them for the newly created user via this property. The digests should be generated with one of the supported algorithms. The hashing algorithm can be specified using the `password_hasher` property. - :param password_hasher: The hashing algorithm that was used to generate the password digest. The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), [sha256](https://en.wikipedia.org/wiki/SHA-2), [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash) and the [argon2](https://argon2.online/) variants argon2i and argon2id. If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. Insecure schemes are marked with `(insecure)` in the list below. Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: **bcrypt:** The digest should be of the following form: `$$$` **bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): `bcrypt_sha256$$$$` **md5** (insecure): The digest should follow the regular form e.g.: `5f4dcc3b5aa765d61d8327deb882cf99` **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: `pbkdf2_sha256$$$` Note: Both the salt and the hash are expected to be base64-encoded. **pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: `pbkdf2_sha512$$$` _iterations:_ The number of iterations used. Must be an integer less than 420000. _salt:_ The salt used when generating the hash. Must be less than bytes. _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): `pbkdf2_sha256$$$` Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: 1. uses sha1 instead of sha256 2. accepts the hash as a hex-encoded string The format is the following: `pbkdf2_sha1$$$` **phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: The format is the following: `$P$` - $P$ is the prefix used to identify phpass hashes. - rounds is a single character encoding a 6-bit integer representing the number of rounds used. - salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. - checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. **scrypt_firebase:** The Firebase-specific variant of scrypt. The value is expected to have 6 segments separated by the $ character and include the following information: _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. _signer key:_ The base64 encoded signer key. _salt separator:_ The base64 encoded salt separator. _rounds:_ The number of rounds the algorithm needs to run. _memory cost:_ The cost of the algorithm run The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: `$$$$$` **scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. The value is expected to have 3 segments separated by the $ character and include the following information: _algorithm args:_ The algorithm used to generate the hash. _salt:_ The salt used to generate the above hash. _hash:_ The actual Base64 hash. The algorithm args are the parameters used to generate the hash and are included in the digest. **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: _version (v):_ The argon version, version 19 is assumed _memory (m):_ The memory used by the algorithm (in kibibytes) _iterations (t):_ The number of iterations to perform _parallelism (p):_ The number of threads to use Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). The final part is the actual digest. `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` **argon2id:** See the previous algorithm for an explanation of the formatting. For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` **sha256** (insecure): The digest should be a 64-length hex string, e.g.: `9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` + :param password_hasher: The hashing algorithm that was used to generate the password digest. The algorithms we support at the moment are [`bcrypt`](https://en.wikipedia.org/wiki/Bcrypt), [`bcrypt_sha256_django`](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [`md5`](https://en.wikipedia.org/wiki/MD5), `pbkdf2_sha1`, `pbkdf2_sha256`, [`pbkdf2_sha256_django`](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [`phpass`](https://www.openwall.com/phpass/), [`scrypt_firebase`](https://firebaseopensource.com/projects/firebase/scrypt/), [`scrypt_werkzeug`](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [`sha256`](https://en.wikipedia.org/wiki/SHA-2), and the [`argon2`](https://argon2.online/) variants: `argon2i` and `argon2id`. Each of the supported hashers expects the incoming digest to be in a particular format. See the [Clerk docs](https://clerk.com/docs/references/backend/user/create-user) for more information. :param skip_password_checks: Set it to `true` if you're updating the user's password and want to skip any password policy settings check. This parameter can only be used when providing a `password`. :param sign_out_of_other_sessions: Set to `true` to sign out the user from all their active sessions once their password is updated. This parameter can only be used when providing a `password`. :param totp_secret: In case TOTP is configured on the instance, you can provide the secret to enable it on the specific user without the need to reset it. Please note that currently the supported options are: * Period: 30 seconds * Code length: 6 digits * Algorithm: SHA1 @@ -1078,6 +1122,9 @@ async def update_async( :param unsafe_metadata: Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. :param delete_self_enabled: If true, the user can delete themselves with the Frontend API. :param create_organization_enabled: If true, the user can create organizations with the Frontend API. + :param legal_accepted_at: A custom timestamps denoting _when_ the user accepted legal requirements, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). + :param skip_legal_checks: When set to `true` all legal checks are skipped. It is not recommended to skip legal checks unless you are migrating a user to Clerk. + :param create_organizations_limit: The maximum number of organizations the user can create. 0 means unlimited. :param created_at: A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -1115,6 +1162,9 @@ async def update_async( unsafe_metadata=utils.get_pydantic_model(unsafe_metadata, Optional[models.UpdateUserUnsafeMetadata]), delete_self_enabled=delete_self_enabled, create_organization_enabled=create_organization_enabled, + legal_accepted_at=legal_accepted_at, + skip_legal_checks=skip_legal_checks, + create_organizations_limit=create_organizations_limit, created_at=created_at, ), ) @@ -2518,14 +2568,14 @@ def get_o_auth_access_token( http_res = self.do_request( hook_ctx=HookContext(operation_id="GetOAuthAccessToken", oauth2_scopes=[], security_source=self.sdk_configuration.security), request=req, - error_status_codes=["422","4XX","5XX"], + 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.ResponseBody]]) - if utils.match_response(http_res, "422", "application/json"): + 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"], "*"): @@ -2600,14 +2650,14 @@ async def get_o_auth_access_token_async( http_res = await self.do_request_async( hook_ctx=HookContext(operation_id="GetOAuthAccessToken", oauth2_scopes=[], security_source=self.sdk_configuration.security), request=req, - error_status_codes=["422","4XX","5XX"], + 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.ResponseBody]]) - if utils.match_response(http_res, "422", "application/json"): + 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"], "*"): @@ -2626,7 +2676,7 @@ def get_organization_memberships( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.UsersGetOrganizationMembershipsResponse: + ) -> Optional[models.OrganizationMemberships]: r"""Retrieve all memberships for a user Retrieve a paginated list of the user's organization memberships @@ -2688,30 +2738,9 @@ def get_organization_memberships( retry_config=retry_config ) - def next_func() -> Optional[models.UsersGetOrganizationMembershipsResponse]: - body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) - offset = request.offset if not request.offset is None else 0 - - if not http_res.text: - return None - results = JSONPath("$").parse(body) - if len(results) == 0 or len(results[0]) == 0: - return None - limit = request.limit if not request.limit is None else 0 - if len(results[0]) < limit: - return None - next_offset = offset + len(results[0]) - - return self.get_organization_memberships( - user_id=user_id, - limit=limit, - offset=next_offset, - retries=retries, - ) - data: Any = None if utils.match_response(http_res, "200", "application/json"): - return models.UsersGetOrganizationMembershipsResponse(result=utils.unmarshal_json(http_res.text, Optional[models.OrganizationMemberships]), next=next_func) + return utils.unmarshal_json(http_res.text, Optional[models.OrganizationMemberships]) if utils.match_response(http_res, "403", "application/json"): data = utils.unmarshal_json(http_res.text, models.ClerkErrorsData) raise models.ClerkErrors(data=data) @@ -2731,7 +2760,7 @@ async def get_organization_memberships_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.UsersGetOrganizationMembershipsResponse: + ) -> Optional[models.OrganizationMemberships]: r"""Retrieve all memberships for a user Retrieve a paginated list of the user's organization memberships @@ -2793,31 +2822,184 @@ async def get_organization_memberships_async( retry_config=retry_config ) - def next_func() -> Optional[models.UsersGetOrganizationMembershipsResponse]: - body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) - offset = request.offset if not request.offset is None else 0 + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[models.OrganizationMemberships]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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 get_organization_invitations( + self, *, + user_id: str, + limit: Optional[int] = 10, + offset: Optional[int] = 0, + status: Optional[models.UsersGetOrganizationInvitationsQueryParamStatus] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.OrganizationInvitationsWithPublicOrganizationData]: + r"""Retrieve all invitations for a user + + Retrieve a paginated list of the user's organization invitations - if not http_res.text: - return None - results = JSONPath("$").parse(body) - if len(results) == 0 or len(results[0]) == 0: - return None - limit = request.limit if not request.limit is None else 0 - if len(results[0]) < limit: - return None - next_offset = offset + len(results[0]) + :param user_id: The ID of the user whose organization invitations we want to retrieve + :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 organization invitations based on their status + :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 + """ + 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.UsersGetOrganizationInvitationsRequest( + user_id=user_id, + limit=limit, + offset=offset, + status=status, + ) + + req = self.build_request( + method="GET", + path="/users/{user_id}/organization_invitations", + 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", + 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 - return self.get_organization_memberships( - user_id=user_id, - limit=limit, - offset=next_offset, - retries=retries, - ) + 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="UsersGetOrganizationInvitations", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","403","404","4XX","5XX"], + retry_config=retry_config + ) data: Any = None if utils.match_response(http_res, "200", "application/json"): - return models.UsersGetOrganizationMembershipsResponse(result=utils.unmarshal_json(http_res.text, Optional[models.OrganizationMemberships]), next=next_func) - if utils.match_response(http_res, "403", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[models.OrganizationInvitationsWithPublicOrganizationData]) + 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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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_organization_invitations_async( + self, *, + user_id: str, + limit: Optional[int] = 10, + offset: Optional[int] = 0, + status: Optional[models.UsersGetOrganizationInvitationsQueryParamStatus] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.OrganizationInvitationsWithPublicOrganizationData]: + r"""Retrieve all invitations for a user + + Retrieve a paginated list of the user's organization invitations + + :param user_id: The ID of the user whose organization invitations we want to retrieve + :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 organization invitations based on their status + :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 + """ + 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.UsersGetOrganizationInvitationsRequest( + user_id=user_id, + limit=limit, + offset=offset, + status=status, + ) + + req = self.build_request( + method="GET", + path="/users/{user_id}/organization_invitations", + 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", + 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="UsersGetOrganizationInvitations", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","403","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.OrganizationInvitationsWithPublicOrganizationData]) + 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"], "*"): @@ -3319,3 +3501,959 @@ async def disable_mfa_async( 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 delete_backup_codes( + self, *, + user_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.DeleteBackupCodeResponseBody]: + r"""Disable all user's Backup codes + + Disable all of a user's backup codes. + + :param user_id: The ID of the user whose backup codes are to be deleted. + :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 + """ + 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.DeleteBackupCodeRequest( + user_id=user_id, + ) + + req = self.build_request( + method="DELETE", + path="/users/{user_id}/backup_code", + 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", + 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="DeleteBackupCode", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["404","4XX","500","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.DeleteBackupCodeResponseBody]) + if utils.match_response(http_res, ["404","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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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 delete_backup_codes_async( + self, *, + user_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.DeleteBackupCodeResponseBody]: + r"""Disable all user's Backup codes + + Disable all of a user's backup codes. + + :param user_id: The ID of the user whose backup codes are to be deleted. + :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 + """ + 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.DeleteBackupCodeRequest( + user_id=user_id, + ) + + req = self.build_request( + method="DELETE", + path="/users/{user_id}/backup_code", + 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", + 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="DeleteBackupCode", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["404","4XX","500","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.DeleteBackupCodeResponseBody]) + if utils.match_response(http_res, ["404","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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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 delete_passkey( + self, *, + user_id: str, + passkey_identification_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.DeletedObject]: + r"""Delete a user passkey + + Delete the passkey identification for a given user and notify them through email. + + :param user_id: The ID of the user that owns the passkey identity + :param passkey_identification_id: The ID of the passkey identity to be deleted + :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 + """ + 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.UserPasskeyDeleteRequest( + user_id=user_id, + passkey_identification_id=passkey_identification_id, + ) + + req = self.build_request( + method="DELETE", + path="/users/{user_id}/passkeys/{passkey_identification_id}", + 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", + 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="UserPasskeyDelete", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["403","404","4XX","500","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.DeletedObject]) + if utils.match_response(http_res, ["403","404","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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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 delete_passkey_async( + self, *, + user_id: str, + passkey_identification_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.DeletedObject]: + r"""Delete a user passkey + + Delete the passkey identification for a given user and notify them through email. + + :param user_id: The ID of the user that owns the passkey identity + :param passkey_identification_id: The ID of the passkey identity to be deleted + :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 + """ + 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.UserPasskeyDeleteRequest( + user_id=user_id, + passkey_identification_id=passkey_identification_id, + ) + + req = self.build_request( + method="DELETE", + path="/users/{user_id}/passkeys/{passkey_identification_id}", + 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", + 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="UserPasskeyDelete", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["403","404","4XX","500","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.DeletedObject]) + if utils.match_response(http_res, ["403","404","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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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 delete_web3_wallet( + self, *, + user_id: str, + web3_wallet_identification_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.DeletedObject]: + r"""Delete a user web3 wallet + + Delete the web3 wallet identification for a given user. + + :param user_id: The ID of the user that owns the web3 wallet + :param web3_wallet_identification_id: The ID of the web3 wallet identity to be deleted + :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 + """ + 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.UserWeb3WalletDeleteRequest( + user_id=user_id, + web3_wallet_identification_id=web3_wallet_identification_id, + ) + + req = self.build_request( + method="DELETE", + path="/users/{user_id}/web3_wallets/{web3_wallet_identification_id}", + 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", + 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="UserWeb3WalletDelete", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","403","404","4XX","500","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.DeletedObject]) + if utils.match_response(http_res, ["400","403","404","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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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 delete_web3_wallet_async( + self, *, + user_id: str, + web3_wallet_identification_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.DeletedObject]: + r"""Delete a user web3 wallet + + Delete the web3 wallet identification for a given user. + + :param user_id: The ID of the user that owns the web3 wallet + :param web3_wallet_identification_id: The ID of the web3 wallet identity to be deleted + :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 + """ + 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.UserWeb3WalletDeleteRequest( + user_id=user_id, + web3_wallet_identification_id=web3_wallet_identification_id, + ) + + req = self.build_request( + method="DELETE", + path="/users/{user_id}/web3_wallets/{web3_wallet_identification_id}", + 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", + 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="UserWeb3WalletDelete", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","403","404","4XX","500","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.DeletedObject]) + if utils.match_response(http_res, ["400","403","404","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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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_totp( + self, *, + user_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.Totp]: + r"""Create a TOTP for a user + + Creates a TOTP (Time-based One-Time Password) for a given user, returning both the TOTP secret and the URI. + + + :param user_id: The ID of the user for whom the TOTP is being created. + :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 + """ + 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.CreateUserTOTPRequest( + user_id=user_id, + ) + + req = self.build_request( + method="POST", + path="/users/{user_id}/totp", + 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", + 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="CreateUserTOTP", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["403","404","4XX","500","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.Totp]) + if utils.match_response(http_res, ["403","404","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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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_totp_async( + self, *, + user_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.Totp]: + r"""Create a TOTP for a user + + Creates a TOTP (Time-based One-Time Password) for a given user, returning both the TOTP secret and the URI. + + + :param user_id: The ID of the user for whom the TOTP is being created. + :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 + """ + 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.CreateUserTOTPRequest( + user_id=user_id, + ) + + req = self.build_request( + method="POST", + path="/users/{user_id}/totp", + 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", + 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="CreateUserTOTP", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["403","404","4XX","500","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.Totp]) + if utils.match_response(http_res, ["403","404","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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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 delete_totp( + self, *, + user_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.DeleteTOTPResponseBody]: + r"""Delete all the user's TOTPs + + Deletes all of the user's TOTPs. + + :param user_id: The ID of the user whose TOTPs are to be deleted + :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 + """ + 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.DeleteTOTPRequest( + user_id=user_id, + ) + + req = self.build_request( + method="DELETE", + path="/users/{user_id}/totp", + 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", + 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="DeleteTOTP", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["404","4XX","500","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.DeleteTOTPResponseBody]) + if utils.match_response(http_res, ["404","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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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 delete_totp_async( + self, *, + user_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.DeleteTOTPResponseBody]: + r"""Delete all the user's TOTPs + + Deletes all of the user's TOTPs. + + :param user_id: The ID of the user whose TOTPs are to be deleted + :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 + """ + 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.DeleteTOTPRequest( + user_id=user_id, + ) + + req = self.build_request( + method="DELETE", + path="/users/{user_id}/totp", + 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", + 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="DeleteTOTP", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["404","4XX","500","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.DeleteTOTPResponseBody]) + if utils.match_response(http_res, ["404","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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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 delete_external_account( + self, *, + user_id: str, + external_account_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.DeletedObject]: + r"""Delete External Account + + Delete an external account by ID. + + :param user_id: The ID of the user's external account + :param external_account_id: The ID of the external account to delete + :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 + """ + 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.DeleteExternalAccountRequest( + user_id=user_id, + external_account_id=external_account_id, + ) + + req = self.build_request( + method="DELETE", + path="/users/{user_id}/external_accounts/{external_account_id}", + 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", + 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="DeleteExternalAccount", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","403","404","4XX","500","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.DeletedObject]) + if utils.match_response(http_res, ["400","403","404","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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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 delete_external_account_async( + self, *, + user_id: str, + external_account_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[models.DeletedObject]: + r"""Delete External Account + + Delete an external account by ID. + + :param user_id: The ID of the user's external account + :param external_account_id: The ID of the external account to delete + :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 + """ + 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.DeleteExternalAccountRequest( + user_id=user_id, + external_account_id=external_account_id, + ) + + req = self.build_request( + method="DELETE", + path="/users/{user_id}/external_accounts/{external_account_id}", + 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", + 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="DeleteExternalAccount", oauth2_scopes=[], security_source=self.sdk_configuration.security), + request=req, + error_status_codes=["400","403","404","4XX","500","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.DeletedObject]) + if utils.match_response(http_res, ["400","403","404","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"], "*"): + raise models.SDKError("API error occurred", http_res.status_code, http_res.text, http_res) + + content_type = http_res.headers.get("Content-Type") + 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 cb02a96..bfb03d1 100644 --- a/src/clerk_backend_api/webhooks.py +++ b/src/clerk_backend_api/webhooks.py @@ -7,6 +7,9 @@ from typing import Any, Optional class Webhooks(BaseSDK): + r"""You can configure webhooks to be notified about various events that happen on your instance. + https://clerk.com/docs/integration/webhooks + """ def create_svix_app(